@nx/expo 23.2.0-beta.6 → 23.2.0-beta.7
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/dist/src/generators/application/lib/normalize-options.d.ts +2 -0
- package/dist/src/generators/application/lib/normalize-options.js +4 -0
- package/dist/src/generators/application/schema.d.ts +2 -2
- package/dist/src/generators/application/schema.json +2 -4
- package/dist/src/generators/library/lib/normalize-options.d.ts +2 -0
- package/dist/src/generators/library/lib/normalize-options.js +4 -0
- package/dist/src/generators/library/schema.d.ts +2 -2
- package/dist/src/generators/library/schema.json +2 -4
- package/dist/src/utils/add-linting.d.ts +3 -2
- package/dist/src/utils/add-linting.js +10 -8
- package/package.json +10 -10
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from '../schema';
|
|
3
|
+
import type { LinterType } from '@nx/js';
|
|
3
4
|
export interface NormalizedSchema extends Omit<Schema, 'name' | 'useTsSolution'> {
|
|
5
|
+
linter: LinterType;
|
|
4
6
|
className: string;
|
|
5
7
|
simpleName: string;
|
|
6
8
|
projectName: string;
|
|
@@ -27,6 +27,10 @@ async function normalizeOptions(host, options) {
|
|
|
27
27
|
const e2eProjectRoot = rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
28
28
|
return {
|
|
29
29
|
...options,
|
|
30
|
+
// Resolved after the spread: `undefined` is falsy, so the ESLint arm in
|
|
31
|
+
// add-linting would still run while the `=== 'eslint'` tsconfig excludes
|
|
32
|
+
// below are skipped.
|
|
33
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
30
34
|
unitTestRunner: options.unitTestRunner || 'jest',
|
|
31
35
|
e2eTestRunner: options.e2eTestRunner || 'none',
|
|
32
36
|
simpleName: projectNames.projectSimpleName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
4
|
directory: string;
|
|
@@ -10,7 +10,7 @@ export interface Schema {
|
|
|
10
10
|
unitTestRunner: 'jest' | 'none'; // default is jest
|
|
11
11
|
classComponent?: boolean;
|
|
12
12
|
js: boolean; // default is false
|
|
13
|
-
linter
|
|
13
|
+
linter?: LinterType;
|
|
14
14
|
enableTypedLinting?: boolean; // default is false
|
|
15
15
|
/**
|
|
16
16
|
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
@@ -41,11 +41,9 @@
|
|
|
41
41
|
"x-priority": "internal"
|
|
42
42
|
},
|
|
43
43
|
"linter": {
|
|
44
|
-
"description": "The tool to use for running lint checks.",
|
|
44
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
45
45
|
"type": "string",
|
|
46
|
-
"enum": ["eslint", "none"],
|
|
47
|
-
"default": "none",
|
|
48
|
-
"x-prompt": "Which linter would you like to use?",
|
|
46
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
49
47
|
"x-priority": "important"
|
|
50
48
|
},
|
|
51
49
|
"unitTestRunner": {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from '../schema';
|
|
3
|
+
import type { LinterType } from '@nx/js';
|
|
3
4
|
export interface NormalizedSchema extends Omit<Schema, 'name'> {
|
|
5
|
+
linter: LinterType;
|
|
4
6
|
fileName: string;
|
|
5
7
|
projectName: string;
|
|
6
8
|
projectRoot: string;
|
|
@@ -23,6 +23,10 @@ async function normalizeOptions(host, options) {
|
|
|
23
23
|
const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
|
|
24
24
|
const normalized = {
|
|
25
25
|
...options,
|
|
26
|
+
// Resolved in the literal so the type guarantees it: `undefined` is falsy,
|
|
27
|
+
// so the ESLint arm would still run while the `=== 'eslint'` tsconfig
|
|
28
|
+
// excludes below are skipped.
|
|
29
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
26
30
|
fileName: projectName,
|
|
27
31
|
routePath: `/${projectNames.projectSimpleName}`,
|
|
28
32
|
projectName: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Same as the @nx/react library schema, except it removes keys: style, component, routing, appProject
|
|
@@ -10,7 +10,7 @@ export interface Schema {
|
|
|
10
10
|
skipFormat: boolean; // default is false
|
|
11
11
|
tags?: string;
|
|
12
12
|
unitTestRunner: 'jest' | 'none';
|
|
13
|
-
linter
|
|
13
|
+
linter?: LinterType;
|
|
14
14
|
publishable?: boolean;
|
|
15
15
|
buildable?: boolean;
|
|
16
16
|
importPath?: string;
|
|
@@ -26,11 +26,9 @@
|
|
|
26
26
|
"x-priority": "important"
|
|
27
27
|
},
|
|
28
28
|
"linter": {
|
|
29
|
-
"description": "The tool to use for running lint checks.",
|
|
29
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
30
30
|
"type": "string",
|
|
31
|
-
"enum": ["eslint", "none"],
|
|
32
|
-
"default": "none",
|
|
33
|
-
"x-prompt": "Which linter would you like to use?",
|
|
31
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
34
32
|
"x-priority": "important"
|
|
35
33
|
},
|
|
36
34
|
"unitTestRunner": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinterType } from '@nx/js';
|
|
2
2
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
3
3
|
interface NormalizedSchema {
|
|
4
|
-
linter?:
|
|
4
|
+
linter?: LinterType;
|
|
5
5
|
projectName: string;
|
|
6
6
|
projectRoot: string;
|
|
7
7
|
enableTypedLinting?: boolean;
|
|
@@ -10,6 +10,7 @@ interface NormalizedSchema {
|
|
|
10
10
|
*/
|
|
11
11
|
setParserOptionsProject?: boolean;
|
|
12
12
|
tsConfigPaths: string[];
|
|
13
|
+
unitTestRunner?: string;
|
|
13
14
|
skipPackageJson?: boolean;
|
|
14
15
|
addPlugin?: boolean;
|
|
15
16
|
buildable?: boolean;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
|
-
const eslint_1 = require("@nx/eslint");
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const react_1 = require("@nx/react");
|
|
7
6
|
const internal_1 = require("@nx/eslint/internal");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
async function addLinting(host, options) {
|
|
9
|
-
if (options.linter === 'none') {
|
|
10
|
-
return () => { };
|
|
11
|
-
}
|
|
12
9
|
const tasks = [];
|
|
13
|
-
|
|
10
|
+
tasks.push(await (0, internal_2.addLintingToProject)(host, {
|
|
11
|
+
oxlintPlugins: ['react', 'react-perf'],
|
|
14
12
|
linter: options.linter,
|
|
15
13
|
project: options.projectName,
|
|
16
14
|
tsConfigPaths: options.tsConfigPaths,
|
|
17
|
-
|
|
15
|
+
unitTestRunner: options.unitTestRunner,
|
|
18
16
|
skipPackageJson: options.skipPackageJson,
|
|
19
17
|
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
20
18
|
addPlugin: options.addPlugin,
|
|
21
19
|
addPackageJsonDependencyChecks: options.buildable,
|
|
22
|
-
});
|
|
23
|
-
|
|
20
|
+
}));
|
|
21
|
+
// Everything below configures ESLint — predefined configs, `extends`, ignore
|
|
22
|
+
// entries — which have no equivalent in other linters.
|
|
23
|
+
if (options.linter && options.linter !== 'eslint') {
|
|
24
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
25
|
+
}
|
|
24
26
|
// Add ignored dependencies and files to dependency-checks rule
|
|
25
27
|
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
26
28
|
(0, internal_1.updateOverrideInLintConfig)(host, options.projectRoot, (override) => Boolean(override.rules?.['@nx/dependency-checks']), (override) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"semver": "^7.6.3",
|
|
62
62
|
"tsconfig-paths": "^4.1.2",
|
|
63
63
|
"tslib": "^2.3.0",
|
|
64
|
-
"@nx/devkit": "23.2.0-beta.
|
|
65
|
-
"@nx/eslint": "23.2.0-beta.
|
|
66
|
-
"@nx/js": "23.2.0-beta.
|
|
67
|
-
"@nx/react": "23.2.0-beta.
|
|
64
|
+
"@nx/devkit": "23.2.0-beta.7",
|
|
65
|
+
"@nx/eslint": "23.2.0-beta.7",
|
|
66
|
+
"@nx/js": "23.2.0-beta.7",
|
|
67
|
+
"@nx/react": "23.2.0-beta.7"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"expo": ">=53.0.0",
|
|
71
71
|
"@expo/metro": ">= 55.0.0",
|
|
72
72
|
"metro-config": ">= 0.82.0",
|
|
73
73
|
"metro-resolver": ">= 0.82.0",
|
|
74
|
-
"@nx/cypress": "23.2.0-beta.
|
|
75
|
-
"@nx/playwright": "23.2.0-beta.
|
|
74
|
+
"@nx/cypress": "23.2.0-beta.7",
|
|
75
|
+
"@nx/playwright": "23.2.0-beta.7"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"@nx/cypress": {
|
|
@@ -95,11 +95,11 @@
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"nx": "23.2.0-beta.
|
|
98
|
+
"nx": "23.2.0-beta.7"
|
|
99
99
|
},
|
|
100
100
|
"optionalDependencies": {
|
|
101
|
-
"@nx/detox": "23.2.0-beta.
|
|
102
|
-
"@nx/rollup": "23.2.0-beta.
|
|
101
|
+
"@nx/detox": "23.2.0-beta.7",
|
|
102
|
+
"@nx/rollup": "23.2.0-beta.7"
|
|
103
103
|
},
|
|
104
104
|
"executors": "./executors.json",
|
|
105
105
|
"ng-update": {
|