@nx/cypress 19.0.0-beta.1 → 19.0.0-beta.10

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.
Files changed (44) hide show
  1. package/generators.json +5 -6
  2. package/index.d.ts +2 -9
  3. package/index.js +3 -12
  4. package/migrations.json +0 -24
  5. package/package.json +5 -6
  6. package/plugins/cypress-preset.d.ts +2 -0
  7. package/src/generators/convert-to-inferred/convert-to-inferred.d.ts +8 -0
  8. package/src/generators/convert-to-inferred/convert-to-inferred.js +86 -0
  9. package/src/generators/convert-to-inferred/lib/add-dev-server-target-to-config.d.ts +12 -0
  10. package/src/generators/convert-to-inferred/lib/add-dev-server-target-to-config.js +56 -0
  11. package/src/generators/convert-to-inferred/lib/add-exclude-spec-pattern.d.ts +2 -0
  12. package/src/generators/convert-to-inferred/lib/add-exclude-spec-pattern.js +28 -0
  13. package/src/generators/convert-to-inferred/lib/target-options-map.d.ts +18 -0
  14. package/src/generators/convert-to-inferred/lib/target-options-map.js +21 -0
  15. package/src/generators/convert-to-inferred/lib/upsert-baseUrl.d.ts +2 -0
  16. package/src/generators/convert-to-inferred/lib/upsert-baseUrl.js +33 -0
  17. package/src/generators/convert-to-inferred/schema.json +19 -0
  18. package/src/generators/cypress-project/cypress-project.d.ts +0 -16
  19. package/src/generators/cypress-project/cypress-project.js +0 -213
  20. package/src/generators/cypress-project/files/v10-and-after/cypress.config.ts__tmpl__ +0 -10
  21. package/src/generators/cypress-project/files/v10-and-after/src/e2e/app.cy.ts__tmpl__ +0 -13
  22. package/src/generators/cypress-project/files/v10-and-after/src/fixtures/example.json__tmpl__ +0 -4
  23. package/src/generators/cypress-project/files/v10-and-after/src/support/app.po.ts__tmpl__ +0 -1
  24. package/src/generators/cypress-project/files/v10-and-after/src/support/commands.ts__tmpl__ +0 -33
  25. package/src/generators/cypress-project/files/v10-and-after/src/support/e2e.ts__tmpl__ +0 -17
  26. package/src/generators/cypress-project/files/v10-and-after/tsconfig.json +0 -10
  27. package/src/generators/cypress-project/files/v9-and-under/cypress.json +0 -12
  28. package/src/generators/cypress-project/files/v9-and-under/src/fixtures/example.json__tmpl__ +0 -4
  29. package/src/generators/cypress-project/files/v9-and-under/src/integration/app.spec.ts__tmpl__ +0 -13
  30. package/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js +0 -22
  31. package/src/generators/cypress-project/files/v9-and-under/src/support/app.po.ts__tmpl__ +0 -1
  32. package/src/generators/cypress-project/files/v9-and-under/src/support/commands.ts__tmpl__ +0 -33
  33. package/src/generators/cypress-project/files/v9-and-under/src/support/index.ts__tmpl__ +0 -17
  34. package/src/generators/cypress-project/files/v9-and-under/tsconfig.json +0 -10
  35. package/src/generators/cypress-project/schema.d.ts +0 -17
  36. package/src/generators/cypress-project/schema.json +0 -78
  37. package/src/migrations/update-15-0-0/add-cypress-inputs.d.ts +0 -2
  38. package/src/migrations/update-15-0-0/add-cypress-inputs.js +0 -42
  39. package/src/migrations/update-15-0-0/update-cy-mount-usage.d.ts +0 -5
  40. package/src/migrations/update-15-0-0/update-cy-mount-usage.js +0 -119
  41. package/src/migrations/update-15-1-0/cypress-11.d.ts +0 -6
  42. package/src/migrations/update-15-1-0/cypress-11.js +0 -114
  43. package/src/migrations/update-15-5-0/update-to-cypress-12.d.ts +0 -24
  44. package/src/migrations/update-15-5-0/update-to-cypress-12.js +0 -180
