archtracker-mcp 0.3.1 → 0.3.2

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/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { Command } from "commander";
5
5
  import { watch } from "fs";
6
6
  import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
7
- import { join as join5 } from "path";
7
+ import { join as join6 } from "path";
8
8
 
9
9
  // src/analyzer/analyze.ts
10
10
  import { resolve as resolve4 } from "path";
@@ -2981,11 +2981,29 @@ function startViewer(graph, options = {}) {
2981
2981
  };
2982
2982
  }
2983
2983
 
2984
+ // src/utils/version.ts
2985
+ import { readFileSync as readFileSync2 } from "fs";
2986
+ import { join as join5, dirname as dirname2 } from "path";
2987
+ import { fileURLToPath } from "url";
2988
+ function loadVersion() {
2989
+ let dir = dirname2(fileURLToPath(import.meta.url));
2990
+ for (let i = 0; i < 5; i++) {
2991
+ try {
2992
+ const pkg = JSON.parse(readFileSync2(join5(dir, "package.json"), "utf-8"));
2993
+ return pkg.version;
2994
+ } catch {
2995
+ dir = dirname2(dir);
2996
+ }
2997
+ }
2998
+ return "0.0.0";
2999
+ }
3000
+ var VERSION = loadVersion();
3001
+
2984
3002
  // src/cli/index.ts
2985
3003
  var program = new Command();
2986
3004
  program.name("archtracker").description(
2987
3005
  "Architecture & Dependency Tracker \u2014 Prevent missed architecture changes in AI-driven development"
2988
- ).version("0.3.1").option("--lang <locale>", "Language (en/ja, auto-detected from LANG env)").hook("preAction", (thisCommand) => {
3006
+ ).version(VERSION).option("--lang <locale>", "Language (en/ja, auto-detected from LANG env)").hook("preAction", (thisCommand) => {
2989
3007
  const lang = thisCommand.opts().lang;
2990
3008
  if (lang === "en" || lang === "ja") {
2991
3009
  setLocale(lang);
@@ -3170,9 +3188,9 @@ jobs:
3170
3188
  - run: npx archtracker check --target ${opts.target} --ci
3171
3189
  `;
3172
3190
  try {
3173
- const dir = join5(".github", "workflows");
3191
+ const dir = join6(".github", "workflows");
3174
3192
  await mkdir2(dir, { recursive: true });
3175
- const path = join5(dir, "arch-check.yml");
3193
+ const path = join6(dir, "arch-check.yml");
3176
3194
  await writeFile2(path, workflow, "utf-8");
3177
3195
  console.log(t("ci.generated", { path }));
3178
3196
  } catch (error) {