specweave 1.0.520 → 1.0.522
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/.claude-plugin/README.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +1 -1
- package/bin/specweave.js +8 -8
- package/dist/plugins/specweave/lib/integrations/github/duplicate-detector.js +6 -6
- package/dist/plugins/specweave/lib/integrations/github/duplicate-detector.js.map +1 -1
- package/dist/plugins/specweave/lib/integrations/github/github-ac-comment-poster.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/integrations/github/github-ac-comment-poster.js +34 -9
- package/dist/plugins/specweave/lib/integrations/github/github-ac-comment-poster.js.map +1 -1
- package/dist/plugins/specweave/lib/integrations/github/github-body-utils.d.ts +38 -0
- package/dist/plugins/specweave/lib/integrations/github/github-body-utils.d.ts.map +1 -0
- package/dist/plugins/specweave/lib/integrations/github/github-body-utils.js +50 -0
- package/dist/plugins/specweave/lib/integrations/github/github-body-utils.js.map +1 -0
- package/dist/plugins/specweave/lib/integrations/github/github-feature-sync.d.ts +0 -2
- package/dist/plugins/specweave/lib/integrations/github/github-feature-sync.d.ts.map +1 -1
- package/dist/plugins/specweave/lib/integrations/github/github-feature-sync.js +194 -173
- package/dist/plugins/specweave/lib/integrations/github/github-feature-sync.js.map +1 -1
- package/dist/src/adapters/codex/README.md +1 -1
- package/dist/src/adapters/gemini/README.md +1 -1
- package/dist/src/cli/commands/complete.d.ts +10 -7
- package/dist/src/cli/commands/complete.d.ts.map +1 -1
- package/dist/src/cli/commands/complete.js +60 -14
- package/dist/src/cli/commands/complete.js.map +1 -1
- package/dist/src/cli/commands/create-increment.d.ts.map +1 -1
- package/dist/src/cli/commands/create-increment.js +2 -10
- package/dist/src/cli/commands/create-increment.js.map +1 -1
- package/dist/src/cli/commands/evaluate-completion.d.ts.map +1 -1
- package/dist/src/cli/commands/evaluate-completion.js +8 -38
- package/dist/src/cli/commands/evaluate-completion.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +25 -0
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/save.js +1 -1
- package/dist/src/cli/commands/save.js.map +1 -1
- package/dist/src/cli/commands/sync-progress.d.ts.map +1 -1
- package/dist/src/cli/commands/sync-progress.js +10 -0
- package/dist/src/cli/commands/sync-progress.js.map +1 -1
- package/dist/src/cli/helpers/init/claude-settings-lsp.js +1 -1
- package/dist/src/cli/helpers/init/claude-settings-lsp.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts +1 -8
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +57 -88
- package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/github.js +1 -3
- package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -1
- package/dist/src/core/increment/completion-validator.d.ts.map +1 -1
- package/dist/src/core/increment/completion-validator.js +2 -3
- package/dist/src/core/increment/completion-validator.js.map +1 -1
- package/dist/src/core/increment/increment-utils.d.ts +7 -7
- package/dist/src/core/increment/increment-utils.d.ts.map +1 -1
- package/dist/src/core/increment/increment-utils.js +19 -13
- package/dist/src/core/increment/increment-utils.js.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.js +9 -0
- package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts +3 -17
- package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
- package/dist/src/core/repo-structure/prompt-consolidator.js +1 -55
- package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +3 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/repo-structure/setup-state-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/setup-state-manager.js +2 -1
- package/dist/src/core/repo-structure/setup-state-manager.js.map +1 -1
- package/dist/src/core/repo-structure/setup-summary.js +1 -1
- package/dist/src/core/repo-structure/setup-summary.js.map +1 -1
- package/dist/src/core/sync-throttle.d.ts +49 -0
- package/dist/src/core/sync-throttle.d.ts.map +1 -0
- package/dist/src/core/sync-throttle.js +94 -0
- package/dist/src/core/sync-throttle.js.map +1 -0
- package/dist/src/dashboard/server/dashboard-server.js +1 -1
- package/dist/src/dashboard/server/dashboard-server.js.map +1 -1
- package/dist/src/hooks/auto-create-external-issue.js +11 -0
- package/dist/src/hooks/auto-create-external-issue.js.map +1 -1
- package/dist/src/init/InitFlow.d.ts.map +1 -1
- package/dist/src/init/InitFlow.js +4 -8
- package/dist/src/init/InitFlow.js.map +1 -1
- package/dist/src/init/research/src/config/ConfigManager.js +1 -1
- package/dist/src/init/research/src/config/ConfigManager.js.map +1 -1
- package/dist/src/init/research/src/config/types.d.ts +0 -1
- package/dist/src/init/research/src/config/types.d.ts.map +1 -1
- package/dist/src/init/research/src/config/types.js +1 -1
- package/dist/src/init/research/src/config/types.js.map +1 -1
- package/dist/src/locales/de/cli.json +1 -1
- package/dist/src/locales/en/cli.json +1 -1
- package/dist/src/locales/es/cli.json +1 -1
- package/dist/src/locales/fr/cli.json +1 -1
- package/dist/src/locales/ja/cli.json +1 -1
- package/dist/src/locales/ko/cli.json +1 -1
- package/dist/src/locales/pt/cli.json +1 -1
- package/dist/src/locales/ru/cli.json +1 -1
- package/dist/src/locales/zh/cli.json +1 -1
- package/dist/src/utils/resolve-increment-id.d.ts +24 -0
- package/dist/src/utils/resolve-increment-id.d.ts.map +1 -0
- package/dist/src/utils/resolve-increment-id.js +53 -0
- package/dist/src/utils/resolve-increment-id.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +2 -2
- package/plugins/specweave/commands/import-external.md +4 -4
- package/plugins/specweave/lib/integrations/github/duplicate-detector.js +1 -1
- package/plugins/specweave/lib/integrations/github/duplicate-detector.ts +6 -6
- package/plugins/specweave/lib/integrations/github/github-ac-comment-poster.js +39 -13
- package/plugins/specweave/lib/integrations/github/github-ac-comment-poster.ts +43 -13
- package/plugins/specweave/lib/integrations/github/github-body-utils.js +15 -0
- package/plugins/specweave/lib/integrations/github/github-body-utils.ts +52 -0
- package/plugins/specweave/lib/integrations/github/github-feature-sync.js +160 -136
- package/plugins/specweave/lib/integrations/github/github-feature-sync.ts +49 -29
- package/plugins/specweave/skills/increment/SKILL.md +45 -88
- package/plugins/specweave/skills/team-lead/SKILL.md +68 -4
- package/scripts/check-node-version.js +1 -1
- package/src/templates/lsp-plugin/plugin.json +1 -1
- package/dist/src/core/migration/consolidation-engine.d.ts +0 -59
- package/dist/src/core/migration/consolidation-engine.d.ts.map +0 -1
- package/dist/src/core/migration/consolidation-engine.js +0 -177
- package/dist/src/core/migration/consolidation-engine.js.map +0 -1
- package/dist/src/core/migration/spec-project-mapper.d.ts +0 -51
- package/dist/src/core/migration/spec-project-mapper.d.ts.map +0 -1
- package/dist/src/core/migration/spec-project-mapper.js +0 -299
- package/dist/src/core/migration/spec-project-mapper.js.map +0 -1
- package/dist/src/core/migration/types.d.ts +0 -132
- package/dist/src/core/migration/types.d.ts.map +0 -1
- package/dist/src/core/migration/types.js +0 -10
- package/dist/src/core/migration/types.js.map +0 -1
- package/dist/src/core/migration/umbrella-migrator.d.ts +0 -58
- package/dist/src/core/migration/umbrella-migrator.d.ts.map +0 -1
- package/dist/src/core/migration/umbrella-migrator.js +0 -617
- package/dist/src/core/migration/umbrella-migrator.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-project-mapper.d.ts","sourceRoot":"","sources":["../../../../src/core/migration/spec-project-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB;AAMD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAkDhC;AAMD;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACjC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,cAAc,EAAE,CAAC,CAuC3B;AAMD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EAAE,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAoCf"}
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Spec Project Mapper
|
|
3
|
-
*
|
|
4
|
-
* Maps FS-XXX feature spec folders to their owning project(s) by scanning
|
|
5
|
-
* increment metadata and spec.md **Project**: fields. Used by the
|
|
6
|
-
* --reorganize-specs flag of migrate-to-umbrella.
|
|
7
|
-
*
|
|
8
|
-
* @module core/migration/spec-project-mapper
|
|
9
|
-
*/
|
|
10
|
-
import * as fs from 'fs';
|
|
11
|
-
import * as path from 'path';
|
|
12
|
-
// ---------------------------------------------------------------------------
|
|
13
|
-
// buildFeatureProjectMap
|
|
14
|
-
// ---------------------------------------------------------------------------
|
|
15
|
-
/**
|
|
16
|
-
* Builds a map of FS-XXX feature IDs to their owning project(s).
|
|
17
|
-
*
|
|
18
|
-
* Strategy:
|
|
19
|
-
* 1. Scan all increments for feature_id in metadata.json (explicit link)
|
|
20
|
-
* 2. Fall back to numeric matching: FS-282 → glob 0282-*
|
|
21
|
-
* 3. Parse increment spec.md for **Project**: lines
|
|
22
|
-
* 4. Default to current project folder name when no Project field found
|
|
23
|
-
*
|
|
24
|
-
* @param projectRoot - Root of the umbrella workspace
|
|
25
|
-
* @returns Map of featureId (e.g. "FS-282") to project IDs (e.g. ["vskill-platform"])
|
|
26
|
-
*/
|
|
27
|
-
export async function buildFeatureProjectMap(projectRoot) {
|
|
28
|
-
const specweavePath = path.join(projectRoot, '.specweave');
|
|
29
|
-
const incrementsDir = path.join(specweavePath, 'increments');
|
|
30
|
-
const specsBaseDir = path.join(specweavePath, 'docs', 'internal', 'specs');
|
|
31
|
-
// Discover existing FS-XXX folders across all project subdirs
|
|
32
|
-
const featureIds = await discoverFeatureIds(specsBaseDir);
|
|
33
|
-
if (featureIds.length === 0) {
|
|
34
|
-
return new Map();
|
|
35
|
-
}
|
|
36
|
-
// Build increment index: numeric prefix → increment dir name
|
|
37
|
-
const incrementIndex = await buildIncrementIndex(incrementsDir);
|
|
38
|
-
// Build feature_id → increment dir name from metadata
|
|
39
|
-
const metadataIndex = await buildMetadataIndex(incrementsDir);
|
|
40
|
-
const result = new Map();
|
|
41
|
-
for (const featureId of featureIds) {
|
|
42
|
-
// Extract numeric part: FS-282 → 282
|
|
43
|
-
const numericPart = featureId.replace('FS-', '');
|
|
44
|
-
// Try metadata feature_id first, then numeric match
|
|
45
|
-
let incrementDirName = metadataIndex.get(featureId);
|
|
46
|
-
if (!incrementDirName) {
|
|
47
|
-
// Pad to 4 digits for matching: 282 → 0282
|
|
48
|
-
const padded = numericPart.padStart(4, '0');
|
|
49
|
-
incrementDirName = incrementIndex.get(padded);
|
|
50
|
-
}
|
|
51
|
-
if (!incrementDirName) {
|
|
52
|
-
// No matching increment — default to current project
|
|
53
|
-
result.set(featureId, [detectCurrentProject(specsBaseDir)]);
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
// Parse spec.md for **Project**: fields
|
|
57
|
-
const specPath = path.join(incrementsDir, incrementDirName, 'spec.md');
|
|
58
|
-
const projects = await parseProjectFields(specPath);
|
|
59
|
-
if (projects.length === 0) {
|
|
60
|
-
result.set(featureId, [detectCurrentProject(specsBaseDir)]);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// Deduplicate
|
|
64
|
-
result.set(featureId, [...new Set(projects)]);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return result;
|
|
68
|
-
}
|
|
69
|
-
// ---------------------------------------------------------------------------
|
|
70
|
-
// generateReorganizationPlan
|
|
71
|
-
// ---------------------------------------------------------------------------
|
|
72
|
-
/**
|
|
73
|
-
* Generates a list of move/copy operations to reorganize FS-XXX folders
|
|
74
|
-
* from a centralized project directory to per-project directories.
|
|
75
|
-
*
|
|
76
|
-
* @param featureMap - Map from buildFeatureProjectMap()
|
|
77
|
-
* @param specsDir - Path to .specweave/docs/internal/specs/
|
|
78
|
-
* @param currentProject - Name of the current (centralized) project folder
|
|
79
|
-
* @returns List of move/copy operations
|
|
80
|
-
*/
|
|
81
|
-
export async function generateReorganizationPlan(featureMap, specsDir, currentProject) {
|
|
82
|
-
const ops = [];
|
|
83
|
-
for (const [featureId, targetProjects] of featureMap) {
|
|
84
|
-
const sourcePath = path.join(specsDir, currentProject, featureId);
|
|
85
|
-
const sourceExists = fs.existsSync(sourcePath);
|
|
86
|
-
// Source must exist under the current project to move/copy
|
|
87
|
-
if (!sourceExists)
|
|
88
|
-
continue;
|
|
89
|
-
// If one of the targets IS the current project, keep the original in place
|
|
90
|
-
// and copy to all other targets. Otherwise, move to first and copy to rest.
|
|
91
|
-
const staysInPlace = targetProjects.includes(currentProject);
|
|
92
|
-
let firstNonCurrent = true;
|
|
93
|
-
for (const targetProject of targetProjects) {
|
|
94
|
-
const destPath = path.join(specsDir, targetProject, featureId);
|
|
95
|
-
// Skip if target is current project (already in place)
|
|
96
|
-
if (targetProject === currentProject)
|
|
97
|
-
continue;
|
|
98
|
-
// Skip if destination already exists (idempotency)
|
|
99
|
-
if (fs.existsSync(destPath))
|
|
100
|
-
continue;
|
|
101
|
-
// If the original stays in place, all other targets are copies.
|
|
102
|
-
// If the original doesn't stay, the first non-current target gets a move.
|
|
103
|
-
const isMove = !staysInPlace && firstNonCurrent;
|
|
104
|
-
firstNonCurrent = false;
|
|
105
|
-
ops.push({
|
|
106
|
-
featureId,
|
|
107
|
-
source: sourcePath,
|
|
108
|
-
destination: destPath,
|
|
109
|
-
type: isMove ? 'move' : 'copy',
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return ops;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Executes a reorganization plan: moves/copies FS-XXX folders to per-project
|
|
117
|
-
* directories and enables multiProject mode in config.json.
|
|
118
|
-
*
|
|
119
|
-
* @param plan - List of move/copy operations from generateReorganizationPlan()
|
|
120
|
-
* @param configPath - Path to .specweave/config.json
|
|
121
|
-
* @param options - { execute: true } to apply changes, false for dry-run
|
|
122
|
-
*/
|
|
123
|
-
export async function reorganizeSpecs(plan, configPath, options) {
|
|
124
|
-
if (!options.execute) {
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
// Execute move/copy operations
|
|
128
|
-
for (const op of plan) {
|
|
129
|
-
const destDir = path.dirname(op.destination);
|
|
130
|
-
await fs.promises.mkdir(destDir, { recursive: true });
|
|
131
|
-
if (op.type === 'move') {
|
|
132
|
-
try {
|
|
133
|
-
await fs.promises.rename(op.source, op.destination);
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
// Cross-device: copy then delete
|
|
137
|
-
await copyDirRecursive(op.source, op.destination);
|
|
138
|
-
await fs.promises.rm(op.source, { recursive: true });
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
142
|
-
// copy
|
|
143
|
-
await copyDirRecursive(op.source, op.destination);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// Update config.json: enable multiProject
|
|
147
|
-
try {
|
|
148
|
-
const raw = await fs.promises.readFile(configPath, 'utf-8');
|
|
149
|
-
const config = JSON.parse(raw);
|
|
150
|
-
if (config.multiProject?.enabled !== true) {
|
|
151
|
-
config.multiProject = config.multiProject || {};
|
|
152
|
-
config.multiProject.enabled = true;
|
|
153
|
-
await fs.promises.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
// Non-fatal
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Recursively copy a directory tree.
|
|
162
|
-
*/
|
|
163
|
-
async function copyDirRecursive(src, dest) {
|
|
164
|
-
await fs.promises.mkdir(dest, { recursive: true });
|
|
165
|
-
const entries = await fs.promises.readdir(src, { withFileTypes: true });
|
|
166
|
-
for (const entry of entries) {
|
|
167
|
-
const srcPath = path.join(src, entry.name);
|
|
168
|
-
const destPath = path.join(dest, entry.name);
|
|
169
|
-
if (entry.isDirectory()) {
|
|
170
|
-
await copyDirRecursive(srcPath, destPath);
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
await fs.promises.copyFile(srcPath, destPath);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
// ---------------------------------------------------------------------------
|
|
178
|
-
// Internals
|
|
179
|
-
// ---------------------------------------------------------------------------
|
|
180
|
-
/**
|
|
181
|
-
* Discovers all FS-XXX directory names across all project subfolders.
|
|
182
|
-
*/
|
|
183
|
-
async function discoverFeatureIds(specsBaseDir) {
|
|
184
|
-
const featureIds = [];
|
|
185
|
-
if (!fs.existsSync(specsBaseDir))
|
|
186
|
-
return featureIds;
|
|
187
|
-
const projectDirs = await fs.promises.readdir(specsBaseDir, { withFileTypes: true });
|
|
188
|
-
for (const dir of projectDirs) {
|
|
189
|
-
if (!dir.isDirectory() || dir.name.startsWith('_'))
|
|
190
|
-
continue;
|
|
191
|
-
const projectPath = path.join(specsBaseDir, dir.name);
|
|
192
|
-
const entries = await fs.promises.readdir(projectPath, { withFileTypes: true });
|
|
193
|
-
for (const entry of entries) {
|
|
194
|
-
if (entry.isDirectory() && /^FS-\d+/.test(entry.name)) {
|
|
195
|
-
if (!featureIds.includes(entry.name)) {
|
|
196
|
-
featureIds.push(entry.name);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
return featureIds;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* Builds an index of 4-digit numeric prefix → increment directory name.
|
|
205
|
-
* E.g., "0282" → "0282-repo-links-all-skill-surfaces"
|
|
206
|
-
*/
|
|
207
|
-
async function buildIncrementIndex(incrementsDir) {
|
|
208
|
-
const index = new Map();
|
|
209
|
-
if (!fs.existsSync(incrementsDir))
|
|
210
|
-
return index;
|
|
211
|
-
const entries = await fs.promises.readdir(incrementsDir, { withFileTypes: true });
|
|
212
|
-
for (const entry of entries) {
|
|
213
|
-
if (!entry.isDirectory())
|
|
214
|
-
continue;
|
|
215
|
-
const match = entry.name.match(/^(\d{4})/);
|
|
216
|
-
if (match) {
|
|
217
|
-
index.set(match[1], entry.name);
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
return index;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Builds an index of feature_id → increment directory name from metadata.json files.
|
|
224
|
-
* E.g., "FS-190" → "0300-custom-feature"
|
|
225
|
-
*/
|
|
226
|
-
async function buildMetadataIndex(incrementsDir) {
|
|
227
|
-
const index = new Map();
|
|
228
|
-
if (!fs.existsSync(incrementsDir))
|
|
229
|
-
return index;
|
|
230
|
-
const entries = await fs.promises.readdir(incrementsDir, { withFileTypes: true });
|
|
231
|
-
for (const entry of entries) {
|
|
232
|
-
if (!entry.isDirectory())
|
|
233
|
-
continue;
|
|
234
|
-
const metadataPath = path.join(incrementsDir, entry.name, 'metadata.json');
|
|
235
|
-
try {
|
|
236
|
-
const raw = await fs.promises.readFile(metadataPath, 'utf-8');
|
|
237
|
-
const metadata = JSON.parse(raw);
|
|
238
|
-
if (metadata.feature_id && typeof metadata.feature_id === 'string') {
|
|
239
|
-
index.set(metadata.feature_id, entry.name);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
catch {
|
|
243
|
-
// Skip invalid/missing metadata
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return index;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Parses a spec.md file for **Project**: lines and returns unique project IDs.
|
|
250
|
-
* Handles comma-separated values (e.g., "specweave, vskill").
|
|
251
|
-
* Ignores backtick-escaped mentions (e.g., `**Project**:` in prose).
|
|
252
|
-
*/
|
|
253
|
-
async function parseProjectFields(specPath) {
|
|
254
|
-
try {
|
|
255
|
-
const content = await fs.promises.readFile(specPath, 'utf-8');
|
|
256
|
-
const projects = [];
|
|
257
|
-
// Match **Project**: at start of line (not inside backticks)
|
|
258
|
-
const regex = /^\*\*Project\*\*:\s*(.+)/gm;
|
|
259
|
-
let match;
|
|
260
|
-
while ((match = regex.exec(content)) !== null) {
|
|
261
|
-
const rawValue = match[1].trim();
|
|
262
|
-
// Skip if the line was inside backticks (preceded by `)
|
|
263
|
-
const lineStart = content.lastIndexOf('\n', match.index) + 1;
|
|
264
|
-
const prefix = content.substring(lineStart, match.index);
|
|
265
|
-
if (prefix.includes('`'))
|
|
266
|
-
continue;
|
|
267
|
-
// Split comma-separated project IDs
|
|
268
|
-
const parts = rawValue.split(',').map((p) => p.trim()).filter(Boolean);
|
|
269
|
-
for (const project of parts) {
|
|
270
|
-
if (!projects.includes(project)) {
|
|
271
|
-
projects.push(project);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return projects;
|
|
276
|
-
}
|
|
277
|
-
catch {
|
|
278
|
-
return [];
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Detects the current (primary) project folder name by finding the first
|
|
283
|
-
* non-archive directory under the specs base dir.
|
|
284
|
-
*/
|
|
285
|
-
function detectCurrentProject(specsBaseDir) {
|
|
286
|
-
try {
|
|
287
|
-
const entries = fs.readdirSync(specsBaseDir, { withFileTypes: true });
|
|
288
|
-
for (const entry of entries) {
|
|
289
|
-
if (entry.isDirectory() && !entry.name.startsWith('_')) {
|
|
290
|
-
return entry.name;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
catch {
|
|
295
|
-
// fallback
|
|
296
|
-
}
|
|
297
|
-
return 'default';
|
|
298
|
-
}
|
|
299
|
-
//# sourceMappingURL=spec-project-mapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-project-mapper.js","sourceRoot":"","sources":["../../../../src/core/migration/spec-project-mapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAa7B,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,WAAmB;IAEnB,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAC3D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAE3E,8DAA8D;IAC9D,MAAM,UAAU,GAAG,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC1D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,GAA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gBAC5B,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAChC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,YAAoB;IAChD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACtE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACvD,OAAO,KAAK,CAAC,IAAI,CAAC;YACpB,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;IACb,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Migration Types for Umbrella Migration Tool
|
|
3
|
-
*
|
|
4
|
-
* Defines types for converting single-repo SpecWeave projects
|
|
5
|
-
* to umbrella/multi-repo structure.
|
|
6
|
-
*
|
|
7
|
-
* @module core/migration/types
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Detected single-repo project eligible for migration
|
|
11
|
-
*/
|
|
12
|
-
export interface MigrationCandidate {
|
|
13
|
-
/** Absolute path to the project root */
|
|
14
|
-
projectRoot: string;
|
|
15
|
-
/** Path to .specweave/config.json */
|
|
16
|
-
configPath: string;
|
|
17
|
-
/** GitHub organization or user name */
|
|
18
|
-
orgName: string;
|
|
19
|
-
/** Repository name (from config or directory name) */
|
|
20
|
-
repoName: string;
|
|
21
|
-
/** Whether CLAUDE.md exists at project root */
|
|
22
|
-
hasClaudeMd: boolean;
|
|
23
|
-
/** Whether AGENTS.md exists at project root */
|
|
24
|
-
hasAgentsMd: boolean;
|
|
25
|
-
/** Whether docs-site/ exists at project root */
|
|
26
|
-
hasDocsSite: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Types of migration operations
|
|
30
|
-
*/
|
|
31
|
-
export type MigrationStepType = 'create-dir' | 'move' | 'copy' | 'update-config' | 'create-file';
|
|
32
|
-
/**
|
|
33
|
-
* Single operation in the migration plan
|
|
34
|
-
*/
|
|
35
|
-
export interface MigrationStep {
|
|
36
|
-
/** Operation type */
|
|
37
|
-
type: MigrationStepType;
|
|
38
|
-
/** Source path (for move/copy operations) */
|
|
39
|
-
source?: string;
|
|
40
|
-
/** Destination path */
|
|
41
|
-
destination: string;
|
|
42
|
-
/** Human-readable description */
|
|
43
|
-
description: string;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Ordered list of operations to execute
|
|
47
|
-
*/
|
|
48
|
-
export interface MigrationPlan {
|
|
49
|
-
/** The candidate being migrated */
|
|
50
|
-
candidate: MigrationCandidate;
|
|
51
|
-
/** Ordered steps to execute */
|
|
52
|
-
steps: MigrationStep[];
|
|
53
|
-
/** Target umbrella directory path */
|
|
54
|
-
umbrellaPath: string;
|
|
55
|
-
/** Umbrella directory name */
|
|
56
|
-
umbrellaName: string;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Result of a migration execution
|
|
60
|
-
*/
|
|
61
|
-
export interface MigrationResult {
|
|
62
|
-
/** Whether migration succeeded */
|
|
63
|
-
success: boolean;
|
|
64
|
-
/** Number of steps completed */
|
|
65
|
-
stepsCompleted: number;
|
|
66
|
-
/** Total number of steps */
|
|
67
|
-
stepsTotal: number;
|
|
68
|
-
/** Path to backup directory */
|
|
69
|
-
backupPath?: string;
|
|
70
|
-
/** Error messages (if any) */
|
|
71
|
-
errors: string[];
|
|
72
|
-
/** Path to the created umbrella directory */
|
|
73
|
-
umbrellaPath?: string;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Options for the migration command
|
|
77
|
-
*/
|
|
78
|
-
export interface MigrationOptions {
|
|
79
|
-
/** Custom umbrella directory name */
|
|
80
|
-
umbrellaName?: string;
|
|
81
|
-
/** Custom umbrella directory path (absolute) */
|
|
82
|
-
umbrellaPath?: string;
|
|
83
|
-
/** GitHub organization name */
|
|
84
|
-
orgName?: string;
|
|
85
|
-
/** Execute the migration (false = dry-run) */
|
|
86
|
-
execute?: boolean;
|
|
87
|
-
/** Rollback a previous migration */
|
|
88
|
-
rollback?: boolean;
|
|
89
|
-
/** Skip confirmation prompts */
|
|
90
|
-
yes?: boolean;
|
|
91
|
-
/** Add a new repo to existing umbrella */
|
|
92
|
-
addRepo?: string;
|
|
93
|
-
/** Reorganize spec folders into per-project directories */
|
|
94
|
-
reorganizeSpecs?: boolean;
|
|
95
|
-
/** Consolidate orphaned increments/docs from nested repos to umbrella root */
|
|
96
|
-
consolidate?: boolean;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Manifest written alongside backup to record what was moved and where.
|
|
100
|
-
* Enables full rollback including moved files (CLAUDE.md, AGENTS.md, docs-site).
|
|
101
|
-
*/
|
|
102
|
-
export interface MigrationManifest {
|
|
103
|
-
/** Timestamp of migration */
|
|
104
|
-
timestamp: string;
|
|
105
|
-
/** Absolute path to the umbrella directory */
|
|
106
|
-
umbrellaPath: string;
|
|
107
|
-
/** Absolute path to the original project */
|
|
108
|
-
projectRoot: string;
|
|
109
|
-
/** Files/dirs that were moved from project to umbrella */
|
|
110
|
-
movedItems: Array<{
|
|
111
|
-
/** Original path (relative to projectRoot) */
|
|
112
|
-
source: string;
|
|
113
|
-
/** Destination path (relative to umbrellaPath) */
|
|
114
|
-
destination: string;
|
|
115
|
-
}>;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Result of adding a new repo to an umbrella
|
|
119
|
-
*/
|
|
120
|
-
export interface AddRepoResult {
|
|
121
|
-
/** Whether the repo was created/cloned successfully */
|
|
122
|
-
success: boolean;
|
|
123
|
-
/** Repository name */
|
|
124
|
-
repoName: string;
|
|
125
|
-
/** Path where repo was created */
|
|
126
|
-
repoPath: string;
|
|
127
|
-
/** Whether gh CLI was used */
|
|
128
|
-
usedGhCli: boolean;
|
|
129
|
-
/** Error message if failed */
|
|
130
|
-
error?: string;
|
|
131
|
-
}
|
|
132
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/migration/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,+CAA+C;IAC/C,WAAW,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,YAAY,GACZ,MAAM,GACN,MAAM,GACN,eAAe,GACf,aAAa,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAC;IACxB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mCAAmC;IACnC,SAAS,EAAE,kBAA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;QAC9C,MAAM,EAAE,MAAM,CAAC;QACf,kDAAkD;QAClD,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,SAAS,EAAE,OAAO,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/core/migration/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Umbrella Migrator
|
|
3
|
-
*
|
|
4
|
-
* Converts single-repo SpecWeave projects to umbrella/multi-repo structure.
|
|
5
|
-
* Creates a sibling umbrella directory and moves SpecWeave-managed files to it,
|
|
6
|
-
* leaving the original project completely untouched.
|
|
7
|
-
*
|
|
8
|
-
* @module core/migration/umbrella-migrator
|
|
9
|
-
*/
|
|
10
|
-
import type { Logger } from '../../utils/logger.js';
|
|
11
|
-
import type { MigrationCandidate, MigrationPlan, MigrationResult, MigrationOptions, AddRepoResult } from './types.js';
|
|
12
|
-
export type UmbrellaCollisionType = 'previous-migration' | 'partial-migration' | 'unrelated';
|
|
13
|
-
/**
|
|
14
|
-
* Classifies an existing umbrella directory to determine how to handle the collision.
|
|
15
|
-
*
|
|
16
|
-
* @param umbrellaPath - Path to the existing umbrella directory
|
|
17
|
-
* @param projectRoot - Path to the original project (for checking backup manifest)
|
|
18
|
-
* @returns Classification or null if directory doesn't exist
|
|
19
|
-
*/
|
|
20
|
-
export declare function classifyExistingUmbrella(umbrellaPath: string, projectRoot: string): Promise<UmbrellaCollisionType | null>;
|
|
21
|
-
/**
|
|
22
|
-
* Detects whether the current project is a single-repo SpecWeave project
|
|
23
|
-
* eligible for umbrella migration.
|
|
24
|
-
*/
|
|
25
|
-
export declare function detectSingleRepoProject(projectRoot: string, logger?: Logger): Promise<MigrationCandidate | null>;
|
|
26
|
-
/**
|
|
27
|
-
* Generates an ordered migration plan from a candidate.
|
|
28
|
-
*/
|
|
29
|
-
export declare function generateMigrationPlan(candidate: MigrationCandidate, options?: MigrationOptions): MigrationPlan;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a backup of .specweave/ before migration.
|
|
32
|
-
* Backup is stored at `{projectRoot}/.specweave-migration-backup/` — outside
|
|
33
|
-
* `.specweave/` so it survives when `.specweave/` is moved to the umbrella.
|
|
34
|
-
*/
|
|
35
|
-
export declare function createBackup(projectRoot: string, logger?: Logger): Promise<string>;
|
|
36
|
-
/**
|
|
37
|
-
* Checks for uncommitted changes and throws if dirty.
|
|
38
|
-
*/
|
|
39
|
-
export declare function guardUncommittedChanges(projectRoot: string): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Executes a migration plan, moving files to the umbrella directory.
|
|
42
|
-
*/
|
|
43
|
-
export declare function executeMigration(plan: MigrationPlan, logger?: Logger): Promise<MigrationResult>;
|
|
44
|
-
/**
|
|
45
|
-
* Rolls back a migration using the backup.
|
|
46
|
-
* Looks for backup at `{projectRoot}/.specweave-migration-backup/`.
|
|
47
|
-
* If a manifest exists, also restores moved files (CLAUDE.md, AGENTS.md, docs-site).
|
|
48
|
-
*/
|
|
49
|
-
export declare function rollbackMigration(projectRoot: string, logger?: Logger): Promise<MigrationResult>;
|
|
50
|
-
/**
|
|
51
|
-
* Adds a new repository to an existing umbrella workspace.
|
|
52
|
-
*/
|
|
53
|
-
export declare function addRepoToUmbrella(umbrellaPath: string, repoName: string, orgName: string, options?: {
|
|
54
|
-
description?: string;
|
|
55
|
-
visibility?: 'public' | 'private';
|
|
56
|
-
prefix?: string;
|
|
57
|
-
}, logger?: Logger): Promise<AddRepoResult>;
|
|
58
|
-
//# sourceMappingURL=umbrella-migrator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"umbrella-migrator.d.ts","sourceRoot":"","sources":["../../../../src/core/migration/umbrella-migrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EAEb,eAAe,EACf,gBAAgB,EAEhB,aAAa,EACd,MAAM,YAAY,CAAC;AAOpB,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAE7F;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAkBvC;AAMD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,MAAsB,GAC7B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA4CpC;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,kBAAkB,EAC7B,OAAO,GAAE,gBAAqB,GAC7B,aAAa,CAsEf;AAWD;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,MAAM,GAAE,MAAsB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAuDD;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAUf;AAMD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,aAAa,EACnB,MAAM,GAAE,MAAsB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAkF1B;AA6HD;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,M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