nx 20.5.0 → 20.6.0-beta.1
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/package.json +12 -12
- package/src/adapter/compat.d.ts +1 -1
- package/src/adapter/compat.js +1 -0
- package/src/command-line/init/configure-plugins.js +9 -2
- package/src/command-line/init/init-v2.js +1 -0
- package/src/command-line/report/report.d.ts +4 -0
- package/src/command-line/report/report.js +17 -1
- package/src/config/nx-json.d.ts +4 -0
- package/src/core/graph/main.js +1 -1
- package/src/native/index.d.ts +8 -4
- package/src/native/native-bindings.js +1 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/cache.d.ts +14 -1
- package/src/tasks-runner/cache.js +63 -4
- package/src/tasks-runner/task-orchestrator.js +6 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "20.
|
3
|
+
"version": "20.6.0-beta.1",
|
4
4
|
"private": false,
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
6
6
|
"repository": {
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"@yarnpkg/lockfile": "^1.1.0",
|
39
39
|
"@yarnpkg/parsers": "3.0.2",
|
40
40
|
"@zkochan/js-yaml": "0.0.7",
|
41
|
-
"axios": "^1.
|
41
|
+
"axios": "^1.8.3",
|
42
42
|
"chalk": "^4.1.0",
|
43
43
|
"cli-cursor": "3.1.0",
|
44
44
|
"cli-spinners": "2.6.1",
|
@@ -82,16 +82,16 @@
|
|
82
82
|
}
|
83
83
|
},
|
84
84
|
"optionalDependencies": {
|
85
|
-
"@nx/nx-darwin-arm64": "20.
|
86
|
-
"@nx/nx-darwin-x64": "20.
|
87
|
-
"@nx/nx-freebsd-x64": "20.
|
88
|
-
"@nx/nx-linux-arm-gnueabihf": "20.
|
89
|
-
"@nx/nx-linux-arm64-gnu": "20.
|
90
|
-
"@nx/nx-linux-arm64-musl": "20.
|
91
|
-
"@nx/nx-linux-x64-gnu": "20.
|
92
|
-
"@nx/nx-linux-x64-musl": "20.
|
93
|
-
"@nx/nx-win32-arm64-msvc": "20.
|
94
|
-
"@nx/nx-win32-x64-msvc": "20.
|
85
|
+
"@nx/nx-darwin-arm64": "20.6.0-beta.1",
|
86
|
+
"@nx/nx-darwin-x64": "20.6.0-beta.1",
|
87
|
+
"@nx/nx-freebsd-x64": "20.6.0-beta.1",
|
88
|
+
"@nx/nx-linux-arm-gnueabihf": "20.6.0-beta.1",
|
89
|
+
"@nx/nx-linux-arm64-gnu": "20.6.0-beta.1",
|
90
|
+
"@nx/nx-linux-arm64-musl": "20.6.0-beta.1",
|
91
|
+
"@nx/nx-linux-x64-gnu": "20.6.0-beta.1",
|
92
|
+
"@nx/nx-linux-x64-musl": "20.6.0-beta.1",
|
93
|
+
"@nx/nx-win32-arm64-msvc": "20.6.0-beta.1",
|
94
|
+
"@nx/nx-win32-x64-msvc": "20.6.0-beta.1"
|
95
95
|
},
|
96
96
|
"nx-migrations": {
|
97
97
|
"migrations": "./migrations.json",
|
package/src/adapter/compat.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export declare const allowedProjectExtensions: readonly ["tags", "implicitDependencies", "configFilePath", "$schema", "generators", "namedInputs", "name", "files", "root", "sourceRoot", "projectType", "release", "includedScripts", "metadata"];
|
2
|
-
export declare const allowedWorkspaceExtensions: readonly ["$schema", "implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudId", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud", "sync", "useLegacyCache"];
|
2
|
+
export declare const allowedWorkspaceExtensions: readonly ["$schema", "implicitDependencies", "affected", "defaultBase", "tasksRunnerOptions", "workspaceLayout", "plugins", "targetDefaults", "files", "generators", "namedInputs", "extends", "cli", "pluginsConfig", "defaultProject", "installation", "release", "nxCloudAccessToken", "nxCloudId", "nxCloudUrl", "nxCloudEncryptionKey", "parallel", "cacheDirectory", "useDaemonProcess", "useInferencePlugins", "neverConnectToCloud", "sync", "useLegacyCache", "maxCacheSize"];
|
package/src/adapter/compat.js
CHANGED
@@ -33,8 +33,15 @@ function runPackageManagerInstallPlugins(repoRoot, pmc = (0, package_manager_1.g
|
|
33
33
|
*/
|
34
34
|
async function installPlugin(plugin, repoRoot = workspace_root_1.workspaceRoot, updatePackageScripts = false, verbose = false, pmc = (0, package_manager_1.getPackageManagerCommand)()) {
|
35
35
|
try {
|
36
|
-
(0, generator_utils_1.getGeneratorInformation)(plugin, 'init', workspace_root_1.workspaceRoot, {});
|
37
|
-
|
36
|
+
const { schema } = (0, generator_utils_1.getGeneratorInformation)(plugin, 'init', workspace_root_1.workspaceRoot, {});
|
37
|
+
let command = `${pmc.exec} nx g ${plugin}:init ${verbose ? '--verbose' : ''}`;
|
38
|
+
if (!!schema.properties['keepExistingVersions']) {
|
39
|
+
command += ` --keepExistingVersions`;
|
40
|
+
}
|
41
|
+
if (updatePackageScripts && !!schema.properties['updatePackageScripts']) {
|
42
|
+
command += ` --updatePackageScripts`;
|
43
|
+
}
|
44
|
+
(0, child_process_1.execSync)(command, {
|
38
45
|
stdio: [0, 1, 2],
|
39
46
|
cwd: repoRoot,
|
40
47
|
windowsHide: false,
|
@@ -156,6 +156,7 @@ const npmPackageToPluginMap = {
|
|
156
156
|
'react-native': '@nx/react-native',
|
157
157
|
'@remix-run/dev': '@nx/remix',
|
158
158
|
'@rsbuild/core': '@nx/rsbuild',
|
159
|
+
'@react-router/dev': '@nx/react',
|
159
160
|
};
|
160
161
|
async function detectPlugins(nxJson, interactive, includeAngularCli) {
|
161
162
|
let files = ['package.json'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), ['**/*/package.json']));
|
@@ -36,6 +36,10 @@ export interface ReportData {
|
|
36
36
|
};
|
37
37
|
projectGraphError?: Error | null;
|
38
38
|
nativeTarget: string | null;
|
39
|
+
cache: {
|
40
|
+
max: number;
|
41
|
+
used: number;
|
42
|
+
} | null;
|
39
43
|
}
|
40
44
|
export declare function getReportData(): Promise<ReportData>;
|
41
45
|
interface OutOfSyncPackageGroup {
|
@@ -22,6 +22,9 @@ const installation_directory_1 = require("../../utils/installation-directory");
|
|
22
22
|
const nx_json_1 = require("../../config/nx-json");
|
23
23
|
const error_types_1 = require("../../project-graph/error-types");
|
24
24
|
const powerpack_1 = require("../../utils/powerpack");
|
25
|
+
const cache_1 = require("../../tasks-runner/cache");
|
26
|
+
const native_1 = require("../../native");
|
27
|
+
const cache_directory_1 = require("../../utils/cache-directory");
|
25
28
|
const nxPackageJson = (0, fileutils_1.readJsonFile)((0, path_1.join)(__dirname, '../../../package.json'));
|
26
29
|
exports.packagesWeCareAbout = [
|
27
30
|
'lerna',
|
@@ -46,7 +49,7 @@ const LINE_SEPARATOR = '---------------------------------------';
|
|
46
49
|
*
|
47
50
|
*/
|
48
51
|
async function reportHandler() {
|
49
|
-
const { pm, pmVersion, powerpackLicense, powerpackError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, } = await getReportData();
|
52
|
+
const { pm, pmVersion, powerpackLicense, powerpackError, localPlugins, powerpackPlugins, communityPlugins, registeredPlugins, packageVersionsWeCareAbout, outOfSyncPackageGroup, projectGraphError, nativeTarget, cache, } = await getReportData();
|
50
53
|
const fields = [
|
51
54
|
['Node', process.versions.node],
|
52
55
|
['OS', `${process.platform}-${process.arch}`],
|
@@ -123,6 +126,10 @@ async function reportHandler() {
|
|
123
126
|
bodyLines.push(`\t ${chalk.green(plugin)}`);
|
124
127
|
}
|
125
128
|
}
|
129
|
+
if (cache) {
|
130
|
+
bodyLines.push(LINE_SEPARATOR);
|
131
|
+
bodyLines.push(`Cache Usage: ${(0, cache_1.formatCacheSize)(cache.used)} / ${cache.max === 0 ? '∞' : (0, cache_1.formatCacheSize)(cache.max)}`);
|
132
|
+
}
|
126
133
|
if (outOfSyncPackageGroup) {
|
127
134
|
bodyLines.push(LINE_SEPARATOR);
|
128
135
|
bodyLines.push(`The following packages should match the installed version of ${outOfSyncPackageGroup.basePackage}`);
|
@@ -175,6 +182,14 @@ async function getReportData() {
|
|
175
182
|
powerpackError = e;
|
176
183
|
}
|
177
184
|
}
|
185
|
+
let cache = (0, cache_1.dbCacheEnabled)(nxJson)
|
186
|
+
? {
|
187
|
+
max: nxJson.maxCacheSize !== undefined
|
188
|
+
? (0, cache_1.parseMaxCacheSize)(nxJson.maxCacheSize)
|
189
|
+
: (0, native_1.getDefaultMaxCacheSize)(cache_directory_1.cacheDir),
|
190
|
+
used: new cache_1.DbCache({ nxCloudRemoteCache: null }).getUsedCacheSpace(),
|
191
|
+
}
|
192
|
+
: null;
|
178
193
|
return {
|
179
194
|
pm,
|
180
195
|
powerpackLicense,
|
@@ -188,6 +203,7 @@ async function getReportData() {
|
|
188
203
|
outOfSyncPackageGroup,
|
189
204
|
projectGraphError,
|
190
205
|
nativeTarget: native ? native.getBinaryTarget() : null,
|
206
|
+
cache,
|
191
207
|
};
|
192
208
|
}
|
193
209
|
async function tryGetProjectGraph() {
|
package/src/config/nx-json.d.ts
CHANGED
@@ -490,6 +490,10 @@ export interface NxJsonConfiguration<T = '*' | string[]> {
|
|
490
490
|
* Use the legacy file system cache instead of the db cache
|
491
491
|
*/
|
492
492
|
useLegacyCache?: boolean;
|
493
|
+
/**
|
494
|
+
* Sets the maximum size of the local cache. Accepts a number followed by a unit (e.g. 100MB). Accepted units are B, KB, MB, and GB.
|
495
|
+
*/
|
496
|
+
maxCacheSize?: string;
|
493
497
|
}
|
494
498
|
export type PluginConfiguration = string | ExpandedPluginConfiguration;
|
495
499
|
export type ExpandedPluginConfiguration<T = unknown> = {
|