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

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/update-executors-file/{helpers.js → helpers.cjs} +6 -18
  6. package/dist/{esm/executors/update-executors-file/helpers.d.ts → cjs/executors/update-executors-file/helpers.d.cts} +0 -8
  7. package/dist/cjs/executors/update-executors-file/{index.js → index.cjs} +2 -2
  8. package/dist/cjs/executors/vtex-link/{helpers.js → helpers.cjs} +4 -4
  9. package/dist/cjs/executors/vtex-link/{index.js → index.cjs} +2 -2
  10. package/dist/cjs/{index.js → index.cjs} +13 -13
  11. package/dist/cjs/{index.d.ts → index.d.cts} +1 -1
  12. package/dist/cjs/index.d.cts.map +1 -0
  13. package/dist/cjs/vite/config-builder/configs/{base.js → base.cjs} +4 -4
  14. package/dist/cjs/vite/config-builder/configs/{index.js → index.cjs} +6 -6
  15. package/dist/cjs/vite/config-builder/configs/{lib.js → lib.cjs} +4 -4
  16. package/dist/cjs/vite/config-builder/configs/{script.js → script.cjs} +4 -4
  17. package/dist/cjs/vite/config-builder/{main.js → main.cjs} +5 -5
  18. package/dist/cjs/vite/config-builder/{plugins.js → plugins.cjs} +4 -4
  19. package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.cjs} +5 -5
  20. package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.cjs} +1 -1
  21. package/dist/cjs/vite/plugins/third-party-css-inject/{main.js → main.cjs} +1 -1
  22. package/dist/esm/executors/deploy/{helpers.js → helpers.mjs} +1 -1
  23. package/dist/esm/executors/deploy/{index.js → index.mjs} +2 -2
  24. package/dist/esm/executors/environments/{index.js → index.mjs} +2 -2
  25. package/dist/esm/executors/publish/{index.js → index.mjs} +4 -4
  26. package/dist/{cjs/executors/update-executors-file/helpers.d.ts → esm/executors/update-executors-file/helpers.d.mts} +0 -8
  27. package/dist/esm/executors/update-executors-file/{helpers.js → helpers.mjs} +7 -19
  28. package/dist/esm/executors/update-executors-file/{index.js → index.mjs} +2 -2
  29. package/dist/esm/executors/vtex-link/{helpers.js → helpers.mjs} +4 -4
  30. package/dist/esm/executors/vtex-link/{index.js → index.mjs} +2 -2
  31. package/dist/esm/{index.d.ts → index.d.mts} +1 -1
  32. package/dist/esm/index.d.mts.map +1 -0
  33. package/dist/esm/{index.js → index.mjs} +13 -13
  34. package/dist/esm/vite/config-builder/configs/{base.js → base.mjs} +4 -4
  35. package/dist/esm/vite/config-builder/configs/{index.js → index.mjs} +6 -6
  36. package/dist/esm/vite/config-builder/configs/{lib.js → lib.mjs} +4 -4
  37. package/dist/esm/vite/config-builder/configs/{script.js → script.mjs} +4 -4
  38. package/dist/esm/vite/config-builder/{main.js → main.mjs} +5 -5
  39. package/dist/esm/vite/config-builder/{plugins.js → plugins.mjs} +4 -4
  40. package/dist/esm/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.mjs} +5 -5
  41. package/dist/esm/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.mjs} +1 -1
  42. package/dist/esm/vite/plugins/third-party-css-inject/{main.js → main.mjs} +1 -1
  43. package/dist/executors.json +10 -10
  44. package/package.json +5 -4
  45. package/dist/cjs/index.d.ts.map +0 -1
  46. package/dist/esm/index.d.ts.map +0 -1
  47. /package/dist/cjs/executors/deploy/{helpers.d.ts → helpers.d.cts} +0 -0
  48. /package/dist/cjs/executors/deploy/{index.d.ts → index.d.cts} +0 -0
  49. /package/dist/cjs/executors/environments/{helpers.js → helpers.cjs} +0 -0
  50. /package/dist/cjs/executors/environments/{helpers.d.ts → helpers.d.cts} +0 -0
  51. /package/dist/cjs/executors/environments/{index.d.ts → index.d.cts} +0 -0
  52. /package/dist/cjs/executors/publish/{helpers.js → helpers.cjs} +0 -0
  53. /package/dist/cjs/executors/publish/{helpers.d.ts → helpers.d.cts} +0 -0
  54. /package/dist/cjs/executors/publish/{index.d.ts → index.d.cts} +0 -0
  55. /package/dist/cjs/executors/shared/{utils.js → utils.cjs} +0 -0
  56. /package/dist/cjs/executors/shared/{utils.d.ts → utils.d.cts} +0 -0
  57. /package/dist/cjs/executors/update-executors-file/{index.d.ts → index.d.cts} +0 -0
  58. /package/dist/cjs/executors/vtex-link/{constants.js → constants.cjs} +0 -0
  59. /package/dist/cjs/executors/vtex-link/{constants.d.ts → constants.d.cts} +0 -0
  60. /package/dist/cjs/executors/vtex-link/{helpers.d.ts → helpers.d.cts} +0 -0
  61. /package/dist/cjs/executors/vtex-link/{index.d.ts → index.d.cts} +0 -0
  62. /package/dist/cjs/scripts/{changeset-pre-mode.js → changeset-pre-mode.cjs} +0 -0
  63. /package/dist/cjs/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.cts} +0 -0
  64. /package/dist/cjs/shared/{logger.js → logger.cjs} +0 -0
  65. /package/dist/cjs/shared/{logger.d.ts → logger.d.cts} +0 -0
  66. /package/dist/cjs/shared/{utils.js → utils.cjs} +0 -0
  67. /package/dist/cjs/shared/{utils.d.ts → utils.d.cts} +0 -0
  68. /package/dist/cjs/vite/config-builder/configs/{app.js → app.cjs} +0 -0
  69. /package/dist/cjs/vite/config-builder/configs/{app.d.ts → app.d.cts} +0 -0
  70. /package/dist/cjs/vite/config-builder/configs/{base.d.ts → base.d.cts} +0 -0
  71. /package/dist/cjs/vite/config-builder/configs/{index.d.ts → index.d.cts} +0 -0
  72. /package/dist/cjs/vite/config-builder/configs/{lib.d.ts → lib.d.cts} +0 -0
  73. /package/dist/cjs/vite/config-builder/configs/{script.d.ts → script.d.cts} +0 -0
  74. /package/dist/cjs/vite/config-builder/{main.d.ts → main.d.cts} +0 -0
  75. /package/dist/cjs/vite/config-builder/{plugins.d.ts → plugins.d.cts} +0 -0
  76. /package/dist/cjs/vite/config-builder/shared/{types.js → types.cjs} +0 -0
  77. /package/dist/cjs/vite/config-builder/shared/{types.d.ts → types.d.cts} +0 -0
  78. /package/dist/cjs/vite/config-builder/shared/utils/{helpers.js → helpers.cjs} +0 -0
  79. /package/dist/cjs/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.cts} +0 -0
  80. /package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.cts} +0 -0
  81. /package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.d.ts → viteCommand.d.cts} +0 -0
  82. /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.js → index.cjs} +0 -0
  83. /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.d.ts → index.d.cts} +0 -0
  84. /package/dist/cjs/vite/plugins/third-party-css-inject/{main.d.ts → main.d.cts} +0 -0
  85. /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.js → utils.cjs} +0 -0
  86. /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.d.ts → utils.d.cts} +0 -0
  87. /package/dist/esm/executors/deploy/{helpers.d.ts → helpers.d.mts} +0 -0
  88. /package/dist/esm/executors/deploy/{index.d.ts → index.d.mts} +0 -0
  89. /package/dist/esm/executors/environments/{helpers.d.ts → helpers.d.mts} +0 -0
  90. /package/dist/esm/executors/environments/{helpers.js → helpers.mjs} +0 -0
  91. /package/dist/esm/executors/environments/{index.d.ts → index.d.mts} +0 -0
  92. /package/dist/esm/executors/publish/{helpers.d.ts → helpers.d.mts} +0 -0
  93. /package/dist/esm/executors/publish/{helpers.js → helpers.mjs} +0 -0
  94. /package/dist/esm/executors/publish/{index.d.ts → index.d.mts} +0 -0
  95. /package/dist/esm/executors/shared/{utils.d.ts → utils.d.mts} +0 -0
  96. /package/dist/esm/executors/shared/{utils.js → utils.mjs} +0 -0
  97. /package/dist/esm/executors/update-executors-file/{index.d.ts → index.d.mts} +0 -0
  98. /package/dist/esm/executors/vtex-link/{constants.d.ts → constants.d.mts} +0 -0
  99. /package/dist/esm/executors/vtex-link/{constants.js → constants.mjs} +0 -0
  100. /package/dist/esm/executors/vtex-link/{helpers.d.ts → helpers.d.mts} +0 -0
  101. /package/dist/esm/executors/vtex-link/{index.d.ts → index.d.mts} +0 -0
  102. /package/dist/esm/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.mts} +0 -0
  103. /package/dist/esm/scripts/{changeset-pre-mode.js → changeset-pre-mode.mjs} +0 -0
  104. /package/dist/esm/shared/{logger.d.ts → logger.d.mts} +0 -0
  105. /package/dist/esm/shared/{logger.js → logger.mjs} +0 -0
  106. /package/dist/esm/shared/{utils.d.ts → utils.d.mts} +0 -0
  107. /package/dist/esm/shared/{utils.js → utils.mjs} +0 -0
  108. /package/dist/esm/vite/config-builder/configs/{app.d.ts → app.d.mts} +0 -0
  109. /package/dist/esm/vite/config-builder/configs/{app.js → app.mjs} +0 -0
  110. /package/dist/esm/vite/config-builder/configs/{base.d.ts → base.d.mts} +0 -0
  111. /package/dist/esm/vite/config-builder/configs/{index.d.ts → index.d.mts} +0 -0
  112. /package/dist/esm/vite/config-builder/configs/{lib.d.ts → lib.d.mts} +0 -0
  113. /package/dist/esm/vite/config-builder/configs/{script.d.ts → script.d.mts} +0 -0
  114. /package/dist/esm/vite/config-builder/{main.d.ts → main.d.mts} +0 -0
  115. /package/dist/esm/vite/config-builder/{plugins.d.ts → plugins.d.mts} +0 -0
  116. /package/dist/esm/vite/config-builder/shared/{types.d.ts → types.d.mts} +0 -0
  117. /package/dist/esm/vite/config-builder/shared/{types.js → types.mjs} +0 -0
  118. /package/dist/esm/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.mts} +0 -0
  119. /package/dist/esm/vite/config-builder/shared/utils/{helpers.js → helpers.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".
@@ -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');
@@ -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
 
@@ -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,10 +1,10 @@
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
9
  var fs = require('fs');
10
10
  var path = require('path');
@@ -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
5
  require('nanoid');
6
6
  require('path');
7
7
  require('ramda');
8
8
  require('minimatch');
9
- require('../../../shared/logger.js');
9
+ require('../../../shared/logger.cjs');
10
10
  require('fs');
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,11 +1,11 @@
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
10
  require('fs');
11
11
  require('chalk');
@@ -1,15 +1,15 @@
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
9
  require('nanoid');
10
10
  require('path');
11
11
  require('ramda');
12
- var projectConfig = require('./shared/utils/projectConfig.js');
12
+ var projectConfig = require('./shared/utils/projectConfig.cjs');
13
13
  require('chalk');
14
14
  require('mri');
15
15
 
@@ -9,11 +9,11 @@ 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
18
  require('fs');
19
19
  require('chalk');
@@ -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".
@@ -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
  /**
@@ -1,34 +1,22 @@
1
1
  import { logger } from '@nx/devkit';
2
2
  import { promises } from 'fs';
3
- import { cond, always, T, endsWith, test, pipe } from 'ramda';
3
+ import { cond, always, T, pipe } from 'ramda';
4
4
 
5
5
  const { writeFile } = promises;
6
- /**
7
- * Transforms the given path by adding or removing the './dist/' prefix
8
- * and ensuring that it has the '.js' extension if it's not a JSON file.
9
- *
10
- * @param {string} path - The original file path to transform.
11
- * @param {boolean} removeDist - Flag to determine if './dist/' should be removed.
12
- * @returns {string} The transformed file path.
13
- */ const transformPathToRoot = (path)=>{
6
+ const transformPathToRoot = (path)=>{
14
7
  const distPrefix = './dist/cjs/';
15
8
  const srcRegex = /^\.\/src\//;
16
- const distRegex = /^\.\/dist\//;
17
- const jsExt = '.js';
18
- endsWith(jsExt, path);
19
- const isJson = endsWith('.json', path);
20
- test(distRegex, path);
21
- // Adds './dist/' prefix to the path if it's not already present.
9
+ const executorTsRegex = /executor\.ts$/;
10
+ const jsonFileRegex = /\.json$/;
11
+ const isJson = jsonFileRegex.test(path);
22
12
  const changeSrcPath = (p)=>p.replace(srcRegex, distPrefix);
23
- // Adds '.js' extension to the path if it's not a JSON file and doesn't have the extension already.
24
- const changeFileName = (p)=>isJson ? p : p.replace(/executor\.ts$/, 'index.js');
13
+ const changeFileName = (p)=>isJson ? p : p.replace(executorTsRegex, 'index.cjs');
25
14
  return pipe(changeSrcPath, changeFileName)(path);
26
15
  };
27
16
  const transformPathToDist = (path)=>{
28
17
  const cjsPrefix = './cjs/';
29
18
  const distRegex = /^\.\/dist\/cjs\//;
30
- const changeDistPath = (p)=>p.replace(distRegex, cjsPrefix);
31
- return changeDistPath(path);
19
+ return path.replace(distRegex, cjsPrefix);
32
20
  };
33
21
  /**
34
22
  * Updates the executor paths for the provided executors object.
@@ -1,7 +1,7 @@
1
1
  import { promises } from 'fs';
2
2
  import { join } from 'path';
3
- import { getProjectConfig, ok, err } from '../shared/utils.js';
4
- import { updateExecutorPaths, writeJsonFileAsync } from './helpers.js';
3
+ import { getProjectConfig, ok, err } from '../shared/utils.mjs';
4
+ import { updateExecutorPaths, writeJsonFileAsync } from './helpers.mjs';
5
5
 
6
6
  const { readFile } = promises;
7
7
  /**
@@ -3,10 +3,10 @@ import { exec, spawn } from 'child_process';
3
3
  import { promises, existsSync } from 'fs';
4
4
  import { join, resolve } from 'path';
5
5
  import { promisify } from 'util';
6
- import '../../shared/logger.js';
7
- import { getPkgJson } from '../../shared/utils.js';
8
- import { ok, shortId } from '../shared/utils.js';
9
- import { VTEX_PROJECT_PATH, ERROR_LINKING_FLAG, SUCCESS_LINKING_FLAG } from './constants.js';
6
+ import '../../shared/logger.mjs';
7
+ import { getPkgJson } from '../../shared/utils.mjs';
8
+ import { ok, shortId } from '../shared/utils.mjs';
9
+ import { VTEX_PROJECT_PATH, ERROR_LINKING_FLAG, SUCCESS_LINKING_FLAG } from './constants.mjs';
10
10
 
11
11
  const execAsync = promisify(exec);
12
12
  const getPkgJsonPath = (vtexProjectPath)=>resolve(vtexProjectPath, 'package.json');
@@ -1,6 +1,6 @@
1
1
  import { resolve } from 'path';
2
- import { getProjectConfig, ok, err } from '../shared/utils.js';
3
- import { validateEnvironment, performRollback, buildAndLink } from './helpers.js';
2
+ import { getProjectConfig, ok, err } from '../shared/utils.mjs';
3
+ import { validateEnvironment, performRollback, buildAndLink } from './helpers.mjs';
4
4
 
5
5
  const VTEX_PROJECT_PATH = process.env.NZ_VTEX_PROJECT;
6
6
  async function runExecutor(opts, ctx) {
@@ -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.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","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,13 +1,13 @@
1
- export { default as deployExecutor } from './executors/deploy/index.js';
2
- export { default as environmentsExecutor } from './executors/environments/index.js';
3
- export { default as publishExecutor } from './executors/publish/index.js';
4
- export { default as updateExecutorsFileExecutor } from './executors/update-executors-file/index.js';
5
- export { default as vtexLinkExecutor } from './executors/vtex-link/index.js';
6
- export { main } from './scripts/changeset-pre-mode.js';
7
- export { createConfigBuilder } from './vite/config-builder/main.js';
8
- export { Flag, ProjectType, Stage, Target, ViteMode } from './vite/config-builder/shared/types.js';
9
- export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, shortId, when } from './vite/config-builder/shared/utils/helpers.js';
10
- export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './vite/config-builder/shared/utils/projectConfig.js';
11
- export { getViteCmdFlags, getViteCommand } from './vite/config-builder/shared/utils/viteCommand.js';
12
- export { thirdPartyCssInjectPlugin } from './vite/plugins/third-party-css-inject/main.js';
13
- export { injectCssIntoShadowDom } from './vite/plugins/shadow-dom-inject-css/index.js';
1
+ export { default as deployExecutor } from './executors/deploy/index.mjs';
2
+ export { default as environmentsExecutor } from './executors/environments/index.mjs';
3
+ export { default as publishExecutor } from './executors/publish/index.mjs';
4
+ export { default as updateExecutorsFileExecutor } from './executors/update-executors-file/index.mjs';
5
+ export { default as vtexLinkExecutor } from './executors/vtex-link/index.mjs';
6
+ export { main } from './scripts/changeset-pre-mode.mjs';
7
+ export { createConfigBuilder } from './vite/config-builder/main.mjs';
8
+ export { Flag, ProjectType, Stage, Target, ViteMode } from './vite/config-builder/shared/types.mjs';
9
+ export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, shortId, when } from './vite/config-builder/shared/utils/helpers.mjs';
10
+ export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './vite/config-builder/shared/utils/projectConfig.mjs';
11
+ export { getViteCmdFlags, getViteCommand } from './vite/config-builder/shared/utils/viteCommand.mjs';
12
+ export { thirdPartyCssInjectPlugin } from './vite/plugins/third-party-css-inject/main.mjs';
13
+ export { injectCssIntoShadowDom } from './vite/plugins/shadow-dom-inject-css/index.mjs';
@@ -1,8 +1,8 @@
1
- import { bundleAnalysisPlugin, basePlugins } from '../plugins.js';
2
- import { Target, ViteMode, Flag, Stage } from '../shared/types.js';
3
- import { getPlugins, when } from '../shared/utils/helpers.js';
1
+ import { bundleAnalysisPlugin, basePlugins } from '../plugins.mjs';
2
+ import { Target, ViteMode, Flag, Stage } from '../shared/types.mjs';
3
+ import { getPlugins, when } from '../shared/utils/helpers.mjs';
4
4
  import 'minimatch';
5
- import '../../../shared/logger.js';
5
+ import '../../../shared/logger.mjs';
6
6
  import '@nx/devkit';
7
7
  import { existsSync } from 'fs';
8
8
  import { resolve } from 'path';
@@ -1,18 +1,18 @@
1
- import { ProjectType } from '../shared/types.js';
1
+ import { ProjectType } from '../shared/types.mjs';
2
2
  import '@nx/devkit';
3
3
  import 'nanoid';
4
4
  import 'path';
5
5
  import 'ramda';
6
6
  import 'minimatch';
7
- import '../../../shared/logger.js';
7
+ import '../../../shared/logger.mjs';
8
8
  import 'fs';
9
9
  import 'chalk';
10
10
  import 'mri';
11
11
  import 'vite';
12
- import { getAppConfig } from './app.js';
13
- import { getBaseConfig } from './base.js';
14
- import { getLibConfig } from './lib.js';
15
- import { getScriptConfig } from './script.js';
12
+ import { getAppConfig } from './app.mjs';
13
+ import { getBaseConfig } from './base.mjs';
14
+ import { getLibConfig } from './lib.mjs';
15
+ import { getScriptConfig } from './script.mjs';
16
16
 
17
17
  const getConfig = (ctx, type = null)=>{
18
18
  switch(type){
@@ -1,8 +1,8 @@
1
1
  import { resolve } from 'path';
2
- import { dtsPlugin } from '../plugins.js';
3
- import '../shared/types.js';
4
- import { when, getPlugins } from '../shared/utils/helpers.js';
5
- import { getExternalDependencies } from '../shared/utils/projectConfig.js';
2
+ import { dtsPlugin } from '../plugins.mjs';
3
+ import '../shared/types.mjs';
4
+ import { when, getPlugins } from '../shared/utils/helpers.mjs';
5
+ import { getExternalDependencies } from '../shared/utils/projectConfig.mjs';
6
6
  import 'chalk';
7
7
  import 'mri';
8
8
  import 'vite';
@@ -1,9 +1,9 @@
1
1
  import { resolve } from 'path';
2
- import { injectCssByJsPlugin, injectCssIntoShadowDomPlugin } from '../plugins.js';
3
- import '../shared/types.js';
4
- import { getPlugins, chunkName } from '../shared/utils/helpers.js';
2
+ import { injectCssByJsPlugin, injectCssIntoShadowDomPlugin } from '../plugins.mjs';
3
+ import '../shared/types.mjs';
4
+ import { getPlugins, chunkName } from '../shared/utils/helpers.mjs';
5
5
  import 'minimatch';
6
- import '../../../shared/logger.js';
6
+ import '../../../shared/logger.mjs';
7
7
  import '@nx/devkit';
8
8
  import 'fs';
9
9
  import 'chalk';
@@ -1,13 +1,13 @@
1
1
  import { defineConfig } from 'vite';
2
- import { currentLogLevel, LogLevel, logger } from '../../shared/logger.js';
3
- import { getPkgJson } from '../../shared/utils.js';
4
- import { getConfig } from './configs/index.js';
5
- import './shared/types.js';
2
+ import { currentLogLevel, LogLevel, logger } from '../../shared/logger.mjs';
3
+ import { getPkgJson } from '../../shared/utils.mjs';
4
+ import { getConfig } from './configs/index.mjs';
5
+ import './shared/types.mjs';
6
6
  import '@nx/devkit';
7
7
  import 'nanoid';
8
8
  import 'path';
9
9
  import 'ramda';
10
- import { initializeConfig, mergeConfigs } from './shared/utils/projectConfig.js';
10
+ import { initializeConfig, mergeConfigs } from './shared/utils/projectConfig.mjs';
11
11
  import 'chalk';
12
12
  import 'mri';
13
13
 
@@ -7,11 +7,11 @@ import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
7
7
  import dts from 'vite-plugin-dts';
8
8
  import tsconfigPaths from 'vite-tsconfig-paths';
9
9
  import 'vite';
10
- import { injectCssIntoShadowDom } from '../plugins/shadow-dom-inject-css/index.js';
11
- import { Stage, Flag } from './shared/types.js';
12
- import { getNxTsConfigPaths } from './shared/utils/helpers.js';
10
+ import { injectCssIntoShadowDom } from '../plugins/shadow-dom-inject-css/index.mjs';
11
+ import { Stage, Flag } from './shared/types.mjs';
12
+ import { getNxTsConfigPaths } from './shared/utils/helpers.mjs';
13
13
  import 'minimatch';
14
- import '../../shared/logger.js';
14
+ import '../../shared/logger.mjs';
15
15
  import '@nx/devkit';
16
16
  import 'fs';
17
17
  import 'chalk';
@@ -1,9 +1,9 @@
1
1
  import { minimatch } from 'minimatch';
2
- import { LogLevel, logger, setLogLevel } from '../../../../shared/logger.js';
3
- import { getPkgJson } from '../../../../shared/utils.js';
4
- import { Flag } from '../types.js';
5
- import { deepMerge } from './helpers.js';
6
- import { getViteCommand } from './viteCommand.js';
2
+ import { LogLevel, logger, setLogLevel } from '../../../../shared/logger.mjs';
3
+ import { getPkgJson } from '../../../../shared/utils.mjs';
4
+ import { Flag } from '../types.mjs';
5
+ import { deepMerge } from './helpers.mjs';
6
+ import { getViteCommand } from './viteCommand.mjs';
7
7
 
8
8
  /**
9
9
  * Initializes the project configuration with default values.
@@ -1,7 +1,7 @@
1
1
  import chalk from 'chalk';
2
2
  import argv from 'mri';
3
3
  import { loadEnv } from 'vite';
4
- import { ViteMode, Stage, Target } from '../types.js';
4
+ import { ViteMode, Stage, Target } from '../types.mjs';
5
5
 
6
6
  /**
7
7
  * Retrieves the Vite command details.
@@ -1,4 +1,4 @@
1
- import { removeLinkStyleSheets, buildCSSInjectionCode } from './utils.js';
1
+ import { removeLinkStyleSheets, buildCSSInjectionCode } from './utils.mjs';
2
2
 
3
3
  /**
4
4
  * Inject the CSS compiled with JS.
@@ -1,28 +1,28 @@
1
1
  {
2
2
  "executors": {
3
3
  "environments": {
4
- "implementation": "./dist/cjs/executors/environments/index.js",
5
- "schema": "./dist/cjs/executors/environments/schema.json",
4
+ "implementation": "./cjs/executors/environments/index.cjs",
5
+ "schema": "./cjs/executors/environments/schema.json",
6
6
  "description": "Configure project with custom environments"
7
7
  },
8
8
  "vtex-link": {
9
- "implementation": "./dist/cjs/executors/vtex-link/index.js",
10
- "schema": "./dist/cjs/executors/vtex-link/schema.json",
9
+ "implementation": "./cjs/executors/vtex-link/index.cjs",
10
+ "schema": "./cjs/executors/vtex-link/schema.json",
11
11
  "description": "Links a package to a VTEX project."
12
12
  },
13
13
  "publish": {
14
- "implementation": "./dist/cjs/executors/publish/index.js",
15
- "schema": "./dist/cjs/executors/publish/schema.json",
14
+ "implementation": "./cjs/executors/publish/index.cjs",
15
+ "schema": "./cjs/executors/publish/schema.json",
16
16
  "description": "publish executor"
17
17
  },
18
18
  "update-executors-file": {
19
- "implementation": "./dist/cjs/executors/update-executors-file/index.js",
20
- "schema": "./dist/cjs/executors/update-executors-file/schema.json",
19
+ "implementation": "./cjs/executors/update-executors-file/index.cjs",
20
+ "schema": "./cjs/executors/update-executors-file/schema.json",
21
21
  "description": "update-executors-file executor"
22
22
  },
23
23
  "deploy": {
24
- "implementation": "./dist/cjs/executors/deploy/index.js",
25
- "schema": "./dist/cjs/executors/deploy/schema.json",
24
+ "implementation": "./cjs/executors/deploy/index.cjs",
25
+ "schema": "./cjs/executors/deploy/schema.json",
26
26
  "description": "deploy executor"
27
27
  }
28
28
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@nizza/devkit",
3
- "version": "0.1.0-alpha.3",
4
- "main": "dist/cjs/index.js",
5
- "module": "dist/esm/index.js",
3
+ "version": "0.1.0-alpha.4",
4
+ "type": "module",
5
+ "main": "dist/cjs/index.cjs",
6
+ "module": "dist/esm/index.mjs",
6
7
  "source": "src/index.ts",
7
8
  "types": "dist/esm/index.d.ts",
8
9
  "files": [
@@ -21,7 +22,7 @@
21
22
  "@rollup/plugin-commonjs": "^25.0.7",
22
23
  "@rollup/plugin-json": "^6.0.1",
23
24
  "@rollup/plugin-node-resolve": "^15.2.3",
24
- "@swc/core": "~1.3.95",
25
+ "@types/semver": "^7.5.0",
25
26
  "rollup": "^4.2.0",
26
27
  "rollup-plugin-copy": "^3.5.0",
27
28
  "rollup-plugin-delete": "^2.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","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 +0,0 @@
1
- {"version":3,"file":"index.d.ts","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":""}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes