@nrwl/react-native 14.0.3 → 14.0.4
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/migrations.json +6 -0
- package/package.json +8 -8
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +0 -2
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +1 -1
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.d.ts +5 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js +42 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js.map +1 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +48 -0
- package/src/utils/versions.js +1 -1
package/migrations.json
CHANGED
|
@@ -35,6 +35,12 @@
|
|
|
35
35
|
"cli": "nx",
|
|
36
36
|
"description": "Add projectRoot option in metro.config.js",
|
|
37
37
|
"factory": "./src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0"
|
|
38
|
+
},
|
|
39
|
+
"change-main-to-class-name-14-0-2": {
|
|
40
|
+
"version": "14.0.3-beta.0",
|
|
41
|
+
"cli": "nx",
|
|
42
|
+
"description": "changes 'main' tag to project's className",
|
|
43
|
+
"factory": "./src/migrations/update-14-0-2/change-main-to-class-name-14-0-2"
|
|
38
44
|
}
|
|
39
45
|
},
|
|
40
46
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.4",
|
|
4
4
|
"description": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Monorepo",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"types": "index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nrwl/detox": "14.0.
|
|
28
|
-
"@nrwl/devkit": "14.0.
|
|
29
|
-
"@nrwl/jest": "14.0.
|
|
30
|
-
"@nrwl/linter": "14.0.
|
|
31
|
-
"@nrwl/storybook": "14.0.
|
|
32
|
-
"@nrwl/react": "14.0.
|
|
33
|
-
"@nrwl/workspace": "14.0.
|
|
27
|
+
"@nrwl/detox": "14.0.4",
|
|
28
|
+
"@nrwl/devkit": "14.0.4",
|
|
29
|
+
"@nrwl/jest": "14.0.4",
|
|
30
|
+
"@nrwl/linter": "14.0.4",
|
|
31
|
+
"@nrwl/storybook": "14.0.4",
|
|
32
|
+
"@nrwl/react": "14.0.4",
|
|
33
|
+
"@nrwl/workspace": "14.0.4",
|
|
34
34
|
"chalk": "^4.1.0",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"fs-extra": "^9.1.0",
|
|
@@ -20,8 +20,6 @@ function update(tree) {
|
|
|
20
20
|
if (metroConfigContent.includes('projectRoot: __dirname')) {
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (metroConfigContent.includes('projectRoot'))
|
|
24
|
-
return;
|
|
25
23
|
tree.write(metroConfigPath, metroConfigContent.replace('debug: ', 'projectRoot: __dirname, watchFolders: [], debug: '));
|
|
26
24
|
}
|
|
27
25
|
catch (_c) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-project-root-metro-config-14-0-0.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAEtB;;;GAGG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,MAAM,eAAe,GAAG,GAAG,OAAO,CAAC,IAAI,kBAAkB,CAAC;YAC1D,IACE,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;gBAC/D,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;gBAE7B,OAAO;YACT,IAAI;gBACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC/D,IAAI,kBAAkB,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE;oBACzD,OAAO;iBACR;gBACD,IAAI,
|
|
1
|
+
{"version":3,"file":"add-project-root-metro-config-14-0-0.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AAEtB;;;GAGG;AACH,SAA8B,MAAM,CAAC,IAAU;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;;YAC3B,MAAM,eAAe,GAAG,GAAG,OAAO,CAAC,IAAI,kBAAkB,CAAC;YAC1D,IACE,CAAA,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;gBAC/D,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;gBAE7B,OAAO;YACT,IAAI;gBACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC/D,IAAI,kBAAkB,CAAC,QAAQ,CAAC,wBAAwB,CAAC,EAAE;oBACzD,OAAO;iBACR;gBACD,IAAI,CAAC,KAAK,CACR,eAAe,EACf,kBAAkB,CAAC,OAAO,CACxB,SAAS,EACT,mDAAmD,CACpD,CACF,CAAC;aACH;YAAC,WAAM;gBACN,eAAM,CAAC,KAAK,CACV,IAAA,qBAAY,EAAA,oBAAoB,eAAe,gBAAgB,OAAO,CAAC,IAAI,GAAG,CAC/E,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AA7BD,yBA6BC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* This function changes "main" tag to project's className
|
|
8
|
+
*/
|
|
9
|
+
function update(tree) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
13
|
+
for (const [name, config] of projects.entries()) {
|
|
14
|
+
if (((_b = (_a = config.targets) === null || _a === void 0 ? void 0 : _a.start) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/react-native:start')
|
|
15
|
+
continue;
|
|
16
|
+
let mailFilePath;
|
|
17
|
+
if (tree.exists((0, path_1.join)(config.root, 'src/main.tsx'))) {
|
|
18
|
+
mailFilePath = (0, path_1.join)(config.root, 'src/main.tsx');
|
|
19
|
+
}
|
|
20
|
+
if (tree.exists((0, path_1.join)(config.root, 'src/main.js'))) {
|
|
21
|
+
mailFilePath = (0, path_1.join)(config.root, 'src/main.js');
|
|
22
|
+
}
|
|
23
|
+
if (!mailFilePath) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const { className } = (0, devkit_1.names)(name);
|
|
28
|
+
const content = tree.read(mailFilePath, 'utf-8');
|
|
29
|
+
if (!content.includes(`'main'`)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
tree.write(mailFilePath, content.replace(`'main'`, `'${className}'`));
|
|
33
|
+
}
|
|
34
|
+
catch (_c) {
|
|
35
|
+
devkit_1.logger.error((0, devkit_1.stripIndents) `Unable to update ${mailFilePath} for project ${name}.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.default = update;
|
|
42
|
+
//# sourceMappingURL=change-main-to-class-name-14-0-2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change-main-to-class-name-14-0-2.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.ts"],"names":[],"mappings":";;;AAAA,yCAOsB;AACtB,+BAA4B;AAE5B;;GAEG;AACH,SAA8B,MAAM,CAAC,IAAU;;;QAC7C,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAEnC,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE;YAC/C,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;gBAChE,SAAS;YACX,IAAI,YAAY,CAAC;YACjB,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,EAAE;gBAClD,YAAY,GAAG,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;aAClD;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,EAAE;gBACjD,YAAY,GAAG,IAAA,WAAI,EAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;aACjD;YACD,IAAI,CAAC,YAAY,EAAE;gBACjB,SAAS;aACV;YACD,IAAI;gBACF,MAAM,EAAE,SAAS,EAAE,GAAG,IAAA,cAAK,EAAC,IAAI,CAAC,CAAC;gBAClC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBACjD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;oBAC/B,OAAO;iBACR;gBACD,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC;aACvE;YAAC,WAAM;gBACN,eAAM,CAAC,KAAK,CACV,IAAA,qBAAY,EAAA,oBAAoB,YAAY,gBAAgB,IAAI,GAAG,CACpE,CAAC;aACH;SACF;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AA/BD,yBA+BC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { addProjectConfiguration, Tree } from '@nrwl/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
|
+
|
|
4
|
+
import update from './change-main-to-class-name-14-0-2';
|
|
5
|
+
|
|
6
|
+
describe('Change from main tag to className tag', () => {
|
|
7
|
+
let tree: Tree;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tree = createTreeWithEmptyWorkspace();
|
|
11
|
+
addProjectConfiguration(tree, 'products', {
|
|
12
|
+
root: 'apps/products',
|
|
13
|
+
sourceRoot: 'apps/products/src',
|
|
14
|
+
targets: {
|
|
15
|
+
start: {
|
|
16
|
+
executor: '@nrwl/react-native:start',
|
|
17
|
+
options: {
|
|
18
|
+
port: 8081,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it(`should udpate main file to registerComponent className`, async () => {
|
|
26
|
+
tree.write(
|
|
27
|
+
'apps/products/src/main.tsx',
|
|
28
|
+
`AppRegistry.registerComponent('main', () => App);`
|
|
29
|
+
);
|
|
30
|
+
await update(tree);
|
|
31
|
+
|
|
32
|
+
expect(tree.read('apps/products/src/main.tsx', 'utf-8')).toEqual(
|
|
33
|
+
`AppRegistry.registerComponent('Products', () => App);`
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it(`should not udpate main file to registerComponent className if it does not exists`, async () => {
|
|
38
|
+
tree.write(
|
|
39
|
+
'apps/products/src/main.tsx',
|
|
40
|
+
`AppRegistry.registerComponent('otherTagName', () => App);`
|
|
41
|
+
);
|
|
42
|
+
await update(tree);
|
|
43
|
+
|
|
44
|
+
expect(tree.read('apps/products/src/main.tsx', 'utf-8')).toEqual(
|
|
45
|
+
`AppRegistry.registerComponent('otherTagName', () => App);`
|
|
46
|
+
);
|
|
47
|
+
});
|
|
48
|
+
});
|
package/src/utils/versions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroReactNativeBabelPresetVersion = exports.reactNativeAsyncStorageAsyncStorageVersion = exports.reactNativeConfigVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '14.0.
|
|
4
|
+
exports.nxVersion = '14.0.4';
|
|
5
5
|
exports.reactNativeVersion = '0.68.1';
|
|
6
6
|
exports.typesReactNativeVersion = '0.67.4';
|
|
7
7
|
exports.typesNodeVersion = '16.11.7';
|