@nx/playwright 20.4.0-canary.20250117-cba25da → 20.4.0-canary.20250121-ee135b2

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/playwright",
3
- "version": "20.4.0-canary.20250117-cba25da",
3
+ "version": "20.4.0-canary.20250121-ee135b2",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
- "@nx/devkit": "20.4.0-canary.20250117-cba25da",
39
- "@nx/eslint": "20.4.0-canary.20250117-cba25da",
40
- "@nx/webpack": "20.4.0-canary.20250117-cba25da",
41
- "@nx/vite": "20.4.0-canary.20250117-cba25da",
42
- "@nx/js": "20.4.0-canary.20250117-cba25da",
38
+ "@nx/devkit": "20.4.0-canary.20250121-ee135b2",
39
+ "@nx/eslint": "20.4.0-canary.20250121-ee135b2",
40
+ "@nx/webpack": "20.4.0-canary.20250121-ee135b2",
41
+ "@nx/vite": "20.4.0-canary.20250121-ee135b2",
42
+ "@nx/js": "20.4.0-canary.20250121-ee135b2",
43
43
  "tslib": "^2.3.0",
44
44
  "minimatch": "9.0.3"
45
45
  },
@@ -4,6 +4,7 @@ exports.configurationGenerator = configurationGenerator;
4
4
  exports.configurationGeneratorInternal = configurationGeneratorInternal;
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
7
+ const prompt_1 = require("@nx/devkit/src/generators/prompt");
7
8
  const js_1 = require("@nx/js");
8
9
  const generator_prompts_1 = require("@nx/js/src/utils/generator-prompts");
9
10
  const package_manager_workspaces_1 = require("@nx/js/src/utils/package-manager-workspaces");
@@ -170,6 +171,11 @@ async function normalizeOptions(tree, options) {
170
171
  (process.env.NX_ADD_PLUGINS !== 'false' &&
171
172
  nxJson.useInferencePlugins !== false);
172
173
  const linter = await (0, generator_prompts_1.normalizeLinterOption)(tree, options.linter);
174
+ if (!options.webServerCommand || !options.webServerAddress) {
175
+ const { webServerCommand, webServerAddress } = await promptForMissingServeData(options.project);
176
+ options.webServerCommand = webServerCommand;
177
+ options.webServerAddress = webServerAddress;
178
+ }
173
179
  return {
174
180
  ...options,
175
181
  addPlugin,
@@ -177,6 +183,29 @@ async function normalizeOptions(tree, options) {
177
183
  directory: options.directory ?? 'e2e',
178
184
  };
179
185
  }
186
+ async function promptForMissingServeData(projectName) {
187
+ const { command, port } = await (0, prompt_1.promptWhenInteractive)([
188
+ {
189
+ type: 'input',
190
+ name: 'command',
191
+ message: 'What command should be run to serve the application locally?',
192
+ initial: `npx nx serve ${projectName}`,
193
+ },
194
+ {
195
+ type: 'numeral',
196
+ name: 'port',
197
+ message: 'What port will the application be served on?',
198
+ initial: 3000,
199
+ },
200
+ ], {
201
+ command: `npx nx serve ${projectName}`,
202
+ port: 3000,
203
+ });
204
+ return {
205
+ webServerCommand: command,
206
+ webServerAddress: `http://localhost:${port}`,
207
+ };
208
+ }
180
209
  function getBrowsersInstallTask() {
181
210
  return () => {
182
211
  devkit_1.output.log({
@@ -54,7 +54,7 @@ async function createNodesInternal(configFilePath, options, context, targetsCach
54
54
  return {};
55
55
  }
56
56
  const normalizedOptions = normalizeOptions(options);
57
- const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, options, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
57
+ const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, normalizedOptions, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
58
58
  targetsCache[hash] ??= await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context);
59
59
  const { targets, metadata } = targetsCache[hash];
60
60
  return {
@@ -227,8 +227,8 @@ function createMatcher(pattern) {
227
227
  function normalizeOptions(options) {
228
228
  return {
229
229
  ...options,
230
- targetName: options.targetName ?? 'e2e',
231
- ciTargetName: options.ciTargetName ?? 'e2e-ci',
230
+ targetName: options?.targetName ?? 'e2e',
231
+ ciTargetName: options?.ciTargetName ?? 'e2e-ci',
232
232
  };
233
233
  }
234
234
  function getTestOutput(playwrightConfig) {