@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.
Files changed (3) hide show
  1. package/cli.ts +5 -0
  2. package/core/arch.ts +6 -1
  3. 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) => absPath === p || absPath.startsWith(`${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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konvert7/klint",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Architecture-as-Code linter for TypeScript. Enforce layer boundaries, import rules, and singleton patterns in YAML.",
5
5
  "type": "module",
6
6
  "bin": {