@nizza/devkit 0.1.0-alpha.4 → 0.1.0-alpha.6
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/shared/utils.cjs +0 -11
- package/dist/cjs/executors/shared/utils.d.cts +1 -8
- package/dist/cjs/executors/vtex-link/helpers.cjs +1 -1
- package/dist/cjs/index.cjs +0 -1
- package/dist/cjs/shared/utils.cjs +11 -0
- package/dist/cjs/shared/utils.d.cts +8 -1
- package/dist/cjs/vite/config-builder/configs/base.cjs +1 -0
- package/dist/cjs/vite/config-builder/configs/index.cjs +2 -2
- package/dist/cjs/vite/config-builder/configs/script.cjs +1 -0
- package/dist/cjs/vite/config-builder/main.cjs +0 -1
- package/dist/cjs/vite/config-builder/plugins.cjs +2 -4
- package/dist/cjs/vite/config-builder/shared/utils/helpers.cjs +3 -12
- package/dist/cjs/vite/config-builder/shared/utils/helpers.d.cts +1 -11
- package/dist/esm/executors/shared/utils.d.mts +1 -8
- package/dist/esm/executors/shared/utils.mjs +1 -11
- package/dist/esm/executors/vtex-link/helpers.mjs +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/shared/utils.d.mts +8 -1
- package/dist/esm/shared/utils.mjs +11 -1
- package/dist/esm/vite/config-builder/configs/base.mjs +1 -0
- package/dist/esm/vite/config-builder/configs/index.mjs +2 -2
- package/dist/esm/vite/config-builder/configs/script.mjs +1 -0
- package/dist/esm/vite/config-builder/main.mjs +0 -1
- package/dist/esm/vite/config-builder/plugins.mjs +2 -4
- package/dist/esm/vite/config-builder/shared/utils/helpers.d.mts +1 -11
- package/dist/esm/vite/config-builder/shared/utils/helpers.mjs +3 -11
- package/dist/executors.json +10 -10
- package/package.json +18 -5
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var devkit = require('@nx/devkit');
|
|
4
|
-
var crypto = require('crypto');
|
|
5
4
|
var child_process = require('child_process');
|
|
6
5
|
var util = require('util');
|
|
7
6
|
|
|
@@ -34,15 +33,6 @@ const execAsync = util.promisify(child_process.exec);
|
|
|
34
33
|
success: false
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Generates a random alphanumeric identifier of a specified length.
|
|
39
|
-
*
|
|
40
|
-
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
41
|
-
* @returns {string} - A string representing a unique identifier.
|
|
42
|
-
*/ function shortId(length = 8) {
|
|
43
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
44
|
-
return Array.from(crypto.randomBytes(length), (b)=>chars[b % chars.length]).join('');
|
|
45
|
-
}
|
|
46
36
|
/**
|
|
47
37
|
* Retrieves the project configuration for the current execution context.
|
|
48
38
|
*
|
|
@@ -75,4 +65,3 @@ exports.err = err;
|
|
|
75
65
|
exports.getProjectConfig = getProjectConfig;
|
|
76
66
|
exports.ok = ok;
|
|
77
67
|
exports.runCommand = runCommand;
|
|
78
|
-
exports.shortId = shortId;
|
|
@@ -15,13 +15,6 @@ declare function ok(message?: string): ExecutorResponse;
|
|
|
15
15
|
* @returns {ExecutorResponse} - An object representing a failed operation.
|
|
16
16
|
*/
|
|
17
17
|
declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
|
|
18
|
-
/**
|
|
19
|
-
* Generates a random alphanumeric identifier of a specified length.
|
|
20
|
-
*
|
|
21
|
-
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
22
|
-
* @returns {string} - A string representing a unique identifier.
|
|
23
|
-
*/
|
|
24
|
-
declare function shortId(length?: number): string;
|
|
25
18
|
/**
|
|
26
19
|
* Retrieves the project configuration for the current execution context.
|
|
27
20
|
*
|
|
@@ -31,4 +24,4 @@ declare function shortId(length?: number): string;
|
|
|
31
24
|
*/
|
|
32
25
|
declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
|
|
33
26
|
declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
|
|
34
|
-
export { ok, err,
|
|
27
|
+
export { ok, err, getProjectConfig, runCommand };
|
|
@@ -96,7 +96,7 @@ const getPkgJsonPath = (vtexProjectPath)=>path.resolve(vtexProjectPath, 'package
|
|
|
96
96
|
const packageJson = utils$1.getPkgJson('./');
|
|
97
97
|
const oldName = `${packageOrg}-${projectName}-${packageJson.version}.tgz`;
|
|
98
98
|
const oldPath = path.join(projectRoot, oldName);
|
|
99
|
-
const newName = `${packageOrg}-${projectName}-${packageJson.version}-${utils.shortId(8)}.tgz`;
|
|
99
|
+
const newName = `${packageOrg}-${projectName}-${packageJson.version}-${utils$1.shortId(8)}.tgz`;
|
|
100
100
|
const newPath = path.join(projectRoot, newName);
|
|
101
101
|
await fs.promises.rename(oldPath, newPath);
|
|
102
102
|
devkit.logger.info(`🏷️ New package name: ${newName}`);
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -47,7 +47,6 @@ exports.chunkName = helpers.chunkName;
|
|
|
47
47
|
exports.deepMerge = helpers.deepMerge;
|
|
48
48
|
exports.getNxTsConfigPaths = helpers.getNxTsConfigPaths;
|
|
49
49
|
exports.getPlugins = helpers.getPlugins;
|
|
50
|
-
exports.shortId = helpers.shortId;
|
|
51
50
|
exports.when = helpers.when;
|
|
52
51
|
exports.getExternalDependencies = projectConfig.getExternalDependencies;
|
|
53
52
|
exports.getInitials = projectConfig.getInitials;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var devkit = require('@nx/devkit');
|
|
4
|
+
var crypto = require('crypto');
|
|
4
5
|
var fs = require('fs');
|
|
5
6
|
var path = require('path');
|
|
6
7
|
|
|
@@ -21,5 +22,15 @@ var path = require('path');
|
|
|
21
22
|
throw err;
|
|
22
23
|
}
|
|
23
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Generates a random alphanumeric identifier of a specified length.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
29
|
+
* @returns {string} - A string representing a unique identifier.
|
|
30
|
+
*/ function shortId(length = 8) {
|
|
31
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
32
|
+
return Array.from(crypto.randomBytes(length), (b)=>chars[b % chars.length]).join('');
|
|
33
|
+
}
|
|
24
34
|
|
|
25
35
|
exports.getPkgJson = getPkgJson;
|
|
36
|
+
exports.shortId = shortId;
|
|
@@ -8,4 +8,11 @@
|
|
|
8
8
|
* const pkgJsonData = getPkgJson('/path/to/project');
|
|
9
9
|
*/
|
|
10
10
|
declare const getPkgJson: (projectPath: string) => Record<string, any>;
|
|
11
|
-
|
|
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 };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var types = require('../shared/types.cjs');
|
|
4
4
|
require('@nx/devkit');
|
|
5
|
-
require('nanoid');
|
|
6
5
|
require('path');
|
|
7
6
|
require('ramda');
|
|
8
|
-
require('minimatch');
|
|
9
7
|
require('../../../shared/logger.cjs');
|
|
8
|
+
require('crypto');
|
|
10
9
|
require('fs');
|
|
10
|
+
require('minimatch');
|
|
11
11
|
require('chalk');
|
|
12
12
|
require('mri');
|
|
13
13
|
require('vite');
|
|
@@ -6,7 +6,6 @@ var utils = require('../../shared/utils.cjs');
|
|
|
6
6
|
var index = require('./configs/index.cjs');
|
|
7
7
|
require('./shared/types.cjs');
|
|
8
8
|
require('@nx/devkit');
|
|
9
|
-
require('nanoid');
|
|
10
9
|
require('path');
|
|
11
10
|
require('ramda');
|
|
12
11
|
var projectConfig = require('./shared/utils/projectConfig.cjs');
|
|
@@ -15,6 +15,7 @@ var helpers = require('./shared/utils/helpers.cjs');
|
|
|
15
15
|
require('minimatch');
|
|
16
16
|
require('../../shared/logger.cjs');
|
|
17
17
|
require('@nx/devkit');
|
|
18
|
+
require('crypto');
|
|
18
19
|
require('fs');
|
|
19
20
|
require('chalk');
|
|
20
21
|
require('mri');
|
|
@@ -28,12 +29,9 @@ require('mri');
|
|
|
28
29
|
* - @rollup/plugin-graphql
|
|
29
30
|
* - @vitejs/plugin-react-swc
|
|
30
31
|
*/ const basePlugins = {
|
|
31
|
-
generate: (
|
|
32
|
+
generate: ()=>{
|
|
32
33
|
const projects = helpers.getNxTsConfigPaths();
|
|
33
34
|
return [
|
|
34
|
-
// tsconfigPaths({
|
|
35
|
-
// projects: tsConfigPaths.map(x => resolve(process.cwd(), x)),
|
|
36
|
-
// }),
|
|
37
35
|
tsconfigPaths({
|
|
38
36
|
projects
|
|
39
37
|
}),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var devkit = require('@nx/devkit');
|
|
4
|
-
var nanoid = require('nanoid');
|
|
5
4
|
var path = require('path');
|
|
6
5
|
var R = require('ramda');
|
|
6
|
+
require('../../../../shared/logger.cjs');
|
|
7
|
+
var utils = require('../../../../shared/utils.cjs');
|
|
7
8
|
|
|
8
9
|
function _interopNamespaceDefault(e) {
|
|
9
10
|
var n = Object.create(null);
|
|
@@ -24,15 +25,6 @@ function _interopNamespaceDefault(e) {
|
|
|
24
25
|
|
|
25
26
|
var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
|
|
26
27
|
|
|
27
|
-
/**
|
|
28
|
-
* Generates a short ID string.
|
|
29
|
-
*
|
|
30
|
-
* @param {number} length - The length of the ID to generate.
|
|
31
|
-
* @returns {string} - The generated ID.
|
|
32
|
-
*
|
|
33
|
-
* @example
|
|
34
|
-
* const id = shortId(10); // Outputs: "Aj3_Dk7_2j"
|
|
35
|
-
*/ const shortId = (length)=>nanoid.nanoid(length);
|
|
36
28
|
/**
|
|
37
29
|
* Deeply merges two objects, combining their properties.
|
|
38
30
|
*
|
|
@@ -65,7 +57,7 @@ var R__namespace = /*#__PURE__*/_interopNamespaceDefault(R);
|
|
|
65
57
|
*/ const chunkName = (prefix)=>(x)=>{
|
|
66
58
|
const nameWithoutUnderscore = x.name.replace(/_/g, '');
|
|
67
59
|
const pre = prefix ? `${prefix}-` : '';
|
|
68
|
-
return `${pre}${nameWithoutUnderscore}-${shortId(8)}.js`;
|
|
60
|
+
return `${pre}${nameWithoutUnderscore}-${utils.shortId(8)}.js`;
|
|
69
61
|
};
|
|
70
62
|
/**
|
|
71
63
|
* Returns the given object if the condition is true, otherwise returns null.
|
|
@@ -120,5 +112,4 @@ exports.chunkName = chunkName;
|
|
|
120
112
|
exports.deepMerge = deepMerge;
|
|
121
113
|
exports.getNxTsConfigPaths = getNxTsConfigPaths;
|
|
122
114
|
exports.getPlugins = getPlugins;
|
|
123
|
-
exports.shortId = shortId;
|
|
124
115
|
exports.when = when;
|
|
@@ -1,16 +1,6 @@
|
|
|
1
1
|
import { PreRenderedChunk } from 'rollup';
|
|
2
2
|
import { PluginOption } from 'vite';
|
|
3
3
|
import { Context, PluginConfig } from "../types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Generates a short ID string.
|
|
6
|
-
*
|
|
7
|
-
* @param {number} length - The length of the ID to generate.
|
|
8
|
-
* @returns {string} - The generated ID.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* const id = shortId(10); // Outputs: "Aj3_Dk7_2j"
|
|
12
|
-
*/
|
|
13
|
-
declare const shortId: (length: number) => string;
|
|
14
4
|
/**
|
|
15
5
|
* Deeply merges two objects, combining their properties.
|
|
16
6
|
*
|
|
@@ -78,4 +68,4 @@ declare const getPlugins: (ctx: Context, ...pluginConfigs: PluginConfig[]) => Pl
|
|
|
78
68
|
* // ['apps/my-app/tsconfig.app.json', 'libs/my-lib/tsconfig.lib.json']
|
|
79
69
|
*/
|
|
80
70
|
declare const getNxTsConfigPaths: () => string[];
|
|
81
|
-
export {
|
|
71
|
+
export { deepMerge, chunkName, when, getPlugins, getNxTsConfigPaths };
|
|
@@ -15,13 +15,6 @@ declare function ok(message?: string): ExecutorResponse;
|
|
|
15
15
|
* @returns {ExecutorResponse} - An object representing a failed operation.
|
|
16
16
|
*/
|
|
17
17
|
declare function err(err?: string | Error | unknown, message?: string): ExecutorResponse;
|
|
18
|
-
/**
|
|
19
|
-
* Generates a random alphanumeric identifier of a specified length.
|
|
20
|
-
*
|
|
21
|
-
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
22
|
-
* @returns {string} - A string representing a unique identifier.
|
|
23
|
-
*/
|
|
24
|
-
declare function shortId(length?: number): string;
|
|
25
18
|
/**
|
|
26
19
|
* Retrieves the project configuration for the current execution context.
|
|
27
20
|
*
|
|
@@ -31,4 +24,4 @@ declare function shortId(length?: number): string;
|
|
|
31
24
|
*/
|
|
32
25
|
declare function getProjectConfig(ctx: ExecutorContext): ProjectConfiguration;
|
|
33
26
|
declare function runCommand(command: string, cwd?: string | URL): Promise<void>;
|
|
34
|
-
export { ok, err,
|
|
27
|
+
export { ok, err, getProjectConfig, runCommand };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { logger } from '@nx/devkit';
|
|
2
|
-
import { randomBytes } from 'crypto';
|
|
3
2
|
import { exec } from 'child_process';
|
|
4
3
|
import { promisify } from 'util';
|
|
5
4
|
|
|
@@ -32,15 +31,6 @@ const execAsync = promisify(exec);
|
|
|
32
31
|
success: false
|
|
33
32
|
};
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Generates a random alphanumeric identifier of a specified length.
|
|
37
|
-
*
|
|
38
|
-
* @param {number} [length=8] - The length of the identifier to generate. Defaults to 8 if not specified.
|
|
39
|
-
* @returns {string} - A string representing a unique identifier.
|
|
40
|
-
*/ function shortId(length = 8) {
|
|
41
|
-
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
42
|
-
return Array.from(randomBytes(length), (b)=>chars[b % chars.length]).join('');
|
|
43
|
-
}
|
|
44
34
|
/**
|
|
45
35
|
* Retrieves the project configuration for the current execution context.
|
|
46
36
|
*
|
|
@@ -69,4 +59,4 @@ async function runCommand(command, cwd) {
|
|
|
69
59
|
}
|
|
70
60
|
}
|
|
71
61
|
|
|
72
|
-
export { err, getProjectConfig, ok, runCommand
|
|
62
|
+
export { err, getProjectConfig, ok, runCommand };
|
|
@@ -4,8 +4,8 @@ import { promises, existsSync } from 'fs';
|
|
|
4
4
|
import { join, resolve } from 'path';
|
|
5
5
|
import { promisify } from 'util';
|
|
6
6
|
import '../../shared/logger.mjs';
|
|
7
|
-
import { getPkgJson } from '../../shared/utils.mjs';
|
|
8
|
-
import { ok
|
|
7
|
+
import { getPkgJson, shortId } from '../../shared/utils.mjs';
|
|
8
|
+
import { ok } from '../shared/utils.mjs';
|
|
9
9
|
import { VTEX_PROJECT_PATH, ERROR_LINKING_FLAG, SUCCESS_LINKING_FLAG } from './constants.mjs';
|
|
10
10
|
|
|
11
11
|
const execAsync = promisify(exec);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ export { default as vtexLinkExecutor } from './executors/vtex-link/index.mjs';
|
|
|
6
6
|
export { main } from './scripts/changeset-pre-mode.mjs';
|
|
7
7
|
export { createConfigBuilder } from './vite/config-builder/main.mjs';
|
|
8
8
|
export { Flag, ProjectType, Stage, Target, ViteMode } from './vite/config-builder/shared/types.mjs';
|
|
9
|
-
export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins,
|
|
9
|
+
export { chunkName, deepMerge, getNxTsConfigPaths, getPlugins, when } from './vite/config-builder/shared/utils/helpers.mjs';
|
|
10
10
|
export { getExternalDependencies, getInitials, initializeConfig, mergeConfigs } from './vite/config-builder/shared/utils/projectConfig.mjs';
|
|
11
11
|
export { getViteCmdFlags, getViteCommand } from './vite/config-builder/shared/utils/viteCommand.mjs';
|
|
12
12
|
export { thirdPartyCssInjectPlugin } from './vite/plugins/third-party-css-inject/main.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,11 +1,11 @@
|
|
|
1
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
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';
|
|
@@ -4,7 +4,6 @@ import { getPkgJson } from '../../shared/utils.mjs';
|
|
|
4
4
|
import { getConfig } from './configs/index.mjs';
|
|
5
5
|
import './shared/types.mjs';
|
|
6
6
|
import '@nx/devkit';
|
|
7
|
-
import 'nanoid';
|
|
8
7
|
import 'path';
|
|
9
8
|
import 'ramda';
|
|
10
9
|
import { initializeConfig, mergeConfigs } from './shared/utils/projectConfig.mjs';
|
|
@@ -13,6 +13,7 @@ import { getNxTsConfigPaths } from './shared/utils/helpers.mjs';
|
|
|
13
13
|
import 'minimatch';
|
|
14
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';
|
|
@@ -26,12 +27,9 @@ import 'mri';
|
|
|
26
27
|
* - @rollup/plugin-graphql
|
|
27
28
|
* - @vitejs/plugin-react-swc
|
|
28
29
|
*/ const basePlugins = {
|
|
29
|
-
generate: (
|
|
30
|
+
generate: ()=>{
|
|
30
31
|
const projects = getNxTsConfigPaths();
|
|
31
32
|
return [
|
|
32
|
-
// tsconfigPaths({
|
|
33
|
-
// projects: tsConfigPaths.map(x => resolve(process.cwd(), x)),
|
|
34
|
-
// }),
|
|
35
33
|
tsconfigPaths({
|
|
36
34
|
projects
|
|
37
35
|
}),
|
|
@@ -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 };
|
package/dist/executors.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"executors": {
|
|
3
3
|
"environments": {
|
|
4
|
-
"implementation": "./cjs/executors/environments/index.cjs",
|
|
5
|
-
"schema": "./cjs/executors/environments/schema.json",
|
|
4
|
+
"implementation": "./dist/cjs/executors/environments/index.cjs",
|
|
5
|
+
"schema": "./dist/cjs/executors/environments/schema.json",
|
|
6
6
|
"description": "Configure project with custom environments"
|
|
7
7
|
},
|
|
8
8
|
"vtex-link": {
|
|
9
|
-
"implementation": "./cjs/executors/vtex-link/index.cjs",
|
|
10
|
-
"schema": "./cjs/executors/vtex-link/schema.json",
|
|
9
|
+
"implementation": "./dist/cjs/executors/vtex-link/index.cjs",
|
|
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": "./cjs/executors/publish/index.cjs",
|
|
15
|
-
"schema": "./cjs/executors/publish/schema.json",
|
|
14
|
+
"implementation": "./dist/cjs/executors/publish/index.cjs",
|
|
15
|
+
"schema": "./dist/cjs/executors/publish/schema.json",
|
|
16
16
|
"description": "publish executor"
|
|
17
17
|
},
|
|
18
18
|
"update-executors-file": {
|
|
19
|
-
"implementation": "./cjs/executors/update-executors-file/index.cjs",
|
|
20
|
-
"schema": "./cjs/executors/update-executors-file/schema.json",
|
|
19
|
+
"implementation": "./dist/cjs/executors/update-executors-file/index.cjs",
|
|
20
|
+
"schema": "./dist/cjs/executors/update-executors-file/schema.json",
|
|
21
21
|
"description": "update-executors-file executor"
|
|
22
22
|
},
|
|
23
23
|
"deploy": {
|
|
24
|
-
"implementation": "./cjs/executors/deploy/index.cjs",
|
|
25
|
-
"schema": "./cjs/executors/deploy/schema.json",
|
|
24
|
+
"implementation": "./dist/cjs/executors/deploy/index.cjs",
|
|
25
|
+
"schema": "./dist/cjs/executors/deploy/schema.json",
|
|
26
26
|
"description": "deploy executor"
|
|
27
27
|
}
|
|
28
28
|
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nizza/devkit",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/cjs/index.cjs",
|
|
6
6
|
"module": "dist/esm/index.mjs",
|
|
7
7
|
"source": "src/index.ts",
|
|
8
8
|
"types": "dist/esm/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/esm/index.mjs",
|
|
13
|
+
"require": "./dist/cjs/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./import": {
|
|
16
|
+
"types": "./dist/esm/index.d.mts",
|
|
17
|
+
"default": "./dist/esm/index.mjs"
|
|
18
|
+
},
|
|
19
|
+
"./require": {
|
|
20
|
+
"types": "./dist/cjs/index.d.cts",
|
|
21
|
+
"default": "./dist/cjs/index.cjs"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
9
24
|
"files": [
|
|
10
25
|
"dist"
|
|
11
26
|
],
|
|
27
|
+
"executors": "./executors.json",
|
|
12
28
|
"dependencies": {
|
|
13
29
|
"chalk": "^4",
|
|
14
30
|
"minimatch": "^9.0.3",
|
|
15
31
|
"mri": "^1.2.0",
|
|
16
|
-
"nanoid": "^5.0.2",
|
|
17
32
|
"ramda": "^0.29.1",
|
|
18
33
|
"semver": "^7.5.4"
|
|
19
34
|
},
|
|
20
|
-
"executors": "./executors.json",
|
|
21
35
|
"devDependencies": {
|
|
22
36
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
23
37
|
"@rollup/plugin-json": "^6.0.1",
|
|
@@ -39,6 +53,5 @@
|
|
|
39
53
|
"vite-plugin-css-injected-by-js": "^3.3.0",
|
|
40
54
|
"vite-plugin-dts": "^3.6.3",
|
|
41
55
|
"vite-tsconfig-paths": "^4.2.1"
|
|
42
|
-
}
|
|
43
|
-
"scripts": {}
|
|
56
|
+
}
|
|
44
57
|
}
|