@nx/cypress 18.0.2 → 18.0.4

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": "18.0.2",
3
+ "version": "18.0.4",
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,14 @@
34
34
  "migrations": "./migrations.json"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "18.0.2",
38
- "@nx/eslint": "18.0.2",
39
- "@nx/js": "18.0.2",
37
+ "@nx/devkit": "18.0.4",
38
+ "@nx/eslint": "18.0.4",
39
+ "@nx/js": "18.0.4",
40
40
  "@phenomnomnominal/tsquery": "~5.0.1",
41
41
  "detect-port": "^1.5.1",
42
42
  "semver": "^7.5.3",
43
43
  "tslib": "^2.3.0",
44
- "@nrwl/cypress": "18.0.2"
44
+ "@nrwl/cypress": "18.0.4"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "cypress": ">= 3 < 14"
@@ -5,7 +5,7 @@ const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const fs_1 = require("fs");
7
7
  const preprocessor_vite_1 = require("../src/plugins/preprocessor-vite");
8
- const symbols_1 = require("../src/utils/symbols");
8
+ const constants_1 = require("../src/utils/constants");
9
9
  const child_process_1 = require("child_process");
10
10
  const http_1 = require("http");
11
11
  const https_1 = require("https");
@@ -30,13 +30,18 @@ function nxBaseCypressPreset(pathToConfig, options) {
30
30
  }
31
31
  exports.nxBaseCypressPreset = nxBaseCypressPreset;
32
32
  function startWebServer(webServerCommand) {
33
- const serverProcess = (0, child_process_1.exec)(webServerCommand, {
33
+ const serverProcess = (0, child_process_1.spawn)(webServerCommand, {
34
34
  cwd: devkit_1.workspaceRoot,
35
+ shell: true,
36
+ // Detaching the process on unix will create a process group, allowing us to kill it later
37
+ // Windows is fine so we leave it attached to this process
38
+ detached: process.platform !== 'win32',
39
+ stdio: 'inherit',
35
40
  });
36
- serverProcess.stdout.pipe(process.stdout);
37
- serverProcess.stderr.pipe(process.stderr);
38
41
  return () => {
39
- serverProcess.kill();
42
+ // child.kill() does not work on linux
43
+ // process.kill will kill the whole process group on unix
44
+ process.kill(-serverProcess.pid, 'SIGKILL');
40
45
  };
41
46
  }
42
47
  /**
@@ -64,7 +69,7 @@ function nxE2EPreset(pathToConfig, options) {
64
69
  supportFile: `${basePath}/support/e2e.{js,ts}`,
65
70
  specPattern: `${basePath}/**/*.cy.{js,jsx,ts,tsx}`,
66
71
  fixturesFolder: `${basePath}/fixtures`,
67
- [symbols_1.NX_PLUGIN_OPTIONS]: {
72
+ [constants_1.NX_PLUGIN_OPTIONS]: {
68
73
  webServerCommand: options?.webServerCommands?.default,
69
74
  webServerCommands: options?.webServerCommands,
70
75
  ciWebServerCommand: options?.ciWebServerCommand,
@@ -108,7 +113,7 @@ function waitForServer(url, webServerConfig) {
108
113
  return new Promise((resolve, reject) => {
109
114
  let pollTimeout;
110
115
  const { protocol } = new URL(url);
111
- const timeoutDuration = webServerConfig?.timeout ?? 10 * 1000;
116
+ const timeoutDuration = webServerConfig?.timeout ?? 15 * 1000;
112
117
  const timeout = setTimeout(() => {
113
118
  clearTimeout(pollTimeout);
114
119
  reject(new Error(`Web server failed to start in ${timeoutDuration}ms. This can be configured in cypress.config.ts.`));
@@ -9,7 +9,7 @@ const fs_1 = require("fs");
9
9
  const workspace_context_1 = require("nx/src/utils/workspace-context");
10
10
  const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculate-hash-for-create-nodes");
11
11
  const cache_directory_1 = require("nx/src/utils/cache-directory");
12
- const symbols_1 = require("../utils/symbols");
12
+ const constants_1 = require("../utils/constants");
13
13
  const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
14
14
  const cachePath = (0, path_1.join)(cache_directory_1.projectGraphCacheDirectory, 'cypress.hash');
15
15
  const targetsCache = (0, fs_1.existsSync)(cachePath) ? readTargetsCache() : {};
@@ -95,7 +95,7 @@ function getOutputs(projectRoot, cypressConfig, testingType) {
95
95
  async function buildCypressTargets(configFilePath, projectRoot, options, context) {
96
96
  const cypressConfig = await (0, config_utils_1.loadConfigFile)((0, path_1.join)(context.workspaceRoot, configFilePath));
97
97
  const pluginPresetOptions = {
98
- ...cypressConfig.e2e?.[symbols_1.NX_PLUGIN_OPTIONS],
98
+ ...cypressConfig.e2e?.[constants_1.NX_PLUGIN_OPTIONS],
99
99
  ...cypressConfig.env,
100
100
  ...cypressConfig.e2e?.env,
101
101
  };
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Key used to store options used by the nx plugin for @nx/cypress.
3
3
  */
4
- export declare const NX_PLUGIN_OPTIONS: unique symbol;
4
+ export declare const NX_PLUGIN_OPTIONS = "__NxPluginOptions__";
@@ -4,4 +4,4 @@ exports.NX_PLUGIN_OPTIONS = void 0;
4
4
  /**
5
5
  * Key used to store options used by the nx plugin for @nx/cypress.
6
6
  */
7
- exports.NX_PLUGIN_OPTIONS = Symbol('Nx Plugin Options');
7
+ exports.NX_PLUGIN_OPTIONS = '__NxPluginOptions__';
@@ -5,5 +5,5 @@ export declare const cypressViteDevServerVersion = "^2.2.1";
5
5
  export declare const cypressVersion = "^13.0.0";
6
6
  export declare const cypressWebpackVersion = "^2.0.0";
7
7
  export declare const webpackHttpPluginVersion = "^5.5.0";
8
- export declare const viteVersion = "^5.0.0";
8
+ export declare const viteVersion = "~5.0.0";
9
9
  export declare const htmlWebpackPluginVersion = "^5.5.0";
@@ -8,5 +8,5 @@ exports.cypressViteDevServerVersion = '^2.2.1';
8
8
  exports.cypressVersion = '^13.0.0';
9
9
  exports.cypressWebpackVersion = '^2.0.0';
10
10
  exports.webpackHttpPluginVersion = '^5.5.0';
11
- exports.viteVersion = '^5.0.0';
11
+ exports.viteVersion = '~5.0.0';
12
12
  exports.htmlWebpackPluginVersion = '^5.5.0';