@nodeve/checks 1.6.0 → 1.8.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/README.md +1 -0
- package/dist/bin/build-helper-manifest.js +36 -43
- package/dist/bin/build-helper-manifest.js.map +1 -1
- package/dist/bin/build-lib-names.js +4 -0
- package/dist/bin/build-lib-names.js.map +1 -1
- package/dist/bin/find-similar-svelte.d.ts +10 -0
- package/dist/bin/find-similar-svelte.d.ts.map +1 -0
- package/dist/bin/find-similar-svelte.js +207 -0
- package/dist/bin/find-similar-svelte.js.map +1 -0
- package/dist/bin/require-eslint.d.ts +3 -0
- package/dist/bin/require-eslint.d.ts.map +1 -0
- package/dist/bin/require-eslint.js +5 -0
- package/dist/bin/require-eslint.js.map +1 -0
- package/dist/checks/catalog.d.ts.map +1 -1
- package/dist/checks/catalog.js +41 -43
- package/dist/checks/catalog.js.map +1 -1
- package/dist/checks/clones.d.ts.map +1 -1
- package/dist/checks/clones.js +76 -55
- package/dist/checks/clones.js.map +1 -1
- package/dist/checks/commit-msg.d.ts.map +1 -1
- package/dist/checks/commit-msg.js +22 -18
- package/dist/checks/commit-msg.js.map +1 -1
- package/dist/checks/helper-collisions.d.ts.map +1 -1
- package/dist/checks/helper-collisions.js +44 -36
- package/dist/checks/helper-collisions.js.map +1 -1
- package/dist/checks/inline-dupes.d.ts.map +1 -1
- package/dist/checks/inline-dupes.js +20 -18
- package/dist/checks/inline-dupes.js.map +1 -1
- package/dist/checks/plural-arrays.d.ts.map +1 -1
- package/dist/checks/plural-arrays.js +4 -3
- package/dist/checks/plural-arrays.js.map +1 -1
- package/dist/checks/require-eslint.d.ts +3 -0
- package/dist/checks/require-eslint.d.ts.map +1 -0
- package/dist/checks/require-eslint.js +42 -0
- package/dist/checks/require-eslint.js.map +1 -0
- package/dist/checks/reshape.d.ts.map +1 -1
- package/dist/checks/reshape.js +41 -32
- package/dist/checks/reshape.js.map +1 -1
- package/dist/lib/ast.d.ts +2 -1
- package/dist/lib/ast.d.ts.map +1 -1
- package/dist/lib/ast.js +4 -4
- package/dist/lib/ast.js.map +1 -1
- package/dist/lib/bin.d.ts +18 -2
- package/dist/lib/bin.d.ts.map +1 -1
- package/dist/lib/bin.js +17 -4
- package/dist/lib/bin.js.map +1 -1
- package/dist/lib/config.d.ts +16 -9
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +1 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/defaults.d.ts +5 -0
- package/dist/lib/defaults.d.ts.map +1 -1
- package/dist/lib/defaults.js +10 -0
- package/dist/lib/defaults.js.map +1 -1
- package/dist/lib/length.d.ts +13 -5
- package/dist/lib/length.d.ts.map +1 -1
- package/dist/lib/length.js +1 -1
- package/dist/lib/length.js.map +1 -1
- package/dist/lib/manifest-ast.d.ts.map +1 -1
- package/dist/lib/manifest-ast.js +66 -41
- package/dist/lib/manifest-ast.js.map +1 -1
- package/dist/lib/registry.d.ts.map +1 -1
- package/dist/lib/registry.js +2 -0
- package/dist/lib/registry.js.map +1 -1
- package/dist/lib/repo.d.ts +11 -1
- package/dist/lib/repo.d.ts.map +1 -1
- package/dist/lib/repo.js +46 -4
- package/dist/lib/repo.js.map +1 -1
- package/lefthook.checks.yml +17 -0
- package/nodeve.checks.defaults.js +10 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ Copy `node_modules/@nodeve/checks/nodeve.checks.defaults.js` to your repo root a
|
|
|
46
46
|
| `file-size` | TS sources over a line budget (warn >225, fail >300) | on (`apps/`, `packages/`) |
|
|
47
47
|
| `catalog` | dependency versions not single-sourced from a workspace catalog | on (a workspace must declare a catalog) |
|
|
48
48
|
| `require-deps` | org-required deps missing from the workspace catalog | on (`remeda`; set `deps: []` to opt out) |
|
|
49
|
+
| `require-eslint` | repo ships no root eslint flat config (eslint is org-mandatory) | on (set `requireEslint: { enforce: false }` to opt out) |
|
|
49
50
|
| `commit-msg` | commit message off Conventional Commits, or a sizeable change with no body | on (`commit-msg` hook; body required past 50 changed lines) |
|
|
50
51
|
|
|
51
52
|
Run any of them as `nodeve-check <name>`. Each also has a standalone `nodeve-check-<name>` bin (identical behavior) for direct invocation.
|
|
@@ -21,57 +21,50 @@ const { root, cfg } = await loadGate('helperManifest');
|
|
|
21
21
|
if (cfg.packages.length === 0)
|
|
22
22
|
process.exit(0);
|
|
23
23
|
const OUTPUT = join(root, cfg.output);
|
|
24
|
-
function
|
|
24
|
+
function exportedEntry(options) {
|
|
25
|
+
const { pkgDir, barrel, reExport, declarations } = options;
|
|
26
|
+
if (reExport.typeOnly)
|
|
27
|
+
return null;
|
|
28
|
+
const sourcePath = resolveSource(dirname(barrel.barrelPath), reExport.module);
|
|
29
|
+
if (!sourcePath)
|
|
30
|
+
return null;
|
|
31
|
+
const context = {
|
|
32
|
+
importPath: barrel.importPath,
|
|
33
|
+
file: relative(pkgDir, sourcePath),
|
|
34
|
+
srcPath: sourcePath,
|
|
35
|
+
symbol: reExport.exportedName,
|
|
36
|
+
};
|
|
37
|
+
if (sourcePath.endsWith('.svelte'))
|
|
38
|
+
return { ...context, kind: 'component', signature: reExport.exportedName, summary: '' };
|
|
39
|
+
const declaration = declarations(sourcePath).get(reExport.localName);
|
|
40
|
+
return declaration ? { ...context, ...declaration } : null;
|
|
41
|
+
}
|
|
42
|
+
function barrelEntries(pkgDir, barrel, declarations) {
|
|
43
|
+
if (!existsSync(barrel.barrelPath))
|
|
44
|
+
return [];
|
|
45
|
+
return reExportsOf(barrel.barrelPath).flatMap((reExport) => {
|
|
46
|
+
const entry = exportedEntry({ pkgDir, barrel, reExport, declarations });
|
|
47
|
+
return entry ? [entry] : [];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function collectExports() {
|
|
25
51
|
const entries = [];
|
|
26
52
|
const declCache = new Map();
|
|
27
|
-
const
|
|
28
|
-
if (!declCache.has(
|
|
29
|
-
declCache.set(
|
|
30
|
-
return declCache.get(
|
|
53
|
+
const declarations = (path) => {
|
|
54
|
+
if (!declCache.has(path))
|
|
55
|
+
declCache.set(path, declarationsOf(path));
|
|
56
|
+
return declCache.get(path);
|
|
31
57
|
};
|
|
32
58
|
for (const pkgRel of cfg.packages) {
|
|
33
59
|
const pkgDir = join(root, pkgRel);
|
|
34
|
-
for (const barrel of barrelsOf(pkgDir))
|
|
35
|
-
|
|
36
|
-
continue;
|
|
37
|
-
const barrelDir = dirname(barrel.barrelPath);
|
|
38
|
-
for (const re of reExportsOf(barrel.barrelPath)) {
|
|
39
|
-
if (re.typeOnly)
|
|
40
|
-
continue; // types are out of scope for v1
|
|
41
|
-
const sourcePath = resolveSource(barrelDir, re.module);
|
|
42
|
-
if (!sourcePath)
|
|
43
|
-
continue;
|
|
44
|
-
const file = relative(pkgDir, sourcePath);
|
|
45
|
-
if (sourcePath.endsWith('.svelte')) {
|
|
46
|
-
entries.push({
|
|
47
|
-
importPath: barrel.importPath,
|
|
48
|
-
file,
|
|
49
|
-
srcPath: sourcePath,
|
|
50
|
-
symbol: re.exportedName,
|
|
51
|
-
kind: 'component',
|
|
52
|
-
signature: re.exportedName,
|
|
53
|
-
summary: '',
|
|
54
|
-
});
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
const decl = declsFor(sourcePath).get(re.localName);
|
|
58
|
-
if (!decl)
|
|
59
|
-
continue;
|
|
60
|
-
entries.push({
|
|
61
|
-
importPath: barrel.importPath,
|
|
62
|
-
file,
|
|
63
|
-
srcPath: sourcePath,
|
|
64
|
-
symbol: re.exportedName,
|
|
65
|
-
...decl,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
60
|
+
for (const barrel of barrelsOf(pkgDir))
|
|
61
|
+
entries.push(...barrelEntries(pkgDir, barrel, declarations));
|
|
69
62
|
}
|
|
70
63
|
return entries.sort((a, b) => a.importPath.localeCompare(b.importPath) ||
|
|
71
64
|
a.file.localeCompare(b.file) ||
|
|
72
65
|
a.symbol.localeCompare(b.symbol));
|
|
73
66
|
}
|
|
74
|
-
function
|
|
67
|
+
function renderManifest(entries) {
|
|
75
68
|
const packages = new Set(entries.map((e) => e.importPath.split('/').slice(0, 2).join('/')));
|
|
76
69
|
const lines = [
|
|
77
70
|
'# Helper manifest — public surface of the configured packages',
|
|
@@ -103,8 +96,8 @@ function render(entries) {
|
|
|
103
96
|
lines.push('');
|
|
104
97
|
return lines.join('\n');
|
|
105
98
|
}
|
|
106
|
-
const entries =
|
|
99
|
+
const entries = collectExports();
|
|
107
100
|
mkdirSync(dirname(OUTPUT), { recursive: true });
|
|
108
|
-
writeFileSync(OUTPUT,
|
|
101
|
+
writeFileSync(OUTPUT, renderManifest(entries));
|
|
109
102
|
console.log(`Wrote ${entries.length} symbols to ${relative(root, OUTPUT)}`);
|
|
110
103
|
//# sourceMappingURL=build-helper-manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-helper-manifest.js","sourceRoot":"","sources":["../../src/bin/build-helper-manifest.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACN,SAAS,EACT,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,
|
|
1
|
+
{"version":3,"file":"build-helper-manifest.js","sourceRoot":"","sources":["../../src/bin/build-helper-manifest.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC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C,CAAC;QACxD,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,UAAU,QAAQ,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,SAAS,GAAG,OAAO,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;IACvF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;AACjC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,aAAa,CAAC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;AAC/C,OAAO,CAAC,GAAG,CAAC,SAAS,OAAO,CAAC,MAAM,eAAe,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -21,8 +21,12 @@ const skipped = [];
|
|
|
21
21
|
for (const lib of cfg.libs) {
|
|
22
22
|
try {
|
|
23
23
|
const mod = (await import(lib));
|
|
24
|
+
// A default-only export (e.g. remeda-humps' `humps`) carries its identity in the
|
|
25
|
+
// function's runtime `.name`, not the `default` key — index it under that name.
|
|
26
|
+
const nameOf = (k) => k === 'default' ? mod.default.name || k : k;
|
|
24
27
|
const fns = Object.keys(mod)
|
|
25
28
|
.filter((k) => typeof mod[k] === 'function')
|
|
29
|
+
.map(nameOf)
|
|
26
30
|
.sort();
|
|
27
31
|
if (fns.length)
|
|
28
32
|
namesByLib[lib] = fns;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-lib-names.js","sourceRoot":"","sources":["../../src/bin/build-lib-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,QAAQ,OAAO,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;IACzG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,8BAA8B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3E,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Finds structurally similar Svelte components that could potentially be consolidated.
|
|
4
|
+
*
|
|
5
|
+
* Usage: nodeve-check-find-similar-svelte [directory] [threshold]
|
|
6
|
+
* directory: Path to scan (default: src/lib)
|
|
7
|
+
* threshold: Similarity threshold 0-1 (default: 0.6)
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=find-similar-svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-similar-svelte.d.ts","sourceRoot":"","sources":["../../src/bin/find-similar-svelte.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Finds structurally similar Svelte components that could potentially be consolidated.
|
|
4
|
+
*
|
|
5
|
+
* Usage: nodeve-check-find-similar-svelte [directory] [threshold]
|
|
6
|
+
* directory: Path to scan (default: src/lib)
|
|
7
|
+
* threshold: Similarity threshold 0-1 (default: 0.6)
|
|
8
|
+
*/
|
|
9
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
const DEFAULT_DIR = 'src/lib';
|
|
12
|
+
const DEFAULT_THRESHOLD = 0.6;
|
|
13
|
+
/** Extract the template (HTML) portion from a Svelte file */
|
|
14
|
+
function extractTemplate(source) {
|
|
15
|
+
return source
|
|
16
|
+
.replace(/<script[\s\S]*?<\/script>/gi, '')
|
|
17
|
+
.replace(/<style[\s\S]*?<\/style>/gi, '')
|
|
18
|
+
.trim();
|
|
19
|
+
}
|
|
20
|
+
/** Extract the script portion from a Svelte file */
|
|
21
|
+
function extractScript(source) {
|
|
22
|
+
const match = source.match(/<script[^>]*>([\s\S]*?)<\/script>/i);
|
|
23
|
+
return match?.[1]?.trim() ?? '';
|
|
24
|
+
}
|
|
25
|
+
/** Extract props interface for comparison */
|
|
26
|
+
function extractPropsInterface(script) {
|
|
27
|
+
const match = script.match(/interface\s+Props\s*\{[\s\S]*?\}/i);
|
|
28
|
+
return match?.[0] ?? null;
|
|
29
|
+
}
|
|
30
|
+
/** Tokenize HTML template, normalizing text content and attributes */
|
|
31
|
+
function tokenizeTemplate(template) {
|
|
32
|
+
const tokens = [];
|
|
33
|
+
// Extract structural elements: tags, attributes (names only), structure
|
|
34
|
+
const tagPattern = /<\/?([a-zA-Z][a-zA-Z0-9-]*)[^>]*>/g;
|
|
35
|
+
let match;
|
|
36
|
+
while ((match = tagPattern.exec(template)) !== null) {
|
|
37
|
+
const fullTag = match[0];
|
|
38
|
+
const tagName = match[1].toLowerCase();
|
|
39
|
+
const isClosing = fullTag.startsWith('</');
|
|
40
|
+
if (isClosing) {
|
|
41
|
+
tokens.push(`</${tagName}>`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Extract attribute names (not values) for structural comparison
|
|
45
|
+
const attrNames = extractAttributeNames(fullTag);
|
|
46
|
+
tokens.push(`<${tagName}:${attrNames.join(',')}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return tokens;
|
|
50
|
+
}
|
|
51
|
+
/** Extract attribute names from a tag string */
|
|
52
|
+
function extractAttributeNames(tag) {
|
|
53
|
+
const attrs = [];
|
|
54
|
+
// Match attribute names (handles various formats)
|
|
55
|
+
const attrPattern = /\s([a-zA-Z_:][-a-zA-Z0-9_:.]*)\s*(?:=|\/?>|$)/g;
|
|
56
|
+
let match;
|
|
57
|
+
while ((match = attrPattern.exec(tag)) !== null) {
|
|
58
|
+
attrs.push(match[1].toLowerCase());
|
|
59
|
+
}
|
|
60
|
+
return attrs.sort();
|
|
61
|
+
}
|
|
62
|
+
/** Tokenize script for structural comparison */
|
|
63
|
+
function tokenizeScript(script) {
|
|
64
|
+
// Normalize and tokenize: remove string literals, normalize whitespace
|
|
65
|
+
const normalized = script
|
|
66
|
+
.replace(/'[^']*'/g, "'STR'")
|
|
67
|
+
.replace(/"[^"]*"/g, '"STR"')
|
|
68
|
+
.replace(/`[^`]*`/g, '`STR`')
|
|
69
|
+
.replace(/\s+/g, ' ')
|
|
70
|
+
.trim();
|
|
71
|
+
// Split into tokens (simple word/symbol boundary)
|
|
72
|
+
return normalized.split(/\s+/).filter(Boolean);
|
|
73
|
+
}
|
|
74
|
+
/** Calculate Jaccard similarity between two token arrays */
|
|
75
|
+
function jaccardSimilarity(a, b) {
|
|
76
|
+
if (a.length === 0 && b.length === 0)
|
|
77
|
+
return 1;
|
|
78
|
+
if (a.length === 0 || b.length === 0)
|
|
79
|
+
return 0;
|
|
80
|
+
const setA = new Set(a);
|
|
81
|
+
const setB = new Set(b);
|
|
82
|
+
let intersection = 0;
|
|
83
|
+
for (const item of setA) {
|
|
84
|
+
if (setB.has(item))
|
|
85
|
+
intersection++;
|
|
86
|
+
}
|
|
87
|
+
const union = setA.size + setB.size - intersection;
|
|
88
|
+
return union === 0 ? 0 : intersection / union;
|
|
89
|
+
}
|
|
90
|
+
/** Calculate n-gram similarity for better sequence matching */
|
|
91
|
+
function ngramSimilarity(a, b, n = 3) {
|
|
92
|
+
const getNgrams = (tokens) => {
|
|
93
|
+
const ngrams = new Set();
|
|
94
|
+
for (let i = 0; i <= tokens.length - n; i++) {
|
|
95
|
+
ngrams.add(tokens.slice(i, i + n).join('|'));
|
|
96
|
+
}
|
|
97
|
+
return ngrams;
|
|
98
|
+
};
|
|
99
|
+
const ngramsA = getNgrams(a);
|
|
100
|
+
const ngramsB = getNgrams(b);
|
|
101
|
+
if (ngramsA.size === 0 && ngramsB.size === 0)
|
|
102
|
+
return 1;
|
|
103
|
+
if (ngramsA.size === 0 || ngramsB.size === 0)
|
|
104
|
+
return 0;
|
|
105
|
+
let intersection = 0;
|
|
106
|
+
for (const ng of ngramsA) {
|
|
107
|
+
if (ngramsB.has(ng))
|
|
108
|
+
intersection++;
|
|
109
|
+
}
|
|
110
|
+
const union = ngramsA.size + ngramsB.size - intersection;
|
|
111
|
+
return union === 0 ? 0 : intersection / union;
|
|
112
|
+
}
|
|
113
|
+
/** Combined similarity score */
|
|
114
|
+
function calculateSimilarity(a, b) {
|
|
115
|
+
// Template similarity (weighted higher - structure matters most)
|
|
116
|
+
const templateJaccard = jaccardSimilarity(a.templateTokens, b.templateTokens);
|
|
117
|
+
const templateNgram = ngramSimilarity(a.templateTokens, b.templateTokens);
|
|
118
|
+
const templateScore = templateJaccard * 0.4 + templateNgram * 0.6;
|
|
119
|
+
// Script similarity
|
|
120
|
+
const scriptJaccard = jaccardSimilarity(a.scriptTokens, b.scriptTokens);
|
|
121
|
+
const scriptNgram = ngramSimilarity(a.scriptTokens, b.scriptTokens);
|
|
122
|
+
const scriptScore = scriptJaccard * 0.4 + scriptNgram * 0.6;
|
|
123
|
+
// Props interface exact match bonus
|
|
124
|
+
const propsBonus = a.propsInterface && b.propsInterface && a.propsInterface === b.propsInterface ? 0.1 : 0;
|
|
125
|
+
// Combined score: template matters more than script
|
|
126
|
+
return Math.min(1, templateScore * 0.6 + scriptScore * 0.3 + propsBonus);
|
|
127
|
+
}
|
|
128
|
+
/** Analyze a single Svelte file */
|
|
129
|
+
function analyzeComponent(filePath) {
|
|
130
|
+
try {
|
|
131
|
+
const source = readFileSync(filePath, 'utf8');
|
|
132
|
+
const template = extractTemplate(source);
|
|
133
|
+
const script = extractScript(source);
|
|
134
|
+
return {
|
|
135
|
+
path: filePath,
|
|
136
|
+
templateTokens: tokenizeTemplate(template),
|
|
137
|
+
scriptTokens: tokenizeScript(script),
|
|
138
|
+
propsInterface: extractPropsInterface(script)
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
console.error(`Failed to analyze ${filePath}:`, error);
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/** Find all similar component pairs */
|
|
147
|
+
async function findSimilarComponents(directory, threshold) {
|
|
148
|
+
const files = readdirSync(directory, { recursive: true, encoding: 'utf8' })
|
|
149
|
+
.filter((f) => f.endsWith('.svelte'))
|
|
150
|
+
.map((f) => join(directory, f));
|
|
151
|
+
console.log(`Scanning ${files.length} Svelte components in ${directory}...\n`);
|
|
152
|
+
// Analyze all components
|
|
153
|
+
const components = [];
|
|
154
|
+
for (const file of files) {
|
|
155
|
+
const info = analyzeComponent(file);
|
|
156
|
+
if (info && info.templateTokens.length > 0) {
|
|
157
|
+
components.push(info);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// Compare all pairs
|
|
161
|
+
const similarPairs = [];
|
|
162
|
+
for (let i = 0; i < components.length; i++) {
|
|
163
|
+
for (let j = i + 1; j < components.length; j++) {
|
|
164
|
+
const similarity = calculateSimilarity(components[i], components[j]);
|
|
165
|
+
if (similarity >= threshold) {
|
|
166
|
+
similarPairs.push({
|
|
167
|
+
fileA: components[i].path,
|
|
168
|
+
fileB: components[j].path,
|
|
169
|
+
similarity
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// Sort by similarity descending
|
|
175
|
+
similarPairs.sort((a, b) => b.similarity - a.similarity);
|
|
176
|
+
return similarPairs;
|
|
177
|
+
}
|
|
178
|
+
/** Format path for display */
|
|
179
|
+
function shortPath(fullPath) {
|
|
180
|
+
return fullPath.replace(process.cwd() + '/', '');
|
|
181
|
+
}
|
|
182
|
+
async function reportSimilarComponents() {
|
|
183
|
+
const args = process.argv.slice(2);
|
|
184
|
+
const directory = args[0] || DEFAULT_DIR;
|
|
185
|
+
const threshold = parseFloat(args[1]) || DEFAULT_THRESHOLD;
|
|
186
|
+
console.log('╭─────────────────────────────────────────────────────────╮');
|
|
187
|
+
console.log('│ Svelte Component Similarity Detector │');
|
|
188
|
+
console.log('╰─────────────────────────────────────────────────────────╯');
|
|
189
|
+
console.log();
|
|
190
|
+
const pairs = await findSimilarComponents(directory, threshold);
|
|
191
|
+
if (pairs.length === 0) {
|
|
192
|
+
console.log(`✓ No similar components found above ${(threshold * 100).toFixed(0)}% threshold`);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
console.log(`Found ${pairs.length} similar component pair(s):\n`);
|
|
196
|
+
for (const pair of pairs) {
|
|
197
|
+
const pct = (pair.similarity * 100).toFixed(1);
|
|
198
|
+
console.log(`┌─ ${pct}% similar ─────────────────────────────`);
|
|
199
|
+
console.log(`│ ${shortPath(pair.fileA)}`);
|
|
200
|
+
console.log(`│ ${shortPath(pair.fileB)}`);
|
|
201
|
+
console.log(`└────────────────────────────────────────────────`);
|
|
202
|
+
console.log();
|
|
203
|
+
}
|
|
204
|
+
console.log('Consider reviewing these pairs for potential consolidation.');
|
|
205
|
+
}
|
|
206
|
+
reportSimilarComponents().catch(console.error);
|
|
207
|
+
//# sourceMappingURL=find-similar-svelte.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-similar-svelte.js","sourceRoot":"","sources":["../../src/bin/find-similar-svelte.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,GAAG,SAAS,CAAA;AAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAS7B,6DAA6D;AAC7D,SAAS,eAAe,CAAC,MAAc;IACtC,OAAO,MAAM;SACX,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC;SAC1C,OAAO,CAAC,2BAA2B,EAAE,EAAE,CAAC;SACxC,IAAI,EAAE,CAAA;AACT,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../src/bin/require-eslint.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-eslint.js","sourceRoot":"","sources":["../../src/bin/require-eslint.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAqE9C,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,SAAS,CA+BpC,CAAC"}
|
package/dist/checks/catalog.js
CHANGED
|
@@ -29,6 +29,44 @@ const DEP_FIELDS = [
|
|
|
29
29
|
'peerDependencies',
|
|
30
30
|
'optionalDependencies',
|
|
31
31
|
];
|
|
32
|
+
function missingCatalogFailure() {
|
|
33
|
+
return {
|
|
34
|
+
status: 'fail',
|
|
35
|
+
summary: 'this workspace declares no catalog',
|
|
36
|
+
rows: [
|
|
37
|
+
'Every workspace must single-source its dependency versions through a',
|
|
38
|
+
'catalog. Add a `catalog:` block to pnpm-workspace.yaml (or',
|
|
39
|
+
'`workspaces.catalog` in package.json for Bun), move your versions into',
|
|
40
|
+
'it, and reference them with "catalog:".',
|
|
41
|
+
'',
|
|
42
|
+
'To deliberately opt out, set `catalog: { enforce: false }` in nodeve.checks.js.',
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function catalogEntryError({ manifest, name, version, ws, }) {
|
|
47
|
+
if (!version.startsWith('catalog:'))
|
|
48
|
+
return `${manifest}: "${name}": "${version}" — pin it in a root catalog and use "catalog:" (or "catalog:<group>")`;
|
|
49
|
+
const group = version.slice('catalog:'.length);
|
|
50
|
+
const table = group === '' ? ws.catalog : ws.catalogs[group];
|
|
51
|
+
if (!table)
|
|
52
|
+
return `${manifest}: "${name}": "${version}" — no catalog group named "${group}" in the workspace`;
|
|
53
|
+
if (name in table)
|
|
54
|
+
return null;
|
|
55
|
+
const where = group === '' ? 'the default catalog' : `catalog "${group}"`;
|
|
56
|
+
return `${manifest}: "${name}": "${version}" — ${where} does not define "${name}"`;
|
|
57
|
+
}
|
|
58
|
+
function catalogErrors(options) {
|
|
59
|
+
const { root, manifests, ws, allowlist } = options;
|
|
60
|
+
return manifests.flatMap((manifest) => {
|
|
61
|
+
const pkg = JSON.parse(readFileSync(join(root, manifest), 'utf8'));
|
|
62
|
+
return DEP_FIELDS.flatMap((field) => Object.entries((pkg[field] ?? {})).flatMap(([name, version]) => {
|
|
63
|
+
if (allowlist.has(`${manifest}::${name}`) || /^(workspace|link|file):/.test(version))
|
|
64
|
+
return [];
|
|
65
|
+
const error = catalogEntryError({ manifest, name, version, ws });
|
|
66
|
+
return error ? [error] : [];
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
}
|
|
32
70
|
export const catalog = {
|
|
33
71
|
name: 'catalog',
|
|
34
72
|
section: 'catalog',
|
|
@@ -44,50 +82,10 @@ reference it with "catalog:", then reinstall.`,
|
|
|
44
82
|
// A workspace must declare a catalog — alignment is the point, so "no catalog"
|
|
45
83
|
// is itself a failure, not a free pass. Opt a repo out deliberately with
|
|
46
84
|
// `catalog.enforce: false` rather than by omitting the catalog.
|
|
47
|
-
if (Object.keys(ws.catalog).length === 0 && Object.keys(ws.catalogs).length === 0)
|
|
48
|
-
return
|
|
49
|
-
status: 'fail',
|
|
50
|
-
summary: 'this workspace declares no catalog',
|
|
51
|
-
rows: [
|
|
52
|
-
'Every workspace must single-source its dependency versions through a',
|
|
53
|
-
'catalog. Add a `catalog:` block to pnpm-workspace.yaml (or',
|
|
54
|
-
'`workspaces.catalog` in package.json for Bun), move your versions into',
|
|
55
|
-
'it, and reference them with "catalog:".',
|
|
56
|
-
'',
|
|
57
|
-
'To deliberately opt out, set `catalog: { enforce: false }` in nodeve.checks.js.',
|
|
58
|
-
],
|
|
59
|
-
};
|
|
60
|
-
}
|
|
85
|
+
if (Object.keys(ws.catalog).length === 0 && Object.keys(ws.catalogs).length === 0)
|
|
86
|
+
return missingCatalogFailure();
|
|
61
87
|
const manifests = workspaceManifests(root, ws);
|
|
62
|
-
const errors =
|
|
63
|
-
for (const manifest of manifests) {
|
|
64
|
-
const pkg = JSON.parse(readFileSync(join(root, manifest), 'utf8'));
|
|
65
|
-
for (const field of DEP_FIELDS) {
|
|
66
|
-
const deps = pkg[field] ?? {};
|
|
67
|
-
for (const [name, version] of Object.entries(deps)) {
|
|
68
|
-
if (allowlist.has(`${manifest}::${name}`))
|
|
69
|
-
continue;
|
|
70
|
-
// Local references, not version pins — single-sourcing doesn't apply.
|
|
71
|
-
if (/^(workspace|link|file):/.test(version))
|
|
72
|
-
continue;
|
|
73
|
-
if (!version.startsWith('catalog:')) {
|
|
74
|
-
// Rule 1: literal version pin — every dependency must go through a catalog.
|
|
75
|
-
errors.push(`${manifest}: "${name}": "${version}" — pin it in a root catalog and use "catalog:" (or "catalog:<group>")`);
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
// Rule 2: the referenced catalog must actually define this dependency.
|
|
79
|
-
const group = version.slice('catalog:'.length); // "" → the default catalog
|
|
80
|
-
const table = group === '' ? ws.catalog : ws.catalogs[group];
|
|
81
|
-
if (!table) {
|
|
82
|
-
errors.push(`${manifest}: "${name}": "${version}" — no catalog group named "${group}" in the workspace`);
|
|
83
|
-
}
|
|
84
|
-
else if (!(name in table)) {
|
|
85
|
-
const where = group === '' ? 'the default catalog' : `catalog "${group}"`;
|
|
86
|
-
errors.push(`${manifest}: "${name}": "${version}" — ${where} does not define "${name}"`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
88
|
+
const errors = catalogErrors({ root, manifests, ws, allowlist });
|
|
91
89
|
if (errors.length > 0)
|
|
92
90
|
return {
|
|
93
91
|
status: 'fail',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,UAAU,GAAG;IAClB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;CACb,CAAC;AAEX,
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/checks/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAgB,aAAa,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,MAAM,UAAU,GAAG;IAClB,cAAc;IACd,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;CACb,CAAC;AAEX,SAAS,qBAAqB;IAC7B,OAAO;QACN,MAAM,EAAE,MAAe;QACvB,OAAO,EAAE,oCAAoC;QAC7C,IAAI,EAAE;YACL,sEAAsE;YACtE,4DAA4D;YAC5D,wEAAwE;YACxE,yCAAyC;YACzC,EAAE;YACF,iFAAiF;SACjF;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C;QAC/C,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAEjE,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;YACpB,OAAO;gBACN,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,0EAA0E;gBACnF,IAAI,EAAE,MAAM;aACZ,CAAC;QAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clones.d.ts","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"clones.d.ts","sourceRoot":"","sources":["../../src/checks/clones.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AA8F9C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,QAAQ,CAoDlC,CAAC"}
|