@powerlines/schema 0.11.87 → 0.11.88
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/resolve.cjs +1 -1
- package/dist/resolve.d.cts.map +1 -1
- package/dist/resolve.d.mts.map +1 -1
- package/dist/resolve.mjs +1 -1
- package/dist/resolve.mjs.map +1 -1
- package/package.json +5 -5
package/dist/resolve.cjs
CHANGED
|
@@ -35,7 +35,7 @@ async function resolveModule(context, input, overrides) {
|
|
|
35
35
|
throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${fileReference.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel.general === "debug" || context.config.logLevel.general === "trace" ? `
|
|
36
36
|
|
|
37
37
|
Bundle output for module:
|
|
38
|
-
${result.text}` : ""}`);
|
|
38
|
+
${result.text && result.text.length > 2e4 ? `${result.text.slice(0, 2e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
39
39
|
}
|
|
40
40
|
throw new Error(`Failed to evaluate the bundled module for "${fileReference.file}". Error: ${error.message}${context.config.logLevel.general === "debug" || context.config.logLevel.general === "trace" ? `
|
|
41
41
|
|
package/dist/resolve.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.cts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAsCA;;;;;;iBAAsB,aAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"resolve.d.cts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAsCA;;;;;;iBAAsB,aAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBA2EW,OAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,OAAA;;;;;;;;;iBAiGW,iBAAA,kBACH,aAAA,GAAgB,aAAA,EAEjC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,aAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,IAAA"}
|
package/dist/resolve.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.mts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAsCA;;;;;;iBAAsB,aAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"resolve.d.mts","names":[],"sources":["../src/resolve.ts"],"mappings":";;;;;;;;AAsCA;;;;;;iBAAsB,aAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBA2EW,OAAA,2BAEH,iBAAA,GAAoB,iBAAA,EAErC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,kBAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,OAAA;;;;;;;;;iBAiGW,iBAAA,kBACH,aAAA,GAAgB,aAAA,EAEjC,OAAA,EAAS,QAAA,EACT,KAAA,EAAO,aAAA,EACP,OAAA,GAAU,aAAA,GACT,OAAA,CAAQ,IAAA"}
|
package/dist/resolve.mjs
CHANGED
|
@@ -33,7 +33,7 @@ async function resolveModule(context, input, overrides) {
|
|
|
33
33
|
throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${fileReference.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel.general === "debug" || context.config.logLevel.general === "trace" ? `
|
|
34
34
|
|
|
35
35
|
Bundle output for module:
|
|
36
|
-
${result.text}` : ""}`);
|
|
36
|
+
${result.text && result.text.length > 2e4 ? `${result.text.slice(0, 2e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
37
37
|
}
|
|
38
38
|
throw new Error(`Failed to evaluate the bundled module for "${fileReference.file}". Error: ${error.message}${context.config.logLevel.general === "debug" || context.config.logLevel.general === "trace" ? `
|
|
39
39
|
|
package/dist/resolve.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.mjs","names":["parseYaml","parseToml"],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext, UnresolvedContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { extractFileReference } from \"@stryke/convert/extract-file-reference\";\nimport { findFileDotExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { FileReference, FileReferenceInput } from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { parse as parseToml } from \"smol-toml\";\nimport { parse as parseYaml } from \"yaml\";\nimport { bundle, BundleOptions } from \"./bundle\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: FileReferenceInput,\n overrides?: BundleOptions\n): Promise<TResult> {\n const fileReference = extractFileReference(input);\n if (!fileReference) {\n throw new Error(\n `Failed to extract a file reference from the provided input ${JSON.stringify(\n input\n )}. The input must be a string or an object with a \"file\" property that specifies the file path and optional export name.`\n );\n }\n\n const result = await bundle<TContext>(context, fileReference.file, overrides);\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n fileReference.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n fileReference.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: FileReferenceInput,\n options?: BundleOptions\n): Promise<TResult> {\n const fileReference = extractFileReference(input);\n if (!fileReference) {\n throw new Error(\n `Failed to extract a file reference from the provided input. The input must be a string or an object with a \"file\" property that specifies the file path and optional export name.`\n );\n }\n\n const extension = findFileExtensionSafe(fileReference.file);\n if (extension.startsWith(\"json\")) {\n try {\n const json = await context.fs.read(fileReference.file);\n if (!isSetString(json)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid JSON.`\n );\n }\n\n return JSON.parse(json) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the JSON file at \"${fileReference.file}\". Please ensure the file exists and contains valid JSON. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"yaml\" || extension === \"yml\") {\n try {\n const yaml = await context.fs.read(fileReference.file);\n if (!isSetString(yaml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid YAML.`\n );\n }\n\n return parseYaml(yaml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the YAML file at \"${fileReference.file}\". Please ensure the file exists and contains valid YAML. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"toml\") {\n try {\n const toml = await context.fs.read(fileReference.file);\n if (!isSetString(toml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid TOML.`\n );\n }\n\n return parseToml(toml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the TOML file at \"${fileReference.file}\". Please ensure the file exists and contains valid TOML. Error: ${(error as Error).message}`\n );\n }\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n fileReference,\n options\n );\n\n let exportName = fileReference.export;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n fileReference.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n fileReference.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: FileReference,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n })\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,eAAsB,cAIpB,SACA,OACA,WACkB;CAClB,MAAM,gBAAgB,qBAAqB,KAAK;CAChD,IAAI,CAAC,eACH,MAAM,IAAI,MACR,8DAA8D,KAAK,UACjE,KACF,EAAE,wHACJ;CAGF,MAAM,SAAS,MAAM,OAAiB,SAAS,cAAc,MAAM,SAAS;CAE5E,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,QAAQ,SAAS,WAAW,OAAO,MAAM;GACxD,UAAU,OAAO;GACjB,KAAK,qBAAqB,OAAO,IAAI;EACvC,CAAC;CACH,SAAS,OAAO;EACd,IACE,YAAa,MAAgB,OAAO,KACpC,IAAI,OACF,uBAAuB,QAAQ,OAAO,WAAW,QAAQ,aAAa,KACxE,EAAE,KAAM,MAAgB,OAAO,GAC/B;GACA,MAAM,aAAc,MAAgB,QAAQ,MAC1C,IAAI,OACF,wBAAwB,QAA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ACnB,MAAM,IAAI,MACR,gBAAgB,cAAc,KAAK,wFACrC;EAGF,OAAOC,MAAU,IAAI;CACvB,SAAS,OAAO;EACd,MAAM,IAAI,MACR,6CAA6C,cAAc,KAAK,mEAAoE,MAAgB,SACtJ;CACF;CAGF,MAAM,WAAW,MAAM,cACrB,SACA,eACA,OACF;CAEA,IAAI,aAAa,cAAc;CAC/B,IAAI,CAAC,YACH,aAAa;CAGf,MAAM,iBAAiB,SAAS,eAAe,SAAS,MAAM;CAC9D,IAAI,mBAAmB,QACrB,MAAM,IAAI,MACR,eAAe,WAAW,kCACxB,cAAc,KACf,YACC,OAAO,KAAK,QAAQ,EAAE,WAAW,IAC7B,gFACE,cAAc,KACf,kBAAkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,QACF,EAAE,KACA,IACF,EAAE,iEAEV;CAGF,OAAO;AACT;;;;;;;;;AAUA,eAAsB,kBAGpB,SACA,OACA,SACe;CACf,OAAO,QACL,MAAM,QACJ,SACA,OACA,KAAK,SAAS,EACZ,SAAS,CACP,cAAc,SAAS;EACrB,YAAY;EACZ,OAAO;CACT,CAAC,CACH,EACF,CAAC,CACH,CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"resolve.mjs","names":["parseYaml","parseToml"],"sources":["../src/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext, UnresolvedContext } from \"@powerlines/core\";\nimport { esbuildPlugin } from \"@powerlines/deepkit/esbuild-plugin\";\nimport { reflect, Type } from \"@powerlines/deepkit/vendor/type\";\nimport { extractFileReference } from \"@stryke/convert/extract-file-reference\";\nimport { findFileDotExtension, findFileExtensionSafe } from \"@stryke/path/find\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport { FileReference, FileReferenceInput } from \"@stryke/types/configuration\";\nimport defu from \"defu\";\nimport { parse as parseToml } from \"smol-toml\";\nimport { parse as parseYaml } from \"yaml\";\nimport { bundle, BundleOptions } from \"./bundle\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: FileReferenceInput,\n overrides?: BundleOptions\n): Promise<TResult> {\n const fileReference = extractFileReference(input);\n if (!fileReference) {\n throw new Error(\n `Failed to extract a file reference from the provided input ${JSON.stringify(\n input\n )}. The input must be a string or an object with a \"file\" property that specifies the file path and optional export name.`\n );\n }\n\n const result = await bundle<TContext>(context, fileReference.file, overrides);\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n ext: findFileDotExtension(result.path)\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework?.name || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework?.name || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n fileReference.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${\n result.text && result.text.length > 20_000\n ? `${result.text.slice(0, 20_000)}\\n... [truncated]`\n : result.text\n}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n fileReference.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel.general === \"debug\" ||\n context.config.logLevel.general === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<\n TResult,\n TContext extends UnresolvedContext = UnresolvedContext\n>(\n context: TContext,\n input: FileReferenceInput,\n options?: BundleOptions\n): Promise<TResult> {\n const fileReference = extractFileReference(input);\n if (!fileReference) {\n throw new Error(\n `Failed to extract a file reference from the provided input. The input must be a string or an object with a \"file\" property that specifies the file path and optional export name.`\n );\n }\n\n const extension = findFileExtensionSafe(fileReference.file);\n if (extension.startsWith(\"json\")) {\n try {\n const json = await context.fs.read(fileReference.file);\n if (!isSetString(json)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid JSON.`\n );\n }\n\n return JSON.parse(json) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the JSON file at \"${fileReference.file}\". Please ensure the file exists and contains valid JSON. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"yaml\" || extension === \"yml\") {\n try {\n const yaml = await context.fs.read(fileReference.file);\n if (!isSetString(yaml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid YAML.`\n );\n }\n\n return parseYaml(yaml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the YAML file at \"${fileReference.file}\". Please ensure the file exists and contains valid YAML. Error: ${(error as Error).message}`\n );\n }\n } else if (extension === \"toml\") {\n try {\n const toml = await context.fs.read(fileReference.file);\n if (!isSetString(toml)) {\n throw new Error(\n `The file at \"${fileReference.file}\" could not be read as a string. Please ensure the file exists and contains valid TOML.`\n );\n }\n\n return parseToml(toml) as TResult;\n } catch (error) {\n throw new Error(\n `Failed to read or parse the TOML file at \"${fileReference.file}\". Please ensure the file exists and contains valid TOML. Error: ${(error as Error).message}`\n );\n }\n }\n\n const resolved = await resolveModule<Record<string, any>, TContext>(\n context,\n fileReference,\n options\n );\n\n let exportName = fileReference.export;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n fileReference.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n fileReference.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n\n/**\n * Resolves a type definition to a Deepkit Type reflection. This function compiles the provided type definition to a module, evaluates the module to get the specified export, and then reflects the export to get its Deepkit Type reflection.\n *\n * @param context - The context object containing the environment paths.\n * @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the Deepkit Type reflection.\n */\nexport async function resolveReflection<\n TContext extends PluginContext = PluginContext\n>(\n context: TContext,\n input: FileReference,\n options?: BundleOptions\n): Promise<Type> {\n return reflect(\n await resolve<Type>(\n context,\n input,\n defu(options, {\n plugins: [\n esbuildPlugin(context, {\n reflection: \"default\",\n level: \"all\"\n })\n ]\n })\n )\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,eAAsB,cAIpB,SACA,OACA,WACkB;CAClB,MAAM,gBAAgB,qBAAqB,KAAK;CAChD,IAAI,CAAC,eACH,MAAM,IAAI,MACR,8DAA8D,KAAK,UACjE,KACF,EAAE,wHACJ;CAGF,MAAM,SAA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
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/schema",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.88",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": [
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"typings": "dist/index.d.mts",
|
|
60
60
|
"files": ["dist"],
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@powerlines/core": "^0.48.
|
|
63
|
-
"@powerlines/deepkit": "^0.9.
|
|
64
|
-
"@powerlines/unplugin": "^0.0.
|
|
62
|
+
"@powerlines/core": "^0.48.38",
|
|
63
|
+
"@powerlines/deepkit": "^0.9.70",
|
|
64
|
+
"@powerlines/unplugin": "^0.0.86",
|
|
65
65
|
"@standard-schema/spec": "^1.1.0",
|
|
66
66
|
"@stryke/convert": "^0.7.14",
|
|
67
67
|
"@stryke/hash": "^0.13.37",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"zod": { "optional": true }
|
|
97
97
|
},
|
|
98
98
|
"publishConfig": { "access": "public" },
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "87e51702e7912e7e0f335da1c4cff9712ec4bdba"
|
|
100
100
|
}
|