@konvert7/klint 0.2.0 → 0.3.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/cli.ts +5 -0
- package/core/arch.ts +6 -1
- package/package.json +1 -1
package/cli.ts
CHANGED
|
@@ -24,6 +24,11 @@ interface CliOptions {
|
|
|
24
24
|
export async function main(opts: CliOptions = {}): Promise<void> {
|
|
25
25
|
const args = process.argv.slice(2);
|
|
26
26
|
|
|
27
|
+
if (args[0] === "help" || args[0] === "h") {
|
|
28
|
+
printHelp();
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
if (args[0] === "install-skill") {
|
|
28
33
|
await installSkill(args.slice(1));
|
|
29
34
|
return;
|
package/core/arch.ts
CHANGED
|
@@ -92,7 +92,12 @@ function resolveLayerFiles(
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
function inPrefixes(absPath: string, prefixes: string[]): boolean {
|
|
95
|
-
return prefixes.some((p) =>
|
|
95
|
+
return prefixes.some((p) => {
|
|
96
|
+
if (absPath === p || absPath.startsWith(`${p}/`)) return true;
|
|
97
|
+
// Extension-less imports ("../cli") won't match a prefix like "{root}/cli.ts"
|
|
98
|
+
const bare = p.replace(/\.(tsx?|jsx?|mts|cts)$/, "");
|
|
99
|
+
return bare !== p && (absPath === bare || absPath.startsWith(`${bare}/`));
|
|
100
|
+
});
|
|
96
101
|
}
|
|
97
102
|
|
|
98
103
|
function scanImports(
|
package/package.json
CHANGED