@fenglimg/fabric-cli 0.1.4 → 1.0.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 (30) hide show
  1. package/dist/{bootstrap-HUDJ2E3Q.js → bootstrap-PMIA4W6G.js} +16 -12
  2. package/dist/{chunk-T3WQUWW4.js → chunk-5BSTO745.js} +9 -6
  3. package/dist/chunk-6ICJICVU.js +10 -0
  4. package/dist/chunk-AEOYCVBG.js +0 -0
  5. package/dist/chunk-DKQ3HOTK.js +206 -0
  6. package/dist/{chunk-U376IPKT.js → chunk-F2BXHPM5.js} +11 -7
  7. package/dist/{chunk-CZ7U6ULM.js → chunk-L43IGJ6X.js} +17 -7
  8. package/dist/chunk-P4KVFB2T.js +0 -0
  9. package/dist/{chunk-N7TTCGJA.js → chunk-VMYPJPKV.js} +1 -0
  10. package/dist/chunk-WWNXR34K.js +49 -0
  11. package/dist/{config-YKDWIRCT.js → config-PXEEXWLM.js} +14 -11
  12. package/dist/{hooks-VXXO4VZP.js → hooks-5S5IRVQE.js} +15 -12
  13. package/dist/human-lint-YSFOZHZ7.js +13 -0
  14. package/dist/index.js +15 -11
  15. package/dist/init-G6Q3OOMC.js +601 -0
  16. package/dist/{ledger-append-EGIKSMU5.js → ledger-append-XZ5SX4O5.js} +2 -1
  17. package/dist/{pre-commit-CXPH7BZH.js → pre-commit-IEIXHKOD.js} +13 -7
  18. package/dist/{scan-UASZQLQP.js → scan-6CURGC3D.js} +3 -1
  19. package/dist/serve-4J2CQY25.js +112 -0
  20. package/dist/{sync-meta-YTG5V3Y6.js → sync-meta-L6M4AEUT.js} +2 -1
  21. package/package.json +12 -8
  22. package/templates/agents-md/AGENTS.md.template +17 -11
  23. package/templates/agents-md/variants/cocos.md +37 -0
  24. package/templates/agents-md/variants/next.md +37 -0
  25. package/templates/agents-md/variants/vite.md +37 -0
  26. package/templates/claude-hooks/agents-md-init-reminder.cjs +18 -0
  27. package/templates/claude-skills/agents-md-init/SKILL.md +86 -0
  28. package/dist/chunk-BWZHNZG6.js +0 -236
  29. package/dist/human-lint-II6TBGP4.js +0 -9
  30. package/dist/init-IBS7KO7A.js +0 -149
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ t
4
+ } from "./chunk-6ICJICVU.js";
2
5
 
3
6
  // src/commands/hooks.ts
4
7
  import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
@@ -8,18 +11,18 @@ import { defineCommand } from "citty";
8
11
  var hooksCommand = defineCommand({
9
12
  meta: {
10
13
  name: "hooks",
11
- description: "\u7BA1\u7406 Fabric Git \u94A9\u5B50\u6A21\u677F\u3002"
14
+ description: t("cli.hooks.description")
12
15
  },
13
16
  subCommands: {
14
17
  install: defineCommand({
15
18
  meta: {
16
19
  name: "install",
17
- description: "\u5B89\u88C5 Fabric Husky pre-commit \u94A9\u5B50\u6A21\u677F\u3002"
20
+ description: t("cli.hooks.install.description")
18
21
  },
19
22
  args: {
20
23
  target: {
21
24
  type: "string",
22
- description: "\u76EE\u6807\u9879\u76EE\u8DEF\u5F84\uFF0C\u9ED8\u8BA4\u4E3A\u5F53\u524D\u5DE5\u4F5C\u76EE\u5F55\u3002",
25
+ description: t("cli.hooks.install.args.target.description"),
23
26
  default: process.cwd()
24
27
  }
25
28
  },
@@ -30,7 +33,7 @@ var hooksCommand = defineCommand({
30
33
  const hookPath = join(huskyDir, "pre-commit");
31
34
  const packageJsonPath = join(target, "package.json");
32
35
  if (!existsSync(packageJsonPath)) {
33
- throw new Error(`package.json is required to install hooks: ${packageJsonPath}`);
36
+ throw new Error(t("cli.hooks.errors.package-json-required", { path: packageJsonPath }));
34
37
  }
35
38
  mkdirSync(huskyDir, { recursive: true });
36
39
  const templateContent = readFileSync(findTemplatePath("templates/husky/pre-commit"), "utf8");
@@ -61,16 +64,16 @@ ${fabricBlock}`, "utf8");
61
64
  `, "utf8");
62
65
  }
63
66
  if (hookAction === "skipped") {
64
- writeStderr(`Fabric hook already present in ${hookPath}, skipped.`);
67
+ writeStderr(t("cli.hooks.install.hook-skipped", { path: hookPath }));
65
68
  } else if (hookAction === "appended") {
66
- writeStderr(`Appended Fabric hook to existing ${hookPath}`);
69
+ writeStderr(t("cli.hooks.install.hook-appended", { path: hookPath }));
67
70
  } else {
68
- writeStderr(`Created ${hookPath}`);
71
+ writeStderr(t("cli.hooks.install.hook-created", { path: hookPath }));
69
72
  }
70
73
  if (hadPrepare) {
71
- writeStderr(`Left existing prepare script unchanged in ${packageJsonPath}`);
74
+ writeStderr(t("cli.hooks.install.prepare-left", { path: packageJsonPath }));
72
75
  } else {
73
- writeStderr(`Added prepare script to ${packageJsonPath}`);
76
+ writeStderr(t("cli.hooks.install.prepare-added", { path: packageJsonPath }));
74
77
  }
75
78
  }
76
79
  })
@@ -82,7 +85,7 @@ function normalizeTarget(targetInput) {
82
85
  }
83
86
  function assertExistingDirectory(target) {
84
87
  if (!existsSync(target) || !statSync(target).isDirectory()) {
85
- throw new Error(`Target must be an existing directory: ${target}`);
88
+ throw new Error(t("cli.shared.target-invalid", { target }));
86
89
  }
87
90
  }
88
91
  function findTemplatePath(relativePath) {
@@ -96,7 +99,7 @@ function findTemplatePath(relativePath) {
96
99
  return candidate;
97
100
  }
98
101
  }
99
- throw new Error(`Template not found: ${relativePath}`);
102
+ throw new Error(t("cli.shared.template-not-found", { path: relativePath }));
100
103
  }
101
104
  function templateCandidatesFrom(start, relativePath) {
102
105
  const candidates = [];
@@ -109,7 +112,7 @@ function templateCandidatesFrom(start, relativePath) {
109
112
  }
110
113
  current = parent;
111
114
  }
112
- return candidates;
115
+ return candidates.reverse();
113
116
  }
