@nx/playwright 22.7.0-pr.33655.2b96277 → 22.7.0-pr.33655.57246dd

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/executors.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
- "executors": {
3
- "playwright": {
4
- "implementation": "./src/executors/playwright/playwright.impl",
5
- "schema": "./src/executors/playwright/schema.json",
6
- "description": "Run Playwright tests."
7
- },
8
- "merge-reports": {
9
- "implementation": "./src/executors/merge-reports/merge-reports.impl",
10
- "schema": "./src/executors/merge-reports/schema.json",
11
- "description": "Merge Playwright blob reports to produce unified reports for the configured reporters (excluding the `blob` reporter).",
12
- "hidden": true
13
- }
2
+ "executors": {
3
+ "playwright": {
4
+ "implementation": "./src/executors/playwright/playwright.impl",
5
+ "schema": "./src/executors/playwright/schema.json",
6
+ "description": "Run Playwright tests."
7
+ },
8
+ "merge-reports": {
9
+ "implementation": "./src/executors/merge-reports/merge-reports.impl",
10
+ "schema": "./src/executors/merge-reports/schema.json",
11
+ "description": "Merge Playwright blob reports to produce unified reports for the configured reporters (excluding the `blob` reporter).",
12
+ "hidden": true
14
13
  }
14
+ }
15
15
  }
package/generators.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
- "name": "Nx Playwright",
3
- "version": "0.1",
4
- "generators": {
5
- "configuration": {
6
- "factory": "./src/generators/configuration/configuration#configurationGeneratorInternal",
7
- "schema": "./src/generators/configuration/schema.json",
8
- "description": "Add Nx Playwright configuration to your project"
9
- },
10
- "init": {
11
- "factory": "./src/generators/init/init#initGeneratorInternal",
12
- "schema": "./src/generators/init/schema.json",
13
- "description": "Initializes a Playwright project in the current workspace",
14
- "hidden": true
15
- },
16
- "convert-to-inferred": {
17
- "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
18
- "schema": "./src/generators/convert-to-inferred/schema.json",
19
- "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`."
20
- }
2
+ "name": "Nx Playwright",
3
+ "version": "0.1",
4
+ "generators": {
5
+ "configuration": {
6
+ "factory": "./src/generators/configuration/configuration#configurationGeneratorInternal",
7
+ "schema": "./src/generators/configuration/schema.json",
8
+ "description": "Add Nx Playwright configuration to your project"
9
+ },
10
+ "init": {
11
+ "factory": "./src/generators/init/init#initGeneratorInternal",
12
+ "schema": "./src/generators/init/schema.json",
13
+ "description": "Initializes a Playwright project in the current workspace",
14
+ "hidden": true
15
+ },
16
+ "convert-to-inferred": {
17
+ "factory": "./src/generators/convert-to-inferred/convert-to-inferred",
18
+ "schema": "./src/generators/convert-to-inferred/schema.json",
19
+ "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`."
21
20
  }
21
+ }
22
22
  }
package/migrations.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "generators": {}
2
+ "generators": {}
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/playwright",
3
- "version": "22.7.0-pr.33655.2b96277",
3
+ "version": "22.7.0-pr.33655.57246dd",
4
4
  "type": "commonjs",
5
5
  "homepage": "https://nx.dev",
6
6
  "private": false,
@@ -34,14 +34,14 @@
34
34
  "directory": "packages/playwright"
35
35
  },
36
36
  "dependencies": {
37
- "@nx/devkit": "22.7.0-pr.33655.2b96277",
38
- "@nx/eslint": "22.7.0-pr.33655.2b96277",
39
- "@nx/js": "22.7.0-pr.33655.2b96277",
37
+ "@nx/devkit": "22.7.0-pr.33655.57246dd",
38
+ "@nx/eslint": "22.7.0-pr.33655.57246dd",
39
+ "@nx/js": "22.7.0-pr.33655.57246dd",
40
40
  "tslib": "^2.3.0",
41
41
  "minimatch": "10.2.4"
42
42
  },
