Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(testing): use createNodesV2 for cypress and playwright #26301

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cypress/plugin.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { createNodes, createDependencies } from './src/plugins/plugin';
export { createNodesV2, createNodes } from './src/plugins/plugin';
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import {
CreateNodesContext,
createProjectGraphAsync,
formatFiles,
joinPathFragments,
type TargetConfiguration,
type Tree,
} from '@nx/devkit';
import { migrateExecutorToPlugin } from '@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator';
import { createNodes } from '../../plugins/plugin';
import { createNodesV2 } from '../../plugins/plugin';
import { targetOptionsToCliMap } from './lib/target-options-map';
import { upsertBaseUrl } from './lib/upsert-baseUrl';
import { addDevServerTargetToConfig } from './lib/add-dev-server-target-to-config';
Expand All @@ -31,7 +29,7 @@ export async function convertToInferred(tree: Tree, options: Schema) {
ciTargetName: 'e2e-ci',
}),
postTargetTransformer,
createNodes,
createNodesV2,
options.project
);

Expand All @@ -45,7 +43,7 @@ export async function convertToInferred(tree: Tree, options: Schema) {
ciTargetName: 'e2e-ci',
}),
postTargetTransformer,
createNodes,
createNodesV2,
options.project
);

Expand Down
10 changes: 3 additions & 7 deletions packages/cypress/src/generators/init/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ import {
Tree,
updateNxJson,
} from '@nx/devkit';
import {
addPluginV1 as _addPlugin,
generateCombinations,
} from '@nx/devkit/src/utils/add-plugin';
import { createNodes } from '../../plugins/plugin';
import { addPlugin as _addPlugin } from '@nx/devkit/src/utils/add-plugin';
import { createNodesV2 } from '../../plugins/plugin';
import { cypressVersion, nxVersion } from '../../utils/versions';
import { Schema } from './schema';
import { CypressPluginOptions } from '../../plugins/plugin';

function setupE2ETargetDefaults(tree: Tree) {
const nxJson = readNxJson(tree);
Expand Down Expand Up @@ -69,7 +65,7 @@ export function addPlugin(
tree,
graph,
'@nx/cypress/plugin',
createNodes,
createNodesV2,
{
targetName: ['e2e', 'cypress:e2e', 'cypress-e2e'],
openTargetName: ['open-cypress', 'cypress-open'],
Expand Down
Loading