@nx/playwright 16.8.0-beta.0 → 16.8.0-beta.2
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 +4 -4
- package/src/utils/add-linter.js +11 -20
- package/src/utils/preset.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/playwright",
|
|
3
|
-
"version": "16.8.0-beta.
|
|
3
|
+
"version": "16.8.0-beta.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"homepage": "https://nx.dev",
|
|
6
6
|
"private": false,
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"directory": "packages/playwright"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@nx/devkit": "16.8.0-beta.
|
|
36
|
-
"@nx/linter": "16.8.0-beta.
|
|
35
|
+
"@nx/devkit": "16.8.0-beta.2",
|
|
36
|
+
"@nx/linter": "16.8.0-beta.2",
|
|
37
37
|
"tslib": "^2.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"./executors/*/schema.json": "./src/executors/*/schema.json",
|
|
57
57
|
"./preset": "./src/utils/preset.js"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9bcc04742f9e1516d8c1ddbfb1907770c347876f"
|
|
60
60
|
}
|
package/src/utils/add-linter.js
CHANGED
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const linter_1 = require("@nx/linter");
|
|
7
7
|
const global_eslint_config_1 = require("@nx/linter/src/generators/init/global-eslint-config");
|
|
8
8
|
const versions_1 = require("./versions");
|
|
9
|
+
const eslint_file_1 = require("@nx/linter/src/generators/utils/eslint-file");
|
|
9
10
|
function addLinterToPlaywrightProject(tree, options) {
|
|
10
11
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
12
|
if (options.linter === linter_1.Linter.None) {
|
|
@@ -13,7 +14,8 @@ function addLinterToPlaywrightProject(tree, options) {
|
|
|
13
14
|
}
|
|
14
15
|
const tasks = [];
|
|
15
16
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
16
|
-
|
|
17
|
+
const eslintFile = (0, eslint_file_1.findEslintFile)(tree, projectConfig.root);
|
|
18
|
+
if (!eslintFile) {
|
|
17
19
|
tasks.push(yield (0, linter_1.lintProjectGenerator)(tree, {
|
|
18
20
|
project: options.project,
|
|
19
21
|
linter: options.linter,
|
|
@@ -33,33 +35,22 @@ function addLinterToPlaywrightProject(tree, options) {
|
|
|
33
35
|
tasks.push(!options.skipPackageJson
|
|
34
36
|
? (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { 'eslint-plugin-playwright': versions_1.eslintPluginPlaywrightVersion })
|
|
35
37
|
: () => { });
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
if ((0, eslint_file_1.isEslintConfigSupported)(tree)) {
|
|
39
|
+
(0, eslint_file_1.addExtendsToLintConfig)(tree, projectConfig.root, 'plugin:playwright/recommended');
|
|
38
40
|
if (options.rootProject) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
(0, eslint_file_1.addPluginsToLintConfig)(tree, projectConfig.root, '@nx');
|
|
42
|
+
(0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, global_eslint_config_1.javaScriptOverride);
|
|
41
43
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
(_a = json.overrides) !== null && _a !== void 0 ? _a : (json.overrides = []);
|
|
46
|
-
const globals = options.rootProject ? [global_eslint_config_1.globalJavaScriptOverrides] : [];
|
|
47
|
-
const override = {
|
|
48
|
-
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
44
|
+
(0, eslint_file_1.addOverrideToLintConfig)(tree, projectConfig.root, {
|
|
45
|
+
files: [`${options.directory}/**/*.{ts,js,tsx,jsx}`],
|
|
49
46
|
parserOptions: !options.setParserOptionsProject
|
|
50
47
|
? undefined
|
|
51
48
|
: {
|
|
52
49
|
project: `${projectConfig.root}/tsconfig.*?.json`,
|
|
53
50
|
},
|
|
54
51
|
rules: {},
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
Object.assign(Object.assign({}, override), { files: [`${options.directory}/**/*.{ts,js,tsx,jsx}`] }),
|
|
58
|
-
];
|
|
59
|
-
json.overrides.push(...globals);
|
|
60
|
-
json.overrides.push(...palywrightFiles);
|
|
61
|
-
return json;
|
|
62
|
-
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
63
54
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
64
55
|
});
|
|
65
56
|
}
|
package/src/utils/preset.js
CHANGED
|
@@ -74,7 +74,7 @@ function nxE2EPreset(pathToConfig, options) {
|
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
76
|
return (0, test_1.defineConfig)({
|
|
77
|
-
testDir: (_a = options.testDir) !== null && _a !== void 0 ? _a : './src',
|
|
77
|
+
testDir: (_a = options === null || options === void 0 ? void 0 : options.testDir) !== null && _a !== void 0 ? _a : './src',
|
|
78
78
|
outputDir: testResultOuputDir,
|
|
79
79
|
/* Run tests in files in parallel */
|
|
80
80
|
fullyParallel: true,
|