crabygen 0.1.0-alpha.6 → 0.1.0-alpha.7
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/bin-craby.js +5 -0
- package/dist/index.cjs +15 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -10
- package/package.json +6 -3
package/bin-craby.js
ADDED
package/dist/index.cjs
CHANGED
|
@@ -27,7 +27,7 @@ let __commander_js_extra_typings = require("@commander-js/extra-typings");
|
|
|
27
27
|
__commander_js_extra_typings = __toESM(__commander_js_extra_typings);
|
|
28
28
|
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "0.1.0-alpha.
|
|
30
|
+
var version = "0.1.0-alpha.7";
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/utils/command.ts
|
|
@@ -45,13 +45,13 @@ function resolveProjectRoot() {
|
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/commands/build.ts
|
|
47
47
|
const command = withVerbose(new __commander_js_extra_typings.Command().name("build").action(async () => {
|
|
48
|
-
(0, __craby_cli_bindings.getBindings)().
|
|
48
|
+
(0, __craby_cli_bindings.getBindings)().build({ projectRoot: resolveProjectRoot() });
|
|
49
49
|
}));
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/commands/clean.ts
|
|
53
53
|
const command$1 = withVerbose(new __commander_js_extra_typings.Command().name("clean").action(async () => {
|
|
54
|
-
(0, __craby_cli_bindings.getBindings)().
|
|
54
|
+
(0, __craby_cli_bindings.getBindings)().clean({ projectRoot: resolveProjectRoot() });
|
|
55
55
|
}));
|
|
56
56
|
|
|
57
57
|
//#endregion
|
|
@@ -64,7 +64,7 @@ const command$2 = withVerbose(new __commander_js_extra_typings.Command().name("c
|
|
|
64
64
|
//#endregion
|
|
65
65
|
//#region src/commands/doctor.ts
|
|
66
66
|
const command$3 = withVerbose(new __commander_js_extra_typings.Command().name("doctor").action(async () => {
|
|
67
|
-
(0, __craby_cli_bindings.getBindings)().
|
|
67
|
+
(0, __craby_cli_bindings.getBindings)().doctor({ projectRoot: resolveProjectRoot() });
|
|
68
68
|
}));
|
|
69
69
|
|
|
70
70
|
//#endregion
|
|
@@ -79,20 +79,25 @@ const command$4 = withVerbose(new __commander_js_extra_typings.Command().name("i
|
|
|
79
79
|
//#endregion
|
|
80
80
|
//#region src/commands/show.ts
|
|
81
81
|
const command$5 = withVerbose(new __commander_js_extra_typings.Command().name("show").action(async () => {
|
|
82
|
-
(0, __craby_cli_bindings.getBindings)().
|
|
82
|
+
(0, __craby_cli_bindings.getBindings)().show({ projectRoot: resolveProjectRoot() });
|
|
83
83
|
}));
|
|
84
84
|
|
|
85
85
|
//#endregion
|
|
86
86
|
//#region src/cli.ts
|
|
87
|
-
function run$1() {
|
|
88
|
-
const cli = __commander_js_extra_typings.program.name(
|
|
89
|
-
cli.action(runCodegen);
|
|
87
|
+
function run$1(baseCommand) {
|
|
88
|
+
const cli = __commander_js_extra_typings.program.name(baseCommand).version(version);
|
|
90
89
|
cli.addCommand(command$2);
|
|
91
90
|
cli.addCommand(command$4);
|
|
92
91
|
cli.addCommand(command);
|
|
93
92
|
cli.addCommand(command$5);
|
|
94
93
|
cli.addCommand(command$3);
|
|
95
94
|
cli.addCommand(command$1);
|
|
95
|
+
cli.argument("[args...]", "optional arguments").action((args) => {
|
|
96
|
+
if (args && args.length > 0) {
|
|
97
|
+
console.error(`error: unknown command '${args[0]}'`);
|
|
98
|
+
cli.help();
|
|
99
|
+
} else runCodegen();
|
|
100
|
+
});
|
|
96
101
|
cli.parse();
|
|
97
102
|
}
|
|
98
103
|
|
|
@@ -117,12 +122,12 @@ const loggerProxy = new Proxy({}, { get(_, prop) {
|
|
|
117
122
|
|
|
118
123
|
//#endregion
|
|
119
124
|
//#region src/index.ts
|
|
120
|
-
async function run() {
|
|
125
|
+
async function run(baseCommand = "crabygen") {
|
|
121
126
|
const { setup } = (0, __craby_cli_bindings.getBindings)();
|
|
122
127
|
const verbose = Boolean(process.argv.find((arg) => arg === "-v" || arg === "--verbose"));
|
|
123
128
|
try {
|
|
124
129
|
setup(verbose ? "debug" : process.env.RUST_LOG);
|
|
125
|
-
run$1();
|
|
130
|
+
run$1(baseCommand);
|
|
126
131
|
} catch (error) {
|
|
127
132
|
loggerProxy.error(error instanceof Error ? error.message : "unknown error");
|
|
128
133
|
process.exit(1);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { getBindings } from "@craby/cli-bindings";
|
|
|
2
2
|
import { Command, Option, program } from "@commander-js/extra-typings";
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "0.1.0-alpha.
|
|
5
|
+
var version = "0.1.0-alpha.7";
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region src/utils/command.ts
|
|
@@ -20,13 +20,13 @@ function resolveProjectRoot() {
|
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/commands/build.ts
|
|
22
22
|
const command = withVerbose(new Command().name("build").action(async () => {
|
|
23
|
-
getBindings().
|
|
23
|
+
getBindings().build({ projectRoot: resolveProjectRoot() });
|
|
24
24
|
}));
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/commands/clean.ts
|
|
28
28
|
const command$1 = withVerbose(new Command().name("clean").action(async () => {
|
|
29
|
-
getBindings().
|
|
29
|
+
getBindings().clean({ projectRoot: resolveProjectRoot() });
|
|
30
30
|
}));
|
|
31
31
|
|
|
32
32
|
//#endregion
|
|
@@ -39,7 +39,7 @@ const command$2 = withVerbose(new Command().name("codegen").action(runCodegen));
|
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/commands/doctor.ts
|
|
41
41
|
const command$3 = withVerbose(new Command().name("doctor").action(async () => {
|
|
42
|
-
getBindings().
|
|
42
|
+
getBindings().doctor({ projectRoot: resolveProjectRoot() });
|
|
43
43
|
}));
|
|
44
44
|
|
|
45
45
|
//#endregion
|
|
@@ -54,20 +54,25 @@ const command$4 = withVerbose(new Command().name("init").argument("<packageName>
|
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region src/commands/show.ts
|
|
56
56
|
const command$5 = withVerbose(new Command().name("show").action(async () => {
|
|
57
|
-
getBindings().
|
|
57
|
+
getBindings().show({ projectRoot: resolveProjectRoot() });
|
|
58
58
|
}));
|
|
59
59
|
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/cli.ts
|
|
62
|
-
function run$1() {
|
|
63
|
-
const cli = program.name(
|
|
64
|
-
cli.action(runCodegen);
|
|
62
|
+
function run$1(baseCommand) {
|
|
63
|
+
const cli = program.name(baseCommand).version(version);
|
|
65
64
|
cli.addCommand(command$2);
|
|
66
65
|
cli.addCommand(command$4);
|
|
67
66
|
cli.addCommand(command);
|
|
68
67
|
cli.addCommand(command$5);
|
|
69
68
|
cli.addCommand(command$3);
|
|
70
69
|
cli.addCommand(command$1);
|
|
70
|
+
cli.argument("[args...]", "optional arguments").action((args) => {
|
|
71
|
+
if (args && args.length > 0) {
|
|
72
|
+
console.error(`error: unknown command '${args[0]}'`);
|
|
73
|
+
cli.help();
|
|
74
|
+
} else runCodegen();
|
|
75
|
+
});
|
|
71
76
|
cli.parse();
|
|
72
77
|
}
|
|
73
78
|
|
|
@@ -92,12 +97,12 @@ const loggerProxy = new Proxy({}, { get(_, prop) {
|
|
|
92
97
|
|
|
93
98
|
//#endregion
|
|
94
99
|
//#region src/index.ts
|
|
95
|
-
async function run() {
|
|
100
|
+
async function run(baseCommand = "crabygen") {
|
|
96
101
|
const { setup } = getBindings();
|
|
97
102
|
const verbose = Boolean(process.argv.find((arg) => arg === "-v" || arg === "--verbose"));
|
|
98
103
|
try {
|
|
99
104
|
setup(verbose ? "debug" : process.env.RUST_LOG);
|
|
100
|
-
run$1();
|
|
105
|
+
run$1(baseCommand);
|
|
101
106
|
} catch (error) {
|
|
102
107
|
loggerProxy.error(error instanceof Error ? error.message : "unknown error");
|
|
103
108
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crabygen",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"bin":
|
|
5
|
+
"bin": {
|
|
6
|
+
"craby": "./bin-craby.js",
|
|
7
|
+
"crabygen": "./bin.js"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"build": "tsdown",
|
|
8
11
|
"prepack": "yarn build",
|
|
@@ -20,7 +23,7 @@
|
|
|
20
23
|
"homepage": "https://github.com/leegeunhyeok/craby#readme",
|
|
21
24
|
"dependencies": {
|
|
22
25
|
"@commander-js/extra-typings": "^14.0.0",
|
|
23
|
-
"@craby/cli-bindings": "0.1.0-alpha.
|
|
26
|
+
"@craby/cli-bindings": "0.1.0-alpha.7",
|
|
24
27
|
"commander": "^14.0.1",
|
|
25
28
|
"es-toolkit": "^1.39.10"
|
|
26
29
|
},
|