@component-compass/cli 0.0.4 → 0.1.0
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/dist/cli.js +29 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/db-import.d.ts +12 -0
- package/dist/commands/db-import.js +54 -0
- package/dist/commands/db-import.js.map +1 -0
- package/dist/commands/scan.d.ts +2 -0
- package/dist/commands/scan.js +171 -12
- package/dist/commands/scan.js.map +1 -1
- package/dist/config/loader.js +2 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/config/schema.d.ts +1 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/manifest/lazy-resolver.d.ts +21 -0
- package/dist/manifest/lazy-resolver.js +70 -0
- package/dist/manifest/lazy-resolver.js.map +1 -1
- package/dist/occurrences.d.ts +1 -1
- package/dist/occurrences.js +3 -4
- package/dist/occurrences.js.map +1 -1
- package/dist/rollup.js.map +1 -1
- package/dist/seeds.js +13 -0
- package/dist/seeds.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/upload.d.ts +26 -0
- package/dist/upload.js +47 -0
- package/dist/upload.js.map +1 -0
- package/dist/walker/resolve-import.d.ts +6 -1
- package/dist/walker/resolve-import.js +100 -41
- package/dist/walker/resolve-import.js.map +1 -1
- package/dist/walker/tsconfig-discovery.d.ts +34 -0
- package/dist/walker/tsconfig-discovery.js +50 -0
- package/dist/walker/tsconfig-discovery.js.map +1 -0
- package/dist/walker/tsconfig-loader.d.ts +35 -0
- package/dist/walker/tsconfig-loader.js +138 -0
- package/dist/walker/tsconfig-loader.js.map +1 -0
- package/package.json +29 -27
- package/schema/config.schema.json +1 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type TsconfigDiscoveryInput = {
|
|
2
|
+
/** Directory containing component-compass.config.json. */
|
|
3
|
+
configDir: string;
|
|
4
|
+
/** Repo root (typically same as configDir, but can differ in nested layouts). */
|
|
5
|
+
repoRoot: string;
|
|
6
|
+
/**
|
|
7
|
+
* Explicit override from cc config. Absolute or relative to configDir.
|
|
8
|
+
* Honored unconditionally when present — caller's `createImportResolver`
|
|
9
|
+
* returns an empty tsconfig layer if the file is missing/broken, matching
|
|
10
|
+
* the same outcome a typo'd path produces.
|
|
11
|
+
*/
|
|
12
|
+
tsconfigPath?: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Tsconfig discovery — single source of truth for where the resolver finds
|
|
16
|
+
* the consumer's tsconfig. Layered:
|
|
17
|
+
*
|
|
18
|
+
* 1. Explicit `tsconfigPath` from cc config → use it (absolute or
|
|
19
|
+
* configDir-relative).
|
|
20
|
+
* 2. `<configDir>/tsconfig.json` if it exists.
|
|
21
|
+
* 3. `<configDir>/tsconfig.base.json` if it exists.
|
|
22
|
+
* 4. `<repoRoot>/tsconfig.json` if different from configDir and it exists.
|
|
23
|
+
* 5. `<repoRoot>/tsconfig.base.json` if different from configDir and it exists.
|
|
24
|
+
* 6. null — no tsconfig; tsconfig `paths` layer of `createImportResolver`
|
|
25
|
+
* becomes empty.
|
|
26
|
+
*
|
|
27
|
+
* Discovery returns the leaf path; `loadTsconfigChain` (in tsconfig-loader)
|
|
28
|
+
* handles `extends` from there. Deliberately does NOT walk up from configDir
|
|
29
|
+
* or repoRoot.
|
|
30
|
+
*
|
|
31
|
+
* Per-package tsconfigs in monorepos (e.g. PIE Aperture's nextjs-app-v14/
|
|
32
|
+
* tsconfig.json) are out of scope — see spec R5.
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveTsconfigPath(input: TsconfigDiscoveryInput): string | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, resolve, join } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Tsconfig discovery — single source of truth for where the resolver finds
|
|
5
|
+
* the consumer's tsconfig. Layered:
|
|
6
|
+
*
|
|
7
|
+
* 1. Explicit `tsconfigPath` from cc config → use it (absolute or
|
|
8
|
+
* configDir-relative).
|
|
9
|
+
* 2. `<configDir>/tsconfig.json` if it exists.
|
|
10
|
+
* 3. `<configDir>/tsconfig.base.json` if it exists.
|
|
11
|
+
* 4. `<repoRoot>/tsconfig.json` if different from configDir and it exists.
|
|
12
|
+
* 5. `<repoRoot>/tsconfig.base.json` if different from configDir and it exists.
|
|
13
|
+
* 6. null — no tsconfig; tsconfig `paths` layer of `createImportResolver`
|
|
14
|
+
* becomes empty.
|
|
15
|
+
*
|
|
16
|
+
* Discovery returns the leaf path; `loadTsconfigChain` (in tsconfig-loader)
|
|
17
|
+
* handles `extends` from there. Deliberately does NOT walk up from configDir
|
|
18
|
+
* or repoRoot.
|
|
19
|
+
*
|
|
20
|
+
* Per-package tsconfigs in monorepos (e.g. PIE Aperture's nextjs-app-v14/
|
|
21
|
+
* tsconfig.json) are out of scope — see spec R5.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveTsconfigPath(input) {
|
|
24
|
+
if (input.tsconfigPath) {
|
|
25
|
+
return isAbsolute(input.tsconfigPath)
|
|
26
|
+
? input.tsconfigPath
|
|
27
|
+
: resolve(input.configDir, input.tsconfigPath);
|
|
28
|
+
}
|
|
29
|
+
// Probe order at each location: tsconfig.json, then tsconfig.base.json.
|
|
30
|
+
// tsconfig.base.json is the de facto monorepo convention (Next.js, Nx,
|
|
31
|
+
// Turborepo defaults). When extends chains live in a per-app tsconfig.json
|
|
32
|
+
// that points to a root tsconfig.base.json, picking up the .base.json
|
|
33
|
+
// directly still resolves the path aliases — the loader treats whatever
|
|
34
|
+
// is discovered as the chain's leaf.
|
|
35
|
+
const candidates = ["tsconfig.json", "tsconfig.base.json"];
|
|
36
|
+
for (const candidate of candidates) {
|
|
37
|
+
const configDirCandidate = join(input.configDir, candidate);
|
|
38
|
+
if (existsSync(configDirCandidate))
|
|
39
|
+
return configDirCandidate;
|
|
40
|
+
}
|
|
41
|
+
if (input.repoRoot !== input.configDir) {
|
|
42
|
+
for (const candidate of candidates) {
|
|
43
|
+
const repoRootCandidate = join(input.repoRoot, candidate);
|
|
44
|
+
if (existsSync(repoRootCandidate))
|
|
45
|
+
return repoRootCandidate;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=tsconfig-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig-discovery.js","sourceRoot":"","sources":["../../src/walker/tsconfig-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgBtD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAA6B;IAC/D,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,UAAU,CAAC,KAAK,CAAC,YAAY,CAAC;YACnC,CAAC,CAAC,KAAK,CAAC,YAAY;YACpB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IACD,wEAAwE;IACxE,uEAAuE;IACvE,2EAA2E;IAC3E,sEAAsE;IACtE,wEAAwE;IACxE,qCAAqC;IACrC,MAAM,UAAU,GAAG,CAAC,eAAe,EAAE,oBAAoB,CAAC,CAAC;IAC3D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACnC,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC5D,IAAI,UAAU,CAAC,kBAAkB,CAAC;YAAE,OAAO,kBAAkB,CAAC;IAChE,CAAC;IACD,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,SAAS,EAAE,CAAC;QACvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAC1D,IAAI,UAAU,CAAC,iBAAiB,CAAC;gBAAE,OAAO,iBAAiB,CAAC;QAC9D,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Compiled alias record consumed by `createImportResolver`. */
|
|
2
|
+
export type AliasEntry = {
|
|
3
|
+
/** Anchored regex matching the specifier; capture group 1 is the wildcard expansion. */
|
|
4
|
+
pattern: RegExp;
|
|
5
|
+
/** Substitution targets in declaration order. `*` is replaced with the captured wildcard. */
|
|
6
|
+
targets: string[];
|
|
7
|
+
/** Absolute directory anchoring `targets` (the effective baseUrl of the file that declared `paths`). */
|
|
8
|
+
base: string;
|
|
9
|
+
};
|
|
10
|
+
export type LoadTsconfigChainResult = {
|
|
11
|
+
entries: AliasEntry[];
|
|
12
|
+
warnings: string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Load a tsconfig and its `extends` chain, returning a flat list of alias
|
|
16
|
+
* entries ready for `createImportResolver`. Pure: no side effects beyond fs
|
|
17
|
+
* reads. Non-fatal failures (missing files, JSONC errors, cycles) are
|
|
18
|
+
* appended to `warnings` rather than thrown — callers decide where to emit.
|
|
19
|
+
*
|
|
20
|
+
* Inheritance semantics match TypeScript:
|
|
21
|
+
* - `extends` is string OR array of strings; arrays apply in order, later
|
|
22
|
+
* overrides earlier.
|
|
23
|
+
* - `compilerOptions.paths`: REPLACE not merge. If the child defines
|
|
24
|
+
* `paths`, the child wins entirely; otherwise the parent's flows through.
|
|
25
|
+
* - `compilerOptions.baseUrl`: REPLACE. Anchored to the file that defines
|
|
26
|
+
* it.
|
|
27
|
+
* - Each `AliasEntry.base` pins to the effective baseUrl of the file that
|
|
28
|
+
* contributed its `paths` (so the resolver doesn't need to know which
|
|
29
|
+
* file produced which entry).
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadTsconfigChain(absPath: string): LoadTsconfigChainResult;
|
|
32
|
+
/** Compile a TS-paths-style alias pattern into an anchored RegExp. The single
|
|
33
|
+
* `*` wildcard becomes capture group 1, available for substitution into the
|
|
34
|
+
* target. Shared between tsconfig-derived and config-derived alias entries. */
|
|
35
|
+
export declare function compileAliasPattern(pattern: string): RegExp;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { dirname, isAbsolute, resolve as pathResolve } from "node:path";
|
|
4
|
+
import { parse as parseJsonc, printParseErrorCode } from "jsonc-parser";
|
|
5
|
+
const REGEX_META = /[.+?^${}()|[\]\\]/g;
|
|
6
|
+
/**
|
|
7
|
+
* Load a tsconfig and its `extends` chain, returning a flat list of alias
|
|
8
|
+
* entries ready for `createImportResolver`. Pure: no side effects beyond fs
|
|
9
|
+
* reads. Non-fatal failures (missing files, JSONC errors, cycles) are
|
|
10
|
+
* appended to `warnings` rather than thrown — callers decide where to emit.
|
|
11
|
+
*
|
|
12
|
+
* Inheritance semantics match TypeScript:
|
|
13
|
+
* - `extends` is string OR array of strings; arrays apply in order, later
|
|
14
|
+
* overrides earlier.
|
|
15
|
+
* - `compilerOptions.paths`: REPLACE not merge. If the child defines
|
|
16
|
+
* `paths`, the child wins entirely; otherwise the parent's flows through.
|
|
17
|
+
* - `compilerOptions.baseUrl`: REPLACE. Anchored to the file that defines
|
|
18
|
+
* it.
|
|
19
|
+
* - Each `AliasEntry.base` pins to the effective baseUrl of the file that
|
|
20
|
+
* contributed its `paths` (so the resolver doesn't need to know which
|
|
21
|
+
* file produced which entry).
|
|
22
|
+
*/
|
|
23
|
+
export function loadTsconfigChain(absPath) {
|
|
24
|
+
const warnings = [];
|
|
25
|
+
const seen = new Set();
|
|
26
|
+
const merged = loadChainInner(absPath, seen, warnings);
|
|
27
|
+
if (!merged || !merged.paths)
|
|
28
|
+
return { entries: [], warnings };
|
|
29
|
+
const entries = [];
|
|
30
|
+
for (const [pattern, targets] of Object.entries(merged.paths)) {
|
|
31
|
+
entries.push({
|
|
32
|
+
pattern: compileAliasPattern(pattern),
|
|
33
|
+
targets,
|
|
34
|
+
base: merged.baseDir,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
return { entries, warnings };
|
|
38
|
+
}
|
|
39
|
+
function loadChainInner(absPath, seen, warnings) {
|
|
40
|
+
if (seen.has(absPath)) {
|
|
41
|
+
warnings.push(`tsconfig extends cycle at ${absPath}; ignoring this hop`);
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
seen.add(absPath);
|
|
45
|
+
const parsed = readAndParse(absPath, warnings);
|
|
46
|
+
if (!parsed)
|
|
47
|
+
return null;
|
|
48
|
+
// Resolve parents first, then apply this file's overrides on top.
|
|
49
|
+
let inherited = null;
|
|
50
|
+
if (parsed.extends) {
|
|
51
|
+
const parents = Array.isArray(parsed.extends) ? parsed.extends : [parsed.extends];
|
|
52
|
+
for (const ext of parents) {
|
|
53
|
+
const parentAbs = resolveExtends(absPath, ext, warnings);
|
|
54
|
+
if (!parentAbs)
|
|
55
|
+
continue;
|
|
56
|
+
const parentResult = loadChainInner(parentAbs, seen, warnings);
|
|
57
|
+
if (!parentResult)
|
|
58
|
+
continue;
|
|
59
|
+
inherited = mergeOverride(inherited, parentResult);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const ownBaseDir = effectiveBaseDir(absPath, parsed);
|
|
63
|
+
const own = {
|
|
64
|
+
paths: parsed.compilerOptions?.paths,
|
|
65
|
+
baseDir: ownBaseDir,
|
|
66
|
+
};
|
|
67
|
+
return mergeOverride(inherited, own);
|
|
68
|
+
}
|
|
69
|
+
function readAndParse(absPath, warnings) {
|
|
70
|
+
let raw;
|
|
71
|
+
try {
|
|
72
|
+
raw = readFileSync(absPath, "utf8");
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
warnings.push(`tsconfig not readable at ${absPath}: ${err.message}`);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const errors = [];
|
|
79
|
+
const parsed = parseJsonc(raw, errors, {
|
|
80
|
+
allowTrailingComma: true,
|
|
81
|
+
disallowComments: false,
|
|
82
|
+
});
|
|
83
|
+
if (errors.length > 0) {
|
|
84
|
+
const messages = errors.map((e) => printParseErrorCode(e.error)).join(", ");
|
|
85
|
+
warnings.push(`tsconfig parse errors in ${absPath}: ${messages}`);
|
|
86
|
+
if (parsed === undefined)
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
if (parsed === null || typeof parsed !== "object") {
|
|
90
|
+
warnings.push(`tsconfig at ${absPath} did not produce an object`);
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return parsed;
|
|
94
|
+
}
|
|
95
|
+
function resolveExtends(fromAbs, spec, warnings) {
|
|
96
|
+
// Relative paths resolve from the importing file's directory. Bare specs
|
|
97
|
+
// (e.g. "@tsconfig/node20/tsconfig.json") go through Node module resolution
|
|
98
|
+
// anchored at the same location.
|
|
99
|
+
const fromDir = dirname(fromAbs);
|
|
100
|
+
if (spec.startsWith(".") || isAbsolute(spec)) {
|
|
101
|
+
const candidate = isAbsolute(spec) ? spec : pathResolve(fromDir, spec);
|
|
102
|
+
// TS conventions: if the path ends without .json, try appending it.
|
|
103
|
+
const withExt = candidate.endsWith(".json") ? candidate : `${candidate}.json`;
|
|
104
|
+
return withExt;
|
|
105
|
+
}
|
|
106
|
+
try {
|
|
107
|
+
const req = createRequire(fromAbs);
|
|
108
|
+
return req.resolve(spec);
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
warnings.push(`tsconfig extends "${spec}" from ${fromAbs} did not resolve`);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function effectiveBaseDir(absPath, parsed) {
|
|
116
|
+
const fileDir = dirname(absPath);
|
|
117
|
+
const baseUrl = parsed.compilerOptions?.baseUrl;
|
|
118
|
+
if (!baseUrl)
|
|
119
|
+
return fileDir;
|
|
120
|
+
return pathResolve(fileDir, baseUrl);
|
|
121
|
+
}
|
|
122
|
+
function mergeOverride(parent, child) {
|
|
123
|
+
// TS replace semantics: if child has paths, child wins entirely; otherwise
|
|
124
|
+
// parent's paths flow through. Each MergedPaths carries the baseDir tied to
|
|
125
|
+
// the *paths* it owns.
|
|
126
|
+
if (child.paths)
|
|
127
|
+
return child;
|
|
128
|
+
if (parent?.paths)
|
|
129
|
+
return parent;
|
|
130
|
+
return child;
|
|
131
|
+
}
|
|
132
|
+
/** Compile a TS-paths-style alias pattern into an anchored RegExp. The single
|
|
133
|
+
* `*` wildcard becomes capture group 1, available for substitution into the
|
|
134
|
+
* target. Shared between tsconfig-derived and config-derived alias entries. */
|
|
135
|
+
export function compileAliasPattern(pattern) {
|
|
136
|
+
return new RegExp(`^${pattern.replace(REGEX_META, "\\$&").replace(/\*/g, "(.*)")}$`);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=tsconfig-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsconfig-loader.js","sourceRoot":"","sources":["../../src/walker/tsconfig-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,EAAE,KAAK,IAAI,UAAU,EAAE,mBAAmB,EAAmB,MAAM,cAAc,CAAC;AAyBzF,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,MAAM,GAAG,cAAc,CAAC,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sB;IAC/D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC;IAChD,IAAI,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC;IAC7B,OAAO,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,aAAa,CAAC,MAA0B,EAAE,KAAkB;IACnE,2EAA2E;IAC3E,4EAA4E;IAC5E,uBAAuB;IACvB,IAAI,KAAK,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IAC9B,IAAI,MAAM,EAAE,KAAK;QAAE,OAAO,MAAM,CAAC;IACjC,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;gFAEgF;AAChF,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,OAAO,IAAI,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AACvF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@component-compass/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Open-source CLI for measuring design-system component usage across multi-framework consumer repos.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,34 +33,36 @@
|
|
|
33
33
|
"clean": "rm -rf dist .turbo"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@babel/parser": "
|
|
37
|
-
"@babel/types": "
|
|
38
|
-
"@component-compass/ast-utils": "
|
|
39
|
-
"@component-compass/manifest-react": "
|
|
40
|
-
"@component-compass/manifest-vue": "
|
|
41
|
-
"@component-compass/parser-html": "
|
|
42
|
-
"@component-compass/parser-lit": "
|
|
43
|
-
"@component-compass/parser-react": "
|
|
44
|
-
"@component-compass/parser-vue": "
|
|
45
|
-
"@component-compass/plugin-core": "
|
|
46
|
-
"@
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
36
|
+
"@babel/parser": "7.29.3",
|
|
37
|
+
"@babel/types": "7.29.0",
|
|
38
|
+
"@component-compass/ast-utils": "0.1.0",
|
|
39
|
+
"@component-compass/manifest-react": "0.1.0",
|
|
40
|
+
"@component-compass/manifest-vue": "0.1.0",
|
|
41
|
+
"@component-compass/parser-html": "0.1.0",
|
|
42
|
+
"@component-compass/parser-lit": "0.1.0",
|
|
43
|
+
"@component-compass/parser-react": "0.1.0",
|
|
44
|
+
"@component-compass/parser-vue": "0.1.0",
|
|
45
|
+
"@component-compass/plugin-core": "0.1.0",
|
|
46
|
+
"@component-compass/reference-graph": "0.1.0",
|
|
47
|
+
"@vue/compiler-sfc": "3.5.33",
|
|
48
|
+
"ajv": "8.20.0",
|
|
49
|
+
"glob": "13.0.6",
|
|
50
|
+
"globby": "16.2.0",
|
|
51
|
+
"js-yaml": "4.1.1",
|
|
52
|
+
"jsonc-parser": "^3.3.1",
|
|
53
|
+
"oxc-parser": "0.130.0",
|
|
54
|
+
"oxc-walker": "1.0.0",
|
|
55
|
+
"parse5": "8.0.1",
|
|
56
|
+
"picomatch": "4.0.4",
|
|
57
|
+
"ulid": "3.0.2"
|
|
56
58
|
},
|
|
57
59
|
"devDependencies": {
|
|
58
|
-
"@oxc-project/types": "
|
|
59
|
-
"@types/js-yaml": "
|
|
60
|
-
"@types/node": "
|
|
61
|
-
"@types/picomatch": "
|
|
62
|
-
"typescript": "
|
|
63
|
-
"vitest": "
|
|
60
|
+
"@oxc-project/types": "0.130.0",
|
|
61
|
+
"@types/js-yaml": "4.0.9",
|
|
62
|
+
"@types/node": "24.12.2",
|
|
63
|
+
"@types/picomatch": "4.0.3",
|
|
64
|
+
"typescript": "5.9.3",
|
|
65
|
+
"vitest": "4.1.5"
|
|
64
66
|
},
|
|
65
67
|
"engines": {
|
|
66
68
|
"node": ">=20"
|