diff --git a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts index fab91a2e8516a..28d929849540d 100644 --- a/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts +++ b/packages/angular/src/migrations/update-14-2-0/remove-show-circular-dependencies-option.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; const executors = [ '@angular-devkit/build-angular:browser', diff --git a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts index 9b7533e766378..82b585e0b24d2 100644 --- a/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts +++ b/packages/angular/src/migrations/update-15-0-0/add-karma-inputs.ts @@ -1,5 +1,5 @@ import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts index 61d18cf36a3e3..115c0709047df 100644 --- a/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts +++ b/packages/angular/src/migrations/update-15-2-0/update-karma-main-file.ts @@ -2,7 +2,7 @@ import type { Tree } from '@nrwl/devkit'; import { formatFiles } from '@nrwl/devkit'; import * as ts from 'typescript'; import { Builders } from '@schematics/angular/utility/workspace-models'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { FileChangeRecorder } from '../../utils/file-change-recorder'; export default async function (tree: Tree) { diff --git a/packages/angular/src/utils/get-mf-projects.ts b/packages/angular/src/utils/get-mf-projects.ts index fc4202361f579..b24493da97372 100644 --- a/packages/angular/src/utils/get-mf-projects.ts +++ b/packages/angular/src/utils/get-mf-projects.ts @@ -1,5 +1,5 @@ import type { Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export function getMFProjects( tree: Tree, diff --git a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts index 481670176b732..b92d71016627c 100644 --- a/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts +++ b/packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts @@ -13,7 +13,7 @@ import { updateJson, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { CypressExecutorOptions } from '../../executors/cypress/cypress.impl'; import { addConfigToTsConfig, diff --git a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts index 6e00265127b14..2c12235a62c0c 100644 --- a/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts +++ b/packages/cypress/src/migrations/update-14-6-1/update-cypress-configs-presets.ts @@ -6,7 +6,7 @@ import { updateJson, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; import { CypressExecutorOptions } from '../../executors/cypress/cypress.impl'; @@ -165,4 +165,5 @@ function cacheComponentTestTarget(tree: Tree) { }, })); } + export default updateCypressConfigsPresets; diff --git a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts index f433c640a4c60..525d4f3c3bcf8 100644 --- a/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts +++ b/packages/cypress/src/migrations/update-15-0-0/add-cypress-inputs.ts @@ -1,5 +1,5 @@ import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { CypressExecutorOptions } from '@nrwl/cypress/src/executors/cypress/cypress.impl'; export default async function (tree: Tree) { diff --git a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts index 4075418df5fc6..6b491a259151c 100644 --- a/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts +++ b/packages/cypress/src/migrations/update-15-0-0/update-cy-mount-usage.ts @@ -12,8 +12,8 @@ import { Tree, visitNotIgnoredFiles, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { checkAndCleanWithSemver } from '@nrwl/devkit/src/utils/semver'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { gte } from 'semver'; import * as ts from 'typescript'; diff --git a/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts b/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts index de26b1c8bf2f3..f7de2bc6a7542 100644 --- a/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts +++ b/packages/cypress/src/migrations/update-15-1-0/cypress-11.ts @@ -7,7 +7,7 @@ import { Tree, visitNotIgnoredFiles, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { extname } from 'path'; import * as ts from 'typescript'; diff --git a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts index 7a0b96961d8f1..306a56323a744 100644 --- a/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts +++ b/packages/cypress/src/migrations/update-15-5-0/update-to-cypress-12.ts @@ -1,13 +1,13 @@ import { + GeneratorCallback, getProjects, + installPackagesTask, stripIndents, Tree, updateJson, visitNotIgnoredFiles, - installPackagesTask, - GeneratorCallback, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/workspace/src/utilities/executor-options-utils.spec.ts b/packages/devkit/src/generators/executor-options-utils.spec.ts similarity index 88% rename from packages/workspace/src/utilities/executor-options-utils.spec.ts rename to packages/devkit/src/generators/executor-options-utils.spec.ts index 8e4c1ebaa8721..381541b4fb53d 100644 --- a/packages/workspace/src/utilities/executor-options-utils.spec.ts +++ b/packages/devkit/src/generators/executor-options-utils.spec.ts @@ -1,7 +1,7 @@ -import { addProjectConfiguration, Tree } from '@nrwl/devkit'; -import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing'; +import { addProjectConfiguration, Tree } from 'nx/src/devkit-exports'; +import { createTreeWithEmptyWorkspace } from 'nx/src/devkit-testing-exports'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from './executor-options-utils'; describe('forEachExecutorOptions', () => { let tree: Tree; diff --git a/packages/workspace/src/utilities/executor-options-utils.ts b/packages/devkit/src/generators/executor-options-utils.ts similarity index 85% rename from packages/workspace/src/utilities/executor-options-utils.ts rename to packages/devkit/src/generators/executor-options-utils.ts index 884509f69e468..0f26036804292 100644 --- a/packages/workspace/src/utilities/executor-options-utils.ts +++ b/packages/devkit/src/generators/executor-options-utils.ts @@ -1,9 +1,9 @@ -import { - Tree, - getProjects, - ProjectConfiguration, - ProjectGraph, -} from '@nrwl/devkit'; +import type { Tree } from 'nx/src/generators/tree'; +import type { ProjectGraph } from 'nx/src/config/project-graph'; +import type { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json'; +import { requireNx } from '../../nx'; + +const { getProjects } = requireNx(); type CallBack = ( currentValue: T, @@ -25,7 +25,7 @@ export function forEachExecutorOptions( * Callback that is called for each options configured for a builder */ callback: CallBack -) { +): void { forEachProjectConfig(getProjects(tree), executorName, callback); } @@ -37,7 +37,7 @@ export function forEachExecutorOptionsInGraph( graph: ProjectGraph, executorName: string, callback: CallBack -) { +): void { const projects = new Map(); Object.values(graph.nodes).forEach((p) => projects.set(p.name, p.data)); @@ -48,7 +48,7 @@ function forEachProjectConfig( projects: Map, executorName: string, callback: CallBack -) { +): void { for (const [projectName, project] of projects) { for (const [targetName, target] of Object.entries(project.targets || {})) { if (executorName !== target.executor) { diff --git a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts index 95ea8ba9350ad..0e7ecdc21a03e 100644 --- a/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts +++ b/packages/expo/src/migrations/update-15-0-3/change-jest-preset.ts @@ -7,12 +7,12 @@ import { Tree, updateJson, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { addPropertyToJestConfig, removePropertyFromJestConfig, } from '@nrwl/jest'; import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { join } from 'path'; /** diff --git a/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts b/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts index 6bfdaaa6102df..a5781e08a1fe7 100644 --- a/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts +++ b/packages/jest/src/migrations/update-12-1-2/update-jest-preset-angular.ts @@ -5,13 +5,12 @@ import { stripIndents, Tree, } from '@nrwl/devkit'; - +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { addPropertyToJestConfig, removePropertyFromJestConfig, } from '../../utils/config/update-config'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; function updateJestConfig(tree: Tree) { diff --git a/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts b/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts index 370f968a256c0..8f3b3b4d275b9 100644 --- a/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts +++ b/packages/jest/src/migrations/update-12-1-2/update-ts-jest.ts @@ -1,7 +1,6 @@ import { formatFiles, logger, stripIndents, Tree } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; - -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { addPropertyToJestConfig, diff --git a/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts b/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts index eb0c723f067e0..c9095b97eec74 100644 --- a/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts +++ b/packages/jest/src/migrations/update-12-4-0/add-test-environment-for-node.ts @@ -6,9 +6,8 @@ import { stripIndents, Tree, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; - -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { addPropertyToJestConfig } from '../../utils/config/update-config'; diff --git a/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts b/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts index bc5e7bc917805..2a500fee920cf 100644 --- a/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts +++ b/packages/jest/src/migrations/update-12-4-0/update-jest-preset-angular.ts @@ -1,7 +1,6 @@ import { formatFiles, logger, stripIndents, Tree } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; - -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { addPropertyToJestConfig, diff --git a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts index d69fbb6bc1f5e..d7fee2d67a2e6 100644 --- a/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts +++ b/packages/jest/src/migrations/update-13-1-2/update-tsconfigs-for-tests.ts @@ -1,4 +1,3 @@ -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { formatFiles, logger, @@ -8,6 +7,7 @@ import { updateJson, visitNotIgnoredFiles, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { basename } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts index 618aaa6216173..7d4a26d3a166a 100644 --- a/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts +++ b/packages/jest/src/migrations/update-13-4-4/add-missing-root-babel-config.ts @@ -5,7 +5,7 @@ import { readProjectConfiguration, Tree, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { JestExecutorOptions } from '../../executors/jest/schema'; import { jestConfigObject } from '../../utils/config/functions'; import { nxVersion } from '../../utils/versions'; diff --git a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts index 7d8db5f67b4da..843924d5fd2f6 100644 --- a/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts +++ b/packages/jest/src/migrations/update-14-0-0/update-jest-config-ext.ts @@ -10,9 +10,9 @@ import { updateJson, updateProjectConfiguration, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { extname } from 'path'; import { JestExecutorOptions } from '../../executors/jest/schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; const allowedExt = ['.ts', '.js']; diff --git a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts index 1befefbeaddff..6eacbe85ffb72 100644 --- a/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts +++ b/packages/jest/src/migrations/update-14-1-5/update-exports-jest-config.ts @@ -1,7 +1,7 @@ -import { addDependenciesToPackageJson, GeneratorCallback } from '@nrwl/devkit'; import type { Tree } from '@nrwl/devkit'; +import { addDependenciesToPackageJson } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsNodeVersion } from '../../utils/versions'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import type { BinaryExpression } from 'typescript'; import type { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts index 9a075c38a457c..5ffd786b577cf 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-configs-jest-28.ts @@ -1,5 +1,5 @@ import { addDependenciesToPackageJson, readJson, Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { isStringLiteralLike, PropertyAssignment } from 'typescript'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts index 4f9326f838e82..56f48c49a2306 100644 --- a/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts +++ b/packages/jest/src/migrations/update-14-6-0/update-tests-jest-28.ts @@ -3,7 +3,7 @@ import { Tree, visitNotIgnoredFiles, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; import { JestExecutorOptions } from '../../executors/jest/schema'; diff --git a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts index e99a5957452cc..b5619a50d2923 100644 --- a/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts +++ b/packages/jest/src/migrations/update-15-0-0/add-jest-inputs.ts @@ -1,5 +1,5 @@ import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts index 369750da33bfd..e55199be5d37c 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-configs-jest-29.ts @@ -1,15 +1,15 @@ import { + createProjectGraphAsync, formatFiles, logger, stripIndents, Tree, - createProjectGraphAsync, } from '@nrwl/devkit'; +import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; import { TS_QUERY_JEST_CONFIG_PREFIX } from '../../utils/ast-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; import { JestExecutorOptions } from '../../executors/jest/schema'; -import { forEachExecutorOptionsInGraph } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { findRootJestPreset } from '../../utils/config/find-root-jest-files'; export async function updateConfigsJest29(tree: Tree) { @@ -226,4 +226,5 @@ function getNodeWithComments(fullText: string, node: ts.Node) { } return node.getText(); } + export default updateConfigsJest29; diff --git a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts index 871207f11afd6..9499387ea6726 100644 --- a/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts +++ b/packages/jest/src/migrations/update-15-8-0/update-tests-jest-29.ts @@ -5,7 +5,7 @@ import { Tree, visitNotIgnoredFiles, } from '@nrwl/devkit'; -import { forEachExecutorOptionsInGraph } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts index 6a4f4755923f8..54bb5daf46d29 100644 --- a/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts +++ b/packages/js/src/migrations/update-13-10-1/update-lib-swcrc-exclude.ts @@ -1,5 +1,5 @@ import { readProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; import { SwcExecutorOptions } from '../../utils/schema'; import { defaultExclude } from '../../utils/swc/add-swc-config'; diff --git a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts index 5bcf4d3601b26..824ff55d13ba2 100644 --- a/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts +++ b/packages/js/src/migrations/update-14-0-0/exclude-jest-config-swcrc.ts @@ -1,6 +1,6 @@ import { readProjectConfiguration, Tree, updateJson } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { join } from 'path'; export function excludeJestConfigSwcrc(tree: Tree) { diff --git a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts index 6fe831cbea45a..5c1ebe5254108 100644 --- a/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts +++ b/packages/js/src/migrations/update-14-1-5/update-swcrc-path.ts @@ -5,7 +5,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; type OldSwcExecutorOptions = SwcExecutorOptions & { swcrcPath?: string }; diff --git a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts index 7b5d27db9b566..7c76d66108126 100644 --- a/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts +++ b/packages/js/src/migrations/update-15-8-0/rename-swcrc-config.ts @@ -5,7 +5,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { SwcExecutorOptions } from '../../utils/schema'; import { tsquery } from '@phenomnomnominal/tsquery'; import type { TemplateSpan } from 'typescript'; diff --git a/packages/linter/src/generators/utils/eslint-targets.ts b/packages/linter/src/generators/utils/eslint-targets.ts index 9e27a4efdedc7..9de6f24bdd7e4 100644 --- a/packages/linter/src/generators/utils/eslint-targets.ts +++ b/packages/linter/src/generators/utils/eslint-targets.ts @@ -1,5 +1,5 @@ import { Tree } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export function getEslintTargets(tree: Tree) { const eslintTargetNames = new Set(); diff --git a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts index 159637fcd575f..fb94861fb3a45 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-build-to-webpack.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function update(host: Tree) { forEachExecutorOptions( diff --git a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts index f141f18d04bf9..35e88dc6a6a13 100644 --- a/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts +++ b/packages/node/src/migrations/update-13-8-5/rename-execute-to-node.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function update(tree: Tree) { forEachExecutorOptions( diff --git a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts index 9da3ba25663a9..75e84c704a8cb 100644 --- a/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts +++ b/packages/node/src/migrations/update-13-8-5/update-package-to-tsc.ts @@ -1,12 +1,11 @@ import { addDependenciesToPackageJson, formatFiles, - getProjects, readProjectConfiguration, Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { nxVersion } from '@nrwl/workspace/src/utils/versions'; export default async function update(host: Tree) { diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts index 20a1c1db44986..aaae8ab742429 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-configs.ts @@ -1,13 +1,13 @@ import { + createProjectGraphAsync, formatFiles, logger, stripIndents, Tree, - createProjectGraphAsync, } from '@nrwl/devkit'; import { tsquery } from '@phenomnomnominal/tsquery'; import * as ts from 'typescript'; -import { forEachExecutorOptionsInGraph } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; import { TS_QUERY_JEST_CONFIG_PREFIX } from '@nrwl/jest/src/utils/ast-utils'; import { findRootJestPreset } from '@nrwl/jest/src/utils/config/find-root-jest-files'; import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; @@ -227,4 +227,5 @@ function getNodeWithComments(fullText: string, node: ts.Node) { } return node.getText(); } + export default updateConfigsJest29; diff --git a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts index e97e51dc3fbcf..4e7d1379bda23 100644 --- a/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts +++ b/packages/nx-plugin/src/migrations/update-15-9-0/jest-29-tests.ts @@ -7,7 +7,7 @@ import { } from '@nrwl/devkit'; import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; import { TEST_FILE_PATTERN } from '@nrwl/jest/src/utils/ast-utils'; -import { forEachExecutorOptionsInGraph } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptionsInGraph } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { CallExpression, diff --git a/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts b/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts index d23d22b7bc67a..f071494ffac68 100644 --- a/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts +++ b/packages/react-native/src/migrations/update-12-5-0/update-jest-for-react-native.ts @@ -5,8 +5,8 @@ import { stripIndents, Tree, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { join } from 'path'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; /** diff --git a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts index 59de3157df58a..b4425ceb0013b 100644 --- a/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts +++ b/packages/react-native/src/migrations/update-14-6-0/remove-jest-transform.ts @@ -6,9 +6,9 @@ import { stripIndents, Tree, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { removePropertyFromJestConfig } from '@nrwl/jest'; import { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { join } from 'path'; /** diff --git a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts index b50a02c432e3a..e8593f2df1778 100644 --- a/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts +++ b/packages/react/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.ts @@ -3,7 +3,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export async function updateExternalEmotionJsxRuntime(tree: Tree) { forEachExecutorOptions( diff --git a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts index 1ad1ebd0b19e5..c7665e858b55a 100644 --- a/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts +++ b/packages/react/src/migrations/update-14-6-0/add-preset-jest-config.ts @@ -4,8 +4,8 @@ import { readProjectConfiguration, Tree, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import type { JestExecutorOptions } from '@nrwl/jest/src/executors/jest/schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { StringLiteral } from 'typescript'; diff --git a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts index 399ad06d79c01..f256c4457661e 100644 --- a/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts +++ b/packages/react/src/migrations/update-15-6-3/webpack-config-setup.ts @@ -5,7 +5,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { basename } from 'path'; import type { WebpackExecutorOptions } from '@nrwl/webpack'; diff --git a/packages/storybook/src/generators/configuration/util-functions.ts b/packages/storybook/src/generators/configuration/util-functions.ts index 601209efa4930..64f17a2ac6525 100644 --- a/packages/storybook/src/generators/configuration/util-functions.ts +++ b/packages/storybook/src/generators/configuration/util-functions.ts @@ -16,6 +16,7 @@ import { workspaceRoot, writeJson, } from '@nrwl/devkit'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { Linter } from '@nrwl/linter'; import { join, relative } from 'path'; import { @@ -24,7 +25,6 @@ import { TsConfig, } from '../../utils/utilities'; import { StorybookConfigureSchema } from './schema'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; import { UiFramework, UiFramework7 } from '../../utils/models'; const DEFAULT_PORT = 4400; diff --git a/packages/storybook/src/generators/migrate-7/helper-functions.ts b/packages/storybook/src/generators/migrate-7/helper-functions.ts index c01f3730865a8..593bd9da2a05c 100644 --- a/packages/storybook/src/generators/migrate-7/helper-functions.ts +++ b/packages/storybook/src/generators/migrate-7/helper-functions.ts @@ -9,7 +9,7 @@ import { updateProjectConfiguration, workspaceRoot, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import ts = require('typescript'); import * as fs from 'fs'; diff --git a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts index ab0dd9b68621c..4d20a68391ec6 100644 --- a/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts +++ b/packages/storybook/src/migrations/update-15-0-0/add-storybook-inputs.ts @@ -1,5 +1,5 @@ import { formatFiles, readNxJson, Tree, updateNxJson } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { const nxJson = readNxJson(tree); diff --git a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts index 200d7f4cd00cd..69e615da7fe78 100644 --- a/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts +++ b/packages/storybook/src/migrations/update-15-4-6/refactor-executor-options.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export default async function (tree: Tree) { updateNonAngularStorybookBuildTargets(tree); diff --git a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts index 9193a7559bc99..78d6097fc3b03 100644 --- a/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts +++ b/packages/storybook/src/migrations/update-15-7-0/add-addon-essentials-to-all.ts @@ -5,10 +5,10 @@ import { logger, Tree, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; -import ts = require('typescript'); import { removeRootConfig } from './remove-root-config'; +import ts = require('typescript'); /** * The purpose of this migrator is to help users move away diff --git a/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts b/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts index fc09e9dc435db..bdc8761835ba9 100644 --- a/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts +++ b/packages/storybook/src/migrations/update-15-7-0/remove-root-config.ts @@ -5,10 +5,10 @@ import { StringChange, Tree, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; -import ts = require('typescript'); import { getRootMainVariableName } from './add-addon-essentials-to-all'; +import ts = require('typescript'); /** * The purpose of this migrator is to help users move away diff --git a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts index 1f0d7b0160d94..f7424600a847f 100644 --- a/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts +++ b/packages/vite/src/migrations/update-15-3-1/update-vite-tsconfig-paths.ts @@ -5,12 +5,11 @@ import { readProjectConfiguration, Tree, } from '@nrwl/devkit'; - -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { tsquery } from '@phenomnomnominal/tsquery'; import { findNodes } from 'nx/src/utils/typescript'; -import ts = require('typescript'); import { normalizeViteConfigFilePathWithTree } from '../../utils/generator-utils'; +import ts = require('typescript'); export async function removeProjectsFromViteTsConfigPaths(tree: Tree) { findAllProjectsWithViteConfig(tree); diff --git a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts index bc0e387c20d22..16bc4b7ae8dff 100644 --- a/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts +++ b/packages/vite/src/migrations/update-15-3-4/set-mode-in-configuration.ts @@ -4,8 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; - -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export async function setModeInConfiguration(tree: Tree) { forAllProjectsUsingViteAddMode(tree); diff --git a/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts b/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts index f6d62353b16f1..6b0276a6e12f4 100644 --- a/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts +++ b/packages/vite/src/migrations/update-15-4-3/update-report-directory.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { VitestExecutorOptions } from '../../executors/test/schema'; export function updateReportDirectoryPlaceholders(tree: Tree) { diff --git a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts index 5475cbbf2b237..cdcf674420887 100644 --- a/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts +++ b/packages/webpack/src/migrations/update-15-6-3/webpack-config-setup.ts @@ -5,7 +5,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { WebpackExecutorOptions } from '../../executors/webpack/schema'; import { basename } from 'path'; diff --git a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts index f8a676a55ea61..399dbdd715d21 100644 --- a/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts +++ b/packages/webpack/src/migrations/update-15-7-2/add-babelUpwardRootMode-flag.ts @@ -4,7 +4,7 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; import { WebpackExecutorOptions } from '../../executors/webpack/schema'; export default async function (tree: Tree) { diff --git a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts index 7dac2f2c6789b..671aa483b249a 100644 --- a/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts +++ b/packages/workspace/src/migrations/update-14-0-0/change-npm-script-executor.ts @@ -4,7 +4,8 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; + +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export async function changeNpmScriptExecutor(tree: Tree) { forEachExecutorOptions( diff --git a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts index e84e269bb430e..4333d44d70c4c 100644 --- a/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts +++ b/packages/workspace/src/migrations/update-14-8-0/change-run-commands-executor.ts @@ -4,7 +4,8 @@ import { Tree, updateProjectConfiguration, } from '@nrwl/devkit'; -import { forEachExecutorOptions } from '@nrwl/workspace/src/utilities/executor-options-utils'; + +import { forEachExecutorOptions } from '@nrwl/devkit/src/generators/executor-options-utils'; export async function changeRunCommandsExecutor(tree: Tree) { forEachExecutorOptions(