File tree Expand file tree Collapse file tree 5 files changed +22
-17
lines changed
Expand file tree Collapse file tree 5 files changed +22
-17
lines changed Original file line number Diff line number Diff line change 11name : Release
22
3+ # This workflow runs after CI succeeds on the main branch.
4+ # By default, all packages are private and won't be published to npm.
5+ # To enable publishing: set "private": false in package.json and add NPM_TOKEN secret.
6+ # See README.md for detailed setup instructions.
7+
38on :
49 workflow_run :
510 workflows : ["CI"]
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ ts-monorepo/
3838
3939### Prerequisites
4040
41- - [ Node.js] ( https://nodejs.org/ ) (v18 or higher)
41+ - [ Node.js] ( https://nodejs.org/ ) (v22 LTS or higher)
4242- [ PNPM] ( https://pnpm.io/ ) (v8 or higher)
4343
4444### Installation
@@ -122,11 +122,20 @@ Releasing is handled automatically through GitHub Actions when changes are merge
122122
123123#### Setting Up npm Publishing
124124
125- To enable npm publishing:
125+ By default, all packages are marked as ` "private": true ` to prevent accidental publishing. To publish packages to npm :
126126
127- 1 . Generate an npm access token with publish permissions
128- 2 . Add the token as a repository secret named ` NPM_TOKEN ` in GitHub
129- 3 . Ensure your packages have unique names in the npm registry
127+ 1 . In the package's ` package.json ` , change ` "private": true ` to ` "private": false `
128+ 2 . Add a ` publishConfig ` section:
129+ ``` json
130+ "publishConfig" : {
131+ "access" : " public"
132+ }
133+ ```
134+ 3 . Generate an npm access token with publish permissions from [ npmjs.com] ( https://www.npmjs.com/settings/~/tokens )
135+ 4 . Add the token as a repository secret named ` NPM_TOKEN ` in GitHub (Settings → Secrets and variables → Actions)
136+ 5 . Ensure your package names are unique in the npm registry or use a scoped package name
137+
138+ ** Note:** The release workflow only runs after the CI workflow succeeds on the ` main ` branch.
130139
131140## Working with this Monorepo
132141
Original file line number Diff line number Diff line change 11{
22 "name" : " @monorepo/core" ,
33 "version" : " 0.1.0" ,
4- "private" : false ,
5- "publishConfig" : {
6- "access" : " public"
7- },
4+ "private" : true ,
85 "main" : " ./dist/index.js" ,
96 "types" : " ./dist/index.d.ts" ,
107 "exports" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @monorepo/feature-a" ,
33 "version" : " 0.1.0" ,
4- "private" : false ,
5- "publishConfig" : {
6- "access" : " public"
7- },
4+ "private" : true ,
85 "main" : " ./dist/index.js" ,
96 "types" : " ./dist/index.d.ts" ,
107 "exports" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " @monorepo/utils" ,
33 "version" : " 0.1.0" ,
4- "private" : false ,
5- "publishConfig" : {
6- "access" : " public"
7- },
4+ "private" : true ,
85 "main" : " ./dist/index.js" ,
96 "types" : " ./dist/index.d.ts" ,
107 "exports" : {
You can’t perform that action at this time.
0 commit comments