43
43
  "devDependencies": {
44
- "nx": "22.7.0-pr.33655.2b96277"
44
+ "nx": "22.7.0-pr.33655.57246dd"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@playwright/test": "^1.36.0"
@@ -1,22 +1,22 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Schema for Playwright Merge Reports Executor",
5
- "description": "Merge Playwright blob reports to produce unified reports for the configured reporters (excluding the `blob` reporter).",
6
- "type": "object",
7
- "properties": {
8
- "config": {
9
- "description": "The Playwright configuration file path. Relative to the project root.",
10
- "type": "string",
11
- "x-completion-type": "file",
12
- "x-completion-glob": "playwright?(*)@(.js|.cjs|.mjs|.ts|.cts|.mtx)",
13
- "x-priority": "important"
14
- },
15
- "expectedSuites": {
16
- "description": "The expected number of test suites to produce a report.",
17
- "type": "number",
18
- "x-priority": "important"
19
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Schema for Playwright Merge Reports Executor",
5
+ "description": "Merge Playwright blob reports to produce unified reports for the configured reporters (excluding the `blob` reporter).",
6
+ "type": "object",
7
+ "properties": {
8
+ "config": {
9
+ "description": "The Playwright configuration file path. Relative to the project root.",
10
+ "type": "string",
11
+ "x-completion-type": "file",
12
+ "x-completion-glob": "playwright?(*)@(.js|.cjs|.mjs|.ts|.cts|.mtx)",
13
+ "x-priority": "important"
20
14
  },
21
- "required": ["config"]
15
+ "expectedSuites": {
16
+ "description": "The expected number of test suites to produce a report.",
17
+ "type": "number",
18
+ "x-priority": "important"
19
+ }
20
+ },
21
+ "required": ["config"]
22
22
  }
@@ -1,165 +1,165 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Playwright executor",
5
- "description": "Run Playwright tests.",
6
- "type": "object",
7
- "properties": {
8
- "browser": {
9
- "type": "string",
10
- "description": "Browser to use for tests, one of 'all', 'chromium', 'firefox' or 'webkit'. If a playwright config is provided/discovered then the browserName value is expected from the configured 'projects'",
11
- "x-priority": "important"
12
- },
13
- "config": {
14
- "type": "string",
15
- "description": "Configuration file, or a test directory with optional",
16
- "x-completion-type": "file",
17
- "x-completion-glob": "playwright?(*)@(.js|.cjs|.mjs|.ts|.cts|.mtx)",
18
- "x-priority": "important"
19
- },
20
- "debug": {
21
- "type": "boolean",
22
- "description": "Run tests with Playwright Inspector. Shortcut for 'PWDEBUG=1' environment variable and '--timeout=0',--max-failures=1 --headed --workers=1' options"
23
- },
24
- "lastFailed": {
25
- "type": "boolean",
26
- "description": "Run only the tests that failed in the last run"
27
- },
28
- "forbidOnly": {
29
- "type": "boolean",
30
- "description": "Fail if test.only is called"
31
- },
32
- "fullyParallel": {
33
- "type": "boolean",
34
- "description": "Run all tests in parallel"
35
- },
36
- "grep": {
37
- "alias": "g",
38
- "type": "string",
39
- "description": "Only run tests matching this regular expression"
40
- },
41
- "globalTimeout": {
42
- "type": "number",
43
- "description": "Maximum time this test suite can run in milliseconds"
44
- },
45
- "grepInvert": {
46
- "alias": "gv",
47
- "type": "string",
48
- "description": "Only run tests that do not match this regular expression"
49
- },
50
- "testFiles": {
51
- "alias": "t",
52
- "type": "array",
53
- "description": "Test files to run",
54
- "items": {
55
- "type": "string"
56
- }
57
- },
58
- "headed": {
59
- "type": "boolean",
60
- "description": "Run tests in headed browsers",
61
- "x-priority": "important"
62
- },
63
- "ignoreSnapshots": {
64
- "type": "boolean",
65
- "description": "Ignore screenshot and snapshot expectations"
66
- },
67
- "workers": {
68
- "alias": "j",
69
- "oneOf": [{ "type": "number" }, { "type": "string" }],
70
- "description": "Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker"
71
- },
72
- "list": {
73
- "type": "boolean",
74
- "description": "Collect all the tests and report them, but do not run"
75
- },
76
- "maxFailures": {
77
- "alias": "x",
78
- "oneOf": [{ "type": "number" }, { "type": "boolean" }],
79
- "description": "Stop after the first N failures"
80
- },
81
- "noDeps": {
82
- "type": "boolean",
83
- "description": "Do not run project dependencies"
84
- },
85
- "output": {
86
- "type": "string",
87
- "description": "Folder for output artifacts"
88
- },
89
- "passWithNoTests": {
90
- "type": "boolean",
91
- "description": "Makes test run succeed even if no tests were found",
92
- "default": true
93
- },
94
- "project": {
95
- "description": "Only run tests from the specified list of projects",
96
- "type": "array",
97
- "items": {
98
- "type": "string"
99
- }
100
- },
101
- "quiet": {
102
- "alias": "q",
103
- "type": "boolean",
104
- "description": "Suppress stdio"
105
- },
106
- "repeatEach": {
107
- "type": "number",
108
- "description": "Run each test N times"
109
- },
110
- "reporter": {
111
- "type": "string",
112
- "description": "Common Reporter values to use, comma-separated, 'list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob'. To configure reporter options, use the playwright configuration."
113
- },
114
- "retries": {
115
- "type": "number",
116
- "description": "Maximum retry count for flaky tests, zero for no retries"
117
- },
118
- "shard": {
119
- "type": "string",
120
- "description": "Shard tests and execute only the selected shard, specify in the form 'current/all', 1-based, for example '3/5'"
121
- },
122
- "timeout": {
123
- "type": "number",
124
- "description": "Specify test timeout threshold in milliseconds, zero for unlimited"
125
- },
126
- "trace": {
127
- "type": "string",
128
- "enum": [
129
- "on",
130
- "off",
131
- "on-first-retry",
132
- "on-all-retries",
133
- "retain-on-failure"
134
- ],
135
- "description": "Force tracing mode, can be 'on', 'off', 'on-first-retry', 'on-all-retries', 'retain-on-failure'"
136
- },
137
- "updateSnapshots": {
138
- "alias": "u",
139
- "type": "boolean",
140
- "description": "Update snapshots with actual results. Snapshots will be created if missing."
141
- },
142
- "ui": {
143
- "type": "boolean",
144
- "description": "Run tests in interactive UI mode"
145
- },
146
- "uiHost": {
147
- "type": "string",
148
- "description": "Host to serve UI on; specifying this option opens UI in a browser tab"
149
- },
150
- "uiPort": {
151
- "type": "number",
152
- "description": "Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab"
153
- },
154
- "skipInstall": {
155
- "type": "boolean",
156
- "description": "Skip running playwright install before running playwright tests. This is to ensure that playwright browsers are installed before running tests.",
157
- "default": false
158
- },
159
- "cacheDir": {
160
- "type": "string",
161
- "description": "Directory for Playwright internal cache (browser binaries, etc.). Sets the PWTEST_CACHE_DIR environment variable."
162
- }
163
- },
164
- "required": []
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Playwright executor",
5
+ "description": "Run Playwright tests.",
6
+ "type": "object",
7
+ "properties": {
8
+ "browser": {
9
+ "type": "string",
10
+ "description": "Browser to use for tests, one of 'all', 'chromium', 'firefox' or 'webkit'. If a playwright config is provided/discovered then the browserName value is expected from the configured 'projects'",
11
+ "x-priority": "important"
12
+ },
13
+ "config": {
14
+ "type": "string",
15
+ "description": "Configuration file, or a test directory with optional",
16
+ "x-completion-type": "file",
17
+ "x-completion-glob": "playwright?(*)@(.js|.cjs|.mjs|.ts|.cts|.mtx)",
18
+ "x-priority": "important"
19
+ },
20
+ "debug": {
21
+ "type": "boolean",
22
+ "description": "Run tests with Playwright Inspector. Shortcut for 'PWDEBUG=1' environment variable and '--timeout=0',--max-failures=1 --headed --workers=1' options"
23
+ },
24
+ "lastFailed": {
25
+ "type": "boolean",
26
+ "description": "Run only the tests that failed in the last run"
27
+ },
28
+ "forbidOnly": {
29
+ "type": "boolean",
30
+ "description": "Fail if test.only is called"
31
+ },
32
+ "fullyParallel": {
33
+ "type": "boolean",
34
+ "description": "Run all tests in parallel"
35
+ },
36
+ "grep": {
37
+ "alias": "g",
38
+ "type": "string",
39
+ "description": "Only run tests matching this regular expression"
40
+ },
41
+ "globalTimeout": {
42
+ "type": "number",
43
+ "description": "Maximum time this test suite can run in milliseconds"
44
+ },
45
+ "grepInvert": {
46
+ "alias": "gv",
47
+ "type": "string",
48
+ "description": "Only run tests that do not match this regular expression"
49
+ },
50
+ "testFiles": {
51
+ "alias": "t",
52
+ "type": "array",
53
+ "description": "Test files to run",
54
+ "items": {
55
+ "type": "string"
56
+ }
57
+ },
58
+ "headed": {
59
+ "type": "boolean",
60
+ "description": "Run tests in headed browsers",
61
+ "x-priority": "important"
62
+ },
63
+ "ignoreSnapshots": {
64
+ "type": "boolean",
65
+ "description": "Ignore screenshot and snapshot expectations"
66
+ },
67
+ "workers": {
68
+ "alias": "j",
69
+ "oneOf": [{ "type": "number" }, { "type": "string" }],
70
+ "description": "Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker"
71
+ },
72
+ "list": {
73
+ "type": "boolean",
74
+ "description": "Collect all the tests and report them, but do not run"
75
+ },
76
+ "maxFailures": {
77
+ "alias": "x",
78
+ "oneOf": [{ "type": "number" }, { "type": "boolean" }],
79
+ "description": "Stop after the first N failures"
80
+ },
81
+ "noDeps": {
82
+ "type": "boolean",
83
+ "description": "Do not run project dependencies"
84
+ },
85
+ "output": {
86
+ "type": "string",
87
+ "description": "Folder for output artifacts"
88
+ },
89
+ "passWithNoTests": {
90
+ "type": "boolean",
91
+ "description": "Makes test run succeed even if no tests were found",
92
+ "default": true
93
+ },
94
+ "project": {
95
+ "description": "Only run tests from the specified list of projects",
96
+ "type": "array",
97
+ "items": {
98
+ "type": "string"
99
+ }
100
+ },
101
+ "quiet": {
102
+ "alias": "q",
103
+ "type": "boolean",
104
+ "description": "Suppress stdio"
105
+ },
106
+ "repeatEach": {
107
+ "type": "number",
108
+ "description": "Run each test N times"
109
+ },
110
+ "reporter": {
111
+ "type": "string",
112
+ "description": "Common Reporter values to use, comma-separated, 'list', 'line', 'dot', 'json', 'junit', 'null', 'github', 'html', 'blob'. To configure reporter options, use the playwright configuration."
113
+ },
114
+ "retries": {
115
+ "type": "number",
116
+ "description": "Maximum retry count for flaky tests, zero for no retries"
117
+ },
118
+ "shard": {
119
+ "type": "string",
120
+ "description": "Shard tests and execute only the selected shard, specify in the form 'current/all', 1-based, for example '3/5'"
121
+ },
122
+ "timeout": {
123
+ "type": "number",
124
+ "description": "Specify test timeout threshold in milliseconds, zero for unlimited"
125
+ },
126
+ "trace": {
127
+ "type": "string",
128
+ "enum": [
129
+ "on",
130
+ "off",
131
+ "on-first-retry",
132
+ "on-all-retries",
133
+ "retain-on-failure"
134
+ ],
135
+ "description": "Force tracing mode, can be 'on', 'off', 'on-first-retry', 'on-all-retries', 'retain-on-failure'"
136
+ },
137
+ "updateSnapshots": {
138
+ "alias": "u",
139
+ "type": "boolean",
140
+ "description": "Update snapshots with actual results. Snapshots will be created if missing."
141
+ },
142
+ "ui": {
143
+ "type": "boolean",
144
+ "description": "Run tests in interactive UI mode"
145
+ },
146
+ "uiHost": {
147
+ "type": "string",
148
+ "description": "Host to serve UI on; specifying this option opens UI in a browser tab"
149
+ },
150
+ "uiPort": {
151
+ "type": "number",
152
+ "description": "Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab"
153
+ },
154
+ "skipInstall": {
155
+ "type": "boolean",
156
+ "description": "Skip running playwright install before running playwright tests. This is to ensure that playwright browsers are installed before running tests.",
157
+ "default": false
158
+ },
159
+ "cacheDir": {
160
+ "type": "string",
161
+ "description": "Directory for Playwright internal cache (browser binaries, etc.). Sets the PWTEST_CACHE_DIR environment variable."
162
+ }
163
+ },
164
+ "required": []
165
165
  }
@@ -1,73 +1,73 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxPlaywrightConfiguration",
4
- "description": "Add a Playwright configuration.",
5
- "title": "Add a Playwright configuration",
6
- "type": "object",
7
- "properties": {
8
- "project": {
9
- "type": "string",
10
- "description": "The project to add a Playwright configuration to.",
11
- "$default": {
12
- "$source": "projectName"
13
- },
14
- "x-priority": "important",
15
- "x-prompt": "What is the name of the project to set up Playwright for?"
16
- },
17
- "directory": {
18
- "type": "string",
19
- "description": "A directory where the project is placed relative from the project root.",
20
- "x-priority": "important",
21
- "default": "e2e"
22
- },
23
- "linter": {
24
- "description": "The tool to use for running lint checks.",
25
- "type": "string",
26
- "enum": ["none", "eslint"],
27
- "x-priority": "important"
28
- },
29
- "js": {
30
- "type": "boolean",
31
- "description": "Generate JavaScript files rather than TypeScript files.",
32
- "default": false
33
- },
34
- "webServerCommand": {
35
- "type": "string",
36
- "description": "The command to start the web server."
37
- },
38
- "webServerAddress": {
39
- "type": "string",
40
- "description": "The address of the web server."
41
- },
42
- "setParserOptionsProject": {
43
- "type": "boolean",
44
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
45
- "default": false
46
- },
47
- "skipFormat": {
48
- "description": "Skip formatting files.",
49
- "type": "boolean",
50
- "default": false,
51
- "x-priority": "internal"
52
- },
53
- "skipPackageJson": {
54
- "type": "boolean",
55
- "default": false,
56
- "description": "Do not add dependencies to `package.json`.",
57
- "x-priority": "internal"
58
- },
59
- "rootProject": {
60
- "description": "Create a application at the root of the workspace",
61
- "type": "boolean",
62
- "default": false,
63
- "hidden": true,
64
- "x-priority": "internal"
65
- },
66
- "skipInstall": {
67
- "type": "boolean",
68
- "description": "Skip running `playwright install`. This is to ensure that playwright browsers are installed.",
69
- "default": false
70
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxPlaywrightConfiguration",
4
+ "description": "Add a Playwright configuration.",
5
+ "title": "Add a Playwright configuration",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The project to add a Playwright configuration to.",
11
+ "$default": {
12
+ "$source": "projectName"
13
+ },
14
+ "x-priority": "important",
15
+ "x-prompt": "What is the name of the project to set up Playwright for?"
71
16
  },
72
- "required": ["project"]
17
+ "directory": {
18
+ "type": "string",
19
+ "description": "A directory where the project is placed relative from the project root.",
20
+ "x-priority": "important",
21
+ "default": "e2e"
22
+ },
23
+ "linter": {
24
+ "description": "The tool to use for running lint checks.",
25
+ "type": "string",
26
+ "enum": ["none", "eslint"],
27
+ "x-priority": "important"
28
+ },
29
+ "js": {
30
+ "type": "boolean",
31
+ "description": "Generate JavaScript files rather than TypeScript files.",
32
+ "default": false
33
+ },
34
+ "webServerCommand": {
35
+ "type": "string",
36
+ "description": "The command to start the web server."
37
+ },
38
+ "webServerAddress": {
39
+ "type": "string",
40
+ "description": "The address of the web server."
41
+ },
42
+ "setParserOptionsProject": {
43
+ "type": "boolean",
44
+ "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
45
+ "default": false
46
+ },
47
+ "skipFormat": {
48
+ "description": "Skip formatting files.",
49
+ "type": "boolean",
50
+ "default": false,
51
+ "x-priority": "internal"
52
+ },
53
+ "skipPackageJson": {
54
+ "type": "boolean",
55
+ "default": false,
56
+ "description": "Do not add dependencies to `package.json`.",
57
+ "x-priority": "internal"
58
+ },
59
+ "rootProject": {
60
+ "description": "Create a application at the root of the workspace",
61
+ "type": "boolean",
62
+ "default": false,
63
+ "hidden": true,
64
+ "x-priority": "internal"
65
+ },
66
+ "skipInstall": {
67
+ "type": "boolean",
68
+ "description": "Skip running `playwright install`. This is to ensure that playwright browsers are installed.",
69
+ "default": false
70
+ }
71
+ },
72
+ "required": ["project"]
73
73
  }
