Typescript guards library.
v4.9.0
npm install -g corepack@0.31.0
corepack enable
yarn installv20.9.0. Use NVM:
- nvm current - check current version of Node
- nvm list - show list of available Node versions
- nvm install - to install and use Node version.
- nvm use - set version of Node as current version
In the project directory, you can run:
Increments the major version in package.json and src/app/manifest.json.
For example, changes "version": "1.2.3" to "version": "2.0.0".
Increments the minor version in package.json and src/app/manifest.json.
For example, changes "version": "1.2.3" to "version": "1.3.0".
Increments the patch version in package.json and src/app/manifest.json.
For example, changes "version": "1.2.3" to "version": "1.2.4".
Automates the process of merging branches, increasing the major-version in the package.json file, and committing the changes to the designated branch. This ensures the version is updated consistently and the changes are easily trackable in the repository.
Automates the process of merging branches, increasing the minor-version in the package.json file, and committing the changes to the designated branch. This ensures the version is updated consistently and the changes are easily trackable in the repository.
Automates the process of merging branches, increasing the patch-version in the package.json file, and committing the changes to the designated branch. This ensures the version is updated consistently and the changes are easily trackable in the repository.
First removes the dist directory using rimraf to ensure a clean build environment and then compiles the TypeScript files using tsc.
Publishes the package with public access.
Formats all TypeScript files using Prettier.
Runs ESLint for static code analysis on TypeScript files.
Fixes errors found by ESLint in TypeScript files.
Runs unit tests using the Jest configuration.
Runs unit tests with coverage calculation option.
Runs unit tests with watch mode.
Generates comprehensive documentation using TypeDoc.
To enable automatic publishing of the package when changes are pushed to the main branch, follow these steps:
- Open your NPM package on https://npmjs.com -> Access Tokens
- Click "Generate New Token" -> "Classic Token", then choose Type -
Automation - Copy the generated token (you won’t be able to see it again!).
📘 See npm’s official docs for more info.
- Open your GitHub repository.
- Go to Settings → Secrets and variables → Actions.
- Click "New repository secret".
- Name it:
NPM_TOKEN - Paste the token value.
📘 See GitHub’s guide on encrypted secrets for details.
The GitHub Actions workflow will now use NPM_TOKEN to publish the package when version changes are pushed to main.
⚠️ Make sure to bump the version inpackage.jsonbefore pushing — otherwise, the workflow will fail due to version conflict.
-
run yarn update-version:patch (or :minor, :major)
-
create PR with message "[Common] Version increase vX.X.X" from "common/version-increase" into "develop"
-
create PR with message "Release vX.X.X" from "develop" into "main"
-
go to Github Repo Home page -> Tags -> Releases -> Draft a new release.
a) create a new tag via "Choose a tag" autocomplete
b) select "develop" branch as a target
c) click the "Generate release notes" button, remove unnecessary notes if necessary, check PR messages and correct the messages if necessary (via PR editing)
d) select "main" branch as a target
e) click the "Publish release"
-
check 'project-publish.yml' job result (Github Actions)
-
checkout "develop" and pull, then merge "main" into "develop" and push
-
update RELEASE-NOTES.md with using generated notes in step 4, create PR with from "common/release-notes-update-vX.X.X" to "develop" message "[Common] RELEASE-NOTES.md update vX.X.X"
Link to repository https://github.com/a1exevs/ts-guards.