@powerlines/plugin-env 0.15.2 → 0.15.4
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/components/docs.cjs +3 -70
- package/dist/components/docs.d.cts +1 -8
- package/dist/components/docs.d.mts +1 -8
- package/dist/components/docs.mjs +2 -68
- package/dist/components/env.cjs +4 -574
- package/dist/components/env.d.cts +2 -19
- package/dist/components/env.d.mts +3 -19
- package/dist/components/env.mjs +2 -570
- package/dist/components/index.cjs +7 -5
- package/dist/components/index.d.cts +4 -2
- package/dist/components/index.d.mts +5 -2
- package/dist/components/index.mjs +4 -2
- package/dist/{plugin-alloy/src/types/components.d.cts → components-8W0Zgj0y.d.mts} +2 -1
- package/dist/components-C9bYrQVK.cjs +0 -0
- package/dist/components-CNIQFfeK.mjs +1 -0
- package/dist/create-reflection-resource-BNYxBgW2.mjs +9846 -0
- package/dist/create-reflection-resource-BWYhmX7O.cjs +10085 -0
- package/dist/docs-5r844zC1.d.mts +9 -0
- package/dist/docs-B66b9li3.mjs +219 -0
- package/dist/docs-_MmTNBQX.d.cts +9 -0
- package/dist/docs-hBlKCRWK.cjs +224 -0
- package/dist/env-BPodCdD1.d.cts +116 -0
- package/dist/env-IQvgnabX.mjs +1578 -0
- package/dist/env-cO4BUDn1.cjs +1596 -0
- package/dist/env-zhzvpUI5.d.mts +98 -0
- package/dist/index-BXxhKmeA.d.mts +1 -0
- package/dist/index-Cc7fCJU9.d.mts +1 -0
- package/dist/index-CqdNToYT.d.cts +1 -0
- package/dist/index-DWPDThxu.d.cts +1 -0
- package/dist/index.cjs +702 -77
- package/dist/index.d.cts +185 -12
- package/dist/index.d.mts +190 -17
- package/dist/index.mjs +648 -28
- package/dist/{deepkit/schemas/reflection.d.mts → plugin-BaInAuAh.d.mts} +326 -59
- package/dist/{deepkit/schemas/reflection.d.cts → plugin-BwuEBScL.d.cts} +268 -1
- package/dist/plugin-D3B5E_Hg.mjs +1 -0
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/resolved-BZG2cwRG.d.cts +1789 -0
- package/dist/resolved-V5COsfDu.d.mts +1791 -0
- package/dist/runtime-Bisl_1Ja.cjs +0 -0
- package/dist/runtime-Q8Ni8SeN.d.cts +794 -0
- package/dist/runtime-azNoeKr-.mjs +1 -0
- package/dist/runtime-qZ0Z2kEd.d.mts +794 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +4 -2
- package/dist/types/index.d.mts +5 -2
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +3 -156
- package/dist/types/plugin.d.mts +4 -158
- package/dist/types/plugin.mjs +2 -0
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts +2 -793
- package/dist/types/runtime.d.mts +2 -793
- package/dist/types/runtime.mjs +2 -0
- package/dist/types-DwElXV6q.mjs +1 -0
- package/dist/types-MYBaygjr.cjs +0 -0
- package/package.json +7 -7
- package/dist/_virtual/rolldown_runtime.cjs +0 -37
- package/dist/_virtual/rolldown_runtime.mjs +0 -29
- package/dist/babel/index.cjs +0 -1
- package/dist/babel/index.d.mts +0 -1
- package/dist/babel/index.mjs +0 -3
- package/dist/babel/plugin.cjs +0 -121
- package/dist/babel/plugin.d.cts +0 -7
- package/dist/babel/plugin.d.mts +0 -9
- package/dist/babel/plugin.mjs +0 -119
- package/dist/deepkit/schemas/reflection.cjs +0 -3940
- package/dist/deepkit/schemas/reflection.mjs +0 -3938
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -913
- package/dist/deepkit/src/capnp.mjs +0 -911
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
- package/dist/deepkit/src/reflect-type.cjs +0 -22
- package/dist/deepkit/src/reflect-type.mjs +0 -20
- package/dist/deepkit/src/resolve-reflections.cjs +0 -16
- package/dist/deepkit/src/resolve-reflections.mjs +0 -15
- package/dist/deepkit/src/transformer.cjs +0 -52
- package/dist/deepkit/src/transformer.mjs +0 -49
- package/dist/deepkit/src/transpile.cjs +0 -29
- package/dist/deepkit/src/transpile.mjs +0 -27
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/utilities.cjs +0 -66
- package/dist/deepkit/src/utilities.mjs +0 -65
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
- package/dist/deepkit/src/vendor/type.cjs +0 -20
- package/dist/deepkit/src/vendor/type.d.cts +0 -7
- package/dist/deepkit/src/vendor/type.d.mts +0 -7
- package/dist/deepkit/src/vendor/type.mjs +0 -11
- package/dist/helpers/automd-generator.cjs +0 -22
- package/dist/helpers/automd-generator.mjs +0 -21
- package/dist/helpers/create-reflection-resource.cjs +0 -55
- package/dist/helpers/create-reflection-resource.d.cts +0 -15
- package/dist/helpers/create-reflection-resource.d.mts +0 -15
- package/dist/helpers/create-reflection-resource.mjs +0 -54
- package/dist/helpers/index.cjs +0 -6
- package/dist/helpers/index.d.mts +0 -6
- package/dist/helpers/index.mjs +0 -8
- package/dist/helpers/load.cjs +0 -83
- package/dist/helpers/load.d.cts +0 -35
- package/dist/helpers/load.d.mts +0 -36
- package/dist/helpers/load.mjs +0 -80
- package/dist/helpers/persistence.cjs +0 -214
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.mjs +0 -202
- package/dist/helpers/reflect.cjs +0 -111
- package/dist/helpers/reflect.d.cts +0 -46
- package/dist/helpers/reflect.d.mts +0 -46
- package/dist/helpers/reflect.mjs +0 -103
- package/dist/helpers/source-file-env.cjs +0 -28
- package/dist/helpers/source-file-env.d.cts +0 -8
- package/dist/helpers/source-file-env.d.mts +0 -8
- package/dist/helpers/source-file-env.mjs +0 -26
- package/dist/helpers/template-helpers.cjs +0 -42
- package/dist/helpers/template-helpers.d.cts +0 -15
- package/dist/helpers/template-helpers.d.mts +0 -15
- package/dist/helpers/template-helpers.mjs +0 -41
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -45
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -44
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -22
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -21
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -64
- package/dist/plugin-alloy/src/core/components/source-file.d.cts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.d.mts +0 -23
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -62
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
- package/dist/plugin-alloy/src/index.cjs +0 -93
- package/dist/plugin-alloy/src/index.mjs +0 -91
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -115
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -114
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -39
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -38
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -18
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
- package/dist/plugin-alloy/src/types/components.d.mts +0 -25
- package/dist/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
- package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -57
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.cts +0 -25
- package/dist/plugin-alloy/src/typescript/components/builtin-file.d.mts +0 -26
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -56
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -126
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -442
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.cts +0 -27
- package/dist/plugin-alloy/src/typescript/components/tsdoc.d.mts +0 -28
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -433
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -194
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.cts +0 -14
- package/dist/plugin-alloy/src/typescript/components/typescript-file.d.mts +0 -15
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -191
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -68
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.cts +0 -11
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.d.mts +0 -12
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -67
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -124
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -123
- package/dist/plugin-automd/src/index.cjs +0 -101
- package/dist/plugin-automd/src/index.mjs +0 -98
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
- package/dist/plugin-babel/src/helpers/options.cjs +0 -50
- package/dist/plugin-babel/src/helpers/options.mjs +0 -47
- package/dist/plugin-babel/src/index.cjs +0 -91
- package/dist/plugin-babel/src/index.mjs +0 -89
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/powerlines/schemas/fs.d.mts +0 -1
- package/dist/powerlines/src/api.d.mts +0 -7
- package/dist/powerlines/src/index.d.mts +0 -12
- package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
- package/dist/powerlines/src/lib/entry.cjs +0 -12
- package/dist/powerlines/src/lib/entry.mjs +0 -14
- package/dist/powerlines/src/lib/logger.cjs +0 -41
- package/dist/powerlines/src/lib/logger.mjs +0 -39
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
- package/dist/powerlines/src/types/api.d.mts +0 -5
- package/dist/powerlines/src/types/babel.d.cts +0 -23
- package/dist/powerlines/src/types/babel.d.mts +0 -23
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -380
- package/dist/powerlines/src/types/config.d.mts +0 -381
- package/dist/powerlines/src/types/context.d.cts +0 -414
- package/dist/powerlines/src/types/context.d.mts +0 -416
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/index.d.mts +0 -12
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -82
- package/dist/powerlines/src/types/resolved.d.mts +0 -83
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
- package/dist/powerlines/src/types/unplugin.d.mts +0 -7
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { getPluginName } from "./filters.mjs";
|
|
2
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
|
-
import { isFunction } from "@stryke/type-checks/is-function";
|
|
4
|
-
import chalk from "chalk";
|
|
5
|
-
|
|
6
|
-
//#region ../plugin-babel/src/helpers/options.ts
|
|
7
|
-
function resolvePluginFunction(context, plugin) {
|
|
8
|
-
try {
|
|
9
|
-
return Array.isArray(plugin) && plugin.length > 0 && plugin[0] ? isFunction(plugin[0]) ? plugin[0](context) : plugin[0] : isFunction(plugin) ? plugin(context) : plugin;
|
|
10
|
-
} catch {
|
|
11
|
-
return plugin[0];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Resolve the [Babel](https://babeljs.io/) plugin.
|
|
16
|
-
*
|
|
17
|
-
* @param context - The context for the transformation.
|
|
18
|
-
* @param code - The code to be transformed.
|
|
19
|
-
* @param id - The ID of the source file.
|
|
20
|
-
* @param plugin - The Babel plugin to resolve.
|
|
21
|
-
* @returns The resolved Babel plugin options, or undefined if the plugin is filtered out.
|
|
22
|
-
*/
|
|
23
|
-
function resolveBabelPlugin(context, code, id, plugin) {
|
|
24
|
-
if (Array.isArray(plugin) && plugin.length > 0 && plugin[0]) {
|
|
25
|
-
if (plugin.length > 2 && plugin[2] && isFunction(plugin[2]) && !plugin[2](code, id)) {
|
|
26
|
-
context.log(LogLevelLabel.TRACE, `Skipping filtered Babel plugin ${chalk.bold.cyanBright(getPluginName(plugin) || "unnamed")} for ${id}`);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
return plugin.length > 2 ? [
|
|
30
|
-
resolvePluginFunction(context, plugin),
|
|
31
|
-
plugin[1],
|
|
32
|
-
plugin[2]
|
|
33
|
-
] : [
|
|
34
|
-
resolvePluginFunction(context, plugin),
|
|
35
|
-
plugin[1],
|
|
36
|
-
null
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
return [
|
|
40
|
-
resolvePluginFunction(context, plugin),
|
|
41
|
-
{},
|
|
42
|
-
null
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { resolveBabelPlugin, resolvePluginFunction };
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_filters = require('./helpers/filters.cjs');
|
|
3
|
-
const require_options = require('./helpers/options.cjs');
|
|
4
|
-
const require_create_plugin = require('./helpers/create-plugin.cjs');
|
|
5
|
-
const require_module_helpers = require('./helpers/module-helpers.cjs');
|
|
6
|
-
require('./helpers/index.cjs');
|
|
7
|
-
let defu = require("defu");
|
|
8
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
9
|
-
let __babel_core = require("@babel/core");
|
|
10
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
11
|
-
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
12
|
-
let __stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
13
|
-
let __stryke_type_checks_is_set_object = require("@stryke/type-checks/is-set-object");
|
|
14
|
-
|
|
15
|
-
//#region ../plugin-babel/src/index.ts
|
|
16
|
-
/**
|
|
17
|
-
* Babel plugin for Powerlines.
|
|
18
|
-
*
|
|
19
|
-
* @param options - The Babel plugin user configuration options.
|
|
20
|
-
* @returns A Powerlines plugin that integrates Babel transformations.
|
|
21
|
-
*/
|
|
22
|
-
const plugin = (options = {}) => {
|
|
23
|
-
return {
|
|
24
|
-
name: "babel",
|
|
25
|
-
config() {
|
|
26
|
-
if (!(0, __stryke_type_checks_is_set_object.isSetObject)(options)) return;
|
|
27
|
-
return { transform: { babel: options } };
|
|
28
|
-
},
|
|
29
|
-
configResolved: {
|
|
30
|
-
order: "pre",
|
|
31
|
-
handler() {
|
|
32
|
-
this.devDependencies["@babel/core"] = "^7.28.4";
|
|
33
|
-
this.config.transform.babel = (0, defu.default)(this.config.transform.babel ?? {}, {
|
|
34
|
-
plugins: [],
|
|
35
|
-
presets: []
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
async transform(code, id) {
|
|
40
|
-
if ((0, __stryke_path_is_parent_path.isParentPath)(id, this.powerlinesPath) || code.includes("/* @storm-ignore */") || code.includes("/* @storm-disable */")) {
|
|
41
|
-
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Skipping Babel transformation for: ${id}`);
|
|
42
|
-
return {
|
|
43
|
-
code,
|
|
44
|
-
id
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
this.log(__storm_software_config_tools_types.LogLevelLabel.TRACE, `Babel transforming file: ${id}`);
|
|
48
|
-
const plugins = this.config.transform.babel.plugins.map((plugin$1) => require_options.resolveBabelPlugin(this, code, id, plugin$1)).filter((plugin$1, _, arr) => plugin$1 && !require_filters.isDuplicatePlugin(arr, plugin$1));
|
|
49
|
-
const presets = this.config.transform.babel.presets.map((preset) => require_options.resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !require_filters.isDuplicatePlugin(arr, preset));
|
|
50
|
-
if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
|
|
51
|
-
code,
|
|
52
|
-
id
|
|
53
|
-
};
|
|
54
|
-
if ([
|
|
55
|
-
"ts",
|
|
56
|
-
"cts",
|
|
57
|
-
"mts",
|
|
58
|
-
"tsx"
|
|
59
|
-
].includes((0, __stryke_path_file_path_fns.findFileExtensionSafe)(id)) && !require_filters.isDuplicatePlugin(plugins, "@babel/plugin-syntax-typescript") && !require_filters.isDuplicatePlugin(presets, "@babel/preset-typescript")) plugins.unshift(["@babel/plugin-syntax-typescript", { isTSX: (0, __stryke_path_file_path_fns.findFileExtension)(id) === ".tsx" }]);
|
|
60
|
-
const result = await (0, __babel_core.transformAsync)(code, {
|
|
61
|
-
highlightCode: true,
|
|
62
|
-
code: true,
|
|
63
|
-
ast: false,
|
|
64
|
-
cloneInputAst: false,
|
|
65
|
-
comments: true,
|
|
66
|
-
sourceType: "module",
|
|
67
|
-
configFile: false,
|
|
68
|
-
babelrc: false,
|
|
69
|
-
envName: this.config.mode,
|
|
70
|
-
caller: { name: this.config.framework },
|
|
71
|
-
...this.config.transform.babel ?? {},
|
|
72
|
-
filename: id,
|
|
73
|
-
plugins: plugins.map((plugin$1) => {
|
|
74
|
-
return Array.isArray(plugin$1) && plugin$1.length >= 2 ? [plugin$1[0], (0, defu.default)(plugin$1.length > 1 && plugin$1[1] ? plugin$1[1] : {}, { options })] : plugin$1;
|
|
75
|
-
}).filter(Boolean),
|
|
76
|
-
presets: presets.map((preset) => {
|
|
77
|
-
return Array.isArray(preset) && preset.length >= 2 ? [preset[0], (0, defu.default)(preset.length > 1 && preset[1] ? preset[1] : {}, { options })] : preset;
|
|
78
|
-
}).filter(Boolean)
|
|
79
|
-
});
|
|
80
|
-
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
81
|
-
return {
|
|
82
|
-
code: result.code,
|
|
83
|
-
id
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
var src_default = plugin;
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
exports.default = src_default;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { getPluginName, isDuplicatePlugin } from "./helpers/filters.mjs";
|
|
2
|
-
import { resolveBabelPlugin, resolvePluginFunction } from "./helpers/options.mjs";
|
|
3
|
-
import { createBabelPlugin } from "./helpers/create-plugin.mjs";
|
|
4
|
-
import { addImport, addImportsToProgram } from "./helpers/module-helpers.mjs";
|
|
5
|
-
import "./helpers/index.mjs";
|
|
6
|
-
import defu from "defu";
|
|
7
|
-
import { transformAsync } from "@babel/core";
|
|
8
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
9
|
-
import { findFileExtension, findFileExtensionSafe } from "@stryke/path/file-path-fns";
|
|
10
|
-
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
11
|
-
import { isSetObject } from "@stryke/type-checks/is-set-object";
|
|
12
|
-
|
|
13
|
-
//#region ../plugin-babel/src/index.ts
|
|
14
|
-
/**
|
|
15
|
-
* Babel plugin for Powerlines.
|
|
16
|
-
*
|
|
17
|
-
* @param options - The Babel plugin user configuration options.
|
|
18
|
-
* @returns A Powerlines plugin that integrates Babel transformations.
|
|
19
|
-
*/
|
|
20
|
-
const plugin = (options = {}) => {
|
|
21
|
-
return {
|
|
22
|
-
name: "babel",
|
|
23
|
-
config() {
|
|
24
|
-
if (!isSetObject(options)) return;
|
|
25
|
-
return { transform: { babel: options } };
|
|
26
|
-
},
|
|
27
|
-
configResolved: {
|
|
28
|
-
order: "pre",
|
|
29
|
-
handler() {
|
|
30
|
-
this.devDependencies["@babel/core"] = "^7.28.4";
|
|
31
|
-
this.config.transform.babel = defu(this.config.transform.babel ?? {}, {
|
|
32
|
-
plugins: [],
|
|
33
|
-
presets: []
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
async transform(code, id) {
|
|
38
|
-
if (isParentPath(id, this.powerlinesPath) || code.includes("/* @storm-ignore */") || code.includes("/* @storm-disable */")) {
|
|
39
|
-
this.log(LogLevelLabel.TRACE, `Skipping Babel transformation for: ${id}`);
|
|
40
|
-
return {
|
|
41
|
-
code,
|
|
42
|
-
id
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
this.log(LogLevelLabel.TRACE, `Babel transforming file: ${id}`);
|
|
46
|
-
const plugins = this.config.transform.babel.plugins.map((plugin$1) => resolveBabelPlugin(this, code, id, plugin$1)).filter((plugin$1, _, arr) => plugin$1 && !isDuplicatePlugin(arr, plugin$1));
|
|
47
|
-
const presets = this.config.transform.babel.presets.map((preset) => resolveBabelPlugin(this, code, id, preset)).filter((preset, _, arr) => preset && !isDuplicatePlugin(arr, preset));
|
|
48
|
-
if (Array.isArray(plugins) && plugins.length === 0 && Array.isArray(presets) && presets.length === 0) return {
|
|
49
|
-
code,
|
|
50
|
-
id
|
|
51
|
-
};
|
|
52
|
-
if ([
|
|
53
|
-
"ts",
|
|
54
|
-
"cts",
|
|
55
|
-
"mts",
|
|
56
|
-
"tsx"
|
|
57
|
-
].includes(findFileExtensionSafe(id)) && !isDuplicatePlugin(plugins, "@babel/plugin-syntax-typescript") && !isDuplicatePlugin(presets, "@babel/preset-typescript")) plugins.unshift(["@babel/plugin-syntax-typescript", { isTSX: findFileExtension(id) === ".tsx" }]);
|
|
58
|
-
const result = await transformAsync(code, {
|
|
59
|
-
highlightCode: true,
|
|
60
|
-
code: true,
|
|
61
|
-
ast: false,
|
|
62
|
-
cloneInputAst: false,
|
|
63
|
-
comments: true,
|
|
64
|
-
sourceType: "module",
|
|
65
|
-
configFile: false,
|
|
66
|
-
babelrc: false,
|
|
67
|
-
envName: this.config.mode,
|
|
68
|
-
caller: { name: this.config.framework },
|
|
69
|
-
...this.config.transform.babel ?? {},
|
|
70
|
-
filename: id,
|
|
71
|
-
plugins: plugins.map((plugin$1) => {
|
|
72
|
-
return Array.isArray(plugin$1) && plugin$1.length >= 2 ? [plugin$1[0], defu(plugin$1.length > 1 && plugin$1[1] ? plugin$1[1] : {}, { options })] : plugin$1;
|
|
73
|
-
}).filter(Boolean),
|
|
74
|
-
presets: presets.map((preset) => {
|
|
75
|
-
return Array.isArray(preset) && preset.length >= 2 ? [preset[0], defu(preset.length > 1 && preset[1] ? preset[1] : {}, { options })] : preset;
|
|
76
|
-
}).filter(Boolean)
|
|
77
|
-
});
|
|
78
|
-
if (!result?.code) throw new Error(`Powerlines - Babel plugin failed to compile ${id}`);
|
|
79
|
-
return {
|
|
80
|
-
code: result.code,
|
|
81
|
-
id
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
var src_default = plugin;
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
89
|
-
export { src_default as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "./plugin.mjs";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PluginContext } from "../../../powerlines/src/types/context.cjs";
|
|
2
|
-
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.cjs";
|
|
3
|
-
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
|
|
4
|
-
|
|
5
|
-
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
|
-
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
-
type BabelPluginUserConfig = UserConfig;
|
|
8
|
-
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
-
transform: {
|
|
10
|
-
babel: BabelResolvedConfig;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PluginContext } from "../../../powerlines/src/types/context.mjs";
|
|
2
|
-
import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.mjs";
|
|
3
|
-
import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
|
|
4
|
-
|
|
5
|
-
//#region ../plugin-babel/src/types/plugin.d.ts
|
|
6
|
-
type BabelPluginOptions = Partial<BabelUserConfig>;
|
|
7
|
-
type BabelPluginUserConfig = UserConfig;
|
|
8
|
-
interface BabelPluginResolvedConfig extends ResolvedConfig {
|
|
9
|
-
transform: {
|
|
10
|
-
babel: BabelResolvedConfig;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "@stryke/capnp";
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./types/fs.mjs";
|
|
2
|
-
import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./types/build.mjs";
|
|
3
|
-
import { CommandType, SUPPORTED_COMMANDS } from "./types/commands.mjs";
|
|
4
|
-
import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./types/plugin.mjs";
|
|
5
|
-
import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./types/tsconfig.mjs";
|
|
6
|
-
import { BuildPluginContext, Context, EmitEntryOptions, EmitOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./types/context.mjs";
|
|
7
|
-
import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./types/babel.mjs";
|
|
8
|
-
import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./types/config.mjs";
|
|
9
|
-
import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./types/resolved.mjs";
|
|
10
|
-
import "./types/index.mjs";
|
|
11
|
-
import "./api.mjs";
|
|
12
|
-
import "../schemas/fs.mjs";
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
require('../entry.cjs');
|
|
3
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
4
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
5
|
-
let defu = require("defu");
|
|
6
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
7
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
8
|
-
let __stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
9
|
-
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
10
|
-
|
|
11
|
-
//#region ../powerlines/src/lib/build/esbuild.ts
|
|
12
|
-
const DEFAULT_ESBUILD_CONFIG = {
|
|
13
|
-
target: "esnext",
|
|
14
|
-
platform: "neutral",
|
|
15
|
-
format: "esm",
|
|
16
|
-
write: true,
|
|
17
|
-
minify: true,
|
|
18
|
-
sourcemap: false,
|
|
19
|
-
bundle: true,
|
|
20
|
-
treeShaking: true,
|
|
21
|
-
keepNames: true,
|
|
22
|
-
splitting: true,
|
|
23
|
-
logLevel: "silent"
|
|
24
|
-
};
|
|
25
|
-
/**
|
|
26
|
-
* Resolves the esbuild options.
|
|
27
|
-
*
|
|
28
|
-
* @param context - The build context.
|
|
29
|
-
* @returns The resolved esbuild options.
|
|
30
|
-
*/
|
|
31
|
-
function extractESBuildConfig(context) {
|
|
32
|
-
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
33
|
-
if (inject && Object.keys(inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
|
|
34
|
-
if (value) if (Array.isArray(value)) {
|
|
35
|
-
if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
|
|
36
|
-
if (value.length === 1) return `
|
|
37
|
-
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
38
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
39
|
-
else if (value.length > 1) return `
|
|
40
|
-
import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
|
|
41
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
42
|
-
} else if (value.length === 1) return `
|
|
43
|
-
import ${key} from "${value[0]}";
|
|
44
|
-
export { ${key} };`;
|
|
45
|
-
else if (value.length > 1) return `
|
|
46
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
47
|
-
export { ${key} };`;
|
|
48
|
-
} else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
|
|
49
|
-
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
50
|
-
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
51
|
-
else return `
|
|
52
|
-
import ${key} from "${value}";
|
|
53
|
-
export { ${key} };`;
|
|
54
|
-
return "";
|
|
55
|
-
}).join("\n"));
|
|
56
|
-
return (0, defu.default)({
|
|
57
|
-
alias: context.builtins.reduce((ret, id) => {
|
|
58
|
-
if (!ret[id]) {
|
|
59
|
-
const path = context.fs.ids[id];
|
|
60
|
-
if (path) ret[id] = path;
|
|
61
|
-
}
|
|
62
|
-
return ret;
|
|
63
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
64
|
-
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
65
|
-
return ret;
|
|
66
|
-
}, {}) : context.config.build.alias : {}),
|
|
67
|
-
inject: inject && Object.keys(inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
68
|
-
}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build.override, [
|
|
69
|
-
"alias",
|
|
70
|
-
"inject",
|
|
71
|
-
"external",
|
|
72
|
-
"noExternal",
|
|
73
|
-
"skipNodeModulesBundle",
|
|
74
|
-
"extensions"
|
|
75
|
-
]) : {}, context.config.build.variant === "esbuild" ? (0, __stryke_helpers_omit.omit)(context.config.build, [
|
|
76
|
-
"alias",
|
|
77
|
-
"inject",
|
|
78
|
-
"external",
|
|
79
|
-
"noExternal",
|
|
80
|
-
"skipNodeModulesBundle",
|
|
81
|
-
"extensions",
|
|
82
|
-
"variant",
|
|
83
|
-
"override"
|
|
84
|
-
]) : {}, {
|
|
85
|
-
mainFields: context.config.build.mainFields,
|
|
86
|
-
conditions: context.config.build.conditions,
|
|
87
|
-
define: context.config.build.define,
|
|
88
|
-
resolveExtensions: context.config.build.extensions,
|
|
89
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
90
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
91
|
-
platform: context.config.build.platform,
|
|
92
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
93
|
-
outdir: context.config.output.buildPath,
|
|
94
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
95
|
-
minify: context.config.mode !== "development",
|
|
96
|
-
metafile: context.config.mode === "development",
|
|
97
|
-
sourcemap: context.config.mode === "development"
|
|
98
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
exports.extractESBuildConfig = extractESBuildConfig;
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import "../entry.mjs";
|
|
2
|
-
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
3
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import defu from "defu";
|
|
5
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
6
|
-
import { omit } from "@stryke/helpers/omit";
|
|
7
|
-
import { camelCase } from "@stryke/string-format/camel-case";
|
|
8
|
-
|
|
9
|
-
//#region ../powerlines/src/lib/build/esbuild.ts
|
|
10
|
-
const DEFAULT_ESBUILD_CONFIG = {
|
|
11
|
-
target: "esnext",
|
|
12
|
-
platform: "neutral",
|
|
13
|
-
format: "esm",
|
|
14
|
-
write: true,
|
|
15
|
-
minify: true,
|
|
16
|
-
sourcemap: false,
|
|
17
|
-
bundle: true,
|
|
18
|
-
treeShaking: true,
|
|
19
|
-
keepNames: true,
|
|
20
|
-
splitting: true,
|
|
21
|
-
logLevel: "silent"
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Resolves the esbuild options.
|
|
25
|
-
*
|
|
26
|
-
* @param context - The build context.
|
|
27
|
-
* @returns The resolved esbuild options.
|
|
28
|
-
*/
|
|
29
|
-
function extractESBuildConfig(context) {
|
|
30
|
-
const inject = context.config.build.override.inject ?? context.config.build.inject;
|
|
31
|
-
if (inject && Object.keys(inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
|
|
32
|
-
if (value) if (Array.isArray(value)) {
|
|
33
|
-
if (camelCase(key) !== key) {
|
|
34
|
-
if (value.length === 1) return `
|
|
35
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
36
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
37
|
-
else if (value.length > 1) return `
|
|
38
|
-
import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
|
|
39
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
40
|
-
} else if (value.length === 1) return `
|
|
41
|
-
import ${key} from "${value[0]}";
|
|
42
|
-
export { ${key} };`;
|
|
43
|
-
else if (value.length > 1) return `
|
|
44
|
-
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
45
|
-
export { ${key} };`;
|
|
46
|
-
} else if (camelCase(key) !== key) return `
|
|
47
|
-
import ${camelCase(key)} from "${value[0]}";
|
|
48
|
-
export { ${camelCase(key)} as "${key}" }`;
|
|
49
|
-
else return `
|
|
50
|
-
import ${key} from "${value}";
|
|
51
|
-
export { ${key} };`;
|
|
52
|
-
return "";
|
|
53
|
-
}).join("\n"));
|
|
54
|
-
return defu({
|
|
55
|
-
alias: context.builtins.reduce((ret, id) => {
|
|
56
|
-
if (!ret[id]) {
|
|
57
|
-
const path = context.fs.ids[id];
|
|
58
|
-
if (path) ret[id] = path;
|
|
59
|
-
}
|
|
60
|
-
return ret;
|
|
61
|
-
}, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
|
|
62
|
-
if (!ret[alias.find.toString()]) ret[alias.find.toString()] = alias.replacement;
|
|
63
|
-
return ret;
|
|
64
|
-
}, {}) : context.config.build.alias : {}),
|
|
65
|
-
inject: inject && Object.keys(inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")] : void 0
|
|
66
|
-
}, context.config.build.variant === "esbuild" ? omit(context.config.build.override, [
|
|
67
|
-
"alias",
|
|
68
|
-
"inject",
|
|
69
|
-
"external",
|
|
70
|
-
"noExternal",
|
|
71
|
-
"skipNodeModulesBundle",
|
|
72
|
-
"extensions"
|
|
73
|
-
]) : {}, context.config.build.variant === "esbuild" ? omit(context.config.build, [
|
|
74
|
-
"alias",
|
|
75
|
-
"inject",
|
|
76
|
-
"external",
|
|
77
|
-
"noExternal",
|
|
78
|
-
"skipNodeModulesBundle",
|
|
79
|
-
"extensions",
|
|
80
|
-
"variant",
|
|
81
|
-
"override"
|
|
82
|
-
]) : {}, {
|
|
83
|
-
mainFields: context.config.build.mainFields,
|
|
84
|
-
conditions: context.config.build.conditions,
|
|
85
|
-
define: context.config.build.define,
|
|
86
|
-
resolveExtensions: context.config.build.extensions,
|
|
87
|
-
packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
|
|
88
|
-
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
89
|
-
platform: context.config.build.platform,
|
|
90
|
-
treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
|
|
91
|
-
outdir: context.config.output.buildPath,
|
|
92
|
-
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
93
|
-
minify: context.config.mode !== "development",
|
|
94
|
-
metafile: context.config.mode === "development",
|
|
95
|
-
sourcemap: context.config.mode === "development"
|
|
96
|
-
}, DEFAULT_ESBUILD_CONFIG);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
export { extractESBuildConfig };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
require('../plugin-utils/paths.cjs');
|
|
2
|
-
let __stryke_path_replace = require("@stryke/path/replace");
|
|
3
|
-
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
4
|
-
let __stryke_fs_is_file = require("@stryke/fs/is-file");
|
|
5
|
-
let __stryke_fs_list_files = require("@stryke/fs/list-files");
|
|
6
|
-
let __stryke_path_append = require("@stryke/path/append");
|
|
7
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
8
|
-
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
9
|
-
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
10
|
-
let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
|
|
11
|
-
let __stryke_helpers_get_unique = require("@stryke/helpers/get-unique");
|
|
12
|
-
require("@stryke/hash/murmurhash");
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "../plugin-utils/paths.mjs";
|
|
2
|
-
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
3
|
-
import { toArray } from "@stryke/convert/to-array";
|
|
4
|
-
import "@stryke/fs/is-file";
|
|
5
|
-
import { listFiles } from "@stryke/fs/list-files";
|
|
6
|
-
import { appendPath } from "@stryke/path/append";
|
|
7
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
8
|
-
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
9
|
-
import { isString } from "@stryke/type-checks/is-string";
|
|
10
|
-
import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
|
|
11
|
-
import { getUniqueBy } from "@stryke/helpers/get-unique";
|
|
12
|
-
import "@stryke/hash/murmurhash";
|
|
13
|
-
|
|
14
|
-
export { };
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
3
|
-
let chalk = require("chalk");
|
|
4
|
-
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
5
|
-
require("@storm-software/config-tools/logger");
|
|
6
|
-
require("@storm-software/config-tools/utilities/colors");
|
|
7
|
-
require("@stryke/helpers/noop");
|
|
8
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
9
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
10
|
-
|
|
11
|
-
//#region ../powerlines/src/lib/logger.ts
|
|
12
|
-
const BADGE_COLORS = [
|
|
13
|
-
"#00A0DD",
|
|
14
|
-
"#6FCE4E",
|
|
15
|
-
"#FBBF24",
|
|
16
|
-
"#F43F5E",
|
|
17
|
-
"#3B82F6",
|
|
18
|
-
"#A855F7",
|
|
19
|
-
"#469592",
|
|
20
|
-
"#288EDF",
|
|
21
|
-
"#D8B4FE",
|
|
22
|
-
"#10B981",
|
|
23
|
-
"#EF4444",
|
|
24
|
-
"#F0EC56",
|
|
25
|
-
"#F472B6",
|
|
26
|
-
"#22D3EE",
|
|
27
|
-
"#EAB308",
|
|
28
|
-
"#84CC16",
|
|
29
|
-
"#F87171",
|
|
30
|
-
"#0EA5E9",
|
|
31
|
-
"#D946EF",
|
|
32
|
-
"#FACC15",
|
|
33
|
-
"#34D399",
|
|
34
|
-
"#8B5CF6"
|
|
35
|
-
];
|
|
36
|
-
const extendLog = (logFn, name) => {
|
|
37
|
-
return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.extendLog = extendLog;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
2
|
-
import chalk from "chalk";
|
|
3
|
-
import "@storm-software/config-tools/logger";
|
|
4
|
-
import "@storm-software/config-tools/utilities/colors";
|
|
5
|
-
import "@stryke/helpers/noop";
|
|
6
|
-
import { kebabCase } from "@stryke/string-format/kebab-case";
|
|
7
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
8
|
-
|
|
9
|
-
//#region ../powerlines/src/lib/logger.ts
|
|
10
|
-
const BADGE_COLORS = [
|
|
11
|
-
"#00A0DD",
|
|
12
|
-
"#6FCE4E",
|
|
13
|
-
"#FBBF24",
|
|
14
|
-
"#F43F5E",
|
|
15
|
-
"#3B82F6",
|
|
16
|
-
"#A855F7",
|
|
17
|
-
"#469592",
|
|
18
|
-
"#288EDF",
|
|
19
|
-
"#D8B4FE",
|
|
20
|
-
"#10B981",
|
|
21
|
-
"#EF4444",
|
|
22
|
-
"#F0EC56",
|
|
23
|
-
"#F472B6",
|
|
24
|
-
"#22D3EE",
|
|
25
|
-
"#EAB308",
|
|
26
|
-
"#84CC16",
|
|
27
|
-
"#F87171",
|
|
28
|
-
"#0EA5E9",
|
|
29
|
-
"#D946EF",
|
|
30
|
-
"#FACC15",
|
|
31
|
-
"#34D399",
|
|
32
|
-
"#8B5CF6"
|
|
33
|
-
];
|
|
34
|
-
const extendLog = (logFn, name) => {
|
|
35
|
-
return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
export { extendLog };
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_esbuild = require('../build/esbuild.cjs');
|
|
3
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
|
-
let esbuild = require("esbuild");
|
|
5
|
-
|
|
6
|
-
//#region ../powerlines/src/lib/utilities/bundle.ts
|
|
7
|
-
/**
|
|
8
|
-
* Bundle a type definition to a module.
|
|
9
|
-
*
|
|
10
|
-
* @param context - The context object containing the environment paths.
|
|
11
|
-
* @param file - The file path to bundle.
|
|
12
|
-
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
13
|
-
* @returns A promise that resolves to the bundled module.
|
|
14
|
-
*/
|
|
15
|
-
async function bundle(context, file, overrides = {}) {
|
|
16
|
-
const path = await context.fs.resolve(file);
|
|
17
|
-
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
18
|
-
const result = await (0, esbuild.build)({
|
|
19
|
-
...require_esbuild.extractESBuildConfig(context),
|
|
20
|
-
entryPoints: [path],
|
|
21
|
-
write: false,
|
|
22
|
-
sourcemap: false,
|
|
23
|
-
splitting: false,
|
|
24
|
-
treeShaking: false,
|
|
25
|
-
bundle: true,
|
|
26
|
-
...overrides
|
|
27
|
-
});
|
|
28
|
-
if (result.errors.length > 0) throw new Error(`Failed to transpile ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
|
|
29
|
-
if (result.warnings.length > 0) context.log(__storm_software_config_tools_types.LogLevelLabel.WARN, `Warnings while transpiling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
|
|
30
|
-
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.`);
|
|
31
|
-
return result.outputFiles.filter(Boolean)[0];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
//#endregion
|
|
35
|
-
exports.bundle = bundle;
|