@power-plant/schema 0.0.43 → 0.0.44
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 +6 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +6 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1002,9 +1002,11 @@ async function extractTSType(input, options = {}) {
|
|
|
1002
1002
|
splitting: false,
|
|
1003
1003
|
treeShaking: true,
|
|
1004
1004
|
bundle: true,
|
|
1005
|
-
packages: "bundle",
|
|
1006
1005
|
keepNames: true,
|
|
1007
1006
|
metafile: false,
|
|
1007
|
+
minify: true,
|
|
1008
|
+
legalComments: "none",
|
|
1009
|
+
target: "es2022",
|
|
1008
1010
|
absWorkingDir: cwd,
|
|
1009
1011
|
plugins: [createDeepkitPlugin(options)]
|
|
1010
1012
|
});
|
|
@@ -1030,11 +1032,11 @@ async function extractTSType(input, options = {}) {
|
|
|
1030
1032
|
if (!schema) throw new Error(`The export "${exportName}" could not be converted to a JSON Schema.`);
|
|
1031
1033
|
return schema;
|
|
1032
1034
|
} catch (error) {
|
|
1033
|
-
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}`);
|
|
1035
|
+
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}${error.stack ? `\n${error.stack}` : ""}`);
|
|
1034
1036
|
}
|
|
1035
1037
|
}
|
|
1036
1038
|
/**
|
|
1037
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
1039
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
1038
1040
|
*
|
|
1039
1041
|
* @example
|
|
1040
1042
|
* ```ts
|
|
@@ -1129,7 +1131,7 @@ async function extractSchemaWithSource(input, options = {}) {
|
|
|
1129
1131
|
};
|
|
1130
1132
|
}
|
|
1131
1133
|
/**
|
|
1132
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
1134
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
1133
1135
|
*
|
|
1134
1136
|
* @example
|
|
1135
1137
|
* ```ts
|
package/dist/index.d.cts
CHANGED
|
@@ -100,7 +100,7 @@ declare function extractSource(variant: SchemaSourceVariant, input: SchemaSource
|
|
|
100
100
|
*/
|
|
101
101
|
declare function extractTSType(input: FileReferenceInput, options?: InferLoadOptions<typeof input> & BaseExtractOptions): Promise<JsonSchema>;
|
|
102
102
|
/**
|
|
103
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
103
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
104
104
|
*
|
|
105
105
|
* @example
|
|
106
106
|
* ```ts
|
|
@@ -134,7 +134,7 @@ declare function extractTSType(input: FileReferenceInput, options?: InferLoadOpt
|
|
|
134
134
|
*/
|
|
135
135
|
declare function extractSchemaWithSource<TSpec = any>(input: SchemaConfig, options?: InferExtractOptions<typeof input>): Promise<ExtractedSchemaEnvelope<TSpec>>;
|
|
136
136
|
/**
|
|
137
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
137
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
138
138
|
*
|
|
139
139
|
* @example
|
|
140
140
|
* ```ts
|
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":";;;;;;;;;;;;;;;;;;;;;;;iBAwGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBCoDc,iBAAiB,QAAQ,aAAa;;;;iBAgMtC,YACd,SAAS,qBACT,OAAO;;;;iBA+CO,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;;;;;;;;;;;iBA4NmB,cACpB,OAAO,oBACP,UAAS,wBAAwB,SAAS,qBACzC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;iBAwGgB,yBACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBAqHc,6BACd,MAAM,YACN,UAAU,YACV;;;;;;;;;iBCoDc,iBAAiB,QAAQ,aAAa;;;;iBAgMtC,YACd,SAAS,qBACT,OAAO;;;;iBA+CO,kBAAkB,YAAY,OAAO;;;;;;;iBAcrC,kBAAkB,kBAAkB;;;;;;;;iBAoCpC,uBACd,O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BAqB3C,gBACd,iBACC,SAAS;;;;;;;;;;;iBA2BI,6BAA6B;;;;;;;;;;iBAoB7B,aAAa,iBAAiB,SAAS;;;;;;;;;;iBAsCvC,qBAAqB,iBAAiB,SAAS;;;;;;;;;;iBAa/C,gBAAgB,iBAAiB,SAAS;;;;;;;;;;;iBAyD1C,sBAAsB,iBAAiB,SAAS;;;;;;;;;;;cAmBnD,uBAAc;iBAEX,gBAAgB,iBAAiB,SAAS;;;;;;;;;;;;cA2B7C,6BAAoB;iBAEjB,sBACd,iBACC,SAAS;;;;;;;iBAuBI,SAAS,iBAAiB,SAAS;;;;;;;iBAkBnC,WAAW,OACzB,iBACC,SAAS,iBAAiB;;;;;;;iBAUb,mBAAmB,iBAAiB,SAAS;;;;;;;iBAiB7C,eACd,iBACC,SAAS,eAAe"}
|
package/dist/index.d.mts
CHANGED
|
@@ -100,7 +100,7 @@ declare function extractSource(variant: SchemaSourceVariant, input: SchemaSource
|
|
|
100
100
|
*/
|
|
101
101
|
declare function extractTSType(input: FileReferenceInput, options?: InferLoadOptions<typeof input> & BaseExtractOptions): Promise<JsonSchema>;
|
|
102
102
|
/**
|
|
103
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
103
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
104
104
|
*
|
|
105
105
|
* @example
|
|
106
106
|
* ```ts
|
|
@@ -134,7 +134,7 @@ declare function extractTSType(input: FileReferenceInput, options?: InferLoadOpt
|
|
|
134
134
|
*/
|
|
135
135
|
declare function extractSchemaWithSource<TSpec = any>(input: SchemaConfig, options?: InferExtractOptions<typeof input>): Promise<ExtractedSchemaEnvelope<TSpec>>;
|
|
136
136
|
/**
|
|
137
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
137
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
138
138
|
*
|
|
139
139
|
* @example
|
|
140
140
|
* ```ts
|
package/dist/index.mjs
CHANGED
|
@@ -998,9 +998,11 @@ async function extractTSType(input, options = {}) {
|
|
|
998
998
|
splitting: false,
|
|
999
999
|
treeShaking: true,
|
|
1000
1000
|
bundle: true,
|
|
1001
|
-
packages: "bundle",
|
|
1002
1001
|
keepNames: true,
|
|
1003
1002
|
metafile: false,
|
|
1003
|
+
minify: true,
|
|
1004
|
+
legalComments: "none",
|
|
1005
|
+
target: "es2022",
|
|
1004
1006
|
absWorkingDir: cwd,
|
|
1005
1007
|
plugins: [createDeepkitPlugin(options)]
|
|
1006
1008
|
});
|
|
@@ -1026,11 +1028,11 @@ async function extractTSType(input, options = {}) {
|
|
|
1026
1028
|
if (!schema) throw new Error(`The export "${exportName}" could not be converted to a JSON Schema.`);
|
|
1027
1029
|
return schema;
|
|
1028
1030
|
} catch (error) {
|
|
1029
|
-
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}`);
|
|
1031
|
+
throw new Error(`Failed to generate a JSON schema for "${fileReference.file}"${resolvedPath && resolvedPath !== fileReference.file ? ` (resolved: ${resolvedPath})` : ""} using the type "${exportName}". Error: ${error.message}${error.stack ? `\n${error.stack}` : ""}`);
|
|
1030
1032
|
}
|
|
1031
1033
|
}
|
|
1032
1034
|
/**
|
|
1033
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
1035
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
1034
1036
|
*
|
|
1035
1037
|
* @example
|
|
1036
1038
|
* ```ts
|
|
@@ -1125,7 +1127,7 @@ async function extractSchemaWithSource(input, options = {}) {
|
|
|
1125
1127
|
};
|
|
1126
1128
|
}
|
|
1127
1129
|
/**
|
|
1128
|
-
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [
|
|
1130
|
+
* Extracts a JSON Schema from a given schema definition input, which can be a Zod schema, a Valibot schema, any Standard JSON Schema type, a plain JSON Schema object, an untyped schema, a Deepkit Type object, or a {@link FileReferenceInput} to an exported TypeScript type definition or any of the previous options. If the input is a {@link FileReferenceInput} (e.g. a file path with an export), the source code will be bundled with [esbuild](https://esbuild.github.io) using [\@deepkit/type-compiler](https://deepkit.io/en/documentation/runtime-types/getting-started) reflection to obtain the actual schema definition before extraction.
|
|
1129
1131
|
*
|
|
1130
1132
|
* @example
|
|
1131
1133
|
* ```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Power Plant utility package to help managing schemas.",
|
|
6
6
|
"keywords": [
|
|
@@ -187,5 +187,5 @@
|
|
|
187
187
|
"picomatch": "2.3.2",
|
|
188
188
|
"to-regex-range": "5.0.1"
|
|
189
189
|
},
|
|
190
|
-
"gitHead": "
|
|
190
|
+
"gitHead": "6b19a0185343ce0068a955fb2a958308084120c3"
|
|
191
191
|
}
|