crabygen 0.1.0-alpha.6 → 0.1.0-alpha.8
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 +27 -16
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -11
- package/package.json +7 -4
package/bin-craby.js
ADDED
package/dist/index.cjs
CHANGED
|
@@ -21,13 +21,19 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
24
|
-
let __craby_cli_bindings = require("@craby/cli-bindings");
|
|
25
|
-
__craby_cli_bindings = __toESM(__craby_cli_bindings);
|
|
26
24
|
let __commander_js_extra_typings = require("@commander-js/extra-typings");
|
|
27
25
|
__commander_js_extra_typings = __toESM(__commander_js_extra_typings);
|
|
26
|
+
let __craby_cli_bindings = require("@craby/cli-bindings");
|
|
27
|
+
__craby_cli_bindings = __toESM(__craby_cli_bindings);
|
|
28
28
|
|
|
29
29
|
//#region package.json
|
|
30
|
-
var version = "0.1.0-alpha.
|
|
30
|
+
var version = "0.1.0-alpha.8";
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/utils/bindings.ts
|
|
34
|
+
function getBindings() {
|
|
35
|
+
return __craby_cli_bindings;
|
|
36
|
+
}
|
|
31
37
|
|
|
32
38
|
//#endregion
|
|
33
39
|
//#region src/utils/command.ts
|
|
@@ -45,32 +51,32 @@ function resolveProjectRoot() {
|
|
|
45
51
|
//#endregion
|
|
46
52
|
//#region src/commands/build.ts
|
|
47
53
|
const command = withVerbose(new __commander_js_extra_typings.Command().name("build").action(async () => {
|
|
48
|
-
|
|
54
|
+
getBindings().build({ projectRoot: resolveProjectRoot() });
|
|
49
55
|
}));
|
|
50
56
|
|
|
51
57
|
//#endregion
|
|
52
58
|
//#region src/commands/clean.ts
|
|
53
59
|
const command$1 = withVerbose(new __commander_js_extra_typings.Command().name("clean").action(async () => {
|
|
54
|
-
|
|
60
|
+
getBindings().clean({ projectRoot: resolveProjectRoot() });
|
|
55
61
|
}));
|
|
56
62
|
|
|
57
63
|
//#endregion
|
|
58
64
|
//#region src/commands/codegen.ts
|
|
59
65
|
async function runCodegen() {
|
|
60
|
-
|
|
66
|
+
getBindings().codegen({ projectRoot: resolveProjectRoot() });
|
|
61
67
|
}
|
|
62
68
|
const command$2 = withVerbose(new __commander_js_extra_typings.Command().name("codegen").action(runCodegen));
|
|
63
69
|
|
|
64
70
|
//#endregion
|
|
65
71
|
//#region src/commands/doctor.ts
|
|
66
72
|
const command$3 = withVerbose(new __commander_js_extra_typings.Command().name("doctor").action(async () => {
|
|
67
|
-
|
|
73
|
+
getBindings().doctor({ projectRoot: resolveProjectRoot() });
|
|
68
74
|
}));
|
|
69
75
|
|
|
70
76
|
//#endregion
|
|
71
77
|
//#region src/commands/init.ts
|
|
72
78
|
const command$4 = withVerbose(new __commander_js_extra_typings.Command().name("init").argument("<packageName>", "The name of the package").action(async (packageName) => {
|
|
73
|
-
|
|
79
|
+
getBindings().init({
|
|
74
80
|
cwd: process.cwd(),
|
|
75
81
|
pkgName: packageName
|
|
76
82
|
});
|
|
@@ -79,20 +85,25 @@ const command$4 = withVerbose(new __commander_js_extra_typings.Command().name("i
|
|
|
79
85
|
//#endregion
|
|
80
86
|
//#region src/commands/show.ts
|
|
81
87
|
const command$5 = withVerbose(new __commander_js_extra_typings.Command().name("show").action(async () => {
|
|
82
|
-
|
|
88
|
+
getBindings().show({ projectRoot: resolveProjectRoot() });
|
|
83
89
|
}));
|
|
84
90
|
|
|
85
91
|
//#endregion
|
|
86
92
|
//#region src/cli.ts
|
|
87
|
-
function run$1() {
|
|
88
|
-
const cli = __commander_js_extra_typings.program.name(
|
|
89
|
-
cli.action(runCodegen);
|
|
93
|
+
function run$1(baseCommand) {
|
|
94
|
+
const cli = __commander_js_extra_typings.program.name(baseCommand).version(version);
|
|
90
95
|
cli.addCommand(command$2);
|
|
91
96
|
cli.addCommand(command$4);
|
|
92
97
|
cli.addCommand(command);
|
|
93
98
|
cli.addCommand(command$5);
|
|
94
99
|
cli.addCommand(command$3);
|
|
95
100
|
cli.addCommand(command$1);
|
|
101
|
+
cli.argument("[args...]", "optional arguments").action((args) => {
|
|
102
|
+
if (args && args.length > 0) {
|
|
103
|
+
console.error(`error: unknown command '${args[0]}'`);
|
|
104
|
+
cli.help();
|
|
105
|
+
} else runCodegen();
|
|
106
|
+
});
|
|
96
107
|
cli.parse();
|
|
97
108
|
}
|
|
98
109
|
|
|
@@ -101,7 +112,7 @@ function run$1() {
|
|
|
101
112
|
let logger = null;
|
|
102
113
|
function getLogger() {
|
|
103
114
|
if (logger) return logger;
|
|
104
|
-
const bindings =
|
|
115
|
+
const bindings = getBindings();
|
|
105
116
|
logger = {
|
|
106
117
|
trace: bindings.trace,
|
|
107
118
|
debug: bindings.debug,
|
|
@@ -117,12 +128,12 @@ const loggerProxy = new Proxy({}, { get(_, prop) {
|
|
|
117
128
|
|
|
118
129
|
//#endregion
|
|
119
130
|
//#region src/index.ts
|
|
120
|
-
async function run() {
|
|
121
|
-
const { setup } =
|
|
131
|
+
async function run(baseCommand = "crabygen") {
|
|
132
|
+
const { setup } = getBindings();
|
|
122
133
|
const verbose = Boolean(process.argv.find((arg) => arg === "-v" || arg === "--verbose"));
|
|
123
134
|
try {
|
|
124
135
|
setup(verbose ? "debug" : process.env.RUST_LOG);
|
|
125
|
-
run$1();
|
|
136
|
+
run$1(baseCommand);
|
|
126
137
|
} catch (error) {
|
|
127
138
|
loggerProxy.error(error instanceof Error ? error.message : "unknown error");
|
|
128
139
|
process.exit(1);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { getBindings } from "@craby/cli-bindings";
|
|
2
1
|
import { Command, Option, program } from "@commander-js/extra-typings";
|
|
2
|
+
import * as mod from "@craby/cli-bindings";
|
|
3
3
|
|
|
4
4
|
//#region package.json
|
|
5
|
-
var version = "0.1.0-alpha.
|
|
5
|
+
var version = "0.1.0-alpha.8";
|
|
6
|
+
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/utils/bindings.ts
|
|
9
|
+
function getBindings() {
|
|
10
|
+
return mod;
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
//#endregion
|
|
8
14
|
//#region src/utils/command.ts
|
|
@@ -20,13 +26,13 @@ function resolveProjectRoot() {
|
|
|
20
26
|
//#endregion
|
|
21
27
|
//#region src/commands/build.ts
|
|
22
28
|
const command = withVerbose(new Command().name("build").action(async () => {
|
|
23
|
-
getBindings().
|
|
29
|
+
getBindings().build({ projectRoot: resolveProjectRoot() });
|
|
24
30
|
}));
|
|
25
31
|
|
|
26
32
|
//#endregion
|
|
27
33
|
//#region src/commands/clean.ts
|
|
28
34
|
const command$1 = withVerbose(new Command().name("clean").action(async () => {
|
|
29
|
-
getBindings().
|
|
35
|
+
getBindings().clean({ projectRoot: resolveProjectRoot() });
|
|
30
36
|
}));
|
|
31
37
|
|
|
32
38
|
//#endregion
|
|
@@ -39,7 +45,7 @@ const command$2 = withVerbose(new Command().name("codegen").action(runCodegen));
|
|
|
39
45
|
//#endregion
|
|
40
46
|
//#region src/commands/doctor.ts
|
|
41
47
|
const command$3 = withVerbose(new Command().name("doctor").action(async () => {
|
|
42
|
-
getBindings().
|
|
48
|
+
getBindings().doctor({ projectRoot: resolveProjectRoot() });
|
|
43
49
|
}));
|
|
44
50
|
|
|
45
51
|
//#endregion
|
|
@@ -54,20 +60,25 @@ const command$4 = withVerbose(new Command().name("init").argument("<packageName>
|
|
|
54
60
|
//#endregion
|
|
55
61
|
//#region src/commands/show.ts
|
|
56
62
|
const command$5 = withVerbose(new Command().name("show").action(async () => {
|
|
57
|
-
getBindings().
|
|
63
|
+
getBindings().show({ projectRoot: resolveProjectRoot() });
|
|
58
64
|
}));
|
|
59
65
|
|
|
60
66
|
//#endregion
|
|
61
67
|
//#region src/cli.ts
|
|
62
|
-
function run$1() {
|
|
63
|
-
const cli = program.name(
|
|
64
|
-
cli.action(runCodegen);
|
|
68
|
+
function run$1(baseCommand) {
|
|
69
|
+
const cli = program.name(baseCommand).version(version);
|
|
65
70
|
cli.addCommand(command$2);
|
|
66
71
|
cli.addCommand(command$4);
|
|
67
72
|
cli.addCommand(command);
|
|
68
73
|
cli.addCommand(command$5);
|
|
69
74
|
cli.addCommand(command$3);
|
|
70
75
|
cli.addCommand(command$1);
|
|
76
|
+
cli.argument("[args...]", "optional arguments").action((args) => {
|
|
77
|
+
if (args && args.length > 0) {
|
|
78
|
+
console.error(`error: unknown command '${args[0]}'`);
|
|
79
|
+
cli.help();
|
|
80
|
+
} else runCodegen();
|
|
81
|
+
});
|
|
71
82
|
cli.parse();
|
|
72
83
|
}
|
|
73
84
|
|
|
@@ -92,12 +103,12 @@ const loggerProxy = new Proxy({}, { get(_, prop) {
|
|
|
92
103
|
|
|
93
104
|
//#endregion
|
|
94
105
|
//#region src/index.ts
|
|
95
|
-
async function run() {
|
|
106
|
+
async function run(baseCommand = "crabygen") {
|
|
96
107
|
const { setup } = getBindings();
|
|
97
108
|
const verbose = Boolean(process.argv.find((arg) => arg === "-v" || arg === "--verbose"));
|
|
98
109
|
try {
|
|
99
110
|
setup(verbose ? "debug" : process.env.RUST_LOG);
|
|
100
|
-
run$1();
|
|
111
|
+
run$1(baseCommand);
|
|
101
112
|
} catch (error) {
|
|
102
113
|
loggerProxy.error(error instanceof Error ? error.message : "unknown error");
|
|
103
114
|
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.8",
|
|
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,13 +23,13 @@
|
|
|
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.8",
|
|
24
27
|
"commander": "^14.0.1",
|
|
25
28
|
"es-toolkit": "^1.39.10"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
31
|
"@types/node": "^22",
|
|
29
|
-
"tsdown": "^0.15.
|
|
32
|
+
"tsdown": "^0.15.6",
|
|
30
33
|
"typescript": "^5.9.2"
|
|
31
34
|
},
|
|
32
35
|
"packageManager": "yarn@4.9.2"
|