@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
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk7N6FX55G_js = require('./chunk-7N6FX55G.js');
3
+ var chunkJPTGZQLU_js = require('./chunk-JPTGZQLU.js');
4
4
 
5
5
  // src/plugin/index.ts
6
- var createNodesV2 = chunk7N6FX55G_js.createNxPlugin({
6
+ var createNodesV2 = chunkJPTGZQLU_js.createNxPlugin({
7
7
  framework: "powerlines"
8
8
  });
9
9
 
@@ -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
 
6
6
  // src/executors/lint/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 = chunkIPVB7OAF_js.withExecutor("lint", executorFn);
14
+ var executor = chunk2SFOQMAA_js.withExecutor("lint", executorFn);
15
15
  var executor_default = executor;
16
16
 
17
17
  exports.executorFn = executorFn;
@@ -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
 
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 = chunkIPVB7OAF_js.withExecutor("docs", executorFn);
14
+ var executor = chunk2SFOQMAA_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-OY7HISJN.mjs';
1
+ import { withExecutor } from './chunk-IAWSQ5AX.mjs';
2
2
  import { __name } from './chunk-O6YSETKJ.mjs';
3
3
 
4
4
  // src/executors/lint/executor.ts
@@ -3,6 +3,7 @@
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');
7
8
  var isFunction = require('@stryke/type-checks/is-function');
8
9
  var isSetObject = require('@stryke/type-checks/is-set-object');
@@ -12,7 +13,7 @@ var types = require('@storm-software/config-tools/types');
12
13
  require('@stryke/fs/json');
13
14
  require('@stryke/fs/list-files');
14
15
  require('@stryke/fs/remove-file');
15
- var hashFiles = require('@stryke/hash/hash-files');
16
+ 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,11 +32,17 @@ 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, 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
+ const resolvedUserConfigFile = configFile && exists.existsSync(configFile) ? configFile : configFile && exists.existsSync(joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), configFile)) ? joinPaths.joinPaths(append.appendPath(projectRoot, workspaceRoot), configFile) : 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;
37
38
  if (resolvedUserConfigFile) {
38
- const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
39
+ let resolvedPath;
40
+ try {
41
+ resolvedPath = jiti.esmResolve(resolvedUserConfigFile);
42
+ } catch {
43
+ resolvedPath = resolvedUserConfigFile;
44
+ }
45
+ const resolved = await jiti.import(resolvedPath);
39
46
  if (resolved) {
40
47
  let config = {};
41
48
  if (isFunction.isFunction(resolved)) {
@@ -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 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("prepare", executorFn);
22
+ var executor = chunk2SFOQMAA_js.withExecutor("prepare", executorFn);
23
23
  var executor_default = executor;
24
24
 
25
25
  exports.executorFn = executorFn;
@@ -1,4 +1,4 @@
1
- import { PROJECT_ROOT_HASH_LENGTH, loadUserConfigFile } from './chunk-FMYWKI25.mjs';
1
+ import { PROJECT_ROOT_HASH_LENGTH, loadUserConfigFile } from './chunk-X6GFPXO4.mjs';
2
2
  import { CONFIG_INPUTS } from './chunk-LQU7XWFP.mjs';
3
3
  import { __name } from './chunk-O6YSETKJ.mjs';
4
4
  import { createNodesFromFiles } from '@nx/devkit';
@@ -62,7 +62,7 @@ function createNxPlugin(opts) {
62
62
  moduleCache: true
63
63
  });
64
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);
65
+ const userConfig = await loadUserConfigFile(projectRoot, contextV2.workspaceRoot, jiti, "build", "development", configFile, framework);
66
66
  if (!existsSync(joinPaths(contextV2.workspaceRoot, projectRoot, "package.json"))) {
67
67
  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
68
  return {};
@@ -127,8 +127,8 @@ function createNxPlugin(opts) {
127
127
  executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
128
128
  dependsOn: [
129
129
  `^${options?.prepare?.targetName || "prepare"}`,
130
- "clean"
131
- ],
130
+ options?.clean !== false && `${options?.clean?.targetName || "clean"}`
131
+ ].filter(Boolean),
132
132
  defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
133
133
  options: {
134
134
  entry: userConfig.entry || "{sourceRoot}/index.ts",
@@ -162,7 +162,7 @@ function createNxPlugin(opts) {
162
162
  executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
163
163
  dependsOn: [
164
164
  `^${options?.build?.targetName || "build"}`,
165
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
165
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
166
166
  ].filter(Boolean),
167
167
  defaultConfiguration: options?.build?.defaultConfiguration || "production",
168
168
  options: {
@@ -204,7 +204,7 @@ function createNxPlugin(opts) {
204
204
  executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
205
205
  dependsOn: [
206
206
  `^${options?.lint?.targetName || "lint"}`,
207
- options?.prepare !== false && `^${options?.prepare?.targetName || "prepare"}`
207
+ options?.prepare !== false && `${options?.prepare?.targetName || "prepare"}`
208
208
  ].filter(Boolean),
209
209
  defaultConfiguration: options?.lint?.defaultConfiguration || "production",
210
210
  options: {
@@ -245,7 +245,7 @@ function createNxPlugin(opts) {
245
245
  executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
246
246
  dependsOn: [
247
247
  `^${options?.docs?.targetName || "docs"}`,
248
- options?.build !== false && `^${options?.build?.targetName || "build"}`
248
+ options?.build !== false && `${options?.build?.targetName || "build"}`
249
249
  ].filter(Boolean),
250
250
  defaultConfiguration: options?.docs?.defaultConfiguration || "production",
251
251
  options: {
@@ -286,7 +286,7 @@ function createNxPlugin(opts) {
286
286
  executor: options?.deploy?.executor || `@${framework}/nx:${options?.deploy?.targetName || "deploy"}`,
287
287
  dependsOn: [
288
288
  `^${options?.deploy?.targetName || "deploy"}`,
289
- options?.build !== false && `^${options?.build?.targetName || "build"}`
289
+ options?.build !== false && `${options?.build?.targetName || "build"}`
290
290
  ].filter(Boolean),
291
291
  defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
292
292
  options: {