specweave 1.0.0-rc.2 → 1.0.1
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/README.md +6 -10
- package/dist/src/cli/helpers/init/external-import-grouping.d.ts.map +1 -1
- package/dist/src/cli/helpers/init/external-import-grouping.js +44 -8
- package/dist/src/cli/helpers/init/external-import-grouping.js.map +1 -1
- package/dist/src/cli/workers/clone-worker.d.ts +7 -0
- package/dist/src/cli/workers/clone-worker.d.ts.map +1 -1
- package/dist/src/cli/workers/clone-worker.js +49 -18
- package/dist/src/cli/workers/clone-worker.js.map +1 -1
- package/dist/src/config/types.d.ts +1208 -203
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/init/architecture/types.d.ts +140 -33
- package/dist/src/init/architecture/types.d.ts.map +1 -1
- package/dist/src/init/compliance/types.d.ts +27 -30
- package/dist/src/init/compliance/types.d.ts.map +1 -1
- package/dist/src/init/repo/types.d.ts +34 -11
- package/dist/src/init/repo/types.d.ts.map +1 -1
- package/dist/src/init/research/src/config/types.d.ts +82 -15
- package/dist/src/init/research/src/config/types.d.ts.map +1 -1
- package/dist/src/init/research/types.d.ts +93 -38
- package/dist/src/init/research/types.d.ts.map +1 -1
- package/dist/src/init/team/types.d.ts +42 -4
- package/dist/src/init/team/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugins/specweave/hooks/universal/hook-wrapper.cmd +26 -26
- package/plugins/specweave/hooks/universal/session-start.cmd +16 -16
- package/plugins/specweave/hooks/universal/session-start.ps1 +16 -16
- package/plugins/specweave-github/commands/clone.md +509 -0
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +738 -0
- package/plugins/specweave-kafka/package.json +1 -1
- package/plugins/specweave-release/commands/npm.md +129 -27
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +1107 -0
|
@@ -7,6 +7,44 @@ description: Bump patch version, auto-commit dirty changes, push to GitHub, buil
|
|
|
7
7
|
|
|
8
8
|
You are the NPM Release Assistant. Your job is to automate the patch version release process.
|
|
9
9
|
|
|
10
|
+
## CRITICAL: Prerelease Version Handling
|
|
11
|
+
|
|
12
|
+
**⚠️ NEVER use `npm version patch` on prerelease versions!**
|
|
13
|
+
|
|
14
|
+
`npm version patch` converts `1.0.0-rc.1` → `1.0.0` (WRONG!)
|
|
15
|
+
|
|
16
|
+
**CORRECT behavior:**
|
|
17
|
+
- `1.0.0-rc.1` → `1.0.0-rc.2` (increment prerelease)
|
|
18
|
+
- `1.0.0-beta.5` → `1.0.0-beta.6` (increment prerelease)
|
|
19
|
+
- `1.0.0` → `1.0.1` (increment patch - stable version)
|
|
20
|
+
|
|
21
|
+
**Use `--stable` flag ONLY when intentionally promoting to stable release!**
|
|
22
|
+
|
|
23
|
+
### Version Detection Algorithm
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Get current version
|
|
27
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
28
|
+
|
|
29
|
+
# Check if it's a prerelease (contains hyphen: 1.0.0-rc.1, 1.0.0-beta.2, etc.)
|
|
30
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
31
|
+
IS_PRERELEASE=true
|
|
32
|
+
else
|
|
33
|
+
IS_PRERELEASE=false
|
|
34
|
+
fi
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Version Bump Command Selection
|
|
38
|
+
|
|
39
|
+
| Current Version | Flag | Command | Result |
|
|
40
|
+
|-----------------|------|---------|--------|
|
|
41
|
+
| `1.0.0-rc.1` | (none) | `npm version prerelease` | `1.0.0-rc.2` |
|
|
42
|
+
| `1.0.0-rc.5` | `--stable` | `npm version patch` | `1.0.1` |
|
|
43
|
+
| `1.0.0` | (none) | `npm version patch` | `1.0.1` |
|
|
44
|
+
| `1.0.0` | `--stable` | `npm version patch` | `1.0.1` |
|
|
45
|
+
|
|
46
|
+
**Rule**: If prerelease AND no `--stable` flag → use `npm version prerelease`
|
|
47
|
+
|
|
10
48
|
## Command Modes
|
|
11
49
|
|
|
12
50
|
| Command | Flow | Use Case |
|
|
@@ -16,6 +54,7 @@ You are the NPM Release Assistant. Your job is to automate the patch version rel
|
|
|
16
54
|
| `/sw-release:npm --ci` | Bump → Push → **CI publishes** | Let GitHub Actions handle npm publish |
|
|
17
55
|
| `/sw-release:npm --only` | Bump → Build → **Publish locally** → NO push | Quick local release, push later |
|
|
18
56
|
| `/sw-release:npm --only --local` | **Bump ONLY** → NO build, NO publish, NO git | FASTEST: Local testing only |
|
|
57
|
+
| `/sw-release:npm --stable` | Same as default, but promotes prerelease to stable | **PROMOTE TO STABLE** |
|
|
19
58
|
|
|
20
59
|
## Detecting Mode
|
|
21
60
|
|
|
@@ -26,16 +65,18 @@ Check flags in the command invocation:
|
|
|
26
65
|
--ci → CI MODE: push to git, GitHub Actions publishes (requires clean working tree)
|
|
27
66
|
--only --local → Version bump ONLY (no build, no publish, no git) - FASTEST
|
|
28
67
|
--only → Direct publish to npm (bypass CI), no git push
|
|
68
|
+
--stable → Force promote prerelease to stable (use with any mode)
|
|
29
69
|
(no flags) → DEFAULT: INSTANT RELEASE (auto-commit, push, build, publish, push tag)
|
|
30
70
|
```
|
|
31
71
|
|
|
32
72
|
**Flag Detection Order:**
|
|
33
|
-
1. Check for `--
|
|
34
|
-
2. Check for `--
|
|
35
|
-
3. Check for `--
|
|
36
|
-
4.
|
|
37
|
-
5. If `--only`
|
|
38
|
-
6.
|
|
73
|
+
1. Check for `--stable` flag → Set PROMOTE_TO_STABLE=true (affects version bump command)
|
|
74
|
+
2. Check for `--quick` flag → QUICK MODE (save + local publish, NO GH workflow)
|
|
75
|
+
3. Check for `--ci` flag → CI MODE (GitHub Actions publishes)
|
|
76
|
+
4. Check for `--only` flag
|
|
77
|
+
5. If `--only` present, check for `--local` flag → LOCAL MODE (fastest)
|
|
78
|
+
6. If `--only` only → DIRECT MODE
|
|
79
|
+
7. No flags → **DEFAULT: INSTANT RELEASE** (auto-commit dirty, push, build, publish)
|
|
39
80
|
|
|
40
81
|
**If `--quick`**: Use QUICK MODE (section "Quick Mode Workflow")
|
|
41
82
|
**If `--ci`**: Use CI MODE (section "CI Mode Workflow")
|
|
@@ -104,11 +145,36 @@ git push origin develop
|
|
|
104
145
|
- ✅ No risk of "released but not pushed" state
|
|
105
146
|
- ✅ Clean recovery if anything fails mid-release
|
|
106
147
|
|
|
107
|
-
### 4. Bump
|
|
148
|
+
### 4. Smart Version Bump (Prerelease-Aware!)
|
|
149
|
+
|
|
150
|
+
**CRITICAL: Detect prerelease and bump correctly!**
|
|
108
151
|
|
|
109
152
|
```bash
|
|
110
|
-
|
|
111
|
-
|
|
153
|
+
# Get current version
|
|
154
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
155
|
+
echo "Current version: $CURRENT"
|
|
156
|
+
|
|
157
|
+
# Check if prerelease (contains hyphen like 1.0.0-rc.1, 1.0.0-beta.2)
|
|
158
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
159
|
+
echo "Detected PRERELEASE version"
|
|
160
|
+
# Check for --stable flag in command args
|
|
161
|
+
if [[ "--stable flag was passed" ]]; then
|
|
162
|
+
echo "Promoting to stable (--stable flag)"
|
|
163
|
+
npm version patch -m "chore: release stable version %s"
|
|
164
|
+
else
|
|
165
|
+
echo "Incrementing prerelease number"
|
|
166
|
+
npm version prerelease -m "chore: bump version to %s"
|
|
167
|
+
fi
|
|
168
|
+
else
|
|
169
|
+
echo "Detected STABLE version"
|
|
170
|
+
npm version patch -m "chore: bump version to %s"
|
|
171
|
+
fi
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Examples:**
|
|
175
|
+
- `1.0.0-rc.1` → `1.0.0-rc.2` (prerelease increment, DEFAULT)
|
|
176
|
+
- `1.0.0-rc.5` + `--stable` → `1.0.1` (promote to stable, EXPLICIT)
|
|
177
|
+
- `1.0.0` → `1.0.1` (patch increment)
|
|
112
178
|
|
|
113
179
|
This creates a NEW commit + tag locally.
|
|
114
180
|
|
|
@@ -215,10 +281,20 @@ git commit -m "[auto-generated message based on changed files]"
|
|
|
215
281
|
git push origin develop
|
|
216
282
|
```
|
|
217
283
|
|
|
218
|
-
### 4. Bump
|
|
284
|
+
### 4. Smart Version Bump (Prerelease-Aware!)
|
|
285
|
+
|
|
286
|
+
**CRITICAL: Same logic as Default Mode - detect prerelease!**
|
|
219
287
|
|
|
220
288
|
```bash
|
|
221
|
-
|
|
289
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
290
|
+
|
|
291
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
292
|
+
# Prerelease: bump prerelease number (1.0.0-rc.1 → 1.0.0-rc.2)
|
|
293
|
+
npm version prerelease -m "chore: bump version to %s"
|
|
294
|
+
else
|
|
295
|
+
# Stable: bump patch (1.0.0 → 1.0.1)
|
|
296
|
+
npm version patch -m "chore: bump version to %s"
|
|
297
|
+
fi
|
|
222
298
|
```
|
|
223
299
|
|
|
224
300
|
This creates a NEW commit + tag locally.
|
|
@@ -303,11 +379,18 @@ node -p "require('./package.json').version"
|
|
|
303
379
|
- Not on `develop` branch (ask user to switch)
|
|
304
380
|
- Uncommitted changes exist (ask user to commit first)
|
|
305
381
|
|
|
306
|
-
### 2. Bump
|
|
382
|
+
### 2. Smart Version Bump (Prerelease-Aware!)
|
|
307
383
|
|
|
308
384
|
```bash
|
|
309
|
-
|
|
310
|
-
|
|
385
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
386
|
+
|
|
387
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
388
|
+
# Prerelease: bump prerelease number
|
|
389
|
+
npm version prerelease -m "chore: bump version to %s"
|
|
390
|
+
else
|
|
391
|
+
# Stable: bump patch
|
|
392
|
+
npm version patch -m "chore: bump version to %s"
|
|
393
|
+
fi
|
|
311
394
|
```
|
|
312
395
|
|
|
313
396
|
### 3. Extract New Version
|
|
@@ -370,11 +453,18 @@ node -p "require('./package.json').version"
|
|
|
370
453
|
- Not on `develop` branch (ask user to switch)
|
|
371
454
|
- Uncommitted changes exist (ask user to commit first)
|
|
372
455
|
|
|
373
|
-
### 2.
|
|
456
|
+
### 2. Smart Version Bump (Prerelease-Aware!)
|
|
374
457
|
|
|
375
458
|
```bash
|
|
376
|
-
|
|
377
|
-
|
|
459
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
460
|
+
|
|
461
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
462
|
+
# Prerelease: bump prerelease number (1.0.0-rc.1 → 1.0.0-rc.2)
|
|
463
|
+
npm version prerelease -m "chore: bump version to %s"
|
|
464
|
+
else
|
|
465
|
+
# Stable: bump patch (1.0.0 → 1.0.1)
|
|
466
|
+
npm version patch -m "chore: bump version to %s"
|
|
467
|
+
fi
|
|
378
468
|
```
|
|
379
469
|
|
|
380
470
|
**What this does**:
|
|
@@ -473,15 +563,19 @@ Show the user:
|
|
|
473
563
|
|
|
474
564
|
# FASTEST: Version bump only (no publish, no git, no build)
|
|
475
565
|
/sw-release:npm --only --local
|
|
566
|
+
|
|
567
|
+
# PROMOTE prerelease to stable (1.0.0-rc.5 → 1.0.1)
|
|
568
|
+
/sw-release:npm --stable
|
|
476
569
|
```
|
|
477
570
|
|
|
478
|
-
| Scenario | Command |
|
|
479
|
-
|
|
480
|
-
| **INSTANT RELEASE** | (no flags) |
|
|
481
|
-
| **QUICK RELEASE** | `--quick` |
|
|
482
|
-
| CI release | `--ci` |
|
|
483
|
-
|
|
|
484
|
-
|
|
|
571
|
+
| Scenario | Command | Prerelease Handling | Git Pushed | Tag Pushed |
|
|
572
|
+
|----------|---------|---------------------|------------|------------|
|
|
573
|
+
| **INSTANT RELEASE** | (no flags) | `rc.1`→`rc.2` (smart) | ✅ Yes | ✅ Yes |
|
|
574
|
+
| **QUICK RELEASE** | `--quick` | `rc.1`→`rc.2` (smart) | ✅ Yes | ❌ No |
|
|
575
|
+
| CI release | `--ci` | `rc.1`→`rc.2` (smart) | ✅ Yes | ✅ Yes |
|
|
576
|
+
| Local publish | `--only` | `rc.1`→`rc.2` (smart) | ❌ No | ❌ No |
|
|
577
|
+
| Local bump | `--only --local` | `rc.1`→`rc.2` (smart) | ❌ No | ❌ No |
|
|
578
|
+
| **PROMOTE** | `--stable` | `rc.X`→`X.Y.Z+1` | ✅ Yes | ✅ Yes |
|
|
485
579
|
|
|
486
580
|
---
|
|
487
581
|
|
|
@@ -503,16 +597,24 @@ node -p "require('./package.json').version"
|
|
|
503
597
|
|
|
504
598
|
**NO git checks** - we're not committing or pushing anything!
|
|
505
599
|
|
|
506
|
-
### 2.
|
|
600
|
+
### 2. Smart Version Bump (NO git commit, NO tag)
|
|
507
601
|
|
|
508
602
|
```bash
|
|
509
|
-
|
|
510
|
-
|
|
603
|
+
CURRENT=$(node -p "require('./package.json').version")
|
|
604
|
+
|
|
605
|
+
if [[ "$CURRENT" == *"-"* ]]; then
|
|
606
|
+
# Prerelease: bump prerelease number (1.0.0-rc.1 → 1.0.0-rc.2)
|
|
607
|
+
npm version prerelease --no-git-tag-version
|
|
608
|
+
else
|
|
609
|
+
# Stable: bump patch (1.0.0 → 1.0.1)
|
|
610
|
+
npm version patch --no-git-tag-version
|
|
611
|
+
fi
|
|
511
612
|
```
|
|
512
613
|
|
|
513
614
|
**What this does**:
|
|
514
615
|
- Updates `package.json` version ONLY
|
|
515
616
|
- Updates `package-lock.json` version ONLY
|
|
617
|
+
- Respects prerelease versions!
|
|
516
618
|
- NO git commit created
|
|
517
619
|
- NO git tag created
|
|
518
620
|
- INSTANT (< 1 second)
|