114
117
  function writeStderr(message) {
115
118
  process.stderr.write(`${message}
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ humanLintCommand,
4
+ humanLockEntrySchema,
5
+ human_lint_default
6
+ } from "./chunk-L43IGJ6X.js";
7
+ import "./chunk-WWNXR34K.js";
8
+ import "./chunk-6ICJICVU.js";
9
+ export {
10
+ human_lint_default as default,
11
+ humanLintCommand,
12
+ humanLockEntrySchema
13
+ };
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ t
4
+ } from "./chunk-6ICJICVU.js";
2
5
 
3
6
  // src/index.ts
4
7
  import { realpathSync } from "fs";
@@ -8,23 +11,24 @@ import { defineCommand, runMain } from "citty";
8
11
 
9
12
  // src/commands/index.ts
10
13
  var allCommands = {
11
- bootstrap: () => import("./bootstrap-HUDJ2E3Q.js").then((module) => module.default),
12
- init: () => import("./init-IBS7KO7A.js").then((module) => module.default),
13
- scan: () => import("./scan-UASZQLQP.js").then((module) => module.default),
14
- "sync-meta": () => import("./sync-meta-YTG5V3Y6.js").then((module) => module.default),
15
- "human-lint": () => import("./human-lint-II6TBGP4.js").then((module) => module.default),
16
- "ledger-append": () => import("./ledger-append-EGIKSMU5.js").then((module) => module.default),
17
- hooks: () => import("./hooks-VXXO4VZP.js").then((module) => module.default),
18
- config: () => import("./config-YKDWIRCT.js").then((module) => module.configCmd),
19
- "pre-commit": () => import("./pre-commit-CXPH7BZH.js").then((module) => module.default)
14
+ bootstrap: () => import("./bootstrap-PMIA4W6G.js").then((module) => module.default),
15
+ init: () => import("./init-G6Q3OOMC.js").then((module) => module.default),
16
+ scan: () => import("./scan-6CURGC3D.js").then((module) => module.default),
17
+ serve: () => import("./serve-4J2CQY25.js").then((module) => module.default),
18
+ "sync-meta": () => import("./sync-meta-L6M4AEUT.js").then((module) => module.default),
19
+ "human-lint": () => import("./human-lint-YSFOZHZ7.js").then((module) => module.default),
20
+ "ledger-append": () => import("./ledger-append-XZ5SX4O5.js").then((module) => module.default),
21
+ hooks: () => import("./hooks-5S5IRVQE.js").then((module) => module.default),
22
+ config: () => import("./config-PXEEXWLM.js").then((module) => module.configCmd),
23
+ "pre-commit": () => import("./pre-commit-IEIXHKOD.js").then((module) => module.default)
20
24
  };
21
25
 
22
26
  // src/index.ts
23
27
  var main = defineCommand({
24
28
  meta: {
25
29
  name: "fab",
26
- version: "0.1.4",
27
- description: "Fabric CLI - AI \u667A\u80FD\u4F53\u534F\u4F5C\u6846\u67B6"
30
+ version: "1.0.0",
31
+ description: t("cli.main.description")
28
32
  },
29
33
  subCommands: allCommands
30
34
  });