@nx/cypress 22.7.0-beta.1 → 22.7.0-beta.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/cypress",
3
- "version": "22.7.0-beta.1",
3
+ "version": "22.7.0-beta.2",
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": {
@@ -36,9 +36,9 @@
36
36
  "migrations": "./migrations.json"
37
37
  },
38
38
  "dependencies": {
39
- "@nx/devkit": "22.7.0-beta.1",
40
- "@nx/eslint": "22.7.0-beta.1",
41
- "@nx/js": "22.7.0-beta.1",
39
+ "@nx/devkit": "22.7.0-beta.2",
40
+ "@nx/eslint": "22.7.0-beta.2",
41
+ "@nx/js": "22.7.0-beta.2",
42
42
  "@phenomnomnominal/tsquery": "~6.1.4",
43
43
  "detect-port": "^1.5.1",
44
44
  "semver": "^7.6.3",
@@ -46,7 +46,7 @@
46
46
  "tslib": "^2.3.0"
47
47
  },
48
48
  "devDependencies": {
49
- "nx": "22.7.0-beta.1"
49
+ "nx": "22.7.0-beta.2"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "cypress": ">= 13 < 16"
@@ -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: false,
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: false,
54
+ windowsHide: true,
54
55
  });
55
56
  }
56
57
  catch (e) {
@@ -3,11 +3,12 @@ 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");
8
9
  const versions_1 = require("../../utils/versions");
9
10
  const base_setup_1 = require("../base-setup/base-setup");
10
- const init_1 = require("../init/init");
11
+ const init_1 = tslib_1.__importDefault(require("../init/init"));
11
12
  function componentConfigurationGenerator(tree, options) {
12
13
  return componentConfigurationGeneratorInternal(tree, {
13
14
  addPlugin: false,
@@ -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":"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,uBA4HzB"}
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"}
@@ -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', 'cypress', 'eslint-plugin-cypress/flat', false, false);
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: {},
@@ -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 detectPort = require("detect-port");
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 detectPort(freePort || normalizedPortValue);
90
+ freePort = await (0, detect_port_1.default)(freePort || normalizedPortValue);
90
91
  if (attemptToLockPort(freePort)) {
91
92
  break;
92
93
  }