@@ -1,19 +1,19 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxPlaywrightConvertToInferred",
4
- "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
5
- "title": "Convert Playwright project from executor to plugin",
6
- "type": "object",
7
- "properties": {
8
- "project": {
9
- "type": "string",
10
- "description": "The project to convert from using the `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`.",
11
- "x-priority": "important"
12
- },
13
- "skipFormat": {
14
- "type": "boolean",
15
- "description": "Whether to format files at the end of the migration.",
16
- "default": false
17
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxPlaywrightConvertToInferred",
4
+ "description": "Convert existing Playwright project(s) using `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`. Defaults to migrating all projects. Pass '--project' to migrate only one target.",
5
+ "title": "Convert Playwright project from executor to plugin",
6
+ "type": "object",
7
+ "properties": {
8
+ "project": {
9
+ "type": "string",
10
+ "description": "The project to convert from using the `@nx/playwright:playwright` executor to use `@nx/playwright/plugin`.",
11
+ "x-priority": "important"
12
+ },
13
+ "skipFormat": {
14
+ "type": "boolean",
15
+ "description": "Whether to format files at the end of the migration.",
16
+ "default": false
18
17
  }
18
+ }
19
19
  }
@@ -1,34 +1,34 @@
1
1
  {
2
- "$schema": "https://json-schema.org/schema",
3
- "$id": "NxPlaywrightInit",
4
- "title": "Playwright Init Generator",
5
- "description": "Initializes a Playwright project in the current workspace.",
6
- "type": "object",
7
- "properties": {
8
- "skipFormat": {
9
- "description": "Skip formatting files.",
10
- "type": "boolean",
11
- "default": false,
12
- "x-priority": "internal"
13
- },
14
- "skipPackageJson": {
15
- "type": "boolean",
16
- "default": false,
17
- "description": "Do not add dependencies to `package.json`.",
18
- "x-priority": "internal"
19
- },
20
- "keepExistingVersions": {
21
- "type": "boolean",
22
- "x-priority": "internal",
23
- "description": "Keep existing dependencies versions",
24
- "default": false
25
- },
26
- "updatePackageScripts": {
27
- "type": "boolean",
28
- "x-priority": "internal",
29
- "description": "Update `package.json` scripts with inferred targets",
30
- "default": false
31
- }
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxPlaywrightInit",
4
+ "title": "Playwright Init Generator",
5
+ "description": "Initializes a Playwright project in the current workspace.",
6
+ "type": "object",
7
+ "properties": {
8
+ "skipFormat": {
9
+ "description": "Skip formatting files.",
10
+ "type": "boolean",
11
+ "default": false,
12
+ "x-priority": "internal"
32
13
  },
33
- "required": []
14
+ "skipPackageJson": {
15
+ "type": "boolean",
16
+ "default": false,
17
+ "description": "Do not add dependencies to `package.json`.",
18
+ "x-priority": "internal"
19
+ },
20
+ "keepExistingVersions": {
21
+ "type": "boolean",
22
+ "x-priority": "internal",
23
+ "description": "Keep existing dependencies versions",
24
+ "default": false
25
+ },
26
+ "updatePackageScripts": {
27
+ "type": "boolean",
28
+ "x-priority": "internal",
29
+ "description": "Update `package.json` scripts with inferred targets",
30
+ "default": false
31
+ }
32
+ },
33
+ "required": []
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAiBpB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,uBAAuB,CAqB9D,CAAC;AAEF,eAAO,MAAM,aAAa,wCAAc,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAWD,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,uBAAuB,CAwB9D,CAAC;AAEF,eAAO,MAAM,aAAa,wCAAc,CAAC"}
@@ -6,6 +6,7 @@ const calculate_hash_for_create_nodes_1 = require("@nx/devkit/src/utils/calculat
6
6
  const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
7
7
  const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
8
8
  const js_1 = require("@nx/js");
9
+ const internal_1 = require("@nx/js/src/internal");
9
10
  const minimatch_1 = require("minimatch");
10
11
  const node_fs_1 = require("node:fs");
11
12
  const node_path_1 = require("node:path");
@@ -14,7 +15,6 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
14
15
  const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
15
16
  const workspace_context_1 = require("nx/src/utils/workspace-context");
16
17
  const reporters_1 = require("../utils/reporters");
17
- const pmc = (0, devkit_1.getPackageManagerCommand)();
18
18
  const playwrightConfigGlob = '**/playwright.config.{js,ts,cjs,cts,mjs,mts}';
19
19
  exports.createNodes = [
20
20
  playwrightConfigGlob,
@@ -22,8 +22,9 @@ exports.createNodes = [
22
22
  const optionsHash = (0, file_hasher_1.hashObject)(options);
23
23
  const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `playwright-${optionsHash}.hash`);
24
24
  const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
25
+ const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
25
26
  try {
26
- return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache), configFilePaths, options, context);
27
+ return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFilePaths, options, context);
27
28
  }
28
29
  finally {
29
30
  pluginCache.writeToDisk(cachePath);
@@ -31,7 +32,7 @@ exports.createNodes = [
31
32
  },
32
33
  ];
33
34
  exports.createNodesV2 = exports.createNodes;
34
- async function createNodesInternal(configFilePath, options, context, pluginCache) {
35
+ async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
35
36
  const projectRoot = (0, node_path_1.dirname)(configFilePath);
36
37
  // Do not create a project if package.json and project.json isn't there.
37
38
  const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
@@ -40,12 +41,16 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
40
41
  return {};
41
42
  }
42
43
  const normalizedOptions = normalizeOptions(options);
44
+ const externalTsconfigInputs = collectExternalTsconfigInputs(projectRoot, context.workspaceRoot);
43
45
  const hash = await (0, calculate_hash_for_create_nodes_1.calculateHashForCreateNodes)(projectRoot, {
44
46
  ...normalizedOptions,
45
47
  CI: process.env.CI,
46
- }, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
48
+ }, context, [
49
+ (0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot)),
50
+ ...externalTsconfigInputs,
51
+ ]);
47
52
  if (!pluginCache.has(hash)) {
48
- pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context));
53
+ pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context, pmc, externalTsconfigInputs));
49
54
  }
