- Initialize and set upstream or clone the monorepo
- In monorepo directory:
$ npm install --save lerna
- Installs and saves lerna as a dependency for the project
- Use npm registry ->
$ npm config set registry https://registry.npmjs.org/
- Use npm registry ->
$ lerna init --independent
- Initialize lerna with independent package versioning (vs. project versioning)
- In the packages directory:
$ lerna create @scope/package-name
- Example:
@psu-ooe/wc-package
- This command also creates
lib/
and__tests__/
in package directory -- may or may not be an option to turn this off, as well as set default "main" attribute.
- Example:
- Make sure the resistry in the newly created packed directory is github packages
- Add files to new package
- Commit and push changes
$ npm login --registry=https://npm.pkg.github.com --scope=@scope
- Uses personal access token, see more about token creation here (GitHub Docs) and here (brief of token package permissions)
$ lerna version [major | minor | patch | premajor | preminor | prepatch | prerelease]
- If the
--no-git-tag-version
options is used for lerna version, lerna will neither tag the release NOR commit the new package.json with updated version - Any prerelease identifier can be used and incremented (ex: 1.0.0-dev.0 to 1.0.0-dev.1)
- If the
$ lerna publish from-git
- Will call
lerna version
(looking for a way to easily publish without incrementing version) - These last two commands are what we will use for GitHub Actions
- Will call
publishConfig:
"access"?- Include
publishConfig:"registry"
inlerna create