@nx/playwright 18.1.0-canary.20240222-5d6abe4 → 18.1.0-canary.20240223-21e7648
Sign up to get free protection for your applications and to get access to all the features.
package/migrations.json
CHANGED
@@ -5,6 +5,12 @@
|
|
5
5
|
"version": "17.3.1-beta.0",
|
6
6
|
"description": "Add project property to playwright config",
|
7
7
|
"implementation": "./src/migrations/update-17-3-1/add-project-to-config"
|
8
|
+
},
|
9
|
+
"18-1-0-remove-baseUrl-from-project-json": {
|
10
|
+
"cli": "nx",
|
11
|
+
"version": "18.1.0-beta.3",
|
12
|
+
"description": "Remove invalid baseUrl option from @nx/playwright:playwright targets in project.json.",
|
13
|
+
"implementation": "./src/migrations/update-18-1-0/remove-baseUrl-from-project-json"
|
8
14
|
}
|
9
15
|
}
|
10
16
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/playwright",
|
3
|
-
"version": "18.1.0-canary.
|
3
|
+
"version": "18.1.0-canary.20240223-21e7648",
|
4
4
|
"type": "commonjs",
|
5
5
|
"homepage": "https://nx.dev",
|
6
6
|
"private": false,
|
@@ -33,9 +33,9 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
36
|
-
"@nx/devkit": "18.1.0-canary.
|
37
|
-
"@nx/eslint": "18.1.0-canary.
|
38
|
-
"@nx/js": "18.1.0-canary.
|
36
|
+
"@nx/devkit": "18.1.0-canary.20240223-21e7648",
|
37
|
+
"@nx/eslint": "18.1.0-canary.20240223-21e7648",
|
38
|
+
"@nx/js": "18.1.0-canary.20240223-21e7648",
|
39
39
|
"tslib": "^2.3.0",
|
40
40
|
"minimatch": "9.0.3"
|
41
41
|
},
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
4
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
5
|
+
async function default_1(tree) {
|
6
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/playwright:playwright', (options, projectName, targetName, configurationName) => {
|
7
|
+
if (options?.['baseUrl']) {
|
8
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
9
|
+
if (configurationName) {
|
10
|
+
delete project.targets[targetName].configurations[configurationName]['baseUrl'];
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
delete project.targets[targetName].options['baseUrl'];
|
14
|
+
}
|
15
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
|
16
|
+
}
|
17
|
+
});
|
18
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
19
|
+
for (const [targetNameOrExecutor, target] of Object.entries(nxJson.targetDefaults)) {
|
20
|
+
if (targetNameOrExecutor === '@nx/playwright:playwright' ||
|
21
|
+
(target.executor && target.executor === '@nx/playwright:playwright')) {
|
22
|
+
let updated = false;
|
23
|
+
if (target.options?.['baseUrl']) {
|
24
|
+
delete nxJson.targetDefaults[targetNameOrExecutor].options['baseUrl'];
|
25
|
+
updated = true;
|
26
|
+
}
|
27
|
+
if (target.configurations) {
|
28
|
+
for (const [configurationName, configuration] of Object.entries(target.configurations)) {
|
29
|
+
if (configuration['baseUrl']) {
|
30
|
+
delete nxJson.targetDefaults[targetNameOrExecutor].configurations[configurationName]['baseUrl'];
|
31
|
+
updated = true;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
if (updated) {
|
36
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
await (0, devkit_1.formatFiles)(tree);
|
41
|
+
}
|
42
|
+
exports.default = default_1;
|
package/src/plugins/plugin.js
CHANGED
@@ -30,7 +30,7 @@ exports.createNodes = [
|
|
30
30
|
async (configFilePath, options, context) => {
|
31
31
|
const projectRoot = (0, path_1.dirname)(configFilePath);
|
32
32
|
// Do not create a project if package.json and project.json isn't there.
|
33
|
-
const siblingFiles = (0, fs_1.readdirSync)(projectRoot);
|
33
|
+
const siblingFiles = (0, fs_1.readdirSync)((0, path_1.join)(context.workspaceRoot, projectRoot));
|
34
34
|
if (!siblingFiles.includes('package.json') &&
|
35
35
|
!siblingFiles.includes('project.json')) {
|
36
36
|
return {};
|