@kizunajs/cli 2.0.0-beta.11 → 2.0.0-beta.12
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/cli.cjs
CHANGED
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { _ as loadConfig, a as ConfigSyntaxError, c as formatStale, d as diffSnapshots, f as formatChange, h as snapshotTarget, i as readSnapshot, l as writeFiles, m as snapshotPathFor, n as routeMap, o as generateConfigTypes, p as hasBreakingChange, r as diffAgainst, s as checkFiles, t as formatRoutes } from "./route-map-
|
|
2
|
+
import { _ as loadConfig, a as ConfigSyntaxError, c as formatStale, d as diffSnapshots, f as formatChange, h as snapshotTarget, i as readSnapshot, l as writeFiles, m as snapshotPathFor, n as routeMap, o as generateConfigTypes, p as hasBreakingChange, r as diffAgainst, s as checkFiles, t as formatRoutes } from "./route-map-Bt94ERSi.mjs";
|
|
3
3
|
import { dirname, relative, resolve } from "node:path";
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { parseArgs } from "node:util";
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_route_map = require("./route-map-
|
|
2
|
+
const require_route_map = require("./route-map-CTy0nJPu.cjs");
|
|
3
3
|
let kizunajs_generator = require("kizunajs/generator");
|
|
4
4
|
//#region src/api-notices.ts
|
|
5
5
|
const readSunset = (route) => {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as loadConfig, a as ConfigSyntaxError, c as formatStale, f as formatChange, g as diffSchemas, l as writeFiles, n as routeMap, o as generateConfigTypes, p as hasBreakingChange, r as diffAgainst, s as checkFiles, t as formatRoutes, u as diffApis } from "./route-map-
|
|
1
|
+
import { _ as loadConfig, a as ConfigSyntaxError, c as formatStale, f as formatChange, g as diffSchemas, l as writeFiles, n as routeMap, o as generateConfigTypes, p as hasBreakingChange, r as diffAgainst, s as checkFiles, t as formatRoutes, u as diffApis } from "./route-map-Bt94ERSi.mjs";
|
|
2
2
|
import { walkApi } from "kizunajs/generator";
|
|
3
3
|
//#region src/api-notices.ts
|
|
4
4
|
const readSunset = (route) => {
|
|
@@ -611,12 +611,22 @@ const typeOfStringUnion = (expression, key) => {
|
|
|
611
611
|
return codes.length > 0 ? codes.join(" | ") : "never";
|
|
612
612
|
};
|
|
613
613
|
/**
|
|
614
|
+
* The repo's Prettier `printWidth`. A line the generator writes longer than this
|
|
615
|
+
* is one `pnpm format` would rewrite, and `--check` would then report the file
|
|
616
|
+
* as behind.
|
|
617
|
+
*/
|
|
618
|
+
const PRINT_WIDTH = 140;
|
|
619
|
+
/**
|
|
614
620
|
* Each plugin in order, as a tuple, so a handler reaches each one under its own
|
|
615
|
-
* slug.
|
|
621
|
+
* slug. It wraps one plugin per line when the line would run past
|
|
622
|
+
* {@link PRINT_WIDTH}, the way Prettier does.
|
|
616
623
|
*/
|
|
617
|
-
const typeOfPluginList = (expression, used) => {
|
|
624
|
+
const typeOfPluginList = (expression, used, prefix) => {
|
|
618
625
|
if (!ts.isArrayLiteralExpression(expression)) throw new ConfigSyntaxError("`plugins` has to be an array, so each plugin keeps its place.");
|
|
619
|
-
|
|
626
|
+
const entries = expression.elements.map((element) => typeOfValue(element, used, "plugins"));
|
|
627
|
+
const inline = `[${entries.join(", ")}]`;
|
|
628
|
+
if (`${prefix}${inline};`.length <= PRINT_WIDTH) return inline;
|
|
629
|
+
return `[\n${entries.map((entry) => ` ${entry},`).join("\n")}\n ]`;
|
|
620
630
|
};
|
|
621
631
|
/**
|
|
622
632
|
* The `issueCodes` inside `validation`, or nothing when it declares none.
|
|
@@ -713,7 +723,7 @@ const generateConfigTypes = (configSource, fileName = "kizuna.config.ts", output
|
|
|
713
723
|
else if (key === "validation") {
|
|
714
724
|
const codes = issueCodesOf(value);
|
|
715
725
|
if (codes !== void 0) lines.push(` validation: {\n issueCodes: ${codes};\n };`);
|
|
716
|
-
} else if (key === "plugins") lines.push(` ${key}: ${typeOfPluginList(value, used)};`);
|
|
726
|
+
} else if (key === "plugins") lines.push(` ${key}: ${typeOfPluginList(value, used, ` ${key}: `)};`);
|
|
717
727
|
else lines.push(` ${key}: ${typeOfValue(value, used, key)};`);
|
|
718
728
|
}
|
|
719
729
|
const configDir = dirname(resolve(fileName));
|
|
@@ -634,12 +634,22 @@ const typeOfStringUnion = (expression, key) => {
|
|
|
634
634
|
return codes.length > 0 ? codes.join(" | ") : "never";
|
|
635
635
|
};
|
|
636
636
|
/**
|
|
637
|
+
* The repo's Prettier `printWidth`. A line the generator writes longer than this
|
|
638
|
+
* is one `pnpm format` would rewrite, and `--check` would then report the file
|
|
639
|
+
* as behind.
|
|
640
|
+
*/
|
|
641
|
+
const PRINT_WIDTH = 140;
|
|
642
|
+
/**
|
|
637
643
|
* Each plugin in order, as a tuple, so a handler reaches each one under its own
|
|
638
|
-
* slug.
|
|
644
|
+
* slug. It wraps one plugin per line when the line would run past
|
|
645
|
+
* {@link PRINT_WIDTH}, the way Prettier does.
|
|
639
646
|
*/
|
|
640
|
-
const typeOfPluginList = (expression, used) => {
|
|
647
|
+
const typeOfPluginList = (expression, used, prefix) => {
|
|
641
648
|
if (!typescript.default.isArrayLiteralExpression(expression)) throw new ConfigSyntaxError("`plugins` has to be an array, so each plugin keeps its place.");
|
|
642
|
-
|
|
649
|
+
const entries = expression.elements.map((element) => typeOfValue(element, used, "plugins"));
|
|
650
|
+
const inline = `[${entries.join(", ")}]`;
|
|
651
|
+
if (`${prefix}${inline};`.length <= PRINT_WIDTH) return inline;
|
|
652
|
+
return `[\n${entries.map((entry) => ` ${entry},`).join("\n")}\n ]`;
|
|
643
653
|
};
|
|
644
654
|
/**
|
|
645
655
|
* The `issueCodes` inside `validation`, or nothing when it declares none.
|
|
@@ -736,7 +746,7 @@ const generateConfigTypes = (configSource, fileName = "kizuna.config.ts", output
|
|
|
736
746
|
else if (key === "validation") {
|
|
737
747
|
const codes = issueCodesOf(value);
|
|
738
748
|
if (codes !== void 0) lines.push(` validation: {\n issueCodes: ${codes};\n };`);
|
|
739
|
-
} else if (key === "plugins") lines.push(` ${key}: ${typeOfPluginList(value, used)};`);
|
|
749
|
+
} else if (key === "plugins") lines.push(` ${key}: ${typeOfPluginList(value, used, ` ${key}: `)};`);
|
|
740
750
|
else lines.push(` ${key}: ${typeOfValue(value, used, key)};`);
|
|
741
751
|
}
|
|
742
752
|
const configDir = (0, node_path.dirname)((0, node_path.resolve)(fileName));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kizunajs/cli",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.12",
|
|
4
4
|
"description": "Command line tooling for Kizuna.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kizunajs",
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"zod": "^4.0.0",
|
|
65
|
-
"kizunajs": "2.0.0-beta.
|
|
65
|
+
"kizunajs": "2.0.0-beta.12"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^24",
|
|
69
69
|
"@types/react": "^19.2.18",
|
|
70
70
|
"tsdown": "^0.21.0",
|
|
71
71
|
"zod": "^4.0.0",
|
|
72
|
-
"kizunajs": "2.0.0-beta.
|
|
72
|
+
"kizunajs": "2.0.0-beta.12"
|
|
73
73
|
},
|
|
74
74
|
"scripts": {
|
|
75
75
|
"build": "tsdown src/index.ts src/cli.ts --format esm,cjs --dts --clean --external kizunajs --external zod --external jiti --external typescript",
|