@nx/playwright 22.7.0-beta.1 → 22.7.0-beta.11
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 +7 -8
- package/src/executors/merge-reports/merge-reports.impl.js +1 -1
- package/src/executors/playwright/playwright.impl.js +1 -1
- package/src/generators/configuration/configuration.js +3 -2
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +13 -13
- package/src/utils/add-linter.d.ts.map +1 -1
- package/src/utils/add-linter.js +6 -1
- package/project.json +0 -58
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/playwright",
|
|
3
|
-
"version": "22.7.0-beta.
|
|
3
|
+
"version": "22.7.0-beta.11",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"homepage": "https://nx.dev",
|
|
6
6
|
"private": false,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"Front-end"
|
|
23
23
|
],
|
|
24
24
|
"main": "./index.js",
|
|
25
|
-
"
|
|
25
|
+
"types": "./index.d.ts",
|
|
26
26
|
"author": "Victor Savkin",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"bugs": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"directory": "packages/playwright"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@nx/devkit": "22.7.0-beta.
|
|
38
|
-
"@nx/eslint": "22.7.0-beta.
|
|
39
|
-
"@nx/js": "22.7.0-beta.
|
|
37
|
+
"@nx/devkit": "22.7.0-beta.11",
|
|
38
|
+
"@nx/eslint": "22.7.0-beta.11",
|
|
39
|
+
"@nx/js": "22.7.0-beta.11",
|
|
40
40
|
"tslib": "^2.3.0",
|
|
41
41
|
"minimatch": "10.2.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"nx": "22.7.0-beta.
|
|
44
|
+
"nx": "22.7.0-beta.11"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@playwright/test": "^1.36.0"
|
|
@@ -68,6 +68,5 @@
|
|
|
68
68
|
},
|
|
69
69
|
"nx-migrations": {
|
|
70
70
|
"migrations": "./migrations.json"
|
|
71
|
-
}
|
|
72
|
-
"types": "./index.d.ts"
|
|
71
|
+
}
|
|
73
72
|
}
|
|
@@ -17,7 +17,7 @@ async function playwrightExecutor(options, context) {
|
|
|
17
17
|
(0, child_process_1.execSync)(`${pmc.exec} playwright install`, {
|
|
18
18
|
cwd: devkit_1.workspaceRoot,
|
|
19
19
|
stdio: 'inherit',
|
|
20
|
-
windowsHide:
|
|
20
|
+
windowsHide: true,
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
const args = createArgs(options);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
|
4
4
|
exports.configurationGeneratorInternal = configurationGeneratorInternal;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
7
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
8
|
const prompt_1 = require("@nx/devkit/src/generators/prompt");
|
|
@@ -11,7 +12,7 @@ const package_manager_workspaces_1 = require("@nx/js/src/utils/package-manager-w
|
|
|
11
12
|
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
12
13
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
13
14
|
const child_process_1 = require("child_process");
|
|
14
|
-
const path = require("path");
|
|
15
|
+
const path = tslib_1.__importStar(require("path"));
|
|
15
16
|
const add_linter_1 = require("../../utils/add-linter");
|
|
16
17
|
const versions_1 = require("../../utils/versions");
|
|
17
18
|
const init_1 = require("../init/init");
|
|
@@ -216,7 +217,7 @@ function getBrowsersInstallTask() {
|
|
|
216
217
|
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
217
218
|
(0, child_process_1.execSync)(`${pmc.exec} playwright install`, {
|
|
218
219
|
cwd: devkit_1.workspaceRoot,
|
|
219
|
-
windowsHide:
|
|
220
|
+
windowsHide: true,
|
|
220
221
|
});
|
|
221
222
|
};
|
|
222
223
|
}
|
|
@@ -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;
|
|
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;AAepB,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"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -14,7 +14,6 @@ const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
|
14
14
|
const plugin_cache_utils_1 = require("nx/src/utils/plugin-cache-utils");
|
|
15
15
|
const workspace_context_1 = require("nx/src/utils/workspace-context");
|
|
16
16
|
const reporters_1 = require("../utils/reporters");
|
|
17
|
-
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
18
17
|
const playwrightConfigGlob = '**/playwright.config.{js,ts,cjs,cts,mjs,mts}';
|
|
19
18
|
exports.createNodes = [
|
|
20
19
|
playwrightConfigGlob,
|
|
@@ -22,8 +21,9 @@ exports.createNodes = [
|
|
|
22
21
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
23
22
|
const cachePath = (0, node_path_1.join)(cache_directory_1.workspaceDataDirectory, `playwright-${optionsHash}.hash`);
|
|
24
23
|
const pluginCache = new plugin_cache_utils_1.PluginCache(cachePath);
|
|
24
|
+
const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(context.workspaceRoot));
|
|
25
25
|
try {
|
|
26
|
-
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache), configFilePaths, options, context);
|
|
26
|
+
return await (0, devkit_1.createNodesFromFiles)((configFile, options, context) => createNodesInternal(configFile, options, context, pluginCache, pmc), configFilePaths, options, context);
|
|
27
27
|
}
|
|
28
28
|
finally {
|
|
29
29
|
pluginCache.writeToDisk(cachePath);
|
|
@@ -31,7 +31,7 @@ exports.createNodes = [
|
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
33
|
exports.createNodesV2 = exports.createNodes;
|
|
34
|
-
async function createNodesInternal(configFilePath, options, context, pluginCache) {
|
|
34
|
+
async function createNodesInternal(configFilePath, options, context, pluginCache, pmc) {
|
|
35
35
|
const projectRoot = (0, node_path_1.dirname)(configFilePath);
|
|
36
36
|
// Do not create a project if package.json and project.json isn't there.
|
|
37
37
|
const siblingFiles = (0, node_fs_1.readdirSync)((0, node_path_1.join)(context.workspaceRoot, projectRoot));
|
|
@@ -45,7 +45,7 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
|
|
|
45
45
|
CI: process.env.CI,
|
|
46
46
|
}, context, [(0, js_1.getLockFileName)((0, devkit_1.detectPackageManager)(context.workspaceRoot))]);
|
|
47
47
|
if (!pluginCache.has(hash)) {
|
|
48
|
-
pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context));
|
|
48
|
+
pluginCache.set(hash, await buildPlaywrightTargets(configFilePath, projectRoot, normalizedOptions, context, pmc));
|
|
49
49
|
}
|
|
50
50
|
const { targets, metadata } = pluginCache.get(hash);
|
|
51
51
|
return {
|
|
@@ -58,7 +58,7 @@ async function createNodesInternal(configFilePath, options, context, pluginCache
|
|
|
58
58
|
},
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
async function buildPlaywrightTargets(configFilePath, projectRoot, options, context) {
|
|
61
|
+
async function buildPlaywrightTargets(configFilePath, projectRoot, options, context, pmc) {
|
|
62
62
|
// Playwright forbids importing the `@playwright/test` module twice. This would affect running the tests,
|
|
63
63
|
// but we're just reading the config so let's delete the variable they are using to detect this.
|
|
64
64
|
// See: https://github.com/microsoft/playwright/pull/11218/files
|
|
@@ -99,7 +99,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
|
|
|
99
99
|
cache: true,
|
|
100
100
|
inputs: [
|
|
101
101
|
...('production' in namedInputs
|
|
102
|
-
? ['default', '^{projectRoot}/tsconfig*.json'
|
|
102
|
+
? ['default', '^production', '^{projectRoot}/tsconfig*.json']
|
|
103
103
|
: ['default', '^default']),
|
|
104
104
|
{ externalDependencies: ['@playwright/test'] },
|
|
105
105
|
],
|
|
@@ -116,7 +116,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
|
|
|
116
116
|
cache: true,
|
|
117
117
|
inputs: [
|
|
118
118
|
...('production' in namedInputs
|
|
119
|
-
? ['default', '^{projectRoot}/tsconfig*.json'
|
|
119
|
+
? ['default', '^production', '^{projectRoot}/tsconfig*.json']
|
|
120
120
|
: ['default', '^default']),
|
|
121
121
|
{ externalDependencies: ['@playwright/test'] },
|
|
122
122
|
],
|
|
@@ -160,7 +160,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
|
|
|
160
160
|
env: getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder),
|
|
161
161
|
},
|
|
162
162
|
outputs: getAtomizedTaskOutputs(testOutput, reporterOutputs, context.workspaceRoot, projectRoot, outputSubfolder),
|
|
163
|
-
command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0,
|
|
163
|
+
command: `${baseTargetConfig.command} ${relativeSpecFilePath} --output=${(0, devkit_1.joinPathFragments)(testOutput, outputSubfolder)}`,
|
|
164
164
|
metadata: {
|
|
165
165
|
technologies: ['playwright'],
|
|
166
166
|
description: `Runs Playwright Tests in ${relativeSpecFilePath} in CI`,
|
|
@@ -219,7 +219,7 @@ async function buildPlaywrightTargets(configFilePath, projectRoot, options, cont
|
|
|
219
219
|
inputs: ciBaseTargetConfig.inputs,
|
|
220
220
|
outputs: Array.from(mergeReportsTargetOutputs),
|
|
221
221
|
options: {
|
|
222
|
-
config: node_path_1.
|
|
222
|
+
config: (0, devkit_1.normalizePath)((0, node_path_1.relative)(projectRoot, configFilePath)),
|
|
223
223
|
expectedSuites: dependsOn.length,
|
|
224
224
|
},
|
|
225
225
|
metadata: {
|
|
@@ -306,9 +306,9 @@ function getAtomizedTaskOutputs(testOutput, reporterOutputs, workspaceRoot, proj
|
|
|
306
306
|
function addSubfolderToOutput(output, subfolder) {
|
|
307
307
|
const parts = (0, node_path_1.parse)(output);
|
|
308
308
|
if (parts.ext !== '') {
|
|
309
|
-
return (0,
|
|
309
|
+
return (0, devkit_1.joinPathFragments)(parts.dir, subfolder, parts.base);
|
|
310
310
|
}
|
|
311
|
-
return (0,
|
|
311
|
+
return (0, devkit_1.joinPathFragments)(output, subfolder);
|
|
312
312
|
}
|
|
313
313
|
function getWebserverCommandTasks(playwrightConfig) {
|
|
314
314
|
if (!playwrightConfig.webServer) {
|
|
@@ -395,6 +395,6 @@ function getAtomizedTaskEnvVars(reporterOutputs, outputSubfolder) {
|
|
|
395
395
|
function normalizeAtomizedTaskBlobReportOutput(output, subfolder) {
|
|
396
396
|
// set unique name for the blob report file
|
|
397
397
|
return output.endsWith('.zip')
|
|
398
|
-
? (0,
|
|
399
|
-
: (0,
|
|
398
|
+
? (0, devkit_1.joinPathFragments)((0, node_path_1.dirname)(output), `${subfolder}.zip`)
|
|
399
|
+
: (0, devkit_1.joinPathFragments)(output, `${subfolder}.zip`);
|
|
400
400
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAatE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;QAEI;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"add-linter.d.ts","sourceRoot":"","sources":["../../../../../packages/playwright/src/utils/add-linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,YAAY,CAAC;AAatE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb;;QAEI;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAmF5B"}
|
package/src/utils/add-linter.js
CHANGED
|
@@ -35,7 +35,12 @@ async function addLinterToPlaywrightProject(tree, options) {
|
|
|
35
35
|
if ((0, eslint_file_1.isEslintConfigSupported)(tree, projectConfig.root) ||
|
|
36
36
|
(0, eslint_file_1.isEslintConfigSupported)(tree)) {
|
|
37
37
|
if ((0, flat_config_1.useFlatConfig)(tree)) {
|
|
38
|
-
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'flat/recommended',
|
|
38
|
+
(0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(tree, projectConfig.root, 'flat/recommended', {
|
|
39
|
+
moduleName: 'playwright',
|
|
40
|
+
moduleImportPath: 'eslint-plugin-playwright',
|
|
41
|
+
spread: false,
|
|
42
|
+
insertAtTheEnd: false,
|
|
43
|
+
});
|
|
39
44
|
(0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, {
|
|
40
45
|
files: ['*.ts', '*.js'],
|
|
41
46
|
rules: {},
|
package/project.json
DELETED
|
@@ -1,58 +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
|
-
},
|
|
11
|
-
"legacy-post-build": {
|
|
12
|
-
"executor": "@nx/workspace-plugin:legacy-post-build",
|
|
13
|
-
"options": {
|
|
14
|
-
"tsConfig": "./tsconfig.lib.json",
|
|
15
|
-
"assets": [
|
|
16
|
-
{
|
|
17
|
-
"input": "packages/playwright",
|
|
18
|
-
"glob": "**/files/**",
|
|
19
|
-
"output": "/"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"input": "packages/playwright",
|
|
23
|
-
"glob": "**/files/**/.gitkeep",
|
|
24
|
-
"output": "/"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"input": "packages/playwright",
|
|
28
|
-
"glob": "**/*.json",
|
|
29
|
-
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
|
|
30
|
-
"output": "/"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"input": "packages/playwright",
|
|
34
|
-
"glob": "**/*.js",
|
|
35
|
-
"ignore": ["**/jest.config.js"],
|
|
36
|
-
"output": "/"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"input": "packages/playwright",
|
|
40
|
-
"glob": "**/*.d.ts",
|
|
41
|
-
"output": "/"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"input": "packages/playwright",
|
|
45
|
-
"glob": "PLUGIN.md",
|
|
46
|
-
"output": "/"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"input": "",
|
|
50
|
-
"glob": "LICENSE",
|
|
51
|
-
"output": "/"
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"tags": []
|
|
58
|
-
}
|