@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.
- package/dist/{bootstrap-HUDJ2E3Q.js → bootstrap-PMIA4W6G.js} +16 -12
- package/dist/{chunk-T3WQUWW4.js → chunk-5BSTO745.js} +9 -6
- package/dist/chunk-6ICJICVU.js +10 -0
- package/dist/chunk-AEOYCVBG.js +0 -0
- package/dist/chunk-DKQ3HOTK.js +206 -0
- package/dist/{chunk-U376IPKT.js → chunk-F2BXHPM5.js} +11 -7
- package/dist/{chunk-CZ7U6ULM.js → chunk-L43IGJ6X.js} +17 -7
- package/dist/chunk-P4KVFB2T.js +0 -0
- package/dist/{chunk-N7TTCGJA.js → chunk-VMYPJPKV.js} +1 -0
- package/dist/chunk-WWNXR34K.js +49 -0
- package/dist/{config-YKDWIRCT.js → config-PXEEXWLM.js} +14 -11
- package/dist/{hooks-VXXO4VZP.js → hooks-5S5IRVQE.js} +15 -12
- package/dist/human-lint-YSFOZHZ7.js +13 -0
- package/dist/index.js +15 -11
- package/dist/init-G6Q3OOMC.js +601 -0
- package/dist/{ledger-append-EGIKSMU5.js → ledger-append-XZ5SX4O5.js} +2 -1
- package/dist/{pre-commit-CXPH7BZH.js → pre-commit-IEIXHKOD.js} +13 -7
- package/dist/{scan-UASZQLQP.js → scan-6CURGC3D.js} +3 -1
- package/dist/serve-4J2CQY25.js +112 -0
- package/dist/{sync-meta-YTG5V3Y6.js → sync-meta-L6M4AEUT.js} +2 -1
- package/package.json +12 -8
- package/templates/agents-md/AGENTS.md.template +17 -11
- package/templates/agents-md/variants/cocos.md +37 -0
- package/templates/agents-md/variants/next.md +37 -0
- package/templates/agents-md/variants/vite.md +37 -0
- package/templates/claude-hooks/agents-md-init-reminder.cjs +18 -0
- package/templates/claude-skills/agents-md-init/SKILL.md +86 -0
- package/dist/chunk-BWZHNZG6.js +0 -236
- package/dist/human-lint-II6TBGP4.js +0 -9
- 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: "
|
|
14
|
+
description: t("cli.hooks.description")
|
|
12
15
|
},
|
|
13
16
|
subCommands: {
|
|
14
17
|
install: defineCommand({
|
|
15
18
|
meta: {
|
|
16
19
|
name: "install",
|
|
17
|
-
description: "
|
|
20
|
+
description: t("cli.hooks.install.description")
|
|
18
21
|
},
|
|
19
22
|
args: {
|
|
20
23
|
target: {
|
|
21
24
|
type: "string",
|
|
22
|
-
description: "
|
|
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(
|
|
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(
|
|
67
|
+
writeStderr(t("cli.hooks.install.hook-skipped", { path: hookPath }));
|
|
65
68
|
} else if (hookAction === "appended") {
|
|
66
|
-
writeStderr(
|
|
69
|
+
writeStderr(t("cli.hooks.install.hook-appended", { path: hookPath }));
|
|
67
70
|
} else {
|
|
68
|
-
writeStderr(
|
|
71
|
+
writeStderr(t("cli.hooks.install.hook-created", { path: hookPath }));
|
|
69
72
|
}
|
|
70
73
|
if (hadPrepare) {
|
|
71
|
-
writeStderr(
|
|
74
|
+
writeStderr(t("cli.hooks.install.prepare-left", { path: packageJsonPath }));
|
|
72
75
|
} else {
|
|
73
|
-
writeStderr(
|
|
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(
|
|
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(
|
|
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-
|
|
12
|
-
init: () => import("./init-
|
|
13
|
-
scan: () => import("./scan-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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.
|
|
27
|
-
description: "
|
|
30
|
+
version: "1.0.0",
|
|
31
|
+
description: t("cli.main.description")
|
|
28
32
|
},
|
|
29
33
|
subCommands: allCommands
|
|
30
34
|
});
|