Skip to content

Commit 5605194

Browse files
committed
chore: update to Node 22 LTS and improve CI/CD workflow
- Update CI to use Node.js 22 (LTS) only - Reorder CI steps: lint → build → typecheck → test - Configure release workflow to depend on CI success - Set all packages to private by default - Update test configuration to run from root - Update documentation with Node 22 requirement and publishing guide - Add workflow comments explaining behavior
1 parent 388d4f4 commit 5605194

File tree

5 files changed

+22
-17
lines changed

5 files changed

+22
-17
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
name: 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+
38
on:
49
workflow_run:
510
workflows: ["CI"]

README.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff 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

packages/core/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
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": {

packages/feature-a/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
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": {

packages/utils/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
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": {

0 commit comments

Comments
 (0)