specweave 0.26.14 → 0.28.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/CLAUDE.md +73 -1
- package/README.md +245 -446
- package/dist/plugins/specweave-jira/lib/setup-wizard.d.ts.map +1 -1
- package/dist/plugins/specweave-jira/lib/setup-wizard.js +57 -78
- package/dist/plugins/specweave-jira/lib/setup-wizard.js.map +1 -1
- package/dist/src/cli/commands/import-docs.d.ts.map +1 -1
- package/dist/src/cli/commands/import-docs.js +23 -31
- package/dist/src/cli/commands/import-docs.js.map +1 -1
- package/dist/src/cli/commands/import-external.d.ts.map +1 -1
- package/dist/src/cli/commands/import-external.js +6 -10
- package/dist/src/cli/commands/import-external.js.map +1 -1
- package/dist/src/cli/commands/init-multiproject.d.ts.map +1 -1
- package/dist/src/cli/commands/init-multiproject.js +58 -73
- package/dist/src/cli/commands/init-multiproject.js.map +1 -1
- package/dist/src/cli/commands/init.d.ts +17 -11
- package/dist/src/cli/commands/init.d.ts.map +1 -1
- package/dist/src/cli/commands/init.js +221 -1874
- package/dist/src/cli/commands/init.js.map +1 -1
- package/dist/src/cli/commands/install.d.ts.map +1 -1
- package/dist/src/cli/commands/install.js +14 -22
- package/dist/src/cli/commands/install.js.map +1 -1
- package/dist/src/cli/commands/migrate-config.d.ts.map +1 -1
- package/dist/src/cli/commands/migrate-config.js +6 -10
- package/dist/src/cli/commands/migrate-config.js.map +1 -1
- package/dist/src/cli/commands/switch-project.d.ts.map +1 -1
- package/dist/src/cli/commands/switch-project.js.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -1
- package/dist/src/cli/helpers/ado-area-path-mapper.js +36 -49
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.d.ts.map +1 -1
- package/dist/src/cli/helpers/github/increment-profile-selector.js.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.d.ts.map +1 -1
- package/dist/src/cli/helpers/github/profile-manager.js +8 -11
- package/dist/src/cli/helpers/github/profile-manager.js.map +1 -1
- package/dist/src/cli/helpers/github-repo-selector.d.ts.map +1 -1
- package/dist/src/cli/helpers/github-repo-selector.js +26 -50
- package/dist/src/cli/helpers/github-repo-selector.js.map +1 -1
- package/dist/src/cli/helpers/import-strategy-prompter.d.ts.map +1 -1
- package/dist/src/cli/helpers/import-strategy-prompter.js +39 -52
- package/dist/src/cli/helpers/import-strategy-prompter.js.map +1 -1
- package/dist/src/cli/helpers/init/config-detection.d.ts +40 -0
- package/dist/src/cli/helpers/init/config-detection.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/config-detection.js +125 -0
- package/dist/src/cli/helpers/init/config-detection.js.map +1 -0
- package/dist/src/cli/helpers/init/directory-structure.d.ts +26 -0
- package/dist/src/cli/helpers/init/directory-structure.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/directory-structure.js +190 -0
- package/dist/src/cli/helpers/init/directory-structure.js.map +1 -0
- package/dist/src/cli/helpers/init/external-import.d.ts +15 -0
- package/dist/src/cli/helpers/init/external-import.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/external-import.js +251 -0
- package/dist/src/cli/helpers/init/external-import.js.map +1 -0
- package/dist/src/cli/helpers/init/index.d.ts +15 -0
- package/dist/src/cli/helpers/init/index.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/index.js +26 -0
- package/dist/src/cli/helpers/init/index.js.map +1 -0
- package/dist/src/cli/helpers/init/next-steps.d.ts +15 -0
- package/dist/src/cli/helpers/init/next-steps.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/next-steps.js +72 -0
- package/dist/src/cli/helpers/init/next-steps.js.map +1 -0
- package/dist/src/cli/helpers/init/path-utils.d.ts +41 -0
- package/dist/src/cli/helpers/init/path-utils.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/path-utils.js +146 -0
- package/dist/src/cli/helpers/init/path-utils.js.map +1 -0
- package/dist/src/cli/helpers/init/plugin-installer.d.ts +28 -0
- package/dist/src/cli/helpers/init/plugin-installer.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/plugin-installer.js +238 -0
- package/dist/src/cli/helpers/init/plugin-installer.js.map +1 -0
- package/dist/src/cli/helpers/init/repository-setup.d.ts +28 -0
- package/dist/src/cli/helpers/init/repository-setup.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/repository-setup.js +78 -0
- package/dist/src/cli/helpers/init/repository-setup.js.map +1 -0
- package/dist/src/cli/helpers/init/smart-reinit.d.ts +30 -0
- package/dist/src/cli/helpers/init/smart-reinit.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/smart-reinit.js +140 -0
- package/dist/src/cli/helpers/init/smart-reinit.js.map +1 -0
- package/dist/src/cli/helpers/init/testing-config.d.ts +27 -0
- package/dist/src/cli/helpers/init/testing-config.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/testing-config.js +131 -0
- package/dist/src/cli/helpers/init/testing-config.js.map +1 -0
- package/dist/src/cli/helpers/init/types.d.ts +86 -0
- package/dist/src/cli/helpers/init/types.d.ts.map +1 -0
- package/dist/src/cli/helpers/init/types.js +5 -0
- package/dist/src/cli/helpers/init/types.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +10 -12
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +43 -60
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- 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 +193 -230
- 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 +43 -54
- package/dist/src/cli/helpers/issue-tracker/github.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/index.js +27 -40
- package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/jira.js +54 -70
- package/dist/src/cli/helpers/issue-tracker/jira.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -1
- package/dist/src/cli/helpers/smart-filter.js +62 -85
- package/dist/src/cli/helpers/smart-filter.js.map +1 -1
- package/dist/src/core/increment/auto-transition-manager.d.ts +12 -0
- package/dist/src/core/increment/auto-transition-manager.d.ts.map +1 -1
- package/dist/src/core/increment/auto-transition-manager.js +45 -0
- package/dist/src/core/increment/auto-transition-manager.js.map +1 -1
- package/dist/src/core/increment/metadata-manager.d.ts.map +1 -1
- package/dist/src/core/increment/metadata-manager.js +46 -0
- package/dist/src/core/increment/metadata-manager.js.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.d.ts +12 -0
- package/dist/src/core/increment/status-change-sync-trigger.d.ts.map +1 -1
- package/dist/src/core/increment/status-change-sync-trigger.js +48 -2
- package/dist/src/core/increment/status-change-sync-trigger.js.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.d.ts +13 -0
- package/dist/src/core/living-docs/living-docs-sync.d.ts.map +1 -1
- package/dist/src/core/living-docs/living-docs-sync.js +40 -0
- package/dist/src/core/living-docs/living-docs-sync.js.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts +5 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-bulk-discovery.js +68 -86
- package/dist/src/core/repo-structure/repo-bulk-discovery.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 +345 -425
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.d.ts.map +1 -1
- package/dist/src/core/sync/bidirectional-engine.js +21 -29
- package/dist/src/core/sync/bidirectional-engine.js.map +1 -1
- package/dist/src/init/InitFlow.js +15 -19
- package/dist/src/init/InitFlow.js.map +1 -1
- package/dist/src/init/repo/types.d.ts +1 -1
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -1
- package/dist/src/integrations/ado/area-path-mapper.js +19 -23
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -1
- package/dist/src/utils/external-resource-validator.d.ts.map +1 -1
- package/dist/src/utils/external-resource-validator.js +41 -65
- package/dist/src/utils/external-resource-validator.js.map +1 -1
- package/dist/src/utils/project-detection.d.ts.map +1 -1
- package/dist/src/utils/project-detection.js +19 -21
- package/dist/src/utils/project-detection.js.map +1 -1
- package/dist/src/utils/project-validator.d.ts.map +1 -1
- package/dist/src/utils/project-validator.js +5 -7
- package/dist/src/utils/project-validator.js.map +1 -1
- package/package.json +2 -3
- package/plugins/specweave/agents/tech-lead/AGENT.md +9 -0
- package/plugins/specweave/hooks/post-edit-write-consolidated.sh +87 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.d.ts +12 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js +45 -0
- package/plugins/specweave/lib/vendor/core/increment/auto-transition-manager.js.map +1 -1
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js +46 -0
- package/plugins/specweave/lib/vendor/core/increment/metadata-manager.js.map +1 -1
- package/plugins/specweave/skills/increment-planner/SKILL.md +10 -5
- package/plugins/specweave/skills/specweave-framework/SKILL.md +6 -4
- package/plugins/specweave/templates/coding-standards.md.template +36 -0
- package/plugins/specweave-ado/lib/project-selector.js +56 -67
- package/plugins/specweave-ado/lib/project-selector.ts +72 -85
- package/plugins/specweave-github/lib/repo-selector.js +55 -66
- package/plugins/specweave-github/lib/repo-selector.ts +73 -84
- package/plugins/specweave-jira/commands/import-projects.js +3 -5
- package/plugins/specweave-jira/commands/import-projects.ts +3 -5
- package/plugins/specweave-jira/lib/project-selector.js +60 -71
- package/plugins/specweave-jira/lib/project-selector.ts +78 -91
- package/plugins/specweave-jira/lib/setup-wizard.js +51 -72
- package/plugins/specweave-jira/lib/setup-wizard.ts +56 -74
- package/src/templates/CLAUDE.md.template +14 -0
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Validates project names
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import
|
|
12
|
+
import { select, checkbox, input, Separator } from '@inquirer/prompts';
|
|
13
13
|
import { AdoClient } from '../../../src/integrations/ado/ado-client.js';
|
|
14
14
|
|
|
15
15
|
// ============================================================================
|
|
@@ -101,31 +101,27 @@ export async function selectAdoProjects(
|
|
|
101
101
|
console.log(` Total: ${allProjects.length} projects\n`);
|
|
102
102
|
|
|
103
103
|
// Decide selection method
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
: []),
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
]);
|
|
104
|
+
const selectionMethod = await select({
|
|
105
|
+
message: 'How would you like to select projects?',
|
|
106
|
+
choices: [
|
|
107
|
+
{
|
|
108
|
+
name: `📋 Interactive (browse and select from ${allProjects.length} projects)`,
|
|
109
|
+
value: 'interactive' as const,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: '✏️ Manual entry (type project names)',
|
|
113
|
+
value: 'manual' as const,
|
|
114
|
+
},
|
|
115
|
+
...(allowSelectAll
|
|
116
|
+
? [
|
|
117
|
+
{
|
|
118
|
+
name: `✨ Select all (${allProjects.length} projects)`,
|
|
119
|
+
value: 'all' as const,
|
|
120
|
+
},
|
|
121
|
+
]
|
|
122
|
+
: []),
|
|
123
|
+
],
|
|
124
|
+
});
|
|
129
125
|
|
|
130
126
|
if (selectionMethod === 'all') {
|
|
131
127
|
return {
|
|
@@ -160,45 +156,40 @@ async function interactiveProjectSelection(
|
|
|
160
156
|
): Promise<ProjectSelectionResult> {
|
|
161
157
|
console.log('💡 Use <space> to select, <a> to toggle all, <i> to invert\n');
|
|
162
158
|
|
|
163
|
-
const choices =
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
new inquirer.Separator(),
|
|
159
|
+
const choices = [
|
|
160
|
+
...allProjects.map((p) => ({
|
|
161
|
+
name: formatProjectChoice(p),
|
|
162
|
+
value: p.name,
|
|
163
|
+
checked: preSelected.includes(p.name),
|
|
164
|
+
})),
|
|
165
|
+
// Add separator and manual entry option at the end
|
|
166
|
+
new Separator(),
|
|
172
167
|
{
|
|
173
168
|
name: '✏️ Enter project names manually instead',
|
|
174
169
|
value: '__MANUAL__',
|
|
175
170
|
checked: false,
|
|
176
|
-
}
|
|
177
|
-
|
|
171
|
+
},
|
|
172
|
+
];
|
|
178
173
|
|
|
179
|
-
const
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
return true;
|
|
199
|
-
},
|
|
174
|
+
const selectedNames = await checkbox({
|
|
175
|
+
message: `Select Azure DevOps projects (${minSelection}${maxSelection ? `-${maxSelection}` : '+'} required):`,
|
|
176
|
+
choices,
|
|
177
|
+
pageSize,
|
|
178
|
+
loop: false,
|
|
179
|
+
validate: (selected: readonly string[]) => {
|
|
180
|
+
const actualSelected = selected.filter((k) => k !== '__MANUAL__');
|
|
181
|
+
|
|
182
|
+
if (actualSelected.length < minSelection) {
|
|
183
|
+
return `Please select at least ${minSelection} project(s)`;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (maxSelection && actualSelected.length > maxSelection) {
|
|
187
|
+
return `Please select at most ${maxSelection} project(s)`;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return true;
|
|
200
191
|
},
|
|
201
|
-
|
|
192
|
+
});
|
|
202
193
|
|
|
203
194
|
// Check if user chose manual entry
|
|
204
195
|
if (selectedNames.includes('__MANUAL__')) {
|
|
@@ -235,33 +226,29 @@ async function manualProjectEntry(
|
|
|
235
226
|
console.log('');
|
|
236
227
|
}
|
|
237
228
|
|
|
238
|
-
const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
return true;
|
|
262
|
-
},
|
|
229
|
+
const manualNames = await input({
|
|
230
|
+
message: 'Project names:',
|
|
231
|
+
validate: (inputValue: string) => {
|
|
232
|
+
if (!inputValue.trim()) {
|
|
233
|
+
return 'Please enter at least one project name';
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const names = inputValue
|
|
237
|
+
.split(',')
|
|
238
|
+
.map((n) => n.trim())
|
|
239
|
+
.filter((n) => n.length > 0);
|
|
240
|
+
|
|
241
|
+
if (names.length < minSelection) {
|
|
242
|
+
return `Please enter at least ${minSelection} project name(s)`;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
if (maxSelection && names.length > maxSelection) {
|
|
246
|
+
return `Please enter at most ${maxSelection} project name(s)`;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return true;
|
|
263
250
|
},
|
|
264
|
-
|
|
251
|
+
});
|
|
265
252
|
|
|
266
253
|
const selectedNames = manualNames
|
|
267
254
|
.split(',')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { select, checkbox, input, Separator } from "@inquirer/prompts";
|
|
2
2
|
import { GitHubClient } from "./github-client.js";
|
|
3
3
|
async function fetchAllGitHubRepos(owner, limit = 100) {
|
|
4
4
|
console.log("\u{1F50D} Fetching GitHub repositories...");
|
|
@@ -34,29 +34,25 @@ async function selectGitHubRepos(options = {}) {
|
|
|
34
34
|
console.log("\u{1F4CB} Available GitHub Repositories:\n");
|
|
35
35
|
console.log(` Total: ${allRepos.length} repositories
|
|
36
36
|
`);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
const selectionMethod = await select({
|
|
38
|
+
message: "How would you like to select repositories?",
|
|
39
|
+
choices: [
|
|
40
|
+
{
|
|
41
|
+
name: `\u{1F4CB} Interactive (browse and select from ${allRepos.length} repositories)`,
|
|
42
|
+
value: "interactive"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "\u270F\uFE0F Manual entry (type repository names)",
|
|
46
|
+
value: "manual"
|
|
47
|
+
},
|
|
48
|
+
...allowSelectAll ? [
|
|
47
49
|
{
|
|
48
|
-
name:
|
|
49
|
-
value: "
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
value: "all"
|
|
55
|
-
}
|
|
56
|
-
] : []
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
]);
|
|
50
|
+
name: `\u2728 Select all (${allRepos.length} repositories)`,
|
|
51
|
+
value: "all"
|
|
52
|
+
}
|
|
53
|
+
] : []
|
|
54
|
+
]
|
|
55
|
+
});
|
|
60
56
|
if (selectionMethod === "all") {
|
|
61
57
|
return {
|
|
62
58
|
selectedRepos: allRepos.map((r) => r.fullName),
|
|
@@ -81,34 +77,31 @@ async function interactiveRepoSelection(allRepos, preSelected, minSelection, max
|
|
|
81
77
|
value: r.fullName,
|
|
82
78
|
checked: preSelected.includes(r.fullName)
|
|
83
79
|
}));
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
const allChoices = [
|
|
81
|
+
...choices,
|
|
82
|
+
new Separator(),
|
|
86
83
|
{
|
|
87
84
|
name: "\u270F\uFE0F Enter repository names manually instead",
|
|
88
85
|
value: "__MANUAL__",
|
|
89
86
|
checked: false
|
|
90
87
|
}
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
if (maxSelection && actualSelected.length > maxSelection) {
|
|
106
|
-
return `Please select at most ${maxSelection} repository(ies)`;
|
|
107
|
-
}
|
|
108
|
-
return true;
|
|
88
|
+
];
|
|
89
|
+
const selectedRepos = await checkbox({
|
|
90
|
+
message: `Select GitHub repositories (${minSelection}${maxSelection ? `-${maxSelection}` : "+"} required):`,
|
|
91
|
+
choices: allChoices,
|
|
92
|
+
pageSize,
|
|
93
|
+
loop: false,
|
|
94
|
+
validate: (selected) => {
|
|
95
|
+
const actualSelected = selected.filter((k) => k !== "__MANUAL__");
|
|
96
|
+
if (actualSelected.length < minSelection) {
|
|
97
|
+
return `Please select at least ${minSelection} repository(ies)`;
|
|
98
|
+
}
|
|
99
|
+
if (maxSelection && actualSelected.length > maxSelection) {
|
|
100
|
+
return `Please select at most ${maxSelection} repository(ies)`;
|
|
109
101
|
}
|
|
102
|
+
return true;
|
|
110
103
|
}
|
|
111
|
-
|
|
104
|
+
});
|
|
112
105
|
if (selectedRepos.includes("__MANUAL__")) {
|
|
113
106
|
return await manualRepoEntry(allRepos, minSelection, maxSelection);
|
|
114
107
|
}
|
|
@@ -130,30 +123,26 @@ async function manualRepoEntry(allRepos, minSelection, maxSelection) {
|
|
|
130
123
|
);
|
|
131
124
|
console.log("");
|
|
132
125
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
146
|
-
if (maxSelection && repos.length > maxSelection) {
|
|
147
|
-
return `Please enter at most ${maxSelection} repository name(s)`;
|
|
148
|
-
}
|
|
149
|
-
const invalidRepos = repos.filter((r) => !/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/.test(r));
|
|
150
|
-
if (invalidRepos.length > 0) {
|
|
151
|
-
return `Invalid repository format: ${invalidRepos.join(", ")}. Use owner/repo format (e.g., octocat/Hello-World).`;
|
|
152
|
-
}
|
|
153
|
-
return true;
|
|
126
|
+
const manualRepos = await input({
|
|
127
|
+
message: "Repository names:",
|
|
128
|
+
validate: (inputValue) => {
|
|
129
|
+
if (!inputValue.trim()) {
|
|
130
|
+
return "Please enter at least one repository name";
|
|
131
|
+
}
|
|
132
|
+
const repos = inputValue.split(",").map((r) => r.trim()).filter((r) => r.length > 0);
|
|
133
|
+
if (repos.length < minSelection) {
|
|
134
|
+
return `Please enter at least ${minSelection} repository name(s)`;
|
|
135
|
+
}
|
|
136
|
+
if (maxSelection && repos.length > maxSelection) {
|
|
137
|
+
return `Please enter at most ${maxSelection} repository name(s)`;
|
|
154
138
|
}
|
|
139
|
+
const invalidRepos = repos.filter((r) => !/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/.test(r));
|
|
140
|
+
if (invalidRepos.length > 0) {
|
|
141
|
+
return `Invalid repository format: ${invalidRepos.join(", ")}. Use owner/repo format (e.g., octocat/Hello-World).`;
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
155
144
|
}
|
|
156
|
-
|
|
145
|
+
});
|
|
157
146
|
const selectedRepos = manualRepos.split(",").map((r) => r.trim()).filter((r) => r.length > 0);
|
|
158
147
|
const knownRepos = allRepos.map((r) => r.fullName);
|
|
159
148
|
const unknownRepos = selectedRepos.filter((r) => !knownRepos.includes(r));
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Validates repo names
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import
|
|
12
|
+
import { select, checkbox, input, Separator } from '@inquirer/prompts';
|
|
13
13
|
import { GitHubClient } from './github-client.js';
|
|
14
14
|
|
|
15
15
|
// ============================================================================
|
|
@@ -109,31 +109,27 @@ export async function selectGitHubRepos(
|
|
|
109
109
|
console.log(` Total: ${allRepos.length} repositories\n`);
|
|
110
110
|
|
|
111
111
|
// Decide selection method
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
: []),
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
]);
|
|
112
|
+
const selectionMethod = await select({
|
|
113
|
+
message: 'How would you like to select repositories?',
|
|
114
|
+
choices: [
|
|
115
|
+
{
|
|
116
|
+
name: `📋 Interactive (browse and select from ${allRepos.length} repositories)`,
|
|
117
|
+
value: 'interactive',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: '✏️ Manual entry (type repository names)',
|
|
121
|
+
value: 'manual',
|
|
122
|
+
},
|
|
123
|
+
...(allowSelectAll
|
|
124
|
+
? [
|
|
125
|
+
{
|
|
126
|
+
name: `✨ Select all (${allRepos.length} repositories)`,
|
|
127
|
+
value: 'all',
|
|
128
|
+
},
|
|
129
|
+
]
|
|
130
|
+
: []),
|
|
131
|
+
],
|
|
132
|
+
});
|
|
137
133
|
|
|
138
134
|
if (selectionMethod === 'all') {
|
|
139
135
|
return {
|
|
@@ -175,38 +171,35 @@ async function interactiveRepoSelection(
|
|
|
175
171
|
}));
|
|
176
172
|
|
|
177
173
|
// Add manual entry option at the end
|
|
178
|
-
|
|
179
|
-
|
|
174
|
+
const allChoices = [
|
|
175
|
+
...choices,
|
|
176
|
+
new Separator(),
|
|
180
177
|
{
|
|
181
178
|
name: '✏️ Enter repository names manually instead',
|
|
182
179
|
value: '__MANUAL__',
|
|
183
180
|
checked: false,
|
|
184
|
-
}
|
|
185
|
-
|
|
181
|
+
},
|
|
182
|
+
];
|
|
186
183
|
|
|
187
|
-
const
|
|
188
|
-
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
return true;
|
|
207
|
-
},
|
|
184
|
+
const selectedRepos = await checkbox({
|
|
185
|
+
message: `Select GitHub repositories (${minSelection}${maxSelection ? `-${maxSelection}` : '+'} required):`,
|
|
186
|
+
choices: allChoices,
|
|
187
|
+
pageSize,
|
|
188
|
+
loop: false,
|
|
189
|
+
validate: (selected: readonly string[]) => {
|
|
190
|
+
const actualSelected = selected.filter((k) => k !== '__MANUAL__');
|
|
191
|
+
|
|
192
|
+
if (actualSelected.length < minSelection) {
|
|
193
|
+
return `Please select at least ${minSelection} repository(ies)`;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (maxSelection && actualSelected.length > maxSelection) {
|
|
197
|
+
return `Please select at most ${maxSelection} repository(ies)`;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return true;
|
|
208
201
|
},
|
|
209
|
-
|
|
202
|
+
});
|
|
210
203
|
|
|
211
204
|
// Check if user chose manual entry
|
|
212
205
|
if (selectedRepos.includes('__MANUAL__')) {
|
|
@@ -243,39 +236,35 @@ async function manualRepoEntry(
|
|
|
243
236
|
console.log('');
|
|
244
237
|
}
|
|
245
238
|
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return true;
|
|
276
|
-
},
|
|
239
|
+
const manualRepos = await input({
|
|
240
|
+
message: 'Repository names:',
|
|
241
|
+
validate: (inputValue: string) => {
|
|
242
|
+
if (!inputValue.trim()) {
|
|
243
|
+
return 'Please enter at least one repository name';
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const repos = inputValue
|
|
247
|
+
.split(',')
|
|
248
|
+
.map((r) => r.trim())
|
|
249
|
+
.filter((r) => r.length > 0);
|
|
250
|
+
|
|
251
|
+
if (repos.length < minSelection) {
|
|
252
|
+
return `Please enter at least ${minSelection} repository name(s)`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (maxSelection && repos.length > maxSelection) {
|
|
256
|
+
return `Please enter at most ${maxSelection} repository name(s)`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// Validate format (owner/repo)
|
|
260
|
+
const invalidRepos = repos.filter((r) => !/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/.test(r));
|
|
261
|
+
if (invalidRepos.length > 0) {
|
|
262
|
+
return `Invalid repository format: ${invalidRepos.join(', ')}. Use owner/repo format (e.g., octocat/Hello-World).`;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return true;
|
|
277
266
|
},
|
|
278
|
-
|
|
267
|
+
});
|
|
279
268
|
|
|
280
269
|
const selectedRepos = manualRepos
|
|
281
270
|
.split(',')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import
|
|
2
|
+
import { confirm } from "@inquirer/prompts";
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { JiraClient } from "../../../src/integrations/jira/jira-client.js";
|
|
@@ -98,12 +98,10 @@ async function importProjects(options = {}) {
|
|
|
98
98
|
`));
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
type: "confirm",
|
|
103
|
-
name: "confirmed",
|
|
101
|
+
const confirmed = await confirm({
|
|
104
102
|
message: `Import ${newProjects.length} new project(s)?`,
|
|
105
103
|
default: true
|
|
106
|
-
}
|
|
104
|
+
});
|
|
107
105
|
if (!confirmed) {
|
|
108
106
|
console.log(chalk.yellow("\n\u23ED\uFE0F Import canceled\n"));
|
|
109
107
|
return;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import chalk from 'chalk';
|
|
21
|
-
import
|
|
21
|
+
import { confirm } from '@inquirer/prompts';
|
|
22
22
|
import { existsSync } from 'fs';
|
|
23
23
|
import path from 'path';
|
|
24
24
|
import { JiraClient } from '../../../src/integrations/jira/jira-client.js';
|
|
@@ -175,12 +175,10 @@ export async function importProjects(options: ImportProjectsOptions = {}): Promi
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
// Step 9: Confirm import
|
|
178
|
-
const
|
|
179
|
-
type: 'confirm',
|
|
180
|
-
name: 'confirmed',
|
|
178
|
+
const confirmed = await confirm({
|
|
181
179
|
message: `Import ${newProjects.length} new project(s)?`,
|
|
182
180
|
default: true
|
|
183
|
-
}
|
|
181
|
+
});
|
|
184
182
|
|
|
185
183
|
if (!confirmed) {
|
|
186
184
|
console.log(chalk.yellow('\n⏭️ Import canceled\n'));
|