powerlines 0.47.145 → 0.47.146
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/package.cjs +1 -1
- package/dist/package.mjs +1 -1
- package/dist/schema-bundle.cjs +58 -0
- package/dist/schema-bundle.d.cts +20 -0
- package/dist/schema-bundle.d.cts.map +1 -0
- package/dist/schema-bundle.d.mts +20 -0
- package/dist/schema-bundle.d.mts.map +1 -0
- package/dist/schema-bundle.mjs +56 -0
- package/dist/schema-bundle.mjs.map +1 -0
- package/dist/schema-resolve.cjs +86 -0
- package/dist/schema-resolve.d.cts +25 -0
- package/dist/schema-resolve.d.cts.map +1 -0
- package/dist/schema-resolve.d.mts +25 -0
- package/dist/schema-resolve.d.mts.map +1 -0
- package/dist/schema-resolve.mjs +85 -0
- package/dist/schema-resolve.mjs.map +1 -0
- package/dist/schema.cjs +16 -3
- package/dist/schema.d.cts +5 -1
- package/dist/schema.d.mts +5 -1
- package/dist/schema.mjs +7 -2
- package/package.json +22 -8
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let _powerlines_unplugin_esbuild = require("@powerlines/unplugin/esbuild");
|
|
4
|
+
let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
5
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
6
|
+
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
+
let defu = require("defu");
|
|
8
|
+
defu = require_runtime.__toESM(defu, 1);
|
|
9
|
+
let esbuild = require("esbuild");
|
|
10
|
+
let unplugin = require("unplugin");
|
|
11
|
+
|
|
12
|
+
//#region src/schema-bundle.ts
|
|
13
|
+
/**
|
|
14
|
+
* Bundle a type definition to a module.
|
|
15
|
+
*
|
|
16
|
+
* @param context - The context object containing the environment paths.
|
|
17
|
+
* @param file - The file path to bundle.
|
|
18
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
19
|
+
* @returns A promise that resolves to the bundled module.
|
|
20
|
+
*/
|
|
21
|
+
async function bundle(context, file, options = {}) {
|
|
22
|
+
const path = await context.fs.resolve(file);
|
|
23
|
+
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
24
|
+
const result = await (0, esbuild.build)((0, defu.default)({
|
|
25
|
+
platform: "node",
|
|
26
|
+
...(0, _stryke_helpers_omit.omit)(options, ["name", "resolve"]),
|
|
27
|
+
logLevel: "silent",
|
|
28
|
+
entryPoints: [path],
|
|
29
|
+
write: false,
|
|
30
|
+
sourcemap: false,
|
|
31
|
+
splitting: false,
|
|
32
|
+
treeShaking: true,
|
|
33
|
+
bundle: true,
|
|
34
|
+
packages: "bundle",
|
|
35
|
+
keepNames: true,
|
|
36
|
+
metafile: false
|
|
37
|
+
}, (0, _powerlines_unplugin_esbuild.resolveOptions)(context), { plugins: [(0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnpluginResolver)(context, {
|
|
38
|
+
name: options.name ?? `${(0, _stryke_path_file_path_fns.findFileName)(file)} Bundler`,
|
|
39
|
+
prefix: false,
|
|
40
|
+
overrides: (0, defu.default)(options.resolve ?? {}, {
|
|
41
|
+
skipNodeModulesBundle: false,
|
|
42
|
+
external: [
|
|
43
|
+
"@alloy-js/core",
|
|
44
|
+
"@alloy-js/typescript",
|
|
45
|
+
"@alloy-js/json",
|
|
46
|
+
"@alloy-js/markdown"
|
|
47
|
+
]
|
|
48
|
+
}),
|
|
49
|
+
silenceHookLogging: true
|
|
50
|
+
}))()] }));
|
|
51
|
+
if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
52
|
+
if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
53
|
+
if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
|
|
54
|
+
return result.outputFiles.filter(Boolean)[0];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
exports.bundle = bundle;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ResolveOptions, UnresolvedContext } from "@powerlines/core";
|
|
2
|
+
import { DeepPartial } from "@stryke/types/base";
|
|
3
|
+
import { BuildOptions, OutputFile } from "esbuild";
|
|
4
|
+
//#region src/schema-bundle.d.ts
|
|
5
|
+
type BundleOptions = DeepPartial<BuildOptions> & {
|
|
6
|
+
name?: string;
|
|
7
|
+
resolve?: DeepPartial<ResolveOptions>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Bundle a type definition to a module.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The context object containing the environment paths.
|
|
13
|
+
* @param file - The file path to bundle.
|
|
14
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
15
|
+
* @returns A promise that resolves to the bundled module.
|
|
16
|
+
*/
|
|
17
|
+
declare function bundle<TContext extends UnresolvedContext>(context: TContext, file: string, options?: BundleOptions): Promise<OutputFile>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { BundleOptions, bundle };
|
|
20
|
+
//# sourceMappingURL=schema-bundle.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-bundle.d.cts","names":[],"sources":["../src/schema-bundle.ts"],"mappings":";;;;KA6BY,gBAAgB,YAAY;EACtC;EACA,UAAU,YAAY;;;;;;;;;;iBAWF,OAAO,iBAAiB,mBAC5C,SAAS,UACT,cACA,UAAS,gBACR,QAAQ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ResolveOptions, UnresolvedContext } from "@powerlines/core";
|
|
2
|
+
import { BuildOptions, OutputFile } from "esbuild";
|
|
3
|
+
import { DeepPartial } from "@stryke/types/base";
|
|
4
|
+
//#region src/schema-bundle.d.ts
|
|
5
|
+
type BundleOptions = DeepPartial<BuildOptions> & {
|
|
6
|
+
name?: string;
|
|
7
|
+
resolve?: DeepPartial<ResolveOptions>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Bundle a type definition to a module.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The context object containing the environment paths.
|
|
13
|
+
* @param file - The file path to bundle.
|
|
14
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
15
|
+
* @returns A promise that resolves to the bundled module.
|
|
16
|
+
*/
|
|
17
|
+
declare function bundle<TContext extends UnresolvedContext>(context: TContext, file: string, options?: BundleOptions): Promise<OutputFile>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { BundleOptions, bundle };
|
|
20
|
+
//# sourceMappingURL=schema-bundle.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-bundle.d.mts","names":[],"sources":["../src/schema-bundle.ts"],"mappings":";;;;KA6BY,gBAAgB,YAAY;EACtC;EACA,UAAU,YAAY;;;;;;;;;;iBAWF,OAAO,iBAAiB,mBAC5C,SAAS,UACT,cACA,UAAS,gBACR,QAAQ"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { resolveOptions } from "@powerlines/unplugin/esbuild";
|
|
2
|
+
import { createUnpluginResolver } from "@powerlines/core/lib/unplugin";
|
|
3
|
+
import { omit } from "@stryke/helpers/omit";
|
|
4
|
+
import { findFileName } from "@stryke/path/file-path-fns";
|
|
5
|
+
import defu from "defu";
|
|
6
|
+
import { build } from "esbuild";
|
|
7
|
+
import { createEsbuildPlugin } from "unplugin";
|
|
8
|
+
|
|
9
|
+
//#region src/schema-bundle.ts
|
|
10
|
+
/**
|
|
11
|
+
* Bundle a type definition to a module.
|
|
12
|
+
*
|
|
13
|
+
* @param context - The context object containing the environment paths.
|
|
14
|
+
* @param file - The file path to bundle.
|
|
15
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
16
|
+
* @returns A promise that resolves to the bundled module.
|
|
17
|
+
*/
|
|
18
|
+
async function bundle(context, file, options = {}) {
|
|
19
|
+
const path = await context.fs.resolve(file);
|
|
20
|
+
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
21
|
+
const result = await build(defu({
|
|
22
|
+
platform: "node",
|
|
23
|
+
...omit(options, ["name", "resolve"]),
|
|
24
|
+
logLevel: "silent",
|
|
25
|
+
entryPoints: [path],
|
|
26
|
+
write: false,
|
|
27
|
+
sourcemap: false,
|
|
28
|
+
splitting: false,
|
|
29
|
+
treeShaking: true,
|
|
30
|
+
bundle: true,
|
|
31
|
+
packages: "bundle",
|
|
32
|
+
keepNames: true,
|
|
33
|
+
metafile: false
|
|
34
|
+
}, resolveOptions(context), { plugins: [createEsbuildPlugin(createUnpluginResolver(context, {
|
|
35
|
+
name: options.name ?? `${findFileName(file)} Bundler`,
|
|
36
|
+
prefix: false,
|
|
37
|
+
overrides: defu(options.resolve ?? {}, {
|
|
38
|
+
skipNodeModulesBundle: false,
|
|
39
|
+
external: [
|
|
40
|
+
"@alloy-js/core",
|
|
41
|
+
"@alloy-js/typescript",
|
|
42
|
+
"@alloy-js/json",
|
|
43
|
+
"@alloy-js/markdown"
|
|
44
|
+
]
|
|
45
|
+
}),
|
|
46
|
+
silenceHookLogging: true
|
|
47
|
+
}))()] }));
|
|
48
|
+
if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
49
|
+
if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
50
|
+
if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
|
|
51
|
+
return result.outputFiles.filter(Boolean)[0];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { bundle };
|
|
56
|
+
//# sourceMappingURL=schema-bundle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-bundle.mjs","names":[],"sources":["../src/schema-bundle.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 { ResolveOptions, UnresolvedContext } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { resolveOptions } from \"@powerlines/unplugin/esbuild\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport { DeepPartial } from \"@stryke/types/base\";\nimport defu from \"defu\";\nimport type { BuildOptions } from \"esbuild\";\nimport { build, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\n\nexport type BundleOptions = DeepPartial<BuildOptions> & {\n name?: string;\n resolve?: DeepPartial<ResolveOptions>;\n};\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param options - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle<TContext extends UnresolvedContext>(\n context: TContext,\n file: string,\n options: BundleOptions = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build(\n defu(\n {\n platform: \"node\",\n ...omit(options, [\"name\", \"resolve\"]),\n logLevel: \"silent\",\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: true,\n bundle: true,\n packages: \"bundle\",\n keepNames: true,\n metafile: false\n },\n resolveOptions(context),\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, {\n name: options.name ?? `${findFileName(file)} Bundler`,\n prefix: false,\n overrides: defu(options.resolve ?? {}, {\n skipNodeModulesBundle: false,\n external: [\n \"@alloy-js/core\",\n \"@alloy-js/typescript\",\n \"@alloy-js/json\",\n \"@alloy-js/markdown\"\n ]\n }),\n silenceHookLogging: true\n })\n )()\n ]\n }\n )\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA0CA,eAAsB,OACpB,SACA,MACA,UAAyB,CAAC,GACL;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,IAAI;CAC1C,IAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,IAAI,GACtC,MAAM,IAAI,MACR,sBAAsB,KAAK,wCAC7B;CAGF,MAAM,SAAS,MAAM,MACnB,KACE;EACE,UAAU;EACV,GAAG,KAAK,SAAS,CAAC,QAAQ,SAAS,CAAC;EACpC,UAAU;EACV,aAAa,CAAC,IAAI;EAClB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,WAAW;EACX,UAAU;CACZ,GACA,eAAe,OAAO,GACtB,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS;EAC9B,MAAM,QAAQ,QAAQ,GAAG,aAAa,IAAI,EAAE;EAC5C,QAAQ;EACR,WAAW,KAAK,QAAQ,WAAW,CAAC,GAAG;GACrC,uBAAuB;GACvB,UAAU;IACR;IACA;IACA;IACA;GACF;EACF,CAAC;EACD,oBAAoB;CACtB,CAAC,CACH,CAAC,CAAC,CACJ,EACF,CACF,CACF;CACA,IAAI,OAAO,OAAO,SAAS,GACzB,MAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,IAAI,CAAC,CACxB,KAAK,IAAI,GACd;CAEF,IAAI,OAAO,SAAS,SAAS,GAC3B,QAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,IAAI,CAAC,CAC5B,KAAK,IAAI,GACd;CAEF,IAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,OAAO,CAAC,CAAC,WAAW,GACvE,MAAM,IAAI,MACR,iCACE,KACD,gDACH;CAGF,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC,CAAC;AAC5C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_schema_bundle = require('./schema-bundle.cjs');
|
|
3
|
+
let _stryke_convert_extract_file_reference = require("@stryke/convert/extract-file-reference");
|
|
4
|
+
let _stryke_path_find = require("@stryke/path/find");
|
|
5
|
+
let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
6
|
+
let smol_toml = require("smol-toml");
|
|
7
|
+
let yaml = require("yaml");
|
|
8
|
+
|
|
9
|
+
//#region src/schema-resolve.ts
|
|
10
|
+
/**
|
|
11
|
+
* Compiles a type definition to a module and returns the module.
|
|
12
|
+
*
|
|
13
|
+
* @param context - The context object containing the environment paths.
|
|
14
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
15
|
+
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
16
|
+
* @returns A promise that resolves to the compiled module.
|
|
17
|
+
*/
|
|
18
|
+
async function resolveModule(context, input, overrides) {
|
|
19
|
+
const fileReference = (0, _stryke_convert_extract_file_reference.extractFileReference)(input);
|
|
20
|
+
if (!fileReference) throw new Error(`Failed to extract a file reference from the provided input ${JSON.stringify(input)}. The input must be a string or an object with a "file" property that specifies the file path and optional export name.`);
|
|
21
|
+
const result = await require_schema_bundle.bundle(context, fileReference.file, overrides);
|
|
22
|
+
let resolved;
|
|
23
|
+
try {
|
|
24
|
+
resolved = await context.resolver.evalModule(result.text, {
|
|
25
|
+
filename: result.path,
|
|
26
|
+
ext: (0, _stryke_path_find.findFileDotExtension)(result.path)
|
|
27
|
+
});
|
|
28
|
+
} catch (error) {
|
|
29
|
+
if ((0, _stryke_type_checks_is_set_string.isSetString)(error.message) && new RegExp(`Cannot find module '${context.config.framework?.name || "powerlines"}:.*'`).test(error.message)) {
|
|
30
|
+
const moduleName = error.message.match(new RegExp(`Cannot find module '(${context.config.framework?.name || "powerlines"}:.*)'`))?.[1];
|
|
31
|
+
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" ? `
|
|
32
|
+
|
|
33
|
+
Bundle output for module:
|
|
34
|
+
${result.text && result.text.length > 5e4 ? `${result.text.slice(0, 5e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
35
|
+
}
|
|
36
|
+
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" ? `
|
|
37
|
+
|
|
38
|
+
Bundle output for module:
|
|
39
|
+
${result.text && result.text.length > 5e4 ? `${result.text.slice(0, 5e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
40
|
+
}
|
|
41
|
+
return resolved;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Compiles a type definition to a module and returns the specified export from the module.
|
|
45
|
+
*
|
|
46
|
+
* @param context - The context object containing the environment paths.
|
|
47
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
48
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
49
|
+
* @returns A promise that resolves to the compiled module.
|
|
50
|
+
*/
|
|
51
|
+
async function resolve(context, input, options) {
|
|
52
|
+
const fileReference = (0, _stryke_convert_extract_file_reference.extractFileReference)(input);
|
|
53
|
+
if (!fileReference) throw new Error(`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.`);
|
|
54
|
+
const extension = (0, _stryke_path_find.findFileExtensionSafe)(fileReference.file);
|
|
55
|
+
if (extension.startsWith("json")) try {
|
|
56
|
+
const json = await context.fs.read(fileReference.file);
|
|
57
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(json)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid JSON.`);
|
|
58
|
+
return JSON.parse(json);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
throw new Error(`Failed to read or parse the JSON file at "${fileReference.file}". Please ensure the file exists and contains valid JSON. Error: ${error.message}`);
|
|
61
|
+
}
|
|
62
|
+
else if (extension === "yaml" || extension === "yml") try {
|
|
63
|
+
const yaml$1 = await context.fs.read(fileReference.file);
|
|
64
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(yaml$1)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid YAML.`);
|
|
65
|
+
return (0, yaml.parse)(yaml$1);
|
|
66
|
+
} catch (error) {
|
|
67
|
+
throw new Error(`Failed to read or parse the YAML file at "${fileReference.file}". Please ensure the file exists and contains valid YAML. Error: ${error.message}`);
|
|
68
|
+
}
|
|
69
|
+
else if (extension === "toml") try {
|
|
70
|
+
const toml = await context.fs.read(fileReference.file);
|
|
71
|
+
if (!(0, _stryke_type_checks_is_set_string.isSetString)(toml)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid TOML.`);
|
|
72
|
+
return (0, smol_toml.parse)(toml);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
throw new Error(`Failed to read or parse the TOML file at "${fileReference.file}". Please ensure the file exists and contains valid TOML. Error: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
const resolved = await resolveModule(context, fileReference, options);
|
|
77
|
+
let exportName = fileReference.export;
|
|
78
|
+
if (!exportName) exportName = "default";
|
|
79
|
+
const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
|
|
80
|
+
if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${fileReference.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${fileReference.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
|
|
81
|
+
return resolvedExport;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//#endregion
|
|
85
|
+
exports.resolve = resolve;
|
|
86
|
+
exports.resolveModule = resolveModule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BundleOptions } from "./schema-bundle.cjs";
|
|
2
|
+
import { UnresolvedContext } from "@powerlines/core";
|
|
3
|
+
import { FileReferenceInput } from "@stryke/types/configuration";
|
|
4
|
+
//#region src/schema-resolve.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Compiles a type definition to a module and returns the module.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The context object containing the environment paths.
|
|
9
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
10
|
+
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
11
|
+
* @returns A promise that resolves to the compiled module.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveModule<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, input: FileReferenceInput, overrides?: BundleOptions): Promise<TResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Compiles a type definition to a module and returns the specified export from the module.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The context object containing the environment paths.
|
|
18
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
19
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
20
|
+
* @returns A promise that resolves to the compiled module.
|
|
21
|
+
*/
|
|
22
|
+
declare function resolve<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, input: FileReferenceInput, options?: BundleOptions): Promise<TResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { resolve, resolveModule };
|
|
25
|
+
//# sourceMappingURL=schema-resolve.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-resolve.d.cts","names":[],"sources":["../src/schema-resolve.ts"],"mappings":";;;;;;;;;;;;iBAmCsB,cACpB,SACA,iBAAiB,oBAAoB,mBAErC,SAAS,UACT,OAAO,oBACP,YAAY,gBACX,QAAQ;;;;;;;;;iBA+EW,QACpB,SACA,iBAAiB,oBAAoB,mBAErC,SAAS,UACT,OAAO,oBACP,UAAU,gBACT,QAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BundleOptions } from "./schema-bundle.mjs";
|
|
2
|
+
import { UnresolvedContext } from "@powerlines/core";
|
|
3
|
+
import { FileReferenceInput } from "@stryke/types/configuration";
|
|
4
|
+
//#region src/schema-resolve.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Compiles a type definition to a module and returns the module.
|
|
7
|
+
*
|
|
8
|
+
* @param context - The context object containing the environment paths.
|
|
9
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
10
|
+
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
11
|
+
* @returns A promise that resolves to the compiled module.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveModule<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, input: FileReferenceInput, overrides?: BundleOptions): Promise<TResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Compiles a type definition to a module and returns the specified export from the module.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The context object containing the environment paths.
|
|
18
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
19
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
20
|
+
* @returns A promise that resolves to the compiled module.
|
|
21
|
+
*/
|
|
22
|
+
declare function resolve<TResult, TContext extends UnresolvedContext = UnresolvedContext>(context: TContext, input: FileReferenceInput, options?: BundleOptions): Promise<TResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { resolve, resolveModule };
|
|
25
|
+
//# sourceMappingURL=schema-resolve.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-resolve.d.mts","names":[],"sources":["../src/schema-resolve.ts"],"mappings":";;;;;;;;;;;;iBAmCsB,cACpB,SACA,iBAAiB,oBAAoB,mBAErC,SAAS,UACT,OAAO,oBACP,YAAY,gBACX,QAAQ;;;;;;;;;iBA+EW,QACpB,SACA,iBAAiB,oBAAoB,mBAErC,SAAS,UACT,OAAO,oBACP,UAAU,gBACT,QAAQ"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { bundle } from "./schema-bundle.mjs";
|
|
2
|
+
import { extractFileReference } from "@stryke/convert/extract-file-reference";
|
|
3
|
+
import { findFileDotExtension, findFileExtensionSafe } from "@stryke/path/find";
|
|
4
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
5
|
+
import { parse } from "smol-toml";
|
|
6
|
+
import { parse as parse$1 } from "yaml";
|
|
7
|
+
|
|
8
|
+
//#region src/schema-resolve.ts
|
|
9
|
+
/**
|
|
10
|
+
* Compiles a type definition to a module and returns the module.
|
|
11
|
+
*
|
|
12
|
+
* @param context - The context object containing the environment paths.
|
|
13
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
14
|
+
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
15
|
+
* @returns A promise that resolves to the compiled module.
|
|
16
|
+
*/
|
|
17
|
+
async function resolveModule(context, input, overrides) {
|
|
18
|
+
const fileReference = extractFileReference(input);
|
|
19
|
+
if (!fileReference) throw new Error(`Failed to extract a file reference from the provided input ${JSON.stringify(input)}. The input must be a string or an object with a "file" property that specifies the file path and optional export name.`);
|
|
20
|
+
const result = await bundle(context, fileReference.file, overrides);
|
|
21
|
+
let resolved;
|
|
22
|
+
try {
|
|
23
|
+
resolved = await context.resolver.evalModule(result.text, {
|
|
24
|
+
filename: result.path,
|
|
25
|
+
ext: findFileDotExtension(result.path)
|
|
26
|
+
});
|
|
27
|
+
} catch (error) {
|
|
28
|
+
if (isSetString(error.message) && new RegExp(`Cannot find module '${context.config.framework?.name || "powerlines"}:.*'`).test(error.message)) {
|
|
29
|
+
const moduleName = error.message.match(new RegExp(`Cannot find module '(${context.config.framework?.name || "powerlines"}:.*)'`))?.[1];
|
|
30
|
+
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" ? `
|
|
31
|
+
|
|
32
|
+
Bundle output for module:
|
|
33
|
+
${result.text && result.text.length > 5e4 ? `${result.text.slice(0, 5e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
34
|
+
}
|
|
35
|
+
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" ? `
|
|
36
|
+
|
|
37
|
+
Bundle output for module:
|
|
38
|
+
${result.text && result.text.length > 5e4 ? `${result.text.slice(0, 5e4)}\n... [truncated]` : result.text}` : ""}`);
|
|
39
|
+
}
|
|
40
|
+
return resolved;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Compiles a type definition to a module and returns the specified export from the module.
|
|
44
|
+
*
|
|
45
|
+
* @param context - The context object containing the environment paths.
|
|
46
|
+
* @param input - The type definition to compile. This can be either a string or a {@link FileReference} object.
|
|
47
|
+
* @param options - Optional overrides for the ESBuild configuration.
|
|
48
|
+
* @returns A promise that resolves to the compiled module.
|
|
49
|
+
*/
|
|
50
|
+
async function resolve(context, input, options) {
|
|
51
|
+
const fileReference = extractFileReference(input);
|
|
52
|
+
if (!fileReference) throw new Error(`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.`);
|
|
53
|
+
const extension = findFileExtensionSafe(fileReference.file);
|
|
54
|
+
if (extension.startsWith("json")) try {
|
|
55
|
+
const json = await context.fs.read(fileReference.file);
|
|
56
|
+
if (!isSetString(json)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid JSON.`);
|
|
57
|
+
return JSON.parse(json);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
throw new Error(`Failed to read or parse the JSON file at "${fileReference.file}". Please ensure the file exists and contains valid JSON. Error: ${error.message}`);
|
|
60
|
+
}
|
|
61
|
+
else if (extension === "yaml" || extension === "yml") try {
|
|
62
|
+
const yaml = await context.fs.read(fileReference.file);
|
|
63
|
+
if (!isSetString(yaml)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid YAML.`);
|
|
64
|
+
return parse$1(yaml);
|
|
65
|
+
} catch (error) {
|
|
66
|
+
throw new Error(`Failed to read or parse the YAML file at "${fileReference.file}". Please ensure the file exists and contains valid YAML. Error: ${error.message}`);
|
|
67
|
+
}
|
|
68
|
+
else if (extension === "toml") try {
|
|
69
|
+
const toml = await context.fs.read(fileReference.file);
|
|
70
|
+
if (!isSetString(toml)) throw new Error(`The file at "${fileReference.file}" could not be read as a string. Please ensure the file exists and contains valid TOML.`);
|
|
71
|
+
return parse(toml);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
throw new Error(`Failed to read or parse the TOML file at "${fileReference.file}". Please ensure the file exists and contains valid TOML. Error: ${error.message}`);
|
|
74
|
+
}
|
|
75
|
+
const resolved = await resolveModule(context, fileReference, options);
|
|
76
|
+
let exportName = fileReference.export;
|
|
77
|
+
if (!exportName) exportName = "default";
|
|
78
|
+
const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
|
|
79
|
+
if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${fileReference.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${fileReference.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
|
|
80
|
+
return resolvedExport;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { resolve, resolveModule };
|
|
85
|
+
//# sourceMappingURL=schema-resolve.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-resolve.mjs","names":["parseYaml","parseToml"],"sources":["../src/schema-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 { UnresolvedContext } from \"@powerlines/core\";\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 { FileReferenceInput } from \"@stryke/types/configuration\";\nimport { parse as parseToml } from \"smol-toml\";\nimport { parse as parseYaml } from \"yaml\";\nimport { bundle, BundleOptions } from \"./schema-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 > 50_000\n ? `${result.text.slice(0, 50_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${\n result.text && result.text.length > 50_000\n ? `${result.text.slice(0, 50_000)}\\n... [truncated]`\n : result.text\n}`\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"],"mappings":"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"}
|
package/dist/schema.cjs
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_schema_bundle = require('./schema-bundle.cjs');
|
|
3
|
+
const require_schema_resolve = require('./schema-resolve.cjs');
|
|
1
4
|
|
|
5
|
+
exports.bundle = require_schema_bundle.bundle;
|
|
6
|
+
exports.resolve = require_schema_resolve.resolve;
|
|
7
|
+
exports.resolveModule = require_schema_resolve.resolveModule;
|
|
8
|
+
var _power_plant_schema = require("@power-plant/schema");
|
|
9
|
+
Object.keys(_power_plant_schema).forEach(function (k) {
|
|
10
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return _power_plant_schema[k]; }
|
|
13
|
+
});
|
|
14
|
+
});
|
|
2
15
|
|
|
3
|
-
var
|
|
4
|
-
Object.keys(
|
|
16
|
+
var _power_plant_schema_codegen = require("@power-plant/schema/codegen");
|
|
17
|
+
Object.keys(_power_plant_schema_codegen).forEach(function (k) {
|
|
5
18
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
19
|
enumerable: true,
|
|
7
|
-
get: function () { return
|
|
20
|
+
get: function () { return _power_plant_schema_codegen[k]; }
|
|
8
21
|
});
|
|
9
22
|
});
|
package/dist/schema.d.cts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BundleOptions, bundle } from "./schema-bundle.cjs";
|
|
2
|
+
import { resolve, resolveModule } from "./schema-resolve.cjs";
|
|
3
|
+
export * from "@power-plant/schema";
|
|
4
|
+
export * from "@power-plant/schema/codegen";
|
|
5
|
+
export { BundleOptions, bundle, resolve, resolveModule };
|
package/dist/schema.d.mts
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { BundleOptions, bundle } from "./schema-bundle.mjs";
|
|
2
|
+
import { resolve, resolveModule } from "./schema-resolve.mjs";
|
|
3
|
+
export * from "@power-plant/schema";
|
|
4
|
+
export * from "@power-plant/schema/codegen";
|
|
5
|
+
export { BundleOptions, bundle, resolve, resolveModule };
|
package/dist/schema.mjs
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { bundle } from "./schema-bundle.mjs";
|
|
2
|
+
import { resolve, resolveModule } from "./schema-resolve.mjs";
|
|
2
3
|
|
|
3
|
-
export
|
|
4
|
+
export * from "@power-plant/schema"
|
|
5
|
+
|
|
6
|
+
export * from "@power-plant/schema/codegen"
|
|
7
|
+
|
|
8
|
+
export { bundle, resolve, resolveModule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "powerlines",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.146",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The \"framework framework\" that simplifies modern dev tool usage, generates virtual (or actual) code modules, and improves DX across the board.",
|
|
6
6
|
"keywords": [
|
|
@@ -140,6 +140,14 @@
|
|
|
140
140
|
"import": "./dist/schema.mjs",
|
|
141
141
|
"require": "./dist/schema.cjs"
|
|
142
142
|
},
|
|
143
|
+
"./schema-bundle": {
|
|
144
|
+
"import": "./dist/schema-bundle.mjs",
|
|
145
|
+
"require": "./dist/schema-bundle.cjs"
|
|
146
|
+
},
|
|
147
|
+
"./schema-resolve": {
|
|
148
|
+
"import": "./dist/schema-resolve.mjs",
|
|
149
|
+
"require": "./dist/schema-resolve.cjs"
|
|
150
|
+
},
|
|
143
151
|
"./storage": {
|
|
144
152
|
"import": "./dist/storage.mjs",
|
|
145
153
|
"require": "./dist/storage.cjs"
|
|
@@ -173,25 +181,31 @@
|
|
|
173
181
|
"files": ["dist", "bin", "files"],
|
|
174
182
|
"dependencies": {
|
|
175
183
|
"@babel/types": "^8.0.4",
|
|
176
|
-
"@
|
|
177
|
-
"@powerlines/
|
|
178
|
-
"@powerlines/
|
|
179
|
-
"@powerlines/unplugin": "^0.0.
|
|
184
|
+
"@power-plant/schema": "^0.0.22",
|
|
185
|
+
"@powerlines/core": "^0.48.67",
|
|
186
|
+
"@powerlines/engine": "^0.49.69",
|
|
187
|
+
"@powerlines/unplugin": "^0.0.115",
|
|
180
188
|
"@storm-software/config": "^1.138.46",
|
|
181
189
|
"@storm-software/config-tools": "^1.190.109",
|
|
182
190
|
"@stryke/convert": "^0.7.27",
|
|
183
191
|
"@stryke/env": "^0.20.114",
|
|
184
192
|
"@stryke/fs": "^0.33.97",
|
|
193
|
+
"@stryke/helpers": "^0.10.36",
|
|
194
|
+
"@stryke/path": "^0.29.23",
|
|
195
|
+
"@stryke/type-checks": "^0.6.29",
|
|
196
|
+
"@stryke/types": "^0.12.24",
|
|
185
197
|
"defu": "^6.1.7",
|
|
186
|
-
"
|
|
198
|
+
"esbuild": "^0.28.1",
|
|
199
|
+
"smol-toml": "^1.7.0",
|
|
200
|
+
"unplugin": "^3.3.0",
|
|
201
|
+
"yaml": "^2.9.0"
|
|
187
202
|
},
|
|
188
203
|
"devDependencies": {
|
|
189
204
|
"@storm-software/testing-tools": "^1.119.262",
|
|
190
|
-
"@stryke/types": "^0.12.24",
|
|
191
205
|
"@types/node": "^25.9.5",
|
|
192
206
|
"typescript": "^6.0.3",
|
|
193
207
|
"undici-types": "^7.28.0"
|
|
194
208
|
},
|
|
195
209
|
"publishConfig": { "access": "public" },
|
|
196
|
-
"gitHead": "
|
|
210
|
+
"gitHead": "e86d6fab3bd4d2e2f9f6d05df8df7a07d399857e"
|
|
197
211
|
}
|