nx 19.7.4 → 19.8.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +12 -12
- package/src/command-line/generate/generator-utils.d.ts +2 -1
- package/src/command-line/import/command-object.js +1 -1
- package/src/command-line/import/import.js +6 -2
- package/src/command-line/init/init-v2.d.ts +1 -1
- package/src/command-line/init/init-v2.js +8 -2
- package/src/command-line/sync/command-object.js +2 -2
- package/src/core/graph/main.js +1 -1
- package/src/core/graph/styles.css +1 -1
- package/src/daemon/client/client.d.ts +2 -1
- package/src/daemon/client/client.js +7 -0
- package/src/daemon/message-types/task-history.d.ts +9 -3
- package/src/daemon/message-types/task-history.js +10 -2
- package/src/daemon/server/handle-task-history.d.ts +5 -1
- package/src/daemon/server/handle-task-history.js +11 -9
- package/src/daemon/server/server.js +5 -2
- package/src/native/index.d.ts +1 -0
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/init-tasks-runner.d.ts +1 -1
- package/src/tasks-runner/init-tasks-runner.js +5 -3
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.d.ts +0 -2
- package/src/tasks-runner/life-cycles/invoke-runner-terminal-output-life-cycle.js +0 -5
- package/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +2 -6
- package/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +2 -6
- package/src/tasks-runner/life-cycles/store-run-information-life-cycle.d.ts +2 -7
- package/src/tasks-runner/life-cycles/task-history-life-cycle.js +1 -1
- package/src/tasks-runner/life-cycles/task-profiling-life-cycle.d.ts +2 -7
- package/src/tasks-runner/life-cycles/task-results-life-cycle.d.ts +6 -0
- package/src/tasks-runner/life-cycles/task-results-life-cycle.js +17 -0
- package/src/tasks-runner/life-cycles/task-timings-life-cycle.d.ts +2 -7
- package/src/tasks-runner/run-command.d.ts +12 -2
- package/src/tasks-runner/run-command.js +50 -59
- package/src/tasks-runner/task-orchestrator.js +4 -1
- package/src/tasks-runner/tasks-schedule.d.ts +3 -0
- package/src/tasks-runner/tasks-schedule.js +26 -4
- package/src/utils/git-utils.d.ts +1 -0
- package/src/utils/git-utils.js +4 -0
- package/src/utils/task-history.d.ts +12 -1
- package/src/utils/task-history.js +23 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "nx",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.8.0-beta.0",
|
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": {
|
@@ -71,7 +71,7 @@
|
|
71
71
|
"yargs-parser": "21.1.1",
|
72
72
|
"node-machine-id": "1.1.12",
|
73
73
|
"ora": "5.3.0",
|
74
|
-
"@nrwl/tao": "19.
|
74
|
+
"@nrwl/tao": "19.8.0-beta.0"
|
75
75
|
},
|
76
76
|
"peerDependencies": {
|
77
77
|
"@swc-node/register": "^1.8.0",
|
@@ -86,16 +86,16 @@
|
|
86
86
|
}
|
87
87
|
},
|
88
88
|
"optionalDependencies": {
|
89
|
-
"@nx/nx-darwin-x64": "19.
|
90
|
-
"@nx/nx-darwin-arm64": "19.
|
91
|
-
"@nx/nx-linux-x64-gnu": "19.
|
92
|
-
"@nx/nx-linux-x64-musl": "19.
|
93
|
-
"@nx/nx-win32-x64-msvc": "19.
|
94
|
-
"@nx/nx-linux-arm64-gnu": "19.
|
95
|
-
"@nx/nx-linux-arm64-musl": "19.
|
96
|
-
"@nx/nx-linux-arm-gnueabihf": "19.
|
97
|
-
"@nx/nx-win32-arm64-msvc": "19.
|
98
|
-
"@nx/nx-freebsd-x64": "19.
|
89
|
+
"@nx/nx-darwin-x64": "19.8.0-beta.0",
|
90
|
+
"@nx/nx-darwin-arm64": "19.8.0-beta.0",
|
91
|
+
"@nx/nx-linux-x64-gnu": "19.8.0-beta.0",
|
92
|
+
"@nx/nx-linux-x64-musl": "19.8.0-beta.0",
|
93
|
+
"@nx/nx-win32-x64-msvc": "19.8.0-beta.0",
|
94
|
+
"@nx/nx-linux-arm64-gnu": "19.8.0-beta.0",
|
95
|
+
"@nx/nx-linux-arm64-musl": "19.8.0-beta.0",
|
96
|
+
"@nx/nx-linux-arm-gnueabihf": "19.8.0-beta.0",
|
97
|
+
"@nx/nx-win32-arm64-msvc": "19.8.0-beta.0",
|
98
|
+
"@nx/nx-freebsd-x64": "19.8.0-beta.0"
|
99
99
|
},
|
100
100
|
"nx-migrations": {
|
101
101
|
"migrations": "./migrations.json",
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Generator, GeneratorsJson, GeneratorsJsonEntry } from '../../config/misc-interfaces';
|
2
2
|
import { ProjectConfiguration } from '../../config/workspace-json-project-json';
|
3
|
-
export
|
3
|
+
export type GeneratorInformation = {
|
4
4
|
resolvedCollectionName: string;
|
5
5
|
normalizedGeneratorName: string;
|
6
6
|
schema: any;
|
@@ -9,6 +9,7 @@ export declare function getGeneratorInformation(collectionName: string, generato
|
|
9
9
|
isNxGenerator: boolean;
|
10
10
|
generatorConfiguration: GeneratorsJsonEntry;
|
11
11
|
};
|
12
|
+
export declare function getGeneratorInformation(collectionName: string, generatorName: string, root: string | null, projects: Record<string, ProjectConfiguration>): GeneratorInformation;
|
12
13
|
export declare function readGeneratorsJson(collectionName: string, generator: string, root: string | null, projects: Record<string, ProjectConfiguration>): {
|
13
14
|
generatorsFilePath: string;
|
14
15
|
generatorsJson: GeneratorsJson;
|
@@ -6,7 +6,7 @@ const shared_options_1 = require("../yargs-utils/shared-options");
|
|
6
6
|
const handle_errors_1 = require("../../utils/handle-errors");
|
7
7
|
exports.yargsImportCommand = {
|
8
8
|
command: 'import [sourceRepository] [destinationDirectory]',
|
9
|
-
describe:
|
9
|
+
describe: 'Import code and git history from another repository into this repository.',
|
10
10
|
builder: (yargs) => (0, documentation_1.linkToNxDevAndExamples)((0, shared_options_1.withVerbose)(yargs
|
11
11
|
.positional('sourceRepository', {
|
12
12
|
type: 'string',
|
@@ -25,7 +25,12 @@ const needs_install_1 = require("./utils/needs-install");
|
|
25
25
|
const file_utils_1 = require("../../project-graph/file-utils");
|
26
26
|
const importRemoteName = '__tmp_nx_import__';
|
27
27
|
async function importHandler(options) {
|
28
|
+
process.env.NX_RUNNING_NX_IMPORT = 'true';
|
28
29
|
let { sourceRepository, ref, source, destination } = options;
|
30
|
+
const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
|
31
|
+
if (await destinationGitClient.hasUncommittedChanges()) {
|
32
|
+
throw new Error(`You have uncommitted changes in the destination repository. Commit or revert the changes and try again.`);
|
33
|
+
}
|
29
34
|
output_1.output.log({
|
30
35
|
title: 'Nx will walk you through the process of importing code from the source repository into this repository:',
|
31
36
|
bodyLines: [
|
@@ -120,7 +125,6 @@ async function importHandler(options) {
|
|
120
125
|
throw new Error(`The destination directory must be a relative path in this repository.`);
|
121
126
|
}
|
122
127
|
const absDestination = (0, path_1.join)(process.cwd(), destination);
|
123
|
-
const destinationGitClient = new git_utils_1.GitRepository(process.cwd());
|
124
128
|
await assertDestinationEmpty(destinationGitClient, absDestination);
|
125
129
|
const tempImportBranch = getTempImportBranch(ref);
|
126
130
|
await sourceGitClient.addFetchRemote(importRemoteName, ref);
|
@@ -152,7 +156,7 @@ async function importHandler(options) {
|
|
152
156
|
const pmc = (0, package_manager_1.getPackageManagerCommand)();
|
153
157
|
const nxJson = (0, nx_json_1.readNxJson)(workspace_root_1.workspaceRoot);
|
154
158
|
(0, workspace_context_1.resetWorkspaceContext)();
|
155
|
-
const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive);
|
159
|
+
const { plugins, updatePackageScripts } = await (0, init_v2_1.detectPlugins)(nxJson, options.interactive, true);
|
156
160
|
if (packageManager !== sourcePackageManager) {
|
157
161
|
output_1.output.warn({
|
158
162
|
title: `Mismatched package managers`,
|
@@ -8,7 +8,7 @@ export interface InitArgs {
|
|
8
8
|
}
|
9
9
|
export declare function installPlugins(repoRoot: string, plugins: string[], pmc: PackageManagerCommands, updatePackageScripts: boolean): void;
|
10
10
|
export declare function initHandler(options: InitArgs): Promise<void>;
|
11
|
-
export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean): Promise<{
|
11
|
+
export declare function detectPlugins(nxJson: NxJsonConfiguration, interactive: boolean, includeAngularCli?: boolean): Promise<{
|
12
12
|
plugins: string[];
|
13
13
|
updatePackageScripts: boolean;
|
14
14
|
}>;
|
@@ -127,7 +127,7 @@ const npmPackageToPluginMap = {
|
|
127
127
|
'react-native': '@nx/react-native',
|
128
128
|
'@remix-run/dev': '@nx/remix',
|
129
129
|
};
|
130
|
-
async function detectPlugins(nxJson, interactive) {
|
130
|
+
async function detectPlugins(nxJson, interactive, includeAngularCli) {
|
131
131
|
let files = ['package.json'].concat((0, workspace_context_1.globWithWorkspaceContextSync)(process.cwd(), ['**/*/package.json']));
|
132
132
|
const currentPlugins = new Set((nxJson.plugins ?? []).map((p) => {
|
133
133
|
const plugin = typeof p === 'string' ? p : p.plugin;
|
@@ -149,7 +149,13 @@ async function detectPlugins(nxJson, interactive) {
|
|
149
149
|
...packageJson.dependencies,
|
150
150
|
...packageJson.devDependencies,
|
151
151
|
};
|
152
|
-
|
152
|
+
const _npmPackageToPluginMap = {
|
153
|
+
...npmPackageToPluginMap,
|
154
|
+
};
|
155
|
+
if (includeAngularCli) {
|
156
|
+
_npmPackageToPluginMap['@angular/cli'] = '@nx/angular';
|
157
|
+
}
|
158
|
+
for (const [dep, plugin] of Object.entries(_npmPackageToPluginMap)) {
|
153
159
|
if (deps[dep]) {
|
154
160
|
detectedPlugins.add(plugin);
|
155
161
|
}
|
@@ -4,7 +4,7 @@ exports.yargsSyncCheckCommand = exports.yargsSyncCommand = void 0;
|
|
4
4
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
5
5
|
exports.yargsSyncCommand = {
|
6
6
|
command: 'sync',
|
7
|
-
describe:
|
7
|
+
describe: 'Sync the workspace files by running all the sync generators.',
|
8
8
|
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
9
9
|
handler: async (args) => {
|
10
10
|
process.exit(await Promise.resolve().then(() => require('./sync')).then((m) => m.syncHandler(args)));
|
@@ -12,7 +12,7 @@ exports.yargsSyncCommand = {
|
|
12
12
|
};
|
13
13
|
exports.yargsSyncCheckCommand = {
|
14
14
|
command: 'sync:check',
|
15
|
-
describe:
|
15
|
+
describe: 'Check that no changes are required after running all sync generators.',
|
16
16
|
builder: (yargs) => (0, shared_options_1.withVerbose)(yargs),
|
17
17
|
handler: async (args) => {
|
18
18
|
process.exit(await Promise.resolve().then(() => require('./sync')).then((m) => m.syncHandler({ ...args, check: true })));
|