@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,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, shortId } from '../../shared/utils.mjs';
8
+ import { ok } 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, 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';
@@ -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,4 +1,5 @@
1
1
  import { logger } from '@nx/devkit';
2
+ import { randomBytes } from 'crypto';
2
3
  import { readFileSync } from 'fs';
3
4
  import { resolve } from 'path';
4
5
 
@@ -19,5 +20,14 @@ import { resolve } from 'path';
19
20
  throw err;
20
21
  }
21
22
  };
23
+ /**
24
+ * Generates a random alphanumeric identifier of a specified length.
25
+ *
26
+ * @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
27
+ * @returns {string} - A string representing a unique identifier.
28
+ */ function shortId(length = 8) {
29
+ const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
30
+ return Array.from(randomBytes(length), (b)=>chars[b % chars.length]).join('');
31
+ }
22
32
 
23
- export { getPkgJson };
33
+ export { getPkgJson, shortId };
@@ -1,9 +1,10 @@
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
+ import 'crypto';
7
8
  import { existsSync } from 'fs';
8
9
  import { resolve } from 'path';
9
10
  import 'chalk';
@@ -1,18 +1,18 @@
1
- import { ProjectType } from '../shared/types.js';
1
+ import { ProjectType } from '../shared/types.mjs';
2
2
  import '@nx/devkit';
3
- import 'nanoid';
4
3
  import 'path';
5
4
  import 'ramda';
6
- import 'minimatch';
7
- import '../../../shared/logger.js';
5
+ import '../../../shared/logger.mjs';
6
+ import 'crypto';
8
7
  import 'fs';
8
+ import 'minimatch';
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,10 +1,11 @@
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
+ import 'crypto';
8
9
  import 'fs';
9
10
  import 'chalk';
10
11
  import 'mri';
@@ -1,13 +1,12 @@
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
- import 'nanoid';
8
7
  import 'path';
9
8
  import 'ramda';
10
- import { initializeConfig, mergeConfigs } from './shared/utils/projectConfig.js';
9
+ import { initializeConfig, mergeConfigs } from './shared/utils/projectConfig.mjs';
11
10
  import 'chalk';
12
11
  import 'mri';
13
12
 
@@ -7,12 +7,13 @@ 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
+ import 'crypto';
16
17
  import 'fs';
17
18
  import 'chalk';
18
19
  import 'mri';
@@ -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,17 +1,9 @@
1
1
  import { readCachedProjectGraph } from '@nx/devkit';
2
- import { nanoid } from 'nanoid';
3
2
  import { resolve } from 'path';
4
3
  import * as R from 'ramda';
4
+ import '../../../../shared/logger.mjs';
5
+ import { shortId } from '../../../../shared/utils.mjs';
5
6
 
6
- /**
7
- * Generates a short ID string.
8
- *
9
- * @param {number} length - The length of the ID to generate.
10
- * @returns {string} - The generated ID.
11
- *
12
- * @example
13
- * const id = shortId(10); // Outputs: "Aj3_Dk7_2j"
14
- */ const shortId = (length)=>nanoid(length);
15
7
  /**
16
8
  * Deeply merges two objects, combining their properties.
17
9
  *
@@ -95,4 +87,4 @@ import * as R from 'ramda';
95
87
  return Object.values(projects).filter(isValid).map(getTsConfigPath);
96
88
  };
97
89
 
98
- export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, shortId, when };
90
+ export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, when };
@@ -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,27 +1,27 @@
1
1
  {
2
2
  "executors": {
3
3
  "environments": {
4
- "implementation": "./dist/cjs/executors/environments/index.js",
4
+ "implementation": "./dist/cjs/executors/environments/index.cjs",
5
5
  "schema": "./dist/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",
9
+ "implementation": "./dist/cjs/executors/vtex-link/index.cjs",
10
10
  "schema": "./dist/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",
14
+ "implementation": "./dist/cjs/executors/publish/index.cjs",
15
15
  "schema": "./dist/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",
19
+ "implementation": "./dist/cjs/executors/update-executors-file/index.cjs",
20
20
  "schema": "./dist/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",
24
+ "implementation": "./dist/cjs/executors/deploy/index.cjs",
25
25
  "schema": "./dist/cjs/executors/deploy/schema.json",
26
26
  "description": "deploy executor"
27
27
  }
package/package.json CHANGED
@@ -1,27 +1,27 @@
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.5",
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": [
9
10
  "dist"
10
11
  ],
12
+ "executors": "./executors.json",
11
13
  "dependencies": {
12
14
  "chalk": "^4",
13
15
  "minimatch": "^9.0.3",
14
16
  "mri": "^1.2.0",
15
- "nanoid": "^5.0.2",
16
17
  "ramda": "^0.29.1",
17
18
  "semver": "^7.5.4"
18
19
  },
19
- "executors": "./executors.json",
20
20
  "devDependencies": {
21
21
  "@rollup/plugin-commonjs": "^25.0.7",
22
22
  "@rollup/plugin-json": "^6.0.1",
23
23
  "@rollup/plugin-node-resolve": "^15.2.3",
24
- "@swc/core": "~1.3.95",
24
+ "@types/semver": "^7.5.0",
25
25
  "rollup": "^4.2.0",
26
26
  "rollup-plugin-copy": "^3.5.0",
27
27
  "rollup-plugin-delete": "^2.0.0",
@@ -38,6 +38,5 @@
38
38
  "vite-plugin-css-injected-by-js": "^3.3.0",
39
39
  "vite-plugin-dts": "^3.6.3",
40
40
  "vite-tsconfig-paths": "^4.2.1"
41
- },
42
- "scripts": {}
41
+ }
43
42
  }
@@ -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