specweave 0.23.18 → 0.24.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/.claude-plugin/marketplace.json +144 -45
- package/CLAUDE.md +137 -4
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts +89 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.d.ts.map +1 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js +213 -0
- package/dist/src/cli/helpers/ado-area-path-mapper.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts +29 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.d.ts.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js +109 -0
- package/dist/src/cli/helpers/issue-tracker/ado-auto-discover.js.map +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts +1 -0
- package/dist/src/cli/helpers/issue-tracker/ado.d.ts.map +1 -1
- package/dist/src/cli/helpers/issue-tracker/ado.js +2 -0
- package/dist/src/cli/helpers/issue-tracker/ado.js.map +1 -1
- package/dist/src/cli/helpers/smart-filter.d.ts +83 -0
- package/dist/src/cli/helpers/smart-filter.d.ts.map +1 -0
- package/dist/src/cli/helpers/smart-filter.js +265 -0
- package/dist/src/cli/helpers/smart-filter.js.map +1 -0
- package/dist/src/core/qa/quality-gate-decider.d.ts +1 -1
- package/dist/src/core/qa/quality-gate-decider.js +2 -2
- package/dist/src/core/qa/quality-gate-decider.js.map +1 -1
- package/dist/src/core/qa/risk-calculator.d.ts +2 -2
- package/dist/src/core/qa/risk-calculator.js +2 -2
- package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
- package/dist/src/core/repo-structure/repo-structure-manager.js +76 -43
- package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
- package/dist/src/core/validators/ac-presence-validator.d.ts +56 -0
- package/dist/src/core/validators/ac-presence-validator.d.ts.map +1 -0
- package/dist/src/core/validators/ac-presence-validator.js +149 -0
- package/dist/src/core/validators/ac-presence-validator.js.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts +137 -0
- package/dist/src/integrations/ado/area-path-mapper.d.ts.map +1 -0
- package/dist/src/integrations/ado/area-path-mapper.js +267 -0
- package/dist/src/integrations/ado/area-path-mapper.js.map +1 -0
- package/dist/src/integrations/jira/filter-processor.d.ts +126 -0
- package/dist/src/integrations/jira/filter-processor.d.ts.map +1 -0
- package/dist/src/integrations/jira/filter-processor.js +207 -0
- package/dist/src/integrations/jira/filter-processor.js.map +1 -0
- package/dist/src/integrations/jira/jira-client.d.ts +13 -0
- package/dist/src/integrations/jira/jira-client.d.ts.map +1 -1
- package/dist/src/integrations/jira/jira-client.js +33 -0
- package/dist/src/integrations/jira/jira-client.js.map +1 -1
- package/dist/src/utils/ac-embedder.d.ts +63 -0
- package/dist/src/utils/ac-embedder.d.ts.map +1 -0
- package/dist/src/utils/ac-embedder.js +217 -0
- package/dist/src/utils/ac-embedder.js.map +1 -0
- package/dist/src/utils/env-manager.d.ts +86 -0
- package/dist/src/utils/env-manager.d.ts.map +1 -0
- package/dist/src/utils/env-manager.js +188 -0
- package/dist/src/utils/env-manager.js.map +1 -0
- package/package.json +1 -1
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/agents/AGENTS-INDEX.md +1 -1
- package/plugins/specweave/agents/increment-quality-judge-v2/AGENT.md +9 -9
- package/plugins/specweave/commands/specweave-do.md +37 -0
- package/plugins/specweave/commands/specweave-done.md +159 -0
- package/plugins/specweave/commands/specweave-embed-acs.md +446 -0
- package/plugins/specweave/commands/specweave-next.md +148 -3
- package/plugins/specweave/commands/specweave-qa.md +2 -2
- package/plugins/specweave/hooks/pre-increment-start.sh +168 -0
- package/plugins/specweave/skills/SKILLS-INDEX.md +1 -1
- package/plugins/specweave-ado/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-ado/commands/specweave-ado-import-projects.md +331 -0
- package/plugins/specweave-alternatives/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-alternatives/commands/alternatives-analyze.md +336 -0
- package/plugins/specweave-alternatives/skills/architecture-alternatives/SKILL.md +651 -0
- package/plugins/specweave-alternatives/skills/bmad-method/SKILL.md +420 -0
- package/plugins/specweave-alternatives/skills/spec-kit-expert/SKILL.md +487 -0
- package/plugins/specweave-backend/commands/api-scaffold.md +80 -0
- package/plugins/specweave-backend/commands/crud-generate.md +109 -0
- package/plugins/specweave-backend/commands/migration-generate.md +139 -0
- package/plugins/specweave-confluent/commands/connector-deploy.md +154 -0
- package/plugins/specweave-confluent/commands/ksqldb-query.md +179 -0
- package/plugins/specweave-confluent/commands/schema-register.md +123 -0
- package/plugins/specweave-core/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-core/commands/architecture-review.md +288 -0
- package/plugins/specweave-core/commands/code-review.md +213 -0
- package/plugins/specweave-core/commands/refactor-plan.md +249 -0
- package/plugins/specweave-core/skills/code-quality/SKILL.md +157 -0
- package/plugins/specweave-core/skills/design-patterns/SKILL.md +244 -0
- package/plugins/specweave-core/skills/software-architecture/SKILL.md +83 -0
- package/plugins/specweave-cost-optimizer/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-cost-optimizer/commands/cost-analyze.md +360 -0
- package/plugins/specweave-cost-optimizer/commands/cost-optimize.md +480 -0
- package/plugins/specweave-cost-optimizer/skills/aws-cost-expert/SKILL.md +416 -0
- package/plugins/specweave-cost-optimizer/skills/cloud-pricing/SKILL.md +325 -0
- package/plugins/specweave-cost-optimizer/skills/cost-optimization/SKILL.md +337 -0
- package/plugins/specweave-diagrams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-diagrams/commands/diagrams-generate.md +168 -0
- package/plugins/specweave-docs/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-docs/commands/docs-generate.md +441 -0
- package/plugins/specweave-docs/commands/docs-init.md +334 -0
- package/plugins/specweave-docs/skills/docusaurus/SKILL.md +581 -0
- package/plugins/specweave-docs/skills/spec-driven-brainstorming/SKILL.md +689 -0
- package/plugins/specweave-docs/skills/technical-writing/SKILL.md +1039 -0
- package/plugins/specweave-docs-preview/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-figma/.claude-plugin/plugin.json +23 -0
- package/plugins/specweave-figma/commands/figma-import.md +690 -0
- package/plugins/specweave-figma/commands/figma-to-react.md +834 -0
- package/plugins/specweave-figma/commands/figma-tokens.md +815 -0
- package/plugins/specweave-frontend/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-frontend/agents/frontend-architect/AGENT.md +408 -0
- package/plugins/specweave-frontend/agents/frontend-architect/README.md +385 -0
- package/plugins/specweave-frontend/agents/frontend-architect/examples.md +590 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/component-template.tsx +152 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/hook-template.ts +311 -0
- package/plugins/specweave-frontend/agents/frontend-architect/templates/page-template.tsx +228 -0
- package/plugins/specweave-frontend/commands/component-generate.md +510 -0
- package/plugins/specweave-frontend/commands/design-system-init.md +494 -0
- package/plugins/specweave-frontend/commands/frontend-scaffold.md +207 -0
- package/plugins/specweave-frontend/commands/nextjs-setup.md +396 -0
- package/plugins/specweave-frontend/skills/design-system-architect/SKILL.md +278 -0
- package/plugins/specweave-frontend/skills/frontend/SKILL.md +420 -0
- package/plugins/specweave-frontend/skills/nextjs/SKILL.md +546 -0
- package/plugins/specweave-github/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +212 -0
- package/plugins/specweave-infrastructure/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-jira/commands/import-projects.js +183 -0
- package/plugins/specweave-jira/commands/import-projects.md +97 -0
- package/plugins/specweave-jira/commands/import-projects.ts +288 -0
- package/plugins/specweave-jira/commands/specweave-jira-import-projects.md +298 -0
- package/plugins/specweave-kafka/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kafka-streams/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-kubernetes/commands/cluster-setup.md +262 -0
- package/plugins/specweave-kubernetes/commands/deployment-generate.md +242 -0
- package/plugins/specweave-kubernetes/commands/helm-scaffold.md +333 -0
- package/plugins/specweave-ml/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-mobile/commands/app-scaffold.md +233 -0
- package/plugins/specweave-mobile/commands/build-config.md +256 -0
- package/plugins/specweave-mobile/commands/screen-generate.md +289 -0
- package/plugins/specweave-n8n/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-payments/commands/stripe-setup.md +931 -0
- package/plugins/specweave-payments/commands/subscription-flow.md +1193 -0
- package/plugins/specweave-payments/commands/subscription-manage.md +386 -0
- package/plugins/specweave-payments/commands/webhook-setup.md +295 -0
- package/plugins/specweave-plugin-dev/.claude-plugin/plugin.json +13 -12
- package/plugins/specweave-plugin-dev/commands/plugin-create.md +333 -0
- package/plugins/specweave-plugin-dev/commands/plugin-publish.md +339 -0
- package/plugins/specweave-plugin-dev/commands/plugin-test.md +293 -0
- package/plugins/specweave-plugin-dev/skills/claude-sdk/SKILL.md +162 -0
- package/plugins/specweave-plugin-dev/skills/marketplace-publishing/SKILL.md +263 -0
- package/plugins/specweave-plugin-dev/skills/plugin-development/SKILL.md +316 -0
- package/plugins/specweave-release/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave-release/commands/specweave-release-npm.md +110 -0
- package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +168 -0
- package/plugins/specweave-testing/.claude-plugin/plugin.json +21 -0
- package/plugins/specweave-testing/agents/qa-engineer/AGENT.md +818 -0
- package/plugins/specweave-testing/agents/qa-engineer/README.md +443 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/playwright-e2e-test.ts +470 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/test-data-factory.ts +507 -0
- package/plugins/specweave-testing/agents/qa-engineer/templates/vitest-unit-test.ts +400 -0
- package/plugins/specweave-testing/agents/qa-engineer/test-strategies.md +726 -0
- package/plugins/specweave-testing/commands/e2e-setup.md +1081 -0
- package/plugins/specweave-testing/commands/test-coverage.md +979 -0
- package/plugins/specweave-testing/commands/test-generate.md +1156 -0
- package/plugins/specweave-testing/commands/test-init.md +409 -0
- package/plugins/specweave-testing/skills/e2e-playwright/SKILL.md +769 -0
- package/plugins/specweave-testing/skills/tdd-expert/SKILL.md +934 -0
- package/plugins/specweave-testing/skills/unit-testing-expert/SKILL.md +1011 -0
- package/plugins/specweave-tooling/.claude-plugin/plugin.json +22 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-create.md +691 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-package.md +751 -0
- package/plugins/specweave-tooling/commands/specweave-tooling-skill-validate.md +858 -0
- package/plugins/specweave-ui/.claude-plugin/plugin.json +10 -0
- package/plugins/specweave-ui/commands/ui-automate.md +199 -0
- package/plugins/specweave-ui/commands/ui-inspect.md +70 -0
- package/plugins/specweave-ui/skills/browser-automation/SKILL.md +314 -0
- package/plugins/specweave-ui/skills/ui-testing/SKILL.md +716 -0
- package/plugins/specweave-ui/skills/visual-regression/SKILL.md +728 -0
- package/plugins/specweave/commands/check-hooks.md +0 -257
- package/plugins/specweave/commands/specweave-archive-increments.md +0 -82
- package/plugins/specweave-plugin-dev/skills/plugin-expert/SKILL.md +0 -1231
- /package/plugins/specweave/{agents/code-reviewer.md → skills/code-reviewer/SKILL.md} +0 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Smart Filter Module
|
|
3
|
+
*
|
|
4
|
+
* Provides intelligent filtering for project imports with JQL/WIQL support,
|
|
5
|
+
* preview mode, and dry-run capabilities.
|
|
6
|
+
*
|
|
7
|
+
* @module cli/helpers/smart-filter
|
|
8
|
+
*/
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
import inquirer from 'inquirer';
|
|
11
|
+
/**
|
|
12
|
+
* Validate JQL query syntax (JIRA)
|
|
13
|
+
*
|
|
14
|
+
* Basic validation:
|
|
15
|
+
* - Check for common JQL keywords (project, type, status, etc.)
|
|
16
|
+
* - Check for balanced parentheses
|
|
17
|
+
* - Check for valid operators (=, !=, IN, NOT IN, etc.)
|
|
18
|
+
*
|
|
19
|
+
* @param jql - JQL query string
|
|
20
|
+
* @returns Validation result with error message if invalid
|
|
21
|
+
*/
|
|
22
|
+
export function validateJQL(jql) {
|
|
23
|
+
if (!jql || jql.trim().length === 0) {
|
|
24
|
+
return { valid: false, error: 'JQL query cannot be empty' };
|
|
25
|
+
}
|
|
26
|
+
// Check balanced parentheses
|
|
27
|
+
const openCount = (jql.match(/\(/g) || []).length;
|
|
28
|
+
const closeCount = (jql.match(/\)/g) || []).length;
|
|
29
|
+
if (openCount !== closeCount) {
|
|
30
|
+
return { valid: false, error: 'Unbalanced parentheses in JQL query' };
|
|
31
|
+
}
|
|
32
|
+
// Check for valid JQL keywords
|
|
33
|
+
const validKeywords = [
|
|
34
|
+
'project', 'type', 'status', 'priority', 'assignee', 'reporter',
|
|
35
|
+
'created', 'updated', 'resolved', 'labels', 'component', 'fixVersion',
|
|
36
|
+
'affectsVersion', 'sprint', 'epic', 'parent', 'key'
|
|
37
|
+
];
|
|
38
|
+
const hasValidKeyword = validKeywords.some(keyword => jql.toLowerCase().includes(keyword.toLowerCase()));
|
|
39
|
+
if (!hasValidKeyword) {
|
|
40
|
+
return {
|
|
41
|
+
valid: false,
|
|
42
|
+
error: 'JQL query must include at least one valid field (project, type, status, etc.)'
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
// Check for valid operators
|
|
46
|
+
const validOperators = ['=', '!=', 'IN', 'NOT IN', '~', '!~', '>', '<', '>=', '<=', 'IS', 'IS NOT'];
|
|
47
|
+
const hasValidOperator = validOperators.some(op => jql.includes(op));
|
|
48
|
+
if (!hasValidOperator) {
|
|
49
|
+
return {
|
|
50
|
+
valid: false,
|
|
51
|
+
error: 'JQL query must include at least one valid operator (=, IN, etc.)'
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
return { valid: true };
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Validate WIQL query syntax (Azure DevOps)
|
|
58
|
+
*
|
|
59
|
+
* Basic validation for WIQL (Work Item Query Language)
|
|
60
|
+
*
|
|
61
|
+
* @param wiql - WIQL query string
|
|
62
|
+
* @returns Validation result with error message if invalid
|
|
63
|
+
*/
|
|
64
|
+
export function validateWIQL(wiql) {
|
|
65
|
+
if (!wiql || wiql.trim().length === 0) {
|
|
66
|
+
return { valid: false, error: 'WIQL query cannot be empty' };
|
|
67
|
+
}
|
|
68
|
+
// WIQL must start with SELECT
|
|
69
|
+
if (!wiql.trim().toUpperCase().startsWith('SELECT')) {
|
|
70
|
+
return {
|
|
71
|
+
valid: false,
|
|
72
|
+
error: 'WIQL query must start with SELECT'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
// WIQL must contain FROM
|
|
76
|
+
if (!wiql.toUpperCase().includes('FROM')) {
|
|
77
|
+
return {
|
|
78
|
+
valid: false,
|
|
79
|
+
error: 'WIQL query must include FROM clause'
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return { valid: true };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Prompt user for filter criteria
|
|
86
|
+
*
|
|
87
|
+
* Interactive prompts for:
|
|
88
|
+
* - Filter type (JQL/WIQL, project keys, or none)
|
|
89
|
+
* - Exclude archived projects
|
|
90
|
+
* - Exclude deleted projects
|
|
91
|
+
* - Only active projects
|
|
92
|
+
*
|
|
93
|
+
* @param provider - Filter provider (jira or ado)
|
|
94
|
+
* @returns Filter criteria
|
|
95
|
+
*/
|
|
96
|
+
export async function promptFilterCriteria(provider) {
|
|
97
|
+
console.log(chalk.cyan(`\n🔍 ${provider.toUpperCase()} Filter Configuration\n`));
|
|
98
|
+
const criteria = { provider };
|
|
99
|
+
// Step 1: Filter type
|
|
100
|
+
const filterType = await inquirer.prompt([
|
|
101
|
+
{
|
|
102
|
+
type: 'list',
|
|
103
|
+
name: 'type',
|
|
104
|
+
message: 'How would you like to filter projects?',
|
|
105
|
+
default: 'none',
|
|
106
|
+
choices: [
|
|
107
|
+
{
|
|
108
|
+
name: chalk.green('No filter') + chalk.gray(' - Import all projects'),
|
|
109
|
+
value: 'none'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: `Custom ${provider === 'jira' ? 'JQL' : 'WIQL'} query` + chalk.gray(' - Advanced filtering'),
|
|
113
|
+
value: 'query'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Specific project keys' + chalk.gray(' - Manual selection'),
|
|
117
|
+
value: 'keys'
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
]);
|
|
122
|
+
if (filterType.type === 'query') {
|
|
123
|
+
// Custom query
|
|
124
|
+
const queryAnswer = await inquirer.prompt([
|
|
125
|
+
{
|
|
126
|
+
type: 'input',
|
|
127
|
+
name: 'query',
|
|
128
|
+
message: `Enter ${provider === 'jira' ? 'JQL' : 'WIQL'} query:`,
|
|
129
|
+
validate: (input) => {
|
|
130
|
+
const validation = provider === 'jira'
|
|
131
|
+
? validateJQL(input)
|
|
132
|
+
: validateWIQL(input);
|
|
133
|
+
return validation.valid || chalk.red(validation.error || 'Invalid query');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
]);
|
|
137
|
+
criteria.query = queryAnswer.query;
|
|
138
|
+
}
|
|
139
|
+
else if (filterType.type === 'keys') {
|
|
140
|
+
// Specific project keys
|
|
141
|
+
const keysAnswer = await inquirer.prompt([
|
|
142
|
+
{
|
|
143
|
+
type: 'input',
|
|
144
|
+
name: 'keys',
|
|
145
|
+
message: 'Enter project keys (comma-separated):',
|
|
146
|
+
validate: (input) => {
|
|
147
|
+
const trimmed = input.trim();
|
|
148
|
+
if (!trimmed) {
|
|
149
|
+
return chalk.red('Project keys cannot be empty');
|
|
150
|
+
}
|
|
151
|
+
const keys = trimmed.split(',').map(k => k.trim()).filter(k => k.length > 0);
|
|
152
|
+
if (keys.length === 0) {
|
|
153
|
+
return chalk.red('At least one project key required');
|
|
154
|
+
}
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]);
|
|
159
|
+
criteria.projectKeys = keysAnswer.keys.split(',').map(k => k.trim()).filter(k => k.length > 0);
|
|
160
|
+
}
|
|
161
|
+
// Step 2: Additional filters
|
|
162
|
+
const additionalFilters = await inquirer.prompt([
|
|
163
|
+
{
|
|
164
|
+
type: 'confirm',
|
|
165
|
+
name: 'excludeArchived',
|
|
166
|
+
message: 'Exclude archived projects?',
|
|
167
|
+
default: true
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'confirm',
|
|
171
|
+
name: 'excludeDeleted',
|
|
172
|
+
message: 'Exclude deleted projects?',
|
|
173
|
+
default: true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'confirm',
|
|
177
|
+
name: 'onlyActive',
|
|
178
|
+
message: 'Only import active projects?',
|
|
179
|
+
default: false
|
|
180
|
+
}
|
|
181
|
+
]);
|
|
182
|
+
criteria.excludeArchived = additionalFilters.excludeArchived;
|
|
183
|
+
criteria.excludeDeleted = additionalFilters.excludeDeleted;
|
|
184
|
+
criteria.onlyActive = additionalFilters.onlyActive;
|
|
185
|
+
return criteria;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Apply filters to project list
|
|
189
|
+
*
|
|
190
|
+
* @param projects - List of projects to filter
|
|
191
|
+
* @param criteria - Filter criteria
|
|
192
|
+
* @returns Filtered project list
|
|
193
|
+
*/
|
|
194
|
+
export function applyFilters(projects, criteria) {
|
|
195
|
+
const total = projects.length;
|
|
196
|
+
let filtered = projects;
|
|
197
|
+
// Filter by project keys
|
|
198
|
+
if (criteria.projectKeys && criteria.projectKeys.length > 0) {
|
|
199
|
+
filtered = filtered.filter(p => criteria.projectKeys.includes(p.key) || criteria.projectKeys.includes(p.name));
|
|
200
|
+
}
|
|
201
|
+
// Exclude archived
|
|
202
|
+
if (criteria.excludeArchived) {
|
|
203
|
+
filtered = filtered.filter(p => !p.archived && p.archived !== true);
|
|
204
|
+
}
|
|
205
|
+
// Exclude deleted
|
|
206
|
+
if (criteria.excludeDeleted) {
|
|
207
|
+
filtered = filtered.filter(p => !p.deleted && p.deleted !== true);
|
|
208
|
+
}
|
|
209
|
+
// Only active
|
|
210
|
+
if (criteria.onlyActive) {
|
|
211
|
+
filtered = filtered.filter(p => p.status === 'active' || p.state === 'active');
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
total,
|
|
215
|
+
filtered: filtered.length,
|
|
216
|
+
excluded: total - filtered.length,
|
|
217
|
+
items: filtered,
|
|
218
|
+
criteria
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Preview filter results
|
|
223
|
+
*
|
|
224
|
+
* Shows summary of what would be imported with current filter criteria.
|
|
225
|
+
*
|
|
226
|
+
* @param result - Filter result
|
|
227
|
+
* @returns User confirmation to proceed
|
|
228
|
+
*/
|
|
229
|
+
export async function previewFilterResults(result) {
|
|
230
|
+
console.log(chalk.cyan('\n📊 Filter Preview\n'));
|
|
231
|
+
console.log(chalk.white(`Total projects: ${result.total}`));
|
|
232
|
+
console.log(chalk.green(`Filtered (import): ${result.filtered}`));
|
|
233
|
+
console.log(chalk.gray(`Excluded: ${result.excluded}`));
|
|
234
|
+
if (result.criteria.query) {
|
|
235
|
+
console.log(chalk.gray(`\nQuery: ${result.criteria.query}`));
|
|
236
|
+
}
|
|
237
|
+
if (result.criteria.projectKeys && result.criteria.projectKeys.length > 0) {
|
|
238
|
+
console.log(chalk.gray(`\nProject keys: ${result.criteria.projectKeys.join(', ')}`));
|
|
239
|
+
}
|
|
240
|
+
console.log(chalk.gray(`\nFilters applied:`));
|
|
241
|
+
console.log(chalk.gray(` - Exclude archived: ${result.criteria.excludeArchived ? 'Yes' : 'No'}`));
|
|
242
|
+
console.log(chalk.gray(` - Exclude deleted: ${result.criteria.excludeDeleted ? 'Yes' : 'No'}`));
|
|
243
|
+
console.log(chalk.gray(` - Only active: ${result.criteria.onlyActive ? 'Yes' : 'No'}`));
|
|
244
|
+
// Show sample projects (first 5)
|
|
245
|
+
if (result.items.length > 0) {
|
|
246
|
+
console.log(chalk.cyan('\n📋 Sample projects to import (first 5):\n'));
|
|
247
|
+
result.items.slice(0, 5).forEach((p, i) => {
|
|
248
|
+
console.log(chalk.gray(` ${i + 1}. ${p.key || p.name} - ${p.name}`));
|
|
249
|
+
});
|
|
250
|
+
if (result.items.length > 5) {
|
|
251
|
+
console.log(chalk.gray(` ... and ${result.items.length - 5} more\n`));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
// Confirmation
|
|
255
|
+
const answer = await inquirer.prompt([
|
|
256
|
+
{
|
|
257
|
+
type: 'confirm',
|
|
258
|
+
name: 'proceed',
|
|
259
|
+
message: 'Proceed with import?',
|
|
260
|
+
default: true
|
|
261
|
+
}
|
|
262
|
+
]);
|
|
263
|
+
return answer.proceed;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=smart-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-filter.js","sourceRoot":"","sources":["../../../../src/cli/helpers/smart-filter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAsBhC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,2BAA2B,EAAE,CAAC;IAC9D,CAAC;IAED,6BAA6B;IAC7B,MAAM,SAAS,GAAG,CAAC,GAA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YAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAED,eAAe;IACf,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAuB;QACzD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,sBAAsB;YAC/B,OAAO,EAAE,IAAI;SACd;KACF,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,OAAO,CAAC;AACxB,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { QualityAssessment, QualityGateResult, QualityGateDecision, QualityGateThresholds, TestCoverageResult, SecurityAuditResult } from './types.js';
|
|
8
8
|
/**
|
|
9
|
-
* Default quality gate thresholds (
|
|
9
|
+
* Default quality gate thresholds (Probability × Impact scoring)
|
|
10
10
|
*/
|
|
11
11
|
export declare const DEFAULT_THRESHOLDS: QualityGateThresholds;
|
|
12
12
|
export declare class QualityGateDecider {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @since v0.8.0
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
* Default quality gate thresholds (
|
|
8
|
+
* Default quality gate thresholds (Probability × Impact scoring)
|
|
9
9
|
*/
|
|
10
10
|
export const DEFAULT_THRESHOLDS = {
|
|
11
11
|
fail: {
|
|
@@ -37,7 +37,7 @@ export class QualityGateDecider {
|
|
|
37
37
|
const blockers = [];
|
|
38
38
|
const concerns = [];
|
|
39
39
|
const recommendations = [];
|
|
40
|
-
// Check 1: Risk Assessment (
|
|
40
|
+
// Check 1: Risk Assessment (Probability × Impact)
|
|
41
41
|
if (assessment.risk_assessment) {
|
|
42
42
|
this.assessRisks(assessment.risk_assessment, blockers, concerns);
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quality-gate-decider.js","sourceRoot":"","sources":["../../../../src/core/qa/quality-gate-decider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,GAAG,EAAgB,qBAAqB;QACnD,YAAY,EAAE,EAAE,EAAc,wBAAwB;QACtD,WAAW,EAAE,EAAE,EAAe,yBAAyB;QACvD,uBAAuB,EAAE,CAAC,EAAI,6BAA6B;KAC5D;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG,EAAgB,yBAAyB;QACvD,YAAY,EAAE,EAAE,EAAc,4BAA4B;QAC1D,WAAW,EAAE,EAAE,EAAe,6BAA6B;QAC3D,mBAAmB,EAAE,CAAC,EAAQ,6BAA6B;KAC5D;CACF,CAAC;AAEF,MAAM,OAAO,kBAAkB;IAG7B,YAAY,aAAoC,kBAAkB;QAChE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CACJ,UAA6B,EAC7B,YAAiC,EACjC,aAAmC;QAEnC,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,MAAM,eAAe,GAAuB,EAAE,CAAC;QAE/C,
|
|
1
|
+
{"version":3,"file":"quality-gate-decider.js","sourceRoot":"","sources":["../../../../src/core/qa/quality-gate-decider.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA0B;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,GAAG,EAAgB,qBAAqB;QACnD,YAAY,EAAE,EAAE,EAAc,wBAAwB;QACtD,WAAW,EAAE,EAAE,EAAe,yBAAyB;QACvD,uBAAuB,EAAE,CAAC,EAAI,6BAA6B;KAC5D;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,GAAG,EAAgB,yBAAyB;QACvD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G,CAAC,EAAE,CAAC;YACxB,OAAO;gBACL,QAAQ,EAAE,MAAM;gBAChB,SAAS,EAAE,SAAS,QAAQ,CAAC,MAAM,mDAAmD;aACvF,CAAC;QACJ,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,OAAO;gBACL,QAAQ,EAAE,UAAU;gBACpB,SAAS,EAAE,SAAS,QAAQ,CAAC,MAAM,sDAAsD;aAC1F,CAAC;QACJ,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,kDAAkD;SAC9D,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,QAA6B;QAClD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC;YACd,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC;YACd,KAAK,MAAM;gBACT,OAAO,IAAI,CAAC;QAChB,CAAC;IACH,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAA6B;QACnD,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,MAAM;gBACT,OAAO,OAAO,CAAC;YACjB,KAAK,UAAU;gBACb,OAAO,QAAQ,CAAC;YAClB,KAAK,MAAM;gBACT,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Risk Calculator using
|
|
2
|
+
* Risk Calculator using Probability × Impact scoring method
|
|
3
3
|
*
|
|
4
4
|
* @module qa/risk-calculator
|
|
5
5
|
* @since v0.8.0
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Risk, RiskAssessmentResult, RiskCategory, RiskSeverity } from './types.js';
|
|
8
8
|
export declare class RiskCalculator {
|
|
9
9
|
/**
|
|
10
|
-
* Calculate risk score using
|
|
10
|
+
* Calculate risk score using quantitative formula: P × I
|
|
11
11
|
*
|
|
12
12
|
* @param probability - Probability of risk occurring (0.0-1.0)
|
|
13
13
|
* @param impact - Impact severity if risk occurs (1-10)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Risk Calculator using
|
|
2
|
+
* Risk Calculator using Probability × Impact scoring method
|
|
3
3
|
*
|
|
4
4
|
* @module qa/risk-calculator
|
|
5
5
|
* @since v0.8.0
|
|
6
6
|
*/
|
|
7
7
|
export class RiskCalculator {
|
|
8
8
|
/**
|
|
9
|
-
* Calculate risk score using
|
|
9
|
+
* Calculate risk score using quantitative formula: P × I
|
|
10
10
|
*
|
|
11
11
|
* @param probability - Probability of risk occurring (0.0-1.0)
|
|
12
12
|
* @param impact - Impact severity if risk occurs (1-10)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-structure-manager.d.ts","sourceRoot":"","sources":["../../../../src/core/repo-structure/repo-structure-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;QACjC,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,YAAY,EAAE,KAAK,CAAC;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;QACjC,cAAc,EAAE,OAAO,CAAC;QACxB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAoB;gBAE5B,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;IAMrD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAsDrD;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;OAEG;YACW,WAAW;IAsBzB;;OAEG;YACW,mBAAmB;
|
|
1
|
+
{"version":3,"file":"repo-structure-manager.d.ts","sourceRoot":"","sources":["../../../../src/core/repo-structure/repo-structure-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;QACjC,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,YAAY,EAAE,KAAK,CAAC;QAClB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;QACjC,cAAc,EAAE,OAAO,CAAC;QACxB,QAAQ,EAAE,OAAO,CAAC;KACnB,CAAC,CAAC;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAoB;gBAE5B,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;IAMrD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAsDrD;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;OAEG;YACW,WAAW;IAsBzB;;OAEG;YACW,mBAAmB;IAoIjC;;;;;;;;OAQG;YACW,kBAAkB;IAsdhC;;OAEG;YACW,cAAc;IAQ5B;;OAEG;YACW,iBAAiB;IA4E/B;;OAEG;IACG,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiF1E;;OAEG;YACW,eAAe;IA8C7B;;OAEG;YACW,gBAAgB;IAgC9B;;OAEG;YACW,gBAAgB;IAmC9B;;OAEG;YACW,oBAAoB;IAmBlC;;OAEG;IACG,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAiFtE;;;;;OAKG;IACH,OAAO,CAAC,wBAAwB;IAyBhC;;;;;OAKG;IACG,wBAAwB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAwC3E"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* - Organize specs per project/team
|
|
15
15
|
* - Split tasks between repositories
|
|
16
16
|
*/
|
|
17
|
-
import
|
|
17
|
+
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
18
18
|
import path from 'path';
|
|
19
19
|
import chalk from 'chalk';
|
|
20
20
|
import inquirer from 'inquirer';
|
|
@@ -127,7 +127,7 @@ export class RepoStructureManager {
|
|
|
127
127
|
async configureSingleRepo() {
|
|
128
128
|
console.log(chalk.cyan('\n📦 Single Repository Configuration\n'));
|
|
129
129
|
// Check if repo already exists
|
|
130
|
-
const hasGit =
|
|
130
|
+
const hasGit = existsSync(path.join(this.projectPath, '.git'));
|
|
131
131
|
if (hasGit) {
|
|
132
132
|
// Try to detect existing remote
|
|
133
133
|
try {
|
|
@@ -147,15 +147,36 @@ export class RepoStructureManager {
|
|
|
147
147
|
default: true
|
|
148
148
|
}]);
|
|
149
149
|
if (useExisting) {
|
|
150
|
+
// Fetch description and visibility from GitHub API
|
|
151
|
+
let description = `${repo} - SpecWeave project`;
|
|
152
|
+
let visibility = 'private';
|
|
153
|
+
if (this.githubToken) {
|
|
154
|
+
try {
|
|
155
|
+
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`, {
|
|
156
|
+
headers: {
|
|
157
|
+
'Authorization': `Bearer ${this.githubToken}`,
|
|
158
|
+
'Accept': 'application/vnd.github+json'
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
if (response.ok) {
|
|
162
|
+
const data = await response.json();
|
|
163
|
+
description = data.description || description;
|
|
164
|
+
visibility = data.private ? 'private' : 'public';
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch {
|
|
168
|
+
// Use defaults if fetch fails
|
|
169
|
+
}
|
|
170
|
+
}
|
|
150
171
|
return {
|
|
151
172
|
architecture: 'single',
|
|
152
173
|
repositories: [{
|
|
153
174
|
id: 'main',
|
|
154
175
|
name: repo,
|
|
155
176
|
owner: owner,
|
|
156
|
-
description:
|
|
177
|
+
description: description,
|
|
157
178
|
path: '.',
|
|
158
|
-
visibility:
|
|
179
|
+
visibility: visibility, // Fetched from GitHub API
|
|
159
180
|
createOnGitHub: false,
|
|
160
181
|
isNested: false
|
|
161
182
|
}]
|
|
@@ -195,19 +216,23 @@ export class RepoStructureManager {
|
|
|
195
216
|
default: !hasGit
|
|
196
217
|
}
|
|
197
218
|
]);
|
|
198
|
-
// Ask about visibility
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
// Ask about visibility only if creating a new repository
|
|
220
|
+
let visibility = 'private';
|
|
221
|
+
if (answers.createOnGitHub) {
|
|
222
|
+
const visibilityPrompt = getVisibilityPrompt(answers.repo);
|
|
223
|
+
const result = await inquirer.prompt([{
|
|
224
|
+
type: 'list',
|
|
225
|
+
name: 'visibility',
|
|
226
|
+
message: visibilityPrompt.question,
|
|
227
|
+
choices: visibilityPrompt.options.map(opt => ({
|
|
228
|
+
name: `${opt.label}\n${chalk.gray(opt.description)}`,
|
|
229
|
+
value: opt.value,
|
|
230
|
+
short: opt.label
|
|
231
|
+
})),
|
|
232
|
+
default: visibilityPrompt.default
|
|
233
|
+
}]);
|
|
234
|
+
visibility = result.visibility;
|
|
235
|
+
}
|
|
211
236
|
return {
|
|
212
237
|
architecture: 'single',
|
|
213
238
|
repositories: [{
|
|
@@ -360,8 +385,9 @@ export class RepoStructureManager {
|
|
|
360
385
|
}
|
|
361
386
|
}
|
|
362
387
|
]);
|
|
363
|
-
// Fetch description from GitHub API (or use
|
|
388
|
+
// Fetch description and visibility from GitHub API (or use defaults)
|
|
364
389
|
let description = 'SpecWeave parent repository - specs, docs, and architecture';
|
|
390
|
+
let existingVisibility = 'private';
|
|
365
391
|
if (this.githubToken) {
|
|
366
392
|
try {
|
|
367
393
|
const response = await fetch(`https://api.github.com/repos/${ownerPrompt.owner}/${repoPrompt.parentName}`, {
|
|
@@ -373,17 +399,19 @@ export class RepoStructureManager {
|
|
|
373
399
|
if (response.ok) {
|
|
374
400
|
const data = await response.json();
|
|
375
401
|
description = data.description || description;
|
|
402
|
+
existingVisibility = data.private ? 'private' : 'public';
|
|
376
403
|
}
|
|
377
404
|
}
|
|
378
405
|
catch {
|
|
379
|
-
// Use
|
|
406
|
+
// Use defaults if fetch fails
|
|
380
407
|
}
|
|
381
408
|
}
|
|
382
409
|
parentAnswers = {
|
|
383
410
|
owner: ownerPrompt.owner,
|
|
384
411
|
parentName: repoPrompt.parentName,
|
|
385
412
|
description: description,
|
|
386
|
-
createOnGitHub: false // Don't create, it already exists!
|
|
413
|
+
createOnGitHub: false, // Don't create, it already exists!
|
|
414
|
+
visibility: existingVisibility // Use existing visibility from GitHub
|
|
387
415
|
};
|
|
388
416
|
console.log(chalk.green(`\n✓ Using existing repository: ${ownerPrompt.owner}/${repoPrompt.parentName}\n`));
|
|
389
417
|
}
|
|
@@ -447,9 +475,10 @@ export class RepoStructureManager {
|
|
|
447
475
|
parentAnswers = { ...ownerPrompt, ...remainingAnswers };
|
|
448
476
|
}
|
|
449
477
|
}
|
|
450
|
-
// Ask about visibility for parent repo (only if creating on GitHub)
|
|
478
|
+
// Ask about visibility for parent repo (only if creating NEW repo on GitHub)
|
|
451
479
|
let parentVisibility = 'private';
|
|
452
|
-
if (!isLocalParent) {
|
|
480
|
+
if (!isLocalParent && parentAnswers.createOnGitHub) {
|
|
481
|
+
// Only prompt for visibility when creating a NEW repository
|
|
453
482
|
const parentVisibilityPrompt = getVisibilityPrompt(parentAnswers.parentName);
|
|
454
483
|
const result = await inquirer.prompt([{
|
|
455
484
|
type: 'list',
|
|
@@ -464,6 +493,10 @@ export class RepoStructureManager {
|
|
|
464
493
|
}]);
|
|
465
494
|
parentVisibility = result.parentVisibility;
|
|
466
495
|
}
|
|
496
|
+
else if (!isLocalParent && parentAnswers.visibility) {
|
|
497
|
+
// Use existing repository's visibility (fetched from GitHub API)
|
|
498
|
+
parentVisibility = parentAnswers.visibility;
|
|
499
|
+
}
|
|
467
500
|
config.parentRepo = {
|
|
468
501
|
name: parentAnswers.parentName,
|
|
469
502
|
owner: parentAnswers.owner,
|
|
@@ -713,7 +746,7 @@ export class RepoStructureManager {
|
|
|
713
746
|
type: 'confirm',
|
|
714
747
|
name: 'createOnGitHub',
|
|
715
748
|
message: 'Create repository on GitHub?',
|
|
716
|
-
default: !
|
|
749
|
+
default: !existsSync(path.join(this.projectPath, '.git'))
|
|
717
750
|
}
|
|
718
751
|
]);
|
|
719
752
|
// Ask about visibility
|
|
@@ -951,7 +984,7 @@ export class RepoStructureManager {
|
|
|
951
984
|
if (config.architecture === 'parent') {
|
|
952
985
|
// Parent repo approach: ROOT-LEVEL cloning (not services/!)
|
|
953
986
|
// Initialize parent repo at root
|
|
954
|
-
if (!
|
|
987
|
+
if (!existsSync(path.join(this.projectPath, '.git'))) {
|
|
955
988
|
execFileNoThrowSync('git', ['init'], { cwd: this.projectPath });
|
|
956
989
|
if (config.parentRepo) {
|
|
957
990
|
const remoteUrl = `https://github.com/${config.parentRepo.owner}/${config.parentRepo.name}.git`;
|
|
@@ -962,11 +995,11 @@ export class RepoStructureManager {
|
|
|
962
995
|
for (const repo of config.repositories) {
|
|
963
996
|
const repoPath = path.join(this.projectPath, repo.path);
|
|
964
997
|
// Create directory if needed
|
|
965
|
-
if (!
|
|
966
|
-
|
|
998
|
+
if (!existsSync(repoPath)) {
|
|
999
|
+
mkdirSync(repoPath, { recursive: true });
|
|
967
1000
|
}
|
|
968
1001
|
// Initialize git
|
|
969
|
-
if (!
|
|
1002
|
+
if (!existsSync(path.join(repoPath, '.git'))) {
|
|
970
1003
|
execFileNoThrowSync('git', ['init'], { cwd: repoPath });
|
|
971
1004
|
const remoteUrl = `https://github.com/${repo.owner}/${repo.name}.git`;
|
|
972
1005
|
execFileNoThrowSync('git', ['remote', 'add', 'origin', remoteUrl], { cwd: repoPath });
|
|
@@ -979,10 +1012,10 @@ export class RepoStructureManager {
|
|
|
979
1012
|
// Standard multi-repo: repos as subdirectories
|
|
980
1013
|
for (const repo of config.repositories) {
|
|
981
1014
|
const repoPath = path.join(this.projectPath, repo.path);
|
|
982
|
-
if (!
|
|
983
|
-
|
|
1015
|
+
if (!existsSync(repoPath)) {
|
|
1016
|
+
mkdirSync(repoPath, { recursive: true });
|
|
984
1017
|
}
|
|
985
|
-
if (!
|
|
1018
|
+
if (!existsSync(path.join(repoPath, '.git'))) {
|
|
986
1019
|
execFileNoThrowSync('git', ['init'], { cwd: repoPath });
|
|
987
1020
|
const remoteUrl = `https://github.com/${repo.owner}/${repo.name}.git`;
|
|
988
1021
|
execFileNoThrowSync('git', ['remote', 'add', 'origin', remoteUrl], { cwd: repoPath });
|
|
@@ -992,7 +1025,7 @@ export class RepoStructureManager {
|
|
|
992
1025
|
}
|
|
993
1026
|
else {
|
|
994
1027
|
// Single repo or monorepo
|
|
995
|
-
if (!
|
|
1028
|
+
if (!existsSync(path.join(this.projectPath, '.git'))) {
|
|
996
1029
|
execFileNoThrowSync('git', ['init'], { cwd: this.projectPath });
|
|
997
1030
|
const repo = config.repositories[0];
|
|
998
1031
|
if (repo) {
|
|
@@ -1004,8 +1037,8 @@ export class RepoStructureManager {
|
|
|
1004
1037
|
if (config.architecture === 'monorepo' && config.monorepoProjects) {
|
|
1005
1038
|
for (const project of config.monorepoProjects) {
|
|
1006
1039
|
const projectPath = path.join(this.projectPath, 'packages', project);
|
|
1007
|
-
if (!
|
|
1008
|
-
|
|
1040
|
+
if (!existsSync(projectPath)) {
|
|
1041
|
+
mkdirSync(projectPath, { recursive: true });
|
|
1009
1042
|
}
|
|
1010
1043
|
this.createBasicRepoStructure(projectPath, project);
|
|
1011
1044
|
}
|
|
@@ -1024,21 +1057,21 @@ export class RepoStructureManager {
|
|
|
1024
1057
|
const dirs = ['src', 'tests'];
|
|
1025
1058
|
for (const dir of dirs) {
|
|
1026
1059
|
const dirPath = path.join(repoPath, dir);
|
|
1027
|
-
if (!
|
|
1028
|
-
|
|
1060
|
+
if (!existsSync(dirPath)) {
|
|
1061
|
+
mkdirSync(dirPath, { recursive: true });
|
|
1029
1062
|
}
|
|
1030
1063
|
}
|
|
1031
1064
|
// Create README.md
|
|
1032
1065
|
const readmePath = path.join(repoPath, 'README.md');
|
|
1033
|
-
if (!
|
|
1066
|
+
if (!existsSync(readmePath)) {
|
|
1034
1067
|
const readmeContent = `# ${projectId}\n\n${projectId} service/component.\n\nPart of SpecWeave multi-repository project.\n`;
|
|
1035
|
-
|
|
1068
|
+
writeFileSync(readmePath, readmeContent);
|
|
1036
1069
|
}
|
|
1037
1070
|
// Create .gitignore
|
|
1038
1071
|
const gitignorePath = path.join(repoPath, '.gitignore');
|
|
1039
|
-
if (!
|
|
1072
|
+
if (!existsSync(gitignorePath)) {
|
|
1040
1073
|
const gitignoreContent = `node_modules/\ndist/\n.env\n.DS_Store\n*.log\n`;
|
|
1041
|
-
|
|
1074
|
+
writeFileSync(gitignorePath, gitignoreContent);
|
|
1042
1075
|
}
|
|
1043
1076
|
}
|
|
1044
1077
|
/**
|
|
@@ -1054,8 +1087,8 @@ export class RepoStructureManager {
|
|
|
1054
1087
|
// Monorepo: create specs folder for each project
|
|
1055
1088
|
for (const project of config.monorepoProjects) {
|
|
1056
1089
|
const projectSpecPath = path.join(specweavePath, 'docs', 'internal', 'specs', project.toLowerCase());
|
|
1057
|
-
if (!
|
|
1058
|
-
|
|
1090
|
+
if (!existsSync(projectSpecPath)) {
|
|
1091
|
+
mkdirSync(projectSpecPath, { recursive: true });
|
|
1059
1092
|
}
|
|
1060
1093
|
console.log(chalk.gray(` ✓ Created project structure: ${project}`));
|
|
1061
1094
|
}
|
|
@@ -1064,8 +1097,8 @@ export class RepoStructureManager {
|
|
|
1064
1097
|
// Multi-repo: create specs folder for each repository
|
|
1065
1098
|
for (const repo of config.repositories) {
|
|
1066
1099
|
const projectSpecPath = path.join(specweavePath, 'docs', 'internal', 'specs', repo.id);
|
|
1067
|
-
if (!
|
|
1068
|
-
|
|
1100
|
+
if (!existsSync(projectSpecPath)) {
|
|
1101
|
+
mkdirSync(projectSpecPath, { recursive: true });
|
|
1069
1102
|
}
|
|
1070
1103
|
console.log(chalk.gray(` ✓ Created project structure: ${repo.id}`));
|
|
1071
1104
|
}
|