@nx/cypress 22.7.0-beta.0 → 22.7.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.
- package/package.json +8 -9
- package/plugins/cypress-preset.d.ts +1 -1
- package/plugins/cypress-preset.d.ts.map +1 -1
- package/plugins/cypress-preset.js +4 -3
- package/src/generators/component-configuration/component-configuration.d.ts.map +1 -1
- package/src/generators/component-configuration/component-configuration.js +14 -1
- package/src/generators/configuration/configuration.js +2 -1
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +5 -5
- package/src/plugins/preprocessor-vite.d.ts +1 -1
- package/src/plugins/preprocessor-vite.d.ts.map +1 -1
- package/src/plugins/preprocessor-vite.js +2 -2
- package/src/utils/add-linter.d.ts.map +1 -1
- package/src/utils/add-linter.js +6 -1
- package/src/utils/config.js +36 -3
- package/src/utils/start-dev-server.js +3 -2
- package/project.json +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/cypress",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.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": {
|
|
@@ -22,7 +22,8 @@
|
|
|
22
22
|
"Testing"
|
|
23
23
|
],
|
|
24
24
|
"main": "./index.js",
|
|
25
|
-
"
|
|
25
|
+
"type": "commonjs",
|
|
26
|
+
"types": "./index.d.ts",
|
|
26
27
|
"author": "Victor Savkin",
|
|
27
28
|
"license": "MIT",
|
|
28
29
|
"bugs": {
|
|
@@ -36,9 +37,9 @@
|
|
|
36
37
|
"migrations": "./migrations.json"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@nx/devkit": "22.7.0-beta.
|
|
40
|
-
"@nx/eslint": "22.7.0-beta.
|
|
41
|
-
"@nx/js": "22.7.0-beta.
|
|
40
|
+
"@nx/devkit": "22.7.0-beta.10",
|
|
41
|
+
"@nx/eslint": "22.7.0-beta.10",
|
|
42
|
+
"@nx/js": "22.7.0-beta.10",
|
|
42
43
|
"@phenomnomnominal/tsquery": "~6.1.4",
|
|
43
44
|
"detect-port": "^1.5.1",
|
|
44
45
|
"semver": "^7.6.3",
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"tslib": "^2.3.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
|
-
"nx": "22.7.0-beta.
|
|
50
|
+
"nx": "22.7.0-beta.10"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"cypress": ">= 13 < 16"
|
|
@@ -58,7 +59,5 @@
|
|
|
58
59
|
},
|
|
59
60
|
"publishConfig": {
|
|
60
61
|
"access": "public"
|
|
61
|
-
}
|
|
62
|
-
"types": "./index.d.ts",
|
|
63
|
-
"type": "commonjs"
|
|
62
|
+
}
|
|
64
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress-preset.d.ts","sourceRoot":"","sources":["../../../../packages/cypress/plugins/cypress-preset.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cypress-preset.d.ts","sourceRoot":"","sources":["../../../../packages/cypress/plugins/cypress-preset.ts"],"names":[],"mappings":"AAUA,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAYxC,UAAU,iBAAiB;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;CAC5B;AAID,MAAM,WAAW,+BACf,SAAQ,IAAI,CAAC,yBAAyB,EAAE,SAAS,CAAC;CAAG;AAEvD,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE;IAAE,WAAW,EAAE,WAAW,GAAG,KAAK,CAAA;CAAE,GAC7C,iBAAiB,CAwBnB;AA6CD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CACzB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,yBAAyB,OAkEpC;AA0DD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;QAII;IACJ,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE3C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC;;OAEG;IACH,mBAAmB,CAAC,EAAE,YAAY,CAAC;CACpC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nxBaseCypressPreset = nxBaseCypressPreset;
|
|
4
4
|
exports.nxE2EPreset = nxE2EPreset;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
7
8
|
const child_process_1 = require("child_process");
|
|
@@ -9,7 +10,7 @@ const fs_1 = require("fs");
|
|
|
9
10
|
const http_1 = require("http");
|
|
10
11
|
const https_1 = require("https");
|
|
11
12
|
const path_1 = require("path");
|
|
12
|
-
const preprocessor_vite_1 = require("../src/plugins/preprocessor-vite");
|
|
13
|
+
const preprocessor_vite_1 = tslib_1.__importDefault(require("../src/plugins/preprocessor-vite"));
|
|
13
14
|
const constants_1 = require("../src/utils/constants");
|
|
14
15
|
const treeKill = require('tree-kill');
|
|
15
16
|
function nxBaseCypressPreset(pathToConfig, options) {
|
|
@@ -44,13 +45,13 @@ function startWebServer(webServerCommand) {
|
|
|
44
45
|
// Windows is fine so we leave it attached to this process
|
|
45
46
|
detached: process.platform !== 'win32',
|
|
46
47
|
stdio: 'inherit',
|
|
47
|
-
windowsHide:
|
|
48
|
+
windowsHide: true,
|
|
48
49
|
});
|
|
49
50
|
return async () => {
|
|
50
51
|
if (process.platform === 'win32') {
|
|
51
52
|
try {
|
|
52
53
|
(0, child_process_1.execSync)('taskkill /pid ' + serverProcess.pid + ' /T /F', {
|
|
53
|
-
windowsHide:
|
|
54
|
+
windowsHide: true,
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/component-configuration/component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/cypress/src/generators/component-configuration/component-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAIjB,oBAAoB,EAKpB,IAAI,EAIL,MAAM,YAAY,CAAC;AASpB,OAAO,EAAE,mCAAmC,EAAE,MAAM,UAAU,CAAC;AAI/D,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mCAAmC,8BAM7C;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mCAAmC,8BAwD7C;AAkHD,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,oBAAoB,QAsDpC;AAOD,eAAe,+BAA+B,CAAC"}
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.componentConfigurationGenerator = componentConfigurationGenerator;
|
|
4
4
|
exports.componentConfigurationGeneratorInternal = componentConfigurationGeneratorInternal;
|
|
5
5
|
exports.updateTsConfigForComponentTesting = updateTsConfigForComponentTesting;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
|
+
const semver_1 = require("semver");
|
|
8
10
|
const versions_1 = require("../../utils/versions");
|
|
9
11
|
const base_setup_1 = require("../base-setup/base-setup");
|
|
10
|
-
const init_1 = require("../init/init");
|
|
12
|
+
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
11
13
|
function componentConfigurationGenerator(tree, options) {
|
|
12
14
|
return componentConfigurationGeneratorInternal(tree, {
|
|
13
15
|
addPlugin: false,
|
|
@@ -16,6 +18,17 @@ function componentConfigurationGenerator(tree, options) {
|
|
|
16
18
|
}
|
|
17
19
|
async function componentConfigurationGeneratorInternal(tree, options) {
|
|
18
20
|
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'cypress', 'component-configuration');
|
|
21
|
+
// Cypress CT does not support Vite 8 yet (@cypress/vite-dev-server
|
|
22
|
+
// peer dep is ^5.0.0 || ^6.0.0 || ^7.0.0).
|
|
23
|
+
const viteVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'vite');
|
|
24
|
+
if (viteVersion) {
|
|
25
|
+
const viteMajor = (0, semver_1.major)((0, semver_1.coerce)(viteVersion));
|
|
26
|
+
if (viteMajor >= 8) {
|
|
27
|
+
throw new Error(`Cypress component testing does not yet support Vite ${viteMajor}. ` +
|
|
28
|
+
`Downgrade to Vite 7 or earlier to use Cypress component testing. ` +
|
|
29
|
+
`See: https://github.com/cypress-io/cypress/issues/33078`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
19
32
|
const tasks = [];
|
|
20
33
|
const opts = normalizeOptions(tree, options);
|
|
21
34
|
if (!(0, versions_1.getInstalledCypressMajorVersion)(tree)) {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
|
4
4
|
exports.configurationGeneratorInternal = configurationGeneratorInternal;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
8
|
const prompt_1 = require("@nx/devkit/src/generators/prompt");
|
|
@@ -14,7 +15,7 @@ const add_linter_1 = require("../../utils/add-linter");
|
|
|
14
15
|
const config_1 = require("../../utils/config");
|
|
15
16
|
const versions_1 = require("../../utils/versions");
|
|
16
17
|
const base_setup_1 = require("../base-setup/base-setup");
|
|
17
|
-
const init_1 = require("../init/init");
|
|
18
|
+
const init_1 = tslib_1.__importStar(require("../init/init"));
|
|
18
19
|
function configurationGenerator(tree, options) {
|
|
19
20
|
return configurationGeneratorInternal(tree, {
|
|
20
21
|
addPlugin: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,oBAAoB;IACnC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,4BAA4B,CAAC,EAAE,MAAM,CAAC;CACvC;AAcD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,oBAAoB,CAwB3D,CAAC;AAEF,eAAO,MAAM,aAAa,qCAAc,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -24,15 +24,15 @@ const defaultPatterns = {
|
|
|
24
24
|
excludeSpecPattern: ['/snapshots/*', '/image_snapshots/*'],
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
28
27
|
exports.createNodes = [
|
|
29
28
|
cypressConfigGlob,
|
|
30
29
|
async (configFiles, options, context) => {
|
|
31
30
|
const optionsHash = (0, devkit_internals_1.hashObject)(options);
|
|
32
31
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `cypress-${optionsHash}.hash`);
|
|
33
32
|
const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
|
|
33
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
34
34
|
try {
|
|
35
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache), configFiles, options, context);
|
|
35
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFiles, options, context);
|
|
36
36
|
}
|
|
37
37
|
finally {
|
|
38
38
|
pluginCache.writeToDisk(cachePath);
|
|
@@ -40,7 +40,7 @@ exports.createNodes = [
|
|
|
40
40
|
},
|
|
41
41
|
];
|
|
42
42
|
exports.createNodesV2 = exports.createNodes;
|
|
43
|
-
async function createNodesInternal(configFilePath, options, context, pluginCache) {
|
|
43
|
+
async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
|
|
44
44
|
options = normalizeOptions(options);
|
|
45
45
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
|
46
46
|
// Do not create a project if package.json and project.json isn't there.
|
|
@@ -51,7 +51,7 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
|
|
|
51
51
|
}
|
|
52
52
|
const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
53
53
|
if (!pluginCache.has(hash)) {
|
|
54
|
-
pluginCache.set(hash, await buildCypressTargets(configFilePath, projectRoot, options, context));
|
|
54
|
+
pluginCache.set(hash, await buildCypressTargets(configFilePath, projectRoot, options, context, pmc));
|
|
55
55
|
}
|
|
56
56
|
const { targets, metadata } = pluginCache.get(hash);
|
|
57
57
|
const project = {
|
|
@@ -140,7 +140,7 @@ function getOutputs(projectRoot, cypressConfig, testingType) {
|
|
|
140
140
|
}
|
|
141
141
|
return outputs;
|
|
142
142
|
}
|
|
143
|
-
async function buildCypressTargets(configFilePath, projectRoot, options, context) {
|
|
143
|
+
async function buildCypressTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
144
144
|
const cypressConfig = await (0, config_utils_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
|
|
145
145
|
const pluginPresetOptions = {
|
|
146
146
|
...cypressConfig.e2e?.[constants_1.NX_PLUGIN_OPTIONS],
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
23
23
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
**/
|
|
25
|
-
|
|
25
|
+
type InlineConfig = Record<string, any>;
|
|
26
26
|
type CypressPreprocessor = (file: Record<string, any>) => string | Promise<string>;
|
|
27
27
|
/**
|
|
28
28
|
* Use Vite as a file preprocess for Cypress test files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preprocessor-vite.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/preprocessor-vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;IAuBI;
|
|
1
|
+
{"version":3,"file":"preprocessor-vite.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/plugins/preprocessor-vite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;IAuBI;AAMJ,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExC,KAAK,mBAAmB,GAAG,CACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACtB,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAI9B;;;;GAIG;AACH,iBAAS,gBAAgB,CACvB,eAAe,GAAE,YAAiB,GACjC,mBAAmB,CAkErB;AAUD,eAAe,gBAAgB,CAAC"}
|
|
@@ -61,10 +61,10 @@ function vitePreprocessor(configOverrides = {}) {
|
|
|
61
61
|
};
|
|
62
62
|
cache.set(filePath, outputPath);
|
|
63
63
|
const { build } = await Function('return import("vite")')();
|
|
64
|
-
const watcher =
|
|
64
|
+
const watcher = await build({
|
|
65
65
|
...defaultConfig,
|
|
66
66
|
...configOverrides,
|
|
67
|
-
})
|
|
67
|
+
});
|
|
68
68
|
return new Promise((resolve, reject) => {
|
|
69
69
|
if (shouldWatch && isWatcher(watcher)) {
|
|
70
70
|
watcher.on('event', (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAiBtE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;QAGI;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/cypress/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAiBtE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;;QAGI;IACJ,UAAU,EAAE,MAAM,CAAC;IACnB;;;QAGI;IACJ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,uBA8HzB"}
|
package/src/utils/add-linter.js
CHANGED
|
@@ -38,7 +38,12 @@ async function addLinterToCyProject(tree, options) {
|
|
|
38
38
|
(0, eslint_file_1.isEslintConfigSupported)(tree)) {
|
|
39
39
|
const overrides = [];
|
|
40
40
|
if ((0, flat_config_1.useFlatConfig)(tree)) {
|
|
41
|
-
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'recommended',
|
|
41
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'recommended', {
|
|
42
|
+
moduleName: 'cypress',
|
|
43
|
+
moduleImportPath: 'eslint-plugin-cypress/flat',
|
|
44
|
+
spread: false,
|
|
45
|
+
insertAtTheEnd: false,
|
|
46
|
+
});
|
|
42
47
|
(0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, {
|
|
43
48
|
files: ['*.ts', '*.js'],
|
|
44
49
|
rules: {},
|
package/src/utils/config.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.CYPRESS_CONFIG_FILE_NAME_PATTERN = void 0;
|
|
4
37
|
exports.addDefaultE2EConfig = addDefaultE2EConfig;
|
|
@@ -15,7 +48,7 @@ async function addDefaultE2EConfig(cyConfigContents, options, baseUrl) {
|
|
|
15
48
|
if (!cyConfigContents) {
|
|
16
49
|
throw new Error('The passed in cypress config file is empty!');
|
|
17
50
|
}
|
|
18
|
-
const { tsquery } = await Promise.resolve().then(() => require('@phenomnomnominal/tsquery'));
|
|
51
|
+
const { tsquery } = await Promise.resolve().then(() => __importStar(require('@phenomnomnominal/tsquery')));
|
|
19
52
|
const isCommonJS = tsquery.query(cyConfigContents, TS_QUERY_COMMON_JS_EXPORT_SELECTOR).length >
|
|
20
53
|
0;
|
|
21
54
|
const testingTypeConfig = tsquery.query(cyConfigContents, `${TS_QUERY_EXPORT_CONFIG_PREFIX} PropertyAssignment:has(Identifier[name="e2e"])`);
|
|
@@ -57,7 +90,7 @@ async function addDefaultCTConfig(cyConfigContents, options = {}) {
|
|
|
57
90
|
if (!cyConfigContents) {
|
|
58
91
|
throw new Error('The passed in cypress config file is empty!');
|
|
59
92
|
}
|
|
60
|
-
const { tsquery } = await Promise.resolve().then(() => require('@phenomnomnominal/tsquery'));
|
|
93
|
+
const { tsquery } = await Promise.resolve().then(() => __importStar(require('@phenomnomnominal/tsquery')));
|
|
61
94
|
const testingTypeConfig = tsquery.query(cyConfigContents, `${TS_QUERY_EXPORT_CONFIG_PREFIX} PropertyAssignment:has(Identifier[name="component"])`);
|
|
62
95
|
let updatedConfigContents = cyConfigContents;
|
|
63
96
|
if (testingTypeConfig.length === 0) {
|
|
@@ -94,7 +127,7 @@ async function addMountDefinition(cmpCommandFileContents) {
|
|
|
94
127
|
if (!cmpCommandFileContents) {
|
|
95
128
|
throw new Error('The passed in cypress component file is empty!');
|
|
96
129
|
}
|
|
97
|
-
const { tsquery } = await Promise.resolve().then(() => require('@phenomnomnominal/tsquery'));
|
|
130
|
+
const { tsquery } = await Promise.resolve().then(() => __importStar(require('@phenomnomnominal/tsquery')));
|
|
98
131
|
const hasMountCommand = tsquery.query(cmpCommandFileContents, 'CallExpression StringLiteral[value="mount"]')?.length > 0;
|
|
99
132
|
if (hasMountCommand) {
|
|
100
133
|
return cmpCommandFileContents;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.startDevServer = startDevServer;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const path_1 = require("path");
|
|
6
|
-
const
|
|
7
|
+
const detect_port_1 = tslib_1.__importDefault(require("detect-port"));
|
|
7
8
|
const executor_utils_1 = require("nx/src/command-line/run/executor-utils");
|
|
8
9
|
const fs_1 = require("fs");
|
|
9
10
|
const os_1 = require("os");
|
|
@@ -86,7 +87,7 @@ async function getPortForProject(context, target, defaultPort = 4200) {
|
|
|
86
87
|
// make sure when this check happens in parallel,
|
|
87
88
|
// we don't let the same port be used by multiple projects
|
|
88
89
|
do {
|
|
89
|
-
freePort = await
|
|
90
|
+
freePort = await (0, detect_port_1.default)(freePort || normalizedPortValue);
|
|
90
91
|
if (attemptToLockPort(freePort)) {
|
|
91
92
|
break;
|
|
92
93
|
}
|
package/project.json
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "cypress",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "packages/cypress",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
7
|
-
"build": {
|
|
8
|
-
"outputs": ["{workspaceRoot}/dist/packages/cypress/README.md"],
|
|
9
|
-
"command": "node ./scripts/copy-readme.js cypress",
|
|
10
|
-
"dependsOn": ["^build", "build-base", "legacy-post-build"]
|
|
11
|
-
},
|
|
12
|
-
"legacy-post-build": {
|
|
13
|
-
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
14
|
-
"options": {
|
|
15
|
-
"tsConfig": "./tsconfig.lib.json",
|
|
16
|
-
"assets": [
|
|
17
|
-
{
|
|
18
|
-
"input": "packages/cypress",
|
|
19
|
-
"glob": "**/files/**",
|
|
20
|
-
"output": "/"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"input": "packages/cypress",
|
|
24
|
-
"glob": "**/files/**/.gitkeep",
|
|
25
|
-
"output": "/"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"input": "packages/cypress",
|
|
29
|
-
"glob": "**/*.json",
|
|
30
|
-
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
|
31
|
-
"output": "/"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"input": "packages/cypress",
|
|
35
|
-
"glob": "**/*.js",
|
|
36
|
-
"ignore": ["**/jest.config.js"],
|
|
37
|
-
"output": "/"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"input": "packages/cypress",
|
|
41
|
-
"glob": "**/*.d.ts",
|
|
42
|
-
"output": "/"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"input": "packages/cypress",
|
|
46
|
-
"glob": "PLUGIN.md",
|
|
47
|
-
"output": "/"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"input": "",
|
|
51
|
-
"glob": "LICENSE",
|
|
52
|
-
"output": "/"
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|