@lumenflow/cli 3.1.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/release.js +26 -7
- package/package.json +8 -7
package/dist/release.js
CHANGED
|
@@ -65,6 +65,14 @@ const CHANGESET_DIR = '.changeset';
|
|
|
65
65
|
const LUMENFLOW_FORCE_ENV = 'LUMENFLOW_FORCE';
|
|
66
66
|
/** Environment variable to provide reason for force bypass */
|
|
67
67
|
const LUMENFLOW_FORCE_REASON_ENV = 'LUMENFLOW_FORCE_REASON';
|
|
68
|
+
/** Release phase label for pre-release clean-tree validation */
|
|
69
|
+
const RELEASE_CLEAN_CHECK_PHASE_BEFORE_RELEASE = 'before release';
|
|
70
|
+
/** Release phase label for post-publish clean-tree validation */
|
|
71
|
+
const RELEASE_CLEAN_CHECK_PHASE_AFTER_PUBLISH = 'after npm publish';
|
|
72
|
+
/** Command shown when release fails due to dirty working tree */
|
|
73
|
+
const GIT_STATUS_SHORT_COMMAND = 'git status --short';
|
|
74
|
+
/** Guidance shown when generated artifacts dirty the repository */
|
|
75
|
+
const CLEAN_TREE_RECOVERY_GUIDANCE = 'Commit, stash, or clean generated files before retrying release.';
|
|
68
76
|
/**
|
|
69
77
|
* Environment variable for WU tool identification (WU-1296)
|
|
70
78
|
* Pre-push hook checks this to allow approved tool operations
|
|
@@ -101,6 +109,22 @@ export async function withReleaseEnv(fn) {
|
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Assert the current git working tree is clean.
|
|
114
|
+
*
|
|
115
|
+
* @param git - Git adapter with cleanliness check
|
|
116
|
+
* @param phase - Human-readable release phase label
|
|
117
|
+
*/
|
|
118
|
+
export async function assertWorkingTreeClean(git, phase) {
|
|
119
|
+
const isClean = await git.isClean();
|
|
120
|
+
if (isClean) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
die(`Working directory has uncommitted changes ${phase}.\n\n` +
|
|
124
|
+
`Run this command to inspect unexpected artifacts:\n` +
|
|
125
|
+
` ${GIT_STATUS_SHORT_COMMAND}\n` +
|
|
126
|
+
`${CLEAN_TREE_RECOVERY_GUIDANCE}`);
|
|
127
|
+
}
|
|
104
128
|
/**
|
|
105
129
|
* Validate that a string is a valid semver version
|
|
106
130
|
*
|
|
@@ -345,13 +369,7 @@ export async function main() {
|
|
|
345
369
|
const git = getGitForCwd();
|
|
346
370
|
await ensureOnMain(git);
|
|
347
371
|
// Check for uncommitted changes
|
|
348
|
-
|
|
349
|
-
if (!isClean) {
|
|
350
|
-
die(`Working directory has uncommitted changes.\n\n` +
|
|
351
|
-
`Commit or stash changes before releasing:\n` +
|
|
352
|
-
` git status\n` +
|
|
353
|
-
` git stash # or git commit`);
|
|
354
|
-
}
|
|
372
|
+
await assertWorkingTreeClean(git, RELEASE_CLEAN_CHECK_PHASE_BEFORE_RELEASE);
|
|
355
373
|
// Find all @lumenflow/* packages to update
|
|
356
374
|
const packagePaths = findPackageJsonPaths();
|
|
357
375
|
if (packagePaths.length === 0) {
|
|
@@ -443,6 +461,7 @@ export async function main() {
|
|
|
443
461
|
else {
|
|
444
462
|
console.log(`${LOG_PREFIX} Publishing packages to npm...`);
|
|
445
463
|
runCommand(`${PKG_MANAGER} -r publish --access public --no-git-checks`, { label: 'publish' });
|
|
464
|
+
await assertWorkingTreeClean(git, RELEASE_CLEAN_CHECK_PHASE_AFTER_PUBLISH);
|
|
446
465
|
console.log(`${LOG_PREFIX} ✅ Packages published to npm`);
|
|
447
466
|
}
|
|
448
467
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumenflow/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Command-line interface for LumenFlow workflow framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lumenflow",
|
|
@@ -178,12 +178,12 @@
|
|
|
178
178
|
"xstate": "^5.28.0",
|
|
179
179
|
"yaml": "^2.8.2",
|
|
180
180
|
"zod": "^4.3.6",
|
|
181
|
-
"@lumenflow/agent": "3.
|
|
182
|
-
"@lumenflow/
|
|
183
|
-
"@lumenflow/
|
|
184
|
-
"@lumenflow/
|
|
185
|
-
"@lumenflow/memory": "3.
|
|
186
|
-
"@lumenflow/
|
|
181
|
+
"@lumenflow/agent": "3.2.0",
|
|
182
|
+
"@lumenflow/initiatives": "3.2.0",
|
|
183
|
+
"@lumenflow/metrics": "3.2.0",
|
|
184
|
+
"@lumenflow/kernel": "3.2.0",
|
|
185
|
+
"@lumenflow/memory": "3.2.0",
|
|
186
|
+
"@lumenflow/core": "3.2.0"
|
|
187
187
|
},
|
|
188
188
|
"devDependencies": {
|
|
189
189
|
"@vitest/coverage-v8": "^4.0.18",
|
|
@@ -200,6 +200,7 @@
|
|
|
200
200
|
},
|
|
201
201
|
"scripts": {
|
|
202
202
|
"sync:bundled-packs": "node scripts/sync-bundled-packs.mjs",
|
|
203
|
+
"clean:bundled-packs": "node scripts/clean-bundled-packs.mjs",
|
|
203
204
|
"build": "tsc && node scripts/check-shebangs.mjs",
|
|
204
205
|
"build:dist:deps": "pnpm --filter @lumenflow/metrics build && pnpm --filter @lumenflow/kernel build && pnpm --filter @lumenflow/core build && pnpm --filter @lumenflow/memory build && pnpm --filter @lumenflow/agent build && pnpm --filter @lumenflow/initiatives build",
|
|
205
206
|
"build:dist": "pnpm run clean && pnpm run build:dist:deps && tsup && node scripts/fix-entry-points.mjs && node scripts/check-shebangs.mjs",
|