Install dependencies
-
Fork and clone this repo.
git clone git@github.com:<your-github-handle>/cp-validations.git
-
Change directory.
cd cp-validations -
Use
pnpmto install dependencies.pnpm install
Run the demo app
-
Once dependencies have been installed, you can run the demo app.
# From the workspace root pnpm start -
Open the app at http://localhost:4200.
Check and fix errors
-
As you write code, please check that it meets formatting and linting rules.
# From the workspace root pnpm lint -
You can run
lint:fixto fix errors.# From the workspace root pnpm lint:fix
Run tests
-
When you write code, please check that all tests continue to pass.
# From the workspace root pnpm test
Add changeset to pull request
-
To record how a pull request affects packages, you will want to add a changeset.
The changeset provides a summary of the code change. It also describes how package versions should be updated (major, minor, or patch) as a result of the code change.
# From the workspace root pnpm changeset
Publish packages (for admins)
-
Generate a personal access token in GitHub. This token will be used to retrieve pull request information.
-
Run the
release:preparescript. This removes changesets, updates package versions, and updatesCHANGELOGs.# From the workspace root GITHUB_TOKEN=<YOUR_PERSONAL_ACCESS_TOKEN> pnpm release:prepare
Note,
release:preparealso updated the workspace root's version (e.g. from0.1.1to0.1.2). We will use it to name the tag that will be published. -
Review the file changes. Commit them in a branch, then open a pull request to merge the changes to the
mainbranch.# From the workspace root git checkout -b tag-0.1.2 git add . git commit -m "Tagged 0.1.2" git push origin tag-0.1.2
-
Create a tag and provide release notes. The tag name should match the workspace root's version (e.g.
0.1.2). -
Once the tag is created, the package is published to npm using trusted publishing.