powerlines 0.23.7 → 0.23.10
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-DxPACGY4.d.ts → api-5H3zEedD.d.ts} +1 -1
- package/dist/{api--9pVSIbm.d.cts → api-B77aqxGC.d.cts} +1 -1
- package/dist/api.cjs +2 -2
- package/dist/api.d.cts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +4 -4
- package/dist/astro.d.cts +8 -6
- package/dist/astro.d.ts +8 -6
- package/dist/astro.js +3 -3
- package/dist/{chunk-CSSV6ES3.js → chunk-3W5CN3M3.js} +1 -1
- package/dist/{chunk-V732KPW6.cjs → chunk-4EIGDACJ.cjs} +34 -20
- package/dist/{chunk-32NXGMLQ.cjs → chunk-4TBQYHPZ.cjs} +3 -3
- package/dist/{chunk-QXTSQTX5.js → chunk-7G7OFGGH.js} +1 -1
- package/dist/{chunk-NVNBOUXL.js → chunk-MUNYXQYT.js} +34 -20
- package/dist/{chunk-ZUQDWAUO.cjs → chunk-PR3JGGAL.cjs} +2 -2
- package/dist/{chunk-I7G24RUE.cjs → chunk-SNHUEYEP.cjs} +2 -2
- package/dist/{chunk-6CYDJ53Z.js → chunk-SS5AXCGJ.js} +1 -1
- package/dist/{chunk-4TAIQVJG.cjs → chunk-WBC2XOMT.cjs} +2 -2
- package/dist/{chunk-RQAKTG6M.js → chunk-ZIWN73GA.js} +1 -1
- package/dist/config.d.cts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/esbuild.cjs +6 -6
- package/dist/esbuild.d.cts +5 -4
- package/dist/esbuild.d.ts +5 -4
- package/dist/esbuild.js +3 -3
- package/dist/farm.cjs +3 -3
- package/dist/farm.d.cts +9 -7
- package/dist/farm.d.ts +9 -7
- package/dist/farm.js +2 -2
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/{api-Bwwdt0YR.d.cts → api-Cm51oVbC.d.cts} +1 -1
- package/dist/lib/{api-BJ7F7DmT.d.ts → api-mja4jirh.d.ts} +1 -1
- package/dist/lib/build/esbuild.d.cts +1 -1
- package/dist/lib/build/esbuild.d.ts +1 -1
- package/dist/lib/build/index.d.cts +3 -3
- package/dist/lib/build/index.d.ts +3 -3
- package/dist/lib/build/rolldown.d.cts +1 -1
- package/dist/lib/build/rolldown.d.ts +1 -1
- package/dist/lib/build/rollup.d.cts +1 -1
- package/dist/lib/build/rollup.d.ts +1 -1
- package/dist/lib/build/rspack.d.cts +1 -1
- package/dist/lib/build/rspack.d.ts +1 -1
- package/dist/lib/build/tsup.d.cts +1 -1
- package/dist/lib/build/tsup.d.ts +1 -1
- package/dist/lib/build/unbuild.d.cts +3 -3
- package/dist/lib/build/unbuild.d.ts +3 -3
- package/dist/lib/build/vite.d.cts +1 -1
- package/dist/lib/build/vite.d.ts +1 -1
- package/dist/lib/build/webpack.d.cts +1 -1
- package/dist/lib/build/webpack.d.ts +1 -1
- package/dist/lib/{chunk-7XHBIYIN.cjs → chunk-7VJ42H2I.cjs} +0 -16
- package/dist/lib/{chunk-YH5GOJS3.js → chunk-FQLZZYYO.js} +1 -16
- package/dist/lib/{chunk-SZH2DJOG.js → chunk-HNOAMIRO.js} +3 -3
- package/dist/lib/{chunk-EJTGOYSI.cjs → chunk-I6TJUFA6.cjs} +10 -10
- package/dist/lib/chunk-K3NBD5LL.cjs +75 -0
- package/dist/lib/{chunk-EN4XP4D5.js → chunk-OJ5XFCZN.js} +1 -1
- package/dist/lib/{chunk-NVUXGMU5.cjs → chunk-QABAD5RE.cjs} +32 -9
- package/dist/lib/{chunk-CCGA6ZHZ.cjs → chunk-RBSNQFLF.cjs} +16 -16
- package/dist/lib/{chunk-NDKPSA3I.js → chunk-VDPCG3RR.js} +3 -3
- package/dist/lib/{chunk-27RAXIPT.cjs → chunk-VLOUSKRX.cjs} +6 -6
- package/dist/lib/chunk-XBM7FHNK.js +68 -0
- package/dist/lib/{chunk-764HUXP3.js → chunk-XG4CC73V.js} +27 -4
- package/dist/lib/{config-CFZYRPQj.d.ts → config-7Q2dBjJE.d.ts} +6 -0
- package/dist/lib/{config-CxONCKEx.d.cts → config-BnJpgcGr.d.cts} +6 -0
- package/dist/lib/config-file.cjs +3 -3
- package/dist/lib/config-file.d.cts +3 -2
- package/dist/lib/config-file.d.ts +3 -2
- package/dist/lib/config-file.js +1 -1
- package/dist/lib/contexts/api-context.cjs +6 -6
- package/dist/lib/contexts/api-context.d.cts +3 -3
- package/dist/lib/contexts/api-context.d.ts +3 -3
- package/dist/lib/contexts/api-context.js +5 -5
- package/dist/lib/contexts/context.cjs +4 -4
- package/dist/lib/contexts/context.d.cts +10 -3
- package/dist/lib/contexts/context.d.ts +10 -3
- package/dist/lib/contexts/context.js +3 -3
- package/dist/lib/contexts/environment-context.cjs +5 -5
- package/dist/lib/contexts/environment-context.d.cts +3 -3
- package/dist/lib/contexts/environment-context.d.ts +3 -3
- package/dist/lib/contexts/environment-context.js +4 -4
- package/dist/lib/contexts/index.cjs +8 -8
- package/dist/lib/contexts/index.d.cts +3 -3
- package/dist/lib/contexts/index.d.ts +3 -3
- package/dist/lib/contexts/index.js +5 -5
- package/dist/lib/contexts/plugin-context.d.cts +3 -3
- package/dist/lib/contexts/plugin-context.d.ts +3 -3
- package/dist/lib/entry.d.cts +1 -1
- package/dist/lib/entry.d.ts +1 -1
- package/dist/lib/index.cjs +19 -23
- package/dist/lib/index.d.cts +5 -5
- package/dist/lib/index.d.ts +5 -5
- package/dist/lib/index.js +6 -6
- package/dist/lib/{internal-kEzuoIrl.d.ts → internal-BEygquYh.d.ts} +2 -2
- package/dist/lib/{internal-9D9Up5pT.d.cts → internal-BeR8fOB1.d.cts} +2 -2
- package/dist/lib/logger.d.cts +1 -1
- package/dist/lib/logger.d.ts +1 -1
- package/dist/lib/typescript/compiler-host.d.cts +1 -1
- package/dist/lib/typescript/compiler-host.d.ts +1 -1
- package/dist/lib/typescript/import-transformer.d.cts +1 -1
- package/dist/lib/typescript/import-transformer.d.ts +1 -1
- package/dist/lib/typescript/index.d.cts +1 -1
- package/dist/lib/typescript/index.d.ts +1 -1
- package/dist/lib/typescript/program.d.cts +1 -1
- package/dist/lib/typescript/program.d.ts +1 -1
- package/dist/lib/typescript/ts-morph.d.cts +1 -1
- package/dist/lib/typescript/ts-morph.d.ts +1 -1
- package/dist/lib/unplugin/factory.cjs +7 -7
- package/dist/lib/unplugin/factory.d.cts +3 -3
- package/dist/lib/unplugin/factory.d.ts +3 -3
- package/dist/lib/unplugin/factory.js +6 -6
- package/dist/lib/unplugin/helpers.d.cts +1 -1
- package/dist/lib/unplugin/helpers.d.ts +1 -1
- package/dist/lib/unplugin/index.cjs +7 -7
- package/dist/lib/unplugin/index.d.cts +3 -3
- package/dist/lib/unplugin/index.d.ts +3 -3
- package/dist/lib/unplugin/index.js +6 -6
- package/dist/lib/unplugin/plugin.d.cts +3 -3
- package/dist/lib/unplugin/plugin.d.ts +3 -3
- package/dist/lib/unplugin/resolve-id.d.cts +1 -1
- package/dist/lib/unplugin/resolve-id.d.ts +1 -1
- package/dist/lib/{unplugin-tmNrQvUk.d.ts → unplugin-CbbNDduM.d.ts} +2 -2
- package/dist/lib/{unplugin-BdLs3dwd.d.cts → unplugin-ppAOzR__.d.cts} +2 -2
- package/dist/lib/utilities/bundle.d.cts +1 -1
- package/dist/lib/utilities/bundle.d.ts +1 -1
- package/dist/lib/utilities/cache.d.cts +1 -1
- package/dist/lib/utilities/cache.d.ts +1 -1
- package/dist/lib/utilities/file-header.d.cts +1 -1
- package/dist/lib/utilities/file-header.d.ts +1 -1
- package/dist/lib/utilities/index.cjs +7 -11
- package/dist/lib/utilities/index.d.cts +2 -2
- package/dist/lib/utilities/index.d.ts +2 -2
- package/dist/lib/utilities/index.js +1 -1
- package/dist/lib/utilities/meta.cjs +7 -11
- package/dist/lib/utilities/meta.d.cts +2 -3
- package/dist/lib/utilities/meta.d.ts +2 -3
- package/dist/lib/utilities/meta.js +1 -1
- package/dist/lib/utilities/resolve-path.d.cts +1 -1
- package/dist/lib/utilities/resolve-path.d.ts +1 -1
- package/dist/lib/utilities/resolve.d.cts +1 -1
- package/dist/lib/utilities/resolve.d.ts +1 -1
- package/dist/lib/utilities/source-file.d.cts +1 -1
- package/dist/lib/utilities/source-file.d.ts +1 -1
- package/dist/lib/utilities/source-map.d.cts +1 -1
- package/dist/lib/utilities/source-map.d.ts +1 -1
- package/dist/lib/utilities/worker.d.cts +1 -1
- package/dist/lib/utilities/worker.d.ts +1 -1
- package/dist/lib/utilities/write-file.d.cts +1 -1
- package/dist/lib/utilities/write-file.d.ts +1 -1
- package/dist/next.cjs +4 -4
- package/dist/next.js +3 -3
- package/dist/nuxt.cjs +7 -7
- package/dist/nuxt.d.cts +12 -6
- package/dist/nuxt.d.ts +12 -6
- package/dist/nuxt.js +5 -5
- package/dist/plugin-utils/{context-DRFZE3XI.d.ts → context-Cg11S-CE.d.cts} +6 -0
- package/dist/plugin-utils/{context-DRFZE3XI.d.cts → context-Cg11S-CE.d.ts} +6 -0
- package/dist/plugin-utils/context-helpers.d.cts +1 -1
- package/dist/plugin-utils/context-helpers.d.ts +1 -1
- package/dist/plugin-utils/enforce.d.cts +1 -1
- package/dist/plugin-utils/enforce.d.ts +1 -1
- package/dist/plugin-utils/extend.d.cts +1 -1
- package/dist/plugin-utils/extend.d.ts +1 -1
- package/dist/plugin-utils/get-config-path.d.cts +1 -1
- package/dist/plugin-utils/get-config-path.d.ts +1 -1
- package/dist/plugin-utils/helpers.d.cts +1 -1
- package/dist/plugin-utils/helpers.d.ts +1 -1
- package/dist/plugin-utils/index.d.cts +1 -1
- package/dist/plugin-utils/index.d.ts +1 -1
- package/dist/plugin-utils/merge.d.cts +1 -1
- package/dist/plugin-utils/merge.d.ts +1 -1
- package/dist/plugin-utils/paths.d.cts +1 -1
- package/dist/plugin-utils/paths.d.ts +1 -1
- package/dist/{resolved-DKFZ11S7.d.ts → resolved-B3BSdXCt.d.ts} +13 -1
- package/dist/{resolved-C00CJgsk.d.cts → resolved-DGrpILrS.d.cts} +13 -1
- package/dist/rolldown.cjs +3 -3
- package/dist/rolldown.d.cts +3 -3
- package/dist/rolldown.d.ts +3 -3
- package/dist/rolldown.js +2 -2
- package/dist/rollup.cjs +3 -3
- package/dist/rollup.d.cts +3 -3
- package/dist/rollup.d.ts +3 -3
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +3 -3
- package/dist/rspack.d.cts +3 -3
- package/dist/rspack.d.ts +3 -3
- package/dist/rspack.js +2 -2
- package/dist/tsup.cjs +4 -4
- package/dist/tsup.d.cts +3 -2
- package/dist/tsup.d.ts +3 -2
- package/dist/tsup.js +3 -3
- package/dist/types/api.d.cts +2 -2
- package/dist/types/api.d.ts +2 -2
- package/dist/types/babel.d.cts +1 -1
- package/dist/types/babel.d.ts +1 -1
- package/dist/types/commands.d.cts +1 -1
- package/dist/types/commands.d.ts +1 -1
- package/dist/types/config.d.cts +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/context.d.cts +1 -1
- package/dist/types/context.d.ts +1 -1
- package/dist/types/hooks.d.cts +1 -1
- package/dist/types/hooks.d.ts +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/internal.d.cts +2 -2
- package/dist/types/internal.d.ts +2 -2
- package/dist/types/plugin.d.cts +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/resolved.d.cts +1 -1
- package/dist/types/resolved.d.ts +1 -1
- package/dist/types/unplugin.d.cts +2 -2
- package/dist/types/unplugin.d.ts +2 -2
- package/dist/unloader.cjs +3 -3
- package/dist/unloader.d.cts +5 -4
- package/dist/unloader.d.ts +5 -4
- package/dist/unloader.js +2 -2
- package/dist/unplugin.cjs +7 -7
- package/dist/unplugin.d.cts +2 -2
- package/dist/unplugin.d.ts +2 -2
- package/dist/unplugin.js +3 -3
- package/dist/vite.cjs +6 -6
- package/dist/vite.d.cts +5 -4
- package/dist/vite.d.ts +5 -4
- package/dist/vite.js +3 -3
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.d.cts +3 -3
- package/dist/webpack.d.ts +3 -3
- package/dist/webpack.js +3 -3
- package/package.json +10 -9
- package/dist/lib/chunk-XW5TELHB.cjs +0 -67
- package/dist/lib/chunk-ZPIKFR7Z.js +0 -60
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
4
|
+
var getConfig = require('@storm-software/config-tools/get-config');
|
|
5
|
+
var exists = require('@stryke/fs/exists');
|
|
6
|
+
var append = require('@stryke/path/append');
|
|
7
|
+
var joinPaths = require('@stryke/path/join-paths');
|
|
8
|
+
var replace = require('@stryke/path/replace');
|
|
9
|
+
var isFunction = require('@stryke/type-checks/is-function');
|
|
10
|
+
var isSetObject = require('@stryke/type-checks/is-set-object');
|
|
11
|
+
var c12 = require('c12');
|
|
12
|
+
var defu = require('defu');
|
|
13
|
+
|
|
14
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
17
|
+
|
|
18
|
+
async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
19
|
+
return defu__default.default({
|
|
20
|
+
workspaceRoot
|
|
21
|
+
}, await getConfig.getWorkspaceConfig(true, {
|
|
22
|
+
cwd,
|
|
23
|
+
workspaceRoot,
|
|
24
|
+
useDefault: true
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
chunkUSNT2KNT_cjs.__name(loadWorkspaceConfig, "loadWorkspaceConfig");
|
|
28
|
+
async function loadUserConfigFile(projectRoot, workspaceRoot, jiti, command, mode = "production", configFile, framework = "powerlines") {
|
|
29
|
+
let resolvedUserConfig = {};
|
|
30
|
+
let resolvedUserConfigFile;
|
|
31
|
+
if (configFile) {
|
|
32
|
+
resolvedUserConfigFile = exists.existsSync(replace.replacePath(configFile, projectRoot)) ? replace.replacePath(configFile, projectRoot) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), replace.replacePath(configFile, projectRoot))) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), replace.replacePath(configFile, projectRoot)) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), configFile)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), configFile) : void 0;
|
|
33
|
+
}
|
|
34
|
+
if (!resolvedUserConfigFile) {
|
|
35
|
+
resolvedUserConfigFile = exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.js`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.js`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`) : exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`) : void 0;
|
|
36
|
+
}
|
|
37
|
+
if (resolvedUserConfigFile) {
|
|
38
|
+
const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
|
|
39
|
+
if (resolved) {
|
|
40
|
+
let config = {};
|
|
41
|
+
if (isFunction.isFunction(resolved)) {
|
|
42
|
+
config = await Promise.resolve(resolved({
|
|
43
|
+
command,
|
|
44
|
+
mode,
|
|
45
|
+
isSsrBuild: false,
|
|
46
|
+
isPreview: false
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
if (isSetObject.isSetObject(config)) {
|
|
50
|
+
resolvedUserConfig = {
|
|
51
|
+
...config,
|
|
52
|
+
config,
|
|
53
|
+
configFile: resolvedUserConfigFile
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const result = await c12.loadConfig({
|
|
59
|
+
cwd: projectRoot,
|
|
60
|
+
name: framework,
|
|
61
|
+
envName: mode,
|
|
62
|
+
globalRc: true,
|
|
63
|
+
packageJson: true,
|
|
64
|
+
dotenv: true,
|
|
65
|
+
jiti
|
|
66
|
+
});
|
|
67
|
+
return defu__default.default(resolvedUserConfig, isSetObject.isSetObject(result?.config) ? {
|
|
68
|
+
...result.config,
|
|
69
|
+
...result
|
|
70
|
+
} : {});
|
|
71
|
+
}
|
|
72
|
+
chunkUSNT2KNT_cjs.__name(loadUserConfigFile, "loadUserConfigFile");
|
|
73
|
+
|
|
74
|
+
exports.loadUserConfigFile = loadUserConfigFile;
|
|
75
|
+
exports.loadWorkspaceConfig = loadWorkspaceConfig;
|
|
@@ -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-XG4CC73V.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,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk7VJ42H2I_cjs = require('./chunk-7VJ42H2I.cjs');
|
|
4
|
+
var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
|
|
5
5
|
var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
|
|
6
6
|
var chunkISBHXSDH_cjs = require('./chunk-ISBHXSDH.cjs');
|
|
7
7
|
var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
|
|
@@ -12,6 +12,7 @@ var exists = require('@stryke/fs/exists');
|
|
|
12
12
|
var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
|
|
13
13
|
var json = require('@stryke/fs/json');
|
|
14
14
|
var resolve = require('@stryke/fs/resolve');
|
|
15
|
+
var hashFiles = require('@stryke/hash/hash-files');
|
|
15
16
|
var murmurhash = require('@stryke/hash/murmurhash');
|
|
16
17
|
var getUnique = require('@stryke/helpers/get-unique');
|
|
17
18
|
var omit = require('@stryke/helpers/omit');
|
|
@@ -70,6 +71,7 @@ var _fs__default = /*#__PURE__*/_interopDefault(_fs);
|
|
|
70
71
|
|
|
71
72
|
function resolveOptions(options) {
|
|
72
73
|
return defu2__default.default(options, {
|
|
74
|
+
debug: options.logLevel === "trace",
|
|
73
75
|
interopDefault: true,
|
|
74
76
|
fsCache: options.mode !== "development" ? joinPaths.joinPaths(options.cacheDir, "jiti") : false,
|
|
75
77
|
moduleCache: options.mode !== "development"
|
|
@@ -1999,7 +2001,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
1999
2001
|
* @returns A promise that resolves to the new context.
|
|
2000
2002
|
*/
|
|
2001
2003
|
static async from(workspaceRoot, config) {
|
|
2002
|
-
const context = new _PowerlinesContext(await
|
|
2004
|
+
const context = new _PowerlinesContext(await chunkK3NBD5LL_cjs.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
2003
2005
|
await context.withUserConfig(config);
|
|
2004
2006
|
context.powerlinesPath = await resolve.resolvePackage("powerlines");
|
|
2005
2007
|
if (!context.powerlinesPath) {
|
|
@@ -2096,10 +2098,10 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2096
2098
|
workspaceRoot: this.workspaceConfig?.workspaceRoot,
|
|
2097
2099
|
projectRoot: this.config?.projectRoot
|
|
2098
2100
|
}, {
|
|
2099
|
-
maxLength:
|
|
2101
|
+
maxLength: chunk7VJ42H2I_cjs.PROJECT_ROOT_HASH_LENGTH
|
|
2100
2102
|
}),
|
|
2101
2103
|
configHash: murmurhash.murmurhash(this.config, {
|
|
2102
|
-
maxLength:
|
|
2104
|
+
maxLength: chunk7VJ42H2I_cjs.CACHE_HASH_LENGTH
|
|
2103
2105
|
})
|
|
2104
2106
|
};
|
|
2105
2107
|
}
|
|
@@ -2159,7 +2161,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2159
2161
|
* Get the path to the data directory for the project
|
|
2160
2162
|
*/
|
|
2161
2163
|
get dataPath() {
|
|
2162
|
-
return join.joinPaths(this.envPaths.data, "projects",
|
|
2164
|
+
return join.joinPaths(this.envPaths.data, "projects", chunk7VJ42H2I_cjs.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
|
|
2163
2165
|
}
|
|
2164
2166
|
/**
|
|
2165
2167
|
* Get the path to the cache directory for the project
|
|
@@ -2169,7 +2171,7 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2169
2171
|
checksum: this.#checksum,
|
|
2170
2172
|
config: this.meta.configHash
|
|
2171
2173
|
}, {
|
|
2172
|
-
maxLength:
|
|
2174
|
+
maxLength: chunk7VJ42H2I_cjs.CACHE_HASH_LENGTH
|
|
2173
2175
|
}));
|
|
2174
2176
|
}
|
|
2175
2177
|
/**
|
|
@@ -2356,6 +2358,26 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2356
2358
|
*/
|
|
2357
2359
|
logFn;
|
|
2358
2360
|
/**
|
|
2361
|
+
* Generates a checksum representing the current context state
|
|
2362
|
+
*
|
|
2363
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
2364
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
2365
|
+
*/
|
|
2366
|
+
async generateChecksum(root = this.config.projectRoot) {
|
|
2367
|
+
this.#checksum = await hashFiles.hashDirectory(root, {
|
|
2368
|
+
ignore: [
|
|
2369
|
+
"node_modules",
|
|
2370
|
+
".git",
|
|
2371
|
+
".nx",
|
|
2372
|
+
".cache",
|
|
2373
|
+
".storm",
|
|
2374
|
+
"tmp",
|
|
2375
|
+
"dist"
|
|
2376
|
+
]
|
|
2377
|
+
});
|
|
2378
|
+
return this.#checksum;
|
|
2379
|
+
}
|
|
2380
|
+
/**
|
|
2359
2381
|
* Initialize the context with the provided configuration options
|
|
2360
2382
|
*
|
|
2361
2383
|
* @param config - The partial user configuration to use for initialization.
|
|
@@ -2387,15 +2409,16 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2387
2409
|
if (exists.existsSync(packageJsonPath)) {
|
|
2388
2410
|
this.packageJson = await json.readJsonFile(packageJsonPath);
|
|
2389
2411
|
}
|
|
2390
|
-
this.#checksum = await
|
|
2412
|
+
this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
|
|
2391
2413
|
this.resolver = createResolver({
|
|
2392
2414
|
workspaceRoot: this.workspaceConfig.workspaceRoot,
|
|
2393
2415
|
projectRoot: cacheKey.projectRoot,
|
|
2394
2416
|
cacheDir: this.cachePath,
|
|
2395
2417
|
mode: cacheKey.mode,
|
|
2418
|
+
logLevel: config.logLevel || this.config?.logLevel || this.workspaceConfig.logLevel || "info",
|
|
2396
2419
|
skipCache: cacheKey.skipCache
|
|
2397
2420
|
});
|
|
2398
|
-
const userConfig = await
|
|
2421
|
+
const userConfig = await chunkK3NBD5LL_cjs.loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2399
2422
|
this.mergeUserConfig(userConfig.config);
|
|
2400
2423
|
configCache.set(cacheKey, {
|
|
2401
2424
|
projectJson: this.projectJson,
|
|
@@ -4,10 +4,10 @@ var chunk2NZADVP5_cjs = require('./chunk-2NZADVP5.cjs');
|
|
|
4
4
|
var chunk4NHFXDTQ_cjs = require('./chunk-4NHFXDTQ.cjs');
|
|
5
5
|
var chunkZBDVQVUK_cjs = require('./chunk-ZBDVQVUK.cjs');
|
|
6
6
|
var chunkBQU53ZNB_cjs = require('./chunk-BQU53ZNB.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkVLOUSKRX_cjs = require('./chunk-VLOUSKRX.cjs');
|
|
8
8
|
var chunkB3EE3VHZ_cjs = require('./chunk-B3EE3VHZ.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkQABAD5RE_cjs = require('./chunk-QABAD5RE.cjs');
|
|
10
|
+
var chunk7VJ42H2I_cjs = require('./chunk-7VJ42H2I.cjs');
|
|
11
11
|
var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
|
|
12
12
|
var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
|
|
13
13
|
var chunkISBHXSDH_cjs = require('./chunk-ISBHXSDH.cjs');
|
|
@@ -476,7 +476,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
|
|
|
476
476
|
* Initialize the Powerlines API
|
|
477
477
|
*/
|
|
478
478
|
static async from(workspaceRoot, config) {
|
|
479
|
-
const api = new _PowerlinesAPI(await
|
|
479
|
+
const api = new _PowerlinesAPI(await chunkVLOUSKRX_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
|
|
480
480
|
api.#context.$$internal.api = api;
|
|
481
481
|
for (const plugin of api.context.config.plugins ?? []) {
|
|
482
482
|
await api.#addPlugin(plugin);
|
|
@@ -523,8 +523,8 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
|
|
|
523
523
|
context.log(types.LogLevelLabel.TRACE, `Powerlines configuration has been resolved:
|
|
524
524
|
|
|
525
525
|
${console.formatLogMessage(context.config)}`);
|
|
526
|
-
context.fs[
|
|
527
|
-
await
|
|
526
|
+
context.fs[chunkQABAD5RE_cjs.__VFS_PATCH__]();
|
|
527
|
+
await chunk7VJ42H2I_cjs.writeMetaFile(context);
|
|
528
528
|
context.persistedMeta = context.meta;
|
|
529
529
|
if (!exists.existsSync(context.cachePath)) {
|
|
530
530
|
await helpers.createDirectory(context.cachePath);
|
|
@@ -654,8 +654,8 @@ ${formatTypes(generatedTypes)}
|
|
|
654
654
|
throw new Error("Failed to parse the TypeScript configuration file.");
|
|
655
655
|
}
|
|
656
656
|
await this.callPostHook(context, "prepare");
|
|
657
|
-
await
|
|
658
|
-
context.fs[
|
|
657
|
+
await chunk7VJ42H2I_cjs.writeMetaFile(context);
|
|
658
|
+
context.fs[chunkQABAD5RE_cjs.__VFS_REVERT__]();
|
|
659
659
|
});
|
|
660
660
|
this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
|
|
661
661
|
}
|
|
@@ -828,7 +828,7 @@ ${formatTypes(generatedTypes)}
|
|
|
828
828
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
|
|
829
829
|
await this.#executeEnvironments(async (context) => {
|
|
830
830
|
await this.callHook(context, "finalize");
|
|
831
|
-
context.fs[
|
|
831
|
+
context.fs[chunkQABAD5RE_cjs.__VFS_REVERT__]();
|
|
832
832
|
await context.fs.dispose();
|
|
833
833
|
});
|
|
834
834
|
this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
|
|
@@ -993,11 +993,11 @@ ${formatTypes(generatedTypes)}
|
|
|
993
993
|
if (isPromise.isPromiseLike(config)) {
|
|
994
994
|
awaited = await Promise.resolve(config);
|
|
995
995
|
}
|
|
996
|
-
if (!
|
|
996
|
+
if (!chunkQABAD5RE_cjs.isPluginConfig(awaited)) {
|
|
997
997
|
throw new Error(`Invalid plugin specified in the configuration - ${JSON.stringify(awaited)}. Please ensure the value is a plugin name, an object with the \`plugin\` and \`props\` properties, or an instance of \`Plugin\`.`);
|
|
998
998
|
}
|
|
999
999
|
let plugin;
|
|
1000
|
-
if (
|
|
1000
|
+
if (chunkQABAD5RE_cjs.isPlugin(awaited)) {
|
|
1001
1001
|
plugin = awaited;
|
|
1002
1002
|
} else if (isFunction.isFunction(awaited)) {
|
|
1003
1003
|
plugin = await Promise.resolve(awaited());
|
|
@@ -1008,10 +1008,10 @@ ${formatTypes(generatedTypes)}
|
|
|
1008
1008
|
} else {
|
|
1009
1009
|
plugin = resolved;
|
|
1010
1010
|
}
|
|
1011
|
-
} else if (
|
|
1011
|
+
} else if (chunkQABAD5RE_cjs.isPluginConfigTuple(awaited) || chunkQABAD5RE_cjs.isPluginConfigObject(awaited)) {
|
|
1012
1012
|
let pluginConfig;
|
|
1013
1013
|
let pluginOptions;
|
|
1014
|
-
if (
|
|
1014
|
+
if (chunkQABAD5RE_cjs.isPluginConfigTuple(awaited)) {
|
|
1015
1015
|
pluginConfig = awaited[0];
|
|
1016
1016
|
pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
|
|
1017
1017
|
} else {
|
|
@@ -1027,17 +1027,17 @@ ${formatTypes(generatedTypes)}
|
|
|
1027
1027
|
}
|
|
1028
1028
|
} else if (isFunction.isFunction(pluginConfig)) {
|
|
1029
1029
|
plugin = await Promise.resolve(pluginConfig(pluginOptions));
|
|
1030
|
-
} else if (
|
|
1030
|
+
} else if (chunkQABAD5RE_cjs.isPlugin(pluginConfig)) {
|
|
1031
1031
|
plugin = pluginConfig;
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
1034
|
if (!plugin) {
|
|
1035
1035
|
throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
|
|
1036
1036
|
}
|
|
1037
|
-
if (!
|
|
1037
|
+
if (!chunkQABAD5RE_cjs.isPlugin(plugin)) {
|
|
1038
1038
|
throw new Error(`The plugin option ${JSON.stringify(plugin)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
|
|
1039
1039
|
}
|
|
1040
|
-
if (
|
|
1040
|
+
if (chunkQABAD5RE_cjs.checkDedupe(plugin, this.context.plugins)) {
|
|
1041
1041
|
this.context.log(types.LogLevelLabel.TRACE, `Duplicate ${chalk2__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
|
|
1042
1042
|
return null;
|
|
1043
1043
|
}
|
|
@@ -2,10 +2,10 @@ import { writeFile } from './chunk-TANQDHYY.js';
|
|
|
2
2
|
import { getFileHeader } from './chunk-GANVMM73.js';
|
|
3
3
|
import { handleResolveId } from './chunk-G7S5PIAC.js';
|
|
4
4
|
import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-YOENMDZY.js';
|
|
5
|
-
import { PowerlinesAPIContext } from './chunk-
|
|
5
|
+
import { PowerlinesAPIContext } from './chunk-HNOAMIRO.js';
|
|
6
6
|
import { callHook } from './chunk-KFJCWNVG.js';
|
|
7
|
-
import { __VFS_PATCH__, __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-
|
|
8
|
-
import { writeMetaFile } from './chunk-
|
|
7
|
+
import { __VFS_PATCH__, __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-XG4CC73V.js';
|
|
8
|
+
import { writeMetaFile } from './chunk-FQLZZYYO.js';
|
|
9
9
|
import { createLog } from './chunk-ENRLU4UR.js';
|
|
10
10
|
import { getString } from './chunk-M263EZ4F.js';
|
|
11
11
|
import { replacePathTokens } from './chunk-XZFEHPYE.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkI6TJUFA6_cjs = require('./chunk-I6TJUFA6.cjs');
|
|
4
|
+
var chunkQABAD5RE_cjs = require('./chunk-QABAD5RE.cjs');
|
|
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');
|
|
8
8
|
var toArray = require('@stryke/convert/to-array');
|
|
@@ -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 chunkQABAD5RE_cjs.PowerlinesContext {
|
|
68
68
|
static {
|
|
69
69
|
chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
|
|
70
70
|
}
|
|
@@ -79,7 +79,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkNVUXGMU5_cjs
|
|
|
79
79
|
* @returns A promise that resolves to the new context.
|
|
80
80
|
*/
|
|
81
81
|
static async from(workspaceRoot, config) {
|
|
82
|
-
const context = new _PowerlinesAPIContext(await
|
|
82
|
+
const context = new _PowerlinesAPIContext(await chunkK3NBD5LL_cjs.loadWorkspaceConfig(workspaceRoot, config.root));
|
|
83
83
|
await context.withUserConfig(config);
|
|
84
84
|
context.powerlinesPath = await resolve.resolvePackage("powerlines");
|
|
85
85
|
if (!context.powerlinesPath) {
|
|
@@ -127,7 +127,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkNVUXGMU5_cjs
|
|
|
127
127
|
if (this.environments[environment.name]) {
|
|
128
128
|
context = this.environments[environment.name];
|
|
129
129
|
} else {
|
|
130
|
-
context = await
|
|
130
|
+
context = await chunkI6TJUFA6_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);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __name } from './chunk-SHUYVCID.js';
|
|
2
|
+
import { getWorkspaceConfig } from '@storm-software/config-tools/get-config';
|
|
3
|
+
import { existsSync } from '@stryke/fs/exists';
|
|
4
|
+
import { appendPath } from '@stryke/path/append';
|
|
5
|
+
import { joinPaths } from '@stryke/path/join-paths';
|
|
6
|
+
import { replacePath } from '@stryke/path/replace';
|
|
7
|
+
import { isFunction } from '@stryke/type-checks/is-function';
|
|
8
|
+
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
9
|
+
import { loadConfig } from 'c12';
|
|
10
|
+
import defu from 'defu';
|
|
11
|
+
|
|
12
|
+
async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
13
|
+
return defu({
|
|
14
|
+
workspaceRoot
|
|
15
|
+
}, await getWorkspaceConfig(true, {
|
|
16
|
+
cwd,
|
|
17
|
+
workspaceRoot,
|
|
18
|
+
useDefault: true
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
__name(loadWorkspaceConfig, "loadWorkspaceConfig");
|
|
22
|
+
async function loadUserConfigFile(projectRoot, workspaceRoot, jiti, command, mode = "production", configFile, framework = "powerlines") {
|
|
23
|
+
let resolvedUserConfig = {};
|
|
24
|
+
let resolvedUserConfigFile;
|
|
25
|
+
if (configFile) {
|
|
26
|
+
resolvedUserConfigFile = existsSync(replacePath(configFile, projectRoot)) ? replacePath(configFile, projectRoot) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), replacePath(configFile, projectRoot))) ? joinPaths(appendPath(projectRoot, workspaceRoot), replacePath(configFile, projectRoot)) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), configFile)) ? joinPaths(appendPath(projectRoot, workspaceRoot), configFile) : void 0;
|
|
27
|
+
}
|
|
28
|
+
if (!resolvedUserConfigFile) {
|
|
29
|
+
resolvedUserConfigFile = existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.js`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.js`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`) : existsSync(joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`)) ? joinPaths(appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`) : void 0;
|
|
30
|
+
}
|
|
31
|
+
if (resolvedUserConfigFile) {
|
|
32
|
+
const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
|
|
33
|
+
if (resolved) {
|
|
34
|
+
let config = {};
|
|
35
|
+
if (isFunction(resolved)) {
|
|
36
|
+
config = await Promise.resolve(resolved({
|
|
37
|
+
command,
|
|
38
|
+
mode,
|
|
39
|
+
isSsrBuild: false,
|
|
40
|
+
isPreview: false
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
if (isSetObject(config)) {
|
|
44
|
+
resolvedUserConfig = {
|
|
45
|
+
...config,
|
|
46
|
+
config,
|
|
47
|
+
configFile: resolvedUserConfigFile
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const result = await loadConfig({
|
|
53
|
+
cwd: projectRoot,
|
|
54
|
+
name: framework,
|
|
55
|
+
envName: mode,
|
|
56
|
+
globalRc: true,
|
|
57
|
+
packageJson: true,
|
|
58
|
+
dotenv: true,
|
|
59
|
+
jiti
|
|
60
|
+
});
|
|
61
|
+
return defu(resolvedUserConfig, isSetObject(result?.config) ? {
|
|
62
|
+
...result.config,
|
|
63
|
+
...result
|
|
64
|
+
} : {});
|
|
65
|
+
}
|
|
66
|
+
__name(loadUserConfigFile, "loadUserConfigFile");
|
|
67
|
+
|
|
68
|
+
export { loadUserConfigFile, loadWorkspaceConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash
|
|
2
|
-
import { loadWorkspaceConfig, loadUserConfigFile } from './chunk-
|
|
1
|
+
import { CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash } from './chunk-FQLZZYYO.js';
|
|
2
|
+
import { loadWorkspaceConfig, loadUserConfigFile } from './chunk-XBM7FHNK.js';
|
|
3
3
|
import { extendLog, createLog } from './chunk-ENRLU4UR.js';
|
|
4
4
|
import { resolveEntriesSync, getUniqueEntries } from './chunk-XZFEHPYE.js';
|
|
5
5
|
import { __name } from './chunk-SHUYVCID.js';
|
|
@@ -10,6 +10,7 @@ import { existsSync } from '@stryke/fs/exists';
|
|
|
10
10
|
import { relativeToWorkspaceRoot } from '@stryke/fs/get-workspace-root';
|
|
11
11
|
import { readJsonFile } from '@stryke/fs/json';
|
|
12
12
|
import { resolvePackage } from '@stryke/fs/resolve';
|
|
13
|
+
import { hashDirectory } from '@stryke/hash/hash-files';
|
|
13
14
|
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
14
15
|
import { getUnique } from '@stryke/helpers/get-unique';
|
|
15
16
|
import { omit } from '@stryke/helpers/omit';
|
|
@@ -44,6 +45,7 @@ import { Union } from 'unionfs';
|
|
|
44
45
|
|
|
45
46
|
function resolveOptions(options) {
|
|
46
47
|
return defu2(options, {
|
|
48
|
+
debug: options.logLevel === "trace",
|
|
47
49
|
interopDefault: true,
|
|
48
50
|
fsCache: options.mode !== "development" ? joinPaths$1(options.cacheDir, "jiti") : false,
|
|
49
51
|
moduleCache: options.mode !== "development"
|
|
@@ -2330,6 +2332,26 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2330
2332
|
*/
|
|
2331
2333
|
logFn;
|
|
2332
2334
|
/**
|
|
2335
|
+
* Generates a checksum representing the current context state
|
|
2336
|
+
*
|
|
2337
|
+
* @param root - The root directory of the project to generate the checksum for
|
|
2338
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
2339
|
+
*/
|
|
2340
|
+
async generateChecksum(root = this.config.projectRoot) {
|
|
2341
|
+
this.#checksum = await hashDirectory(root, {
|
|
2342
|
+
ignore: [
|
|
2343
|
+
"node_modules",
|
|
2344
|
+
".git",
|
|
2345
|
+
".nx",
|
|
2346
|
+
".cache",
|
|
2347
|
+
".storm",
|
|
2348
|
+
"tmp",
|
|
2349
|
+
"dist"
|
|
2350
|
+
]
|
|
2351
|
+
});
|
|
2352
|
+
return this.#checksum;
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2333
2355
|
* Initialize the context with the provided configuration options
|
|
2334
2356
|
*
|
|
2335
2357
|
* @param config - The partial user configuration to use for initialization.
|
|
@@ -2361,15 +2383,16 @@ var PowerlinesContext = class _PowerlinesContext {
|
|
|
2361
2383
|
if (existsSync(packageJsonPath)) {
|
|
2362
2384
|
this.packageJson = await readJsonFile(packageJsonPath);
|
|
2363
2385
|
}
|
|
2364
|
-
this.#checksum = await
|
|
2386
|
+
this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
|
|
2365
2387
|
this.resolver = createResolver({
|
|
2366
2388
|
workspaceRoot: this.workspaceConfig.workspaceRoot,
|
|
2367
2389
|
projectRoot: cacheKey.projectRoot,
|
|
2368
2390
|
cacheDir: this.cachePath,
|
|
2369
2391
|
mode: cacheKey.mode,
|
|
2392
|
+
logLevel: config.logLevel || this.config?.logLevel || this.workspaceConfig.logLevel || "info",
|
|
2370
2393
|
skipCache: cacheKey.skipCache
|
|
2371
2394
|
});
|
|
2372
|
-
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2395
|
+
const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
|
|
2373
2396
|
this.mergeUserConfig(userConfig.config);
|
|
2374
2397
|
configCache.set(cacheKey, {
|
|
2375
2398
|
projectJson: this.projectJson,
|
|
@@ -1166,6 +1166,12 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1166
1166
|
* @returns A logger function
|
|
1167
1167
|
*/
|
|
1168
1168
|
extendLog: (name: string) => LogFn;
|
|
1169
|
+
/**
|
|
1170
|
+
* Generates a checksum representing the current context state
|
|
1171
|
+
*
|
|
1172
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
1173
|
+
*/
|
|
1174
|
+
generateChecksum: () => Promise<string>;
|
|
1169
1175
|
}
|
|
1170
1176
|
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1171
1177
|
/**
|
|
@@ -1166,6 +1166,12 @@ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedCon
|
|
|
1166
1166
|
* @returns A logger function
|
|
1167
1167
|
*/
|
|
1168
1168
|
extendLog: (name: string) => LogFn;
|
|
1169
|
+
/**
|
|
1170
|
+
* Generates a checksum representing the current context state
|
|
1171
|
+
*
|
|
1172
|
+
* @returns A promise that resolves to a string representing the checksum
|
|
1173
|
+
*/
|
|
1174
|
+
generateChecksum: () => Promise<string>;
|
|
1169
1175
|
}
|
|
1170
1176
|
type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
|
|
1171
1177
|
/**
|
package/dist/lib/config-file.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
|
|
4
4
|
require('./chunk-USNT2KNT.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "loadUserConfigFile", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkK3NBD5LL_cjs.loadUserConfigFile; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "loadWorkspaceConfig", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkK3NBD5LL_cjs.loadWorkspaceConfig; }
|
|
15
15
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Jiti } from 'jiti';
|
|
2
|
-
import { C as Context, e as WorkspaceConfig, P as PowerlinesCommand, f as ParsedUserConfig } from './config-
|
|
2
|
+
import { C as Context, e as WorkspaceConfig, P as PowerlinesCommand, f as ParsedUserConfig } from './config-BnJpgcGr.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -43,6 +43,7 @@ declare function loadWorkspaceConfig(workspaceRoot: string, cwd: string): Promis
|
|
|
43
43
|
* Loads the user configuration file for the project.
|
|
44
44
|
*
|
|
45
45
|
* @param projectRoot - The root directory of the project.
|
|
46
|
+
* @param workspaceRoot - The root directory of the workspace.
|
|
46
47
|
* @param jiti - An instance of Jiti to resolve modules from
|
|
47
48
|
* @param command - The {@link PowerlinesCommand} string associated with the current running process
|
|
48
49
|
* @param mode - The mode in which the project is running (default is "production").
|
|
@@ -50,7 +51,7 @@ declare function loadWorkspaceConfig(workspaceRoot: string, cwd: string): Promis
|
|
|
50
51
|
* @param framework - The framework name to use for default configuration file names.
|
|
51
52
|
* @returns A promise that resolves to the resolved user configuration.
|
|
52
53
|
*/
|
|
53
|
-
declare function loadUserConfigFile(projectRoot: string, jiti: Jiti, command?: PowerlinesCommand, mode?: string, configFile?: string, framework?: string): Promise<ParsedUserConfig>;
|
|
54
|
+
declare function loadUserConfigFile(projectRoot: string, workspaceRoot: string, jiti: Jiti, command?: PowerlinesCommand, mode?: string, configFile?: string, framework?: string): Promise<ParsedUserConfig>;
|
|
54
55
|
declare type __ΩPartiallyResolvedContext = any[];
|
|
55
56
|
|
|
56
57
|
export { type PartiallyResolvedContext, type __ΩPartiallyResolvedContext, loadUserConfigFile, loadWorkspaceConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Jiti } from 'jiti';
|
|
2
|
-
import { C as Context, e as WorkspaceConfig, P as PowerlinesCommand, f as ParsedUserConfig } from './config-
|
|
2
|
+
import { C as Context, e as WorkspaceConfig, P as PowerlinesCommand, f as ParsedUserConfig } from './config-7Q2dBjJE.js';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
5
5
|
import '@storm-software/config/types';
|
|
@@ -43,6 +43,7 @@ declare function loadWorkspaceConfig(workspaceRoot: string, cwd: string): Promis
|
|
|
43
43
|
* Loads the user configuration file for the project.
|
|
44
44
|
*
|
|
45
45
|
* @param projectRoot - The root directory of the project.
|
|
46
|
+
* @param workspaceRoot - The root directory of the workspace.
|
|
46
47
|
* @param jiti - An instance of Jiti to resolve modules from
|
|
47
48
|
* @param command - The {@link PowerlinesCommand} string associated with the current running process
|
|
48
49
|
* @param mode - The mode in which the project is running (default is "production").
|
|
@@ -50,7 +51,7 @@ declare function loadWorkspaceConfig(workspaceRoot: string, cwd: string): Promis
|
|
|
50
51
|
* @param framework - The framework name to use for default configuration file names.
|
|
51
52
|
* @returns A promise that resolves to the resolved user configuration.
|
|
52
53
|
*/
|
|
53
|
-
declare function loadUserConfigFile(projectRoot: string, jiti: Jiti, command?: PowerlinesCommand, mode?: string, configFile?: string, framework?: string): Promise<ParsedUserConfig>;
|
|
54
|
+
declare function loadUserConfigFile(projectRoot: string, workspaceRoot: string, jiti: Jiti, command?: PowerlinesCommand, mode?: string, configFile?: string, framework?: string): Promise<ParsedUserConfig>;
|
|
54
55
|
declare type __ΩPartiallyResolvedContext = any[];
|
|
55
56
|
|
|
56
57
|
export { type PartiallyResolvedContext, type __ΩPartiallyResolvedContext, loadUserConfigFile, loadWorkspaceConfig };
|
package/dist/lib/config-file.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { loadUserConfigFile, loadWorkspaceConfig } from './chunk-
|
|
1
|
+
export { loadUserConfigFile, loadWorkspaceConfig } from './chunk-XBM7FHNK.js';
|
|
2
2
|
import './chunk-SHUYVCID.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkVLOUSKRX_cjs = require('../chunk-VLOUSKRX.cjs');
|
|
4
|
+
require('../chunk-I6TJUFA6.cjs');
|
|
5
5
|
require('../chunk-B3EE3VHZ.cjs');
|
|
6
|
-
require('../chunk-
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-QABAD5RE.cjs');
|
|
7
|
+
require('../chunk-7VJ42H2I.cjs');
|
|
8
|
+
require('../chunk-K3NBD5LL.cjs');
|
|
9
9
|
require('../chunk-JA4HSQRN.cjs');
|
|
10
10
|
require('../chunk-ISBHXSDH.cjs');
|
|
11
11
|
require('../chunk-USNT2KNT.cjs');
|
|
@@ -14,5 +14,5 @@ require('../chunk-USNT2KNT.cjs');
|
|
|
14
14
|
|
|
15
15
|
Object.defineProperty(exports, "PowerlinesAPIContext", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkVLOUSKRX_cjs.PowerlinesAPIContext; }
|
|
18
18
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as ResolvedConfig, A as APIContext, I as InitialUserConfig, n as EnvironmentContext, L as LogFn, o as Plugin, p as PluginContext, e as WorkspaceConfig, q as EnvironmentResolvedConfig } from '../config-
|
|
1
|
+
import { m as ResolvedConfig, A as APIContext, I as InitialUserConfig, n as EnvironmentContext, L as LogFn, o as Plugin, p as PluginContext, e as WorkspaceConfig, q as EnvironmentResolvedConfig } from '../config-BnJpgcGr.cjs';
|
|
2
2
|
import { PowerlinesContext } from './context.cjs';
|
|
3
3
|
import '@storm-software/build-tools/types';
|
|
4
4
|
import '@storm-software/config-tools/types';
|
|
@@ -28,8 +28,8 @@ import '@stryke/types/array';
|
|
|
28
28
|
import '../tsconfig-Bz-CiFqD.cjs';
|
|
29
29
|
import '@stryke/types/tsconfig';
|
|
30
30
|
import 'typescript';
|
|
31
|
-
import '../internal-
|
|
32
|
-
import '../api-
|
|
31
|
+
import '../internal-BeR8fOB1.cjs';
|
|
32
|
+
import '../api-Cm51oVbC.cjs';
|
|
33
33
|
|
|
34
34
|
declare class PowerlinesAPIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends PowerlinesContext<TResolvedConfig> implements APIContext<TResolvedConfig> {
|
|
35
35
|
#private;
|