@powerlines/nx 0.10.23 → 0.10.26

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/{chunk-IPVB7OAF.js → chunk-2SFOQMAA.js} +34 -494
  3. package/dist/{chunk-7JI7SNPI.js → chunk-4A6Y7MGQ.js} +2 -2
  4. package/dist/{chunk-C7YXZ6X3.mjs → chunk-6UH4EGMN.mjs} +1 -1
  5. package/dist/{chunk-62CNXBCW.js → chunk-6WVDB4DZ.js} +2 -2
  6. package/dist/{chunk-SBOWIOOS.js → chunk-7TPTVC3S.js} +2 -2
  7. package/dist/{chunk-Z6JAOALZ.js → chunk-A26KXB6A.js} +2 -2
  8. package/dist/{chunk-NQA6VVBG.mjs → chunk-A7SAZMVH.mjs} +1 -1
  9. package/dist/{chunk-LTCZN4I4.js → chunk-ACE6O62X.js} +11 -19
  10. package/dist/{chunk-SJ6WM4OK.js → chunk-B5L3T46G.js} +2 -2
  11. package/dist/{chunk-XRMEXEW2.mjs → chunk-BXKPRYNH.mjs} +8 -8
  12. package/dist/{chunk-OY7HISJN.mjs → chunk-IAWSQ5AX.mjs} +27 -487
  13. package/dist/{chunk-7N6FX55G.js → chunk-JPTGZQLU.js} +9 -9
  14. package/dist/{chunk-JFEKW6WO.mjs → chunk-KCL7KVDF.mjs} +1 -1
  15. package/dist/{chunk-R6VKTKIJ.mjs → chunk-L46S3DXB.mjs} +1 -1
  16. package/dist/{chunk-XL4OPEOX.mjs → chunk-ONWCIW2E.mjs} +1 -1
  17. package/dist/{chunk-JZFLLKX7.js → chunk-PJYRCGK4.js} +2 -2
  18. package/dist/{chunk-FMYWKI25.mjs → chunk-X6GFPXO4.mjs} +12 -19
  19. package/dist/{chunk-IZ2DVA7V.mjs → chunk-Z22G7IM3.mjs} +1 -1
  20. package/dist/executors.js +12 -12
  21. package/dist/executors.mjs +7 -7
  22. package/dist/index.js +15 -15
  23. package/dist/index.mjs +9 -9
  24. package/dist/src/base/base-executor.js +3 -3
  25. package/dist/src/base/base-executor.mjs +2 -2
  26. package/dist/src/executors/build/executor.js +5 -5
  27. package/dist/src/executors/build/executor.mjs +3 -3
  28. package/dist/src/executors/clean/executor.js +5 -5
  29. package/dist/src/executors/clean/executor.mjs +3 -3
  30. package/dist/src/executors/docs/executor.js +5 -5
  31. package/dist/src/executors/docs/executor.mjs +3 -3
  32. package/dist/src/executors/lint/executor.js +5 -5
  33. package/dist/src/executors/lint/executor.mjs +3 -3
  34. package/dist/src/executors/prepare/executor.js +5 -5
  35. package/dist/src/executors/prepare/executor.mjs +3 -3
  36. package/dist/src/helpers/plugin-utilities.js +5 -5
  37. package/dist/src/helpers/plugin-utilities.mjs +2 -2
  38. package/dist/src/plugin/index.js +4 -4
  39. package/dist/src/plugin/index.mjs +3 -3
  40. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -2,6 +2,34 @@
2
2
 
3
3
  # Changelog for Powerlines - Nx
4
4
 
