@nrwl/react-native 14.7.18 → 15.0.0-beta.0
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/CHANGELOG.md +1 -1
- package/package.json +9 -9
- package/src/generators/application/schema.json +1 -1
- package/src/generators/component-story/component-story.spec.ts +8 -13
- package/src/generators/library/schema.json +1 -1
- package/src/utils/add-linting.js +0 -3
- package/src/utils/add-linting.js.map +1 -1
- package/src/utils/add-linting.spec.ts +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [15.0.0-beta.0](https://github.com/nrwl/nx/compare/14.8.0...15.0.0-beta.0) (2022-09-28)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/react-native
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0-beta.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
|
|
6
6
|
"keywords": [
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"main": "index.js",
|
|
26
26
|
"types": "index.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@nrwl/detox": "
|
|
29
|
-
"@nrwl/devkit": "
|
|
30
|
-
"@nrwl/jest": "
|
|
31
|
-
"@nrwl/linter": "
|
|
32
|
-
"@nrwl/react": "
|
|
33
|
-
"@nrwl/storybook": "
|
|
34
|
-
"@nrwl/workspace": "
|
|
28
|
+
"@nrwl/detox": "15.0.0-beta.0",
|
|
29
|
+
"@nrwl/devkit": "15.0.0-beta.0",
|
|
30
|
+
"@nrwl/jest": "15.0.0-beta.0",
|
|
31
|
+
"@nrwl/linter": "15.0.0-beta.0",
|
|
32
|
+
"@nrwl/react": "15.0.0-beta.0",
|
|
33
|
+
"@nrwl/storybook": "15.0.0-beta.0",
|
|
34
|
+
"@nrwl/workspace": "15.0.0-beta.0",
|
|
35
35
|
"chalk": "^4.1.0",
|
|
36
36
|
"enhanced-resolve": "^5.8.3",
|
|
37
37
|
"fs-extra": "^10.1.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "40c8859ff039dcf30a8b55a9abfbbfcb38eb4b88"
|
|
57
57
|
}
|
|
@@ -15,7 +15,7 @@ describe('react-native:component-story', () => {
|
|
|
15
15
|
|
|
16
16
|
describe('default setup', () => {
|
|
17
17
|
beforeEach(async () => {
|
|
18
|
-
appTree = await createTestUILib('test-ui-lib'
|
|
18
|
+
appTree = await createTestUILib('test-ui-lib');
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
describe('when file does not contain a component', () => {
|
|
@@ -376,7 +376,7 @@ describe('react-native:component-story', () => {
|
|
|
376
376
|
|
|
377
377
|
describe('using eslint', () => {
|
|
378
378
|
beforeEach(async () => {
|
|
379
|
-
appTree = await createTestUILib('test-ui-lib'
|
|
379
|
+
appTree = await createTestUILib('test-ui-lib');
|
|
380
380
|
await componentGenerator(appTree, {
|
|
381
381
|
name: 'test-ui-lib',
|
|
382
382
|
project: 'test-ui-lib',
|
|
@@ -404,16 +404,13 @@ describe('react-native:component-story', () => {
|
|
|
404
404
|
});
|
|
405
405
|
});
|
|
406
406
|
|
|
407
|
-
export async function createTestUILib(
|
|
408
|
-
libName: string,
|
|
409
|
-
useEsLint = false
|
|
410
|
-
): Promise<Tree> {
|
|
407
|
+
export async function createTestUILib(libName: string): Promise<Tree> {
|
|
411
408
|
let appTree = createTreeWithEmptyWorkspace();
|
|
412
409
|
appTree.write('.gitignore', '');
|
|
413
410
|
|
|
414
411
|
await libraryGenerator(appTree, {
|
|
415
412
|
name: libName,
|
|
416
|
-
linter:
|
|
413
|
+
linter: Linter.EsLint,
|
|
417
414
|
skipFormat: true,
|
|
418
415
|
skipTsConfig: false,
|
|
419
416
|
unitTestRunner: 'jest',
|
|
@@ -425,14 +422,12 @@ export async function createTestUILib(
|
|
|
425
422
|
export: true,
|
|
426
423
|
});
|
|
427
424
|
|
|
428
|
-
|
|
429
|
-
const currentWorkspaceJson = getProjects(appTree);
|
|
425
|
+
const currentWorkspaceJson = getProjects(appTree);
|
|
430
426
|
|
|
431
|
-
|
|
432
|
-
|
|
427
|
+
const projectConfig = currentWorkspaceJson.get(libName);
|
|
428
|
+
projectConfig.targets.lint.options.linter = 'eslint';
|
|
433
429
|
|
|
434
|
-
|
|
435
|
-
}
|
|
430
|
+
updateProjectConfiguration(appTree, libName, projectConfig);
|
|
436
431
|
|
|
437
432
|
return appTree;
|
|
438
433
|
}
|
package/src/utils/add-linting.js
CHANGED
|
@@ -18,9 +18,6 @@ function addLinting(host, options) {
|
|
|
18
18
|
eslintFilePatterns: [`${options.projectRoot}/**/*.{ts,tsx,js,jsx}`],
|
|
19
19
|
skipFormat: true,
|
|
20
20
|
});
|
|
21
|
-
if (options.linter === linter_1.Linter.TsLint) {
|
|
22
|
-
return () => { };
|
|
23
|
-
}
|
|
24
21
|
const reactEslintJson = (0, react_1.createReactEslintJson)(options.projectRoot, options.setParserOptionsProject);
|
|
25
22
|
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, '.eslintrc.json'), (json) => {
|
|
26
23
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-linting.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/add-linting.ts"],"names":[],"mappings":";;;;AAAA,2FAAqF;AACrF,yCAA4D;AAC5D,yCAKsB;AACtB,uCAA6E;AAW7E,SAAsB,UAAU,CAAC,IAAU,EAAE,OAAyB;;QACpE,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,IAAI,EAAE;YAClC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE;YAChD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,WAAW;YAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,kBAAkB,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,uBAAuB,CAAC;YACnE,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,
|
|
1
|
+
{"version":3,"file":"add-linting.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/add-linting.ts"],"names":[],"mappings":";;;;AAAA,2FAAqF;AACrF,yCAA4D;AAC5D,yCAKsB;AACtB,uCAA6E;AAW7E,SAAsB,UAAU,CAAC,IAAU,EAAE,OAAyB;;QACpE,IAAI,OAAO,CAAC,MAAM,KAAK,eAAM,CAAC,IAAI,EAAE;YAClC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAoB,EAAC,IAAI,EAAE;YAChD,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,WAAW;YAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,kBAAkB,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,uBAAuB,CAAC;YACnE,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,IAAA,6BAAqB,EAC3C,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,uBAAuB,CAChC,CAAC;QAEF,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,EACxD,CAAC,IAAyB,EAAE,EAAE;;YAC5B,IAAI,GAAG,eAAe,CAAC;YACvB,IAAI,CAAC,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;YAEpE,uDAAuD;YACvD,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,SAAS,0CAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CACzE,CAAC;YACF,IAAI,cAAc,EAAE;gBAClB,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC;gBAClD,cAAc,CAAC,KAAK,CAAC,mCAAmC,CAAC,GAAG,KAAK,CAAC;aACnE;YAED,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;QAEF,MAAM,WAAW,GAAG,MAAM,IAAA,qCAA4B,EACpD,IAAI,EACJ,+BAAuB,CAAC,YAAY,EACpC,+BAAuB,CAAC,eAAe,CACxC,CAAC;QAEF,OAAO,IAAA,sCAAgB,EAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;IACjD,CAAC;CAAA;AA7CD,gCA6CC"}
|
|
@@ -28,21 +28,6 @@ describe('Add Linting', () => {
|
|
|
28
28
|
expect(project.targets.lint.executor).toEqual('@nrwl/linter:eslint');
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
it('should add update `workspace.json` file properly when tslint is passed', () => {
|
|
32
|
-
addLinting(tree, {
|
|
33
|
-
projectName: 'my-lib',
|
|
34
|
-
linter: Linter.TsLint,
|
|
35
|
-
tsConfigPaths: ['libs/my-lib/tsconfig.lib.json'],
|
|
36
|
-
projectRoot: 'libs/my-lib',
|
|
37
|
-
});
|
|
38
|
-
const project = readProjectConfiguration(tree, 'my-lib');
|
|
39
|
-
|
|
40
|
-
expect(project.targets.lint).toBeDefined();
|
|
41
|
-
expect(project.targets.lint.executor).toEqual(
|
|
42
|
-
'@angular-devkit/build-angular:tslint'
|
|
43
|
-
);
|
|
44
|
-
});
|
|
45
|
-
|
|
46
31
|
it('should not add lint target when "none" is passed', async () => {
|
|
47
32
|
addLinting(tree, {
|
|
48
33
|
projectName: 'my-lib',
|