@nx/playwright 20.4.0-canary.20250115-0ae8665 → 20.4.0-canary.20250117-cba25da

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.20250115-0ae8665",
3
+ "version": "20.4.0-canary.20250117-cba25da",
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.20250115-0ae8665",
39
- "@nx/eslint": "20.4.0-canary.20250115-0ae8665",
40
- "@nx/webpack": "20.4.0-canary.20250115-0ae8665",
41
- "@nx/vite": "20.4.0-canary.20250115-0ae8665",
42
- "@nx/js": "20.4.0-canary.20250115-0ae8665",
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",
43
43
  "tslib": "^2.3.0",
44
44
  "minimatch": "9.0.3"
45
45
  },
@@ -36,7 +36,36 @@ async function configurationGeneratorInternal(tree, rawOptions) {
36
36
  });
37
37
  const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree);
38
38
  const tsconfigPath = (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json');
39
- if (!tree.exists(tsconfigPath)) {
39
+ if (tree.exists(tsconfigPath)) {
40
+ if (isTsSolutionSetup) {
41
+ const tsconfig = {
42
+ extends: (0, js_1.getRelativePathToRootTsConfig)(tree, projectConfig.root),
43
+ compilerOptions: {
44
+ allowJs: true,
45
+ outDir: 'out-tsc/playwright',
46
+ sourceMap: false,
47
+ },
48
+ include: [
49
+ (0, devkit_1.joinPathFragments)(options.directory, '**/*.ts'),
50
+ (0, devkit_1.joinPathFragments)(options.directory, '**/*.js'),
51
+ 'playwright.config.ts',
52
+ ],
53
+ exclude: ['out-tsc', 'test-output'],
54
+ };
55
+ // skip eslint from typechecking since it extends from root file that is outside rootDir
56
+ if (options.linter === 'eslint') {
57
+ tsconfig.exclude.push('eslint.config.js', 'eslint.config.mjs', 'eslint.config.cjs');
58
+ }
59
+ (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.e2e.json'), tsconfig);
60
+ (0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
61
+ // add the project tsconfig to the workspace root tsconfig.json references
62
+ json.references ??= [];
63
+ json.references.push({ path: './tsconfig.e2e.json' });
64
+ return json;
65
+ });
66
+ }
67
+ }
68
+ else {
40
69
  const tsconfig = {
41
70
  extends: (0, js_1.getRelativePathToRootTsConfig)(tree, projectConfig.root),
42
71
  compilerOptions: {
@@ -1,7 +1,6 @@
1
1
  import { defineConfig, devices } from '@playwright/test';
2
2
  import { nxE2EPreset } from '@nx/playwright/preset';
3
- <% if(!webServerCommand || !webServerAddress) { %>// eslint-disable-next-line @typescript-eslint/no-unused-vars <% } %>
4
- import { workspaceRoot } from '@nx/devkit';
3
+ <% if (webServerCommand && webServerAddress) { %>import { workspaceRoot } from '@nx/devkit';<% } %>
5
4
 
6
5
  // For CI, you may want to set BASE_URL to the deployed application.
7
6
  const baseURL = process.env['BASE_URL'] || '<% if(webServerAddress) {%><%= webServerAddress %><% } else {%>http://localhost:3000<% } %>';