5
+ ## [0.10.26](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.26) (11/20/2025)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **nx:** Resolve issue with Nx plugin's `dependsOn` values
10
+ ([2b8ad3d](https://github.com/storm-software/powerlines/commit/2b8ad3d))
11
+
12
+ ### Updated Dependencies
13
+
14
+ - Updated **powerlines** to **v0.23.9**
15
+
16
+ ## [0.10.25](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.25) (11/20/2025)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **powerlines:** Fixed configuration file resolution issues
21
+ ([246a997](https://github.com/storm-software/powerlines/commit/246a997))
22
+
23
+ ### Updated Dependencies
24
+
25
+ - Updated **powerlines** to **v0.23.8**
26
+
27
+ ## [0.10.24](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.24) (11/20/2025)
28
+
29
+ ### Updated Dependencies
30
+
31
+ - Updated **powerlines** to **v0.23.7**
32
+
5
33
  ## [0.10.23](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.23) (11/20/2025)
6
34
 
7
35
  ### Updated Dependencies
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLTCZN4I4_js = require('./chunk-LTCZN4I4.js');
3
+ var chunkACE6O62X_js = require('./chunk-ACE6O62X.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
  var logger = require('@storm-software/config-tools/logger');
6
6
  var baseExecutor = require('@storm-software/workspace-tools/base/base-executor');
@@ -42,6 +42,7 @@ var writeFile$1 = require('@stryke/fs/write-file');
42
42
  var prettier = require('prettier');
43
43
  var getEnvPaths = require('@stryke/env/get-env-paths');
44
44
  var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
45
+ var hashFiles = require('@stryke/hash/hash-files');
45
46
  var murmurhash = require('@stryke/hash/murmurhash');
46
47
  var getUnique = require('@stryke/helpers/get-unique');
47
48
  var omit = require('@stryke/helpers/omit');
@@ -67,14 +68,6 @@ var isParentPath = require('@stryke/path/is-parent-path');
67
68
  var memfs = require('memfs');
68
69
  var unionfs = require('unionfs');
69
70
  var isObject = require('@stryke/type-checks/is-object');
70
- var environmentChecks = require('@stryke/env/environment-checks');
71
- var unplugin = require('unplugin');
72
- var camelCase = require('@stryke/string-format/camel-case');
73
- var bundleRequire = require('bundle-require');
74
- require('@stryke/fs/read-file');
75
- require('magic-string');
76
- var kit = require('@nuxt/kit');
77
- require('@nuxt/schema');
78
71
 
79
72
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
80
73
 
@@ -730,8 +723,8 @@ function isHookExternal(hook) {
730
723
  return hook.startsWith("vite:") || hook.startsWith("esbuild:") || hook.startsWith("rolldown:") || hook.startsWith("rollup:") || hook.startsWith("webpack:") || hook.startsWith("rspack:") || hook.startsWith("farm:");
731
724
  }
732
725
  chunkSHUYVCID_js.__name(isHookExternal, "isHookExternal");
733
- function checkDedupe(plugin, plugins2) {
734
- return plugin.dedupe === false || plugins2.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
726
+ function checkDedupe(plugin, plugins) {
727
+ return plugin.dedupe === false || plugins.some((p) => p.dedupe !== false && (isFunction.isFunction(p.dedupe) && p.dedupe(plugin) || p.name === plugin.name));
735
728
  }
736
729
  chunkSHUYVCID_js.__name(checkDedupe, "checkDedupe");
737
730
  function addPluginHook(context, plugin, pluginHook, hooksList) {
@@ -2684,7 +2677,7 @@ var PowerlinesContext = class _PowerlinesContext {
2684
2677
  * @returns A promise that resolves to the new context.
2685
2678
  */
2686
2679
  static async from(workspaceRoot, config) {
2687
- const context = new _PowerlinesContext(await chunkLTCZN4I4_js.loadWorkspaceConfig(workspaceRoot, config.root));
2680
+ const context = new _PowerlinesContext(await chunkACE6O62X_js.loadWorkspaceConfig(workspaceRoot, config.root));
2688
2681
  await context.withUserConfig(config);
2689
2682
  context.powerlinesPath = await resolve.resolvePackage("powerlines");
2690
2683
  if (!context.powerlinesPath) {
@@ -2781,10 +2774,10 @@ var PowerlinesContext = class _PowerlinesContext {
2781
2774
  workspaceRoot: this.workspaceConfig?.workspaceRoot,
2782
2775
  projectRoot: this.config?.projectRoot
2783
2776
  }, {
2784
- maxLength: chunkLTCZN4I4_js.PROJECT_ROOT_HASH_LENGTH
2777
+ maxLength: chunkACE6O62X_js.PROJECT_ROOT_HASH_LENGTH
2785
2778
  }),
2786
2779
  configHash: murmurhash.murmurhash(this.config, {
2787
- maxLength: chunkLTCZN4I4_js.CACHE_HASH_LENGTH
2780
+ maxLength: chunkACE6O62X_js.CACHE_HASH_LENGTH
2788
2781
  })
2789
2782
  };
2790
2783
  }
@@ -2844,7 +2837,7 @@ var PowerlinesContext = class _PowerlinesContext {
2844
2837
  * Get the path to the data directory for the project
2845
2838
  */
2846
2839
  get dataPath() {
2847
- return join.joinPaths(this.envPaths.data, "projects", chunkLTCZN4I4_js.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
2840
+ return join.joinPaths(this.envPaths.data, "projects", chunkACE6O62X_js.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
2848
2841
  }
2849
2842
  /**
2850
2843
  * Get the path to the cache directory for the project
@@ -2854,7 +2847,7 @@ var PowerlinesContext = class _PowerlinesContext {
2854
2847
  checksum: this.#checksum,
2855
2848
  config: this.meta.configHash
2856
2849
  }, {
2857
- maxLength: chunkLTCZN4I4_js.CACHE_HASH_LENGTH
2850
+ maxLength: chunkACE6O62X_js.CACHE_HASH_LENGTH
2858
2851
  }));
2859
2852
  }
2860
2853
  /**
@@ -3041,6 +3034,26 @@ var PowerlinesContext = class _PowerlinesContext {
3041
3034
  */
3042
3035
  logFn;
3043
3036
  /**
3037
+ * Generates a checksum representing the current context state
3038
+ *
3039
+ * @param root - The root directory of the project to generate the checksum for
3040
+ * @returns A promise that resolves to a string representing the checksum
3041
+ */
3042
+ async generateChecksum(root = this.config.projectRoot) {
3043
+ this.#checksum = await hashFiles.hashDirectory(root, {
3044
+ ignore: [
3045
+ "node_modules",
3046
+ ".git",
3047
+ ".nx",
3048
+ ".cache",
3049
+ ".storm",
3050
+ "tmp",
3051
+ "dist"
3052
+ ]
3053
+ });
3054
+ return this.#checksum;
3055
+ }
3056
+ /**
3044
3057
  * Initialize the context with the provided configuration options
3045
3058
  *
3046
3059
  * @param config - The partial user configuration to use for initialization.
@@ -3072,7 +3085,7 @@ var PowerlinesContext = class _PowerlinesContext {
3072
3085
  if (exists.existsSync(packageJsonPath)) {
3073
3086
  this.packageJson = await json.readJsonFile(packageJsonPath);
3074
3087
  }
3075
- this.#checksum = await chunkLTCZN4I4_js.getChecksum(cacheKey.projectRoot);
3088
+ this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
3076
3089
  this.resolver = createResolver({
3077
3090
  workspaceRoot: this.workspaceConfig.workspaceRoot,
3078
3091
  projectRoot: cacheKey.projectRoot,
@@ -3080,7 +3093,7 @@ var PowerlinesContext = class _PowerlinesContext {
3080
3093
  mode: cacheKey.mode,
3081
3094
  skipCache: cacheKey.skipCache
3082
3095
  });
3083
- const userConfig = await chunkLTCZN4I4_js.loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3096
+ const userConfig = await chunkACE6O62X_js.loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3084
3097
  this.mergeUserConfig(userConfig.config);
3085
3098
  configCache.set(cacheKey, {
3086
3099
  projectJson: this.projectJson,
@@ -3439,7 +3452,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
3439
3452
  * @returns A promise that resolves to the new context.
3440
3453
  */
3441
3454
  static async from(workspaceRoot, config) {
3442
- const context = new _PowerlinesAPIContext(await chunkLTCZN4I4_js.loadWorkspaceConfig(workspaceRoot, config.root));
3455
+ const context = new _PowerlinesAPIContext(await chunkACE6O62X_js.loadWorkspaceConfig(workspaceRoot, config.root));
3443
3456
  await context.withUserConfig(config);
3444
3457
  context.powerlinesPath = await resolve.resolvePackage("powerlines");
3445
3458
  if (!context.powerlinesPath) {
@@ -3627,7 +3640,7 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
3627
3640
 
3628
3641
  ${console.formatLogMessage(context.config)}`);
3629
3642
  context.fs[__VFS_PATCH__]();
3630
- await chunkLTCZN4I4_js.writeMetaFile(context);
3643
+ await chunkACE6O62X_js.writeMetaFile(context);
3631
3644
  context.persistedMeta = context.meta;
3632
3645
  if (!exists.existsSync(context.cachePath)) {
3633
3646
  await helpers.createDirectory(context.cachePath);
@@ -3757,7 +3770,7 @@ ${formatTypes(generatedTypes)}
3757
3770
  throw new Error("Failed to parse the TypeScript configuration file.");
3758
3771
  }
3759
3772
  await this.callPostHook(context, "prepare");
3760
- await chunkLTCZN4I4_js.writeMetaFile(context);
3773
+ await chunkACE6O62X_js.writeMetaFile(context);
3761
3774
  context.fs[__VFS_REVERT__]();
3762
3775
  });
3763
3776
  this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");
@@ -4196,479 +4209,6 @@ Note: Please ensure the plugin package's default export is a class that extends
4196
4209
  }
4197
4210
  }
4198
4211
  };
4199
- var DEFAULT_ESBUILD_CONFIG = {
4200
- target: "esnext",
4201
- platform: "neutral",
4202
- format: "esm",
4203
- write: true,
4204
- minify: true,
4205
- sourcemap: false,
4206
- bundle: true,
4207
- treeShaking: true,
4208
- keepNames: true,
4209
- splitting: true,
4210
- logLevel: "silent"
4211
- };
4212
- function extractESBuildConfig(context) {
4213
- const inject = context.config.build.override.inject ?? context.config.build.inject;
4214
- if (inject && Object.keys(inject).length > 0) {
4215
- context.fs.writeFileSync(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js"), Object.entries(inject).map(([key, value]) => {
4216
- if (value) {
4217
- if (Array.isArray(value)) {
4218
- if (camelCase.camelCase(key) !== key) {
4219
- if (value.length === 1) {
4220
- return `
4221
- import ${camelCase.camelCase(key)} from "${value[0]}";
4222
- export { ${camelCase.camelCase(key)} as "${key}" }`;
4223
- } else if (value.length > 1) {
4224
- return `
4225
- import ${value[1] === "*" ? `* as ${camelCase.camelCase(key)}` : `{ ${value[1]} as ${camelCase.camelCase(key)} }`} from "${value[0]}";
4226
- export { ${camelCase.camelCase(key)} as "${key}" }`;
4227
- }
4228
- } else if (value.length === 1) {
4229
- return `
4230
- import ${key} from "${value[0]}";
4231
- export { ${key} };`;
4232
- } else if (value.length > 1) {
4233
- return `
4234
- import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
4235
- export { ${key} };`;
4236
- }
4237
- } else if (camelCase.camelCase(key) !== key) {
4238
- return `
4239
- import ${camelCase.camelCase(key)} from "${value[0]}";
4240
- export { ${camelCase.camelCase(key)} as "${key}" }`;
4241
- } else {
4242
- return `
4243
- import ${key} from "${value}";
4244
- export { ${key} };`;
4245
- }
4246
- }
4247
- return "";
4248
- }).join("\n"));
4249
- }
4250
- return defu5__default.default({
4251
- alias: context.builtins.reduce((ret, id) => {
4252
- if (!ret[id]) {
4253
- const path = context.fs.ids[id];
4254
- if (path) {
4255
- ret[id] = path;
4256
- }
4257
- }
4258
- return ret;
4259
- }, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias.reduce((ret, alias) => {
4260
- if (!ret[alias.find.toString()]) {
4261
- ret[alias.find.toString()] = alias.replacement;
4262
- }
4263
- return ret;
4264
- }, {}) : context.config.build.alias : {}),
4265
- inject: inject && Object.keys(inject).length > 0 ? [
4266
- joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.artifactsPath, "inject-shim.js")
4267
- ] : void 0
4268
- }, context.config.build.variant === "esbuild" ? omit.omit(context.config.build.override, [
4269
- "alias",
4270
- "inject",
4271
- "external",
4272
- "noExternal",
4273
- "skipNodeModulesBundle",
4274
- "extensions"
4275
- ]) : {}, {
4276
- mainFields: context.config.build.mainFields,
4277
- conditions: context.config.build.conditions,
4278
- define: context.config.build.define,
4279
- resolveExtensions: context.config.build.extensions,
4280
- packages: context.config.build.skipNodeModulesBundle ? "external" : context.config.build.variant === "esbuild" ? context.config.build.packages : void 0,
4281
- format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
4282
- platform: context.config.build.platform,
4283
- treeShaking: Boolean(context.config.build?.treeshake) || context.config.build?.treeShaking,
4284
- outdir: context.config.output.distPath,
4285
- tsconfig: context.tsconfig.tsconfigFilePath,
4286
- tsconfigRaw: context.tsconfig.tsconfigJson
4287
- }, context.config.build.variant === "esbuild" ? omit.omit(context.config.build, [
4288
- "alias",
4289
- "inject",
4290
- "external",
4291
- "noExternal",
4292
- "skipNodeModulesBundle",
4293
- "extensions"
4294
- ]) : {}, {
4295
- minify: context.config.mode !== "development",
4296
- metafile: context.config.mode === "development",
4297
- sourcemap: context.config.mode === "development"
4298
- }, DEFAULT_ESBUILD_CONFIG);
4299
- }
4300
- chunkSHUYVCID_js.__name(extractESBuildConfig, "extractESBuildConfig");
4301
-
4302
- // ../powerlines/src/lib/build/vite.ts
4303
- var DEFAULT_VITE_CONFIG = {
4304
- resolve: {
4305
- extensions: [
4306
- ".mjs",
4307
- ".js",
4308
- ".mts",
4309
- ".ts",
4310
- ".jsx",
4311
- ".tsx",
4312
- ".json"
4313
- ]
4314
- },
4315
- json: {
4316
- stringify: true
4317
- },
4318
- logLevel: "silent",
4319
- clearScreen: true
4320
- };
4321
- function extractViteConfig(context) {
4322
- return defu5__default.default({
4323
- resolve: {
4324
- alias: context.builtins.reduce((ret, id) => {
4325
- if (!ret.find((e) => e.find === id)) {
4326
- const path = context.fs.ids[id];
4327
- if (path) {
4328
- ret.push({
4329
- find: id,
4330
- replacement: path
4331
- });
4332
- }
4333
- }
4334
- return ret;
4335
- }, context.config.build.alias ? Array.isArray(context.config.build.alias) ? context.config.build.alias : Object.entries(context.config.build.alias).reduce((ret, [id, path]) => {
4336
- if (!ret.find((e) => e.find === id)) {
4337
- ret.push({
4338
- find: id,
4339
- replacement: path
4340
- });
4341
- }
4342
- return ret;
4343
- }, []) : []),
4344
- dedupe: context.config.build.dedupe,
4345
- mainFields: context.config.build.mainFields,
4346
- conditions: context.config.build.conditions,
4347
- extensions: context.config.build.extensions
4348
- }
4349
- }, context.config.build.variant === "vite" ? context.config.build.override : {}, {
4350
- define: context.config.build.define,
4351
- rootDir: context.config.sourceRoot,
4352
- platform: context.config.build.platform,
4353
- mode: context.config.mode === "development" ? "development" : "production",
4354
- cacheDir: joinPaths.joinPaths(context.cachePath, "vite"),
4355
- build: {
4356
- outDir: context.config.output.distPath,
4357
- tsconfig: context.tsconfig.tsconfigFilePath,
4358
- tsconfigRaw: context.tsconfig.tsconfigJson
4359
- },
4360
- esbuild: extractESBuildConfig(context),
4361
- logLevel: context.config.logLevel ?? void 0,
4362
- envDir: context.config.projectRoot
4363
- }, context.config.build.variant === "vite" ? context.config.build : {}, {
4364
- build: {
4365
- minify: context.config.mode !== "development",
4366
- metafile: context.config.mode === "development",
4367
- sourcemap: context.config.mode === "development"
4368
- }
4369
- }, DEFAULT_VITE_CONFIG);
4370
- }
4371
- chunkSHUYVCID_js.__name(extractViteConfig, "extractViteConfig");
4372
- function getString(code) {
4373
- if (!code) {
4374
- return "";
4375
- }
4376
- if (isString.isString(code)) {
4377
- return code;
4378
- }
4379
- if (isSetObject.isSetObject(code) && "code" in code) {
4380
- return code.code;
4381
- }
4382
- return code.toString();
4383
- }
4384
- chunkSHUYVCID_js.__name(getString, "getString");
4385
- var NON_NODE_MODULE_REGEX = /^[A-Z]:[/\\]|^\.{0,2}\/|^\.{1,2}$/;
4386
- async function handleResolveId(context, args, options = {}) {
4387
- if (args.id) {
4388
- if (context.fs.isVirtual(args.id) || args.importer && context.fs.isVirtual(args.id, {
4389
- paths: [
4390
- args.importer
4391
- ]
4392
- })) {
4393
- const resolvedPath = args.importer ? context.fs.resolve(args.id, {
4394
- paths: [
4395
- args.importer
4396
- ]
4397
- }) : context.fs.resolve(args.id);
4398
- if (resolvedPath) {
4399
- return {
4400
- id: resolvedPath,
4401
- external: context.config.projectType !== "application"
4402
- };
4403
- }
4404
- }
4405
- if (!!context.tsconfig.options.paths && Object.keys(context.tsconfig.options.paths).some((path) => args.id.startsWith(path.replaceAll("*", "")))) {
4406
- let tsconfigPath = false;
4407
- if (context.tsconfig.options.paths) {
4408
- for (const tsconfigPathKey of Object.keys(context.tsconfig.options.paths).filter((tsconfigPath2) => args.id.startsWith(tsconfigPath2.replaceAll("*", "")))) {
4409
- const resolvedPath = context.tsconfig.options.paths[tsconfigPathKey]?.find((tsconfigPath2) => context.fs.resolve(join.joinPaths(context.workspaceConfig.workspaceRoot, tsconfigPath2.replaceAll("*", ""), args.id.replace(tsconfigPathKey.replaceAll("*", ""), ""))) || context.fs.formatPath(tsconfigPath2) === context.fs.formatPath(args.id));
4410
- if (resolvedPath) {
4411
- tsconfigPath = context.fs.formatPath(resolvedPath) === context.fs.formatPath(args.id) ? context.fs.formatPath(resolvedPath) : context.fs.resolve(join.joinPaths(context.workspaceConfig.workspaceRoot, resolvedPath.replaceAll("*", ""), args.id.replace(tsconfigPathKey.replaceAll("*", ""), "")));
4412
- }
4413
- }
4414
- }
4415
- let tsconfigPathPackage = false;
4416
- if (context.tsconfig.options.paths) {
4417
- const tsconfigPathKeys = Object.keys(context.tsconfig.options.paths).filter((tsconfigPath2) => args.id.startsWith(tsconfigPath2.replaceAll("*", "")));
4418
- if (tsconfigPathKeys.length > 0 && tsconfigPathKeys[0]) {
4419
- tsconfigPathPackage = tsconfigPathKeys[0].replace(/\/\*$/, "");
4420
- }
4421
- }
4422
- if (tsconfigPath && tsconfigPathPackage) {
4423
- return {
4424
- id: tsconfigPath,
4425
- external: Boolean(!options.noExternal?.includes(tsconfigPathPackage) && (options.external?.includes(tsconfigPathPackage) ?? context.config.projectType !== "application"))
4426
- };
4427
- }
4428
- }
4429
- if (options.skipResolve) {
4430
- return void 0;
4431
- }
4432
- if (options.skipNodeModulesBundle) {
4433
- if (bundleRequire.match(args.id, options.resolvePatterns) || bundleRequire.match(args.id, options.noExternal) || args.id.startsWith("internal:") || args.id.startsWith("virtual:")) {
4434
- return void 0;
4435
- }
4436
- if (bundleRequire.match(args.id, options.external) || args.id.startsWith("node:")) {
4437
- return {
4438
- id: args.id,
4439
- external: true
4440
- };
4441
- }
4442
- if (!NON_NODE_MODULE_REGEX.test(args.id)) {
4443
- return {
4444
- id: args.id,
4445
- external: true
4446
- };
4447
- }
4448
- } else {
4449
- const resolvedPath = context.fs.resolve(args.id, {
4450
- paths: args.importer ? [
4451
- args.importer
4452
- ] : []
4453
- });
4454
- if (bundleRequire.match(args.id, options.noExternal) || resolvedPath && context.fs.metadata[resolvedPath]?.type === "builtin") {
4455
- return void 0;
4456
- }
4457
- if (bundleRequire.match(args.id, options.external) || args.id.startsWith("node:")) {
4458
- return {
4459
- id: args.id,
4460
- external: true
4461
- };
4462
- }
4463
- }
4464
- }
4465
- return void 0;
4466
- }
4467
- chunkSHUYVCID_js.__name(handleResolveId, "handleResolveId");
4468
-
4469
- // ../powerlines/src/lib/unplugin/factory.ts
4470
- function createUnpluginFactory(variant, decorate) {
4471
- return (config, meta) => {
4472
- const log = createLog("unplugin", config);
4473
- log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
4474
- try {
4475
- const userConfig = {
4476
- ...config,
4477
- variant,
4478
- unplugin: meta
4479
- };
4480
- let api;
4481
- let resolvePatterns = [];
4482
- async function buildStart() {
4483
- log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
4484
- const workspaceRoot = getWorkspaceRoot.getWorkspaceRoot(process.cwd());
4485
- api = await PowerlinesAPI.from(workspaceRoot, userConfig);
4486
- if (api.context.config.build.skipNodeModulesBundle) {
4487
- resolvePatterns = bundleRequire.tsconfigPathsToRegExp(api.context.tsconfig.options.paths ?? []);
4488
- }
4489
- log(types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
4490
- await api.prepare({
4491
- command: "build"
4492
- });
4493
- }
4494
- chunkSHUYVCID_js.__name(buildStart, "buildStart");
4495
- async function resolveId(id, importer, options = {
4496
- isEntry: false
4497
- }) {
4498
- return handleResolveId(api.context, {
4499
- id,
4500
- importer,
4501
- options
4502
- }, {
4503
- skipNodeModulesBundle: api.context.config.build.skipNodeModulesBundle,
4504
- external: api.context.config.build.external,
4505
- noExternal: api.context.config.build.noExternal,
4506
- resolvePatterns
4507
- });
4508
- }
4509
- chunkSHUYVCID_js.__name(resolveId, "resolveId");
4510
- async function load(id) {
4511
- const environment = await api.context.getEnvironment();
4512
- if (id) {
4513
- const resolvedPath = environment.fs.resolve(id);
4514
- if (resolvedPath) {
4515
- return environment.fs.readFile(resolvedPath);
4516
- }
4517
- }
4518
- let result2 = await api.callPreHook(environment, "load", id);
4519
- if (result2) {
4520
- return result2;
4521
- }
4522
- result2 = await api.callNormalHook(environment, "load", id);
4523
- if (result2) {
4524
- return result2;
4525
- }
4526
- return api.callPostHook(environment, "load", id);
4527
- }
4528
- chunkSHUYVCID_js.__name(load, "load");
4529
- async function transform(code, id) {
4530
- const environment = await api.context.getEnvironment();
4531
- let transformed = code;
4532
- let result2 = await api.callPreHook(environment, "transform", getString(transformed), id);
4533
- if (result2) {
4534
- transformed = result2;
4535
- }
4536
- result2 = await api.callNormalHook(environment, "transform", getString(transformed), id);
4537
- if (result2) {
4538
- transformed = result2;
4539
- }
4540
- result2 = await api.callPostHook(environment, "transform", getString(transformed), id);
4541
- if (result2) {
4542
- transformed = result2;
4543
- }
4544
- return transformed;
4545
- }
4546
- chunkSHUYVCID_js.__name(transform, "transform");
4547
- async function writeBundle() {
4548
- log(types.LogLevelLabel.DEBUG, "Finalizing Powerlines project output...");
4549
- const environment = await api.context.getEnvironment();
4550
- await api.callHook(environment, "writeBundle");
4551
- }
4552
- chunkSHUYVCID_js.__name(writeBundle, "writeBundle");
4553
- const result = {
4554
- name: "powerlines",
4555
- api,
4556
- resolveId: {
4557
- filter: {
4558
- id: {
4559
- include: [
4560
- /.*/
4561
- ]
4562
- }
4563
- },
4564
- handler: resolveId
4565
- },
4566
- load: {
4567
- filter: {
4568
- id: {
4569
- include: [
4570
- /.*/,
4571
- /^storm:/
4572
- ]
4573
- }
4574
- },
4575
- handler: load
4576
- },
4577
- transform,
4578
- buildStart,
4579
- writeBundle
4580
- };
4581
- return decorate ? decorate(api, result) : result;
4582
- } catch (error) {
4583
- log(types.LogLevelLabel.FATAL, error?.message);
4584
- throw error;
4585
- }
4586
- };
4587
- }
4588
- chunkSHUYVCID_js.__name(createUnpluginFactory, "createUnpluginFactory");
4589
-
4590
- // ../powerlines/src/vite.ts
4591
- var vite = unplugin.createVitePlugin(createUnpluginFactory("vite", (api, plugin) => {
4592
- return {
4593
- ...plugin,
4594
- vite: {
4595
- sharedDuringBuild: true,
4596
- async hotUpdate(options) {
4597
- const environment = await api.context.getEnvironment();
4598
- return api.callHook(environment, "vite:hotUpdate", options);
4599
- },
4600
- async config(config, env) {
4601
- api.context.config.mode = environmentChecks.isDevelopmentMode(env.mode) ? "development" : environmentChecks.isTestMode(env.mode) ? "test" : "production";
4602
- const environment = await api.context.getEnvironment();
4603
- const result = await api.callHook(environment, "config");
4604
- return defu5__default.default(
4605
- extractViteConfig(api.context),
4606
- // Need to use `any` here to avoid excessive type complexity
4607
- result?.build ?? {},
4608
- config
4609
- );
4610
- },
4611
- async configResolved(_config) {
4612
- const environment = await api.context.getEnvironment();
4613
- await api.callHook(environment, "configResolved");
4614
- },
4615
- async configureServer(server) {
4616
- const environment = await api.context.getEnvironment();
4617
- return api.callHook(environment, "vite:configureServer", server);
4618
- },
4619
- async configurePreviewServer(server) {
4620
- const environment = await api.context.getEnvironment();
4621
- return api.callHook(environment, "vite:configurePreviewServer", server);
4622
- },
4623
- async transformIndexHtml(html, ctx) {
4624
- const environment = await api.context.getEnvironment();
4625
- return api.callHook(environment, "vite:transformIndexHtml", html, ctx);
4626
- },
4627
- async handleHotUpdate(ctx) {
4628
- const environment = await api.context.getEnvironment();
4629
- return api.callHook(environment, "vite:handleHotUpdate", ctx);
4630
- }
4631
- }
4632
- };
4633
- }));
4634
- var vite_default = vite;
4635
- unplugin.createEsbuildPlugin(createUnpluginFactory("esbuild", (api, plugin) => {
4636
- return {
4637
- ...plugin,
4638
- esbuild: {
4639
- config: /* @__PURE__ */ chunkSHUYVCID_js.__name((options) => {
4640
- options ??= {};
4641
- const result = extractESBuildConfig(api.context);
4642
- for (const key in result) {
4643
- if (isUndefined.isUndefined(options[key]) && !isUndefined.isUndefined(result[key])) {
4644
- options[key] = result[key];
4645
- }
4646
- }
4647
- }, "config"),
4648
- setup: /* @__PURE__ */ chunkSHUYVCID_js.__name(async (build) => {
4649
- const environment = await api.context.getEnvironment();
4650
- return api.callHook(environment, "esbuild:setup", build);
4651
- }, "setup")
4652
- }
4653
- };
4654
- }));
4655
- var webpack = unplugin.createWebpackPlugin(createUnpluginFactory("webpack"));
4656
- var webpack_default = webpack;
4657
- kit.defineNuxtModule({
4658
- meta: {
4659
- name: "powerlines",
4660
- configKey: "storm"
4661
- },
4662
- defaults: {},
4663
- setup(options, _nuxt) {
4664
- kit.addVitePlugin(() => vite_default(options));
4665
- kit.addWebpackPlugin(() => webpack_default(options));
4666
- }
4667
- });
4668
- unplugin.createRolldownPlugin(createUnpluginFactory("rolldown"));
4669
- unplugin.createRollupPlugin(createUnpluginFactory("rollup"));
4670
- unplugin.createRspackPlugin(createUnpluginFactory("rspack"));
4671
- unplugin.createUnloaderPlugin(createUnpluginFactory("unloader"));
4672
4212
 
4673
4213
  // ../powerlines/src/index.ts
4674
4214
  var src_default = PowerlinesAPI;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkIPVB7OAF_js = require('./chunk-IPVB7OAF.js');
3
+ var chunk2SFOQMAA_js = require('./chunk-2SFOQMAA.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
  var defu = require('defu');
6
6
 
@@ -19,7 +19,7 @@ async function executorFn(context, api) {
19
19
  };
20
20
  }
21
21
  chunkSHUYVCID_js.__name(executorFn, "executorFn");
22
- var executor = chunkIPVB7OAF_js.withExecutor("build", executorFn);
22
+ var executor = chunk2SFOQMAA_js.withExecutor("build", executorFn);
23
23
  var executor_default = executor;
24
24
 
25
25
  exports.executorFn = executorFn;
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-OY7HISJN.mjs';
1
+ import { withExecutor } from './chunk-IAWSQ5AX.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
  import defu from 'defu';
4
4