package/generators.json CHANGED
@@ -9,12 +9,6 @@
9
9
  "aliases": ["ng-add"],
10
10
  "hidden": true
11
11
  },
12
- "cypress-project": {
13
- "factory": "./src/generators/cypress-project/cypress-project#cypressProjectGeneratorInternal",
14
- "schema": "./src/generators/cypress-project/schema.json",
15
- "description": "Add a Cypress E2E Project.",
16
- "hidden": true
17
- },
18
12
  "configuration": {
19
13
  "aliases": ["cypress-e2e-configuration", "e2e", "e2e-config"],
20
14
  "factory": "./src/generators/configuration/configuration#configurationGeneratorInternal",
@@ -32,6 +26,11 @@
32
26
  "factory": "./src/generators/migrate-to-cypress-11/migrate-to-cypress-11#migrateCypressProject",
33
27
  "schema": "./src/generators/migrate-to-cypress-11/schema.json",
34
28
  "description": "Migrate existing Cypress e2e projects to Cypress v11"
29
+ },
30
+ "convert-to-inferred": {
31
+ "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
32
+ "schema": "./src/generators/convert-to-inferred/schema.json",
33
+ "description": "Convert existing Cypress project(s) using `@nx/cypress:cypress` executor to use `@nx/cypress/plugin`."
35
34
  }
36
35
  }
37
36
  }
package/index.d.ts CHANGED
@@ -1,11 +1,4 @@
1
- import { configurationGenerator } from './src/generators/configuration/configuration';
2
- import { componentConfigurationGenerator } from './src/generators/component-configuration/component-configuration';
3
- import { cypressProjectGenerator as _cypressProjectGenerator } from './src/generators/cypress-project/cypress-project';
4
- export { configurationGenerator, componentConfigurationGenerator };
5
- /** @deprecated Use `configurationGenerator` instead. It will be removed in Nx 19. */
6
- export declare const cypressComponentConfiguration: typeof componentConfigurationGenerator;
7
- export { configurationGenerator as cypressE2EConfigurationGenerator };
8
- /** @deprecated Add a new project and call `configurationGenerator` instead. It will be removed in Nx 19. */
9
- export declare const cypressProjectGenerator: typeof _cypressProjectGenerator;
1
+ export { configurationGenerator } from './src/generators/configuration/configuration';
2
+ export { componentConfigurationGenerator } from './src/generators/component-configuration/component-configuration';
10
3
  export { cypressInitGenerator } from './src/generators/init/init';
11
4
  export { migrateCypressProject } from './src/generators/migrate-to-cypress-11/migrate-to-cypress-11';
package/index.js CHANGED
@@ -1,19 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.migrateCypressProject = exports.cypressInitGenerator = exports.cypressProjectGenerator = exports.cypressE2EConfigurationGenerator = exports.cypressComponentConfiguration = exports.componentConfigurationGenerator = exports.configurationGenerator = void 0;
4
- const configuration_1 = require("./src/generators/configuration/configuration");
3
+ exports.migrateCypressProject = exports.cypressInitGenerator = exports.componentConfigurationGenerator = exports.configurationGenerator = void 0;
4
+ var configuration_1 = require("./src/generators/configuration/configuration");
5
5
  Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return configuration_1.configurationGenerator; } });
6
- Object.defineProperty(exports, "cypressE2EConfigurationGenerator", { enumerable: true, get: function () { return configuration_1.configurationGenerator; } });
7
- const component_configuration_1 = require("./src/generators/component-configuration/component-configuration");
6
+ var component_configuration_1 = require("./src/generators/component-configuration/component-configuration");
8
7
  Object.defineProperty(exports, "componentConfigurationGenerator", { enumerable: true, get: function () { return component_configuration_1.componentConfigurationGenerator; } });
