You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It uses npm, TypeScript compiler, Jest, webpack, ESLint, Prettier. The production files include CommonJS, ES Modules, UMD version and TypeScript declaration files.
7
+
It uses npm, TypeScript compiler, Jest, webpack, ESLint, Prettier, husky, commitlint. The production files include CommonJS, ES Modules, UMD version and TypeScript declaration files.
@@ -54,6 +54,8 @@ Test your code with Jest framework:
54
54
npm run test
55
55
```
56
56
57
+
**Note:** Example TypeScript Package uses [husky](https://typicode.github.io/husky/) and [commitlint](https://commitlint.js.org/) to automatically execute test and [lint commit message](https://www.conventionalcommits.org/) before every commit.
58
+
57
59
### Build
58
60
59
61
Build production (distribution) files in your **dist** folder:
@@ -146,9 +148,11 @@ If you publish your package to npm only, and don't want to publish to GitHub Pac
146
148
Now everything is set. The example package has automated tests and upload (publishing) already set up with GitHub Actions:
147
149
148
150
- Every time you `git push` or a pull request is submitted on your `master` or `main` branch, the package is automatically tested against the desired OS and Node.js versions with GitHub Actions.
149
-
- Every time a new release (either the initial version or an updated version) is created, the latest version of the package is automatically published to npm and/or GitHub Packages registry with GitHub Actions.
151
+
- Every time an [**annotated**](https://git-scm.com/book/en/v2/Git-Basics-Tagging#_annotated_tags) (not [lightweight](https://git-scm.com/book/en/v2/Git-Basics-Tagging#_lightweight_tags)) "v*" tag is pushed onto GitHub, a GitHub release is automatically generated from this version, it also automatically publishes to the npm registry and/or GitHub Packages registry to update the package there.
152
+
-[`npm version`](https://docs.npmjs.com/cli/v6/commands/npm-version) / [`yarn version`](https://yarnpkg.com/cli/version) is useful to create tags.
153
+
- You could also add `"postversion": "git push --follow-tags"` to **package.json** file to push it automatically after `npm` or `yarn``version`. (for `yarn version` only: because `yarn version` doesn't check whether there are uncommitted changes, you can add `"preversion": "git diff-index --quiet HEAD --"` to **package.json**)
150
154
151
-
Apparently, you have to change the version number in order to publish a new version to the registries. You can unpublish a version or the whole package but can never re-publish the same version under the same name.
155
+
For npm registry: you can unpublish a version or the whole package but can never re-publish the same version under the same name.
152
156
153
157
If you want to modify the description / README on the npm package page, you have to publish a new version. You can modify the description on GitHub Packages without publishing.
0 commit comments