50
55
  const { targets, metadata } = pluginCache.get(hash);
51
56
  return {
@@ -58,13 +63,17 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
58
63
  },
59
64
  };
60
65
  }
61
- async function buildPlaywrightTargets(configFilePath, projectRoot, options, context) {
66
+ async function buildPlaywrightTargets(configFilePath, projectRoot, options, context, pmc, externalTsconfigInputs) {
62
67
  // Playwright forbids importing the `@playwright/test` module twice. This would affect running the tests,
63
68
  // but we're just reading the config so let's delete the variable they are using to detect this.
64
69
  // See: https://github.com/microsoft/playwright/pull/11218/files
65
70
  delete process['__pw_initiator__'];
66
71
  const playwrightConfig = await (0, config_utils_1.loadConfigFile)((0, node_path_1.join)(context.workspaceRoot, configFilePath));
67
72
  const namedInputs = (0, get_named_inputs_1.getNamedInputs)(projectRoot, context);
73
+ const tsconfigJsonInputs = externalTsconfigInputs.map((file) => ({
74
+ json: `{workspaceRoot}/${file}`,
75
+ fields: ['compilerOptions', 'extends', 'files', 'include'],
76
+ }));
68
77
  const targets = {};
69
78
  let metadata;
70
79
  const testOutput = getTestOutput(playwrightConfig);
@@ -101,6 +110,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
101
110
  ...('production' in namedInputs
102
111
  ? ['default', '^production', '^{projectRoot}/tsconfig*.json']
103
112
  : ['default', '^default']),
113
+ ...tsconfigJsonInputs,
104
114
  { externalDependencies: ['@playwright/test'] },
105
115
  ],
106
116
  outputs: getTargetOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot),
