@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.
- package/dist/cjs/executors/deploy/{helpers.js → helpers.cjs} +1 -1
- package/dist/cjs/executors/deploy/{index.js → index.cjs} +2 -2
- package/dist/cjs/executors/environments/{index.js → index.cjs} +2 -2
- package/dist/cjs/executors/publish/{index.js → index.cjs} +4 -4
- package/dist/cjs/executors/shared/{utils.js → utils.cjs} +0 -11
- package/dist/{esm/executors/shared/utils.d.ts → cjs/executors/shared/utils.d.cts} +1 -8
- package/dist/cjs/executors/update-executors-file/{helpers.js → helpers.cjs} +6 -18
- package/dist/{esm/executors/update-executors-file/helpers.d.ts → cjs/executors/update-executors-file/helpers.d.cts} +0 -8
- package/dist/cjs/executors/update-executors-file/{index.js → index.cjs} +2 -2
- package/dist/cjs/executors/vtex-link/{helpers.js → helpers.cjs} +5 -5
- package/dist/cjs/executors/vtex-link/{index.js → index.cjs} +2 -2
- package/dist/cjs/{index.js → index.cjs} +13 -14
- package/dist/cjs/{index.d.ts → index.d.cts} +1 -1
- package/dist/cjs/index.d.cts.map +1 -0
- package/dist/cjs/shared/{utils.js → utils.cjs} +11 -0
- package/dist/cjs/shared/{utils.d.ts → utils.d.cts} +8 -1
- package/dist/cjs/vite/config-builder/configs/{base.js → base.cjs} +5 -4
- package/dist/cjs/vite/config-builder/configs/{index.js → index.cjs} +8 -8
- package/dist/cjs/vite/config-builder/configs/{lib.js → lib.cjs} +4 -4
- package/dist/cjs/vite/config-builder/configs/{script.js → script.cjs} +5 -4
- package/dist/cjs/vite/config-builder/{main.js → main.cjs} +5 -6
- package/dist/cjs/vite/config-builder/{plugins.js → plugins.cjs} +5 -4
- package/dist/cjs/vite/config-builder/shared/utils/{helpers.js → helpers.cjs} +3 -12
- package/dist/cjs/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.cts} +1 -11
- package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.cjs} +5 -5
- package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.cjs} +1 -1
- package/dist/cjs/vite/plugins/third-party-css-inject/{main.js → main.cjs} +1 -1
- package/dist/esm/executors/deploy/{helpers.js → helpers.mjs} +1 -1
- package/dist/esm/executors/deploy/{index.js → index.mjs} +2 -2
- package/dist/esm/executors/environments/{index.js → index.mjs} +2 -2
- package/dist/esm/executors/publish/{index.js → index.mjs} +4 -4
- package/dist/{cjs/executors/shared/utils.d.ts → esm/executors/shared/utils.d.mts} +1 -8
- package/dist/esm/executors/shared/{utils.js → utils.mjs} +1 -11
- package/dist/{cjs/executors/update-executors-file/helpers.d.ts → esm/executors/update-executors-file/helpers.d.mts} +0 -8
- package/dist/esm/executors/update-executors-file/{helpers.js → helpers.mjs} +7 -19
- package/dist/esm/executors/update-executors-file/{index.js → index.mjs} +2 -2
- package/dist/esm/executors/vtex-link/{helpers.js → helpers.mjs} +4 -4
- package/dist/esm/executors/vtex-link/{index.js → index.mjs} +2 -2
- package/dist/esm/{index.d.ts → index.d.mts} +1 -1
- package/dist/esm/index.d.mts.map +1 -0
- package/dist/esm/{index.js → index.mjs} +13 -13
- package/dist/esm/shared/{utils.d.ts → utils.d.mts} +8 -1
- package/dist/esm/shared/{utils.js → utils.mjs} +11 -1
- package/dist/esm/vite/config-builder/configs/{base.js → base.mjs} +5 -4
- package/dist/esm/vite/config-builder/configs/{index.js → index.mjs} +8 -8
- package/dist/esm/vite/config-builder/configs/{lib.js → lib.mjs} +4 -4
- package/dist/esm/vite/config-builder/configs/{script.js → script.mjs} +5 -4
- package/dist/esm/vite/config-builder/{main.js → main.mjs} +5 -6
- package/dist/esm/vite/config-builder/{plugins.js → plugins.mjs} +5 -4
- package/dist/esm/vite/config-builder/shared/utils/{helpers.d.ts → helpers.d.mts} +1 -11
- package/dist/esm/vite/config-builder/shared/utils/{helpers.js → helpers.mjs} +3 -11
- package/dist/esm/vite/config-builder/shared/utils/{projectConfig.js → projectConfig.mjs} +5 -5
- package/dist/esm/vite/config-builder/shared/utils/{viteCommand.js → viteCommand.mjs} +1 -1
- package/dist/esm/vite/plugins/third-party-css-inject/{main.js → main.mjs} +1 -1
- package/dist/executors.json +5 -5
- package/package.json +7 -8
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/esm/index.d.ts.map +0 -1
- /package/dist/cjs/executors/deploy/{helpers.d.ts → helpers.d.cts} +0 -0
- /package/dist/cjs/executors/deploy/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/executors/environments/{helpers.js → helpers.cjs} +0 -0
- /package/dist/cjs/executors/environments/{helpers.d.ts → helpers.d.cts} +0 -0
- /package/dist/cjs/executors/environments/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/executors/publish/{helpers.js → helpers.cjs} +0 -0
- /package/dist/cjs/executors/publish/{helpers.d.ts → helpers.d.cts} +0 -0
- /package/dist/cjs/executors/publish/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/executors/update-executors-file/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/executors/vtex-link/{constants.js → constants.cjs} +0 -0
- /package/dist/cjs/executors/vtex-link/{constants.d.ts → constants.d.cts} +0 -0
- /package/dist/cjs/executors/vtex-link/{helpers.d.ts → helpers.d.cts} +0 -0
- /package/dist/cjs/executors/vtex-link/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/scripts/{changeset-pre-mode.js → changeset-pre-mode.cjs} +0 -0
- /package/dist/cjs/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.cts} +0 -0
- /package/dist/cjs/shared/{logger.js → logger.cjs} +0 -0
- /package/dist/cjs/shared/{logger.d.ts → logger.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{app.js → app.cjs} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{app.d.ts → app.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{base.d.ts → base.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{lib.d.ts → lib.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/configs/{script.d.ts → script.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/{main.d.ts → main.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/{plugins.d.ts → plugins.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/shared/{types.js → types.cjs} +0 -0
- /package/dist/cjs/vite/config-builder/shared/{types.d.ts → types.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.cts} +0 -0
- /package/dist/cjs/vite/config-builder/shared/utils/{viteCommand.d.ts → viteCommand.d.cts} +0 -0
- /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.js → index.cjs} +0 -0
- /package/dist/cjs/vite/plugins/shadow-dom-inject-css/{index.d.ts → index.d.cts} +0 -0
- /package/dist/cjs/vite/plugins/third-party-css-inject/{main.d.ts → main.d.cts} +0 -0
- /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.js → utils.cjs} +0 -0
- /package/dist/cjs/vite/plugins/third-party-css-inject/{utils.d.ts → utils.d.cts} +0 -0
- /package/dist/esm/executors/deploy/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/executors/deploy/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/executors/environments/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/executors/environments/{helpers.js → helpers.mjs} +0 -0
- /package/dist/esm/executors/environments/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/executors/publish/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/executors/publish/{helpers.js → helpers.mjs} +0 -0
- /package/dist/esm/executors/publish/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/executors/update-executors-file/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/executors/vtex-link/{constants.d.ts → constants.d.mts} +0 -0
- /package/dist/esm/executors/vtex-link/{constants.js → constants.mjs} +0 -0
- /package/dist/esm/executors/vtex-link/{helpers.d.ts → helpers.d.mts} +0 -0
- /package/dist/esm/executors/vtex-link/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/scripts/{changeset-pre-mode.d.ts → changeset-pre-mode.d.mts} +0 -0
- /package/dist/esm/scripts/{changeset-pre-mode.js → changeset-pre-mode.mjs} +0 -0
- /package/dist/esm/shared/{logger.d.ts → logger.d.mts} +0 -0
- /package/dist/esm/shared/{logger.js → logger.mjs} +0 -0
- /package/dist/esm/vite/config-builder/configs/{app.d.ts → app.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/configs/{app.js → app.mjs} +0 -0
- /package/dist/esm/vite/config-builder/configs/{base.d.ts → base.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/configs/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/configs/{lib.d.ts → lib.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/configs/{script.d.ts → script.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/{main.d.ts → main.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/{plugins.d.ts → plugins.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/shared/{types.d.ts → types.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/shared/{types.js → types.mjs} +0 -0
- /package/dist/esm/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.mts} +0 -0
- /package/dist/esm/vite/config-builder/shared/utils/{viteCommand.d.ts → viteCommand.d.mts} +0 -0
- /package/dist/esm/vite/plugins/shadow-dom-inject-css/{index.d.ts → index.d.mts} +0 -0
- /package/dist/esm/vite/plugins/shadow-dom-inject-css/{index.js → index.mjs} +0 -0
- /package/dist/esm/vite/plugins/third-party-css-inject/{main.d.ts → main.d.mts} +0 -0
- /package/dist/esm/vite/plugins/third-party-css-inject/{utils.d.ts → utils.d.mts} +0 -0
- /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,
|
|
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
|
|
17
|
-
const
|
|
18
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
4
|
-
import { updateExecutorPaths, writeJsonFileAsync } from './helpers.
|
|
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.
|
|
7
|
-
import { getPkgJson } from '../../shared/utils.
|
|
8
|
-
import { ok
|
|
9
|
-
import { VTEX_PROJECT_PATH, ERROR_LINKING_FLAG, SUCCESS_LINKING_FLAG } from './constants.
|
|
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.
|
|
3
|
-
import { validateEnvironment, performRollback, buildAndLink } from './helpers.
|
|
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) {
|
|
@@ -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.
|
|
2
|
-
export { default as environmentsExecutor } from './executors/environments/index.
|
|
3
|
-
export { default as publishExecutor } from './executors/publish/index.
|
|
4
|
-
export { default as updateExecutorsFileExecutor } from './executors/update-executors-file/index.
|
|
5
|
-
export { default as vtexLinkExecutor } from './executors/vtex-link/index.
|
|
6
|
-
export { main } from './scripts/changeset-pre-mode.
|
|
7
|
-
export { createConfigBuilder } from './vite/config-builder/main.
|
|
8
|
-
export { Flag, ProjectType, Stage, Target, ViteMode } from './vite/config-builder/shared/types.
|
|
9
|
-
export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins,
|
|
10
|
-
export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './vite/config-builder/shared/utils/projectConfig.
|
|
11
|
-
export { getViteCmdFlags, getViteCommand } from './vite/config-builder/shared/utils/viteCommand.
|
|
12
|
-
export { thirdPartyCssInjectPlugin } from './vite/plugins/third-party-css-inject/main.
|
|
13
|
-
export { injectCssIntoShadowDom } from './vite/plugins/shadow-dom-inject-css/index.
|
|
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
|
-
|
|
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.
|
|
2
|
-
import { Target, ViteMode, Flag, Stage } from '../shared/types.
|
|
3
|
-
import { getPlugins, when } from '../shared/utils/helpers.
|
|
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.
|
|
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.
|
|
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 '
|
|
7
|
-
import '
|
|
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.
|
|
13
|
-
import { getBaseConfig } from './base.
|
|
14
|
-
import { getLibConfig } from './lib.
|
|
15
|
-
import { getScriptConfig } from './script.
|
|
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.
|
|
3
|
-
import '../shared/types.
|
|
4
|
-
import { when, getPlugins } from '../shared/utils/helpers.
|
|
5
|
-
import { getExternalDependencies } from '../shared/utils/projectConfig.
|
|
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.
|
|
3
|
-
import '../shared/types.
|
|
4
|
-
import { getPlugins, chunkName } from '../shared/utils/helpers.
|
|
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.
|
|
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.
|
|
3
|
-
import { getPkgJson } from '../../shared/utils.
|
|
4
|
-
import { getConfig } from './configs/index.
|
|
5
|
-
import './shared/types.
|
|
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.
|
|
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.
|
|
11
|
-
import { Stage, Flag } from './shared/types.
|
|
12
|
-
import { getNxTsConfigPaths } from './shared/utils/helpers.
|
|
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.
|
|
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 {
|
|
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,
|
|
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.
|
|
3
|
-
import { getPkgJson } from '../../../../shared/utils.
|
|
4
|
-
import { Flag } from '../types.
|
|
5
|
-
import { deepMerge } from './helpers.
|
|
6
|
-
import { getViteCommand } from './viteCommand.
|
|
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.
|
package/dist/executors.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"executors": {
|
|
3
3
|
"environments": {
|
|
4
|
-
"implementation": "./dist/cjs/executors/environments/index.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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
|
-
"@
|
|
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
|
}
|
package/dist/cjs/index.d.ts.map
DELETED
|
@@ -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":""}
|
package/dist/esm/index.d.ts.map
DELETED
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/cjs/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.cts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/esm/vite/config-builder/shared/utils/{projectConfig.d.ts → projectConfig.d.mts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|