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
fix(release): remove version script that caused recursive lerna invocation (#142)
The version script in package.json was triggered as a lifecycle hook
during `lerna version`, causing a recursive call that failed with
EUNCOMMIT error. Removed conflicting npm scripts (version, publish,
release) and updated documentation to reference workflow source files.
Introduced in #135.
Copy file name to clipboardExpand all lines: docs/PUBLISHING-SETUP.md
+25-2Lines changed: 25 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ Check that workflow can authenticate:
55
55
To publish packages manually from local machine:
56
56
57
57
1.**Environment Variables**:
58
-
-`NPM_TOKEN` - For npm authentication
58
+
-`NPM_TOKEN` - For npm authentication (or `NODE_AUTH_TOKEN`)
59
59
-`GH_TOKEN` - For creating GitHub releases
60
60
61
61
2.**Clean Working Tree**: No uncommitted changes
@@ -64,7 +64,30 @@ To publish packages manually from local machine:
64
64
65
65
4.**Tests Passing**: Run `npm test`
66
66
67
-
See: docs/agents/release.md for manual release workflow
67
+
### Manual Release Commands
68
+
69
+
Execute these commands in order:
70
+
71
+
```bash
72
+
# Set npm authentication (use NPM_TOKEN from environment)
73
+
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
74
+
75
+
# Build packages
76
+
npm run build
77
+
78
+
# Run tests
79
+
npm run test
80
+
81
+
# Version packages (creates git tags and GitHub releases)
82
+
npx lerna version --yes --no-private
83
+
84
+
# Publish to npm
85
+
npx lerna publish from-git --yes --no-private
86
+
```
87
+
88
+
**Important**: Do NOT create npm scripts named `version` or `publish` - these names conflict with npm lifecycle hooks and cause recursive execution issues.
89
+
90
+
See: docs/agents/release.md for more details on the release workflow
Copy file name to clipboardExpand all lines: docs/agents/release.md
+13-41Lines changed: 13 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,38 +10,15 @@ Publishing packages to npm using Lerna-Lite with conventional commits.
10
10
11
11
### Production Releases
12
12
13
-
Automatically triggered on:
13
+
Auto-triggered on push to main. Skipped when commit starts with `chore(release):` or no package changes.
14
14
15
-
- Push to main branch (after PR merge)
15
+
### Pre-release (Feature Branch)
16
16
17
-
Releases are SKIPPED when:
18
-
19
-
- Commit message starts with `chore(release):`
20
-
- No packages have changed since last release
21
-
- Only test/doc/config files changed (see lerna.json ignoreChanges)
22
-
23
-
### Feature Branch Releases (Pre-release)
24
-
25
-
Manually triggered via GitHub Actions workflow_dispatch.
26
-
27
-
Results:
28
-
29
-
- Pre-release version (e.g., `0.1.0-beta.0`)
30
-
- Custom dist-tag (auto-generated from branch name or specified)
31
-
- NO git tags or GitHub releases
32
-
- Does NOT affect `latest` npm dist-tag
33
-
34
-
**Note**: Pre-release version changes are NOT committed back to the branch. Each manual trigger increments the pre-release counter (`.0`, `.1`, `.2`, etc.).
17
+
Manual workflow_dispatch trigger. Creates pre-release version with custom dist-tag. NO git tags. Version changes NOT committed to branch.
35
18
36
19
### Pre-release Cleanup
37
20
38
-
When a PR is closed or merged, the cleanup workflow automatically:
39
-
40
-
- Removes the dist-tag from npm (e.g., `beta`, `feat-xyz`)
41
-
- Leaves published versions in npm (doesn't break existing users)
42
-
- Users can still install by exact version: `npm install @pkg@0.1.0-beta.0`
43
-
44
-
The dist-tag removal prevents new installations via `npm install @pkg@beta` while keeping the version available for existing users.
21
+
Auto-removes dist-tag when PR closed/merged. Published versions remain available.
45
22
46
23
## Version Bumping
47
24
@@ -59,25 +36,20 @@ Conventional commit types determine version bump:
59
36
60
37
### Production Release
61
38
62
-
Automatic on push to main (after PR merge). No manual action needed.
63
-
64
-
### Pre-release (Feature Branch Testing)
39
+
Automatic on push to main. No action needed.
65
40
66
-
Trigger manually via workflow_dispatch. Pre-release publishes to custom dist-tag.
41
+
### Pre-release (Feature Branch)
67
42
68
-
Requires maintain or admin repository access.
69
-
70
-
Options:
71
-
72
-
- Empty dist-tag input: auto-generates from branch name
73
-
- Specified dist-tag: uses provided value (must be valid npm dist-tag format)
74
-
- Dry-run: validates without publishing
43
+
Manual workflow_dispatch. Requires maintain/admin access. Dist-tag auto-generated from branch or specified.
75
44
76
45
### Manual/Emergency Release
77
46
78
-
For local releases when automation unavailable: build → test → version → publish
47
+
NEVER use npm scripts named `version` or `publish` - they conflict with npm lifecycle hooks.
48
+
49
+
Use npx lerna commands directly with `--yes` and `--no-private` flags.
79
50
80
-
See: `.github/workflows/release.yml` for workflow implementation
81
-
See: `docs/PUBLISHING-SETUP.md` for first-time configuration and manual release setup
51
+
See: `.github/workflows/release.yml` lines 172-173, 249 for production commands
52
+
See: `.github/workflows/release.yml` lines 192-197, 271-276 for pre-release commands
53
+
See: `docs/PUBLISHING-SETUP.md` for complete manual release procedure
82
54
See: `lerna.json` for Lerna configuration
83
55
See: `docs/agents/git.md` for commit message format
0 commit comments