@voyantjs/cli 0.3.0 → 0.4.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-module.d.ts","sourceRoot":"","sources":["../../src/commands/generate-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate-module.d.ts","sourceRoot":"","sources":["../../src/commands/generate-module.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhE;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAyDvF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
1
2
|
import { join } from "node:path";
|
|
2
3
|
import { parseArgs } from "../lib/args.js";
|
|
3
4
|
import { pathExists, writeTextFile } from "../lib/fs.js";
|
|
@@ -34,8 +35,9 @@ export async function generateModuleCommand(ctx) {
|
|
|
34
35
|
const baseDir = typeof dirFlag === "string" ? dirFlag : join(ctx.cwd, "packages");
|
|
35
36
|
const moduleDir = join(baseDir, kebab);
|
|
36
37
|
const force = flags.force === true;
|
|
38
|
+
const version = resolveVoyantVersion();
|
|
37
39
|
const files = [
|
|
38
|
-
["package.json", packageJson(names)],
|
|
40
|
+
["package.json", packageJson(names, version)],
|
|
39
41
|
["tsconfig.json", tsconfigJson()],
|
|
40
42
|
["src/schema.ts", schemaTs(names)],
|
|
41
43
|
["src/validation.ts", validationTs(names)],
|
|
@@ -62,3 +64,13 @@ export async function generateModuleCommand(ctx) {
|
|
|
62
64
|
` 3. Implement schema.ts, then pnpm db:generate\n`);
|
|
63
65
|
return 0;
|
|
64
66
|
}
|
|
67
|
+
function resolveVoyantVersion() {
|
|
68
|
+
try {
|
|
69
|
+
const raw = readFileSync(join(import.meta.dirname, "..", "..", "package.json"), "utf8");
|
|
70
|
+
const pkg = JSON.parse(raw);
|
|
71
|
+
return pkg.version || "0.1.0";
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return "0.1.0";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -6,7 +6,7 @@ export interface ModuleNames {
|
|
|
6
6
|
/** PascalCase name (e.g. "Invoices"). Used for type names + exports. */
|
|
7
7
|
pascal: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function packageJson(names: ModuleNames): string;
|
|
9
|
+
export declare function packageJson(names: ModuleNames, version: string): string;
|
|
10
10
|
export declare function tsconfigJson(): string;
|
|
11
11
|
export declare function schemaTs(names: ModuleNames): string;
|
|
12
12
|
export declare function validationTs(names: ModuleNames): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-files.d.ts","sourceRoot":"","sources":["../../src/templates/module-files.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"module-files.d.ts","sourceRoot":"","sources":["../../src/templates/module-files.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAyDvE;AAED,wBAAgB,YAAY,IAAI,MAAM,CAarC;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAenD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAiBvD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAYpD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAanD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAuBlD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyantjs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "FSL-1.1-Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
],
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"tar": "^7.4.3",
|
|
57
|
-
"@voyantjs/core": "0.
|
|
57
|
+
"@voyantjs/core": "0.4.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@types/node": "^22.10.1",
|