@power-plant/schema 0.0.81 → 0.0.83
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/index.cjs +11 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.mjs +12 -3
- package/package.json +19 -19
package/dist/index.cjs
CHANGED
|
@@ -1004,6 +1004,15 @@ async function extractTSType(input, options = {}) {
|
|
|
1004
1004
|
const resolvedPath = await (0, _stryke_fs_resolve.resolveSafe)(fileReference.file, { fs: options.fs });
|
|
1005
1005
|
const filePath = resolvedPath || fileReference.file;
|
|
1006
1006
|
const cwd = options.cwd || process.cwd();
|
|
1007
|
+
const esbuildOverrides = (0, _stryke_helpers_omit.omit)(options, [
|
|
1008
|
+
"cwd",
|
|
1009
|
+
"fs",
|
|
1010
|
+
"logger",
|
|
1011
|
+
"storage",
|
|
1012
|
+
"tsconfig",
|
|
1013
|
+
"reflection",
|
|
1014
|
+
"exclude"
|
|
1015
|
+
]);
|
|
1007
1016
|
try {
|
|
1008
1017
|
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
1009
1018
|
const result = await (0, esbuild.build)((0, defu.default)({
|
|
@@ -1015,7 +1024,7 @@ async function extractTSType(input, options = {}) {
|
|
|
1015
1024
|
sourcemap: false,
|
|
1016
1025
|
splitting: false,
|
|
1017
1026
|
keepNames: true
|
|
1018
|
-
},
|
|
1027
|
+
}, esbuildOverrides, {
|
|
1019
1028
|
treeShaking: true,
|
|
1020
1029
|
bundle: true,
|
|
1021
1030
|
metafile: false,
|
|
@@ -1094,7 +1103,7 @@ async function extractSchemaWithSource(input, options = {}) {
|
|
|
1094
1103
|
}
|
|
1095
1104
|
};
|
|
1096
1105
|
const unwrapped = unwrapSchemaConfig(input);
|
|
1097
|
-
if ((0, _stryke_type_checks.isObject)(unwrapped) && (
|
|
1106
|
+
if ((0, _stryke_type_checks.isObject)(unwrapped) && !Array.isArray(unwrapped) && Object.keys(unwrapped).length === 0) {
|
|
1098
1107
|
const schema = { type: [...require_constants.JSON_SCHEMA_TYPES] };
|
|
1099
1108
|
const hash = extractHash("json-schema", schema);
|
|
1100
1109
|
return {
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/compatibility.ts","../src/extract.ts","../src/helpers.ts","../src/metadata.ts","../src/type-checks.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAyGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/compatibility.ts","../src/extract.ts","../src/helpers.ts","../src/metadata.ts","../src/type-checks.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;iBAyGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBCqDc,iBAAiB,QAAQ,aAAa;;;;iBAgMtC,YACd,SAAS,qBACT,OAAO;;;;iBA8CO,kBAAkB,YAAY,OAAO;;;;;;;iBAcrC,kBAAkB,kBAAkB;;;;;;;;iBAoCpC,uBACd,OAAO,qBACN;;;;;;;iBA4Ba,eAAe,OAAO,eAAe;;;;;;;;;iBAsB/B,cACpB,OAAO,oBACP,UAAU,sBACT,QAAQ;;;;;;;;;iBAqCK,cACd,SAAS,qBACT,OAAO,qBACN;;;;;;;;;;;;iBA8Ja,oBACd,SAAS;EAAuB,KAAK;IACpC;;;;;;;;;;;iBAuEmB,cACpB,OAAO,oBACP,UAAS,wBAAwB,SAAS,qBACzC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqKW,wBAAwB,aAC5C,OAAO,cACP,UAAS,2BAA2B,SACnC,QAAQ,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0Kb,QA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BAkBnC,WAAW,OACzB,iBACC,SAAS,iBAAiB;;;;;;;iBAUb,mBAAmB,iBAAiB,SAAS;;;;;;;iBAiB7C,eACd,iBACC,SAAS,eAAe"}
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { getJsonSchemaType } from "./codegen.mjs";
|
|
|
5
5
|
import { n as createStoragePromises, r as normalizeKey, t as mapStorageToFileSystem } from "./storage-DEe8ZAMI.mjs";
|
|
6
6
|
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
7
7
|
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
8
|
-
import { isBigInt, isBoolean,
|
|
8
|
+
import { isBigInt, isBoolean, isInteger, isNull, isNumber, isObject, isRegExp, isSetArray, isSetObject as isSetObject$1, isSetString as isSetString$1, isString, isUndefined } from "@stryke/type-checks";
|
|
9
9
|
import { ReflectionClass, ReflectionKind, TypeNumberBrand, isType, reflect, stringifyType } from "@deepkit/type";
|
|
10
10
|
import { extractFileReference } from "@stryke/convert/extract-file-reference";
|
|
11
11
|
import { resolveSafe } from "@stryke/fs/resolve";
|
|
@@ -1000,6 +1000,15 @@ async function extractTSType(input, options = {}) {
|
|
|
1000
1000
|
const resolvedPath = await resolveSafe(fileReference.file, { fs: options.fs });
|
|
1001
1001
|
const filePath = resolvedPath || fileReference.file;
|
|
1002
1002
|
const cwd = options.cwd || process.cwd();
|
|
1003
|
+
const esbuildOverrides = omit(options, [
|
|
1004
|
+
"cwd",
|
|
1005
|
+
"fs",
|
|
1006
|
+
"logger",
|
|
1007
|
+
"storage",
|
|
1008
|
+
"tsconfig",
|
|
1009
|
+
"reflection",
|
|
1010
|
+
"exclude"
|
|
1011
|
+
]);
|
|
1003
1012
|
try {
|
|
1004
1013
|
options.logger?.debug?.(`Generating JSON schema for bundled "${filePath}" using the type "${exportName}"`);
|
|
1005
1014
|
const result = await build(defu({
|
|
@@ -1011,7 +1020,7 @@ async function extractTSType(input, options = {}) {
|
|
|
1011
1020
|
sourcemap: false,
|
|
1012
1021
|
splitting: false,
|
|
1013
1022
|
keepNames: true
|
|
1014
|
-
},
|
|
1023
|
+
}, esbuildOverrides, {
|
|
1015
1024
|
treeShaking: true,
|
|
1016
1025
|
bundle: true,
|
|
1017
1026
|
metafile: false,
|
|
@@ -1090,7 +1099,7 @@ async function extractSchemaWithSource(input, options = {}) {
|
|
|
1090
1099
|
}
|
|
1091
1100
|
};
|
|
1092
1101
|
const unwrapped = unwrapSchemaConfig(input);
|
|
1093
|
-
if (isObject(unwrapped) &&
|
|
1102
|
+
if (isObject(unwrapped) && !Array.isArray(unwrapped) && Object.keys(unwrapped).length === 0) {
|
|
1094
1103
|
const schema = { type: [...JSON_SCHEMA_TYPES] };
|
|
1095
1104
|
const hash = extractHash("json-schema", schema);
|
|
1096
1105
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Power Plant utility package to help managing schemas.",
|
|
6
6
|
"keywords": [
|
|
@@ -137,26 +137,26 @@
|
|
|
137
137
|
"@deepkit/type-spec": "^1.0.19",
|
|
138
138
|
"@marcj/ts-clone-node": "^2.2.0",
|
|
139
139
|
"@standard-schema/spec": "^1.1.0",
|
|
140
|
-
"@stryke/convert": "^0.7.
|
|
141
|
-
"@stryke/date": "^0.0.
|
|
142
|
-
"@stryke/fs": "^0.33.
|
|
143
|
-
"@stryke/hash": "^0.13.
|
|
144
|
-
"@stryke/helpers": "^0.10.
|
|
145
|
-
"@stryke/json": "^0.15.
|
|
146
|
-
"@stryke/path": "^0.29.
|
|
147
|
-
"@stryke/resolve": "^0.0.
|
|
148
|
-
"@stryke/string-format": "^0.17.
|
|
149
|
-
"@stryke/type-checks": "^0.6.
|
|
150
|
-
"@stryke/types": "^0.12.
|
|
151
|
-
"@stryke/unique-id": "^0.3.
|
|
152
|
-
"@stryke/url": "^0.4.
|
|
153
|
-
"@stryke/zod": "^0.3.
|
|
140
|
+
"@stryke/convert": "^0.7.39",
|
|
141
|
+
"@stryke/date": "^0.0.20",
|
|
142
|
+
"@stryke/fs": "^0.33.110",
|
|
143
|
+
"@stryke/hash": "^0.13.63",
|
|
144
|
+
"@stryke/helpers": "^0.10.48",
|
|
145
|
+
"@stryke/json": "^0.15.32",
|
|
146
|
+
"@stryke/path": "^0.29.35",
|
|
147
|
+
"@stryke/resolve": "^0.0.25",
|
|
148
|
+
"@stryke/string-format": "^0.17.50",
|
|
149
|
+
"@stryke/type-checks": "^0.6.41",
|
|
150
|
+
"@stryke/types": "^0.12.36",
|
|
151
|
+
"@stryke/unique-id": "^0.3.121",
|
|
152
|
+
"@stryke/url": "^0.4.60",
|
|
153
|
+
"@stryke/zod": "^0.3.54",
|
|
154
154
|
"@typescript/vfs": "^1.6.4",
|
|
155
155
|
"@valibot/to-json-schema": "^1.7.1",
|
|
156
156
|
"braces": "^3.0.3",
|
|
157
157
|
"compatfactory": "^4.0.4",
|
|
158
158
|
"defu": "^6.1.7",
|
|
159
|
-
"esbuild": "^0.28.
|
|
159
|
+
"esbuild": "^0.28.2",
|
|
160
160
|
"fill-range": "^7.1.1",
|
|
161
161
|
"is-number": "^7.0.0",
|
|
162
162
|
"jiti": "^2.7.0",
|
|
@@ -169,9 +169,9 @@
|
|
|
169
169
|
},
|
|
170
170
|
"devDependencies": {
|
|
171
171
|
"@deepkit/type-compiler": "1.0.19",
|
|
172
|
-
"@powerlines/plugin-tsdown": "^0.1.
|
|
172
|
+
"@powerlines/plugin-tsdown": "^0.1.602",
|
|
173
173
|
"@types/node": "^25.9.5",
|
|
174
|
-
"powerlines": "^0.47.
|
|
174
|
+
"powerlines": "^0.47.201",
|
|
175
175
|
"valibot": "^1.4.2",
|
|
176
176
|
"zod": "^4.4.3"
|
|
177
177
|
},
|
|
@@ -185,5 +185,5 @@
|
|
|
185
185
|
},
|
|
186
186
|
"publishConfig": { "access": "public" },
|
|
187
187
|
"inlinedDependencies": { "@deepkit/type-compiler": "1.0.19" },
|
|
188
|
-
"gitHead": "
|
|
188
|
+
"gitHead": "681185c0980c7d8645734f3b5dc6a2fa1483bc52"
|
|
189
189
|
}
|