-
Notifications
You must be signed in to change notification settings - Fork 325
Minimal Path to Awesome
The shortest way to prepare your local copy of the project for development and testing.
Before you start contributing to this project, you will need Node.js@20 and npm@10 installed.
- Fork this repository
- Clone your fork to your local machine
- In the root of the project, run the following commands in your command line:
-
npm i
: restore all dependencies of the project -
npm run build
: build the entire project -
npm link
: create a link/reference to your local project. This allows you to reference your locally installed CLI instead of the npm-hosted package.
-
If you installed the CLI globally using the
npm i -g @pnp/cli-microsoft365
command, we recommend that you uninstall it first, before runningnpm link
That's it! If you now run m365 version
you will see that you are now using the beta version of CLI for Microsoft 365 in your shell!
It doesn't really matter which IDE you are using. We recommend using Visual Studio Code. When using VS Code, the following extensions will come in handy:
Extension | Why is it useful? |
---|---|
Mocha Test Explorer | This extension will help you when writing tests. It is capable of running individual tests and debugging. You will also get a nice overview of all tests within the project. |
ESLint | We use ESLint to monitor consistency within the project. By installing this extension, you are notified of problems while writing code. |
CLI for Microsoft 365 comes with a set of commands that you will need during development.
Command | Description |
---|---|
npm run build |
Builds the entire project. |
npm run watch |
Builds the entire project first. After this, a watcher will make sure that every time a file is saved, an incremental build is triggered. This means that not the entire project is rebuilt but only the changed files. You typically use this command while developing. |
npm run clean |
Clean the output directory. All built files will be deleted. |
npm run test |
Run all tests, check all ESLint rules, ... This is a combination of npm run test:cov and npm run lint . This is what happens in our GitHub workflows when creating a PR. |
npm run test:cov |
Run all tests and create a coverage report. |
npm run test:test |
Run all tests. |
npm run lint |
Run all ESLint rules. |
CLI for Microsoft 365 uses Docusaurus to publish documentation pages.
After doing any kind of modifications to the docs it's always good to check them locally before submitting a PR. To run your local development server that will serve CLI for Microsoft 365 docs locally simply go to the /docs
folder and run
npm run start
For more information check out running the development server guide