- Install the latest Node JS@^17.4.0 and Yarn and simply run
yarn install
command in the project directory. - Install Yeoman's command line utility,
yo
.
To test your generator, link your package with yarn link <YOUR_GENERATOR_DIR>
and run yo [generator-name]
(where 'generator-name' is your defined Yeoman generator name. For instance, by default the boilerplate provided name: example-generator
)
For more details, visit Yeoman's authoring guide for creating a generator.
yarn add <package-name> --dev # for dev tools, story dependencies, libraries to be bundled
yarn add <package-name> [--peer] # for external dependencies
Note: All packages are installed using the PnP strategy by default. To see advantages, visit the official Yarn docs. Some tools however, such as Flow, are not compatible with the PnP resolution strategy. In order to circumvent you can opt out by installing non PnP configurations as a seperate Yarn project. For example, see Static Types.
yarn flow-typed-install # clean & install flow definitions from dependencies and peerDependencies
yarn flow-typed-update # downloads and updates new flow definitions
cd shared/flow-deps && yarn install <package-name> # install any node modules that flow cannot resolve with PnP strategy
yarn flow-typed-create-stub <package-name> # create a flow-typed stub for a package name into shared/flow-typed/npm
Note: Since the shared/flow-typed/npm is ignored, it is best to move the stub file so it can be committed.
yarn flow # performs type checking on files
yarn lint # runs linter to detect any style issues (css & js)
yarn lint:css # lint only css
yarn lint:js # lint only js
yarn lint:js --fix # attempts to fix js lint issues
yarn test # runs functional/unit tests