@hyphaene/hexa-ts-kit 1.12.2 → 1.13.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.
@@ -2443,14 +2443,16 @@ var ALLOWED_SUFFIXES = [
2443
2443
  ".rules.ts"
2444
2444
  ];
2445
2445
  var ALLOWED_SPECIAL_FILES = ["index.ts", "openapi.ts"];
2446
- function parseFile(filePath) {
2446
+ function createProject() {
2447
+ return new Project3({
2448
+ useInMemoryFileSystem: true,
2449
+ skipAddingFilesFromTsConfig: true
2450
+ });
2451
+ }
2452
+ function parseFile(filePath, project) {
2447
2453
  try {
2448
- const project = new Project3({
2449
- useInMemoryFileSystem: false,
2450
- skipAddingFilesFromTsConfig: true
2451
- });
2452
- project.addSourceFileAtPath(filePath);
2453
- return project.getSourceFileOrThrow(filePath);
2454
+ const content = readFileSync4(filePath, "utf-8");
2455
+ return project.createSourceFile(filePath, content, { overwrite: true });
2454
2456
  } catch {
2455
2457
  return null;
2456
2458
  }
@@ -2584,7 +2586,7 @@ function getNonReexportStatements(sourceFile) {
2584
2586
  }
2585
2587
  return violations;
2586
2588
  }
2587
- async function checkEnumBundleRules(cwd) {
2589
+ async function checkEnumBundleRules(cwd, project) {
2588
2590
  const results = [];
2589
2591
  const files = await fg9("src/**/*.enum-bundle.ts", {
2590
2592
  cwd,
@@ -2593,7 +2595,7 @@ async function checkEnumBundleRules(cwd) {
2593
2595
  for (const file of files) {
2594
2596
  const fullPath = `${cwd}/${file}`;
2595
2597
  const content = readFileContent(fullPath);
2596
- const sourceFile = parseFile(fullPath);
2598
+ const sourceFile = parseFile(fullPath, project);
2597
2599
  if (!sourceFile) continue;
2598
2600
  const exportedNames = getExportedNames(sourceFile);
2599
2601
  const fileName = basename5(file, ".enum-bundle.ts");
@@ -2637,7 +2639,7 @@ async function checkEnumBundleRules(cwd) {
2637
2639
  }
2638
2640
  return results;
2639
2641
  }
2640
- async function checkResponseRules(cwd) {
2642
+ async function checkResponseRules(cwd, project) {
2641
2643
  const results = [];
2642
2644
  const files = await fg9("src/**/*.response.ts", {
2643
2645
  cwd,
@@ -2646,7 +2648,7 @@ async function checkResponseRules(cwd) {
2646
2648
  for (const file of files) {
2647
2649
  const fullPath = `${cwd}/${file}`;
2648
2650
  const content = readFileContent(fullPath);
2649
- const sourceFile = parseFile(fullPath);
2651
+ const sourceFile = parseFile(fullPath, project);
2650
2652
  if (!sourceFile) continue;
2651
2653
  const exportedNames = getExportedNames(sourceFile);
2652
2654
  const fileName = basename5(file, ".response.ts");
@@ -2683,7 +2685,7 @@ async function checkResponseRules(cwd) {
2683
2685
  }
2684
2686
  return results;
2685
2687
  }
2686
- async function checkRequestRules(cwd) {
2688
+ async function checkRequestRules(cwd, project) {
2687
2689
  const results = [];
2688
2690
  const files = await fg9("src/**/*.request.ts", {
2689
2691
  cwd,
@@ -2692,7 +2694,7 @@ async function checkRequestRules(cwd) {
2692
2694
  for (const file of files) {
2693
2695
  const fullPath = `${cwd}/${file}`;
2694
2696
  const content = readFileContent(fullPath);
2695
- const sourceFile = parseFile(fullPath);
2697
+ const sourceFile = parseFile(fullPath, project);
2696
2698
  if (!sourceFile) continue;
2697
2699
  const exportedNames = getExportedNames(sourceFile);
2698
2700
  const hasTypedSchema = exportedNames.some(
@@ -2719,7 +2721,7 @@ async function checkRequestRules(cwd) {
2719
2721
  }
2720
2722
  return results;
2721
2723
  }
2722
- async function checkContractFileRules(cwd) {
2724
+ async function checkContractFileRules(cwd, project) {
2723
2725
  const results = [];
2724
2726
  const files = await fg9("src/**/*.contract.ts", {
2725
2727
  cwd,
@@ -2728,7 +2730,7 @@ async function checkContractFileRules(cwd) {
2728
2730
  for (const file of files) {
2729
2731
  const fullPath = `${cwd}/${file}`;
2730
2732
  const content = readFileContent(fullPath);
2731
- const sourceFile = parseFile(fullPath);
2733
+ const sourceFile = parseFile(fullPath, project);
2732
2734
  if (!sourceFile) continue;
2733
2735
  const exportedNames = getExportedNames(sourceFile);
2734
2736
  const hasContractExport = exportedNames.some((n) => n.endsWith("Contract"));
@@ -2762,7 +2764,7 @@ async function checkContractFileRules(cwd) {
2762
2764
  }
2763
2765
  return results;
2764
2766
  }
2765
- async function checkIndexRules(cwd) {
2767
+ async function checkIndexRules(cwd, project) {
2766
2768
  const results = [];
2767
2769
  const files = await fg9("src/**/index.ts", {
2768
2770
  cwd,
@@ -2770,7 +2772,7 @@ async function checkIndexRules(cwd) {
2770
2772
  });
2771
2773
  for (const file of files) {
2772
2774
  const fullPath = `${cwd}/${file}`;
2773
- const sourceFile = parseFile(fullPath);
2775
+ const sourceFile = parseFile(fullPath, project);
2774
2776
  if (!sourceFile) continue;
2775
2777
  const violations = getNonReexportStatements(sourceFile);
2776
2778
  if (violations.length > 0) {
@@ -2836,7 +2838,7 @@ async function checkNamingRules(cwd) {
2836
2838
  }
2837
2839
  return results;
2838
2840
  }
2839
- async function checkDeprecatedRules(cwd) {
2841
+ async function checkDeprecatedRules(cwd, project) {
2840
2842
  const results = [];
2841
2843
  const files = await fg9("src/**/*.deprecated.ts", {
2842
2844
  cwd,
@@ -2844,7 +2846,7 @@ async function checkDeprecatedRules(cwd) {
2844
2846
  });
2845
2847
  for (const file of files) {
2846
2848
  const fullPath = `${cwd}/${file}`;
2847
- const sourceFile = parseFile(fullPath);
2849
+ const sourceFile = parseFile(fullPath, project);
2848
2850
  if (!sourceFile) continue;
2849
2851
  const missing = getExportsWithoutDeprecatedJsdoc(sourceFile);
2850
2852
  if (missing.length > 0) {
@@ -2885,6 +2887,7 @@ var contractsNomenclatureChecker = {
2885
2887
  }
2886
2888
  const disabledRules = getDisabledRules(configResult.config);
2887
2889
  const results = [];
2890
+ const project = createProject();
2888
2891
  const [
2889
2892
  enumResults,
2890
2893
  responseResults,
@@ -2895,14 +2898,14 @@ var contractsNomenclatureChecker = {
2895
2898
  namingResults,
2896
2899
  deprecatedResults
2897
2900
  ] = await Promise.all([
2898
- checkEnumBundleRules(ctx.cwd),
2899
- checkResponseRules(ctx.cwd),
2900
- checkRequestRules(ctx.cwd),
2901
- checkContractFileRules(ctx.cwd),
2902
- checkIndexRules(ctx.cwd),
2901
+ checkEnumBundleRules(ctx.cwd, project),
2902
+ checkResponseRules(ctx.cwd, project),
2903
+ checkRequestRules(ctx.cwd, project),
2904
+ checkContractFileRules(ctx.cwd, project),
2905
+ checkIndexRules(ctx.cwd, project),
2903
2906
  checkHelperRules(ctx.cwd),
2904
2907
  checkNamingRules(ctx.cwd),
2905
- checkDeprecatedRules(ctx.cwd)
2908
+ checkDeprecatedRules(ctx.cwd, project)
2906
2909
  ]);
2907
2910
  results.push(
2908
2911
  ...enumResults,
package/dist/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  lintCommand,
6
6
  loadConfig,
7
7
  scaffoldCommand
8
- } from "./chunk-4LVIIP2D.js";
8
+ } from "./chunk-73G2DONK.js";
9
9
  import {
10
10
  scanForVaultRepos
11
11
  } from "./chunk-WXFSGE4N.js";
@@ -3,7 +3,7 @@ import {
3
3
  analyzeCore,
4
4
  lintCore,
5
5
  scaffoldCore
6
- } from "./chunk-4LVIIP2D.js";
6
+ } from "./chunk-73G2DONK.js";
7
7
 
8
8
  // src/mcp-server.ts
9
9
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyphaene/hexa-ts-kit",
3
- "version": "1.12.2",
3
+ "version": "1.13.0",
4
4
  "description": "TypeScript dev kit for Claude Code agents: architecture linting, scaffolding, knowledge analysis",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,7 +47,7 @@
47
47
  "homepage": "https://github.com/hyphaene/hexa-ts-kit#readme",
48
48
  "dependencies": {
49
49
  "@modelcontextprotocol/sdk": "^1.25.1",
50
- "commander": "^12.1.0",
50
+ "commander": "^14.0.3",
51
51
  "fast-glob": "^3.3.2",
52
52
  "gray-matter": "^4.0.3",
53
53
  "ink": "^6.6.0",
@@ -64,13 +64,13 @@
64
64
  "devDependencies": {
65
65
  "@semantic-release/changelog": "^6.0.3",
66
66
  "@semantic-release/git": "^10.0.1",
67
- "@types/node": "^22.10.2",
67
+ "@types/node": "^25.2.3",
68
68
  "@types/react": "^19.2.10",
69
- "@vitest/coverage-v8": "^3.1.4",
69
+ "@vitest/coverage-v8": "^4.0.18",
70
70
  "semantic-release": "^25.0.2",
71
71
  "tsup": "^8.3.5",
72
72
  "typescript": "^5.7.2",
73
- "vitest": "^3.1.4"
73
+ "vitest": "^4.0.18"
74
74
  },
75
75
  "engines": {
76
76
  "node": ">=20"