@powerlines/nx 0.10.24 → 0.10.27

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 (46) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/{chunk-LTCZN4I4.js → chunk-2PYUYDPD.js} +11 -19
  3. package/dist/{chunk-EYCHNX35.js → chunk-2W5L3QE3.js} +2 -2
  4. package/dist/{chunk-GFUZORW3.js → chunk-2YSHMNU6.js} +2 -2
  5. package/dist/{chunk-4QIKRF4D.mjs → chunk-DMX7BNND.mjs} +28 -20
  6. package/dist/{chunk-AQAUVXZI.js → chunk-ELZO2KAE.js} +2 -2
  7. package/dist/{chunk-PNGMBVSP.mjs → chunk-EWXGKWHK.mjs} +1 -1
  8. package/dist/{chunk-BGLSTX6F.js → chunk-I7QVZOFS.js} +2 -2
  9. package/dist/{chunk-JV366LTN.mjs → chunk-LH6XKDMA.mjs} +1 -1
  10. package/dist/{chunk-RCEEHPJE.mjs → chunk-LQRLEK65.mjs} +1 -1
  11. package/dist/{chunk-676DOF5H.js → chunk-MAMHMV35.js} +28 -20
  12. package/dist/{chunk-HJUENOPY.mjs → chunk-U2ZZ4QLS.mjs} +26 -3
  13. package/dist/{chunk-RAUJ3U2D.js → chunk-UAUZWBTW.js} +34 -11
  14. package/dist/{chunk-N5IOYNUV.js → chunk-V5EQMHJX.js} +2 -2
  15. package/dist/{chunk-TSJZC5A3.mjs → chunk-WAXOGGDZ.mjs} +1 -1
  16. package/dist/{chunk-FMYWKI25.mjs → chunk-WGIN2BGP.mjs} +12 -19
  17. package/dist/{chunk-ECQAG447.mjs → chunk-WNLIJGN4.mjs} +1 -1
  18. package/dist/{chunk-R6VKTKIJ.mjs → chunk-Y4WK22DY.mjs} +1 -1
  19. package/dist/{chunk-PZGSOSV4.js → chunk-YPABMWPC.js} +2 -2
  20. package/dist/executors.js +12 -12
  21. package/dist/executors.mjs +7 -7
  22. package/dist/index.js +18 -18
  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/dist/src/types/plugin.d.mts +24 -0
  41. package/dist/src/types/plugin.d.ts +24 -0
  42. package/package.json +10 -10
  43. package/dist/chunk-62CNXBCW.js +0 -10
  44. package/dist/chunk-7N6FX55G.js +0 -347
  45. package/dist/chunk-SAVSMAFN.mjs +0 -8
  46. package/dist/chunk-XRMEXEW2.mjs +0 -339
package/CHANGELOG.md CHANGED
@@ -2,6 +2,39 @@
2
2
 
3
3
  # Changelog for Powerlines - Nx
4
4
 
5
+ ## [0.10.27](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.27) (11/21/2025)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **powerlines:** Fix config file path resolution issue
10
+ ([c201914](https://github.com/storm-software/powerlines/commit/c201914))
11
+
12
+ ### Updated Dependencies
13
+
14
+ - Updated **powerlines** to **v0.23.10**
15
+
16
+ ## [0.10.26](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.26) (11/20/2025)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **nx:** Resolve issue with Nx plugin's `dependsOn` values
21
+ ([2b8ad3d](https://github.com/storm-software/powerlines/commit/2b8ad3d))
22
+
23
+ ### Updated Dependencies
24
+
25
+ - Updated **powerlines** to **v0.23.9**
26
+
27
+ ## [0.10.25](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.25) (11/20/2025)
28
+
29
+ ### Bug Fixes
30
+
31
+ - **powerlines:** Fixed configuration file resolution issues
32
+ ([246a997](https://github.com/storm-software/powerlines/commit/246a997))
33
+
34
+ ### Updated Dependencies
35
+
36
+ - Updated **powerlines** to **v0.23.8**
37
+
5
38
  ## [0.10.24](https://github.com/storm-software/powerlines/releases/tag/nx%400.10.24) (11/20/2025)
6
39
 
7
40
  ### Updated Dependencies
@@ -3,7 +3,9 @@
3
3
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
4
4
  var getConfig = require('@storm-software/config-tools/get-config');
5
5
  var exists = require('@stryke/fs/exists');
6
+ var append = require('@stryke/path/append');
6
7
  var joinPaths = require('@stryke/path/join-paths');
8
+ var replace = require('@stryke/path/replace');
7
9
  var isFunction = require('@stryke/type-checks/is-function');
8
10
  var isSetObject = require('@stryke/type-checks/is-set-object');
9
11
  var c12 = require('c12');
@@ -12,7 +14,6 @@ var types = require('@storm-software/config-tools/types');
12
14
  require('@stryke/fs/json');
13
15
  require('@stryke/fs/list-files');
14
16
  require('@stryke/fs/remove-file');
15
- var hashFiles = require('@stryke/hash/hash-files');
16
17
  require('@stryke/helpers/get-unique');
17
18
  require('@stryke/path/file-path-fns');
18
19
  var kebabCase = require('@stryke/string-format/kebab-case');
@@ -31,9 +32,15 @@ async function loadWorkspaceConfig(workspaceRoot, cwd) {
31
32
  }));
32
33
  }
33
34
  chunkSHUYVCID_js.__name(loadWorkspaceConfig, "loadWorkspaceConfig");
34
- async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile, framework = "powerlines") {
35
+ async function loadUserConfigFile(projectRoot, workspaceRoot, jiti, command, mode = "production", configFile, framework = "powerlines") {
35
36
  let resolvedUserConfig = {};
36
- const resolvedUserConfigFile = configFile && exists.existsSync(configFile) ? configFile : configFile && exists.existsSync(joinPaths.joinPaths(projectRoot, configFile)) ? joinPaths.joinPaths(projectRoot, configFile) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.ts`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.ts`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.js`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.js`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.mts`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.mts`) : exists.existsSync(joinPaths.joinPaths(projectRoot, `${framework}.config.mjs`)) ? joinPaths.joinPaths(projectRoot, `${framework}.config.mjs`) : void 0;
37
+ let resolvedUserConfigFile;
38
+ if (configFile) {
39
+ 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;
40
+ }
41
+ if (!resolvedUserConfigFile) {
42
+ 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;
43
+ }
37
44
  if (resolvedUserConfigFile) {
38
45
  const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
39
46
  if (resolved) {
@@ -41,7 +48,7 @@ async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile,
41
48
  if (isFunction.isFunction(resolved)) {
42
49
  config = await Promise.resolve(resolved({
43
50
  command,
44
- mode: mode || "production",
51
+ mode,
45
52
  isSsrBuild: false,
46
53
  isPreview: false
47
54
  }));
@@ -77,20 +84,6 @@ function getPrefixedProjectRootHash(name, projectRootHash) {
77
84
  return combined.length > PROJECT_ROOT_HASH_LENGTH ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH) : combined;
78
85
  }
79
86
  chunkSHUYVCID_js.__name(getPrefixedProjectRootHash, "getPrefixedProjectRootHash");
80
- async function getChecksum(path) {
81
- return hashFiles.hashDirectory(path, {
82
- ignore: [
83
- "node_modules",
84
- ".git",
85
- ".nx",
86
- ".cache",
87
- ".storm",
88
- "tmp",
89
- "dist"
90
- ]
91
- });
92
- }
93
- chunkSHUYVCID_js.__name(getChecksum, "getChecksum");
94
87
  async function writeMetaFile(context) {
95
88
  const metaFilePath = joinPaths.joinPaths(context.dataPath, "meta.json");
96
89
  context.log(types.LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
@@ -102,7 +95,6 @@ chunkSHUYVCID_js.__name(writeMetaFile, "writeMetaFile");
102
95
 
103
96
  exports.CACHE_HASH_LENGTH = CACHE_HASH_LENGTH;
104
97
  exports.PROJECT_ROOT_HASH_LENGTH = PROJECT_ROOT_HASH_LENGTH;
105
- exports.getChecksum = getChecksum;
106
98
  exports.getPrefixedProjectRootHash = getPrefixedProjectRootHash;
107
99
  exports.loadUserConfigFile = loadUserConfigFile;
108
100
  exports.loadWorkspaceConfig = loadWorkspaceConfig;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRAUJ3U2D_js = require('./chunk-RAUJ3U2D.js');
3
+ var chunkUAUZWBTW_js = require('./chunk-UAUZWBTW.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 = chunkRAUJ3U2D_js.withExecutor("build", executorFn);
22
+ var executor = chunkUAUZWBTW_js.withExecutor("build", executorFn);
23
23
  var executor_default = executor;
24
24
 
25
25
  exports.executorFn = executorFn;
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk676DOF5H_js = require('./chunk-676DOF5H.js');
3
+ var chunkMAMHMV35_js = require('./chunk-MAMHMV35.js');
4
4
 
5
5
  // src/plugin/index.ts
6
- var createNodesV2 = chunk676DOF5H_js.createNxPlugin({
6
+ var createNodesV2 = chunkMAMHMV35_js.createNxPlugin({
7
7
  framework: "powerlines"
8
8
  });
9
9
 
@@ -1,5 +1,5 @@
1
+ import { PROJECT_ROOT_HASH_LENGTH, loadUserConfigFile } from './chunk-WGIN2BGP.mjs';
1
2
  import { CONFIG_INPUTS } from './chunk-LQU7XWFP.mjs';
2
- import { PROJECT_ROOT_HASH_LENGTH, loadUserConfigFile } from './chunk-FMYWKI25.mjs';
3
3
  import { __name } from './chunk-O6YSETKJ.mjs';
4
4
  import { createNodesFromFiles } from '@nx/devkit';
5
5
  import { withNamedInputs } from '@storm-software/workspace-tools/utils/nx-json';
@@ -45,6 +45,14 @@ function createNxPlugin(opts) {
45
45
  throw new Error("The cache directory could not be determined.");
46
46
  }
47
47
  const nxJson = readNxJson(contextV2.workspaceRoot);
48
+ const resolver = createJiti(contextV2.workspaceRoot, {
49
+ debug: !!options?.debug,
50
+ interopDefault: true,
51
+ fsCache: joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, {
52
+ maxLength: PROJECT_ROOT_HASH_LENGTH
53
+ }), "jiti"),
54
+ moduleCache: true
55
+ });
48
56
  return createNodesFromFiles(async (configFile, _, context) => {
49
57
  try {
50
58
  const projectRoot = getProjectRoot(configFile, contextV2.workspaceRoot);
@@ -53,16 +61,10 @@ function createNxPlugin(opts) {
53
61
  return {};
54
62
  }
55
63
  const root = getRoot(projectRoot, context);
56
- const cacheDir = joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, {
57
- maxLength: PROJECT_ROOT_HASH_LENGTH
58
- }));
59
- const jiti = createJiti(joinPaths(contextV2.workspaceRoot, projectRoot), {
60
- interopDefault: true,
61
- fsCache: joinPaths(cacheDir, "jiti"),
62
- moduleCache: true
63
- });
64
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
65
- const userConfig = await loadUserConfigFile(joinPaths(contextV2.workspaceRoot, projectRoot), jiti, "build", "development", joinPaths(contextV2.workspaceRoot, configFile), framework);
64
+ if (options?.debug) {
65
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
66
+ }
67
+ const userConfig = await loadUserConfigFile(projectRoot, contextV2.workspaceRoot, resolver, "build", "development", configFile, framework);
66
68
  if (!existsSync(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
67
69
  console.warn(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${joinPaths(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
68
70
  return {};
@@ -74,7 +76,9 @@ function createNxPlugin(opts) {
74
76
  }
75
77
  const packageJson = JSON.parse(packageJsonContent);
76
78
  if (!userConfig.configFile && !packageJson?.storm) {
77
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
79
+ if (options?.debug) {
80
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
81
+ }
78
82
  return {};
79
83
  }
80
84
  const projectConfig = getProjectConfigFromProjectRoot(projectRoot, packageJson);
@@ -84,7 +88,9 @@ function createNxPlugin(opts) {
84
88
  }
85
89
  const tsconfig = userConfig?.tsconfig || (existsSync(joinPaths(projectRoot, "tsconfig.json")) ? joinPaths(projectRoot, "tsconfig.json") : void 0);
86
90
  const targets = readTargetsFromPackageJson(packageJson, nxJson, projectRoot, context.workspaceRoot);
87
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
91
+ if (options?.debug) {
92
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
93
+ }
88
94
  if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) {
89
95
  targets[options?.clean?.targetName || "clean"] = {
90
96
  inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : withNamedInputs(targetInputs, [
@@ -127,8 +133,8 @@ function createNxPlugin(opts) {
127
133
  executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
128
134
  dependsOn: [
129
135
  `^${options?.prepare?.targetName || "prepare"}`,
130
- "clean"
131
- ],
136
+ options?.clean !== false && `${options?.clean?.targetName || "clean"}`
137
+ ].filter(Boolean),
132
138
  defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
133
139
  options: {
134
140
  entry: userConfig.entry || "{sourceRoot}/index.ts",
@@ -162,7 +168,7 @@ function createNxPlugin(opts) {
162
168
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
163
169
  dependsOn: [
164
170
  `^${options?.build?.targetName || "build"}`,
165
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
171
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
166
172
  ].filter(Boolean),
167
173
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
168
174
  options: {
@@ -204,7 +210,7 @@ function createNxPlugin(opts) {
204
210
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
205
211
  dependsOn: [
206
212
  `^${options?.lint?.targetName || "lint"}`,
207
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
213
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
208
214
  ].filter(Boolean),
209
215
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
210
216
  options: {
@@ -245,7 +251,7 @@ function createNxPlugin(opts) {
245
251
  executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
246
252
  dependsOn: [
247
253
  `^${options?.docs?.targetName || "docs"}`,
248
- options?.build !== false && `^${options?.build?.targetName || "build"}`
254
+ options?.build !== false && `${options?.build?.targetName || "build"}`
249
255
  ].filter(Boolean),
250
256
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
251
257
  options: {
@@ -286,7 +292,7 @@ function createNxPlugin(opts) {
286
292
  executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
287
293
  dependsOn: [
288
294
  `^${options?.deploy?.targetName || "deploy"}`,
289
- options?.build !== false && `^${options?.build?.targetName || "build"}`
295
+ options?.build !== false && `${options?.build?.targetName || "build"}`
290
296
  ].filter(Boolean),
291
297
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
292
298
  options: {
@@ -314,7 +320,9 @@ function createNxPlugin(opts) {
314
320
  addProjectTag(projectConfig, framework, projectConfig.projectType || userConfig.type || "library", {
315
321
  overwrite: true
316
322
  });
317
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
323
+ if (options?.debug) {
324
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
325
+ }
318
326
  return {
319
327
  projects: {
320
328
  [root]: defu(projectConfig, {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRAUJ3U2D_js = require('./chunk-RAUJ3U2D.js');
3
+ var chunkUAUZWBTW_js = require('./chunk-UAUZWBTW.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
 
6
6
  // src/executors/clean/executor.ts
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
11
11
  };
12
12
  }
13
13
  chunkSHUYVCID_js.__name(executorFn, "executorFn");
14
- var executor = chunkRAUJ3U2D_js.withExecutor("clean", executorFn);
14
+ var executor = chunkUAUZWBTW_js.withExecutor("clean", executorFn);
15
15
  var executor_default = executor;
16
16
 
17
17
  exports.executorFn = executorFn;
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-HJUENOPY.mjs';
1
+ import { withExecutor } from './chunk-U2ZZ4QLS.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
 
4
4
  // src/executors/lint/executor.ts
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRAUJ3U2D_js = require('./chunk-RAUJ3U2D.js');
3
+ var chunkUAUZWBTW_js = require('./chunk-UAUZWBTW.js');
4
4
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
5
5
 
6
6
  // src/executors/docs/executor.ts
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
11
11
  };
12
12
  }
13
13
  chunkSHUYVCID_js.__name(executorFn, "executorFn");
14
- var executor = chunkRAUJ3U2D_js.withExecutor("docs", executorFn);
14
+ var executor = chunkUAUZWBTW_js.withExecutor("docs", executorFn);
15
15
  var executor_default = executor;
16
16
 
17
17
  exports.executorFn = executorFn;
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-HJUENOPY.mjs';
1
+ import { withExecutor } from './chunk-U2ZZ4QLS.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
  import defu from 'defu';
4
4
 
@@ -1,4 +1,4 @@
1
- import { withExecutor } from './chunk-HJUENOPY.mjs';
1
+ import { withExecutor } from './chunk-U2ZZ4QLS.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
 
4
4
  // src/executors/clean/executor.ts
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var chunk2PYUYDPD_js = require('./chunk-2PYUYDPD.js');
3
4
  var chunkVIU4CXA3_js = require('./chunk-VIU4CXA3.js');
4
- var chunkLTCZN4I4_js = require('./chunk-LTCZN4I4.js');
5
5
  var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
6
6
  var devkit = require('@nx/devkit');
7
7
  var nxJson = require('@storm-software/workspace-tools/utils/nx-json');
@@ -51,6 +51,14 @@ function createNxPlugin(opts) {
51
51
  throw new Error("The cache directory could not be determined.");
52
52
  }
53
53
  const nxJson$1 = nxJson_js.readNxJson(contextV2.workspaceRoot);
54
+ const resolver = jiti.createJiti(contextV2.workspaceRoot, {
55
+ debug: !!options?.debug,
56
+ interopDefault: true,
57
+ fsCache: joinPaths.joinPaths(envPaths.cache, "nx-plugin", murmurhash.murmurhash(contextV2.workspaceRoot, {
58
+ maxLength: chunk2PYUYDPD_js.PROJECT_ROOT_HASH_LENGTH
59
+ }), "jiti"),
60
+ moduleCache: true
61
+ });
54
62
  return devkit.createNodesFromFiles(async (configFile, _, context) => {
55
63
  try {
56
64
  const projectRoot = pluginHelpers.getProjectRoot(configFile, contextV2.workspaceRoot);
@@ -59,16 +67,10 @@ function createNxPlugin(opts) {
59
67
  return {};
60
68
  }
61
69
  const root = pluginHelpers.getRoot(projectRoot, context);
62
- const cacheDir = joinPaths.joinPaths(envPaths.cache, "nx-plugin", murmurhash.murmurhash(contextV2.workspaceRoot, {
63
- maxLength: chunkLTCZN4I4_js.PROJECT_ROOT_HASH_LENGTH
64
- }));
65
- const jiti$1 = jiti.createJiti(joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot), {
66
- interopDefault: true,
67
- fsCache: joinPaths.joinPaths(cacheDir, "jiti"),
68
- moduleCache: true
69
- });
70
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
71
- const userConfig = await chunkLTCZN4I4_js.loadUserConfigFile(joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot), jiti$1, "build", "development", joinPaths.joinPaths(contextV2.workspaceRoot, configFile), framework);
70
+ if (options?.debug) {
71
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Loading ${framework} user configuration for project in root directory ${projectRoot}.`);
72
+ }
73
+ const userConfig = await chunk2PYUYDPD_js.loadUserConfigFile(projectRoot, contextV2.workspaceRoot, resolver, "build", "development", configFile, framework);
72
74
  if (!exists.existsSync(joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
73
75
  console.warn(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Cannot find \`package.json\` file in the project's root directory (path: "${joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot)}"). Skipping project configuration.`);
74
76
  return {};
@@ -80,7 +82,9 @@ function createNxPlugin(opts) {
80
82
  }
81
83
  const packageJson = JSON.parse(packageJsonContent);
82
84
  if (!userConfig.configFile && !packageJson?.storm) {
83
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
85
+ if (options?.debug) {
86
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
87
+ }
84
88
  return {};
85
89
  }
86
90
  const projectConfig = pluginHelpers.getProjectConfigFromProjectRoot(projectRoot, packageJson);
@@ -90,7 +94,9 @@ function createNxPlugin(opts) {
90
94
  }
91
95
  const tsconfig = userConfig?.tsconfig || (exists.existsSync(joinPaths.joinPaths(projectRoot, "tsconfig.json")) ? joinPaths.joinPaths(projectRoot, "tsconfig.json") : void 0);
92
96
  const targets = packageJson_js.readTargetsFromPackageJson(packageJson, nxJson$1, projectRoot, context.workspaceRoot);
93
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
97
+ if (options?.debug) {
98
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Preparing Nx targets for project in root directory ${projectRoot}.`);
99
+ }
94
100
  if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) {
95
101
  targets[options?.clean?.targetName || "clean"] = {
96
102
  inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : nxJson.withNamedInputs(targetInputs, [
@@ -133,8 +139,8 @@ function createNxPlugin(opts) {
133
139
  executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
134
140
  dependsOn: [
135
141
  `^${options?.prepare?.targetName || "prepare"}`,
136
- "clean"
137
- ],
142
+ options?.clean !== false && `${options?.clean?.targetName || "clean"}`
143
+ ].filter(Boolean),
138
144
  defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
139
145
  options: {
140
146
  entry: userConfig.entry || "{sourceRoot}/index.ts",
@@ -168,7 +174,7 @@ function createNxPlugin(opts) {
168
174
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
169
175
  dependsOn: [
170
176
  `^${options?.build?.targetName || "build"}`,
171
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
177
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
172
178
  ].filter(Boolean),
173
179
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
174
180
  options: {
@@ -210,7 +216,7 @@ function createNxPlugin(opts) {
210
216
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
211
217
  dependsOn: [
212
218
  `^${options?.lint?.targetName || "lint"}`,
213
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
219
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
214
220
  ].filter(Boolean),
215
221
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
216
222
  options: {
@@ -251,7 +257,7 @@ function createNxPlugin(opts) {
251
257
  executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
252
258
  dependsOn: [
253
259
  `^${options?.docs?.targetName || "docs"}`,
254
- options?.build !== false && `^${options?.build?.targetName || "build"}`
260
+ options?.build !== false && `${options?.build?.targetName || "build"}`
255
261
  ].filter(Boolean),
256
262
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
257
263
  options: {
@@ -292,7 +298,7 @@ function createNxPlugin(opts) {
292
298
  executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
293
299
  dependsOn: [
294
300
  `^${options?.deploy?.targetName || "deploy"}`,
295
- options?.build !== false && `^${options?.build?.targetName || "build"}`
301
+ options?.build !== false && `${options?.build?.targetName || "build"}`
296
302
  ].filter(Boolean),
297
303
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
298
304
  options: {
@@ -320,7 +326,9 @@ function createNxPlugin(opts) {
320
326
  projectTags.addProjectTag(projectConfig, framework, projectConfig.projectType || userConfig.type || "library", {
321
327
  overwrite: true
322
328
  });
323
- console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
329
+ if (options?.debug) {
330
+ console.debug(`[${name}] - ${(/* @__PURE__ */ new Date()).toISOString()} - Completed preparing Nx configuration for project in root directory ${projectRoot}.`);
331
+ }
324
332
  return {
325
333
  projects: {
326
334
  [root]: defu__default.default(projectConfig, {
@@ -1,4 +1,4 @@
1
- import { loadWorkspaceConfig, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, getChecksum, loadUserConfigFile, writeMetaFile } from './chunk-FMYWKI25.mjs';
1
+ import { loadWorkspaceConfig, CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash, loadUserConfigFile, writeMetaFile } from './chunk-WGIN2BGP.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
  import { getLogFn, getLogLevel, writeError } from '@storm-software/config-tools/logger';
4
4
  import { withRunExecutor } from '@storm-software/workspace-tools/base/base-executor';
@@ -40,6 +40,7 @@ import { writeFile as writeFile$1 } from '@stryke/fs/write-file';
40
40
  import { resolveConfig, format } from 'prettier';
41
41
  import { getEnvPaths } from '@stryke/env/get-env-paths';
42
42
  import { relativeToWorkspaceRoot } from '@stryke/fs/get-workspace-root';
43
+ import { hashDirectory } from '@stryke/hash/hash-files';
43
44
  import { murmurhash } from '@stryke/hash/murmurhash';
44
45
  import { getUnique, getUniqueBy } from '@stryke/helpers/get-unique';
45
46
  import { omit } from '@stryke/helpers/omit';
@@ -623,6 +624,7 @@ function createDefaultEnvironment(userConfig) {
623
624
  __name(createDefaultEnvironment, "createDefaultEnvironment");
624
625
  function resolveOptions(options) {
625
626
  return defu5(options, {
627
+ debug: options.logLevel === "trace",
626
628
  interopDefault: true,
627
629
  fsCache: options.mode !== "development" ? joinPaths$1(options.cacheDir, "jiti") : false,
628
630
  moduleCache: options.mode !== "development"
@@ -3003,6 +3005,26 @@ var PowerlinesContext = class _PowerlinesContext {
3003
3005
  */
3004
3006
  logFn;
3005
3007
  /**
3008
+ * Generates a checksum representing the current context state
3009
+ *
3010
+ * @param root - The root directory of the project to generate the checksum for
3011
+ * @returns A promise that resolves to a string representing the checksum
3012
+ */
3013
+ async generateChecksum(root = this.config.projectRoot) {
3014
+ this.#checksum = await hashDirectory(root, {
3015
+ ignore: [
3016
+ "node_modules",
3017
+ ".git",
3018
+ ".nx",
3019
+ ".cache",
3020
+ ".storm",
3021
+ "tmp",
3022
+ "dist"
3023
+ ]
3024
+ });
3025
+ return this.#checksum;
3026
+ }
3027
+ /**
3006
3028
  * Initialize the context with the provided configuration options
3007
3029
  *
3008
3030
  * @param config - The partial user configuration to use for initialization.
@@ -3034,15 +3056,16 @@ var PowerlinesContext = class _PowerlinesContext {
3034
3056
  if (existsSync(packageJsonPath)) {
3035
3057
  this.packageJson = await readJsonFile(packageJsonPath);
3036
3058
  }
3037
- this.#checksum = await getChecksum(cacheKey.projectRoot);
3059
+ this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
3038
3060
  this.resolver = createResolver({
3039
3061
  workspaceRoot: this.workspaceConfig.workspaceRoot,
3040
3062
  projectRoot: cacheKey.projectRoot,
3041
3063
  cacheDir: this.cachePath,
3042
3064
  mode: cacheKey.mode,
3065
+ logLevel: config.logLevel || this.config?.logLevel || this.workspaceConfig.logLevel || "info",
3043
3066
  skipCache: cacheKey.skipCache
3044
3067
  });
3045
- const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3068
+ const userConfig = await loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3046
3069
  this.mergeUserConfig(userConfig.config);
3047
3070
  configCache.set(cacheKey, {
3048
3071
  projectJson: this.projectJson,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkLTCZN4I4_js = require('./chunk-LTCZN4I4.js');
3
+ var chunk2PYUYDPD_js = require('./chunk-2PYUYDPD.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');
@@ -653,6 +654,7 @@ function createDefaultEnvironment(userConfig) {
653
654
  chunkSHUYVCID_js.__name(createDefaultEnvironment, "createDefaultEnvironment");
654
655
  function resolveOptions(options) {
655
656
  return defu5__default.default(options, {
657
+ debug: options.logLevel === "trace",
656
658
  interopDefault: true,
657
659
  fsCache: options.mode !== "development" ? joinPaths.joinPaths(options.cacheDir, "jiti") : false,
658
660
  moduleCache: options.mode !== "development"
@@ -2676,7 +2678,7 @@ var PowerlinesContext = class _PowerlinesContext {
2676
2678
  * @returns A promise that resolves to the new context.
2677
2679
  */
2678
2680
  static async from(workspaceRoot, config) {
2679
- const context = new _PowerlinesContext(await chunkLTCZN4I4_js.loadWorkspaceConfig(workspaceRoot, config.root));
2681
+ const context = new _PowerlinesContext(await chunk2PYUYDPD_js.loadWorkspaceConfig(workspaceRoot, config.root));
2680
2682
  await context.withUserConfig(config);
2681
2683
  context.powerlinesPath = await resolve.resolvePackage("powerlines");
2682
2684
  if (!context.powerlinesPath) {
@@ -2773,10 +2775,10 @@ var PowerlinesContext = class _PowerlinesContext {
2773
2775
  workspaceRoot: this.workspaceConfig?.workspaceRoot,
2774
2776
  projectRoot: this.config?.projectRoot
2775
2777
  }, {
2776
- maxLength: chunkLTCZN4I4_js.PROJECT_ROOT_HASH_LENGTH
2778
+ maxLength: chunk2PYUYDPD_js.PROJECT_ROOT_HASH_LENGTH
2777
2779
  }),
2778
2780
  configHash: murmurhash.murmurhash(this.config, {
2779
- maxLength: chunkLTCZN4I4_js.CACHE_HASH_LENGTH
2781
+ maxLength: chunk2PYUYDPD_js.CACHE_HASH_LENGTH
2780
2782
  })
2781
2783
  };
2782
2784
  }
@@ -2836,7 +2838,7 @@ var PowerlinesContext = class _PowerlinesContext {
2836
2838
  * Get the path to the data directory for the project
2837
2839
  */
2838
2840
  get dataPath() {
2839
- return join.joinPaths(this.envPaths.data, "projects", chunkLTCZN4I4_js.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
2841
+ return join.joinPaths(this.envPaths.data, "projects", chunk2PYUYDPD_js.getPrefixedProjectRootHash(this.config.name, this.meta.projectRootHash));
2840
2842
  }
2841
2843
  /**
2842
2844
  * Get the path to the cache directory for the project
@@ -2846,7 +2848,7 @@ var PowerlinesContext = class _PowerlinesContext {
2846
2848
  checksum: this.#checksum,
2847
2849
  config: this.meta.configHash
2848
2850
  }, {
2849
- maxLength: chunkLTCZN4I4_js.CACHE_HASH_LENGTH
2851
+ maxLength: chunk2PYUYDPD_js.CACHE_HASH_LENGTH
2850
2852
  }));
2851
2853
  }
2852
2854
  /**
@@ -3033,6 +3035,26 @@ var PowerlinesContext = class _PowerlinesContext {
3033
3035
  */
3034
3036
  logFn;
3035
3037
  /**
3038
+ * Generates a checksum representing the current context state
3039
+ *
3040
+ * @param root - The root directory of the project to generate the checksum for
3041
+ * @returns A promise that resolves to a string representing the checksum
3042
+ */
3043
+ async generateChecksum(root = this.config.projectRoot) {
3044
+ this.#checksum = await hashFiles.hashDirectory(root, {
3045
+ ignore: [
3046
+ "node_modules",
3047
+ ".git",
3048
+ ".nx",
3049
+ ".cache",
3050
+ ".storm",
3051
+ "tmp",
3052
+ "dist"
3053
+ ]
3054
+ });
3055
+ return this.#checksum;
3056
+ }
3057
+ /**
3036
3058
  * Initialize the context with the provided configuration options
3037
3059
  *
3038
3060
  * @param config - The partial user configuration to use for initialization.
@@ -3064,15 +3086,16 @@ var PowerlinesContext = class _PowerlinesContext {
3064
3086
  if (exists.existsSync(packageJsonPath)) {
3065
3087
  this.packageJson = await json.readJsonFile(packageJsonPath);
3066
3088
  }
3067
- this.#checksum = await chunkLTCZN4I4_js.getChecksum(cacheKey.projectRoot);
3089
+ this.#checksum = await this.generateChecksum(cacheKey.projectRoot);
3068
3090
  this.resolver = createResolver({
3069
3091
  workspaceRoot: this.workspaceConfig.workspaceRoot,
3070
3092
  projectRoot: cacheKey.projectRoot,
3071
3093
  cacheDir: this.cachePath,
3072
3094
  mode: cacheKey.mode,
3095
+ logLevel: config.logLevel || this.config?.logLevel || this.workspaceConfig.logLevel || "info",
3073
3096
  skipCache: cacheKey.skipCache
3074
3097
  });
3075
- const userConfig = await chunkLTCZN4I4_js.loadUserConfigFile(cacheKey.projectRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3098
+ const userConfig = await chunk2PYUYDPD_js.loadUserConfigFile(cacheKey.projectRoot, this.workspaceConfig.workspaceRoot, this.resolver, cacheKey.command, cacheKey.mode, cacheKey.configFile, cacheKey.framework);
3076
3099
  this.mergeUserConfig(userConfig.config);
3077
3100
  configCache.set(cacheKey, {
3078
3101
  projectJson: this.projectJson,
@@ -3431,7 +3454,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends PowerlinesContext
3431
3454
  * @returns A promise that resolves to the new context.
3432
3455
  */
3433
3456
  static async from(workspaceRoot, config) {
3434
- const context = new _PowerlinesAPIContext(await chunkLTCZN4I4_js.loadWorkspaceConfig(workspaceRoot, config.root));
3457
+ const context = new _PowerlinesAPIContext(await chunk2PYUYDPD_js.loadWorkspaceConfig(workspaceRoot, config.root));
3435
3458
  await context.withUserConfig(config);
3436
3459
  context.powerlinesPath = await resolve.resolvePackage("powerlines");
3437
3460
  if (!context.powerlinesPath) {
@@ -3619,7 +3642,7 @@ ${context.entry.map((entry) => `- ${entry.input.file || entry.file}${entry.outpu
3619
3642
 
3620
3643
  ${console.formatLogMessage(context.config)}`);
3621
3644
  context.fs[__VFS_PATCH__]();
3622
- await chunkLTCZN4I4_js.writeMetaFile(context);
3645
+ await chunk2PYUYDPD_js.writeMetaFile(context);
3623
3646
  context.persistedMeta = context.meta;
3624
3647
  if (!exists.existsSync(context.cachePath)) {
3625
3648
  await helpers.createDirectory(context.cachePath);
@@ -3749,7 +3772,7 @@ ${formatTypes(generatedTypes)}
3749
3772
  throw new Error("Failed to parse the TypeScript configuration file.");
3750
3773
  }
3751
3774
  await this.callPostHook(context, "prepare");
3752
- await chunkLTCZN4I4_js.writeMetaFile(context);
3775
+ await chunk2PYUYDPD_js.writeMetaFile(context);
3753
3776
  context.fs[__VFS_REVERT__]();
3754
3777
  });
3755
3778
  this.context.log(types.LogLevelLabel.INFO, "Powerlines API has been prepared successfully");