9
- const cypress_project_1 = require("./src/generators/cypress-project/cypress-project");
10
- // Maintain backwards compatibility with the old names in case community plugins used them.
11
- // TODO(v19): Remove old name
12
- /** @deprecated Use `configurationGenerator` instead. It will be removed in Nx 19. */
13
- exports.cypressComponentConfiguration = component_configuration_1.componentConfigurationGenerator;
14
- // TODO(v19): Remove project generator
15
- /** @deprecated Add a new project and call `configurationGenerator` instead. It will be removed in Nx 19. */
16
- exports.cypressProjectGenerator = cypress_project_1.cypressProjectGenerator;
17
8
  var init_1 = require("./src/generators/init/init");
18
9
  Object.defineProperty(exports, "cypressInitGenerator", { enumerable: true, get: function () { return init_1.cypressInitGenerator; } });
19
10
  var migrate_to_cypress_11_1 = require("./src/generators/migrate-to-cypress-11/migrate-to-cypress-11");
package/migrations.json CHANGED
@@ -1,29 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "add-cypress-inputs": {
4
- "cli": "nx",
5
- "version": "15.0.0-beta.0",
6
- "description": "Stop hashing cypress spec files and config files for build targets and dependent tasks",
7
- "factory": "./src/migrations/update-15-0-0/add-cypress-inputs"
8
- },
9
- "update-cy-mount-usage": {
10
- "cli": "nx",
11
- "version": "15.0.0-beta.4",
12
- "description": "Update to using cy.mount in the commands.ts file instead of importing mount for each component test file",
13
- "factory": "./src/migrations/update-15-0-0/update-cy-mount-usage"
14
- },
15
- "update-to-cypress-11": {
16
- "cli": "nx",
17
- "version": "15.1.0-beta.0",
18
- "description": "Update to Cypress v11. This migration will only update if the workspace is already on v10. https://www.cypress.io/blog/2022/11/04/upcoming-changes-to-component-testing/",
19
- "factory": "./src/migrations/update-15-1-0/cypress-11"
20
- },
21
- "update-to-cypress-12": {
22
- "cli": "nx",
23
- "version": "15.5.0-beta.0",
24
- "description": "Update to Cypress v12. Cypress 12 contains a handful of breaking changes that might causes tests to start failing that nx cannot directly fix. Read more Cypress 12 changes: https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-12-0.This migration will only run if you are already using Cypress v11.",
25
- "factory": "./src/migrations/update-15-5-0/update-to-cypress-12"
26
- },
27
3
  "update-16-0-0-add-nx-packages": {
28
4
  "cli": "nx",
29
5
  "version": "16.0.0-beta.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "19.0.0-beta.1",
3
+ "version": "19.0.0-beta.10",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Cypress contains executors and generators allowing your workspace to use the powerful Cypress integration testing capabilities.",
6
6
  "repository": {
@@ -34,14 +34,13 @@
34
34
  "migrations": "./migrations.json"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "19.0.0-beta.1",
38
- "@nx/eslint": "19.0.0-beta.1",
39
- "@nx/js": "19.0.0-beta.1",
37
+ "@nx/devkit": "19.0.0-beta.10",
38
+ "@nx/eslint": "19.0.0-beta.10",
39
+ "@nx/js": "19.0.0-beta.10",
40
40
  "@phenomnomnominal/tsquery": "~5.0.1",
41
41
  "detect-port": "^1.5.1",
42
- "semver": "^7.5.3",
43
42
  "tslib": "^2.3.0",
44
- "@nrwl/cypress": "19.0.0-beta.1"
43
+ "@nrwl/cypress": "19.0.0-beta.10"
45
44
  },
46
45
  "peerDependencies": {
47
46
  "cypress": ">= 3 < 14"
@@ -14,6 +14,8 @@ export interface NxComponentTestingOptions {
14
14
  bundler?: 'vite' | 'webpack';
15
15
  compiler?: 'swc' | 'babel';
16
16
  }
17
+ export interface NxComponentTestingPresetOptions extends Omit<NxComponentTestingOptions, 'bundler'> {
18
+ }
17
19
  export declare function nxBaseCypressPreset(pathToConfig: string, options?: {
18
20
  testingType: 'component' | 'e2e';
19
21
  }): BaseCypressPreset;
@@ -0,0 +1,8 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ interface Schema {
3
+ project?: string;
4
+ all?: boolean;
5
+ skipFormat?: boolean;
6
+ }
7
+ export declare function convertToInferred(tree: Tree, options: Schema): Promise<void>;
8
+ export default convertToInferred;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convertToInferred = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
6
+ const plugin_1 = require("../../plugins/plugin");
7
+ const target_options_map_1 = require("./lib/target-options-map");
8
+ const upsert_baseUrl_1 = require("./lib/upsert-baseUrl");
9
+ const add_dev_server_target_to_config_1 = require("./lib/add-dev-server-target-to-config");
10
+ const add_exclude_spec_pattern_1 = require("./lib/add-exclude-spec-pattern");
11
+ async function convertToInferred(tree, options) {
12
+ const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
13
+ await (0, executor_to_plugin_migrator_1.migrateExecutorToPlugin)(tree, projectGraph, '@nx/cypress:cypress', '@nx/cypress/plugin', (targetName) => ({
14
+ targetName,
15
+ ciTargetName: 'e2e-ci',
16
+ }), postTargetTransformer, plugin_1.createNodes, options.project);
17
+ if (!options.skipFormat) {
18
+ await (0, devkit_1.formatFiles)(tree);
19
+ }
20
+ }
21
+ exports.convertToInferred = convertToInferred;
22
+ function postTargetTransformer(target, tree) {
23
+ if (target.options) {
24
+ const configFilePath = target.options.cypressConfig;
25
+ delete target.options.cypressConfig;
26
+ delete target.options.copyFiles;
27
+ delete target.options.skipServe;
28
+ for (const key in target_options_map_1.targetOptionsToCliMap) {
29
+ if (target.options[key]) {
30
+ target.options[target_options_map_1.targetOptionsToCliMap[key]] = target.options[key];
31
+ delete target.options[key];
32
+ }
33
+ }
34
+ if ('exit' in target.options && !target.options.exit) {
35
+ delete target.options.exit;
36
+ target.options['no-exit'] = true;
37
+ }
38
+ if (target.options.testingType) {
39
+ delete target.options.testingType;
40
+ }
41
+ if (target.options.watch) {
42
+ target.options.headed = true;
43
+ target.options['no-exit'] = true;
44
+ delete target.options.watch;
45
+ }
46
+ if (target.options.baseUrl) {
47
+ (0, upsert_baseUrl_1.upsertBaseUrl)(tree, configFilePath, target.options.baseUrl);
48
+ delete target.options.baseUrl;
49
+ }
50
+ if (target.options.devServerTarget) {
51
+ const webServerCommands = {
52
+ default: `npx nx run ${target.options.devServerTarget}`,
53
+ };
54
+ delete target.options.devServerTarget;
55
+ if (target.configurations) {
56
+ for (const configuration in target.configurations) {
57
+ if (target.configurations[configuration]?.devServerTarget) {
58
+ webServerCommands[configuration] = `npx nx run ${target.configurations[configuration].devServerTarget}`;
59
+ delete target.configurations[configuration].devServerTarget;
60
+ }
61
+ }
62
+ }
63
+ (0, add_dev_server_target_to_config_1.addDevServerTargetToConfig)(tree, configFilePath, webServerCommands, target.configurations?.ci?.devServerTarget);
64
+ }
65
+ if (target.options.ignoreTestFiles) {
66
+ (0, add_exclude_spec_pattern_1.addExcludeSpecPattern)(tree, configFilePath, target.options.ignoreTestFiles);
67
+ delete target.options.ignoreTestFiles;
68
+ }
69
+ if (Object.keys(target.options).length === 0) {
70
+ delete target.options;
71
+ }
72
+ if (target.configurations &&
73
+ Object.keys(target.configurations).length !== 0) {
74
+ for (const configuration in target.configurations) {
75
+ if (Object.keys(target.configurations[configuration]).length === 0) {
76
+ delete target.configurations[configuration];
77
+ }
78
+ }
79
+ if (Object.keys(target.configurations).length === 0) {
80
+ delete target.configurations;
81
+ }
82
+ }
83
+ }
84
+ return target;
85
+ }
86
+ exports.default = convertToInferred;
@@ -0,0 +1,12 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ /**
3
+ * Add or update the webServerCommands and ciWebServerCommand options in the Cypress Config
4
+ * Scenarios Covered:
5
+ * 1. Only devServerTarget Exists
6
+ * 2. devServerTarget and configuration.ci.devServerTarget Exists
7
+ *
8
+ * For each, the following scenarios are covered:
9
+ * a. The command is not listed in the config, so it is added
10
+ * b. Replace the existing webServerCommands with the value passed in
11
+ */
12
+ export declare function addDevServerTargetToConfig(tree: Tree, configFilePath: string, webServerCommands: Record<string, string>, ciDevServerTarget?: string): void;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addDevServerTargetToConfig = void 0;
4
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
5
+ /**
6
+ * Add or update the webServerCommands and ciWebServerCommand options in the Cypress Config
7
+ * Scenarios Covered:
8
+ * 1. Only devServerTarget Exists
9
+ * 2. devServerTarget and configuration.ci.devServerTarget Exists
10
+ *
11
+ * For each, the following scenarios are covered:
12
+ * a. The command is not listed in the config, so it is added
13
+ * b. Replace the existing webServerCommands with the value passed in
14
+ */
15
+ function addDevServerTargetToConfig(tree, configFilePath, webServerCommands, ciDevServerTarget) {
16
+ let configFileContents = tree.read(configFilePath, 'utf-8');
17
+ let ast = tsquery_1.tsquery.ast(configFileContents);
18
+ const NX_E2E_PRESET_OPTIONS_SELECTOR = 'PropertyAssignment:has(Identifier[name=e2e]) CallExpression:has(Identifier[name=nxE2EPreset]) > ObjectLiteralExpression';
19
+ const nxE2ePresetOptionsNodes = (0, tsquery_1.tsquery)(ast, NX_E2E_PRESET_OPTIONS_SELECTOR, {
20
+ visitAllChildren: true,
21
+ });
22
+ if (nxE2ePresetOptionsNodes.length !== 0) {
23
+ let nxE2ePresetOptionsNode = nxE2ePresetOptionsNodes[0];
24
+ const WEB_SERVER_COMMANDS_SELECTOR = 'PropertyAssignment:has(Identifier[name=webServerCommands])';
25
+ const webServerCommandsNodes = (0, tsquery_1.tsquery)(nxE2ePresetOptionsNode, WEB_SERVER_COMMANDS_SELECTOR, { visitAllChildren: true });
26
+ if (webServerCommandsNodes.length !== 0) {
27
+ // Already exists, replace it
28
+ tree.write(configFilePath, `${configFileContents.slice(0, webServerCommandsNodes[0].getStart())}webServerCommands: ${JSON.stringify(webServerCommands)}${configFileContents.slice(webServerCommandsNodes[0].getEnd())}`);
29
+ }
30
+ else {
31
+ tree.write(configFilePath, `${configFileContents.slice(0, nxE2ePresetOptionsNode.getStart() + 1)}webServerCommands: ${JSON.stringify(webServerCommands)},${configFileContents.slice(nxE2ePresetOptionsNode.getStart() + 1)}`);
32
+ }
33
+ if (ciDevServerTarget) {
34
+ configFileContents = tree.read(configFilePath, 'utf-8');
35
+ ast = tsquery_1.tsquery.ast(configFileContents);
36
+ nxE2ePresetOptionsNode = (0, tsquery_1.tsquery)(ast, NX_E2E_PRESET_OPTIONS_SELECTOR, {
37
+ visitAllChildren: true,
38
+ })[0];
39
+ const CI_WEB_SERVER_COMMANDS_SELECTOR = 'PropertyAssignment:has(Identifier[name=ciWebServerCommand])';
40
+ const ciWebServerCommandsNodes = (0, tsquery_1.tsquery)(nxE2ePresetOptionsNode, CI_WEB_SERVER_COMMANDS_SELECTOR, { visitAllChildren: true });
41
+ if (ciWebServerCommandsNodes.length !== 0) {
42
+ const ciWebServerCommandNode = ciWebServerCommandsNodes[0].getChildAt(2);
43
+ const ciWebServerCommand = ciWebServerCommandNode
44
+ .getText()
45
+ .replace(/["']/g, '');
46
+ if (!ciWebServerCommand.includes(ciDevServerTarget)) {
47
+ tree.write(configFilePath, `${configFileContents.slice(0, ciWebServerCommandNode.getStart())}"npx nx run ${ciDevServerTarget}"${configFileContents.slice(ciWebServerCommandNode.getEnd())}`);
48
+ }
49
+ }
50
+ else {
51
+ tree.write(configFilePath, `${configFileContents.slice(0, nxE2ePresetOptionsNode.getStart() + 1)}ciWebServerCommand: "npx nx run ${ciDevServerTarget}",${configFileContents.slice(nxE2ePresetOptionsNode.getStart() + 1)}`);
52
+ }
53
+ }
54
+ }
55
+ }
56
+ exports.addDevServerTargetToConfig = addDevServerTargetToConfig;
@@ -0,0 +1,2 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ export declare function addExcludeSpecPattern(tree: Tree, configFilePath: string, excludeSpecPattern: string | string[]): void;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addExcludeSpecPattern = void 0;
4
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
5
+ function addExcludeSpecPattern(tree, configFilePath, excludeSpecPattern) {
6
+ let configFileContents = tree.read(configFilePath, 'utf-8');
7
+ let ast = tsquery_1.tsquery.ast(configFileContents);
8
+ const E2E_CONFIG_SELECTOR = 'PropertyAssignment:has(Identifier[name=e2e]) > ObjectLiteralExpression';
9
+ const e2eConfigNodes = (0, tsquery_1.tsquery)(ast, E2E_CONFIG_SELECTOR, {
10
+ visitAllChildren: true,
11
+ });
12
+ if (e2eConfigNodes.length !== 0) {
13
+ const e2eConfigNode = e2eConfigNodes[0];
14
+ const EXCLUDE_SPEC_PATTERN_SELECTOR = 'PropertyAssignment:has(Identifier[name="excludeSpecPattern"])';
15
+ const excludeSpecPatternNodes = (0, tsquery_1.tsquery)(e2eConfigNode, EXCLUDE_SPEC_PATTERN_SELECTOR, { visitAllChildren: true });
16
+ if (excludeSpecPatternNodes.length !== 0) {
17
+ const excludeSpecPatternNode = excludeSpecPatternNodes[0];
18
+ let updatedExcludePattern = Array.isArray(excludeSpecPattern)
19
+ ? excludeSpecPattern
20
+ : [excludeSpecPattern];
21
+ tree.write(configFilePath, `${configFileContents.slice(0, excludeSpecPatternNode.getStart())}excludeSpecPattern: ${JSON.stringify(updatedExcludePattern)}${configFileContents.slice(excludeSpecPatternNode.getEnd())}`);
22
+ }
23
+ else {
24
+ tree.write(configFilePath, `${configFileContents.slice(0, e2eConfigNode.getStart() + 1)}excludeSpecPattern: ${JSON.stringify(excludeSpecPattern)},${configFileContents.slice(e2eConfigNode.getStart() + 1)}`);
25
+ }
26
+ }
27
+ }
28
+ exports.addExcludeSpecPattern = addExcludeSpecPattern;
@@ -0,0 +1,18 @@
1
+ export declare const targetOptionsToCliMap: {
2
+ headed: string;
3
+ headless: string;
4
+ key: string;
5
+ record: string;
6
+ parallel: string;
7
+ browser: string;
8
+ env: string;
9
+ spec: string;
10
+ ciBuildId: string;
11
+ group: string;
12
+ reporter: string;
13
+ reporterOptions: string;
14
+ tag: string;
15
+ port: string;
16
+ quiet: string;
17
+ runnerUi: string;
18
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.targetOptionsToCliMap = void 0;
4
+ exports.targetOptionsToCliMap = {
5
+ headed: 'headed',
6
+ headless: 'headless',
7
+ key: 'key',
8
+ record: 'record',
9
+ parallel: 'parallel',
10
+ browser: 'browser',
11
+ env: 'env',
12
+ spec: 'spec',
13
+ ciBuildId: 'ci-build-id',
14
+ group: 'group',
15
+ reporter: 'reporter',
16
+ reporterOptions: 'reporter-options',
17
+ tag: 'tag',
18
+ port: 'port',
19
+ quiet: 'quiet',
20
+ runnerUi: 'runner-ui',
21
+ };
@@ -0,0 +1,2 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ export declare function upsertBaseUrl(tree: Tree, configFilePath: string, baseUrlValueInProject: string): void;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.upsertBaseUrl = void 0;
4
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
5
+ function upsertBaseUrl(tree, configFilePath, baseUrlValueInProject) {
6
+ const configFileContents = tree.read(configFilePath, 'utf-8');
7
+ const ast = tsquery_1.tsquery.ast(configFileContents);
8
+ const BASE_URL_SELECTOR = 'PropertyAssignment:has(Identifier[name=e2e]) PropertyAssignment:has(Identifier[name="baseUrl"])';
9
+ const baseUrlNodes = (0, tsquery_1.tsquery)(ast, BASE_URL_SELECTOR, {
10
+ visitAllChildren: true,
11
+ });
12
+ if (baseUrlNodes.length !== 0) {
13
+ // The property exists in the config
14
+ const baseUrlValueNode = baseUrlNodes[0].getChildAt(2);
15
+ const baseUrlValue = baseUrlValueNode.getText().replace(/(["'])/, '');
16
+ if (baseUrlValue === baseUrlValueInProject) {
17
+ return;
18
+ }
19
+ tree.write(configFilePath, `${configFileContents.slice(0, baseUrlValueNode.getStart())}"${baseUrlValueInProject}"${configFileContents.slice(baseUrlValueNode.getEnd())}`);
20
+ }
21
+ else {
22
+ const E2E_OBJECT_SELECTOR = 'PropertyAssignment:has(Identifier[name=e2e]) ObjectLiteralExpression';
23
+ const e2eConfigNodes = (0, tsquery_1.tsquery)(ast, E2E_OBJECT_SELECTOR, {
24
+ visitAllChildren: true,
25
+ });
26
+ if (e2eConfigNodes.length !== 0) {
27
+ const e2eConfigNode = e2eConfigNodes[0];
28
+ tree.write(configFilePath, `${configFileContents.slice(0, e2eConfigNode.getEnd() - 1)}baseUrl: "${baseUrlValueInProject}",
29
+ ${configFileContents.slice(e2eConfigNode.getEnd() - 1)}`);
30
+ }
31
+ }
32
+ }
33
+ exports.upsertBaseUrl = upsertBaseUrl;
@@ -0,0 +1,19 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxCypressConvertToInferred",
4
+ "description": "Convert existing Cypress project(s) using `@nx/cypress:cypress` executor to use `@nx/cypress/plugin`.",
5
+ "title": "Convert Cypress project from executor to plugin",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The project to convert from using the `@nx/cypress:cypress` executor to use `@nx/cypress/plugin`.",
11
+ "x-priority": "important"
12
+ },
13
+ "skipFormat": {
14
+ "type": "boolean",
15
+ "description": "Whether to format files at the end of the migration.",
16
+ "default": false
17
+ }
18
+ }
19
+ }
@@ -1,16 +0,0 @@
1
- import { GeneratorCallback, Tree } from '@nx/devkit';
2
- import { Schema } from './schema';
3
- export interface CypressProjectSchema extends Schema {
4
- projectName: string;
5
- projectRoot: string;
6
- rootProject: boolean;
7
- }
8
- /**
9
- * @deprecated use cypressE2EConfigurationGenerator instead
10
- **/
11
- export declare function cypressProjectGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
12
- /**
13
- * @deprecated use cypressE2EConfigurationGenerator instead
14
- **/
15
- export declare function cypressProjectGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
16
- export default cypressProjectGenerator;