@nx/cypress 16.0.0-beta.1
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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/executors.json +16 -0
- package/generators.json +66 -0
- package/index.d.ts +5 -0
- package/index.js +14 -0
- package/index.js.map +1 -0
- package/migrations.json +53 -0
- package/package.json +59 -0
- package/plugins/cypress-preset.d.ts +62 -0
- package/plugins/cypress-preset.js +53 -0
- package/plugins/cypress-preset.js.map +1 -0
- package/src/executors/cypress/compat.d.ts +2 -0
- package/src/executors/cypress/compat.js +6 -0
- package/src/executors/cypress/compat.js.map +1 -0
- package/src/executors/cypress/cypress.impl.d.ts +40 -0
- package/src/executors/cypress/cypress.impl.js +372 -0
- package/src/executors/cypress/cypress.impl.js.map +1 -0
- package/src/executors/cypress/schema.json +158 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.d.ts +4 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +104 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -0
- package/src/generators/convert-tslint-to-eslint/schema.json +44 -0
- package/src/generators/cypress-component-project/cypress-component-project.d.ts +4 -0
- package/src/generators/cypress-component-project/cypress-component-project.js +127 -0
- package/src/generators/cypress-component-project/cypress-component-project.js.map +1 -0
- package/src/generators/cypress-component-project/files/cypress/fixtures/example.json +5 -0
- package/src/generators/cypress-component-project/files/cypress/support/commands.ts__ext__ +34 -0
- package/src/generators/cypress-component-project/files/cypress/support/component-index.html +13 -0
- package/src/generators/cypress-component-project/files/cypress/support/component.ts__ext__ +17 -0
- package/src/generators/cypress-component-project/files/cypress/tsconfig.cy.json +17 -0
- package/src/generators/cypress-component-project/files/cypress.config.ts__ext__ +3 -0
- package/src/generators/cypress-component-project/schema.d.ts +5 -0
- package/src/generators/cypress-component-project/schema.json +33 -0
- package/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.d.ts +18 -0
- package/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.js +133 -0
- package/src/generators/cypress-e2e-configuration/cypress-e2e-configuration.js.map +1 -0
- package/src/generators/cypress-e2e-configuration/files/v10/__dir__/e2e/app.cy.ts__tmpl__ +13 -0
- package/src/generators/cypress-e2e-configuration/files/v10/__dir__/fixtures/example.json__tmpl__ +4 -0
- package/src/generators/cypress-e2e-configuration/files/v10/__dir__/support/app.po.ts__tmpl__ +1 -0
- package/src/generators/cypress-e2e-configuration/files/v10/__dir__/support/commands.ts__tmpl__ +33 -0
- package/src/generators/cypress-e2e-configuration/files/v10/__dir__/support/e2e.ts__tmpl__ +17 -0
- package/src/generators/cypress-e2e-configuration/files/v10/cypress.config.ts__tmpl__ +9 -0
- package/src/generators/cypress-e2e-configuration/files/v10/tsconfig__tsFileExt__ +10 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/fixtures/example.json__tmpl__ +4 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/integration/app.spec.ts__tmpl__ +13 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/plugins/index.js +22 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/support/app.po.ts__tmpl__ +1 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/support/commands.ts__tmpl__ +33 -0
- package/src/generators/cypress-e2e-configuration/files/v9/__dir__/support/index.ts__tmpl__ +17 -0
- package/src/generators/cypress-e2e-configuration/files/v9/cypress.json +12 -0
- package/src/generators/cypress-e2e-configuration/files/v9/tsconfig__tsFileExt__ +10 -0
- package/src/generators/cypress-e2e-configuration/schema.json +91 -0
- package/src/generators/cypress-project/cypress-project.d.ts +13 -0
- package/src/generators/cypress-project/cypress-project.js +172 -0
- package/src/generators/cypress-project/cypress-project.js.map +1 -0
- package/src/generators/cypress-project/files/v10-and-after/cypress.config.ts__tmpl__ +10 -0
- package/src/generators/cypress-project/files/v10-and-after/src/e2e/app.cy.ts__tmpl__ +13 -0
- package/src/generators/cypress-project/files/v10-and-after/src/fixtures/example.json__tmpl__ +4 -0
- package/src/generators/cypress-project/files/v10-and-after/src/support/app.po.ts__tmpl__ +1 -0
- package/src/generators/cypress-project/files/v10-and-after/src/support/commands.ts__tmpl__ +33 -0
- package/src/generators/cypress-project/files/v10-and-after/src/support/e2e.ts__tmpl__ +17 -0
- package/src/generators/cypress-project/files/v10-and-after/tsconfig.json +10 -0
- package/src/generators/cypress-project/files/v9-and-under/cypress.json +12 -0
- package/src/generators/cypress-project/files/v9-and-under/src/fixtures/example.json__tmpl__ +4 -0
- package/src/generators/cypress-project/files/v9-and-under/src/integration/app.spec.ts__tmpl__ +13 -0
- package/src/generators/cypress-project/files/v9-and-under/src/plugins/index.js +22 -0
- package/src/generators/cypress-project/files/v9-and-under/src/support/app.po.ts__tmpl__ +1 -0
- package/src/generators/cypress-project/files/v9-and-under/src/support/commands.ts__tmpl__ +33 -0
- package/src/generators/cypress-project/files/v9-and-under/src/support/index.ts__tmpl__ +17 -0
- package/src/generators/cypress-project/files/v9-and-under/tsconfig.json +10 -0
- package/src/generators/cypress-project/schema.d.ts +15 -0
- package/src/generators/cypress-project/schema.json +79 -0
- package/src/generators/init/init.d.ts +5 -0
- package/src/generators/init/init.js +47 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/schema.d.ts +5 -0
- package/src/generators/init/schema.json +16 -0
- package/src/generators/migrate-to-cypress-11/conversion.util.d.ts +34 -0
- package/src/generators/migrate-to-cypress-11/conversion.util.js +241 -0
- package/src/generators/migrate-to-cypress-11/conversion.util.js.map +1 -0
- package/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.d.ts +3 -0
- package/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.js +85 -0
- package/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.js.map +1 -0
- package/src/generators/migrate-to-cypress-11/schema.json +15 -0
- package/src/migrations/update-12-8-0/remove-typescript-plugin.d.ts +2 -0
- package/src/migrations/update-12-8-0/remove-typescript-plugin.js +89 -0
- package/src/migrations/update-12-8-0/remove-typescript-plugin.js.map +1 -0
- package/src/migrations/update-14-6-1/update-cypress-configs-presets.d.ts +3 -0
- package/src/migrations/update-14-6-1/update-cypress-configs-presets.js +111 -0
- package/src/migrations/update-14-6-1/update-cypress-configs-presets.js.map +1 -0
- package/src/migrations/update-14-7-0/update-cypress-version-if-10.d.ts +3 -0
- package/src/migrations/update-14-7-0/update-cypress-version-if-10.js +33 -0
- package/src/migrations/update-14-7-0/update-cypress-version-if-10.js.map +1 -0
- package/src/migrations/update-15-0-0/add-cypress-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-cypress-inputs.js +48 -0
- package/src/migrations/update-15-0-0/add-cypress-inputs.js.map +1 -0
- package/src/migrations/update-15-0-0/update-cy-mount-usage.d.ts +5 -0
- package/src/migrations/update-15-0-0/update-cy-mount-usage.js +124 -0
- package/src/migrations/update-15-0-0/update-cy-mount-usage.js.map +1 -0
- package/src/migrations/update-15-1-0/cypress-11.d.ts +6 -0
- package/src/migrations/update-15-1-0/cypress-11.js +118 -0
- package/src/migrations/update-15-1-0/cypress-11.js.map +1 -0
- package/src/migrations/update-15-5-0/helpers.d.ts +3 -0
- package/src/migrations/update-15-5-0/helpers.js +40 -0
- package/src/migrations/update-15-5-0/helpers.js.map +1 -0
- package/src/migrations/update-15-5-0/update-to-cypress-12.d.ts +24 -0
- package/src/migrations/update-15-5-0/update-to-cypress-12.js +183 -0
- package/src/migrations/update-15-5-0/update-to-cypress-12.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/plugins/preprocessor-vite.d.ts +32 -0
- package/src/plugins/preprocessor-vite.js +96 -0
- package/src/plugins/preprocessor-vite.js.map +1 -0
- package/src/utils/add-linter.d.ts +21 -0
- package/src/utils/add-linter.js +90 -0
- package/src/utils/add-linter.js.map +1 -0
- package/src/utils/ct-helpers.d.ts +16 -0
- package/src/utils/ct-helpers.js +86 -0
- package/src/utils/ct-helpers.js.map +1 -0
- package/src/utils/cypress-version.d.ts +5 -0
- package/src/utils/cypress-version.js +34 -0
- package/src/utils/cypress-version.js.map +1 -0
- package/src/utils/find-target-options.d.ts +16 -0
- package/src/utils/find-target-options.js +115 -0
- package/src/utils/find-target-options.js.map +1 -0
- package/src/utils/project-name.d.ts +3 -0
- package/src/utils/project-name.js +20 -0
- package/src/utils/project-name.js.map +1 -0
- package/src/utils/versions.d.ts +9 -0
- package/src/utils/versions.js +13 -0
- package/src/utils/versions.js.map +1 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NxCypressProjectGeneratorSchema",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Create Cypress Configuration for the workspace",
|
|
6
|
+
"description": "Create Cypress Configuration for the workspace.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The name of the frontend project to test.",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "projectName"
|
|
14
|
+
},
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"baseUrl": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The address (with the port) which your application is running on."
|
|
20
|
+
},
|
|
21
|
+
"name": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Name of the E2E Project.",
|
|
24
|
+
"$default": {
|
|
25
|
+
"$source": "argv",
|
|
26
|
+
"index": 0
|
|
27
|
+
},
|
|
28
|
+
"x-prompt": "What name would you like to use for the e2e project?"
|
|
29
|
+
},
|
|
30
|
+
"directory": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "A directory where the project is placed.",
|
|
33
|
+
"x-priority": "important"
|
|
34
|
+
},
|
|
35
|
+
"linter": {
|
|
36
|
+
"description": "The tool to use for running lint checks.",
|
|
37
|
+
"type": "string",
|
|
38
|
+
"enum": ["eslint", "none"],
|
|
39
|
+
"default": "eslint"
|
|
40
|
+
},
|
|
41
|
+
"js": {
|
|
42
|
+
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
43
|
+
"type": "boolean",
|
|
44
|
+
"default": false
|
|
45
|
+
},
|
|
46
|
+
"skipFormat": {
|
|
47
|
+
"description": "Skip formatting files.",
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"default": false,
|
|
50
|
+
"x-priority": "internal"
|
|
51
|
+
},
|
|
52
|
+
"setParserOptionsProject": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
55
|
+
"default": false
|
|
56
|
+
},
|
|
57
|
+
"standaloneConfig": {
|
|
58
|
+
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside workspace.json.",
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"default": true,
|
|
61
|
+
"x-deprecated": "Nx only supports standaloneConfig"
|
|
62
|
+
},
|
|
63
|
+
"skipPackageJson": {
|
|
64
|
+
"type": "boolean",
|
|
65
|
+
"default": false,
|
|
66
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
67
|
+
"x-priority": "internal"
|
|
68
|
+
},
|
|
69
|
+
"bundler": {
|
|
70
|
+
"description": "The Cypress bundler to use.",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"enum": ["vite", "webpack", "none"],
|
|
73
|
+
"x-prompt": "Which Cypress bundler do you want to use?",
|
|
74
|
+
"default": "webpack"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"required": ["name"],
|
|
78
|
+
"examplesFile": "../../../docs/cypress-project-examples.md"
|
|
79
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import { Schema } from './schema';
|
|
3
|
+
export declare function cypressInitGenerator(tree: Tree, options: Schema): Promise<GeneratorCallback>;
|
|
4
|
+
export default cypressInitGenerator;
|
|
5
|
+
export declare const cypressInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cypressInitSchematic = exports.cypressInitGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const versions_1 = require("../../utils/versions");
|
|
7
|
+
const js_1 = require("@nx/js");
|
|
8
|
+
function setupE2ETargetDefaults(tree) {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
var _e, _f;
|
|
11
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
12
|
+
if (!nxJson.namedInputs) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
// E2e targets depend on all their project's sources + production sources of dependencies
|
|
16
|
+
(_a = nxJson.targetDefaults) !== null && _a !== void 0 ? _a : (nxJson.targetDefaults = {});
|
|
17
|
+
const productionFileSet = !!((_b = nxJson.namedInputs) === null || _b === void 0 ? void 0 : _b.production);
|
|
18
|
+
(_c = (_e = nxJson.targetDefaults).e2e) !== null && _c !== void 0 ? _c : (_e.e2e = {});
|
|
19
|
+
(_d = (_f = nxJson.targetDefaults.e2e).inputs) !== null && _d !== void 0 ? _d : (_f.inputs = [
|
|
20
|
+
'default',
|
|
21
|
+
productionFileSet ? '^production' : '^default',
|
|
22
|
+
]);
|
|
23
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
24
|
+
}
|
|
25
|
+
function updateDependencies(tree) {
|
|
26
|
+
(0, devkit_1.removeDependenciesFromPackageJson)(tree, ['@nrwl/cypress'], []);
|
|
27
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
28
|
+
['@nrwl/cypress']: versions_1.nxVersion,
|
|
29
|
+
cypress: versions_1.cypressVersion,
|
|
30
|
+
'@types/node': versions_1.typesNodeVersion,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function cypressInitGenerator(tree, options) {
|
|
34
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
setupE2ETargetDefaults(tree);
|
|
36
|
+
const tasks = [];
|
|
37
|
+
tasks.push(yield (0, js_1.initGenerator)(tree, Object.assign(Object.assign({}, options), { skipFormat: true })));
|
|
38
|
+
if (!options.skipPackageJson) {
|
|
39
|
+
tasks.push(updateDependencies(tree));
|
|
40
|
+
}
|
|
41
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
exports.cypressInitGenerator = cypressInitGenerator;
|
|
45
|
+
exports.default = cypressInitGenerator;
|
|
46
|
+
exports.cypressInitSchematic = (0, devkit_1.convertNxGenerator)(cypressInitGenerator);
|
|
47
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,uCASoB;AACpB,mDAI8B;AAE9B,+BAAuC;AAEvC,SAAS,sBAAsB,CAAC,IAAU;;;IACxC,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE;QACvB,OAAO;KACR;IAED,yFAAyF;IACzF,MAAA,MAAM,CAAC,cAAc,oCAArB,MAAM,CAAC,cAAc,GAAK,EAAE,EAAC;IAE7B,MAAM,iBAAiB,GAAG,CAAC,CAAC,CAAA,MAAA,MAAM,CAAC,WAAW,0CAAE,UAAU,CAAA,CAA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Init",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Add Cypress Configuration to the workspace",
|
|
6
|
+
"description": "Add Cypress Configuration to the workspace.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"skipPackageJson": {
|
|
10
|
+
"type": "boolean",
|
|
11
|
+
"default": false,
|
|
12
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
13
|
+
"x-priority": "internal"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
+
export declare function findCypressConfigs(tree: Tree, projectConfig: ProjectConfiguration, target: string, config: string): {
|
|
3
|
+
cypressConfigPathJson: string;
|
|
4
|
+
cypressConfigPathTs: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* update the existing cypress.json config to the new cypress.config.ts structure.
|
|
8
|
+
* return both the old and new configs
|
|
9
|
+
*/
|
|
10
|
+
export declare function createNewCypressConfig(tree: Tree, projectConfig: ProjectConfiguration, cypressConfigPathJson: string): {
|
|
11
|
+
cypressConfigTs: Record<string, any>;
|
|
12
|
+
cypressConfigJson: Record<string, any>;
|
|
13
|
+
};
|
|
14
|
+
export declare function createSupportFileImport(oldSupportFilePath: string, newSupportFilePath: string, projectSourceRoot: string): {
|
|
15
|
+
oldImportPathLeaf: string;
|
|
16
|
+
newImportPathLeaf: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function updateProjectPaths(tree: Tree, projectConfig: ProjectConfiguration, { cypressConfigTs, cypressConfigJson, }: {
|
|
19
|
+
cypressConfigTs: Record<string, any>;
|
|
20
|
+
cypressConfigJson: Record<string, any>;
|
|
21
|
+
}): void;
|
|
22
|
+
export declare function updateImports(tree: Tree, filePath: string, oldImportPath: string, newImportPath: string): void;
|
|
23
|
+
export declare function writeNewConfig(tree: Tree, cypressConfigPathTs: string, cypressConfigs: {
|
|
24
|
+
cypressConfigTs: Record<string, any>;
|
|
25
|
+
cypressConfigJson: Record<string, any>;
|
|
26
|
+
}): void;
|
|
27
|
+
export declare function addConfigToTsConfig(tree: Tree, tsconfigPath: string, cypressConfigPath: string): void;
|
|
28
|
+
export declare function updatePluginFile(tree: Tree, projectConfig: ProjectConfiguration, cypressConfigs: {
|
|
29
|
+
cypressConfigTs: Record<string, any>;
|
|
30
|
+
cypressConfigJson: Record<string, any>;
|
|
31
|
+
}): {
|
|
32
|
+
cypressConfigTs: Record<string, any>;
|
|
33
|
+
cypressConfigJson: Record<string, any>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePluginFile = exports.addConfigToTsConfig = exports.writeNewConfig = exports.updateImports = exports.updateProjectPaths = exports.createSupportFileImport = exports.createNewCypressConfig = exports.findCypressConfigs = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
8
|
+
let tsModule;
|
|
9
|
+
let tsquery;
|
|
10
|
+
const validFilesEndingsToUpdate = [
|
|
11
|
+
'.js',
|
|
12
|
+
'.jsx',
|
|
13
|
+
'.ts',
|
|
14
|
+
'.tsx',
|
|
15
|
+
'.mjs',
|
|
16
|
+
'.cjs',
|
|
17
|
+
];
|
|
18
|
+
function findCypressConfigs(tree, projectConfig, target, config) {
|
|
19
|
+
var _a, _b, _c, _d, _e;
|
|
20
|
+
const cypressConfigPathJson = ((_c = (_b = (_a = projectConfig.targets[target]) === null || _a === void 0 ? void 0 : _a.configurations) === null || _b === void 0 ? void 0 : _b[config]) === null || _c === void 0 ? void 0 : _c.cypressConfig) ||
|
|
21
|
+
((_e = (_d = projectConfig.targets[target]) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.cypressConfig);
|
|
22
|
+
// make sure it's a json file, since it could have been updated to ts file from previous configuration migration
|
|
23
|
+
if (!cypressConfigPathJson || (0, path_1.extname)(cypressConfigPathJson) !== '.json') {
|
|
24
|
+
return {
|
|
25
|
+
cypressConfigPathJson: null,
|
|
26
|
+
cypressConfigPathTs: null,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const cypressConfigPathTs = (0, devkit_1.joinPathFragments)((0, path_1.dirname)(cypressConfigPathJson),
|
|
30
|
+
// create matching ts config for custom cypress config if present
|
|
31
|
+
(cypressConfigPathJson === null || cypressConfigPathJson === void 0 ? void 0 : cypressConfigPathJson.endsWith('cypress.json'))
|
|
32
|
+
? 'cypress.config.ts' //default
|
|
33
|
+
: `${(0, path_1.basename)(cypressConfigPathJson, (0, path_1.extname)(cypressConfigPathJson))}.config.ts`);
|
|
34
|
+
return {
|
|
35
|
+
cypressConfigPathJson,
|
|
36
|
+
cypressConfigPathTs,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
exports.findCypressConfigs = findCypressConfigs;
|
|
40
|
+
/**
|
|
41
|
+
* update the existing cypress.json config to the new cypress.config.ts structure.
|
|
42
|
+
* return both the old and new configs
|
|
43
|
+
*/
|
|
44
|
+
function createNewCypressConfig(tree, projectConfig, cypressConfigPathJson) {
|
|
45
|
+
const cypressConfigJson = (0, devkit_1.readJson)(tree, cypressConfigPathJson);
|
|
46
|
+
const { modifyObstructiveCode = null, // no longer needed in configs
|
|
47
|
+
integrationFolder = 'src/e2e', // provide the new defaults if the value isn't present
|
|
48
|
+
supportFile = 'src/support/e2e.ts' } = cypressConfigJson, restOfConfig = tslib_1.__rest(cypressConfigJson, ["modifyObstructiveCode", "integrationFolder", "supportFile"]);
|
|
49
|
+
const newIntegrationFolder = tree.exists((0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'integration'))
|
|
50
|
+
? 'src/e2e'
|
|
51
|
+
: integrationFolder;
|
|
52
|
+
const cypressConfigTs = {
|
|
53
|
+
e2e: Object.assign(Object.assign({}, restOfConfig), { specPattern: `${newIntegrationFolder}/**/*.cy.{js,jsx,ts,tsx}`,
|
|
54
|
+
// if supportFile is defined (can be false if not using it) and in the default location (or in the new default location),
|
|
55
|
+
// then use the new default location.
|
|
56
|
+
// otherwise we will use the existing folder location/falsey value
|
|
57
|
+
supportFile: (supportFile &&
|
|
58
|
+
tree.exists((0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'index.ts'))) ||
|
|
59
|
+
tree.exists((0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'e2e.ts'))
|
|
60
|
+
? 'src/support/e2e.ts'
|
|
61
|
+
: supportFile,
|
|
62
|
+
// if the default location is used then will update to the new location otherwise keep the custom location
|
|
63
|
+
// this is used down the line, but won't be in the final config file since it's a deprecated option
|
|
64
|
+
integrationFolder: newIntegrationFolder }),
|
|
65
|
+
};
|
|
66
|
+
return { cypressConfigTs, cypressConfigJson };
|
|
67
|
+
}
|
|
68
|
+
exports.createNewCypressConfig = createNewCypressConfig;
|
|
69
|
+
function createSupportFileImport(oldSupportFilePath, newSupportFilePath, projectSourceRoot) {
|
|
70
|
+
// need to get the new import path for the support file.
|
|
71
|
+
// before it was "<relative path>/support/index.ts" and the new path will be "<relative path>/support/e2e.ts"
|
|
72
|
+
// i.e. take ../support => ../support/e2e.ts
|
|
73
|
+
// 1. take apps/app-e2e/support/index.ts => support (this cant have a / in it. must grab the leaf for tsquery)
|
|
74
|
+
// 2. if the leaf value is index.ts then grab the parent directory (i.e. so we have support/index.ts => support)
|
|
75
|
+
// 3. take apps/app-e2e/support/e2e.ts => support/e2e
|
|
76
|
+
// apps/app-e2e/support/e2e.ts => support/e2e
|
|
77
|
+
const newFileExt = (0, path_1.extname)(newSupportFilePath);
|
|
78
|
+
const newImportPathLeaf = (0, path_1.relative)(projectSourceRoot, newSupportFilePath).replace(newFileExt, '');
|
|
79
|
+
// apps/app-e2e/support/index.ts => support/index
|
|
80
|
+
const oldFileExt = (0, path_1.extname)(oldSupportFilePath);
|
|
81
|
+
const oldImportPathLeaf = (0, path_1.relative)(projectSourceRoot, oldSupportFilePath).replace(oldFileExt, '');
|
|
82
|
+
// support/index => support
|
|
83
|
+
const oldRelativeImportPath = (0, path_1.basename)(oldImportPathLeaf, oldFileExt);
|
|
84
|
+
return {
|
|
85
|
+
newImportPathLeaf,
|
|
86
|
+
// don't import from 'support/index' it's just 'support'
|
|
87
|
+
oldImportPathLeaf: oldRelativeImportPath === 'index'
|
|
88
|
+
? (0, path_1.dirname)(oldImportPathLeaf)
|
|
89
|
+
: oldImportPathLeaf,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
exports.createSupportFileImport = createSupportFileImport;
|
|
93
|
+
function updateProjectPaths(tree, projectConfig, { cypressConfigTs, cypressConfigJson, }) {
|
|
94
|
+
const { integrationFolder, supportFile } = cypressConfigTs['e2e'];
|
|
95
|
+
const oldIntegrationFolder = (0, devkit_1.joinPathFragments)(projectConfig.root, cypressConfigJson.integrationFolder);
|
|
96
|
+
const newIntegrationFolder = (0, devkit_1.joinPathFragments)(projectConfig.root, integrationFolder);
|
|
97
|
+
let newSupportFile;
|
|
98
|
+
let oldSupportFile;
|
|
99
|
+
let oldImportLeafPath;
|
|
100
|
+
let newImportLeafPath;
|
|
101
|
+
let shouldUpdateSupportFileImports = false;
|
|
102
|
+
// supportFile can be falsey or a string path to the file
|
|
103
|
+
if (cypressConfigJson.supportFile) {
|
|
104
|
+
// we need to check the test files to see if
|
|
105
|
+
// support file import is used and then update it if so
|
|
106
|
+
shouldUpdateSupportFileImports = true;
|
|
107
|
+
oldSupportFile = (0, devkit_1.joinPathFragments)(projectConfig.root, cypressConfigJson.supportFile);
|
|
108
|
+
newSupportFile = (0, devkit_1.joinPathFragments)(projectConfig.root, supportFile);
|
|
109
|
+
// oldSupportFile might have already been updated
|
|
110
|
+
// to the new default location so must be guarded for
|
|
111
|
+
if (oldSupportFile !== newSupportFile && tree.exists(oldSupportFile)) {
|
|
112
|
+
tree.rename(oldSupportFile, newSupportFile);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
shouldUpdateSupportFileImports = false;
|
|
117
|
+
newSupportFile = supportFile;
|
|
118
|
+
// rename the default support file even if not in use to keep the system in sync with cypress v10
|
|
119
|
+
const defaultSupportFile = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'index.ts');
|
|
120
|
+
if (tree.exists(defaultSupportFile)) {
|
|
121
|
+
const newSupportDefaultPath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'support', 'e2e.ts');
|
|
122
|
+
if (defaultSupportFile !== newSupportDefaultPath &&
|
|
123
|
+
tree.exists(defaultSupportFile)) {
|
|
124
|
+
tree.rename(defaultSupportFile, newSupportDefaultPath);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (shouldUpdateSupportFileImports) {
|
|
129
|
+
const newImportPaths = createSupportFileImport(oldSupportFile, newSupportFile, projectConfig.sourceRoot);
|
|
130
|
+
oldImportLeafPath = newImportPaths.oldImportPathLeaf;
|
|
131
|
+
newImportLeafPath = newImportPaths.newImportPathLeaf;
|
|
132
|
+
}
|
|
133
|
+
// tree.rename doesn't work on directories must update each file within
|
|
134
|
+
// the directory to the new directory
|
|
135
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, projectConfig.sourceRoot, (path) => {
|
|
136
|
+
const normalizedPath = (0, devkit_1.normalizePath)(path);
|
|
137
|
+
if (!normalizedPath.includes(oldIntegrationFolder)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const fileName = (0, path_1.basename)(normalizedPath);
|
|
141
|
+
let newPath = normalizedPath.replace(oldIntegrationFolder, newIntegrationFolder);
|
|
142
|
+
if (fileName.includes('.spec.')) {
|
|
143
|
+
newPath = newPath.replace('.spec.', '.cy.');
|
|
144
|
+
}
|
|
145
|
+
if (newPath !== normalizedPath && tree.exists(normalizedPath)) {
|
|
146
|
+
tree.rename(normalizedPath, newPath);
|
|
147
|
+
}
|
|
148
|
+
// if they weren't using the supportFile then there is no need to update the imports.
|
|
149
|
+
if (shouldUpdateSupportFileImports &&
|
|
150
|
+
validFilesEndingsToUpdate.some((e) => path.endsWith(e))) {
|
|
151
|
+
updateImports(tree, newPath, oldImportLeafPath, newImportLeafPath);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
if (tree.children(oldIntegrationFolder).length === 0) {
|
|
155
|
+
tree.delete(oldIntegrationFolder);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.updateProjectPaths = updateProjectPaths;
|
|
159
|
+
function updateImports(tree, filePath, oldImportPath, newImportPath) {
|
|
160
|
+
if (!tsModule) {
|
|
161
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
162
|
+
}
|
|
163
|
+
if (!tsquery) {
|
|
164
|
+
(0, ensure_typescript_1.ensureTypescript)();
|
|
165
|
+
tsquery = require('@phenomnomnominal/tsquery').tsquery;
|
|
166
|
+
}
|
|
167
|
+
const { isCallExpression, isExportDeclaration, isImportDeclaration } = tsModule;
|
|
168
|
+
const endOfImportSelector = `StringLiteral[value=/${oldImportPath}$/]`;
|
|
169
|
+
const fileContent = tree.read(filePath, 'utf-8');
|
|
170
|
+
const newContent = tsquery.replace(fileContent, endOfImportSelector, (node) => {
|
|
171
|
+
// if node.parent is an CallExpression require() ||ImportDeclaration
|
|
172
|
+
if ((node === null || node === void 0 ? void 0 : node.parent) &&
|
|
173
|
+
(isCallExpression(node.parent) ||
|
|
174
|
+
isImportDeclaration(node.parent) ||
|
|
175
|
+
isExportDeclaration(node.parent))) {
|
|
176
|
+
return `'${node.text.replace(oldImportPath, newImportPath)}'`;
|
|
177
|
+
}
|
|
178
|
+
return node.text;
|
|
179
|
+
});
|
|
180
|
+
tree.write(filePath, newContent);
|
|
181
|
+
}
|
|
182
|
+
exports.updateImports = updateImports;
|
|
183
|
+
function writeNewConfig(tree, cypressConfigPathTs, cypressConfigs) {
|
|
184
|
+
// remove deprecated configs options
|
|
185
|
+
const _a = cypressConfigs.cypressConfigTs.e2e, { pluginsFile = false, integrationFolder = '' } = _a, restOfConfig = tslib_1.__rest(_a, ["pluginsFile", "integrationFolder"]);
|
|
186
|
+
const pluginImport = pluginsFile
|
|
187
|
+
? `import setupNodeEvents from '${pluginsFile}';`
|
|
188
|
+
: '';
|
|
189
|
+
const convertedConfig = JSON.stringify(restOfConfig, null, 2);
|
|
190
|
+
tree.write(cypressConfigPathTs, (0, devkit_1.stripIndents) `
|
|
191
|
+
import { defineConfig } from 'cypress'
|
|
192
|
+
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
|
|
193
|
+
${pluginImport}
|
|
194
|
+
|
|
195
|
+
const cypressJsonConfig = ${convertedConfig}
|
|
196
|
+
export default defineConfig({
|
|
197
|
+
e2e: {
|
|
198
|
+
...nxE2EPreset(__dirname),
|
|
199
|
+
...cypressJsonConfig,
|
|
200
|
+
${pluginsFile ? 'setupNodeEvents' : ''}
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
`);
|
|
204
|
+
}
|
|
205
|
+
exports.writeNewConfig = writeNewConfig;
|
|
206
|
+
function addConfigToTsConfig(tree, tsconfigPath, cypressConfigPath) {
|
|
207
|
+
if (tree.exists(tsconfigPath)) {
|
|
208
|
+
(0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
|
|
209
|
+
json.include = Array.from(new Set([
|
|
210
|
+
...(json.include || []),
|
|
211
|
+
(0, path_1.relative)((0, path_1.dirname)(tsconfigPath), cypressConfigPath),
|
|
212
|
+
]));
|
|
213
|
+
return json;
|
|
214
|
+
}, { expectComments: true });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
exports.addConfigToTsConfig = addConfigToTsConfig;
|
|
218
|
+
function updatePluginFile(tree, projectConfig, cypressConfigs) {
|
|
219
|
+
var _a, _b;
|
|
220
|
+
// if ts file change module.exports = to export default
|
|
221
|
+
// if js file don't do anything
|
|
222
|
+
// update cypressConfigTs.e2e to remove file extension
|
|
223
|
+
const pluginsFile = (_b = (_a = cypressConfigs.cypressConfigTs) === null || _a === void 0 ? void 0 : _a.e2e) === null || _b === void 0 ? void 0 : _b.pluginsFile;
|
|
224
|
+
if (!pluginsFile) {
|
|
225
|
+
return cypressConfigs;
|
|
226
|
+
}
|
|
227
|
+
const ext = (0, path_1.extname)(pluginsFile);
|
|
228
|
+
const updatedCypressConfigs = Object.assign(Object.assign({}, cypressConfigs), { cypressConfigTs: {
|
|
229
|
+
e2e: Object.assign(Object.assign({}, cypressConfigs.cypressConfigTs.e2e), { pluginsFile: pluginsFile.replace(ext, '') }),
|
|
230
|
+
} });
|
|
231
|
+
const pluginFilePath = (0, devkit_1.joinPathFragments)(projectConfig.root, pluginsFile);
|
|
232
|
+
if (ext === '.ts' && tree.exists(pluginFilePath)) {
|
|
233
|
+
const pluginFileContent = tree.read(pluginFilePath, 'utf-8');
|
|
234
|
+
tree.write(pluginFilePath, pluginFileContent
|
|
235
|
+
.replace('module.exports =', 'export default')
|
|
236
|
+
.replace(/module\.exports\.(.*?)=/g, 'export const $1='));
|
|
237
|
+
}
|
|
238
|
+
return updatedCypressConfigs;
|
|
239
|
+
}
|
|
240
|
+
exports.updatePluginFile = updatePluginFile;
|
|
241
|
+
//# sourceMappingURL=conversion.util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversion.util.js","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/migrate-to-cypress-11/conversion.util.ts"],"names":[],"mappings":";;;;AAAA,uCASoB;AACpB,+BAA4D;AAE5D,qFAAiF;AAEjF,IAAI,QAAqC,CAAC;AAC1C,IAAI,OAA2D,CAAC;AAEhE,MAAM,yBAAyB,GAAG;IAChC,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,MAAM;CACP,CAAC;AAEF,SAAgB,kBAAk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aACd,OAAO,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;aAC7C,OAAO,CAAC,0BAA0B,EAAE,kBAAkB,CAAC,CAC3D,CAAC;KACH;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAxCD,4CAwCC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateCypressProject = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cypress_version_1 = require("../../utils/cypress-version");
|
|
6
|
+
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
8
|
+
const conversion_util_1 = require("./conversion.util");
|
|
9
|
+
function migrateCypressProject(tree) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
(0, cypress_version_1.assertMinimumCypressVersion)(8);
|
|
12
|
+
if ((0, cypress_version_1.installedCypressVersion)() >= 10) {
|
|
13
|
+
devkit_1.logger.info('NX This workspace is already using Cypress v10+');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// keep history of cypress configs as some workspaces share configs
|
|
17
|
+
// if we don't have the already migrated configs
|
|
18
|
+
// it prevents us from being able to rename files for those projects
|
|
19
|
+
const previousCypressConfigs = new Map();
|
|
20
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/cypress:cypress', (currentValue, projectName, target, configuration) => {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
22
|
+
try {
|
|
23
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
24
|
+
const { cypressConfigPathJson, cypressConfigPathTs } = (0, conversion_util_1.findCypressConfigs)(tree, projectConfig, target, configuration);
|
|
25
|
+
if (!cypressConfigPathJson && !cypressConfigPathTs) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// a matching cypress ts file hasn't been made yet. need to migrate.
|
|
29
|
+
if (tree.exists(cypressConfigPathJson) &&
|
|
30
|
+
!tree.exists(cypressConfigPathTs)) {
|
|
31
|
+
let cypressConfigs = (0, conversion_util_1.createNewCypressConfig)(tree, projectConfig, cypressConfigPathJson);
|
|
32
|
+
cypressConfigs = (0, conversion_util_1.updatePluginFile)(tree, projectConfig, cypressConfigs);
|
|
33
|
+
(0, conversion_util_1.writeNewConfig)(tree, cypressConfigPathTs, cypressConfigs);
|
|
34
|
+
previousCypressConfigs.set(cypressConfigPathJson, cypressConfigs);
|
|
35
|
+
tree.delete(cypressConfigPathJson);
|
|
36
|
+
}
|
|
37
|
+
// ts file has been made and matching json file has been removed only need to update the project config
|
|
38
|
+
if (!tree.exists(cypressConfigPathJson) &&
|
|
39
|
+
tree.exists(cypressConfigPathTs)) {
|
|
40
|
+
const cypressConfigs = previousCypressConfigs.get(cypressConfigPathJson);
|
|
41
|
+
(0, conversion_util_1.updateProjectPaths)(tree, projectConfig, cypressConfigs);
|
|
42
|
+
(0, conversion_util_1.addConfigToTsConfig)(tree, (configuration
|
|
43
|
+
? (_d = (_c = (_b = (_a = projectConfig.targets) === null || _a === void 0 ? void 0 : _a[target]) === null || _b === void 0 ? void 0 : _b.configurations) === null || _c === void 0 ? void 0 : _c[configuration]) === null || _d === void 0 ? void 0 : _d.tsConfig
|
|
44
|
+
: (_g = (_f = (_e = projectConfig.targets) === null || _e === void 0 ? void 0 : _e[target]) === null || _f === void 0 ? void 0 : _f.options) === null || _g === void 0 ? void 0 : _g.tsConfig) ||
|
|
45
|
+
(0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json'), cypressConfigPathTs);
|
|
46
|
+
if (configuration) {
|
|
47
|
+
projectConfig.targets[target].configurations[configuration] = Object.assign(Object.assign({}, projectConfig.targets[target].configurations[configuration]), { cypressConfig: cypressConfigPathTs });
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
projectConfig.targets[target].options = Object.assign(Object.assign({}, projectConfig.targets[target].options), { cypressConfig: cypressConfigPathTs });
|
|
51
|
+
}
|
|
52
|
+
projectConfig.targets[target].options.testingType = 'e2e';
|
|
53
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfig);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
devkit_1.logger.error((0, devkit_1.stripIndents) `
|
|
58
|
+
NX There was an error converting ${projectName}:${target}.
|
|
59
|
+
You can manually update the project by following the migration guide if need be.
|
|
60
|
+
https://nx.dev/cypress/v10-migration-guide
|
|
61
|
+
`);
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
66
|
+
json.devDependencies['cypress'] = '^11.2.0';
|
|
67
|
+
return json;
|
|
68
|
+
});
|
|
69
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
70
|
+
if (tree.exists('cypress.json')) {
|
|
71
|
+
devkit_1.logger.warn((0, devkit_1.stripIndents) `A root cypress.json file was found.
|
|
72
|
+
You should remove this file as it will cause an error when running Cypress.
|
|
73
|
+
If you want to share options between Cypress projects.
|
|
74
|
+
You can create a root ts file and import it into each project's cypress config file.
|
|
75
|
+
More Info: https://github.com/nrwl/nx/issues/11512#issuecomment-1213420638
|
|
76
|
+
`);
|
|
77
|
+
}
|
|
78
|
+
return () => {
|
|
79
|
+
(0, devkit_1.installPackagesTask)(tree);
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
exports.migrateCypressProject = migrateCypressProject;
|
|
84
|
+
exports.default = migrateCypressProject;
|
|
85
|
+
//# sourceMappingURL=migrate-to-cypress-11.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-to-cypress-11.js","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/migrate-to-cypress-11/migrate-to-cypress-11.ts"],"names":[],"mappings":";;;;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,eAAM,CAAC,KAAK,CAAC,IAAA,qBAAY,EAAA;mCACE,WAAW,IAAI,MAAM;;;GAGrD,CAAC,CAAC;gBACG,MAAM,CAAC,CAAC;aACT;QACH,CAAC,CACF,CAAC;QAEF,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,EAAE;YACxC,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;QAEH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;YAC/B,eAAM,CAAC,IAAI,CAAC,IAAA,qBAAY,EAAA;;;;;KAKvB,CAAC,CAAC;SACJ;QACD,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AAhHD,sDAgHC;AAED,kBAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "NxCypressMigrateTo11",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Migrate e2e project to Cypress 11",
|
|
6
|
+
"description": "Migrate Cypress e2e project from v8/v9 to Cypress v11.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g @nrwl/cypress:migrate-to-cypress-11",
|
|
11
|
+
"description": "Migrate existing cypress projects to Cypress v11"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {}
|
|
15
|
+
}
|