@prover-coder-ai/component-tagger 1.0.6 → 1.0.7
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/package.json +5 -4
- package/dist/tests/core/component-path.test.d.ts +0 -1
- package/dist/tests/core/component-path.test.js +0 -17
- package/dist/vitest.config.d.ts +0 -2
- package/dist/vitest.config.js +0 -67
- /package/dist/{src/core → core}/component-path.d.ts +0 -0
- /package/dist/{src/core → core}/component-path.js +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/shell → shell}/component-tagger.d.ts +0 -0
- /package/dist/{src/shell → shell}/component-tagger.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prover-coder-ai/component-tagger",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Component tagger Vite plugin for JSX metadata",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -66,15 +66,16 @@
|
|
|
66
66
|
"vitest": "^4.0.17"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
|
-
"
|
|
70
|
-
"
|
|
69
|
+
"prebuild": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
|
|
70
|
+
"build": "tsc -p tsconfig.build.json",
|
|
71
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
71
72
|
"lint": "npx @ton-ai-core/vibecode-linter src/",
|
|
72
73
|
"lint:tests": "npx @ton-ai-core/vibecode-linter tests/",
|
|
73
74
|
"lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
|
|
74
75
|
"check": "pnpm run typecheck",
|
|
75
76
|
"prestart": "pnpm run build",
|
|
76
77
|
"start": "node dist/index.js",
|
|
77
|
-
"test": "pnpm run lint:tests && vitest run",
|
|
78
|
+
"test": "pnpm run build && pnpm run lint:tests && vitest run",
|
|
78
79
|
"typecheck": "tsc --noEmit"
|
|
79
80
|
}
|
|
80
81
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "@effect/vitest";
|
|
2
|
-
import { Effect } from "effect";
|
|
3
|
-
import { componentPathAttributeName, formatComponentPathValue, isJsxFile } from "../../src/core/component-path.js";
|
|
4
|
-
describe("component-path", () => {
|
|
5
|
-
it.effect("exposes the path attribute name", () => Effect.sync(() => {
|
|
6
|
-
expect(componentPathAttributeName).toBe("path");
|
|
7
|
-
}));
|
|
8
|
-
it.effect("formats the component path payload", () => Effect.sync(() => {
|
|
9
|
-
const result = formatComponentPathValue("src/App.tsx", 12, 3);
|
|
10
|
-
expect(result).toBe("src/App.tsx:12:3");
|
|
11
|
-
}));
|
|
12
|
-
it.effect("detects JSX/TSX module ids", () => Effect.sync(() => {
|
|
13
|
-
expect(isJsxFile("src/App.tsx")).toBe(true);
|
|
14
|
-
expect(isJsxFile("src/App.jsx?import")).toBe(true);
|
|
15
|
-
expect(isJsxFile("src/App.ts")).toBe(false);
|
|
16
|
-
}));
|
|
17
|
-
});
|
package/dist/vitest.config.d.ts
DELETED
package/dist/vitest.config.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// CHANGE: Migrate from Jest to Vitest with mathematical equivalence
|
|
2
|
-
// WHY: Faster execution, native ESM, Effect integration via @effect/vitest
|
|
3
|
-
// QUOTE(ТЗ): "Проект использует Effect + функциональную парадигму"
|
|
4
|
-
// REF: Migration from jest.config.mjs
|
|
5
|
-
// PURITY: SHELL (configuration only)
|
|
6
|
-
// INVARIANT: ∀ test: behavior_jest ≡ behavior_vitest
|
|
7
|
-
// EFFECT: Effect<TestReport, never, TestEnvironment>
|
|
8
|
-
// COMPLEXITY: O(n) test execution where n = |test_files|
|
|
9
|
-
import { defineConfig } from "vitest/config";
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
test: {
|
|
12
|
-
// CHANGE: Native ESM support without experimental flags
|
|
13
|
-
// WHY: Vitest designed for ESM, no need for --experimental-vm-modules
|
|
14
|
-
// INVARIANT: Deterministic test execution without side effects
|
|
15
|
-
globals: false, // IMPORTANT: Use explicit imports for type safety
|
|
16
|
-
environment: "node",
|
|
17
|
-
// CHANGE: Match Jest's test file patterns
|
|
18
|
-
// INVARIANT: Same test discovery as Jest
|
|
19
|
-
include: ["tests/**/*.{test,spec}.ts"],
|
|
20
|
-
exclude: ["node_modules", "dist", "dist-test"],
|
|
21
|
-
// CHANGE: Coverage with 100% threshold for CORE (same as Jest)
|
|
22
|
-
// WHY: CORE must maintain mathematical guarantees via complete coverage
|
|
23
|
-
// INVARIANT: coverage_vitest ≥ coverage_jest ∧ ∀ f ∈ CORE: coverage(f) = 100%
|
|
24
|
-
coverage: {
|
|
25
|
-
provider: "v8", // Faster than babel (istanbul), native V8 coverage
|
|
26
|
-
reporter: ["text", "json", "html"],
|
|
27
|
-
include: ["src/**/*.ts"],
|
|
28
|
-
exclude: [
|
|
29
|
-
"src/**/*.test.ts",
|
|
30
|
-
"src/**/*.spec.ts",
|
|
31
|
-
"src/**/__tests__/**",
|
|
32
|
-
"scripts/**/*.ts"
|
|
33
|
-
],
|
|
34
|
-
// CHANGE: Maintain exact same thresholds as Jest
|
|
35
|
-
// WHY: Enforce 100% coverage for CORE, 10% minimum for SHELL
|
|
36
|
-
// INVARIANT: ∀ f ∈ src/core/**/*.ts: all_metrics(f) = 100%
|
|
37
|
-
// NOTE: Vitest v8 provider collects coverage for all matched files by default
|
|
38
|
-
thresholds: {
|
|
39
|
-
"src/core/**/*.ts": {
|
|
40
|
-
branches: 100,
|
|
41
|
-
functions: 100,
|
|
42
|
-
lines: 100,
|
|
43
|
-
statements: 100
|
|
44
|
-
},
|
|
45
|
-
global: {
|
|
46
|
-
branches: 10,
|
|
47
|
-
functions: 10,
|
|
48
|
-
lines: 10,
|
|
49
|
-
statements: 10
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
// CHANGE: Faster test execution via thread pooling
|
|
54
|
-
// WHY: Vitest uses worker threads by default (faster than Jest's processes)
|
|
55
|
-
// COMPLEXITY: O(n/k) where n = tests, k = worker_count
|
|
56
|
-
// NOTE: Vitest runs tests in parallel by default, no additional config needed
|
|
57
|
-
// CHANGE: Clear mocks between tests (Jest equivalence)
|
|
58
|
-
// WHY: Prevent test contamination, ensure test independence
|
|
59
|
-
// INVARIANT: ∀ test_i, test_j: independent(test_i, test_j) ⇒ no_shared_state
|
|
60
|
-
clearMocks: true,
|
|
61
|
-
mockReset: true,
|
|
62
|
-
restoreMocks: true
|
|
63
|
-
// CHANGE: Disable globals to enforce explicit imports
|
|
64
|
-
// WHY: Type safety, explicit dependencies, functional purity
|
|
65
|
-
// NOTE: Tests must import { describe, it, expect } from "vitest"
|
|
66
|
-
}
|
|
67
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|