@@ -118,6 +128,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
118
128
  ...('production' in namedInputs
119
129
  ? ['default', '^production', '^{projectRoot}/tsconfig*.json']
120
130
  : ['default', '^default']),
131
+ ...tsconfigJsonInputs,
121
132
  { externalDependencies: ['@playwright/test'] },
122
133
  ],
123
134
  outputs: getTargetOutputs(testOutput, ciReporterOutputs, context.workspaceRoot, projectRoot),
@@ -160,7 +171,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
160
171
  env: getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder),
161
172
  },
162
173
  outputs: getAtomizedTaskOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot, outputSubfolder),
163
- command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, node_path_1.join)(testOutput, outputSubfolder)}`,
174
+ command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, devkit_1.joinPathFragments)(testOutput, outputSubfolder)}`,
164
175
  metadata: {
165
176
  technologies: ['playwright'],
166
177
  description: `Runs Playwright Tests in ${relativeSpecFilePath} in CI`,
@@ -219,7 +230,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
219
230
  inputs: ciBaseTargetConfig.inputs,
220
231
  outputs: Array.from(mergeReportsTargetOutputs),
221
232
  options: {
222
- config: node_path_1.posix.relative(projectRoot, configFilePath),
233
+ config: (0, devkit_1.normalizePath)((0, node_path_1.relative)(projectRoot, configFilePath)),
223
234
  expectedSuites: dependsOn.length,
224
235
  },
225
236
  metadata: {
@@ -306,9 +317,9 @@ function getAtomizedTaskOutputs(testOutput, reporterOutputs, workspaceRoot, proj
306
317
  function addSubfolderToOutput(output, subfolder) {
307
318
  const parts = (0, node_path_1.parse)(output);
308
319
  if (parts.ext !== '') {
309
- return (0, node_path_1.join)(parts.dir, subfolder, parts.base);
320
+ return (0, devkit_1.joinPathFragments)(parts.dir, subfolder, parts.base);
310
321
  }
311
- return (0, node_path_1.join)(output, subfolder);
322
+ return (0, devkit_1.joinPathFragments)(output, subfolder);
312
323
  }
313
324
  function getWebserverCommandTasks(playwrightConfig) {
314
325
  if (!playwrightConfig.webServer) {
@@ -395,6 +406,59 @@ function getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder) {
395
406
  function normalizeAtomizedTaskBlobReportOutput(output, subfolder) {
396
407
  // set unique name for the blob report file
397
408
  return output.endsWith('.zip')
398
- ? (0, node_path_1.join)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
399
- : (0, node_path_1.join)(output, `${subfolder}.zip`);
409
+ ? (0, devkit_1.joinPathFragments)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
410
+ : (0, devkit_1.joinPathFragments)(output, `${subfolder}.zip`);
411
+ }
412
+ /**
413
+ * Collects tsconfig files read by the Playwright task that are NOT already
414
+ * covered by other inputs, returned as workspace-relative paths.
415
+ *
416
+ * Sources:
417
+ * - The project tsconfig's `extends` chain (compile-time config loading)
418
+ * - The workspace root `tsconfig.json` (read at runtime by
419
+ * `isUsingTsSolutionSetup`, which `nxE2EPreset` calls from the Playwright
420
+ * worker to pick the output directory convention)
421
+ *
422
+ * Exclusions:
423
+ * - Files inside the project root — covered by `default`
424
+ * - The native `TsConfiguration` hash instruction file at the workspace
425
+ * root (`tsconfig.base.json` when it exists, otherwise `tsconfig.json`)
426
+ * - Files under `node_modules` — invalidated via the lockfile
427
+ * - Paths outside the workspace — cannot be expressed as inputs
428
+ */
429
+ function collectExternalTsconfigInputs(projectRoot, workspaceRoot) {
430
+ const rootTsConfigName = (0, js_1.getRootTsConfigFileName)();
431
+ const projectPrefix = `${projectRoot}/`;
432
+ const collected = [];
433
+ const seen = new Set();
434
+ const visit = (absolutePath) => {
435
+ const wsRelative = (0, node_path_1.relative)(workspaceRoot, absolutePath)
436
+ .split(node_path_1.sep)
437
+ .join('/');
438
+ if (seen.has(wsRelative))
439
+ return 'continue';
440
+ seen.add(wsRelative);
441
+ if (wsRelative.startsWith('../') || wsRelative === '..')
442
+ return 'continue';
443
+ if (wsRelative.startsWith('node_modules/') ||
444
+ wsRelative.includes('/node_modules/')) {
445
+ return 'continue';
446
+ }
447
+ if (wsRelative === projectRoot || wsRelative.startsWith(projectPrefix)) {
448
+ return 'continue';
449
+ }
450
+ if (wsRelative === rootTsConfigName)
451
+ return 'continue';
452
+ collected.push(wsRelative);
453
+ return 'continue';
454
+ };
455
+ const projectTsconfig = (0, node_path_1.join)(workspaceRoot, projectRoot, 'tsconfig.json');
456
+ if ((0, node_fs_1.existsSync)(projectTsconfig)) {
457
+ (0, internal_1.walkTsconfigExtendsChain)(projectTsconfig, visit);
458
+ }
459
+ const rootTsconfig = (0, node_path_1.join)(workspaceRoot, 'tsconfig.json');
460
+ if ((0, node_fs_1.existsSync)(rootTsconfig)) {
461
+ (0, internal_1.walkTsconfigExtendsChain)(rootTsconfig, visit);
462
+ }
463
+ return collected;
400
464
  }
package/assets.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "outDir": "dist/packages/playwright",
3
- "assets": [
4
- {
5
- "glob": "**/files/**"
6
- },
7
- {
8
- "glob": "**/*.json",
9
- "ignore": ["tsconfig*.json", "project.json", ".eslintrc.json"]
10
- },
11
- {
12
- "glob": "**/*.js",
13
- "ignore": ["**/jest.config.js"]
14
- },
15
- {
16
- "glob": "**/*.d.ts"
17
- },
18
- {
19
- "glob": "PLUGIN.md"
20
- },
21
- "LICENSE"
22
- ]
23
- }
package/project.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "name": "playwright",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "sourceRoot": "packages/playwright",
5
- "projectType": "library",
6
- "targets": {
7
- "build": {
8
- "outputs": ["{workspaceRoot}/dist/packages/playwright/README.md"],
9
- "commands": ["node ./scripts/copy-readme.js playwright"],
10
- "inputs": ["copyReadme"]
11
- }
12
- },
13
- "tags": []
14
- }