@nizza/devkit 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (126) hide show
  1. package/dist/cjs/executors/deploy/{helpers.js → helpers.cjs} +1 -1
  2. package/dist/cjs/executors/deploy/{index.js → index.cjs} +2 -2
  3. package/dist/cjs/executors/environments/{index.js → index.cjs} +2 -2
  4. package/dist/cjs/executors/publish/{index.js → index.cjs} +4 -4
  5. package/dist/cjs/executors/shared/{utils.js → utils.cjs} +0 -11
  6. package/dist/{esm/executors/shared/utils.d.ts → cjs/executors/shared/utils.d.cts} +1 -8
  7. package/dist/cjs/executors/update-executors-file/{helpers.js → helpers.cjs} +6 -18
  8. package/dist/{esm/executors/update-executors-file/helpers.d.ts → cjs/executors/update-executors-file/helpers.d.cts} +0 -8
  9. package/dist/cjs/executors/update-executors-file/{index.js → index.cjs} +2 -2
  10. package/dist/cjs/executors/vtex-link/{helpers.js → helpers.cjs} +5 -5
  11. package/dist/cjs/executors/vtex-link/{index.js → index.cjs} +2 -2
  12. package/dist/cjs/{index.js → index.cjs} +13 -14
  13. package/dist/cjs/{index.d.ts → index.d.cts} +1 -1
  14. package/dist/cjs/index.d.cts.map +1 -0
  15. package/dist/cjs/shared/{utils.js → utils.cjs} +11 -0
  16. package/dist/cjs/shared/{utils.d.ts → utils.d.cts} +8 -1
  17. package/dist/cjs/vite/config-builder/configs/{base.js → base.cjs} +5 -4
  18. package/dist/cjs/vite/config-builder/configs/{index.js → index.cjs} +8 -8
  19. package/dist/cjs/vite/config-builder/configs/{lib.js → lib.cjs} +4 -4
  20. package/dist/cjs/vite/config-builder/configs/{script.js → script.cjs} +5 -4
  21. package/dist/cjs/vite/config-builder/{main.js → main.cjs} +5 -6
  22. package/dist/cjs/vite/config-builder/{plugins.js → plugins.cjs} +5 -4
  23. package/dist/cjs/vite/config-builder/shared/utils/{helpers.js → helpers.cjs} +3 -12
  24. package/dist/cjs/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.cts} +1 -11
  25. package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.cjs} +5 -5
  26. package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.cjs} +1 -1
  27. package/dist/cjs/vite/plugins/third-party-css-inject/{main.js → main.cjs} +1 -1
  28. package/dist/esm/executors/deploy/{helpers.js → helpers.mjs} +1 -1
  29. package/dist/esm/executors/deploy/{index.js → index.mjs} +2 -2
  30. package/dist/esm/executors/environments/{index.js → index.mjs} +2 -2
  31. package/dist/esm/executors/publish/{index.js → index.mjs} +4 -4
  32. package/dist/{cjs/executors/shared/utils.d.ts → esm/executors/shared/utils.d.mts} +1 -8
  33. package/dist/esm/executors/shared/{utils.js → utils.mjs} +1 -11
  34. package/dist/{cjs/executors/update-executors-file/helpers.d.ts → esm/executors/update-executors-file/helpers.d.mts} +0 -8
  35. package/dist/esm/executors/update-executors-file/{helpers.js → helpers.mjs} +7 -19
  36. package/dist/esm/executors/update-executors-file/{index.js → index.mjs} +2 -2
  37. package/dist/esm/executors/vtex-link/{helpers.js → helpers.mjs} +4 -4
  38. package/dist/esm/executors/vtex-link/{index.js → index.mjs} +2 -2
  39. package/dist/esm/{index.d.ts → index.d.mts} +1 -1
  40. package/dist/esm/index.d.mts.map +1 -0
  41. package/dist/esm/{index.js → index.mjs} +13 -13
  42. package/dist/esm/shared/{utils.d.ts → utils.d.mts} +8 -1
  43. package/dist/esm/shared/{utils.js → utils.mjs} +11 -1
  44. package/dist/esm/vite/config-builder/configs/{base.js → base.mjs} +5 -4
  45. package/dist/esm/vite/config-builder/configs/{index.js → index.mjs} +8 -8
  46. package/dist/esm/vite/config-builder/configs/{lib.js → lib.mjs} +4 -4
  47. package/dist/esm/vite/config-builder/configs/{script.js → script.mjs} +5 -4
  48. package/dist/esm/vite/config-builder/{main.js → main.mjs} +5 -6
  49. package/dist/esm/vite/config-builder/{plugins.js → plugins.mjs} +5 -4
  50. package/dist/esm/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.mts} +1 -11
  51. package/dist/esm/vite/config-builder/shared/utils/{helpers.js → helpers.mjs} +3 -11
  52. package/dist/esm/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.mjs} +5 -5
  53. package/dist/esm/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.mjs} +1 -1
  54. package/dist/esm/vite/plugins/third-party-css-inject/{main.js → main.mjs} +1 -1
  55. package/dist/executors.json +5 -5
  56. package/package.json +7 -8
  57. package/dist/cjs/index.d.ts.map +0 -1
  58. package/dist/esm/index.d.ts.map +0 -1
  59. /package/dist/cjs/executors/deploy/{helpers.d.ts → helpers.d.cts} +0 -0
  60. /package/dist/cjs/executors/deploy/{index.d.ts → index.d.cts} +0 -0
  61. /package/dist/cjs/executors/environments/{helpers.js → helpers.cjs} +0 -0
  62. /package/dist/cjs/executors/environments/{helpers.d.ts → helpers.d.cts} +0 -0
  63. /package/dist/cjs/executors/environments/{index.d.ts → index.d.cts} +0 -0
  64. /package/dist/cjs/executors/publish/{helpers.js → helpers.cjs} +0 -0
  65. /package/dist/cjs/executors/publish/{helpers.d.ts → helpers.d.cts} +0 -0
  66. /package/dist/cjs/executors/publish/{index.d.ts → index.d.cts} +0 -0
  67. /package/dist/cjs/executors/update-executors-file/{index.d.ts → index.d.cts} +0 -0
  68. /package/dist/cjs/executors/vtex-link/{constants.js → constants.cjs} +0 -0
  69. /package/dist/cjs/executors/vtex-link/{constants.d.ts → constants.d.cts} +0 -0
  70. /package/dist/cjs/executors/vtex-link/{helpers.d.ts → helpers.d.cts} +0 -0
  71. /package/dist/cjs/executors/vtex-link/{index.d.ts → index.d.cts} +0 -0
  72. /package/dist/cjs/scripts/{changeset-pre-mode.js → changeset-pre-mode.cjs} +0 -0
  73. /package/dist/cjs/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.cts} +0 -0
  74. /package/dist/cjs/shared/{logger.js → logger.cjs} +0 -0
  75. /package/dist/cjs/shared/{logger.d.ts → logger.d.cts} +0 -0
  76. /package/dist/cjs/vite/config-builder/configs/{app.js → app.cjs} +0 -0
  77. /package/dist/cjs/vite/config-builder/configs/{app.d.ts → app.d.cts} +0 -0
  78. /package/dist/cjs/vite/config-builder/configs/{base.d.ts → base.d.cts} +0 -0
  79. /package/dist/cjs/vite/config-builder/configs/{index.d.ts → index.d.cts} +0 -0
  80. /package/dist/cjs/vite/config-builder/configs/{lib.d.ts → lib.d.cts} +0 -0
  81. /package/dist/cjs/vite/config-builder/configs/{script.d.ts → script.d.cts} +0 -0
  82. /package/dist/cjs/vite/config-builder/{main.d.ts → main.d.cts} +0 -0
  83. /package/dist/cjs/vite/config-builder/{plugins.d.ts → plugins.d.cts} +0 -0
  84. /package/dist/cjs/vite/config-builder/shared/{types.js → types.cjs} +0 -0
  85. /package/dist/cjs/vite/config-builder/shared/{types.d.ts → types.d.cts} +0 -0
  86. /package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.cts} +0 -0
  87. /package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.d.ts → viteCommand.d.cts} +0 -0
  88. /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.js → index.cjs} +0 -0
  89. /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.d.ts → index.d.cts} +0 -0
  90. /package/dist/cjs/vite/plugins/third-party-css-inject/{main.d.ts → main.d.cts} +0 -0
  91. /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.js → utils.cjs} +0 -0
  92. /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.d.ts → utils.d.cts} +0 -0
  93. /package/dist/esm/executors/deploy/{helpers.d.ts → helpers.d.mts} +0 -0
  94. /package/dist/esm/executors/deploy/{index.d.ts → index.d.mts} +0 -0
  95. /package/dist/esm/executors/environments/{helpers.d.ts → helpers.d.mts} +0 -0
  96. /package/dist/esm/executors/environments/{helpers.js → helpers.mjs} +0 -0
  97. /package/dist/esm/executors/environments/{index.d.ts → index.d.mts} +0 -0
  98. /package/dist/esm/executors/publish/{helpers.d.ts → helpers.d.mts} +0 -0
  99. /package/dist/esm/executors/publish/{helpers.js → helpers.mjs} +0 -0
  100. /package/dist/esm/executors/publish/{index.d.ts → index.d.mts} +0 -0
  101. /package/dist/esm/executors/update-executors-file/{index.d.ts → index.d.mts} +0 -0
  102. /package/dist/esm/executors/vtex-link/{constants.d.ts → constants.d.mts} +0 -0
  103. /package/dist/esm/executors/vtex-link/{constants.js → constants.mjs} +0 -0
  104. /package/dist/esm/executors/vtex-link/{helpers.d.ts → helpers.d.mts} +0 -0
  105. /package/dist/esm/executors/vtex-link/{index.d.ts → index.d.mts} +0 -0
  106. /package/dist/esm/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.mts} +0 -0
  107. /package/dist/esm/scripts/{changeset-pre-mode.js → changeset-pre-mode.mjs} +0 -0
  108. /package/dist/esm/shared/{logger.d.ts → logger.d.mts} +0 -0
  109. /package/dist/esm/shared/{logger.js → logger.mjs} +0 -0
  110. /package/dist/esm/vite/config-builder/configs/{app.d.ts → app.d.mts} +0 -0
  111. /package/dist/esm/vite/config-builder/configs/{app.js → app.mjs} +0 -0
  112. /package/dist/esm/vite/config-builder/configs/{base.d.ts → base.d.mts} +0 -0
  113. /package/dist/esm/vite/config-builder/configs/{index.d.ts → index.d.mts} +0 -0
  114. /package/dist/esm/vite/config-builder/configs/{lib.d.ts → lib.d.mts} +0 -0
  115. /package/dist/esm/vite/config-builder/configs/{script.d.ts → script.d.mts} +0 -0
  116. /package/dist/esm/vite/config-builder/{main.d.ts → main.d.mts} +0 -0
  117. /package/dist/esm/vite/config-builder/{plugins.d.ts → plugins.d.mts} +0 -0
  118. /package/dist/esm/vite/config-builder/shared/{types.d.ts → types.d.mts} +0 -0
  119. /package/dist/esm/vite/config-builder/shared/{types.js → types.mjs} +0 -0
  120. /package/dist/esm/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.mts} +0 -0
  121. /package/dist/esm/vite/config-builder/shared/utils/{viteCommand.d.ts → viteCommand.d.mts} +0 -0
  122. /package/dist/esm/vite/plugins/shadow-dom-inject-css/{index.d.ts → index.d.mts} +0 -0
  123. /package/dist/esm/vite/plugins/shadow-dom-inject-css/{index.js → index.mjs} +0 -0
  124. /package/dist/esm/vite/plugins/third-party-css-inject/{main.d.ts → main.d.mts} +0 -0
  125. /package/dist/esm/vite/plugins/third-party-css-inject/{utils.d.ts → utils.d.mts} +0 -0
  126. /package/dist/esm/vite/plugins/third-party-css-inject/{utils.js → utils.mjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var devkit = require('@nx/devkit');
4
- var utils = require('../shared/utils.js');
4
+ var utils = require('../shared/utils.cjs');
5
5
 
6
6
  async function cleanS3Bucket(s3BucketPath) {
7
7
  devkit.logger.info('🧹 Cleaning S3 bucket...');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var utils = require('../shared/utils.js');
4
- var helpers = require('./helpers.js');
3
+ var utils = require('../shared/utils.cjs');
4
+ var helpers = require('./helpers.cjs');
5
5
 
6
6
  async function deployExecutor(opts, ctx) {
7
7
  try {
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var path = require('path');
4
- var utils = require('../shared/utils.js');
5
- var helpers = require('./helpers.js');
4
+ var utils = require('../shared/utils.cjs');
5
+ var helpers = require('./helpers.cjs');
6
6
 
7
7
  const ENV_DIR = 'src/environments';
8
8
  const ENV_DEV_FILE = 'environment.ts';
@@ -2,10 +2,10 @@
2
2
 
3
3
  var devkit = require('@nx/devkit');
4
4
  var semver = require('semver');
5
- require('../../shared/logger.js');
6
- var utils$1 = require('../../shared/utils.js');
7
- var utils = require('../shared/utils.js');
8
- var helpers = require('./helpers.js');
5
+ require('../../shared/logger.cjs');
6
+ var utils$1 = require('../../shared/utils.cjs');
7
+ var utils = require('../shared/utils.cjs');
8
+ var helpers = require('./helpers.cjs');
9
9
 
10
10
  /**
11
11
  * This is a minimal script to publish package to "npm".
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var devkit = require('@nx/devkit');
4
- var crypto = require('crypto');
5
4
  var child_process = require('child_process');
6
5
  var util = require('util');
7
6
 
@@ -34,15 +33,6 @@ const execAsync = util.promisify(child_process.exec);
34
33
  success: false
35
34
  };
36
35
  }
37
- /**
38
- * Generates a random alphanumeric identifier of a specified length.
39
- *
40
- * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
41
- * @returns {string} - A string representing a unique identifier.
42
- */ function shortId(length = 8) {
43
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
44
- return Array.from(crypto.randomBytes(length), (b)=>chars[b % chars.length]).join('');
45
- }
46
36
  /**
47
37
  * Retrieves the project configuration for the current execution context.
48
38
  *
@@ -75,4 +65,3 @@ exports.err = err;
75
65
  exports.getProjectConfig = getProjectConfig;
76
66
  exports.ok = ok;
77
67
  exports.runCommand = runCommand;
78
- exports.shortId = shortId;
@@ -15,13 +15,6 @@ declare function ok(message?: string): ExecutorResponse;
15
15
  * @returns {ExecutorResponse} - An object representing a failed operation.
16
16
  */
17
17
  declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
18
- /**
19
- * Generates a random alphanumeric identifier of a specified length.
20
- *
21
- * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
22
- * @returns {string} - A string representing a unique identifier.
23
- */
24
- declare function shortId(length?: number): string;
25
18
  /**
26
19
  * Retrieves the project configuration for the current execution context.
27
20
  *
@@ -31,4 +24,4 @@ declare function shortId(length?: number): string;
31
24
  */
32
25
  declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
33
26
  declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
34
- export { ok, err, shortId, getProjectConfig, runCommand };
27
+ export { ok, err, getProjectConfig, runCommand };
@@ -5,32 +5,20 @@ var fs = require('fs');
5
5
  var R = require('ramda');
6
6
 
7
7
  const { writeFile } = fs.promises;
8
- /**
9
- * Transforms the given path by adding or removing the './dist/' prefix
10
- * and ensuring that it has the '.js' extension if it's not a JSON file.
11
- *
12
- * @param {string} path - The original file path to transform.
13
- * @param {boolean} removeDist - Flag to determine if './dist/' should be removed.
14
- * @returns {string} The transformed file path.
15
- */ const transformPathToRoot = (path)=>{
8
+ const transformPathToRoot = (path)=>{
16
9
  const distPrefix = './dist/cjs/';
17
10
  const srcRegex = /^\.\/src\//;
18
- const distRegex = /^\.\/dist\//;
19
- const jsExt = '.js';
20
- R.endsWith(jsExt, path);
21
- const isJson = R.endsWith('.json', path);
22
- R.test(distRegex, path);
23
- // Adds './dist/' prefix to the path if it's not already present.
11
+ const executorTsRegex = /executor\.ts$/;
12
+ const jsonFileRegex = /\.json$/;
13
+ const isJson = jsonFileRegex.test(path);
24
14
  const changeSrcPath = (p)=>p.replace(srcRegex, distPrefix);
25
- // Adds '.js' extension to the path if it's not a JSON file and doesn't have the extension already.
26
- const changeFileName = (p)=>isJson ? p : p.replace(/executor\.ts$/, 'index.js');
15
+ const changeFileName = (p)=>isJson ? p : p.replace(executorTsRegex, 'index.cjs');
27
16
  return R.pipe(changeSrcPath, changeFileName)(path);
28
17
  };
29
18
  const transformPathToDist = (path)=>{
30
19
  const cjsPrefix = './cjs/';
31
20
  const distRegex = /^\.\/dist\/cjs\//;
32
- const changeDistPath = (p)=>p.replace(distRegex, cjsPrefix);
33
- return changeDistPath(path);
21
+ return path.replace(distRegex, cjsPrefix);
34
22
  };
35
23
  /**
36
24
  * Updates the executor paths for the provided executors object.
@@ -1,12 +1,4 @@
1
1
  import { Executors } from "../../types-763439e4.js";
2
- /**
3
- * Transforms the given path by adding or removing the './dist/' prefix
4
- * and ensuring that it has the '.js' extension if it's not a JSON file.
5
- *
6
- * @param {string} path - The original file path to transform.
7
- * @param {boolean} removeDist - Flag to determine if './dist/' should be removed.
8
- * @returns {string} The transformed file path.
9
- */
10
2
  declare const transformPathToRoot: (path: string) => string;
11
3
  declare const transformPathToDist: (path: string) => string;
12
4
  /**
@@ -2,8 +2,8 @@
2
2
 
3
3
  var fs = require('fs');
4
4
  var path = require('path');
5
- var utils = require('../shared/utils.js');
6
- var helpers = require('./helpers.js');
5
+ var utils = require('../shared/utils.cjs');
6
+ var helpers = require('./helpers.cjs');
7
7
 
8
8
  const { readFile } = fs.promises;
9
9
  /**
@@ -5,10 +5,10 @@ var child_process = require('child_process');
5
5
  var fs = require('fs');
6
6
  var path = require('path');
7
7
  var util = require('util');
8
- require('../../shared/logger.js');
9
- var utils$1 = require('../../shared/utils.js');
10
- var utils = require('../shared/utils.js');
11
- var constants = require('./constants.js');
8
+ require('../../shared/logger.cjs');
9
+ var utils$1 = require('../../shared/utils.cjs');
10
+ var utils = require('../shared/utils.cjs');
11
+ var constants = require('./constants.cjs');
12
12
 
13
13
  const execAsync = util.promisify(child_process.exec);
14
14
  const getPkgJsonPath = (vtexProjectPath)=>path.resolve(vtexProjectPath, 'package.json');
@@ -96,7 +96,7 @@ const getPkgJsonPath = (vtexProjectPath)=>path.resolve(vtexProjectPath, 'package
96
96
  const packageJson = utils$1.getPkgJson('./');
97
97
  const oldName = `${packageOrg}-${projectName}-${packageJson.version}.tgz`;
98
98
  const oldPath = path.join(projectRoot, oldName);
99
- const newName = `${packageOrg}-${projectName}-${packageJson.version}-${utils.shortId(8)}.tgz`;
99
+ const newName = `${packageOrg}-${projectName}-${packageJson.version}-${utils$1.shortId(8)}.tgz`;
100
100
  const newPath = path.join(projectRoot, newName);
101
101
  await fs.promises.rename(oldPath, newPath);
102
102
  devkit.logger.info(`🏷️ New package name: ${newName}`);
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var path = require('path');
4
- var utils = require('../shared/utils.js');
5
- var helpers = require('./helpers.js');
4
+ var utils = require('../shared/utils.cjs');
5
+ var helpers = require('./helpers.cjs');
6
6
 
7
7
  const VTEX_PROJECT_PATH = process.env.NZ_VTEX_PROJECT;
8
8
  async function runExecutor(opts, ctx) {
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./executors/deploy/index.js');
4
- var index$1 = require('./executors/environments/index.js');
5
- var index$2 = require('./executors/publish/index.js');
6
- var index$3 = require('./executors/update-executors-file/index.js');
7
- var index$4 = require('./executors/vtex-link/index.js');
8
- var changesetPreMode = require('./scripts/changeset-pre-mode.js');
9
- var main = require('./vite/config-builder/main.js');
10
- var types = require('./vite/config-builder/shared/types.js');
11
- var helpers = require('./vite/config-builder/shared/utils/helpers.js');
12
- var projectConfig = require('./vite/config-builder/shared/utils/projectConfig.js');
13
- var viteCommand = require('./vite/config-builder/shared/utils/viteCommand.js');
14
- var main$1 = require('./vite/plugins/third-party-css-inject/main.js');
15
- var index$5 = require('./vite/plugins/shadow-dom-inject-css/index.js');
3
+ var index = require('./executors/deploy/index.cjs');
4
+ var index$1 = require('./executors/environments/index.cjs');
5
+ var index$2 = require('./executors/publish/index.cjs');
6
+ var index$3 = require('./executors/update-executors-file/index.cjs');
7
+ var index$4 = require('./executors/vtex-link/index.cjs');
8
+ var changesetPreMode = require('./scripts/changeset-pre-mode.cjs');
9
+ var main = require('./vite/config-builder/main.cjs');
10
+ var types = require('./vite/config-builder/shared/types.cjs');
11
+ var helpers = require('./vite/config-builder/shared/utils/helpers.cjs');
12
+ var projectConfig = require('./vite/config-builder/shared/utils/projectConfig.cjs');
13
+ var viteCommand = require('./vite/config-builder/shared/utils/viteCommand.cjs');
14
+ var main$1 = require('./vite/plugins/third-party-css-inject/main.cjs');
15
+ var index$5 = require('./vite/plugins/shadow-dom-inject-css/index.cjs');
16
16
 
17
17
 
18
18
 
@@ -47,7 +47,6 @@ exports.chunkName = helpers.chunkName;
47
47
  exports.deepMerge = helpers.deepMerge;
48
48
  exports.getNxTsConfigPaths = helpers.getNxTsConfigPaths;
49
49
  exports.getPlugins = helpers.getPlugins;
50
- exports.shortId = helpers.shortId;
51
50
  exports.when = helpers.when;
52
51
  exports.getExternalDependencies = projectConfig.getExternalDependencies;
53
52
  exports.getInitials = projectConfig.getInitials;
@@ -7,4 +7,4 @@ export * from "./scripts/changeset-pre-mode.js";
7
7
  export * from "./vite/config-builder/main.js";
8
8
  export * from "./index-f6330edc.js";
9
9
  export * from "./index-0ce2daf7.js";
10
- //# sourceMappingURL=index.d.ts.map
10
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/index.ts","../../src/executors/index.ts","../../src/scripts/index.ts","../../src/vite/config-builder/index.ts","../../src/vite/index.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var devkit = require('@nx/devkit');
4
+ var crypto = require('crypto');
4
5
  var fs = require('fs');
5
6
  var path = require('path');
6
7
 
@@ -21,5 +22,15 @@ var path = require('path');
21
22
  throw err;
22
23
  }
23
24
  };
25
+ /**
26
+ * Generates a random alphanumeric identifier of a specified length.
27
+ *
28
+ * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
29
+ * @returns {string} - A string representing a unique identifier.
30
+ */ function shortId(length = 8) {
31
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
32
+ return Array.from(crypto.randomBytes(length), (b)=>chars[b % chars.length]).join('');
33
+ }
24
34
 
25
35
  exports.getPkgJson = getPkgJson;
36
+ exports.shortId = shortId;
@@ -8,4 +8,11 @@
8
8
  * const pkgJsonData = getPkgJson('/path/to/project');
9
9
  */
10
10
  declare const getPkgJson: (projectPath: string) => Record<string, any>;
11
- export { getPkgJson };
11
+ /**
12
+ * Generates a random alphanumeric identifier of a specified length.
13
+ *
14
+ * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
15
+ * @returns {string} - A string representing a unique identifier.
16
+ */
17
+ declare function shortId(length?: number): string;
18
+ export { getPkgJson, shortId };
@@ -1,11 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var plugins = require('../plugins.js');
4
- var types = require('../shared/types.js');
5
- var helpers = require('../shared/utils/helpers.js');
3
+ var plugins = require('../plugins.cjs');
4
+ var types = require('../shared/types.cjs');
5
+ var helpers = require('../shared/utils/helpers.cjs');
6
6
  require('minimatch');
7
- require('../../../shared/logger.js');
7
+ require('../../../shared/logger.cjs');
8
8
  require('@nx/devkit');
9
+ require('crypto');
9
10
  var fs = require('fs');
10
11
  var path = require('path');
11
12
  require('chalk');
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var types = require('../shared/types.js');
3
+ var types = require('../shared/types.cjs');
4
4
  require('@nx/devkit');
5
- require('nanoid');
6
5
  require('path');
7
6
  require('ramda');
8
- require('minimatch');
9
- require('../../../shared/logger.js');
7
+ require('../../../shared/logger.cjs');
8
+ require('crypto');
10
9
  require('fs');
10
+ require('minimatch');
11
11
  require('chalk');
12
12
  require('mri');
13
13
  require('vite');
14
- var app = require('./app.js');
15
- var base = require('./base.js');
16
- var lib = require('./lib.js');
17
- var script = require('./script.js');
14
+ var app = require('./app.cjs');
15
+ var base = require('./base.cjs');
16
+ var lib = require('./lib.cjs');
17
+ var script = require('./script.cjs');
18
18
 
19
19
  const getConfig = (ctx, type = null)=>{
20
20
  switch(type){
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var path = require('path');
4
- var plugins = require('../plugins.js');
5
- require('../shared/types.js');
6
- var helpers = require('../shared/utils/helpers.js');
7
- var projectConfig = require('../shared/utils/projectConfig.js');
4
+ var plugins = require('../plugins.cjs');
5
+ require('../shared/types.cjs');
6
+ var helpers = require('../shared/utils/helpers.cjs');
7
+ var projectConfig = require('../shared/utils/projectConfig.cjs');
8
8
  require('chalk');
9
9
  require('mri');
10
10
  require('vite');
@@ -1,12 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var path = require('path');
4
- var plugins = require('../plugins.js');
5
- require('../shared/types.js');
6
- var helpers = require('../shared/utils/helpers.js');
4
+ var plugins = require('../plugins.cjs');
5
+ require('../shared/types.cjs');
6
+ var helpers = require('../shared/utils/helpers.cjs');
7
7
  require('minimatch');
8
- require('../../../shared/logger.js');
8
+ require('../../../shared/logger.cjs');
9
9
  require('@nx/devkit');
10
+ require('crypto');
10
11
  require('fs');
11
12
  require('chalk');
12
13
  require('mri');
@@ -1,15 +1,14 @@
1
1
  'use strict';
2
2
 
3
3
  var vite = require('vite');
4
- var logger = require('../../shared/logger.js');
5
- var utils = require('../../shared/utils.js');
6
- var index = require('./configs/index.js');
7
- require('./shared/types.js');
4
+ var logger = require('../../shared/logger.cjs');
5
+ var utils = require('../../shared/utils.cjs');
6
+ var index = require('./configs/index.cjs');
7
+ require('./shared/types.cjs');
8
8
  require('@nx/devkit');
9
- require('nanoid');
10
9
  require('path');
11
10
  require('ramda');
12
- var projectConfig = require('./shared/utils/projectConfig.js');
11
+ var projectConfig = require('./shared/utils/projectConfig.cjs');
13
12
  require('chalk');
14
13
  require('mri');
15
14
 
@@ -9,12 +9,13 @@ var cssInjectedByJsPlugin = require('vite-plugin-css-injected-by-js');
9
9
  var dts = require('vite-plugin-dts');
10
10
  var tsconfigPaths = require('vite-tsconfig-paths');
11
11
  require('vite');
12
- var index = require('../plugins/shadow-dom-inject-css/index.js');
13
- var types = require('./shared/types.js');
14
- var helpers = require('./shared/utils/helpers.js');
12
+ var index = require('../plugins/shadow-dom-inject-css/index.cjs');
13
+ var types = require('./shared/types.cjs');
14
+ var helpers = require('./shared/utils/helpers.cjs');
15
15
  require('minimatch');
16
- require('../../shared/logger.js');
16
+ require('../../shared/logger.cjs');
17
17
  require('@nx/devkit');
18
+ require('crypto');
18
19
  require('fs');
19
20
  require('chalk');
20
21
  require('mri');
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  var devkit = require('@nx/devkit');
4
- var nanoid = require('nanoid');
5
4
  var path = require('path');
6
5
  var R = require('ramda');
6
+ require('../../../../shared/logger.cjs');
7
+ var utils = require('../../../../shared/utils.cjs');
7
8
 
8
9
  function _interopNamespaceDefault(e) {
9
10
  var n = Object.create(null);
@@ -24,15 +25,6 @@ function _interopNamespaceDefault(e) {
24
25
 
25
26
  var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
26
27
 
27
- /**
28
- * Generates a short ID string.
29
- *
30
- * @param {number} length - The length of the ID to generate.
31
- * @returns {string} - The generated ID.
32
- *
33
- * @example
34
- * const id = shortId(10); // Outputs: "Aj3_Dk7_2j"
35
- */ const shortId = (length)=>nanoid.nanoid(length);
36
28
  /**
37
29
  * Deeply merges two objects, combining their properties.
38
30
  *
@@ -65,7 +57,7 @@ var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
65
57
  */ const chunkName = (prefix)=>(x)=>{
66
58
  const nameWithoutUnderscore = x.name.replace(/_/g, '');
67
59
  const pre = prefix ? `${prefix}-` : '';
68
- return `${pre}${nameWithoutUnderscore}-${shortId(8)}.js`;
60
+ return `${pre}${nameWithoutUnderscore}-${utils.shortId(8)}.js`;
69
61
  };
70
62
  /**
71
63
  * Returns the given object if the condition is true, otherwise returns null.
@@ -120,5 +112,4 @@ exports.chunkName = chunkName;
120
112
  exports.deepMerge = deepMerge;
121
113
  exports.getNxTsConfigPaths = getNxTsConfigPaths;
122
114
  exports.getPlugins = getPlugins;
123
- exports.shortId = shortId;
124
115
  exports.when = when;
@@ -1,16 +1,6 @@
1
1
  import { PreRenderedChunk } from 'rollup';
2
2
  import { PluginOption } from 'vite';
3
3
  import { Context, PluginConfig } from "../types.js";
4
- /**
5
- * Generates a short ID string.
6
- *
7
- * @param {number} length - The length of the ID to generate.
8
- * @returns {string} - The generated ID.
9
- *
10
- * @example
11
- * const id = shortId(10); // Outputs: "Aj3_Dk7_2j"
12
- */
13
- declare const shortId: (length: number) => string;
14
4
  /**
15
5
  * Deeply merges two objects, combining their properties.
16
6
  *
@@ -78,4 +68,4 @@ declare const getPlugins: (ctx: Context, ...pluginConfigs: PluginConfig[]) => Pl
78
68
  * // ['apps/my-app/tsconfig.app.json', 'libs/my-lib/tsconfig.lib.json']
79
69
  */
80
70
  declare const getNxTsConfigPaths: () => string[];
81
- export { shortId, deepMerge, chunkName, when, getPlugins, getNxTsConfigPaths };
71
+ export { deepMerge, chunkName, when, getPlugins, getNxTsConfigPaths };
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var minimatch = require('minimatch');
4
- var logger = require('../../../../shared/logger.js');
5
- var utils = require('../../../../shared/utils.js');
6
- var types = require('../types.js');
7
- var helpers = require('./helpers.js');
8
- var viteCommand = require('./viteCommand.js');
4
+ var logger = require('../../../../shared/logger.cjs');
5
+ var utils = require('../../../../shared/utils.cjs');
6
+ var types = require('../types.cjs');
7
+ var helpers = require('./helpers.cjs');
8
+ var viteCommand = require('./viteCommand.cjs');
9
9
 
10
10
  /**
11
11
  * Initializes the project configuration with default values.
@@ -3,7 +3,7 @@
3
3
  var chalk = require('chalk');
4
4
  var argv = require('mri');
5
5
  var vite = require('vite');
6
- var types = require('../types.js');
6
+ var types = require('../types.cjs');
7
7
 
8
8
  /**
9
9
  * Retrieves the Vite command details.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var utils = require('./utils.js');
3
+ var utils = require('./utils.cjs');
4
4
 
5
5
  /**
6
6
  * Inject the CSS compiled with JS.
@@ -1,5 +1,5 @@
1
1
  import { logger } from '@nx/devkit';
2
- import { runCommand } from '../shared/utils.js';
2
+ import { runCommand } from '../shared/utils.mjs';
3
3
 
4
4
  async function cleanS3Bucket(s3BucketPath) {
5
5
  logger.info('🧹 Cleaning S3 bucket...');
@@ -1,5 +1,5 @@
1
- import { getProjectConfig, runCommand, ok, err } from '../shared/utils.js';
2
- import { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation } from './helpers.js';
1
+ import { getProjectConfig, runCommand, ok, err } from '../shared/utils.mjs';
2
+ import { cleanS3Bucket, copyAssetsToS3, createCloudFrontInvalidation } from './helpers.mjs';
3
3
 
4
4
  async function deployExecutor(opts, ctx) {
5
5
  try {
@@ -1,6 +1,6 @@
1
1
  import { join } from 'path';
2
- import { getProjectConfig, ok, err } from '../shared/utils.js';
3
- import { ensureDirectoryExists, createEnvironmentFileContent, writeFilesIfNotExist } from './helpers.js';
2
+ import { getProjectConfig, ok, err } from '../shared/utils.mjs';
3
+ import { ensureDirectoryExists, createEnvironmentFileContent, writeFilesIfNotExist } from './helpers.mjs';
4
4
 
5
5
  const ENV_DIR = 'src/environments';
6
6
  const ENV_DEV_FILE = 'environment.ts';
@@ -1,9 +1,9 @@
1
1
  import { logger } from '@nx/devkit';
2
2
  import semver from 'semver';
3
- import '../../shared/logger.js';
4
- import { getPkgJson } from '../../shared/utils.js';
5
- import { getProjectConfig, runCommand, ok, err } from '../shared/utils.js';
6
- import { checkPublishedVersion } from './helpers.js';
3
+ import '../../shared/logger.mjs';
4
+ import { getPkgJson } from '../../shared/utils.mjs';
5
+ import { getProjectConfig, runCommand, ok, err } from '../shared/utils.mjs';
6
+ import { checkPublishedVersion } from './helpers.mjs';
7
7
 
8
8
  /**
9
9
  * This is a minimal script to publish package to "npm".
@@ -15,13 +15,6 @@ declare function ok(message?: string): ExecutorResponse;
15
15
  * @returns {ExecutorResponse} - An object representing a failed operation.
16
16
  */
17
17
  declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
18
- /**
19
- * Generates a random alphanumeric identifier of a specified length.
20
- *
21
- * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
22
- * @returns {string} - A string representing a unique identifier.
23
- */
24
- declare function shortId(length?: number): string;
25
18
  /**
26
19
  * Retrieves the project configuration for the current execution context.
27
20
  *
@@ -31,4 +24,4 @@ declare function shortId(length?: number): string;
31
24
  */
32
25
  declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
33
26
  declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
34
- export { ok, err, shortId, getProjectConfig, runCommand };
27
+ export { ok, err, getProjectConfig, runCommand };
@@ -1,5 +1,4 @@
1
1
  import { logger } from '@nx/devkit';
2
- import { randomBytes } from 'crypto';
3
2
  import { exec } from 'child_process';
4
3
  import { promisify } from 'util';
5
4
 
@@ -32,15 +31,6 @@ const execAsync = promisify(exec);
32
31
  success: false
33
32
  };
34
33
  }
35
- /**
36
- * Generates a random alphanumeric identifier of a specified length.
37
- *
38
- * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
39
- * @returns {string} - A string representing a unique identifier.
40
- */ function shortId(length = 8) {
41
- const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
42
- return Array.from(randomBytes(length), (b)=>chars[b % chars.length]).join('');
43
- }
44
34
  /**
45
35
  * Retrieves the project configuration for the current execution context.
46
36
  *
@@ -69,4 +59,4 @@ async function runCommand(command, cwd) {
69
59
  }
70
60
  }
71
61
 
72
- export { err, getProjectConfig, ok, runCommand, shortId };
62
+ export { err, getProjectConfig, ok, runCommand };
@@ -1,12 +1,4 @@
1
1
  import { Executors } from "../../types-763439e4.js";
2
- /**
3
- * Transforms the given path by adding or removing the './dist/' prefix
4
- * and ensuring that it has the '.js' extension if it's not a JSON file.
5
- *
6
- * @param {string} path - The original file path to transform.
7
- * @param {boolean} removeDist - Flag to determine if './dist/' should be removed.
8
- * @returns {string} The transformed file path.
9
- */
10
2
  declare const transformPathToRoot: (path: string) => string;
11
3
  declare const transformPathToDist: (path: string) => string;
12
4
  /**