@nx/playwright 20.5.0-beta.0 → 20.5.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/generators.json CHANGED
@@ -10,7 +10,8 @@
10
10
  "init": {
11
11
  "factory": "./src/generators/init/init#initGeneratorInternal",
12
12
  "schema": "./src/generators/init/schema.json",
13
- "description": "Initializes a Playwright project in the current workspace"
13
+ "description": "Initializes a Playwright project in the current workspace",
14
+ "hidden": true
14
15
  },
15
16
  "convert-to-inferred": {
16
17
  "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "20.5.0-beta.0",
3
+ "version": "20.5.0-beta.1",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -35,20 +35,26 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@phenomnomnominal/tsquery": "~5.0.1",
38
- "@nx/devkit": "20.5.0-beta.0",
39
- "@nx/eslint": "20.5.0-beta.0",
40
- "@nx/webpack": "20.5.0-beta.0",
41
- "@nx/vite": "20.5.0-beta.0",
42
- "@nx/js": "20.5.0-beta.0",
38
+ "@nx/devkit": "20.5.0-beta.1",
39
+ "@nx/eslint": "20.5.0-beta.1",
40
+ "@nx/js": "20.5.0-beta.1",
43
41
  "tslib": "^2.3.0",
44
42
  "minimatch": "9.0.3"
45
43
  },
46
44
  "peerDependencies": {
47
- "@playwright/test": "^1.36.0"
45
+ "@playwright/test": "^1.36.0",
46
+ "@nx/webpack": "file:../webpack",
47
+ "@nx/vite": "file:../vite"
48
48
  },
49
49
  "peerDependenciesMeta": {
50
50
  "@playwright/test": {
51
51
  "optional": true
52
+ },
53
+ "@nx/webpack": {
54
+ "optional": true
55
+ },
56
+ "@nx/vite": {
57
+ "optional": true
52
58
  }
53
59
  },
54
60
  "executors": "./executors.json",
@@ -7,8 +7,6 @@ const add_e2e_ci_target_defaults_1 = require("./add-e2e-ci-target-defaults");
7
7
  const loaded_nx_plugin_1 = require("nx/src/project-graph/plugins/loaded-nx-plugin");
8
8
  const retrieve_workspace_files_1 = require("nx/src/project-graph/utils/retrieve-workspace-files");
9
9
  const error_types_1 = require("nx/src/project-graph/error-types");
10
- const plugin_1 = require("@nx/webpack/src/plugins/plugin");
11
- const plugin_2 = require("@nx/vite/plugin");
12
10
  async function default_1(tree) {
13
11
  const graph = await (0, devkit_1.createProjectGraphAsync)();
14
12
  const collectedProjects = [];
@@ -86,8 +84,8 @@ async function default_1(tree) {
86
84
  : 'preview', projectToMigrate.configFileType === 'webpack'
87
85
  ? 'serveStaticTargetName'
88
86
  : 'previewTargetName', projectToMigrate.configFileType === 'webpack'
89
- ? plugin_1.createNodesV2
90
- : plugin_2.createNodesV2)) ??
87
+ ? (await getDynamicImportedModule('@nx/webpack/src/plugins/plugin', '@nx/webpack should be installed when attempting to setup @nx/playwright with a webpack config file.')).createNodesV2
88
+ : (await getDynamicImportedModule('@nx/vite/plugin', '@nx/vite should be installed when attempting to setup @nx/playwright with a vite config file.')).createNodesV2)) ??
91
89
  getServeStaticLikeTarget(tree, graph, projectToMigrate.projectName, projectToMigrate.configFileType === 'webpack'
92
90
  ? '@nx/web:file-server'
93
91
  : '@nx/vite:preview-server');
@@ -133,6 +131,14 @@ async function default_1(tree) {
133
131
  await (0, add_e2e_ci_target_defaults_1.default)(tree);
134
132
  await (0, devkit_1.formatFiles)(tree);
135
133
  }
134
+ async function getDynamicImportedModule(moduleName, error) {
135
+ try {
136
+ return (await Promise.resolve(`${moduleName}`).then(s => require(s)));
137
+ }
138
+ catch {
139
+ throw new Error(error);
140
+ }
141
+ }
136
142
  async function getServeStaticTargetNameForConfigFile(tree, pluginName, configFile, defaultTargetName, targetNamePluginOption, createNodesV2) {
137
143
  const nxJson = (0, devkit_1.readNxJson)(tree);
138
144
  const matchingPluginRegistrations = nxJson.plugins?.filter((p) => typeof p === 'string' ? p === pluginName : p.plugin === pluginName);