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
|
@@ -18,7 +18,7 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends tsMorph.InMemor
|
|
|
18
18
|
}
|
|
19
19
|
readDirSync(dirPath) {
|
|
20
20
|
return this.#fs.readdirSync(dirPath).reduce((ret, entry) => {
|
|
21
|
-
const fullPath = this.#fs.
|
|
21
|
+
const fullPath = this.#fs.resolveSync(join.joinPaths(dirPath, entry));
|
|
22
22
|
if (fullPath) {
|
|
23
23
|
ret.push({
|
|
24
24
|
name: entry,
|
|
@@ -79,7 +79,7 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends tsMorph.InMemor
|
|
|
79
79
|
return this.#fs.isDirectory(dirPath);
|
|
80
80
|
}
|
|
81
81
|
realpathSync(path) {
|
|
82
|
-
return this.#fs.
|
|
82
|
+
return this.#fs.resolveSync(path) || path;
|
|
83
83
|
}
|
|
84
84
|
getCurrentDirectory() {
|
|
85
85
|
return "/";
|
|
@@ -91,14 +91,16 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends tsMorph.InMemor
|
|
|
91
91
|
return this.#fs.globSync(patterns);
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
|
-
function createProgram(context) {
|
|
95
|
-
|
|
94
|
+
function createProgram(context, override) {
|
|
95
|
+
const project = new tsMorph.Project({
|
|
96
96
|
compilerOptions: {
|
|
97
97
|
...context.tsconfig.options
|
|
98
98
|
},
|
|
99
99
|
tsConfigFilePath: context.tsconfig.tsconfigFilePath,
|
|
100
|
-
fileSystem: new VirtualFileSystemHost(context.fs)
|
|
100
|
+
fileSystem: new VirtualFileSystemHost(context.fs),
|
|
101
|
+
...override
|
|
101
102
|
});
|
|
103
|
+
return project;
|
|
102
104
|
}
|
|
103
105
|
chunkUSNT2KNT_cjs.__name(createProgram, "createProgram");
|
|
104
106
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { resolvePath } from './chunk-NWAD7K4D.js';
|
|
2
1
|
import { extractESBuildConfig } from './chunk-AOHJEL2Q.js';
|
|
3
2
|
import { __name } from './chunk-SHUYVCID.js';
|
|
4
3
|
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
5
4
|
import { build } from 'esbuild';
|
|
6
5
|
|
|
7
6
|
async function bundle(context, file, overrides = {}) {
|
|
8
|
-
const path = await
|
|
7
|
+
const path = await context.fs.resolve(file);
|
|
9
8
|
if (!path || !context.fs.existsSync(path)) {
|
|
10
9
|
throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
11
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkAA6RBP44_cjs = require('./chunk-AA6RBP44.cjs');
|
|
4
|
+
var chunkRNHKEPFD_cjs = require('./chunk-RNHKEPFD.cjs');
|
|
5
5
|
var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
|
|
6
6
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
7
7
|
var types = require('@storm-software/config-tools/types');
|
|
@@ -64,7 +64,7 @@ function createDefaultEnvironment(userConfig) {
|
|
|
64
64
|
chunkUSNT2KNT_cjs.__name(createDefaultEnvironment, "createDefaultEnvironment");
|
|
65
65
|
|
|
66
66
|
// src/lib/contexts/api-context.ts
|
|
67
|
-
var PowerlinesAPIContext = class _PowerlinesAPIContext extends
|
|
67
|
+
var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkRNHKEPFD_cjs.PowerlinesContext {
|
|
68
68
|
static {
|
|
69
69
|
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
|
|
70
70
|
}
|
|
@@ -127,7 +127,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkQABAD5RE_cjs
|
|
|
127
127
|
if (this.environments[environment.name]) {
|
|
128
128
|
context = this.environments[environment.name];
|
|
129
129
|
} else {
|
|
130
|
-
context = await
|
|
130
|
+
context = await chunkAA6RBP44_cjs.PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
|
|
131
131
|
}
|
|
132
132
|
if (isSetObject.isSetObject(this.config.inlineConfig)) {
|
|
133
133
|
await context.withInlineConfig(this.config.inlineConfig);
|
|
@@ -54,7 +54,7 @@ async function createVirtualProgram(rootNames, context, compilerOptions = {}) {
|
|
|
54
54
|
...ts__default.default.sys,
|
|
55
55
|
realpath: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((path) => {
|
|
56
56
|
if (context.fs.existsSync(path)) {
|
|
57
|
-
return context.fs.
|
|
57
|
+
return context.fs.resolveSync(path);
|
|
58
58
|
}
|
|
59
59
|
return ts__default.default.sys.realpath?.(path) ?? path;
|
|
60
60
|
}, "realpath"),
|
|
@@ -109,7 +109,7 @@ async function createVirtualProgram(rootNames, context, compilerOptions = {}) {
|
|
|
109
109
|
},
|
|
110
110
|
resolvePath: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((fileName) => {
|
|
111
111
|
if (context.fs.existsSync(fileName)) {
|
|
112
|
-
return context.fs.
|
|
112
|
+
return context.fs.resolveSync(fileName);
|
|
113
113
|
}
|
|
114
114
|
return ts__default.default.sys.resolvePath(fileName);
|
|
115
115
|
}, "resolvePath"),
|
|
@@ -136,7 +136,7 @@ function createVirtualCompilerHost(context, sys, compilerOptions) {
|
|
|
136
136
|
// getDefaultLibLocation: () => '/',
|
|
137
137
|
getNewLine: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name(() => sys.newLine, "getNewLine"),
|
|
138
138
|
getSourceFile: /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((fileName, languageVersionOrOptions) => {
|
|
139
|
-
const resolved = context.fs.
|
|
139
|
+
const resolved = context.fs.resolveSync(fileName);
|
|
140
140
|
if (resolved && context.fs.existsSync(resolved)) {
|
|
141
141
|
return context.fs.readFileSync(resolved);
|
|
142
142
|
}
|
|
@@ -16,7 +16,7 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends InMemoryFileSys
|
|
|
16
16
|
}
|
|
17
17
|
readDirSync(dirPath) {
|
|
18
18
|
return this.#fs.readdirSync(dirPath).reduce((ret, entry) => {
|
|
19
|
-
const fullPath = this.#fs.
|
|
19
|
+
const fullPath = this.#fs.resolveSync(joinPaths(dirPath, entry));
|
|
20
20
|
if (fullPath) {
|
|
21
21
|
ret.push({
|
|
22
22
|
name: entry,
|
|
@@ -77,7 +77,7 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends InMemoryFileSys
|
|
|
77
77
|
return this.#fs.isDirectory(dirPath);
|
|
78
78
|
}
|
|
79
79
|
realpathSync(path) {
|
|
80
|
-
return this.#fs.
|
|
80
|
+
return this.#fs.resolveSync(path) || path;
|
|
81
81
|
}
|
|
82
82
|
getCurrentDirectory() {
|
|
83
83
|
return "/";
|
|
@@ -89,14 +89,16 @@ var VirtualFileSystemHost = class VirtualFileSystemHost2 extends InMemoryFileSys
|
|
|
89
89
|
return this.#fs.globSync(patterns);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
function createProgram(context) {
|
|
93
|
-
|
|
92
|
+
function createProgram(context, override) {
|
|
93
|
+
const project = new Project({
|
|
94
94
|
compilerOptions: {
|
|
95
95
|
...context.tsconfig.options
|
|
96
96
|
},
|
|
97
97
|
tsConfigFilePath: context.tsconfig.tsconfigFilePath,
|
|
98
|
-
fileSystem: new VirtualFileSystemHost(context.fs)
|
|
98
|
+
fileSystem: new VirtualFileSystemHost(context.fs),
|
|
99
|
+
...override
|
|
99
100
|
});
|
|
101
|
+
return project;
|
|
100
102
|
}
|
|
101
103
|
__name(createProgram, "createProgram");
|
|
102
104
|
|
|
@@ -20,8 +20,10 @@ import { Worker } from 'jest-worker';
|
|
|
20
20
|
import { Jiti } from 'jiti';
|
|
21
21
|
import MagicString, { SourceMap } from 'magic-string';
|
|
22
22
|
import { Range } from 'semver';
|
|
23
|
+
import { Project } from 'ts-morph';
|
|
23
24
|
import { TransformResult as TransformResult$1, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginMessage, UnpluginBuildContext } from 'unplugin';
|
|
24
|
-
import {
|
|
25
|
+
import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
|
|
26
|
+
import { StatSyncOptions, Stats, RmDirOptions, RmOptions, Mode, MakeDirectoryOptions as MakeDirectoryOptions$1, WriteFileOptions as WriteFileOptions$1 } from 'node:fs';
|
|
25
27
|
import { ArrayValues } from '@stryke/types/array';
|
|
26
28
|
import { P as ParsedTypeScriptConfig, T as TSConfig } from './tsconfig-Bz-CiFqD.cjs';
|
|
27
29
|
|
|
@@ -112,21 +114,27 @@ interface PowerlinesWriteFileOptions extends ResolveFSOptions {
|
|
|
112
114
|
type NodeWriteFileOptions = WriteFileOptions$1;
|
|
113
115
|
type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
|
|
114
116
|
type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
115
|
-
interface
|
|
117
|
+
interface ResolveOptions extends ResolveOptions$1 {
|
|
116
118
|
/**
|
|
117
|
-
*
|
|
118
|
-
|
|
119
|
-
|
|
119
|
+
* If true, the module is being resolved as an entry point.
|
|
120
|
+
*/
|
|
121
|
+
isEntry?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* If true, the resolver will skip using the cache when resolving modules.
|
|
124
|
+
*/
|
|
125
|
+
skipCache?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* An array of external modules or patterns to exclude from resolution.
|
|
120
128
|
*/
|
|
121
|
-
|
|
129
|
+
external?: (string | RegExp)[];
|
|
122
130
|
/**
|
|
123
|
-
*
|
|
131
|
+
* An array of modules or patterns to include in the resolution, even if they are marked as external.
|
|
124
132
|
*/
|
|
125
|
-
|
|
133
|
+
noExternal?: (string | RegExp)[];
|
|
126
134
|
/**
|
|
127
|
-
*
|
|
135
|
+
* An array of patterns to match when resolving modules.
|
|
128
136
|
*/
|
|
129
|
-
|
|
137
|
+
skipNodeModulesBundle?: boolean;
|
|
130
138
|
}
|
|
131
139
|
interface VirtualFileSystemInterface {
|
|
132
140
|
/**
|
|
@@ -140,27 +148,33 @@ interface VirtualFileSystemInterface {
|
|
|
140
148
|
/**
|
|
141
149
|
* The underlying file metadata.
|
|
142
150
|
*/
|
|
143
|
-
metadata: Record<string, VirtualFileMetadata
|
|
151
|
+
metadata: Readonly<Record<string, VirtualFileMetadata>>;
|
|
152
|
+
/**
|
|
153
|
+
* A map of file paths to their module ids.
|
|
154
|
+
*/
|
|
155
|
+
ids: Readonly<Record<string, string>>;
|
|
144
156
|
/**
|
|
145
157
|
* A map of module ids to their file paths.
|
|
146
158
|
*/
|
|
147
|
-
|
|
159
|
+
paths: Readonly<Record<string, string>>;
|
|
148
160
|
/**
|
|
149
161
|
* Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
150
162
|
*
|
|
151
163
|
* @param pathOrId - The path or id to check.
|
|
164
|
+
* @param importer - The importer path, if any.
|
|
152
165
|
* @param options - Optional parameters for resolving the path.
|
|
153
166
|
* @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
154
167
|
*/
|
|
155
|
-
isVirtual: (pathOrId: string, options?:
|
|
168
|
+
isVirtual: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
156
169
|
/**
|
|
157
170
|
* Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
158
171
|
*
|
|
159
172
|
* @param pathOrId - The path or id to check.
|
|
173
|
+
* @param importer - The importer path, if any.
|
|
160
174
|
* @param options - Optional parameters for resolving the path.
|
|
161
175
|
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
162
176
|
*/
|
|
163
|
-
isPhysical: (pathOrId: string, options?:
|
|
177
|
+
isPhysical: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
164
178
|
/**
|
|
165
179
|
* Checks if a file exists in the virtual file system (VFS).
|
|
166
180
|
*
|
|
@@ -188,7 +202,7 @@ interface VirtualFileSystemInterface {
|
|
|
188
202
|
* @param pathOrId - The path or id of the file.
|
|
189
203
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
190
204
|
*/
|
|
191
|
-
getMetadata: (pathOrId:
|
|
205
|
+
getMetadata: (pathOrId: string) => VirtualFileMetadata | undefined;
|
|
192
206
|
/**
|
|
193
207
|
* Gets the stats of a file in the virtual file system (VFS).
|
|
194
208
|
*
|
|
@@ -261,7 +275,7 @@ interface VirtualFileSystemInterface {
|
|
|
261
275
|
* @param path - The path to the file to remove.
|
|
262
276
|
* @returns A promise that resolves when the file is removed.
|
|
263
277
|
*/
|
|
264
|
-
unlinkSync: (path:
|
|
278
|
+
unlinkSync: (path: string, options?: ResolveFSOptions) => void;
|
|
265
279
|
/**
|
|
266
280
|
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
267
281
|
*
|
|
@@ -275,7 +289,7 @@ interface VirtualFileSystemInterface {
|
|
|
275
289
|
* @param path - The path to create the directory at.
|
|
276
290
|
* @param options - Options for creating the directory.
|
|
277
291
|
*/
|
|
278
|
-
rmdirSync: (path:
|
|
292
|
+
rmdirSync: (path: string, options?: RmDirOptions & ResolveFSOptions) => any;
|
|
279
293
|
/**
|
|
280
294
|
* Removes a directory in the virtual file system (VFS).
|
|
281
295
|
*
|
|
@@ -283,7 +297,7 @@ interface VirtualFileSystemInterface {
|
|
|
283
297
|
* @param options - Options for creating the directory.
|
|
284
298
|
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
285
299
|
*/
|
|
286
|
-
rmdir: (path:
|
|
300
|
+
rmdir: (path: string, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
|
|
287
301
|
/**
|
|
288
302
|
* Removes a file or directory in the virtual file system (VFS).
|
|
289
303
|
*
|
|
@@ -291,14 +305,14 @@ interface VirtualFileSystemInterface {
|
|
|
291
305
|
* @param options - Options for removing the file or directory.
|
|
292
306
|
* @returns A promise that resolves when the file or directory is removed.
|
|
293
307
|
*/
|
|
294
|
-
rm: (path:
|
|
308
|
+
rm: (path: string, options?: RmOptions & ResolveFSOptions) => Promise<void>;
|
|
295
309
|
/**
|
|
296
310
|
* Synchronously removes a file or directory in the virtual file system (VFS).
|
|
297
311
|
*
|
|
298
312
|
* @param path - The path to the file or directory to remove.
|
|
299
313
|
* @param options - Options for removing the file or directory.
|
|
300
314
|
*/
|
|
301
|
-
rmSync: (path:
|
|
315
|
+
rmSync: (path: string, options?: RmOptions & ResolveFSOptions) => void;
|
|
302
316
|
/**
|
|
303
317
|
* Creates a directory in the virtual file system (VFS).
|
|
304
318
|
*
|
|
@@ -306,7 +320,7 @@ interface VirtualFileSystemInterface {
|
|
|
306
320
|
* @param options - Options for creating the directory.
|
|
307
321
|
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
308
322
|
*/
|
|
309
|
-
mkdirSync: (path:
|
|
323
|
+
mkdirSync: (path: string, options?: MakeDirectoryOptions) => string | undefined;
|
|
310
324
|
/**
|
|
311
325
|
* Creates a directory in the virtual file system (VFS).
|
|
312
326
|
*
|
|
@@ -314,7 +328,7 @@ interface VirtualFileSystemInterface {
|
|
|
314
328
|
* @param options - Options for creating the directory.
|
|
315
329
|
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
316
330
|
*/
|
|
317
|
-
mkdir: (path:
|
|
331
|
+
mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<string | undefined>;
|
|
318
332
|
/**
|
|
319
333
|
* Reads a file from the virtual file system (VFS).
|
|
320
334
|
*
|
|
@@ -336,7 +350,7 @@ interface VirtualFileSystemInterface {
|
|
|
336
350
|
* @param options - Optional parameters for writing the file.
|
|
337
351
|
* @returns A promise that resolves when the file is written.
|
|
338
352
|
*/
|
|
339
|
-
writeFile: (path:
|
|
353
|
+
writeFile: (path: string, data?: WriteFileData, options?: WriteFileOptions) => Promise<void>;
|
|
340
354
|
/**
|
|
341
355
|
* Writes a file to the virtual file system (VFS).
|
|
342
356
|
*
|
|
@@ -344,7 +358,7 @@ interface VirtualFileSystemInterface {
|
|
|
344
358
|
* @param data - The contents of the file.
|
|
345
359
|
* @param options - Optional parameters for writing the file.
|
|
346
360
|
*/
|
|
347
|
-
writeFileSync: (path:
|
|
361
|
+
writeFileSync: (path: string, data?: WriteFileData, options?: WriteFileOptions) => void;
|
|
348
362
|
/**
|
|
349
363
|
* Moves a file from one path to another in the virtual file system (VFS).
|
|
350
364
|
*
|
|
@@ -391,24 +405,43 @@ interface VirtualFileSystemInterface {
|
|
|
391
405
|
* Resolves a path or id to a file path in the virtual file system.
|
|
392
406
|
*
|
|
393
407
|
* @param pathOrId - The path or id of the file to resolve.
|
|
394
|
-
* @param options - Optional parameters for resolving the path.
|
|
395
408
|
* @returns The resolved path of the file if it exists, otherwise false.
|
|
396
409
|
*/
|
|
397
|
-
|
|
410
|
+
realpathSync: (pathOrId: string) => string;
|
|
398
411
|
/**
|
|
399
|
-
*
|
|
412
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
400
413
|
*
|
|
401
|
-
* @
|
|
402
|
-
*
|
|
414
|
+
* @remarks
|
|
415
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* ```ts
|
|
419
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
420
|
+
* ```
|
|
421
|
+
*
|
|
422
|
+
* @param id - The module to resolve.
|
|
423
|
+
* @param importer - An optional path to the importer module.
|
|
424
|
+
* @param options - Additional resolution options.
|
|
425
|
+
* @returns A promise that resolves to the resolved module path.
|
|
403
426
|
*/
|
|
404
|
-
|
|
427
|
+
resolve: (id: string, importer?: string, options?: ResolveOptions) => Promise<string | undefined>;
|
|
405
428
|
/**
|
|
406
|
-
*
|
|
429
|
+
* A synchronous helper function to resolve modules using the Jiti resolver
|
|
407
430
|
*
|
|
408
|
-
* @
|
|
409
|
-
*
|
|
431
|
+
* @remarks
|
|
432
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```ts
|
|
436
|
+
* const resolvedPath = context.resolveSync("some-module", "/path/to/importer");
|
|
437
|
+
* ```
|
|
438
|
+
*
|
|
439
|
+
* @param id - The module to resolve.
|
|
440
|
+
* @param importer - An optional path to the importer module.
|
|
441
|
+
* @param options - Additional resolution options.
|
|
442
|
+
* @returns The resolved module path.
|
|
410
443
|
*/
|
|
411
|
-
|
|
444
|
+
resolveSync: (id: string, importer?: string, options?: ResolveOptions) => string | undefined;
|
|
412
445
|
/**
|
|
413
446
|
* Disposes of the virtual file system (VFS), writes any virtual file changes to disk, and releases any associated resources.
|
|
414
447
|
*/
|
|
@@ -1123,6 +1156,47 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1123
1156
|
* The builtin module id that exist in the Powerlines virtual file system
|
|
1124
1157
|
*/
|
|
1125
1158
|
builtins: string[];
|
|
1159
|
+
/**
|
|
1160
|
+
* The {@link Project} instance used for type reflection and module manipulation
|
|
1161
|
+
*
|
|
1162
|
+
* @see https://ts-morph.com/
|
|
1163
|
+
*
|
|
1164
|
+
* @remarks
|
|
1165
|
+
* This instance is created lazily on first access.
|
|
1166
|
+
*/
|
|
1167
|
+
program: Project;
|
|
1168
|
+
/**
|
|
1169
|
+
* A helper function to resolve modules using the Jiti resolver
|
|
1170
|
+
*
|
|
1171
|
+
* @remarks
|
|
1172
|
+
* This function can be used to resolve modules relative to the project root directory.
|
|
1173
|
+
*
|
|
1174
|
+
* @example
|
|
1175
|
+
* ```ts
|
|
1176
|
+
* const resolvedPath = await context.resolve("some-module", "/path/to/importer");
|
|
1177
|
+
* ```
|
|
1178
|
+
*
|
|
1179
|
+
* @param id - The module to resolve.
|
|
1180
|
+
* @param importer - An optional path to the importer module.
|
|
1181
|
+
* @param options - Additional resolution options.
|
|
1182
|
+
* @returns A promise that resolves to the resolved module path.
|
|
1183
|
+
*/
|
|
1184
|
+
resolveId: (id: string, importer?: string, options?: ResolveOptions) => Promise<ExternalIdResult | undefined>;
|
|
1185
|
+
/**
|
|
1186
|
+
* A helper function to load modules using the Jiti resolver
|
|
1187
|
+
*
|
|
1188
|
+
* @remarks
|
|
1189
|
+
* This function can be used to load modules relative to the project root directory.
|
|
1190
|
+
*
|
|
1191
|
+
* @example
|
|
1192
|
+
* ```ts
|
|
1193
|
+
* const module = await context.load("some-module", "/path/to/importer");
|
|
1194
|
+
* ```
|
|
1195
|
+
*
|
|
1196
|
+
* @param id - The module to load.
|
|
1197
|
+
* @returns A promise that resolves to the loaded module.
|
|
1198
|
+
*/
|
|
1199
|
+
load: (id: string) => Promise<TransformResult | undefined>;
|
|
1126
1200
|
/**
|
|
1127
1201
|
* The Powerlines builtin virtual files
|
|
1128
1202
|
*/
|
|
@@ -1657,4 +1731,4 @@ type DeployInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineCon
|
|
|
1657
1731
|
command: "deploy";
|
|
1658
1732
|
};
|
|
1659
1733
|
|
|
1660
|
-
export { type BuildInlineConfig as $, type APIContext as A, type
|
|
1734
|
+
export { type BuildInlineConfig as $, type APIContext as A, type InferHookParameters as B, type Context as C, type InferHookReturnType as D, type ESBuildResolvedBuildConfig as E, type UnpluginBuildVariant as F, type InferResolvedConfig as G, type HooksList as H, type InitialUserConfig as I, type InferUnpluginVariant as J, type BuildPlugin as K, type LogFn as L, type MakeDirectoryOptions as M, type InferUserConfig as N, type SourceFile as O, type PowerlinesCommand as P, type WorkerProcess as Q, type ResolveOptions as R, type SelectHooksOptions as S, type TsupBuildConfig as T, type UnbuildBuildConfig as U, type VirtualFileSystemInterface as V, type WriteFileData as W, type PrepareInlineConfig as X, type NewInlineConfig as Y, type CleanInlineConfig as Z, __VFS_PATCH__ as _, type VirtualFileMetadata as a, type LintInlineConfig as a0, type DocsInlineConfig as a1, type DeployInlineConfig as a2, type ResolveFSOptions as b, type WriteFileOptions as c, __VFS_REVERT__ as d, type WorkspaceConfig as e, type ParsedUserConfig as f, type ResolvedEntryTypeDefinition as g, type RolldownResolvedBuildConfig as h, type RollupResolvedBuildConfig as i, type TsupResolvedBuildConfig as j, type UnbuildResolvedBuildConfig as k, type ViteResolvedBuildConfig as l, type ResolvedConfig as m, type EnvironmentContext as n, type Plugin as o, type PluginContext as p, type EnvironmentResolvedConfig as q, type EnvironmentContextPlugin as r, type HookKeys as s, type InferHookHandler as t, type MetaInfo as u, type Resolver as v, type TransformResult as w, type VirtualFile as x, type PowerlinesWriteFileOptions as y, type InitContextOptions as z };
|