powerlines 0.23.10 → 0.24.0
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/{api-5H3zEedD.d.ts → api-C32Buv5_.d.ts} +1 -1
- package/dist/{api-B77aqxGC.d.cts → api-wzd5AREv.d.cts} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/api.d.cts +4 -2
- package/dist/api.d.ts +4 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.d.cts +3 -1
- package/dist/astro.d.ts +3 -1
- package/dist/astro.js +3 -3
- package/dist/chunk-2TWFBWKA.cjs +133 -0
- package/dist/{chunk-3W5CN3M3.js → chunk-7V3LWCLB.js} +1 -1
- package/dist/chunk-EXQM3KGH.js +130 -0
- package/dist/{chunk-4EIGDACJ.cjs → chunk-FGH3MZTQ.cjs} +523 -649
- package/dist/{chunk-SNHUEYEP.cjs → chunk-FPB2O7FD.cjs} +2 -2
- package/dist/{chunk-ZIWN73GA.js → chunk-H74SWU2C.js} +1 -1
- package/dist/{chunk-WBC2XOMT.cjs → chunk-HTGCHSLH.cjs} +2 -2
- package/dist/{chunk-PR3JGGAL.cjs → chunk-TIBYAWZZ.cjs} +2 -2
- package/dist/{chunk-SS5AXCGJ.js → chunk-ZEE73BCY.js} +1 -1
- package/dist/{chunk-MUNYXQYT.js → chunk-ZT2J55YE.js} +526 -649
- package/dist/config.d.cts +3 -1
- package/dist/config.d.ts +3 -1
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.d.cts +3 -1
- package/dist/esbuild.d.ts +3 -1
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.d.cts +3 -1
- package/dist/farm.d.ts +3 -1
- package/dist/farm.js +2 -2
- package/dist/index.cjs +11 -23
- package/dist/index.d.cts +6 -135
- package/dist/index.d.ts +6 -135
- package/dist/index.js +2 -2
- package/dist/lib/{api-Cm51oVbC.d.cts → api-BRMITKt-.d.cts} +1 -1
- package/dist/lib/{api-mja4jirh.d.ts → api-CDUN9en8.d.ts} +1 -1
- package/dist/lib/build/esbuild.d.cts +3 -1
- package/dist/lib/build/esbuild.d.ts +3 -1
- package/dist/lib/build/index.d.cts +5 -3
- package/dist/lib/build/index.d.ts +5 -3
- package/dist/lib/build/rolldown.d.cts +3 -1
- package/dist/lib/build/rolldown.d.ts +3 -1
- package/dist/lib/build/rollup.d.cts +3 -1
- package/dist/lib/build/rollup.d.ts +3 -1
- package/dist/lib/build/rspack.d.cts +3 -1
- package/dist/lib/build/rspack.d.ts +3 -1
- package/dist/lib/build/tsup.d.cts +3 -1
- package/dist/lib/build/tsup.d.ts +3 -1
- package/dist/lib/build/unbuild.d.cts +5 -3
- package/dist/lib/build/unbuild.d.ts +5 -3
- package/dist/lib/build/vite.d.cts +3 -1
- package/dist/lib/build/vite.d.ts +3 -1
- package/dist/lib/build/webpack.d.cts +3 -1
- package/dist/lib/build/webpack.d.ts +3 -1
- package/dist/lib/{chunk-52VDUP5J.js → chunk-6I5PL7H2.js} +5 -17
- package/dist/lib/{chunk-UPVFKXB7.cjs → chunk-6PPZCPME.cjs} +1 -2
- package/dist/lib/{chunk-HNOAMIRO.js → chunk-7CVPZOH4.js} +2 -2
- package/dist/lib/{chunk-SEWUUTNA.js → chunk-A2NFSQ5K.js} +1 -1
- package/dist/lib/{chunk-I6TJUFA6.cjs → chunk-AA6RBP44.cjs} +10 -10
- package/dist/lib/{chunk-VDPCG3RR.js → chunk-CGRHZJY5.js} +41 -82
- package/dist/lib/{chunk-OJ5XFCZN.js → chunk-DFW5FGEO.js} +1 -1
- package/dist/lib/{chunk-VL63QEPF.cjs → chunk-DUZJ7ZF2.cjs} +2 -2
- package/dist/lib/{chunk-EFYMNU53.cjs → chunk-EV357RFB.cjs} +5 -17
- package/dist/lib/{chunk-54XNJQTH.js → chunk-HAXL7QE7.js} +3 -3
- package/dist/lib/{chunk-XG4CC73V.js → chunk-KFWMKDJQ.js} +391 -589
- package/dist/lib/{chunk-RBSNQFLF.cjs → chunk-MS3CD2U6.cjs} +49 -91
- package/dist/lib/{chunk-QABAD5RE.cjs → chunk-RNHKEPFD.cjs} +387 -586
- package/dist/lib/{chunk-4EIXDLFP.cjs → chunk-SAS5EPBD.cjs} +7 -5
- package/dist/lib/{chunk-EUDKQWSB.js → chunk-VHLINWXG.js} +1 -2
- package/dist/lib/{chunk-VLOUSKRX.cjs → chunk-VMLQATMA.cjs} +4 -4
- package/dist/lib/{chunk-IBPA3VN5.cjs → chunk-WUYK74EH.cjs} +3 -3
- package/dist/lib/{chunk-RD5AUWXN.js → chunk-YQ3ODCHV.js} +7 -5
- package/dist/lib/{config-BnJpgcGr.d.cts → config-D8KrE7SZ.d.cts} +109 -35
- package/dist/lib/{config-7Q2dBjJE.d.ts → config-DBIFdRoq.d.ts} +109 -35
- package/dist/lib/config-file.d.cts +3 -1
- package/dist/lib/config-file.d.ts +3 -1
- package/dist/lib/contexts/api-context.cjs +5 -4
- package/dist/lib/contexts/api-context.d.cts +5 -3
- package/dist/lib/contexts/api-context.d.ts +5 -3
- package/dist/lib/contexts/api-context.js +4 -3
- package/dist/lib/contexts/context.cjs +3 -2
- package/dist/lib/contexts/context.d.cts +47 -4
- package/dist/lib/contexts/context.d.ts +47 -4
- package/dist/lib/contexts/context.js +2 -1
- package/dist/lib/contexts/environment-context.cjs +4 -3
- package/dist/lib/contexts/environment-context.d.cts +5 -3
- package/dist/lib/contexts/environment-context.d.ts +5 -3
- package/dist/lib/contexts/environment-context.js +3 -2
- package/dist/lib/contexts/index.cjs +7 -6
- package/dist/lib/contexts/index.d.cts +5 -3
- package/dist/lib/contexts/index.d.ts +5 -3
- package/dist/lib/contexts/index.js +4 -3
- package/dist/lib/contexts/plugin-context.d.cts +5 -3
- package/dist/lib/contexts/plugin-context.d.ts +5 -3
- package/dist/lib/entry.d.cts +3 -1
- package/dist/lib/entry.d.ts +3 -1
- package/dist/lib/index.cjs +39 -45
- package/dist/lib/index.d.cts +67 -48
- package/dist/lib/index.d.ts +67 -48
- package/dist/lib/index.js +12 -14
- package/dist/lib/{internal-BEygquYh.d.ts → internal-1qCyw7bA.d.ts} +2 -2
- package/dist/lib/{internal-BeR8fOB1.d.cts → internal-CaGANOWK.d.cts} +2 -2
- package/dist/lib/logger.d.cts +3 -1
- package/dist/lib/logger.d.ts +3 -1
- package/dist/lib/typescript/compiler-host.cjs +7 -7
- package/dist/lib/typescript/compiler-host.d.cts +3 -1
- package/dist/lib/typescript/compiler-host.d.ts +3 -1
- package/dist/lib/typescript/compiler-host.js +6 -6
- package/dist/lib/typescript/import-transformer.cjs +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +3 -1
- package/dist/lib/typescript/import-transformer.d.ts +3 -1
- package/dist/lib/typescript/import-transformer.js +1 -1
- package/dist/lib/typescript/index.cjs +8 -8
- package/dist/lib/typescript/index.d.cts +3 -2
- package/dist/lib/typescript/index.d.ts +3 -2
- package/dist/lib/typescript/index.js +2 -2
- package/dist/lib/typescript/program.cjs +6 -6
- package/dist/lib/typescript/program.d.cts +3 -1
- package/dist/lib/typescript/program.d.ts +3 -1
- package/dist/lib/typescript/program.js +1 -1
- package/dist/lib/typescript/ts-morph.cjs +2 -2
- package/dist/lib/typescript/ts-morph.d.cts +5 -3
- package/dist/lib/typescript/ts-morph.d.ts +5 -3
- package/dist/lib/typescript/ts-morph.js +1 -1
- package/dist/lib/unplugin/factory.cjs +6 -6
- package/dist/lib/unplugin/factory.d.cts +5 -3
- package/dist/lib/unplugin/factory.d.ts +5 -3
- package/dist/lib/unplugin/factory.js +5 -5
- package/dist/lib/unplugin/helpers.d.cts +3 -1
- package/dist/lib/unplugin/helpers.d.ts +3 -1
- package/dist/lib/unplugin/index.cjs +11 -11
- package/dist/lib/unplugin/index.d.cts +6 -4
- package/dist/lib/unplugin/index.d.ts +6 -4
- package/dist/lib/unplugin/index.js +7 -7
- package/dist/lib/unplugin/plugin.cjs +2 -3
- package/dist/lib/unplugin/plugin.d.cts +6 -4
- package/dist/lib/unplugin/plugin.d.ts +6 -4
- package/dist/lib/unplugin/plugin.js +1 -2
- package/dist/lib/{unplugin-CbbNDduM.d.ts → unplugin-CEeJqADD.d.ts} +2 -2
- package/dist/lib/{unplugin-ppAOzR__.d.cts → unplugin-bUSyjd0S.d.cts} +2 -2
- package/dist/lib/utilities/bundle.cjs +2 -3
- package/dist/lib/utilities/bundle.d.cts +3 -1
- package/dist/lib/utilities/bundle.d.ts +3 -1
- package/dist/lib/utilities/bundle.js +1 -2
- package/dist/lib/utilities/cache.d.cts +3 -1
- package/dist/lib/utilities/cache.d.ts +3 -1
- package/dist/lib/utilities/file-header.d.cts +3 -1
- package/dist/lib/utilities/file-header.d.ts +3 -1
- package/dist/lib/utilities/index.cjs +14 -19
- package/dist/lib/utilities/index.d.cts +3 -2
- package/dist/lib/utilities/index.d.ts +3 -2
- package/dist/lib/utilities/index.js +4 -5
- package/dist/lib/utilities/meta.d.cts +3 -1
- package/dist/lib/utilities/meta.d.ts +3 -1
- package/dist/lib/utilities/resolve.cjs +3 -4
- package/dist/lib/utilities/resolve.d.cts +3 -1
- package/dist/lib/utilities/resolve.d.ts +3 -1
- package/dist/lib/utilities/resolve.js +2 -3
- package/dist/lib/utilities/source-file.d.cts +3 -1
- package/dist/lib/utilities/source-file.d.ts +3 -1
- package/dist/lib/utilities/source-map.d.cts +3 -1
- package/dist/lib/utilities/source-map.d.ts +3 -1
- package/dist/lib/utilities/worker.d.cts +3 -1
- package/dist/lib/utilities/worker.d.ts +3 -1
- package/dist/lib/utilities/write-file.d.cts +3 -1
- package/dist/lib/utilities/write-file.d.ts +3 -1
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +6 -6
- package/dist/nuxt.js +4 -4
- package/dist/plugin-utils/{context-Cg11S-CE.d.cts → context-BITGF5LZ.d.cts} +118 -39
- package/dist/plugin-utils/{context-Cg11S-CE.d.ts → context-BITGF5LZ.d.ts} +118 -39
- package/dist/plugin-utils/context-helpers.d.cts +4 -1
- package/dist/plugin-utils/context-helpers.d.ts +4 -1
- package/dist/plugin-utils/enforce.d.cts +4 -1
- package/dist/plugin-utils/enforce.d.ts +4 -1
- package/dist/plugin-utils/extend.d.cts +4 -1
- package/dist/plugin-utils/extend.d.ts +4 -1
- package/dist/plugin-utils/get-config-path.d.cts +4 -1
- package/dist/plugin-utils/get-config-path.d.ts +4 -1
- package/dist/plugin-utils/helpers.d.cts +4 -1
- package/dist/plugin-utils/helpers.d.ts +4 -1
- package/dist/plugin-utils/index.d.cts +4 -1
- package/dist/plugin-utils/index.d.ts +4 -1
- package/dist/plugin-utils/merge.d.cts +4 -1
- package/dist/plugin-utils/merge.d.ts +4 -1
- package/dist/plugin-utils/paths.d.cts +4 -1
- package/dist/plugin-utils/paths.d.ts +4 -1
- package/dist/{resolved-B3BSdXCt.d.ts → resolved-BABoCnXm.d.ts} +43 -1
- package/dist/{resolved-DGrpILrS.d.cts → resolved-CSqGKlA5.d.cts} +43 -1
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.d.cts +3 -1
- package/dist/rolldown.d.ts +3 -1
- package/dist/rolldown.js +2 -2
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +3 -1
- package/dist/rollup.d.ts +3 -1
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.d.cts +3 -1
- package/dist/rspack.d.ts +3 -1
- package/dist/rspack.js +2 -2
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.js +3 -3
- package/dist/types/api.d.cts +4 -2
- package/dist/types/api.d.ts +4 -2
- package/dist/types/babel.d.cts +3 -1
- package/dist/types/babel.d.ts +3 -1
- package/dist/types/commands.d.cts +3 -1
- package/dist/types/commands.d.ts +3 -1
- package/dist/types/config.d.cts +3 -1
- package/dist/types/config.d.ts +3 -1
- package/dist/types/context.d.cts +3 -1
- package/dist/types/context.d.ts +3 -1
- package/dist/types/fs.d.cts +68 -36
- package/dist/types/fs.d.ts +68 -36
- package/dist/types/hooks.d.cts +3 -1
- package/dist/types/hooks.d.ts +3 -1
- package/dist/types/index.d.cts +5 -3
- package/dist/types/index.d.ts +5 -3
- package/dist/types/internal.d.cts +4 -2
- package/dist/types/internal.d.ts +4 -2
- package/dist/types/plugin.d.cts +3 -1
- package/dist/types/plugin.d.ts +3 -1
- package/dist/types/resolved.d.cts +3 -1
- package/dist/types/resolved.d.ts +3 -1
- package/dist/types/unplugin.d.cts +4 -2
- package/dist/types/unplugin.d.ts +4 -2
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.d.cts +3 -1
- package/dist/unloader.d.ts +3 -1
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +12 -28
- package/dist/unplugin.d.cts +104 -31
- package/dist/unplugin.d.ts +104 -31
- package/dist/unplugin.js +10 -23
- package/dist/vite.cjs +6 -6
- package/dist/vite.d.cts +3 -1
- package/dist/vite.d.ts +3 -1
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.d.cts +3 -1
- package/dist/webpack.d.ts +3 -1
- package/dist/webpack.js +3 -3
- package/package.json +16 -15
- package/schemas/fs.capnp +35 -38
- package/dist/chunk-4TBQYHPZ.cjs +0 -234
- package/dist/chunk-7G7OFGGH.js +0 -230
- package/dist/lib/chunk-G7S5PIAC.js +0 -89
- package/dist/lib/chunk-MZJWK36Q.cjs +0 -37
- package/dist/lib/chunk-NWAD7K4D.js +0 -35
- package/dist/lib/chunk-ZBDVQVUK.cjs +0 -91
- package/dist/lib/unplugin/resolve-id.cjs +0 -11
- package/dist/lib/unplugin/resolve-id.d.cts +0 -57
- package/dist/lib/unplugin/resolve-id.d.ts +0 -57
- package/dist/lib/unplugin/resolve-id.js +0 -2
- package/dist/lib/utilities/resolve-path.cjs +0 -11
- package/dist/lib/utilities/resolve-path.d.cts +0 -40
- package/dist/lib/utilities/resolve-path.d.ts +0 -40
- package/dist/lib/utilities/resolve-path.js +0 -2
- /package/dist/lib/{chunk-HMO3LAYL.js → chunk-I2DQRMX3.js} +0 -0
- /package/dist/lib/{chunk-EJ25PQEL.cjs → chunk-YK4PYVLM.cjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PowerlinesEnvironmentContext } from './chunk-
|
|
2
|
-
import { PowerlinesContext } from './chunk-
|
|
1
|
+
import { PowerlinesEnvironmentContext } from './chunk-DFW5FGEO.js';
|
|
2
|
+
import { PowerlinesContext } from './chunk-KFWMKDJQ.js';
|
|
3
3
|
import { loadWorkspaceConfig } from './chunk-XBM7FHNK.js';
|
|
4
4
|
import { __name } from './chunk-SHUYVCID.js';
|
|
5
5
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bundle } from './chunk-
|
|
1
|
+
import { bundle } from './chunk-VHLINWXG.js';
|
|
2
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
3
3
|
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
4
4
|
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkB3EE3VHZ_cjs = require('./chunk-B3EE3VHZ.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkRNHKEPFD_cjs = require('./chunk-RNHKEPFD.cjs');
|
|
5
5
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
6
6
|
var resolve = require('@stryke/fs/resolve');
|
|
7
7
|
var isFunction = require('@stryke/type-checks/is-function');
|
|
@@ -17,7 +17,7 @@ var PLUGIN_NON_HOOK_FIELDS = [
|
|
|
17
17
|
];
|
|
18
18
|
|
|
19
19
|
// src/lib/contexts/environment-context.ts
|
|
20
|
-
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends
|
|
20
|
+
var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends chunkRNHKEPFD_cjs.PowerlinesContext {
|
|
21
21
|
static {
|
|
22
22
|
chunkUSNT2KNT_cjs.__name(this, "PowerlinesEnvironmentContext");
|
|
23
23
|
}
|
|
@@ -65,7 +65,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
65
65
|
if (!result || isObject.isObject(result) && Object.keys(result).length === 0) {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
resolvedPlugin =
|
|
68
|
+
resolvedPlugin = chunkRNHKEPFD_cjs.isPlugin(result) ? result : plugin;
|
|
69
69
|
}
|
|
70
70
|
const context = chunkB3EE3VHZ_cjs.createPluginContext(resolvedPlugin, this);
|
|
71
71
|
this.plugins.push({
|
|
@@ -75,28 +75,28 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
75
75
|
this.#hooks = Object.keys(resolvedPlugin).filter((key) => !PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
|
|
76
76
|
const hook = key;
|
|
77
77
|
const pluginHook = resolvedPlugin[hook];
|
|
78
|
-
if (!
|
|
78
|
+
if (!chunkRNHKEPFD_cjs.isPluginHook(pluginHook)) {
|
|
79
79
|
return ret;
|
|
80
80
|
}
|
|
81
|
-
if (!
|
|
81
|
+
if (!chunkRNHKEPFD_cjs.isHookExternal(hook)) {
|
|
82
82
|
ret[hook] ??= {};
|
|
83
83
|
if (resolvedPlugin.enforce) {
|
|
84
84
|
ret[hook][`${resolvedPlugin.enforce}Enforced`] ??= [];
|
|
85
|
-
|
|
85
|
+
chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${resolvedPlugin.enforce}Enforced`]);
|
|
86
86
|
return ret;
|
|
87
87
|
}
|
|
88
88
|
if (isFunction.isFunction(pluginHook) || !pluginHook.order) {
|
|
89
89
|
ret[hook].normal ??= [];
|
|
90
|
-
|
|
90
|
+
chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook].normal);
|
|
91
91
|
return ret;
|
|
92
92
|
}
|
|
93
93
|
ret[hook][`${pluginHook.order}Ordered`] ??= [];
|
|
94
|
-
|
|
94
|
+
chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${pluginHook.order}Ordered`]);
|
|
95
95
|
} else {
|
|
96
96
|
ret[hook] ??= [];
|
|
97
97
|
ret[hook].push({
|
|
98
98
|
plugin: resolvedPlugin,
|
|
99
|
-
hook:
|
|
99
|
+
hook: chunkRNHKEPFD_cjs.getHookHandler(pluginHook).bind(context)
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
return ret;
|
|
@@ -108,7 +108,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
|
|
|
108
108
|
selectHooks(hook, options) {
|
|
109
109
|
const handlers = [];
|
|
110
110
|
if (this.hooks[hook]) {
|
|
111
|
-
if (!
|
|
111
|
+
if (!chunkRNHKEPFD_cjs.isHookExternal(hook)) {
|
|
112
112
|
const hooks = this.hooks[hook];
|
|
113
113
|
if (options?.order) {
|
|
114
114
|
if (options?.order === "pre") {
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { writeFile } from './chunk-TANQDHYY.js';
|
|
2
2
|
import { getFileHeader } from './chunk-GANVMM73.js';
|
|
3
|
-
import { handleResolveId } from './chunk-G7S5PIAC.js';
|
|
4
3
|
import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-YOENMDZY.js';
|
|
5
|
-
import { PowerlinesAPIContext } from './chunk-
|
|
4
|
+
import { PowerlinesAPIContext } from './chunk-7CVPZOH4.js';
|
|
6
5
|
import { callHook } from './chunk-KFJCWNVG.js';
|
|
7
|
-
import {
|
|
6
|
+
import { __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-KFWMKDJQ.js';
|
|
8
7
|
import { writeMetaFile } from './chunk-FQLZZYYO.js';
|
|
9
8
|
import { createLog } from './chunk-ENRLU4UR.js';
|
|
10
9
|
import { getString } from './chunk-M263EZ4F.js';
|
|
11
|
-
import { replacePathTokens } from './chunk-XZFEHPYE.js';
|
|
12
10
|
import { __name } from './chunk-SHUYVCID.js';
|
|
13
11
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
14
12
|
import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
|
|
15
|
-
import { tsconfigPathsToRegExp } from 'bundle-require';
|
|
16
13
|
import { transformAsync } from '@babel/core';
|
|
17
14
|
import { formatLogMessage } from '@storm-software/config-tools/logger/console';
|
|
18
15
|
import { toArray } from '@stryke/convert/to-array';
|
|
@@ -34,11 +31,10 @@ import { isSet } from '@stryke/type-checks/is-set';
|
|
|
34
31
|
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
35
32
|
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
36
33
|
import chalk2 from 'chalk';
|
|
37
|
-
import defu from 'defu';
|
|
38
34
|
import Handlebars from 'handlebars';
|
|
39
35
|
import { declare } from '@babel/helper-plugin-utils';
|
|
40
36
|
import * as t from '@babel/types';
|
|
41
|
-
import ts, {
|
|
37
|
+
import ts, { flattenDiagnosticMessageText } from 'typescript';
|
|
42
38
|
import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
|
|
43
39
|
import { getObjectDiff } from '@donedeal0/superdiff';
|
|
44
40
|
import { readJsonFile } from '@stryke/fs/json';
|
|
@@ -52,7 +48,7 @@ function resolveModulePath(nodePath, state) {
|
|
|
52
48
|
return;
|
|
53
49
|
}
|
|
54
50
|
const sourcePath = nodePath.node.value;
|
|
55
|
-
const resolvedPath = state.context?.fs.
|
|
51
|
+
const resolvedPath = state.context?.fs.resolveSync(sourcePath);
|
|
56
52
|
if (resolvedPath) {
|
|
57
53
|
nodePath.replaceWith(t.stringLiteral(
|
|
58
54
|
// Remove the file extension if it exists
|
|
@@ -156,33 +152,31 @@ function formatTypes(code) {
|
|
|
156
152
|
).replaceAll("#private;", "").replace(/__Ω/g, "");
|
|
157
153
|
}
|
|
158
154
|
__name(formatTypes, "formatTypes");
|
|
159
|
-
async function emitTypes(context,
|
|
160
|
-
context.log(LogLevelLabel.TRACE,
|
|
161
|
-
|
|
162
|
-
|
|
155
|
+
async function emitTypes(context, files) {
|
|
156
|
+
context.log(LogLevelLabel.TRACE, `Running the TypeScript compiler for ${files.length} generated runtime files.`);
|
|
157
|
+
context.program.addSourceFilesAtPaths(files);
|
|
158
|
+
const result = context.program.emitToMemory({
|
|
159
|
+
emitOnlyDtsFiles: true
|
|
160
|
+
});
|
|
163
161
|
let builtinModules = "";
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
for (const file of result.getFiles()) {
|
|
163
|
+
if (!file.filePath.endsWith(".map")) {
|
|
164
|
+
if (context.builtins.some((builtin) => builtin === file.filePath || context.fs.metadata[builtin]?.id && context.fs.metadata[builtin]?.id === file.filePath)) {
|
|
165
|
+
const module = await context.fs.resolve(file.filePath);
|
|
168
166
|
builtinModules += `
|
|
169
|
-
declare module "${
|
|
170
|
-
|
|
171
|
-
}
|
|
172
|
-
`;
|
|
167
|
+
declare module "${module}" {
|
|
168
|
+
${file.text.trim().replace(/^\s*export\s*declare\s*/gm, "export ").replace(/^\s*declare\s*/gm, "")}
|
|
169
|
+
}
|
|
170
|
+
`;
|
|
173
171
|
}
|
|
174
172
|
}
|
|
175
|
-
}
|
|
176
|
-
const diagnostics = getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
173
|
+
}
|
|
177
174
|
const diagnosticMessages = [];
|
|
178
|
-
|
|
179
|
-
if (diagnostic.
|
|
180
|
-
|
|
181
|
-
const message = flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
182
|
-
diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
175
|
+
result.getDiagnostics().forEach((diagnostic) => {
|
|
176
|
+
if (diagnostic.getSourceFile()?.getBaseName()) {
|
|
177
|
+
diagnosticMessages.push(`${diagnostic.getSourceFile()?.getBaseName()} (${(diagnostic.getLineNumber() ?? 0) + 1}): ${flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n")}`);
|
|
183
178
|
} else {
|
|
184
|
-
|
|
185
|
-
diagnosticMessages.push(message);
|
|
179
|
+
diagnosticMessages.push(flattenDiagnosticMessageText(diagnostic.getMessageText().toString(), "\n"));
|
|
186
180
|
}
|
|
187
181
|
});
|
|
188
182
|
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
@@ -360,6 +354,7 @@ async function initializeTsconfig(context) {
|
|
|
360
354
|
const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
|
|
361
355
|
context.tsconfig.originalTsconfigJson = await readJsonFile(tsconfigFilePath);
|
|
362
356
|
context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
|
|
357
|
+
context.log(LogLevelLabel.TRACE, "Writing updated TypeScript configuration (tsconfig.json) file to disk.");
|
|
363
358
|
await context.fs.writeFile(tsconfigFilePath, StormJSON.stringify(context.tsconfig.tsconfigJson), {
|
|
364
359
|
mode: "fs"
|
|
365
360
|
});
|
|
@@ -489,13 +484,9 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
|
|
|
489
484
|
await resolveTsconfig(context);
|
|
490
485
|
await installDependencies(context);
|
|
491
486
|
await this.callPostHook(context, "configResolved");
|
|
492
|
-
if (context.config.build.polyfill) {
|
|
493
|
-
context.config.build.polyfill = context.config.build.polyfill.map((polyfill) => replacePathTokens(context, polyfill));
|
|
494
|
-
}
|
|
495
487
|
context.log(LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
|
|
496
488
|
|
|
497
489
|
${formatLogMessage(context.config)}`);
|
|
498
|
-
context.fs[__VFS_PATCH__]();
|
|
499
490
|
await writeMetaFile(context);
|
|
500
491
|
context.persistedMeta = context.meta;
|
|
501
492
|
if (!existsSync(context.cachePath)) {
|
|
@@ -545,35 +536,19 @@ ${formatLogMessage(context.config)}`);
|
|
|
545
536
|
if (!typescriptPath) {
|
|
546
537
|
throw new Error("Could not resolve TypeScript package location. Please ensure TypeScript is installed.");
|
|
547
538
|
}
|
|
548
|
-
const files = builtinFilePaths.reduce(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
ret.
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")
|
|
556
|
-
]);
|
|
557
|
-
context.log(LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
558
|
-
const resolvedTsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.tsconfig.tsconfigFilePath, defu({
|
|
559
|
-
compilerOptions: {
|
|
560
|
-
strict: false,
|
|
561
|
-
noEmit: false,
|
|
562
|
-
declaration: true,
|
|
563
|
-
declarationMap: false,
|
|
564
|
-
emitDeclarationOnly: true,
|
|
565
|
-
skipLibCheck: true
|
|
539
|
+
const files = builtinFilePaths.reduce(
|
|
540
|
+
(ret, fileName) => {
|
|
541
|
+
const formatted = replacePath(fileName, context.workspaceConfig.workspaceRoot);
|
|
542
|
+
if (!ret.includes(formatted)) {
|
|
543
|
+
ret.push(formatted);
|
|
544
|
+
}
|
|
545
|
+
return ret;
|
|
566
546
|
},
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}, context.config.tsconfigRaw ?? {}));
|
|
573
|
-
resolvedTsconfig.options.configFilePath = joinPaths(context.workspaceConfig.workspaceRoot, context.tsconfig.tsconfigFilePath);
|
|
574
|
-
resolvedTsconfig.options.pathsBasePath = context.workspaceConfig.workspaceRoot;
|
|
575
|
-
resolvedTsconfig.options.suppressOutputPathCheck = true;
|
|
576
|
-
let generatedTypes = await emitTypes(context, resolvedTsconfig, files);
|
|
547
|
+
[]
|
|
548
|
+
// [joinPaths(typescriptPath, "lib", "lib.esnext.full.d.ts")]
|
|
549
|
+
);
|
|
550
|
+
context.log(LogLevelLabel.TRACE, "Parsing TypeScript configuration for the Powerlines project.");
|
|
551
|
+
let generatedTypes = await emitTypes(context, files);
|
|
577
552
|
context.log(LogLevelLabel.TRACE, `Generating TypeScript declaration file in ${context.config.output.dts}.`);
|
|
578
553
|
const directives = [];
|
|
579
554
|
let result = await this.callPreHook(context, "generateTypes", generatedTypes);
|
|
@@ -627,7 +602,6 @@ ${formatTypes(generatedTypes)}
|
|
|
627
602
|
}
|
|
628
603
|
await this.callPostHook(context, "prepare");
|
|
629
604
|
await writeMetaFile(context);
|
|
630
|
-
context.fs[__VFS_REVERT__]();
|
|
631
605
|
});
|
|
632
606
|
this.context.log(LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
|
|
633
607
|
}
|
|
@@ -1078,14 +1052,10 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1078
1052
|
unplugin: meta
|
|
1079
1053
|
};
|
|
1080
1054
|
let api;
|
|
1081
|
-
let resolvePatterns = [];
|
|
1082
1055
|
async function buildStart() {
|
|
1083
1056
|
log(LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
|
|
1084
1057
|
const workspaceRoot = getWorkspaceRoot(process.cwd());
|
|
1085
1058
|
api = await PowerlinesAPI.from(workspaceRoot, userConfig);
|
|
1086
|
-
if (api.context.config.build.skipNodeModulesBundle) {
|
|
1087
|
-
resolvePatterns = tsconfigPathsToRegExp(api.context.tsconfig.options.paths ?? []);
|
|
1088
|
-
}
|
|
1089
1059
|
log(LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
|
|
1090
1060
|
await api.prepare({
|
|
1091
1061
|
command: "build"
|
|
@@ -1095,26 +1065,11 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1095
1065
|
async function resolveId(id, importer, options = {
|
|
1096
1066
|
isEntry: false
|
|
1097
1067
|
}) {
|
|
1098
|
-
return
|
|
1099
|
-
id,
|
|
1100
|
-
importer,
|
|
1101
|
-
options
|
|
1102
|
-
}, {
|
|
1103
|
-
skipNodeModulesBundle: api.context.config.build.skipNodeModulesBundle,
|
|
1104
|
-
external: api.context.config.build.external,
|
|
1105
|
-
noExternal: api.context.config.build.noExternal,
|
|
1106
|
-
resolvePatterns
|
|
1107
|
-
});
|
|
1068
|
+
return api.context.resolveId(id, importer, options);
|
|
1108
1069
|
}
|
|
1109
1070
|
__name(resolveId, "resolveId");
|
|
1110
1071
|
async function load(id) {
|
|
1111
1072
|
const environment = await api.context.getEnvironment();
|
|
1112
|
-
if (id) {
|
|
1113
|
-
const resolvedPath = environment.fs.resolve(id);
|
|
1114
|
-
if (resolvedPath) {
|
|
1115
|
-
return environment.fs.readFile(resolvedPath);
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
1073
|
let result2 = await api.callPreHook(environment, "load", id);
|
|
1119
1074
|
if (result2) {
|
|
1120
1075
|
return result2;
|
|
@@ -1123,6 +1078,10 @@ function createUnpluginFactory(variant, decorate) {
|
|
|
1123
1078
|
if (result2) {
|
|
1124
1079
|
return result2;
|
|
1125
1080
|
}
|
|
1081
|
+
result2 = await environment.load(id);
|
|
1082
|
+
if (result2) {
|
|
1083
|
+
return result2;
|
|
1084
|
+
}
|
|
1126
1085
|
return api.callPostHook(environment, "load", id);
|
|
1127
1086
|
}
|
|
1128
1087
|
__name(load, "load");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPluginContext } from './chunk-KFJCWNVG.js';
|
|
2
|
-
import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-
|
|
2
|
+
import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-KFWMKDJQ.js';
|
|
3
3
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
4
|
import { resolvePackage } from '@stryke/fs/resolve';
|
|
5
5
|
import { isFunction } from '@stryke/type-checks/is-function';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk6PPZCPME_cjs = require('./chunk-6PPZCPME.cjs');
|
|
4
4
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
var parseTypeDefinition = require('@stryke/convert/parse-type-definition');
|
|
6
6
|
var isSetString = require('@stryke/type-checks/is-set-string');
|
|
@@ -12,7 +12,7 @@ async function resolve(context, type, overrides = {}) {
|
|
|
12
12
|
} else {
|
|
13
13
|
typeDefinition = type;
|
|
14
14
|
}
|
|
15
|
-
const result = await
|
|
15
|
+
const result = await chunk6PPZCPME_cjs.bundle(context, typeDefinition.file, overrides);
|
|
16
16
|
const resolved = await context.resolver.evalModule(result.text, {
|
|
17
17
|
filename: result.path,
|
|
18
18
|
forceTranspile: true
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkDX2VAXZB_cjs = require('./chunk-DX2VAXZB.cjs');
|
|
4
|
-
var chunkZBDVQVUK_cjs = require('./chunk-ZBDVQVUK.cjs');
|
|
5
4
|
var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
|
|
6
5
|
var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
|
|
7
6
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
@@ -10,7 +9,7 @@ var filePathFns = require('@stryke/path/file-path-fns');
|
|
|
10
9
|
var replace = require('@stryke/path/replace');
|
|
11
10
|
var isString = require('@stryke/type-checks/is-string');
|
|
12
11
|
|
|
13
|
-
function createUnplugin(context,
|
|
12
|
+
function createUnplugin(context, _options = {}) {
|
|
14
13
|
const ctx = context;
|
|
15
14
|
return () => {
|
|
16
15
|
const log = chunkJA4HSQRN_cjs.extendLog(ctx.log, "unplugin");
|
|
@@ -43,16 +42,7 @@ function createUnplugin(context, options = {}) {
|
|
|
43
42
|
if (result) {
|
|
44
43
|
return result;
|
|
45
44
|
}
|
|
46
|
-
result = await
|
|
47
|
-
id,
|
|
48
|
-
importer,
|
|
49
|
-
options: opts
|
|
50
|
-
}, {
|
|
51
|
-
skipResolve: options.skipResolve,
|
|
52
|
-
skipNodeModulesBundle: ctx.config.build.skipNodeModulesBundle,
|
|
53
|
-
external: ctx.config.build.external,
|
|
54
|
-
noExternal: ctx.config.build.noExternal
|
|
55
|
-
});
|
|
45
|
+
result = await ctx.resolveId(id, importer, opts);
|
|
56
46
|
if (result) {
|
|
57
47
|
return result;
|
|
58
48
|
}
|
|
@@ -99,11 +89,9 @@ export * from "${isString.isString(resolved) ? resolved : resolved.id}";
|
|
|
99
89
|
if (result) {
|
|
100
90
|
return result;
|
|
101
91
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return ctx.fs.readFile(resolvedPath);
|
|
106
|
-
}
|
|
92
|
+
result = await ctx.load(id);
|
|
93
|
+
if (result) {
|
|
94
|
+
return result;
|
|
107
95
|
}
|
|
108
96
|
return ctx.$$internal.callHook("load", {
|
|
109
97
|
sequential: true,
|
|
@@ -47,7 +47,7 @@ async function createVirtualProgram(rootNames, context, compilerOptions = {}) {
|
|
|
47
47
|
...ts.sys,
|
|
48
48
|
realpath: /* @__PURE__ */ __name((path) => {
|
|
49
49
|
if (context.fs.existsSync(path)) {
|
|
50
|
-
return context.fs.
|
|
50
|
+
return context.fs.resolveSync(path);
|
|
51
51
|
}
|
|
52
52
|
return ts.sys.realpath?.(path) ?? path;
|
|
53
53
|
}, "realpath"),
|
|
@@ -102,7 +102,7 @@ async function createVirtualProgram(rootNames, context, compilerOptions = {}) {
|
|
|
102
102
|
},
|
|
103
103
|
resolvePath: /* @__PURE__ */ __name((fileName) => {
|
|
104
104
|
if (context.fs.existsSync(fileName)) {
|
|
105
|
-
return context.fs.
|
|
105
|
+
return context.fs.resolveSync(fileName);
|
|
106
106
|
}
|
|
107
107
|
return ts.sys.resolvePath(fileName);
|
|
108
108
|
}, "resolvePath"),
|
|
@@ -129,7 +129,7 @@ function createVirtualCompilerHost(context, sys, compilerOptions) {
|
|
|
129
129
|
// getDefaultLibLocation: () => '/',
|
|
130
130
|
getNewLine: /* @__PURE__ */ __name(() => sys.newLine, "getNewLine"),
|
|
131
131
|
getSourceFile: /* @__PURE__ */ __name((fileName, languageVersionOrOptions) => {
|
|
132
|
-
const resolved = context.fs.
|
|
132
|
+
const resolved = context.fs.resolveSync(fileName);
|
|
133
133
|
if (resolved && context.fs.existsSync(resolved)) {
|
|
134
134
|
return context.fs.readFileSync(resolved);
|
|
135
135
|
}
|