specweave 2.2.1 → 2.2.2
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 +2 -2
- package/CLAUDE.md +21 -36
- package/dist/src/cli/dispatcher.d.ts +1 -1
- package/dist/src/cli/dispatcher.js +1 -1
- package/dist/src/cli/helpers/init/instruction-file-merger.js +2 -2
- package/dist/src/cli/helpers/init/instruction-file-merger.js.map +1 -1
- package/dist/src/core/auto/completion-evaluator.d.ts +1 -1
- package/dist/src/core/auto/completion-evaluator.js +1 -1
- package/dist/src/core/fabric/security-judge.d.ts.map +1 -1
- package/dist/src/core/fabric/security-judge.js +37 -5
- package/dist/src/core/fabric/security-judge.js.map +1 -1
- package/dist/src/core/llm/index.d.ts +1 -1
- package/dist/src/core/llm/index.js +1 -1
- package/dist/src/core/llm/model-capabilities.d.ts +79 -0
- package/dist/src/core/llm/model-capabilities.d.ts.map +1 -0
- package/dist/src/core/llm/model-capabilities.js +157 -0
- package/dist/src/core/llm/model-capabilities.js.map +1 -0
- package/dist/src/core/llm/provider-factory.js +1 -1
- package/dist/src/core/llm/providers/anthropic-provider.d.ts +1 -0
- package/dist/src/core/llm/providers/anthropic-provider.d.ts.map +1 -1
- package/dist/src/core/llm/providers/anthropic-provider.js +38 -11
- package/dist/src/core/llm/providers/anthropic-provider.js.map +1 -1
- package/dist/src/core/llm/providers/bedrock-provider.d.ts.map +1 -1
- package/dist/src/core/llm/providers/bedrock-provider.js +10 -5
- package/dist/src/core/llm/providers/bedrock-provider.js.map +1 -1
- package/dist/src/core/llm/providers/claude-code-provider.js +1 -1
- package/dist/src/core/llm/types.d.ts +20 -1
- package/dist/src/core/llm/types.d.ts.map +1 -1
- package/dist/src/core/llm/types.js.map +1 -1
- package/dist/src/core/skill-gen/signal-collector.js +1 -1
- package/dist/src/core/skill-gen/signal-collector.js.map +1 -1
- package/dist/src/core/skill-gen/suggestion-engine.js +1 -1
- package/dist/src/core/skill-gen/suggestion-engine.js.map +1 -1
- package/dist/src/core/skill-gen/types.d.ts +1 -1
- package/dist/src/core/skill-gen/types.d.ts.map +1 -1
- package/dist/src/core/skill-refine/haiku-diff.d.ts +25 -2
- package/dist/src/core/skill-refine/haiku-diff.d.ts.map +1 -1
- package/dist/src/core/skill-refine/haiku-diff.js +18 -5
- package/dist/src/core/skill-refine/haiku-diff.js.map +1 -1
- package/dist/src/core/skills/skill-judge.d.ts +16 -17
- package/dist/src/core/skills/skill-judge.d.ts.map +1 -1
- package/dist/src/core/skills/skill-judge.js +39 -36
- package/dist/src/core/skills/skill-judge.js.map +1 -1
- package/dist/src/dashboard/server/data/cost-aggregator.d.ts.map +1 -1
- package/dist/src/dashboard/server/data/cost-aggregator.js +2 -0
- package/dist/src/dashboard/server/data/cost-aggregator.js.map +1 -1
- package/dist/src/utils/pricing-constants.d.ts +1 -1
- package/dist/src/utils/pricing-constants.d.ts.map +1 -1
- package/dist/src/utils/pricing-constants.js +3 -1
- package/dist/src/utils/pricing-constants.js.map +1 -1
- package/package.json +2 -2
- package/plugins/specweave/.claude-plugin/plugin.json +1 -1
- package/plugins/specweave/.lint/skill-lint.test.ts +104 -92
- package/plugins/specweave/skills/team/agents/_protocol.md +8 -52
- package/plugins/specweave/skills/team/agents/backend.md +2 -5
- package/plugins/specweave/skills/team/agents/brainstorm-advocate.md +4 -2
- package/plugins/specweave/skills/team/agents/brainstorm-critic.md +4 -2
- package/plugins/specweave/skills/team/agents/brainstorm-pragmatist.md +4 -2
- package/plugins/specweave/skills/team/agents/database.md +0 -2
- package/plugins/specweave/skills/team/agents/testing.md +0 -2
- package/dist/src/cli/helpers/init/ado-repo-cloning.d.ts +0 -32
- package/dist/src/cli/helpers/init/ado-repo-cloning.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/ado-repo-cloning.js +0 -157
- package/dist/src/cli/helpers/init/ado-repo-cloning.js.map +0 -1
- package/dist/src/cli/helpers/init/api-docs-config.d.ts +0 -67
- package/dist/src/cli/helpers/init/api-docs-config.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/api-docs-config.js +0 -426
- package/dist/src/cli/helpers/init/api-docs-config.js.map +0 -1
- package/dist/src/cli/helpers/init/bitbucket-repo-cloning.d.ts +0 -42
- package/dist/src/cli/helpers/init/bitbucket-repo-cloning.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/bitbucket-repo-cloning.js +0 -261
- package/dist/src/cli/helpers/init/bitbucket-repo-cloning.js.map +0 -1
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts +0 -45
- package/dist/src/cli/helpers/init/brownfield-analysis.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/brownfield-analysis.js +0 -431
- package/dist/src/cli/helpers/init/brownfield-analysis.js.map +0 -1
- package/dist/src/cli/helpers/init/claude-settings-lsp.d.ts +0 -55
- package/dist/src/cli/helpers/init/claude-settings-lsp.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/claude-settings-lsp.js +0 -270
- package/dist/src/cli/helpers/init/claude-settings-lsp.js.map +0 -1
- package/dist/src/cli/helpers/init/multi-project-folders.d.ts +0 -15
- package/dist/src/cli/helpers/init/multi-project-folders.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/multi-project-folders.js +0 -43
- package/dist/src/cli/helpers/init/multi-project-folders.js.map +0 -1
- package/dist/src/cli/helpers/init/plugin-install-flags.d.ts +0 -114
- package/dist/src/cli/helpers/init/plugin-install-flags.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/plugin-install-flags.js +0 -202
- package/dist/src/cli/helpers/init/plugin-install-flags.js.map +0 -1
- package/dist/src/cli/helpers/init/prompt-flow.d.ts +0 -59
- package/dist/src/cli/helpers/init/prompt-flow.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/prompt-flow.js +0 -127
- package/dist/src/cli/helpers/init/prompt-flow.js.map +0 -1
- package/dist/src/cli/helpers/init/testing-config.d.ts +0 -69
- package/dist/src/cli/helpers/init/testing-config.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/testing-config.js +0 -433
- package/dist/src/cli/helpers/init/testing-config.js.map +0 -1
- package/dist/src/cli/helpers/init/umbrella-cloning.d.ts +0 -39
- package/dist/src/cli/helpers/init/umbrella-cloning.d.ts.map +0 -1
- package/dist/src/cli/helpers/init/umbrella-cloning.js +0 -121
- package/dist/src/cli/helpers/init/umbrella-cloning.js.map +0 -1
- package/plugins/specweave/.lint/skill-lint.ts +0 -51
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code LSP Plugin Auto-Configuration
|
|
3
|
-
*
|
|
4
|
-
* Automatically installs a local LSP plugin during `specweave init` and
|
|
5
|
-
* `specweave update` to enable code intelligence features like:
|
|
6
|
-
* - Go to Definition
|
|
7
|
-
* - Find References
|
|
8
|
-
* - Hover information
|
|
9
|
-
*
|
|
10
|
-
* This creates a local plugin at `.claude/plugins/specweave-lsp/` with
|
|
11
|
-
* proper `.lsp.json` configuration, which is the correct way to enable
|
|
12
|
-
* LSP in Claude Code (not via settings.json directly).
|
|
13
|
-
*/
|
|
14
|
-
import * as fs from '../../../utils/fs-native.js';
|
|
15
|
-
import * as path from 'path';
|
|
16
|
-
import { fileURLToPath } from 'url';
|
|
17
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
18
|
-
const __dirname = path.dirname(__filename);
|
|
19
|
-
/**
|
|
20
|
-
* All supported LSP server configurations
|
|
21
|
-
*/
|
|
22
|
-
const LSP_SERVERS = {
|
|
23
|
-
typescript: {
|
|
24
|
-
command: 'typescript-language-server',
|
|
25
|
-
args: ['--stdio'],
|
|
26
|
-
extensionToLanguage: {
|
|
27
|
-
'.ts': 'typescript',
|
|
28
|
-
'.tsx': 'typescriptreact',
|
|
29
|
-
'.js': 'javascript',
|
|
30
|
-
'.jsx': 'javascriptreact',
|
|
31
|
-
'.mjs': 'javascript',
|
|
32
|
-
'.cjs': 'javascript',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
python: {
|
|
36
|
-
command: 'pyright-langserver',
|
|
37
|
-
args: ['--stdio'],
|
|
38
|
-
extensionToLanguage: {
|
|
39
|
-
'.py': 'python',
|
|
40
|
-
'.pyi': 'python',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
go: {
|
|
44
|
-
command: 'gopls',
|
|
45
|
-
args: ['serve'],
|
|
46
|
-
extensionToLanguage: {
|
|
47
|
-
'.go': 'go',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
rust: {
|
|
51
|
-
command: 'rust-analyzer',
|
|
52
|
-
args: [],
|
|
53
|
-
extensionToLanguage: {
|
|
54
|
-
'.rs': 'rust',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
csharp: {
|
|
58
|
-
command: 'omnisharp',
|
|
59
|
-
args: ['-lsp'],
|
|
60
|
-
extensionToLanguage: {
|
|
61
|
-
'.cs': 'csharp',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Tech stack detection rules
|
|
67
|
-
*/
|
|
68
|
-
const TECH_DETECTION = {
|
|
69
|
-
typescript: {
|
|
70
|
-
files: ['tsconfig.json', 'tsconfig.base.json'],
|
|
71
|
-
patterns: [/typescript|@types\/node/i],
|
|
72
|
-
},
|
|
73
|
-
python: {
|
|
74
|
-
files: ['requirements.txt', 'pyproject.toml', 'setup.py', 'Pipfile'],
|
|
75
|
-
patterns: [/\.py$/],
|
|
76
|
-
},
|
|
77
|
-
go: {
|
|
78
|
-
files: ['go.mod', 'go.sum'],
|
|
79
|
-
patterns: [/\.go$/],
|
|
80
|
-
},
|
|
81
|
-
rust: {
|
|
82
|
-
files: ['Cargo.toml', 'Cargo.lock'],
|
|
83
|
-
patterns: [/\.rs$/],
|
|
84
|
-
},
|
|
85
|
-
csharp: {
|
|
86
|
-
files: ['*.csproj', '*.sln'],
|
|
87
|
-
patterns: [/\.cs$/],
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Get LSP server configuration for a language
|
|
92
|
-
*/
|
|
93
|
-
export function getLspServerConfig(language) {
|
|
94
|
-
const config = LSP_SERVERS[language];
|
|
95
|
-
if (!config) {
|
|
96
|
-
throw new Error(`Unknown language: ${language}`);
|
|
97
|
-
}
|
|
98
|
-
return config;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Detect tech stack in a project directory
|
|
102
|
-
*/
|
|
103
|
-
export function detectTechStack(projectDir) {
|
|
104
|
-
const detected = [];
|
|
105
|
-
for (const [tech, rules] of Object.entries(TECH_DETECTION)) {
|
|
106
|
-
// Check for indicator files
|
|
107
|
-
for (const file of rules.files) {
|
|
108
|
-
if (file.includes('*')) {
|
|
109
|
-
// Glob pattern
|
|
110
|
-
const pattern = file.replace('*', '');
|
|
111
|
-
try {
|
|
112
|
-
const files = fs.readdirSync(projectDir);
|
|
113
|
-
if (files.some((f) => f.endsWith(pattern))) {
|
|
114
|
-
detected.push(tech);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
// Directory not readable
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
// Exact file
|
|
124
|
-
if (fs.existsSync(path.join(projectDir, file))) {
|
|
125
|
-
detected.push(tech);
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Check package.json for dependencies
|
|
131
|
-
if (tech === 'typescript' && !detected.includes(tech)) {
|
|
132
|
-
const pkgPath = path.join(projectDir, 'package.json');
|
|
133
|
-
if (fs.existsSync(pkgPath)) {
|
|
134
|
-
try {
|
|
135
|
-
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
136
|
-
const deps = {
|
|
137
|
-
...pkg.dependencies,
|
|
138
|
-
...pkg.devDependencies,
|
|
139
|
-
};
|
|
140
|
-
if (deps.typescript || Object.keys(deps).some((k) => k.startsWith('@types/'))) {
|
|
141
|
-
detected.push(tech);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
catch {
|
|
145
|
-
// Invalid JSON
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
return [...new Set(detected)]; // Remove duplicates
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Build lspServers configuration based on detected tech stack
|
|
154
|
-
*/
|
|
155
|
-
export function buildLspServersConfig(techStack) {
|
|
156
|
-
const lspServers = {};
|
|
157
|
-
// Map tech to LSP server names
|
|
158
|
-
const techToServer = {
|
|
159
|
-
typescript: 'vtsls',
|
|
160
|
-
python: 'pyright',
|
|
161
|
-
go: 'gopls',
|
|
162
|
-
rust: 'rust-analyzer',
|
|
163
|
-
csharp: 'omnisharp',
|
|
164
|
-
};
|
|
165
|
-
for (const tech of techStack) {
|
|
166
|
-
const serverName = techToServer[tech];
|
|
167
|
-
if (serverName && LSP_SERVERS[tech]) {
|
|
168
|
-
lspServers[serverName] = LSP_SERVERS[tech];
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
// Always include TypeScript as default if no tech detected
|
|
172
|
-
if (Object.keys(lspServers).length === 0) {
|
|
173
|
-
lspServers.vtsls = LSP_SERVERS.typescript;
|
|
174
|
-
}
|
|
175
|
-
return lspServers;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Install local LSP plugin to .claude/plugins/specweave-lsp/
|
|
179
|
-
*
|
|
180
|
-
* This is the correct way to enable LSP in Claude Code - via a plugin
|
|
181
|
-
* with .lsp.json, not via settings.json directly.
|
|
182
|
-
*/
|
|
183
|
-
export async function installLocalLspPlugin(projectDir) {
|
|
184
|
-
const pluginDir = path.join(projectDir, '.claude', 'plugins', 'specweave-lsp');
|
|
185
|
-
const pluginJsonPath = path.join(pluginDir, '.claude-plugin', 'plugin.json');
|
|
186
|
-
const lspJsonPath = path.join(pluginDir, '.lsp.json');
|
|
187
|
-
// Skip if plugin already exists
|
|
188
|
-
if (fs.existsSync(pluginJsonPath) && fs.existsSync(lspJsonPath)) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
// Detect tech stack
|
|
192
|
-
const techStack = detectTechStack(projectDir);
|
|
193
|
-
const lspServers = buildLspServersConfig(techStack);
|
|
194
|
-
// Create plugin directory structure
|
|
195
|
-
fs.mkdirSync(path.join(pluginDir, '.claude-plugin'), { recursive: true });
|
|
196
|
-
// Write plugin.json
|
|
197
|
-
const pluginJson = {
|
|
198
|
-
name: 'specweave-lsp',
|
|
199
|
-
version: '1.0.0',
|
|
200
|
-
description: 'Auto-configured LSP servers for code intelligence',
|
|
201
|
-
author: {
|
|
202
|
-
name: 'SpecWeave',
|
|
203
|
-
url: 'https://spec-weave.com',
|
|
204
|
-
},
|
|
205
|
-
keywords: ['lsp', 'code-intelligence'],
|
|
206
|
-
};
|
|
207
|
-
fs.writeFileSync(pluginJsonPath, JSON.stringify(pluginJson, null, 2) + '\n');
|
|
208
|
-
// Write .lsp.json with detected servers
|
|
209
|
-
fs.writeFileSync(lspJsonPath, JSON.stringify(lspServers, null, 2) + '\n');
|
|
210
|
-
return true;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* Enable the local LSP plugin in settings.json
|
|
214
|
-
*/
|
|
215
|
-
export async function enableLspPluginInSettings(projectDir) {
|
|
216
|
-
const settingsPath = path.join(projectDir, '.claude', 'settings.json');
|
|
217
|
-
// Read existing settings or create new
|
|
218
|
-
let settings = {};
|
|
219
|
-
if (fs.existsSync(settingsPath)) {
|
|
220
|
-
try {
|
|
221
|
-
settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
222
|
-
}
|
|
223
|
-
catch {
|
|
224
|
-
settings = {};
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// Ensure .claude directory exists
|
|
228
|
-
fs.mkdirSync(path.join(projectDir, '.claude'), { recursive: true });
|
|
229
|
-
// Add plugin to enabledPlugins if not already there
|
|
230
|
-
const enabledPlugins = (settings.enabledPlugins || {});
|
|
231
|
-
// Enable the local plugin (path-based plugin)
|
|
232
|
-
enabledPlugins['./plugins/specweave-lsp'] = true;
|
|
233
|
-
settings.enabledPlugins = enabledPlugins;
|
|
234
|
-
// Write back
|
|
235
|
-
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Ensure LSP is configured during `specweave init`
|
|
239
|
-
*
|
|
240
|
-
* Creates a local LSP plugin and enables it in settings.json.
|
|
241
|
-
*/
|
|
242
|
-
export async function ensureClaudeSettingsWithLsp(projectDir) {
|
|
243
|
-
// Install the local LSP plugin
|
|
244
|
-
const installed = await installLocalLspPlugin(projectDir);
|
|
245
|
-
// Enable it in settings.json
|
|
246
|
-
await enableLspPluginInSettings(projectDir);
|
|
247
|
-
// For backwards compatibility, also add lspServers to settings.json
|
|
248
|
-
// (in case future Claude Code versions support this)
|
|
249
|
-
const settingsPath = path.join(projectDir, '.claude', 'settings.json');
|
|
250
|
-
if (fs.existsSync(settingsPath)) {
|
|
251
|
-
try {
|
|
252
|
-
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf-8'));
|
|
253
|
-
if (!settings.lspServers) {
|
|
254
|
-
const techStack = detectTechStack(projectDir);
|
|
255
|
-
settings.lspServers = buildLspServersConfig(techStack);
|
|
256
|
-
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
catch {
|
|
260
|
-
// Ignore errors
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Ensure LSP settings exist during `specweave update`
|
|
266
|
-
*/
|
|
267
|
-
export async function ensureLspSettingsOnUpdate(projectDir) {
|
|
268
|
-
await ensureClaudeSettingsWithLsp(projectDir);
|
|
269
|
-
}
|
|
270
|
-
//# sourceMappingURL=claude-settings-lsp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-settings-lsp.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/claude-settings-lsp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAClD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAW3C;;GAEG;AACH,MAAM,WAAW,GAAoC;IACnD,UAAU,EAAE;QACV,OAAO,EAAE,4BAA4B;QACrC,IAAI,EAAE,CAAC,SAAS,CAAC;QACjB,mBAAmB,EAAE;YACnB,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,iBAAiB;YACzB,KAAK,EAAE,YAAY;YACnB,MAAM,EAAE,iBAAiB;YACzB,MAAM,EAAE,YAAY;YACpB,MAAM,EAAE,YAAY;SACrB;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,oBAAoB;QAC7B,IAAI,EAAE,CAAC,SAAS,CAAC;QACjB,mBAAmB,EAAE;YACnB,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;SACjB;KACF;IACD,EAAE,EAAE;QACF,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,CAAC,OAAO,CAAC;QACf,mBAAmB,EAAE;YACnB,KAAK,EAAE,IAAI;SACZ;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,eAAe;QACxB,IAAI,EAAE,EAAE;QACR,mBAAmB,EAAE;YACnB,KAAK,EAAE,MAAM;SACd;KACF;IACD,MAAM,EAAE;QACN,OAAO,EAAE,WAAW;QACpB,IAAI,EAAE,CAAC,MAAM,CAAC;QACd,mBAAmB,EAAE;YACn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EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;YACpE,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;gBACzB,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;gBAC9C,QAAQ,CAAC,UAAU,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;gBACvD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,gBAAgB;QAClB,CAAC;IACH,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,UAAkB;IAChE,MAAM,2BAA2B,CAAC,UAAU,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Project Folder Helper (0188)
|
|
3
|
-
*
|
|
4
|
-
* Creates specs directories for any provider's multi-project setup.
|
|
5
|
-
* Shared by JIRA, ADO, GitHub, and Bitbucket init paths.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Create project folders under .specweave/docs/internal/specs/.
|
|
9
|
-
*
|
|
10
|
-
* @param targetDir - Project root directory
|
|
11
|
-
* @param projects - List of project names to create folders for
|
|
12
|
-
* @returns List of normalized folder names that were ensured to exist
|
|
13
|
-
*/
|
|
14
|
-
export declare function createProjectFolders(targetDir: string, projects: string[]): Promise<string[]>;
|
|
15
|
-
//# sourceMappingURL=multi-project-folders.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-project-folders.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/multi-project-folders.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkBH;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Multi-Project Folder Helper (0188)
|
|
3
|
-
*
|
|
4
|
-
* Creates specs directories for any provider's multi-project setup.
|
|
5
|
-
* Shared by JIRA, ADO, GitHub, and Bitbucket init paths.
|
|
6
|
-
*/
|
|
7
|
-
import * as fs from 'fs';
|
|
8
|
-
import * as path from 'path';
|
|
9
|
-
/**
|
|
10
|
-
* Normalize a project name into a valid folder name.
|
|
11
|
-
* Lowercases, replaces spaces and non-alphanumeric chars with hyphens.
|
|
12
|
-
*/
|
|
13
|
-
function normalizeFolderName(name) {
|
|
14
|
-
return name
|
|
15
|
-
.toLowerCase()
|
|
16
|
-
.replace(/\s+/g, '-')
|
|
17
|
-
.replace(/[^a-z0-9-]/g, '-')
|
|
18
|
-
.replace(/-+/g, '-')
|
|
19
|
-
.replace(/^-|-$/g, '');
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Create project folders under .specweave/docs/internal/specs/.
|
|
23
|
-
*
|
|
24
|
-
* @param targetDir - Project root directory
|
|
25
|
-
* @param projects - List of project names to create folders for
|
|
26
|
-
* @returns List of normalized folder names that were ensured to exist
|
|
27
|
-
*/
|
|
28
|
-
export async function createProjectFolders(targetDir, projects) {
|
|
29
|
-
const specsBase = path.join(targetDir, '.specweave', 'docs', 'internal', 'specs');
|
|
30
|
-
const ensured = [];
|
|
31
|
-
for (const project of projects) {
|
|
32
|
-
const folderName = normalizeFolderName(project);
|
|
33
|
-
if (!folderName)
|
|
34
|
-
continue;
|
|
35
|
-
const folderPath = path.join(specsBase, folderName);
|
|
36
|
-
if (!fs.existsSync(folderPath)) {
|
|
37
|
-
fs.mkdirSync(folderPath, { recursive: true });
|
|
38
|
-
}
|
|
39
|
-
ensured.push(folderName);
|
|
40
|
-
}
|
|
41
|
-
return ensured;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=multi-project-folders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multi-project-folders.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/multi-project-folders.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;GAGG;AACH,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,QAAkB;IAElB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAClF,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QACpD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC/B,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Installation Flag Management
|
|
3
|
-
*
|
|
4
|
-
* Creates and manages flag files that track plugin installations during
|
|
5
|
-
* a Claude Code session. These flags enable the session restart warning
|
|
6
|
-
* feature to detect when plugins were installed and notify the user.
|
|
7
|
-
*
|
|
8
|
-
* Flag files are stored in `.specweave/state/`:
|
|
9
|
-
* - `plugins-installed-this-session.flag` - JSON with installation metadata
|
|
10
|
-
* - `installed-plugins.txt` - Simple text file with one plugin per line
|
|
11
|
-
*
|
|
12
|
-
* @module cli/helpers/init/plugin-install-flags
|
|
13
|
-
*/
|
|
14
|
-
import type { PluginInstallTrigger } from '../../../core/session/plugin-install-detector.js';
|
|
15
|
-
/**
|
|
16
|
-
* Plugin installation flag data
|
|
17
|
-
*/
|
|
18
|
-
export interface PluginInstallFlag {
|
|
19
|
-
/** ISO-8601 timestamp of installation */
|
|
20
|
-
timestamp: string;
|
|
21
|
-
/** List of installed plugins */
|
|
22
|
-
plugins: string[];
|
|
23
|
-
/** What triggered the installation */
|
|
24
|
-
trigger: PluginInstallTrigger;
|
|
25
|
-
/** Project path where installation occurred */
|
|
26
|
-
projectPath?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Options for creating a plugin install flag
|
|
30
|
-
*/
|
|
31
|
-
export interface CreateFlagOptions {
|
|
32
|
-
/** List of plugins installed */
|
|
33
|
-
plugins: string[];
|
|
34
|
-
/** What triggered the installation */
|
|
35
|
-
trigger: PluginInstallTrigger;
|
|
36
|
-
/** Project path */
|
|
37
|
-
projectPath?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Create plugin installation flag files
|
|
41
|
-
*
|
|
42
|
-
* Creates both the JSON flag file and the plain text plugins file
|
|
43
|
-
* to track that plugins were installed during this session.
|
|
44
|
-
*
|
|
45
|
-
* @param projectRoot - Root directory of the project
|
|
46
|
-
* @param options - Flag creation options
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* createPluginInstallFlag('/path/to/project', {
|
|
51
|
-
* plugins: ['sw', 'frontend'],
|
|
52
|
-
* trigger: 'specweave-init',
|
|
53
|
-
* projectPath: '/path/to/project'
|
|
54
|
-
* });
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function createPluginInstallFlag(projectRoot: string, options: CreateFlagOptions): void;
|
|
58
|
-
/**
|
|
59
|
-
* Read plugin installation flag
|
|
60
|
-
*
|
|
61
|
-
* Reads the flag file and returns its contents. Returns null if
|
|
62
|
-
* the file doesn't exist or contains invalid data.
|
|
63
|
-
*
|
|
64
|
-
* @param projectRoot - Root directory of the project
|
|
65
|
-
* @returns Flag data or null if not found/invalid
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* const flag = readPluginInstallFlag('/path/to/project');
|
|
70
|
-
* if (flag) {
|
|
71
|
-
* console.log('Plugins installed:', flag.plugins);
|
|
72
|
-
* }
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export declare function readPluginInstallFlag(projectRoot: string): PluginInstallFlag | null;
|
|
76
|
-
/**
|
|
77
|
-
* Append plugins to existing flag
|
|
78
|
-
*
|
|
79
|
-
* Adds new plugins to an existing flag file. If no flag exists,
|
|
80
|
-
* creates a new one with 'manual' trigger.
|
|
81
|
-
*
|
|
82
|
-
* @param projectRoot - Root directory of the project
|
|
83
|
-
* @param newPlugins - Plugins to append
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```typescript
|
|
87
|
-
* appendInstalledPlugins('/path/to/project', ['sw-github', 'sw-jira']);
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
export declare function appendInstalledPlugins(projectRoot: string, newPlugins: string[]): void;
|
|
91
|
-
/**
|
|
92
|
-
* Clear plugin installation flag files
|
|
93
|
-
*
|
|
94
|
-
* Removes both the JSON flag file and the plain text plugins file.
|
|
95
|
-
* Safe to call even if files don't exist.
|
|
96
|
-
*
|
|
97
|
-
* @param projectRoot - Root directory of the project
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```typescript
|
|
101
|
-
* clearPluginInstallFlag('/path/to/project');
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
export declare function clearPluginInstallFlag(projectRoot: string): void;
|
|
105
|
-
/**
|
|
106
|
-
* Check if plugins were installed this session
|
|
107
|
-
*
|
|
108
|
-
* Quick check for whether the flag file exists.
|
|
109
|
-
*
|
|
110
|
-
* @param projectRoot - Root directory of the project
|
|
111
|
-
* @returns True if flag exists
|
|
112
|
-
*/
|
|
113
|
-
export declare function hasPluginInstallFlag(projectRoot: string): boolean;
|
|
114
|
-
//# sourceMappingURL=plugin-install-flags.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-install-flags.d.ts","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/plugin-install-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAM7F;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,sCAAsC;IACtC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,gCAAgC;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,sCAAsC;IACtC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAsDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,iBAAiB,GACzB,IAAI,CAmBN;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAClB,iBAAiB,GAAG,IAAI,CAqB1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAAE,GACnB,IAAI,CAoBN;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAchE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAGjE"}
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Installation Flag Management
|
|
3
|
-
*
|
|
4
|
-
* Creates and manages flag files that track plugin installations during
|
|
5
|
-
* a Claude Code session. These flags enable the session restart warning
|
|
6
|
-
* feature to detect when plugins were installed and notify the user.
|
|
7
|
-
*
|
|
8
|
-
* Flag files are stored in `.specweave/state/`:
|
|
9
|
-
* - `plugins-installed-this-session.flag` - JSON with installation metadata
|
|
10
|
-
* - `installed-plugins.txt` - Simple text file with one plugin per line
|
|
11
|
-
*
|
|
12
|
-
* @module cli/helpers/init/plugin-install-flags
|
|
13
|
-
*/
|
|
14
|
-
import * as fs from 'fs';
|
|
15
|
-
import * as path from 'path';
|
|
16
|
-
// ============================================================================
|
|
17
|
-
// Constants
|
|
18
|
-
// ============================================================================
|
|
19
|
-
/** Name of the JSON flag file */
|
|
20
|
-
const FLAG_FILE_NAME = 'plugins-installed-this-session.flag';
|
|
21
|
-
/** Name of the plain text plugins file */
|
|
22
|
-
const PLUGINS_FILE_NAME = 'installed-plugins.txt';
|
|
23
|
-
/** Directory containing state files */
|
|
24
|
-
const STATE_DIR_NAME = 'state';
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// Path Utilities
|
|
27
|
-
// ============================================================================
|
|
28
|
-
/**
|
|
29
|
-
* Get the path to the state directory
|
|
30
|
-
*/
|
|
31
|
-
function getStateDirPath(projectRoot) {
|
|
32
|
-
return path.join(projectRoot, '.specweave', STATE_DIR_NAME);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get the path to the flag file
|
|
36
|
-
*/
|
|
37
|
-
function getFlagFilePath(projectRoot) {
|
|
38
|
-
return path.join(getStateDirPath(projectRoot), FLAG_FILE_NAME);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get the path to the plugins text file
|
|
42
|
-
*/
|
|
43
|
-
function getPluginsFilePath(projectRoot) {
|
|
44
|
-
return path.join(getStateDirPath(projectRoot), PLUGINS_FILE_NAME);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Ensure the state directory exists
|
|
48
|
-
*/
|
|
49
|
-
function ensureStateDirectory(projectRoot) {
|
|
50
|
-
const stateDir = getStateDirPath(projectRoot);
|
|
51
|
-
if (!fs.existsSync(stateDir)) {
|
|
52
|
-
fs.mkdirSync(stateDir, { recursive: true });
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
// ============================================================================
|
|
56
|
-
// Main Functions
|
|
57
|
-
// ============================================================================
|
|
58
|
-
/**
|
|
59
|
-
* Create plugin installation flag files
|
|
60
|
-
*
|
|
61
|
-
* Creates both the JSON flag file and the plain text plugins file
|
|
62
|
-
* to track that plugins were installed during this session.
|
|
63
|
-
*
|
|
64
|
-
* @param projectRoot - Root directory of the project
|
|
65
|
-
* @param options - Flag creation options
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* createPluginInstallFlag('/path/to/project', {
|
|
70
|
-
* plugins: ['sw', 'frontend'],
|
|
71
|
-
* trigger: 'specweave-init',
|
|
72
|
-
* projectPath: '/path/to/project'
|
|
73
|
-
* });
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export function createPluginInstallFlag(projectRoot, options) {
|
|
77
|
-
const { plugins, trigger, projectPath } = options;
|
|
78
|
-
ensureStateDirectory(projectRoot);
|
|
79
|
-
// Create the JSON flag file
|
|
80
|
-
const flag = {
|
|
81
|
-
timestamp: new Date().toISOString(),
|
|
82
|
-
plugins: [...plugins],
|
|
83
|
-
trigger,
|
|
84
|
-
projectPath,
|
|
85
|
-
};
|
|
86
|
-
const flagFile = getFlagFilePath(projectRoot);
|
|
87
|
-
fs.writeFileSync(flagFile, JSON.stringify(flag, null, 2), 'utf-8');
|
|
88
|
-
// Create the plain text plugins file
|
|
89
|
-
const pluginsFile = getPluginsFilePath(projectRoot);
|
|
90
|
-
fs.writeFileSync(pluginsFile, plugins.join('\n') + '\n', 'utf-8');
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Read plugin installation flag
|
|
94
|
-
*
|
|
95
|
-
* Reads the flag file and returns its contents. Returns null if
|
|
96
|
-
* the file doesn't exist or contains invalid data.
|
|
97
|
-
*
|
|
98
|
-
* @param projectRoot - Root directory of the project
|
|
99
|
-
* @returns Flag data or null if not found/invalid
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```typescript
|
|
103
|
-
* const flag = readPluginInstallFlag('/path/to/project');
|
|
104
|
-
* if (flag) {
|
|
105
|
-
* console.log('Plugins installed:', flag.plugins);
|
|
106
|
-
* }
|
|
107
|
-
* ```
|
|
108
|
-
*/
|
|
109
|
-
export function readPluginInstallFlag(projectRoot) {
|
|
110
|
-
const flagFile = getFlagFilePath(projectRoot);
|
|
111
|
-
if (!fs.existsSync(flagFile)) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
const content = fs.readFileSync(flagFile, 'utf-8');
|
|
116
|
-
const flag = JSON.parse(content);
|
|
117
|
-
// Basic validation
|
|
118
|
-
if (!flag.plugins || !Array.isArray(flag.plugins)) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
return flag;
|
|
122
|
-
}
|
|
123
|
-
catch {
|
|
124
|
-
// Invalid JSON or read error
|
|
125
|
-
return null;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Append plugins to existing flag
|
|
130
|
-
*
|
|
131
|
-
* Adds new plugins to an existing flag file. If no flag exists,
|
|
132
|
-
* creates a new one with 'manual' trigger.
|
|
133
|
-
*
|
|
134
|
-
* @param projectRoot - Root directory of the project
|
|
135
|
-
* @param newPlugins - Plugins to append
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* appendInstalledPlugins('/path/to/project', ['sw-github', 'sw-jira']);
|
|
140
|
-
* ```
|
|
141
|
-
*/
|
|
142
|
-
export function appendInstalledPlugins(projectRoot, newPlugins) {
|
|
143
|
-
const existingFlag = readPluginInstallFlag(projectRoot);
|
|
144
|
-
if (existingFlag) {
|
|
145
|
-
// Merge plugins (deduplicate)
|
|
146
|
-
const allPlugins = new Set([...existingFlag.plugins, ...newPlugins]);
|
|
147
|
-
// Update flag with merged plugins
|
|
148
|
-
createPluginInstallFlag(projectRoot, {
|
|
149
|
-
plugins: Array.from(allPlugins),
|
|
150
|
-
trigger: existingFlag.trigger,
|
|
151
|
-
projectPath: existingFlag.projectPath,
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
// Create new flag
|
|
156
|
-
createPluginInstallFlag(projectRoot, {
|
|
157
|
-
plugins: newPlugins,
|
|
158
|
-
trigger: 'manual',
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Clear plugin installation flag files
|
|
164
|
-
*
|
|
165
|
-
* Removes both the JSON flag file and the plain text plugins file.
|
|
166
|
-
* Safe to call even if files don't exist.
|
|
167
|
-
*
|
|
168
|
-
* @param projectRoot - Root directory of the project
|
|
169
|
-
*
|
|
170
|
-
* @example
|
|
171
|
-
* ```typescript
|
|
172
|
-
* clearPluginInstallFlag('/path/to/project');
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
export function clearPluginInstallFlag(projectRoot) {
|
|
176
|
-
const flagFile = getFlagFilePath(projectRoot);
|
|
177
|
-
const pluginsFile = getPluginsFilePath(projectRoot);
|
|
178
|
-
try {
|
|
179
|
-
if (fs.existsSync(flagFile)) {
|
|
180
|
-
fs.unlinkSync(flagFile);
|
|
181
|
-
}
|
|
182
|
-
if (fs.existsSync(pluginsFile)) {
|
|
183
|
-
fs.unlinkSync(pluginsFile);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
catch {
|
|
187
|
-
// Ignore errors during cleanup
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Check if plugins were installed this session
|
|
192
|
-
*
|
|
193
|
-
* Quick check for whether the flag file exists.
|
|
194
|
-
*
|
|
195
|
-
* @param projectRoot - Root directory of the project
|
|
196
|
-
* @returns True if flag exists
|
|
197
|
-
*/
|
|
198
|
-
export function hasPluginInstallFlag(projectRoot) {
|
|
199
|
-
const flagFile = getFlagFilePath(projectRoot);
|
|
200
|
-
return fs.existsSync(flagFile);
|
|
201
|
-
}
|
|
202
|
-
//# sourceMappingURL=plugin-install-flags.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-install-flags.js","sourceRoot":"","sources":["../../../../../src/cli/helpers/init/plugin-install-flags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAiC7B,+EAA+E;AAC/E,YAAY;AACZ,+EAA+E;AAE/E,iCAAiC;AAC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