@inspecto-dev/cli 0.3.7 → 0.3.8
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/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-test.log +6777 -205
- package/CHANGELOG.md +8 -0
- package/dist/bin.js +1 -1
- package/dist/{chunk-LLQA5L7E.js → chunk-B5JDHSP7.js} +28 -18
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/src/commands/integration-automation.ts +4 -2
- package/src/commands/integration-host-ide.ts +10 -3
- package/src/commands/integration-install.ts +13 -3
- package/src/detect/framework.ts +9 -6
- package/src/detect/ide.ts +12 -10
- package/src/detect/provider.ts +1 -1
- package/src/inject/strategies/esbuild.ts +2 -2
- package/src/inject/strategies/rollup.ts +2 -2
- package/src/inject/strategies/rsbuild.ts +2 -2
- package/src/inject/strategies/rspack.ts +2 -2
- package/src/inject/strategies/vite.ts +2 -2
- package/src/inject/strategies/webpack.ts +2 -2
- package/tests/detect.test.ts +2 -2
- package/tests/framework.test.ts +27 -3
- package/tests/plan.test.ts +16 -16
package/CHANGELOG.md
CHANGED
package/dist/bin.js
CHANGED
|
@@ -202,14 +202,14 @@ var ViteStrategy = class {
|
|
|
202
202
|
supports(tool) {
|
|
203
203
|
return tool === "vite";
|
|
204
204
|
}
|
|
205
|
-
inject({ mod, detection }) {
|
|
205
|
+
inject({ mod, detection: _detection }) {
|
|
206
206
|
addVitePlugin(mod, {
|
|
207
207
|
from: "@inspecto-dev/plugin",
|
|
208
208
|
constructor: "inspecto",
|
|
209
209
|
imported: "vitePlugin"
|
|
210
210
|
});
|
|
211
211
|
}
|
|
212
|
-
getManualInstructions(
|
|
212
|
+
getManualInstructions(_detection, _reason) {
|
|
213
213
|
return [
|
|
214
214
|
`import { vitePlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
215
215
|
"",
|
|
@@ -228,10 +228,10 @@ var WebpackStrategy = class {
|
|
|
228
228
|
supports(tool) {
|
|
229
229
|
return tool === "webpack";
|
|
230
230
|
}
|
|
231
|
-
inject(
|
|
231
|
+
inject(_options) {
|
|
232
232
|
throw new Error("Webpack requires manual plugin configuration");
|
|
233
233
|
}
|
|
234
|
-
getManualInstructions(detection,
|
|
234
|
+
getManualInstructions(detection, _reason) {
|
|
235
235
|
const importPkg = detection.isLegacyWebpack ? "@inspecto-dev/plugin/legacy/webpack4" : "@inspecto-dev/plugin";
|
|
236
236
|
const pluginName = detection.isLegacyWebpack ? "webpack4Plugin" : "webpackPlugin";
|
|
237
237
|
const pluginCall = detection.isLegacyWebpack ? `process.env.NODE_ENV !== 'production' && inspecto({
|
|
@@ -256,10 +256,10 @@ var RspackStrategy = class {
|
|
|
256
256
|
supports(tool) {
|
|
257
257
|
return tool === "rspack";
|
|
258
258
|
}
|
|
259
|
-
inject(
|
|
259
|
+
inject(_options) {
|
|
260
260
|
throw new Error("Rspack requires manual plugin configuration");
|
|
261
261
|
}
|
|
262
|
-
getManualInstructions(detection,
|
|
262
|
+
getManualInstructions(detection, _reason) {
|
|
263
263
|
const importPkg = detection.isLegacyRspack ? "@inspecto-dev/plugin/legacy/rspack" : "@inspecto-dev/plugin";
|
|
264
264
|
const pluginCall = detection.isLegacyRspack ? `process.env.NODE_ENV !== 'production' && inspecto({
|
|
265
265
|
pathType: 'absolute',
|
|
@@ -283,10 +283,10 @@ var RsbuildStrategy = class {
|
|
|
283
283
|
supports(tool) {
|
|
284
284
|
return tool === "rsbuild";
|
|
285
285
|
}
|
|
286
|
-
inject(
|
|
286
|
+
inject(_options) {
|
|
287
287
|
throw new Error("Rsbuild requires manual plugin configuration due to nested structure");
|
|
288
288
|
}
|
|
289
|
-
getManualInstructions(
|
|
289
|
+
getManualInstructions(_detection, _reason) {
|
|
290
290
|
return [
|
|
291
291
|
`import { rspackPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
292
292
|
"",
|
|
@@ -308,10 +308,10 @@ var EsbuildStrategy = class {
|
|
|
308
308
|
supports(tool) {
|
|
309
309
|
return tool === "esbuild";
|
|
310
310
|
}
|
|
311
|
-
inject(
|
|
311
|
+
inject(_options) {
|
|
312
312
|
throw new Error("Esbuild requires manual plugin configuration");
|
|
313
313
|
}
|
|
314
|
-
getManualInstructions(detection,
|
|
314
|
+
getManualInstructions(detection, _reason) {
|
|
315
315
|
return [
|
|
316
316
|
`1. Update your esbuild config (${detection.configPath}):`,
|
|
317
317
|
`import { esbuildPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
@@ -339,10 +339,10 @@ var RollupStrategy = class {
|
|
|
339
339
|
supports(tool) {
|
|
340
340
|
return tool === "rollup";
|
|
341
341
|
}
|
|
342
|
-
inject(
|
|
342
|
+
inject(_options) {
|
|
343
343
|
throw new Error("Rollup requires manual plugin configuration");
|
|
344
344
|
}
|
|
345
|
-
getManualInstructions(detection,
|
|
345
|
+
getManualInstructions(detection, _reason) {
|
|
346
346
|
return [
|
|
347
347
|
`1. Update your rollup config (${detection.configPath}):`,
|
|
348
348
|
`import { rollupPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
@@ -1869,22 +1869,25 @@ import { createRequire as createRequire2 } from "module";
|
|
|
1869
1869
|
var META_FRAMEWORK_MAP = {
|
|
1870
1870
|
next: "react",
|
|
1871
1871
|
nuxt: "vue",
|
|
1872
|
+
"@sveltejs/kit": "svelte",
|
|
1872
1873
|
"@remix-run/react": "react",
|
|
1873
1874
|
"@remix-run/dev": "react",
|
|
1874
1875
|
"@vue/nuxt": "vue",
|
|
1875
1876
|
"vite-plugin-vue": "vue",
|
|
1876
1877
|
"@vitejs/plugin-vue": "vue",
|
|
1878
|
+
"@sveltejs/vite-plugin-svelte": "svelte",
|
|
1879
|
+
"vite-plugin-solid": "solid",
|
|
1877
1880
|
"@vitejs/plugin-react": "react",
|
|
1878
1881
|
"@vitejs/plugin-react-swc": "react"
|
|
1879
1882
|
};
|
|
1880
1883
|
var SUPPORTED_FRAMEWORKS = [
|
|
1881
1884
|
{ framework: "react", deps: ["react", "react-dom"] },
|
|
1882
|
-
{ framework: "vue", deps: ["vue"] }
|
|
1885
|
+
{ framework: "vue", deps: ["vue"] },
|
|
1886
|
+
{ framework: "svelte", deps: ["svelte"] },
|
|
1887
|
+
{ framework: "solid", deps: ["solid-js"] },
|
|
1888
|
+
{ framework: "astro", deps: ["astro"] }
|
|
1883
1889
|
];
|
|
1884
1890
|
var UNSUPPORTED_FRAMEWORKS = [
|
|
1885
|
-
{ name: "Solid", dep: "solid-js" },
|
|
1886
|
-
{ name: "Svelte", dep: "svelte" },
|
|
1887
|
-
{ name: "SvelteKit", dep: "@sveltejs/kit" },
|
|
1888
1891
|
{ name: "Angular", dep: "@angular/core" },
|
|
1889
1892
|
{ name: "Preact", dep: "preact" },
|
|
1890
1893
|
{ name: "Lit", dep: "lit" },
|
|
@@ -4996,7 +4999,14 @@ function detectEnvHostIdes() {
|
|
|
4996
4999
|
return Array.from(detected);
|
|
4997
5000
|
}
|
|
4998
5001
|
async function detectArtifactHostIdes(cwd) {
|
|
4999
|
-
const artifactOrder = [
|
|
5002
|
+
const artifactOrder = [
|
|
5003
|
+
"cursor",
|
|
5004
|
+
"trae",
|
|
5005
|
+
"trae-cn",
|
|
5006
|
+
"codebuddy",
|
|
5007
|
+
"codebuddy-cn",
|
|
5008
|
+
"vscode"
|
|
5009
|
+
];
|
|
5000
5010
|
const candidates = artifactOrder.map((ide) => ({
|
|
5001
5011
|
ide,
|
|
5002
5012
|
target: getHostIdeArtifactPath(ide, cwd)
|
|
@@ -5388,7 +5398,7 @@ async function runIntegrationAutomation(assistant, options = {}, cwd) {
|
|
|
5388
5398
|
};
|
|
5389
5399
|
}
|
|
5390
5400
|
}
|
|
5391
|
-
function shouldAutoSend(assistant,
|
|
5401
|
+
function shouldAutoSend(assistant, _ide) {
|
|
5392
5402
|
if (assistant === "copilot") return true;
|
|
5393
5403
|
if (assistant === "codex") return true;
|
|
5394
5404
|
return false;
|
package/dist/index.d.ts
CHANGED
|
@@ -405,6 +405,6 @@ interface ReportCommandErrorOptions {
|
|
|
405
405
|
declare function writeCommandOutput<T>(result: T, json: boolean, renderText: (value: T) => void): T;
|
|
406
406
|
declare function reportCommandError(error: unknown, options?: ReportCommandErrorOptions): void;
|
|
407
407
|
|
|
408
|
-
type Framework = 'react' | 'vue';
|
|
408
|
+
type Framework = 'react' | 'vue' | 'svelte' | 'solid' | 'astro';
|
|
409
409
|
|
|
410
410
|
export { type BuildTool, type DoctorDiagnostic, type DoctorResult, type Framework, type InitOptions, type InstallLock, type OnboardCommandResult, type OnboardStatus, type PackageManager, type ResolvedOnboardingSession, apply, collectDoctorResult, detect, devLink, devStatus, devUnlink, doctor, init, integrationDoctor, onboard, plan, reportCommandError, teardown, writeCommandOutput };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inspecto-dev/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "CLI tools for Inspecto onboarding and lifecycle management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"inspecto",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"ora": "^9.3.0",
|
|
21
21
|
"picocolors": "^1.0.0",
|
|
22
22
|
"prompts": "^2.4.2",
|
|
23
|
-
"@inspecto-dev/types": "0.3.
|
|
23
|
+
"@inspecto-dev/types": "0.3.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@types/node": "^20.19.39",
|
|
@@ -156,7 +156,9 @@ export async function runIntegrationAutomation(
|
|
|
156
156
|
previewParams.set('overrides', JSON.stringify({ type: dispatchMode.mode }))
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
const uriScheme = resolvedHostIde.ide
|
|
159
|
+
const uriScheme = resolvedHostIde.ide
|
|
160
|
+
? (IDE_TO_URI_SCHEME[resolvedHostIde.ide] ?? resolvedHostIde.ide)
|
|
161
|
+
: 'vscode'
|
|
160
162
|
const launchUri = `${uriScheme}://inspecto.inspecto/send?${previewParams.toString()}`
|
|
161
163
|
details.inspectoExtension = {
|
|
162
164
|
source: options.inspectoVsix ? 'local_vsix' : 'marketplace',
|
|
@@ -425,7 +427,7 @@ export async function runIntegrationAutomation(
|
|
|
425
427
|
}
|
|
426
428
|
}
|
|
427
429
|
|
|
428
|
-
function shouldAutoSend(assistant: string,
|
|
430
|
+
function shouldAutoSend(assistant: string, _ide: SupportedHostIde): boolean {
|
|
429
431
|
if (assistant === 'copilot') return true
|
|
430
432
|
if (assistant === 'codex') return true
|
|
431
433
|
return false
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from 'node:path'
|
|
2
2
|
import { exists, readJSON } from '../utils/fs.js'
|
|
3
3
|
import {
|
|
4
|
-
HOST_IDE_IDS,
|
|
5
4
|
getHostIdeArtifactPath,
|
|
6
5
|
isSupportedHostIde,
|
|
7
6
|
type SupportedHostIde,
|
|
@@ -138,7 +137,8 @@ function detectEnvHostIdes(): SupportedHostIde[] {
|
|
|
138
137
|
if (
|
|
139
138
|
process.env.__CFBundleIdentifier === 'ai.codebuddy.mac.cn' ||
|
|
140
139
|
process.env.COCO_IDE_PLUGIN_TYPE === 'CodeBuddyCN' ||
|
|
141
|
-
(process.env.npm_config_user_agent &&
|
|
140
|
+
(process.env.npm_config_user_agent &&
|
|
141
|
+
process.env.npm_config_user_agent.includes('codebuddy-cn'))
|
|
142
142
|
) {
|
|
143
143
|
detected.add('codebuddy-cn')
|
|
144
144
|
} else if (
|
|
@@ -157,7 +157,14 @@ function detectEnvHostIdes(): SupportedHostIde[] {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
async function detectArtifactHostIdes(cwd: string): Promise<SupportedHostIde[]> {
|
|
160
|
-
const artifactOrder: SupportedHostIde[] = [
|
|
160
|
+
const artifactOrder: SupportedHostIde[] = [
|
|
161
|
+
'cursor',
|
|
162
|
+
'trae',
|
|
163
|
+
'trae-cn',
|
|
164
|
+
'codebuddy',
|
|
165
|
+
'codebuddy-cn',
|
|
166
|
+
'vscode',
|
|
167
|
+
]
|
|
161
168
|
const candidates = artifactOrder.map(ide => ({
|
|
162
169
|
ide,
|
|
163
170
|
target: getHostIdeArtifactPath(ide, cwd),
|
|
@@ -19,7 +19,15 @@ import {
|
|
|
19
19
|
const REPO_RAW_BASE = 'https://raw.githubusercontent.com/inspecto-dev/inspecto/main'
|
|
20
20
|
const TOTAL_STEPS = 6
|
|
21
21
|
|
|
22
|
-
type AssistantId =
|
|
22
|
+
type AssistantId =
|
|
23
|
+
| 'codex'
|
|
24
|
+
| 'claude-code'
|
|
25
|
+
| 'copilot'
|
|
26
|
+
| 'cursor'
|
|
27
|
+
| 'gemini'
|
|
28
|
+
| 'trae'
|
|
29
|
+
| 'coco'
|
|
30
|
+
| 'codebuddy'
|
|
23
31
|
type ClaudeScope = 'project' | 'user'
|
|
24
32
|
type CopilotMode = 'skills' | 'instructions' | 'agents'
|
|
25
33
|
type CursorMode = 'skills' | 'rules' | 'agents'
|
|
@@ -509,8 +517,10 @@ function resolveInstallPlan(assistant: string, options: InstallIntegrationOption
|
|
|
509
517
|
executable: true,
|
|
510
518
|
},
|
|
511
519
|
],
|
|
512
|
-
successMessage:
|
|
513
|
-
|
|
520
|
+
successMessage:
|
|
521
|
+
'Installed CodeBuddy skill to .codebuddy/skills/inspecto-onboarding/SKILL.md',
|
|
522
|
+
nextStep:
|
|
523
|
+
'Open a new CodeBuddy chat and verify the inspecto-onboarding skill is available.',
|
|
514
524
|
}
|
|
515
525
|
default:
|
|
516
526
|
throw new Error(`Unknown assistant: ${assistant}`)
|
package/src/detect/framework.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// ============================================================
|
|
2
2
|
// src/detect/framework.ts — Frontend framework detection
|
|
3
3
|
//
|
|
4
|
-
// v1 supported: React / Vue
|
|
5
|
-
// Recognized but unsupported:
|
|
4
|
+
// v1 supported: React / Vue / Svelte / Solid / Astro
|
|
5
|
+
// Recognized but unsupported: Angular, Preact, Lit
|
|
6
6
|
// ============================================================
|
|
7
7
|
import path from 'node:path'
|
|
8
8
|
import { createRequire } from 'node:module'
|
|
9
9
|
import { readJSON } from '../utils/fs.js'
|
|
10
10
|
|
|
11
|
-
export type Framework = 'react' | 'vue'
|
|
11
|
+
export type Framework = 'react' | 'vue' | 'svelte' | 'solid' | 'astro'
|
|
12
12
|
|
|
13
13
|
export interface FrameworkDetection {
|
|
14
14
|
supported: Framework[]
|
|
@@ -25,11 +25,14 @@ interface PackageJSON {
|
|
|
25
25
|
const META_FRAMEWORK_MAP: Record<string, Framework> = {
|
|
26
26
|
next: 'react',
|
|
27
27
|
nuxt: 'vue',
|
|
28
|
+
'@sveltejs/kit': 'svelte',
|
|
28
29
|
'@remix-run/react': 'react',
|
|
29
30
|
'@remix-run/dev': 'react',
|
|
30
31
|
'@vue/nuxt': 'vue',
|
|
31
32
|
'vite-plugin-vue': 'vue',
|
|
32
33
|
'@vitejs/plugin-vue': 'vue',
|
|
34
|
+
'@sveltejs/vite-plugin-svelte': 'svelte',
|
|
35
|
+
'vite-plugin-solid': 'solid',
|
|
33
36
|
'@vitejs/plugin-react': 'react',
|
|
34
37
|
'@vitejs/plugin-react-swc': 'react',
|
|
35
38
|
}
|
|
@@ -38,13 +41,13 @@ const META_FRAMEWORK_MAP: Record<string, Framework> = {
|
|
|
38
41
|
const SUPPORTED_FRAMEWORKS: { framework: Framework; deps: string[] }[] = [
|
|
39
42
|
{ framework: 'react', deps: ['react', 'react-dom'] },
|
|
40
43
|
{ framework: 'vue', deps: ['vue'] },
|
|
44
|
+
{ framework: 'svelte', deps: ['svelte'] },
|
|
45
|
+
{ framework: 'solid', deps: ['solid-js'] },
|
|
46
|
+
{ framework: 'astro', deps: ['astro'] },
|
|
41
47
|
]
|
|
42
48
|
|
|
43
49
|
/** Recognized but not supported in v1 — detect and warn */
|
|
44
50
|
const UNSUPPORTED_FRAMEWORKS: { name: string; dep: string }[] = [
|
|
45
|
-
{ name: 'Solid', dep: 'solid-js' },
|
|
46
|
-
{ name: 'Svelte', dep: 'svelte' },
|
|
47
|
-
{ name: 'SvelteKit', dep: '@sveltejs/kit' },
|
|
48
51
|
{ name: 'Angular', dep: '@angular/core' },
|
|
49
52
|
{ name: 'Preact', dep: 'preact' },
|
|
50
53
|
{ name: 'Lit', dep: 'lit' },
|
package/src/detect/ide.ts
CHANGED
|
@@ -51,7 +51,8 @@ export async function detectIDE(root: string): Promise<IDEProbeResult> {
|
|
|
51
51
|
if (
|
|
52
52
|
process.env.__CFBundleIdentifier === 'ai.codebuddy.mac.cn' ||
|
|
53
53
|
process.env.COCO_IDE_PLUGIN_TYPE === 'CodeBuddyCN' ||
|
|
54
|
-
(process.env.npm_config_user_agent &&
|
|
54
|
+
(process.env.npm_config_user_agent &&
|
|
55
|
+
process.env.npm_config_user_agent.includes('codebuddy-cn'))
|
|
55
56
|
) {
|
|
56
57
|
detected.set('CodeBuddy CN', { ide: 'codebuddy-cn', supported: true })
|
|
57
58
|
} else if (
|
|
@@ -83,15 +84,16 @@ export async function detectIDE(root: string): Promise<IDEProbeResult> {
|
|
|
83
84
|
// if (process.env.TERM_PROGRAM === 'vscode') { ... }
|
|
84
85
|
|
|
85
86
|
// 2. Check Directory Artifacts (Indicates project has been opened in these IDEs)
|
|
86
|
-
const [hasTrae, hasTraeCn, hasCursor, hasVscode, hasIdea, hasCodeBuddy, hasCodeBuddyCn] =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
const [hasTrae, hasTraeCn, hasCursor, hasVscode, hasIdea, hasCodeBuddy, hasCodeBuddyCn] =
|
|
88
|
+
await Promise.all([
|
|
89
|
+
exists(path.join(root, '.trae')),
|
|
90
|
+
exists(path.join(root, '.trae-cn')),
|
|
91
|
+
exists(path.join(root, '.cursor')),
|
|
92
|
+
exists(path.join(root, '.vscode')),
|
|
93
|
+
exists(path.join(root, '.idea')),
|
|
94
|
+
exists(path.join(root, '.codebuddy')),
|
|
95
|
+
exists(path.join(root, '.codebuddy-cn')),
|
|
96
|
+
])
|
|
95
97
|
|
|
96
98
|
// If a directory artifact exists, add it to the detection list.
|
|
97
99
|
// This allows us to surface multiple options (e.g. if you are in Cursor but also have a .vscode folder).
|
package/src/detect/provider.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import path from 'node:path'
|
|
7
7
|
import { exists, readJSON } from '../utils/fs.js'
|
|
8
8
|
import { which } from '../utils/exec.js'
|
|
9
|
-
import type { Provider
|
|
9
|
+
import type { Provider } from '@inspecto-dev/types'
|
|
10
10
|
|
|
11
11
|
export interface ProviderDetection {
|
|
12
12
|
id: Provider
|
|
@@ -8,11 +8,11 @@ export class EsbuildStrategy implements InjectStrategy {
|
|
|
8
8
|
return tool === 'esbuild'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
inject(
|
|
11
|
+
inject(_options: InjectOptions): void {
|
|
12
12
|
throw new Error('Esbuild requires manual plugin configuration')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
getManualInstructions(detection: BuildToolDetection,
|
|
15
|
+
getManualInstructions(detection: BuildToolDetection, _reason: string): string[] {
|
|
16
16
|
return [
|
|
17
17
|
`1. Update your esbuild config (${detection.configPath}):`,
|
|
18
18
|
`import { esbuildPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
@@ -8,11 +8,11 @@ export class RollupStrategy implements InjectStrategy {
|
|
|
8
8
|
return tool === 'rollup'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
inject(
|
|
11
|
+
inject(_options: InjectOptions): void {
|
|
12
12
|
throw new Error('Rollup requires manual plugin configuration')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
getManualInstructions(detection: BuildToolDetection,
|
|
15
|
+
getManualInstructions(detection: BuildToolDetection, _reason: string): string[] {
|
|
16
16
|
return [
|
|
17
17
|
`1. Update your rollup config (${detection.configPath}):`,
|
|
18
18
|
`import { rollupPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
@@ -8,11 +8,11 @@ export class RsbuildStrategy implements InjectStrategy {
|
|
|
8
8
|
return tool === 'rsbuild'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
inject(
|
|
11
|
+
inject(_options: InjectOptions): void {
|
|
12
12
|
throw new Error('Rsbuild requires manual plugin configuration due to nested structure')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
getManualInstructions(
|
|
15
|
+
getManualInstructions(_detection: BuildToolDetection, _reason: string): string[] {
|
|
16
16
|
return [
|
|
17
17
|
`import { rspackPlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
18
18
|
'',
|
|
@@ -8,11 +8,11 @@ export class RspackStrategy implements InjectStrategy {
|
|
|
8
8
|
return tool === 'rspack'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
inject(
|
|
11
|
+
inject(_options: InjectOptions): void {
|
|
12
12
|
throw new Error('Rspack requires manual plugin configuration')
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
getManualInstructions(detection: BuildToolDetection,
|
|
15
|
+
getManualInstructions(detection: BuildToolDetection, _reason: string): string[] {
|
|
16
16
|
const importPkg = detection.isLegacyRspack
|
|
17
17
|
? '@inspecto-dev/plugin/legacy/rspack'
|
|
18
18
|
: '@inspecto-dev/plugin'
|
|
@@ -9,7 +9,7 @@ export class ViteStrategy implements InjectStrategy {
|
|
|
9
9
|
return tool === 'vite'
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
inject({ mod, detection }: InjectOptions): void {
|
|
12
|
+
inject({ mod, detection: _detection }: InjectOptions): void {
|
|
13
13
|
addVitePlugin(mod, {
|
|
14
14
|
from: '@inspecto-dev/plugin',
|
|
15
15
|
constructor: 'inspecto',
|
|
@@ -17,7 +17,7 @@ export class ViteStrategy implements InjectStrategy {
|
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
getManualInstructions(
|
|
20
|
+
getManualInstructions(_detection: BuildToolDetection, _reason: string): string[] {
|
|
21
21
|
return [
|
|
22
22
|
`import { vitePlugin as inspecto } from '@inspecto-dev/plugin'`,
|
|
23
23
|
'',
|
|
@@ -8,12 +8,12 @@ export class WebpackStrategy implements InjectStrategy {
|
|
|
8
8
|
return tool === 'webpack'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
inject(
|
|
11
|
+
inject(_options: InjectOptions): void {
|
|
12
12
|
// AST manipulation for Webpack configs (often CommonJS or complex objects) is brittle in v1
|
|
13
13
|
throw new Error('Webpack requires manual plugin configuration')
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
getManualInstructions(detection: BuildToolDetection,
|
|
16
|
+
getManualInstructions(detection: BuildToolDetection, _reason: string): string[] {
|
|
17
17
|
const importPkg = detection.isLegacyWebpack
|
|
18
18
|
? '@inspecto-dev/plugin/legacy/webpack4'
|
|
19
19
|
: '@inspecto-dev/plugin'
|
package/tests/detect.test.ts
CHANGED
|
@@ -45,7 +45,7 @@ describe('buildOnboardingContext', () => {
|
|
|
45
45
|
})
|
|
46
46
|
vi.mocked(frameworkDetector.detectFrameworks).mockResolvedValue({
|
|
47
47
|
supported: ['react'],
|
|
48
|
-
unsupported: [{ name: '
|
|
48
|
+
unsupported: [{ name: 'Angular', dep: 'angular' }],
|
|
49
49
|
})
|
|
50
50
|
vi.mocked(ideDetector.detectIDE).mockResolvedValue({
|
|
51
51
|
detected: [{ ide: 'vscode', supported: true }],
|
|
@@ -79,7 +79,7 @@ describe('buildOnboardingContext', () => {
|
|
|
79
79
|
},
|
|
80
80
|
frameworks: {
|
|
81
81
|
supported: ['react'],
|
|
82
|
-
unsupported: ['
|
|
82
|
+
unsupported: ['Angular'],
|
|
83
83
|
},
|
|
84
84
|
ides: [{ ide: 'vscode', supported: true }],
|
|
85
85
|
providers: [{ id: 'codex', label: 'Codex CLI', supported: true, preferredMode: 'cli' }],
|
package/tests/framework.test.ts
CHANGED
|
@@ -31,7 +31,7 @@ describe('detectFrameworks', () => {
|
|
|
31
31
|
expect(result.unsupported).toHaveLength(0)
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
it('detects Svelte as
|
|
34
|
+
it('detects Svelte as supported framework', async () => {
|
|
35
35
|
vi.mocked(fsUtils.readJSON).mockResolvedValue({
|
|
36
36
|
devDependencies: {
|
|
37
37
|
svelte: '^4.0.0',
|
|
@@ -39,8 +39,32 @@ describe('detectFrameworks', () => {
|
|
|
39
39
|
})
|
|
40
40
|
|
|
41
41
|
const result = await detectFrameworks('/mock/root')
|
|
42
|
-
expect(result.supported).
|
|
43
|
-
expect(result.unsupported).
|
|
42
|
+
expect(result.supported).toContain('svelte')
|
|
43
|
+
expect(result.unsupported).toHaveLength(0)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('detects Solid as supported framework', async () => {
|
|
47
|
+
vi.mocked(fsUtils.readJSON).mockResolvedValue({
|
|
48
|
+
devDependencies: {
|
|
49
|
+
'solid-js': '^1.0.0',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const result = await detectFrameworks('/mock/root')
|
|
54
|
+
expect(result.supported).toContain('solid')
|
|
55
|
+
expect(result.unsupported).toHaveLength(0)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('detects Astro as supported framework', async () => {
|
|
59
|
+
vi.mocked(fsUtils.readJSON).mockResolvedValue({
|
|
60
|
+
devDependencies: {
|
|
61
|
+
astro: '^4.0.0',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const result = await detectFrameworks('/mock/root')
|
|
66
|
+
expect(result.supported).toContain('astro')
|
|
67
|
+
expect(result.unsupported).toHaveLength(0)
|
|
44
68
|
})
|
|
45
69
|
|
|
46
70
|
it('returns empty if no framework is matched', async () => {
|
package/tests/plan.test.ts
CHANGED
|
@@ -236,7 +236,7 @@ describe('planner orchestration', () => {
|
|
|
236
236
|
},
|
|
237
237
|
frameworks: {
|
|
238
238
|
supported: [],
|
|
239
|
-
unsupported: ['
|
|
239
|
+
unsupported: ['Angular'],
|
|
240
240
|
},
|
|
241
241
|
ides: [{ ide: 'vscode', supported: true }],
|
|
242
242
|
providers: [{ id: 'codex', label: 'Codex CLI', supported: true, preferredMode: 'cli' }],
|
|
@@ -249,13 +249,13 @@ describe('planner orchestration', () => {
|
|
|
249
249
|
expect(result.blockers).toEqual([
|
|
250
250
|
{
|
|
251
251
|
code: 'unsupported-framework',
|
|
252
|
-
message: 'Detected unsupported framework(s):
|
|
252
|
+
message: 'Detected unsupported framework(s): Angular',
|
|
253
253
|
},
|
|
254
254
|
])
|
|
255
255
|
expect(result.actions).toEqual([
|
|
256
256
|
{
|
|
257
257
|
type: 'manual_step',
|
|
258
|
-
target: '
|
|
258
|
+
target: 'Angular',
|
|
259
259
|
description:
|
|
260
260
|
'Inspecto cannot auto-configure this framework yet. Follow the manual setup guide for the detected framework.',
|
|
261
261
|
},
|
|
@@ -278,7 +278,7 @@ describe('planner orchestration', () => {
|
|
|
278
278
|
},
|
|
279
279
|
frameworks: {
|
|
280
280
|
supported: ['react'],
|
|
281
|
-
unsupported: ['
|
|
281
|
+
unsupported: ['Angular'],
|
|
282
282
|
},
|
|
283
283
|
ides: [{ ide: 'vscode', supported: true }],
|
|
284
284
|
providers: [{ id: 'codex', label: 'Codex CLI', supported: true, preferredMode: 'cli' }],
|
|
@@ -297,7 +297,7 @@ describe('planner orchestration', () => {
|
|
|
297
297
|
expect(result.warnings).toEqual([
|
|
298
298
|
{
|
|
299
299
|
code: 'unsupported-framework-present',
|
|
300
|
-
message: 'Unsupported framework(s) also detected:
|
|
300
|
+
message: 'Unsupported framework(s) also detected: Angular',
|
|
301
301
|
},
|
|
302
302
|
])
|
|
303
303
|
expect(result.actions).toEqual([
|
|
@@ -597,7 +597,7 @@ describe('planner orchestration', () => {
|
|
|
597
597
|
},
|
|
598
598
|
frameworks: {
|
|
599
599
|
supported: ['react'],
|
|
600
|
-
unsupported: ['
|
|
600
|
+
unsupported: ['Angular'],
|
|
601
601
|
},
|
|
602
602
|
ides: [{ ide: 'vscode', supported: true }],
|
|
603
603
|
providers: [{ id: 'codex', label: 'Codex CLI', supported: true, preferredMode: 'cli' }],
|
|
@@ -612,7 +612,7 @@ describe('planner orchestration', () => {
|
|
|
612
612
|
})
|
|
613
613
|
expect(result.environment).toEqual({
|
|
614
614
|
frameworks: ['react'],
|
|
615
|
-
unsupportedFrameworks: ['
|
|
615
|
+
unsupportedFrameworks: ['Angular'],
|
|
616
616
|
buildTools: [
|
|
617
617
|
{
|
|
618
618
|
tool: 'vite',
|
|
@@ -633,7 +633,7 @@ describe('planner orchestration', () => {
|
|
|
633
633
|
expect(result.warnings).toEqual([
|
|
634
634
|
{
|
|
635
635
|
code: 'unsupported-framework-present',
|
|
636
|
-
message: 'Unsupported framework(s) also detected:
|
|
636
|
+
message: 'Unsupported framework(s) also detected: Angular',
|
|
637
637
|
},
|
|
638
638
|
])
|
|
639
639
|
})
|
|
@@ -646,7 +646,7 @@ describe('planner orchestration', () => {
|
|
|
646
646
|
project: { root: '/repo', packageManager: 'pnpm' },
|
|
647
647
|
environment: {
|
|
648
648
|
frameworks: ['react'],
|
|
649
|
-
unsupportedFrameworks: ['
|
|
649
|
+
unsupportedFrameworks: ['Angular'],
|
|
650
650
|
buildTools: [],
|
|
651
651
|
unsupportedBuildTools: ['Next.js'],
|
|
652
652
|
ides: [{ ide: 'vscode', supported: true }],
|
|
@@ -677,7 +677,7 @@ describe('planner orchestration', () => {
|
|
|
677
677
|
warnings: [
|
|
678
678
|
{
|
|
679
679
|
code: 'unsupported-framework-present',
|
|
680
|
-
message: 'Unsupported framework(s) also detected:
|
|
680
|
+
message: 'Unsupported framework(s) also detected: Angular',
|
|
681
681
|
},
|
|
682
682
|
],
|
|
683
683
|
blockers: [
|
|
@@ -687,13 +687,13 @@ describe('planner orchestration', () => {
|
|
|
687
687
|
},
|
|
688
688
|
{
|
|
689
689
|
code: 'unsupported-framework',
|
|
690
|
-
message: 'Detected unsupported framework(s):
|
|
690
|
+
message: 'Detected unsupported framework(s): Angular',
|
|
691
691
|
},
|
|
692
692
|
],
|
|
693
693
|
project: { root: '/repo', packageManager: 'pnpm' },
|
|
694
694
|
environment: {
|
|
695
695
|
frameworks: ['react'],
|
|
696
|
-
unsupportedFrameworks: ['
|
|
696
|
+
unsupportedFrameworks: ['Angular'],
|
|
697
697
|
buildTools: [],
|
|
698
698
|
unsupportedBuildTools: ['Next.js'],
|
|
699
699
|
ides: [{ ide: 'vscode', supported: true }],
|
|
@@ -712,13 +712,13 @@ describe('planner orchestration', () => {
|
|
|
712
712
|
const output = logSpy.mock.calls.map(call => call.join(' ')).join('\n')
|
|
713
713
|
|
|
714
714
|
expect(detectSpy).toHaveBeenCalledWith('/repo')
|
|
715
|
-
expect(output).toContain('Unsupported frameworks:
|
|
715
|
+
expect(output).toContain('Unsupported frameworks: Angular')
|
|
716
716
|
expect(output).toContain('Unsupported build tools: Next.js')
|
|
717
|
-
expect(output).not.toContain('Detected unsupported framework(s):
|
|
717
|
+
expect(output).not.toContain('Detected unsupported framework(s): Angular')
|
|
718
718
|
expect(output).not.toContain('Detected unsupported build tool(s): Next.js')
|
|
719
|
-
expect(output.match(/Unsupported frameworks:
|
|
719
|
+
expect(output.match(/Unsupported frameworks: Angular/g)).toHaveLength(1)
|
|
720
720
|
expect(output.match(/Unsupported build tools: Next.js/g)).toHaveLength(1)
|
|
721
|
-
expect(output.match(/
|
|
721
|
+
expect(output.match(/Angular/g)).toHaveLength(1)
|
|
722
722
|
|
|
723
723
|
cwdSpy.mockRestore()
|
|
724
724
|
logSpy.mockRestore()
|