@inspecto-dev/cli 0.2.0-alpha.4 → 0.2.0-alpha.5

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @inspecto-dev/cli@0.2.0-alpha.3 build /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
3
+ > @inspecto-dev/cli@0.2.0-alpha.4 build /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: src/bin.ts, src/index.ts
@@ -10,11 +10,11 @@
10
10
  CLI Target: node18
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
- ESM dist/index.js 109.00 B
14
- ESM dist/chunk-EUCQCD3Y.js 57.56 KB
13
+ ESM dist/chunk-MIHQGC3L.js 58.03 KB
15
14
  ESM dist/bin.js 2.64 KB
16
- ESM ⚡️ Build success in 136ms
15
+ ESM dist/index.js 109.00 B
16
+ ESM ⚡️ Build success in 32ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 1464ms
18
+ DTS ⚡️ Build success in 1096ms
19
19
  DTS dist/bin.d.ts 13.00 B
20
20
  DTS dist/index.d.ts 1.18 KB
@@ -1,21 +1,16 @@
1
-
2
- 
3
- > @inspecto-dev/cli@0.2.0-alpha.3 test /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
4
- > vitest run --passWithNoTests
5
-
6
-
7
-  RUN  v1.6.1 /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
8
-
9
- [?25l ✓ tests/framework.test.ts (5)
10
- ✓ tests/build-tool.test.ts (2)
11
- ✓ tests/ide.test.ts (6)
12
-  ✓ tests/framework.test.ts (5)
13
- ✓ tests/build-tool.test.ts (2)
14
- ✓ tests/ide.test.ts (6)
15
-
16
-  Test Files  3 passed (3)
17
-  Tests  13 passed (13)
18
-  Start at  11:27:40
19
-  Duration  548ms (transform 85ms, setup 0ms, collect 131ms, tests 15ms, environment 0ms, prepare 374ms)
20
-
21
- [?25h[?25h
1
+
2
+ > @inspecto-dev/cli@0.2.0-alpha.4 test /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
3
+ > vitest run --passWithNoTests
4
+
5
+
6
+ RUN v1.6.1 /Users/bytedance/Works/hugo.felix/inspecto/packages/cli
7
+
8
+ ✓ tests/framework.test.ts (5 tests) 4ms
9
+ tests/build-tool.test.ts (2 tests) 9ms
10
+ tests/ide.test.ts (6 tests) 8ms
11
+
12
+ Test Files 3 passed (3)
13
+ Tests 13 passed (13)
14
+ Start at 15:41:01
15
+ Duration 771ms (transform 133ms, setup 1ms, collect 221ms, tests 21ms, environment 0ms, prepare 367ms)
16
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @inspecto-dev/cli
2
2
 
3
+ ## 0.2.0-alpha.5
4
+
5
+ ### Minor Changes
6
+
7
+ - release alpha test version
8
+
3
9
  ## 0.2.0-alpha.4
4
10
 
5
11
  ### Minor Changes
package/dist/bin.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  init,
4
4
  log,
5
5
  teardown
6
- } from "./chunk-EUCQCD3Y.js";
6
+ } from "./chunk-MIHQGC3L.js";
7
7
 
8
8
  // src/bin.ts
9
9
  import { cac } from "cac";
@@ -626,7 +626,8 @@ var ViteStrategy = class {
626
626
  inject({ mod, detection }) {
627
627
  addVitePlugin(mod, {
628
628
  from: "@inspecto-dev/plugin",
629
- constructor: "vitePlugin"
629
+ constructor: "inspecto",
630
+ imported: "vitePlugin"
630
631
  });
631
632
  }
632
633
  getManualInstructions(detection, reason) {
@@ -808,8 +809,21 @@ function printManualInstructions(strategy, detection, reason) {
808
809
  }
809
810
  }
810
811
  function isAlreadyInjected(content) {
811
- return /import\s+.*@inspecto-dev\/plugin/.test(content) || /require\(['"]@inspecto-dev\/plugin['"]\)/.test(content) || /import\s+.*ai-dev-inspector/.test(content) || // Legacy support
812
- /require\(['"]ai-dev-inspector['"]\)/.test(content);
812
+ const normalized = content.replace(/\s+/g, " ");
813
+ const importPlugin = /import\s+(.+?)\s+from\s+['"]@inspecto-dev\/plugin['"]/g;
814
+ const requirePlugin = /require\(['"]@inspecto-dev\/plugin['"]\)/;
815
+ const legacyImport = /import\s+.*ai-dev-inspector/.test(normalized);
816
+ const legacyRequire = /require\(['"]ai-dev-inspector['"]\)/.test(normalized);
817
+ if (legacyImport || legacyRequire || requirePlugin.test(normalized)) return true;
818
+ let match;
819
+ importPlugin.lastIndex = 0;
820
+ while (match = importPlugin.exec(normalized)) {
821
+ const importClause = match[1] || "";
822
+ if (/inspecto/.test(importClause) || /vitePlugin/.test(importClause)) {
823
+ return true;
824
+ }
825
+ }
826
+ return false;
813
827
  }
814
828
  async function injectPlugin(root, detection, dryRun) {
815
829
  const configPath = path7.join(root, detection.configPath);
@@ -1219,7 +1233,9 @@ async function init(options) {
1219
1233
  }
1220
1234
  let manualConfigRequiredFor = "";
1221
1235
  if (verifiedPackages.length > 0 && buildResult.supported.length === 0) {
1222
- log.warn(`No supported build configs detected for: ${verifiedPackages.map((pkg) => pkg ? pkg : ".").join(", ")}`);
1236
+ log.warn(
1237
+ `No supported build configs detected for: ${verifiedPackages.map((pkg) => pkg ? pkg : ".").join(", ")}`
1238
+ );
1223
1239
  log.hint("Double-check the --packages values or run without the flag to scan the repo root");
1224
1240
  }
1225
1241
  if (buildResult.supported.length > 0) {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  doctor,
3
3
  init,
4
4
  teardown
5
- } from "./chunk-EUCQCD3Y.js";
5
+ } from "./chunk-MIHQGC3L.js";
6
6
  export {
7
7
  doctor,
8
8
  init,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inspecto-dev/cli",
3
- "version": "0.2.0-alpha.4",
3
+ "version": "0.2.0-alpha.5",
4
4
  "description": "CLI tools for Inspecto onboarding and lifecycle management",
5
5
  "keywords": [
6
6
  "inspecto",
@@ -41,13 +41,24 @@ function printManualInstructions(
41
41
 
42
42
  /** Check if inspecto is already injected (idempotency). */
43
43
  function isAlreadyInjected(content: string): boolean {
44
- // Use regex to avoid false positives in comments or variables
45
- return (
46
- /import\s+.*@inspecto-dev\/plugin/.test(content) ||
47
- /require\(['"]@inspecto-dev\/plugin['"]\)/.test(content) ||
48
- /import\s+.*ai-dev-inspector/.test(content) || // Legacy support
49
- /require\(['"]ai-dev-inspector['"]\)/.test(content)
50
- )
44
+ const normalized = content.replace(/\s+/g, ' ')
45
+ const importPlugin = /import\s+(.+?)\s+from\s+['"]@inspecto-dev\/plugin['"]/g
46
+ const requirePlugin = /require\(['"]@inspecto-dev\/plugin['"]\)/
47
+ const legacyImport = /import\s+.*ai-dev-inspector/.test(normalized)
48
+ const legacyRequire = /require\(['"]ai-dev-inspector['"]\)/.test(normalized)
49
+
50
+ if (legacyImport || legacyRequire || requirePlugin.test(normalized)) return true
51
+
52
+ let match: RegExpExecArray | null
53
+ importPlugin.lastIndex = 0
54
+ while ((match = importPlugin.exec(normalized))) {
55
+ const importClause = match[1] || ''
56
+ if (/inspecto/.test(importClause) || /vitePlugin/.test(importClause)) {
57
+ return true
58
+ }
59
+ }
60
+
61
+ return false
51
62
  }
52
63
 
53
64
  // ---- Main injection orchestrator ----
@@ -12,7 +12,8 @@ export class ViteStrategy implements InjectStrategy {
12
12
  inject({ mod, detection }: InjectOptions): void {
13
13
  addVitePlugin(mod, {
14
14
  from: '@inspecto-dev/plugin',
15
- constructor: 'vitePlugin',
15
+ constructor: 'inspecto',
16
+ imported: 'vitePlugin',
16
17
  })
17
18
  }
18
19