Comparing version 19.7.0-beta.2 to 19.7.0-beta.3
{ | ||
"name": "nx", | ||
"version": "19.7.0-beta.2", | ||
"version": "19.7.0-beta.3", | ||
"private": false, | ||
@@ -74,3 +74,3 @@ "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.", | ||
"ora": "5.3.0", | ||
"@nrwl/tao": "19.7.0-beta.2" | ||
"@nrwl/tao": "19.7.0-beta.3" | ||
}, | ||
@@ -90,12 +90,12 @@ "peerDependencies": { | ||
"optionalDependencies": { | ||
"@nx/nx-darwin-x64": "19.7.0-beta.2", | ||
"@nx/nx-darwin-arm64": "19.7.0-beta.2", | ||
"@nx/nx-linux-x64-gnu": "19.7.0-beta.2", | ||
"@nx/nx-linux-x64-musl": "19.7.0-beta.2", | ||
"@nx/nx-win32-x64-msvc": "19.7.0-beta.2", | ||
"@nx/nx-linux-arm64-gnu": "19.7.0-beta.2", | ||
"@nx/nx-linux-arm64-musl": "19.7.0-beta.2", | ||
"@nx/nx-linux-arm-gnueabihf": "19.7.0-beta.2", | ||
"@nx/nx-win32-arm64-msvc": "19.7.0-beta.2", | ||
"@nx/nx-freebsd-x64": "19.7.0-beta.2" | ||
"@nx/nx-darwin-x64": "19.7.0-beta.3", | ||
"@nx/nx-darwin-arm64": "19.7.0-beta.3", | ||
"@nx/nx-linux-x64-gnu": "19.7.0-beta.3", | ||
"@nx/nx-linux-x64-musl": "19.7.0-beta.3", | ||
"@nx/nx-win32-x64-msvc": "19.7.0-beta.3", | ||
"@nx/nx-linux-arm64-gnu": "19.7.0-beta.3", | ||
"@nx/nx-linux-arm64-musl": "19.7.0-beta.3", | ||
"@nx/nx-linux-arm-gnueabihf": "19.7.0-beta.3", | ||
"@nx/nx-win32-arm64-msvc": "19.7.0-beta.3", | ||
"@nx/nx-freebsd-x64": "19.7.0-beta.3" | ||
}, | ||
@@ -102,0 +102,0 @@ "nx-migrations": { |
@@ -285,2 +285,9 @@ { | ||
"description": "Whether to automatically apply sync generator changes when running tasks. If not set, the user will be prompted. If set to `true`, the user will not be prompted and the changes will be applied. If set to `false`, the user will not be prompted and the changes will not be applied." | ||
}, | ||
"disabledTaskSyncGenerators": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"description": "List of registered task sync generators to disable." | ||
} | ||
@@ -287,0 +294,0 @@ }, |
@@ -13,17 +13,19 @@ import type { NxReleaseConfiguration } from '../../config/nx-json'; | ||
} | ||
declare const defaultClient: ReleaseClient; | ||
/** | ||
* @public | ||
*/ | ||
export declare const releaseChangelog: any; | ||
export declare const releaseChangelog: typeof defaultClient.releaseChangelog; | ||
/** | ||
* @public | ||
*/ | ||
export declare const releasePublish: any; | ||
export declare const releasePublish: typeof defaultClient.releasePublish; | ||
/** | ||
* @public | ||
*/ | ||
export declare const releaseVersion: any; | ||
export declare const releaseVersion: typeof defaultClient.releaseVersion; | ||
/** | ||
* @public | ||
*/ | ||
export declare const release: any; | ||
export declare const release: typeof defaultClient.release; | ||
export {}; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const ora = require("ora"); | ||
const nx_json_1 = require("../../config/nx-json"); | ||
const project_graph_1 = require("../../project-graph/project-graph"); | ||
@@ -14,3 +15,13 @@ const output_1 = require("../../utils/output"); | ||
const projectGraph = await (0, project_graph_1.createProjectGraphAsync)(); | ||
const syncGenerators = await (0, sync_generators_1.collectAllRegisteredSyncGenerators)(projectGraph); | ||
const nxJson = (0, nx_json_1.readNxJson)(); | ||
const syncGenerators = await (0, sync_generators_1.collectAllRegisteredSyncGenerators)(projectGraph, nxJson); | ||
if (!syncGenerators.length) { | ||
output_1.output.success({ | ||
title: options.check | ||
? 'The workspace is up to date' | ||
: 'The workspace is already up to date', | ||
bodyLines: ['There are no sync generators to run.'], | ||
}); | ||
return 0; | ||
} | ||
const results = await (0, sync_generators_1.getSyncGeneratorChanges)(syncGenerators); | ||
@@ -17,0 +28,0 @@ if (!results.length) { |
@@ -289,3 +289,3 @@ import type { ChangelogRenderOptions } from '../../release/changelog-renderer'; | ||
* Whether to automatically apply sync generator changes when running tasks. | ||
* If not set, the user will be prompted. | ||
* If not set, the user will be prompted in interactive mode. | ||
* If set to `true`, the user will not be prompted and the changes will be applied. | ||
@@ -295,2 +295,6 @@ * If set to `false`, the user will not be prompted and the changes will not be applied. | ||
applyChanges?: boolean; | ||
/** | ||
* List of registered task sync generators to disable. | ||
*/ | ||
disabledTaskSyncGenerators?: string[]; | ||
} | ||
@@ -297,0 +301,0 @@ /** |
@@ -24,2 +24,3 @@ "use strict"; | ||
let storedNxJsonHash; | ||
let storedDisabledTaskSyncGeneratorsHash; | ||
const log = (...messageParts) => { | ||
@@ -111,2 +112,6 @@ logger_1.serverLogger.log('[SYNC]:', ...messageParts); | ||
scheduledGenerators.clear(); | ||
if (!registeredSyncGenerators.size) { | ||
// there are no generators to run | ||
return; | ||
} | ||
for (const generator of registeredSyncGenerators) { | ||
@@ -149,7 +154,11 @@ scheduledGenerators.add(generator); | ||
function collectAllRegisteredSyncGenerators(projectGraph) { | ||
const nxJson = (0, nx_json_1.readNxJson)(); | ||
const projectGraphHash = hashProjectGraph(projectGraph); | ||
if (storedProjectGraphHash !== projectGraphHash) { | ||
const disabledTaskSyncGeneratorsHash = (0, file_hasher_1.hashArray)(nxJson.sync?.disabledTaskSyncGenerators?.sort() ?? []); | ||
if (projectGraphHash !== storedProjectGraphHash || | ||
disabledTaskSyncGeneratorsHash !== storedDisabledTaskSyncGeneratorsHash) { | ||
storedProjectGraphHash = projectGraphHash; | ||
storedDisabledTaskSyncGeneratorsHash = disabledTaskSyncGeneratorsHash; | ||
registeredTaskSyncGenerators = | ||
(0, sync_generators_1.collectRegisteredTaskSyncGenerators)(projectGraph); | ||
(0, sync_generators_1.collectEnabledTaskSyncGeneratorsFromProjectGraph)(projectGraph, nxJson); | ||
} | ||
@@ -159,3 +168,2 @@ else { | ||
} | ||
const nxJson = (0, nx_json_1.readNxJson)(); | ||
const nxJsonHash = (0, file_hasher_1.hashArray)(nxJson.sync?.globalGenerators?.sort() ?? []); | ||
@@ -162,0 +170,0 @@ if (storedNxJsonHash !== nxJsonHash) { |
@@ -14,3 +14,3 @@ import type { CloudTaskRunnerOptions } from './nx-cloud-tasks-runner-shell'; | ||
nxCloudTasksRunner: TasksRunner<CloudTaskRunnerOptions>; | ||
remoteCache: RemoteCacheV2; | ||
getRemoteCache: () => RemoteCacheV2; | ||
} | ||
@@ -17,0 +17,0 @@ export declare function verifyOrUpdateNxCloudClient(options: CloudTaskRunnerOptions): Promise<{ |
@@ -84,4 +84,4 @@ "use strict"; | ||
const { nxCloudClient } = await (0, update_manager_1.verifyOrUpdateNxCloudClient)(options); | ||
if (nxCloudClient.remoteCache) { | ||
return nxCloudClient.remoteCache; | ||
if (nxCloudClient.getRemoteCache) { | ||
return nxCloudClient.getRemoteCache(); | ||
} | ||
@@ -88,0 +88,0 @@ else { |
@@ -124,12 +124,3 @@ "use strict"; | ||
// collect unique syncGenerators from the tasks | ||
const uniqueSyncGenerators = new Set(); | ||
for (const { target } of Object.values(taskGraph.tasks)) { | ||
const { syncGenerators } = projectGraph.nodes[target.project].data.targets[target.target]; | ||
if (!syncGenerators) { | ||
continue; | ||
} | ||
for (const generator of syncGenerators) { | ||
uniqueSyncGenerators.add(generator); | ||
} | ||
} | ||
const uniqueSyncGenerators = (0, sync_generators_1.collectEnabledTaskSyncGeneratorsFromTaskGraph)(taskGraph, projectGraph, nxJson); | ||
if (!uniqueSyncGenerators.size) { | ||
@@ -136,0 +127,0 @@ // There are no sync generators registered in the tasks to run |
import type { GeneratorCallback } from '../config/misc-interfaces'; | ||
import { type NxJsonConfiguration } from '../config/nx-json'; | ||
import type { ProjectGraph } from '../config/project-graph'; | ||
import type { TaskGraph } from '../config/task-graph'; | ||
import type { ProjectConfiguration } from '../config/workspace-json-project-json'; | ||
@@ -18,6 +20,7 @@ import { FsTree, type FileChange, type Tree } from '../generators/tree'; | ||
export declare function flushSyncGeneratorChanges(results: SyncGeneratorChangesResult[]): Promise<void>; | ||
export declare function collectAllRegisteredSyncGenerators(projectGraph: ProjectGraph): Promise<string[]>; | ||
export declare function collectAllRegisteredSyncGenerators(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Promise<string[]>; | ||
export declare function runSyncGenerator(tree: FsTree, generatorSpecifier: string, projects: Record<string, ProjectConfiguration>): Promise<SyncGeneratorChangesResult>; | ||
export declare function collectRegisteredTaskSyncGenerators(projectGraph: ProjectGraph): Set<string>; | ||
export declare function collectRegisteredGlobalSyncGenerators(nxJson?: import("../config/nx-json").NxJsonConfiguration<string[] | "*">): Set<string>; | ||
export declare function collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Set<string>; | ||
export declare function collectEnabledTaskSyncGeneratorsFromTaskGraph(taskGraph: TaskGraph, projectGraph: ProjectGraph, nxJson: NxJsonConfiguration): Set<string>; | ||
export declare function collectRegisteredGlobalSyncGenerators(nxJson?: NxJsonConfiguration<string[] | "*">): Set<string>; | ||
export declare function syncGeneratorResultsToMessageLines(results: SyncGeneratorChangesResult[]): string[]; |
@@ -7,3 +7,4 @@ "use strict"; | ||
exports.runSyncGenerator = runSyncGenerator; | ||
exports.collectRegisteredTaskSyncGenerators = collectRegisteredTaskSyncGenerators; | ||
exports.collectEnabledTaskSyncGeneratorsFromProjectGraph = collectEnabledTaskSyncGeneratorsFromProjectGraph; | ||
exports.collectEnabledTaskSyncGeneratorsFromTaskGraph = collectEnabledTaskSyncGeneratorsFromTaskGraph; | ||
exports.collectRegisteredGlobalSyncGenerators = collectRegisteredGlobalSyncGenerators; | ||
@@ -43,6 +44,6 @@ exports.syncGeneratorResultsToMessageLines = syncGeneratorResultsToMessageLines; | ||
} | ||
async function collectAllRegisteredSyncGenerators(projectGraph) { | ||
async function collectAllRegisteredSyncGenerators(projectGraph, nxJson) { | ||
if (!client_1.daemonClient.enabled()) { | ||
return [ | ||
...collectRegisteredTaskSyncGenerators(projectGraph), | ||
...collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph, nxJson), | ||
...collectRegisteredGlobalSyncGenerators(), | ||
@@ -74,4 +75,5 @@ ]; | ||
} | ||
function collectRegisteredTaskSyncGenerators(projectGraph) { | ||
function collectEnabledTaskSyncGeneratorsFromProjectGraph(projectGraph, nxJson) { | ||
const taskSyncGenerators = new Set(); | ||
const disabledTaskSyncGenerators = new Set(nxJson.sync?.disabledTaskSyncGenerators ?? []); | ||
for (const { data: { targets }, } of Object.values(projectGraph.nodes)) { | ||
@@ -82,6 +84,26 @@ if (!targets) { | ||
for (const target of Object.values(targets)) { | ||
if (!target.syncGenerators) { | ||
if (!target.syncGenerators?.length) { | ||
continue; | ||
} | ||
for (const generator of target.syncGenerators) { | ||
if (!disabledTaskSyncGenerators.has(generator) && | ||
!taskSyncGenerators.has(generator)) { | ||
taskSyncGenerators.add(generator); | ||
} | ||
} | ||
} | ||
} | ||
return taskSyncGenerators; | ||
} | ||
function collectEnabledTaskSyncGeneratorsFromTaskGraph(taskGraph, projectGraph, nxJson) { | ||
const taskSyncGenerators = new Set(); | ||
const disabledTaskSyncGenerators = new Set(nxJson.sync?.disabledTaskSyncGenerators ?? []); | ||
for (const { target } of Object.values(taskGraph.tasks)) { | ||
const { syncGenerators } = projectGraph.nodes[target.project].data.targets[target.target]; | ||
if (!syncGenerators?.length) { | ||
continue; | ||
} | ||
for (const generator of syncGenerators) { | ||
if (!disabledTaskSyncGenerators.has(generator) && | ||
!taskSyncGenerators.has(generator)) { | ||
taskSyncGenerators.add(generator); | ||
@@ -88,0 +110,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9174886
52008
+ Added@nrwl/tao@19.7.0-beta.3(transitive)
+ Added@nx/nx-darwin-arm64@19.7.0-beta.3(transitive)
+ Added@nx/nx-darwin-x64@19.7.0-beta.3(transitive)
+ Added@nx/nx-freebsd-x64@19.7.0-beta.3(transitive)
+ Added@nx/nx-linux-arm-gnueabihf@19.7.0-beta.3(transitive)
+ Added@nx/nx-linux-arm64-gnu@19.7.0-beta.3(transitive)
+ Added@nx/nx-linux-arm64-musl@19.7.0-beta.3(transitive)
+ Added@nx/nx-linux-x64-gnu@19.7.0-beta.3(transitive)
+ Added@nx/nx-linux-x64-musl@19.7.0-beta.3(transitive)
+ Added@nx/nx-win32-arm64-msvc@19.7.0-beta.3(transitive)
+ Added@nx/nx-win32-x64-msvc@19.7.0-beta.3(transitive)
- Removed@nrwl/tao@19.7.0-beta.2(transitive)
- Removed@nx/nx-darwin-arm64@19.7.0-beta.2(transitive)
- Removed@nx/nx-darwin-x64@19.7.0-beta.2(transitive)
- Removed@nx/nx-freebsd-x64@19.7.0-beta.2(transitive)
- Removed@nx/nx-linux-arm-gnueabihf@19.7.0-beta.2(transitive)
- Removed@nx/nx-linux-arm64-gnu@19.7.0-beta.2(transitive)
- Removed@nx/nx-linux-arm64-musl@19.7.0-beta.2(transitive)
- Removed@nx/nx-linux-x64-gnu@19.7.0-beta.2(transitive)
- Removed@nx/nx-linux-x64-musl@19.7.0-beta.2(transitive)
- Removed@nx/nx-win32-arm64-msvc@19.7.0-beta.2(transitive)
- Removed@nx/nx-win32-x64-msvc@19.7.0-beta.2(transitive)
Updated@nrwl/tao@19.7.0-beta.3