@kizunajs/cli 2.0.0-beta.36 → 2.0.0-beta.38
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 +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{route-map-CrmTV7B_.cjs → route-map-BhlDWgV3.cjs} +6 -2
- package/dist/{route-map-CA8qoJHZ.mjs → route-map-C7f-Sf7U.mjs} +7 -3
- package/package.json +3 -3
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_route_map = require("./route-map-
|
|
2
|
+
const require_route_map = require("./route-map-BhlDWgV3.cjs");
|
|
3
3
|
let kizunajs_generator = require("kizunajs/generator");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
let node_fs = require("node:fs");
|
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-C7f-Sf7U.mjs";
|
|
3
3
|
import { walkApi } from "kizunajs/generator";
|
|
4
4
|
import { dirname, relative, resolve } from "node:path";
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
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-BhlDWgV3.cjs");
|
|
3
3
|
let kizunajs_generator = require("kizunajs/generator");
|
|
4
4
|
//#region src/api-notices.ts
|
|
5
5
|
const readSunset = (route) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -100,6 +100,7 @@ type SchemaNode = {
|
|
|
100
100
|
kind: 'enum';
|
|
101
101
|
nullable?: true;
|
|
102
102
|
values: string[];
|
|
103
|
+
extensible?: true;
|
|
103
104
|
refinements?: number;
|
|
104
105
|
} | {
|
|
105
106
|
kind: 'model';
|
|
@@ -110,6 +111,7 @@ type SchemaNode = {
|
|
|
110
111
|
kind: 'union';
|
|
111
112
|
nullable?: true;
|
|
112
113
|
options: SchemaNode[];
|
|
114
|
+
extensible?: true;
|
|
113
115
|
refinements?: number;
|
|
114
116
|
} | {
|
|
115
117
|
kind: string;
|
package/dist/index.d.mts
CHANGED
|
@@ -100,6 +100,7 @@ type SchemaNode = {
|
|
|
100
100
|
kind: 'enum';
|
|
101
101
|
nullable?: true;
|
|
102
102
|
values: string[];
|
|
103
|
+
extensible?: true;
|
|
103
104
|
refinements?: number;
|
|
104
105
|
} | {
|
|
105
106
|
kind: 'model';
|
|
@@ -110,6 +111,7 @@ type SchemaNode = {
|
|
|
110
111
|
kind: 'union';
|
|
111
112
|
nullable?: true;
|
|
112
113
|
options: SchemaNode[];
|
|
114
|
+
extensible?: true;
|
|
113
115
|
refinements?: number;
|
|
114
116
|
} | {
|
|
115
117
|
kind: string;
|
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-C7f-Sf7U.mjs";
|
|
2
2
|
import { walkApi } from "kizunajs/generator";
|
|
3
3
|
//#region src/api-notices.ts
|
|
4
4
|
const readSunset = (route) => {
|
|
@@ -61,6 +61,7 @@ const fieldsOf = (schema) => schema.kind === "object" ? schema.fields : void 0;
|
|
|
61
61
|
const elementOf = (schema) => schema.kind === "array" ? schema.element : void 0;
|
|
62
62
|
const valuesOf = (schema) => schema.kind === "enum" ? schema.values : void 0;
|
|
63
63
|
const modelOf = (schema) => schema.kind === "model" ? schema.model : void 0;
|
|
64
|
+
const isExtensible = (schema) => schema.extensible === true;
|
|
64
65
|
const optionsOf = (schema) => schema.kind === "union" ? schema.options : void 0;
|
|
65
66
|
/**
|
|
66
67
|
* Whether every value `narrow` allows is one `wide` allows too. A union holds
|
|
@@ -108,7 +109,7 @@ const diffSchemas = (before, after, direction, path = "") => {
|
|
|
108
109
|
const widened = holds(after, before);
|
|
109
110
|
const narrowed = holds(before, after);
|
|
110
111
|
if (!kindChanged && widened && narrowed) return [];
|
|
111
|
-
if (direction === "request" ? widened : narrowed) return [{
|
|
112
|
+
if (direction === "response" && widened && !kindChanged && isExtensible(after) || (direction === "request" ? widened : narrowed)) return [{
|
|
112
113
|
breaking: false,
|
|
113
114
|
path,
|
|
114
115
|
summary: `${label} ${direction === "request" ? "widens" : "narrows"} from ${describeKind(before)} to ${describeKind(after)}`,
|
|
@@ -182,7 +183,7 @@ const diffSchemas = (before, after, direction, path = "") => {
|
|
|
182
183
|
summary: `${path || "the body"} no longer accepts ${removed.join(", ")}`
|
|
183
184
|
});
|
|
184
185
|
if (added.length > 0) changes.push({
|
|
185
|
-
breaking: direction === "response",
|
|
186
|
+
breaking: direction === "response" && !isExtensible(after),
|
|
186
187
|
path,
|
|
187
188
|
summary: direction === "response" ? `${path || "the body"} can now be ${added.join(", ")}` : `${path || "the body"} also accepts ${added.join(", ")}`
|
|
188
189
|
});
|
|
@@ -209,6 +210,7 @@ const refinementCount = (schema) => {
|
|
|
209
210
|
const custom = checks.filter((check) => check._zod?.def?.check === "custom").length;
|
|
210
211
|
return custom === 0 ? void 0 : custom;
|
|
211
212
|
};
|
|
213
|
+
const extensibleOf = (schema) => (0, kizunajs_generator.readMetaExtensible)(schema) ? { extensible: true } : {};
|
|
212
214
|
/**
|
|
213
215
|
* A Zod schema reduced to the shape a comparison reads. A model that holds
|
|
214
216
|
* itself is written out once, and inside itself as a reference by its title.
|
|
@@ -258,6 +260,7 @@ const toSchemaNode = (schema, inside = []) => {
|
|
|
258
260
|
kind: "enum",
|
|
259
261
|
...nullability,
|
|
260
262
|
values: Object.values(def.entries ?? {}).map(String).sort(),
|
|
263
|
+
...extensibleOf(inner),
|
|
261
264
|
...carry
|
|
262
265
|
};
|
|
263
266
|
if (def.type === "literal") return {
|
|
@@ -270,6 +273,7 @@ const toSchemaNode = (schema, inside = []) => {
|
|
|
270
273
|
kind: "union",
|
|
271
274
|
...nullability,
|
|
272
275
|
options: options.map((option) => toSchemaNode(option, inside)),
|
|
276
|
+
...extensibleOf(inner),
|
|
273
277
|
...carry
|
|
274
278
|
};
|
|
275
279
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createJiti } from "jiti";
|
|
2
2
|
import { apiEntries } from "kizunajs";
|
|
3
|
-
import { deriveToolNames, flattenJobs, readDef, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, toToolName, unwrapOptionalWrappers, walkApi } from "kizunajs/generator";
|
|
3
|
+
import { deriveToolNames, flattenJobs, readDef, readMetaExtensible, readMetaId, readModelSchema, readObjectShape, resolveResponseBody, toToolName, unwrapOptionalWrappers, walkApi } from "kizunajs/generator";
|
|
4
4
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { parse, stringify } from "yaml";
|
|
6
6
|
import { flattenRoutes } from "kizunajs/adapter";
|
|
@@ -38,6 +38,7 @@ const fieldsOf = (schema) => schema.kind === "object" ? schema.fields : void 0;
|
|
|
38
38
|
const elementOf = (schema) => schema.kind === "array" ? schema.element : void 0;
|
|
39
39
|
const valuesOf = (schema) => schema.kind === "enum" ? schema.values : void 0;
|
|
40
40
|
const modelOf = (schema) => schema.kind === "model" ? schema.model : void 0;
|
|
41
|
+
const isExtensible = (schema) => schema.extensible === true;
|
|
41
42
|
const optionsOf = (schema) => schema.kind === "union" ? schema.options : void 0;
|
|
42
43
|
/**
|
|
43
44
|
* Whether every value `narrow` allows is one `wide` allows too. A union holds
|
|
@@ -85,7 +86,7 @@ const diffSchemas = (before, after, direction, path = "") => {
|
|
|
85
86
|
const widened = holds(after, before);
|
|
86
87
|
const narrowed = holds(before, after);
|
|
87
88
|
if (!kindChanged && widened && narrowed) return [];
|
|
88
|
-
if (direction === "request" ? widened : narrowed) return [{
|
|
89
|
+
if (direction === "response" && widened && !kindChanged && isExtensible(after) || (direction === "request" ? widened : narrowed)) return [{
|
|
89
90
|
breaking: false,
|
|
90
91
|
path,
|
|
91
92
|
summary: `${label} ${direction === "request" ? "widens" : "narrows"} from ${describeKind(before)} to ${describeKind(after)}`,
|
|
@@ -159,7 +160,7 @@ const diffSchemas = (before, after, direction, path = "") => {
|
|
|
159
160
|
summary: `${path || "the body"} no longer accepts ${removed.join(", ")}`
|
|
160
161
|
});
|
|
161
162
|
if (added.length > 0) changes.push({
|
|
162
|
-
breaking: direction === "response",
|
|
163
|
+
breaking: direction === "response" && !isExtensible(after),
|
|
163
164
|
path,
|
|
164
165
|
summary: direction === "response" ? `${path || "the body"} can now be ${added.join(", ")}` : `${path || "the body"} also accepts ${added.join(", ")}`
|
|
165
166
|
});
|
|
@@ -186,6 +187,7 @@ const refinementCount = (schema) => {
|
|
|
186
187
|
const custom = checks.filter((check) => check._zod?.def?.check === "custom").length;
|
|
187
188
|
return custom === 0 ? void 0 : custom;
|
|
188
189
|
};
|
|
190
|
+
const extensibleOf = (schema) => readMetaExtensible(schema) ? { extensible: true } : {};
|
|
189
191
|
/**
|
|
190
192
|
* A Zod schema reduced to the shape a comparison reads. A model that holds
|
|
191
193
|
* itself is written out once, and inside itself as a reference by its title.
|
|
@@ -235,6 +237,7 @@ const toSchemaNode = (schema, inside = []) => {
|
|
|
235
237
|
kind: "enum",
|
|
236
238
|
...nullability,
|
|
237
239
|
values: Object.values(def.entries ?? {}).map(String).sort(),
|
|
240
|
+
...extensibleOf(inner),
|
|
238
241
|
...carry
|
|
239
242
|
};
|
|
240
243
|
if (def.type === "literal") return {
|
|
@@ -247,6 +250,7 @@ const toSchemaNode = (schema, inside = []) => {
|
|
|
247
250
|
kind: "union",
|
|
248
251
|
...nullability,
|
|
249
252
|
options: options.map((option) => toSchemaNode(option, inside)),
|
|
253
|
+
...extensibleOf(inner),
|
|
250
254
|
...carry
|
|
251
255
|
};
|
|
252
256
|
return {
|
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.38",
|
|
4
4
|
"description": "Command line tooling for Kizuna.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kizunajs",
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
"yaml": "^2.9.1"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
|
-
"kizunajs": "2.0.0-beta.
|
|
64
|
+
"kizunajs": "2.0.0-beta.38",
|
|
65
65
|
"zod": "^4.0.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/node": "^24.19.2",
|
|
69
69
|
"@types/react": "^19.3.0",
|
|
70
|
-
"kizunajs": "2.0.0-beta.
|
|
70
|
+
"kizunajs": "2.0.0-beta.38",
|
|
71
71
|
"tsdown": "^0.21.10",
|
|
72
72
|
"zod": "^4.6.7"
|
|
73
73
|
},
|