@nrwl/react-native 15.9.0-beta.8 → 15.9.0-rc.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/executors.json +20 -0
- package/migrations.json +19 -0
- package/package.json +9 -9
- package/src/executors/build-android/build-android.impl.d.ts +2 -2
- package/src/executors/build-android/build-android.impl.js +31 -21
- package/src/executors/build-android/build-android.impl.js.map +1 -1
- package/src/executors/build-android/build-android.impl.ts +55 -28
- package/src/executors/build-android/schema.d.ts +27 -1
- package/src/executors/build-android/schema.json +79 -3
- package/src/executors/build-ios/build-ios.impl.d.ts +6 -0
- package/src/executors/build-ios/build-ios.impl.js +77 -0
- package/src/executors/build-ios/build-ios.impl.js.map +1 -0
- package/src/executors/build-ios/build-ios.impl.ts +118 -0
- package/src/executors/build-ios/compat.d.ts +2 -0
- package/src/executors/build-ios/compat.js +6 -0
- package/src/executors/build-ios/compat.js.map +1 -0
- package/src/executors/build-ios/schema.d.ts +22 -0
- package/src/executors/build-ios/schema.json +106 -0
- package/src/executors/bundle/schema.json +19 -1
- package/src/executors/pod-install/compat.d.ts +2 -0
- package/src/executors/pod-install/compat.js +6 -0
- package/src/executors/pod-install/compat.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.d.ts +6 -0
- package/src/executors/pod-install/pod-install.impl.js +15 -0
- package/src/executors/pod-install/pod-install.impl.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.ts +21 -0
- package/src/executors/pod-install/schema.d.ts +3 -0
- package/src/executors/pod-install/schema.json +18 -0
- package/src/executors/run-android/run-android.impl.js +5 -28
- package/src/executors/run-android/run-android.impl.js.map +1 -1
- package/src/executors/run-android/run-android.impl.ts +10 -27
- package/src/executors/run-android/schema.d.ts +18 -11
- package/src/executors/run-android/schema.json +59 -24
- package/src/executors/run-ios/run-ios.impl.js +7 -20
- package/src/executors/run-ios/run-ios.impl.js.map +1 -1
- package/src/executors/run-ios/run-ios.impl.ts +18 -21
- package/src/executors/run-ios/schema.d.ts +11 -13
- package/src/executors/run-ios/schema.json +61 -32
- package/src/executors/start/schema.d.ts +2 -0
- package/src/generators/application/application.spec.ts +15 -2
- package/src/generators/application/lib/add-detox.js +1 -1
- package/src/generators/application/lib/add-detox.js.map +1 -1
- package/src/generators/application/lib/add-project.js +11 -0
- package/src/generators/application/lib/add-project.js.map +1 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/init/init.js.map +1 -1
- package/src/generators/library/library.spec.ts +2 -2
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +1 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +1 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +1 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +75 -71
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +1 -1
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +37 -37
- package/src/migrations/update-15-0-0/add-babel-inputs.js +2 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +1 -1
- package/src/migrations/update-15-9-1/add-build-ios-target.d.ts +5 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js +34 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js.map +1 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +36 -0
- package/src/utils/add-jest.js +1 -0
- package/src/utils/add-jest.js.map +1 -1
- package/src/utils/get-cli-options.d.ts +8 -0
- package/src/utils/get-cli-options.js +31 -0
- package/src/utils/get-cli-options.js.map +1 -0
- package/src/utils/pod-install-task.d.ts +2 -2
- package/src/utils/pod-install-task.js +12 -3
- package/src/utils/pod-install-task.js.map +1 -1
- package/src/utils/symlink-task.d.ts +1 -1
- package/src/utils/symlink-task.js +2 -2
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
|
@@ -64,42 +64,46 @@ module.exports = (async () => {
|
|
|
64
64
|
);
|
|
65
65
|
await update(tree);
|
|
66
66
|
|
|
67
|
-
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
68
|
-
|
|
69
|
-
const {
|
|
67
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
68
|
+
.toMatchInlineSnapshot(`
|
|
69
|
+
"const { withNxMetro } = require('@nrwl/react-native');
|
|
70
|
+
const { getDefaultConfig } = require('metro-config');
|
|
70
71
|
|
|
71
|
-
module.exports = (async () => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
module.exports = (async () => {
|
|
73
|
+
const {
|
|
74
|
+
resolver: { sourceExts, assetExts },
|
|
75
|
+
} = await getDefaultConfig();
|
|
76
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
77
|
+
return withNxMetro(
|
|
78
|
+
{
|
|
79
|
+
transformer: {
|
|
80
|
+
getTransformOptions: async () => ({
|
|
81
|
+
transform: {
|
|
82
|
+
experimentalImportSupport: false,
|
|
83
|
+
inlineRequires: true,
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
87
|
+
},
|
|
88
|
+
resolver: {
|
|
89
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
90
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
91
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
92
|
+
},
|
|
83
93
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
98
|
-
extensions: [],
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
})();
|
|
102
|
-
`);
|
|
94
|
+
{
|
|
95
|
+
// Change this to true to see debugging info.
|
|
96
|
+
// Useful if you have issues resolving modules
|
|
97
|
+
projectRoot: __dirname,
|
|
98
|
+
watchFolders: [],
|
|
99
|
+
debug: false,
|
|
100
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
101
|
+
extensions: [],
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
})();
|
|
105
|
+
"
|
|
106
|
+
`);
|
|
103
107
|
});
|
|
104
108
|
|
|
105
109
|
it(`should not udpate metro.config.js if projectRoot already exists`, async () => {
|
|
@@ -145,44 +149,44 @@ module.exports = (async () => {
|
|
|
145
149
|
);
|
|
146
150
|
await update(tree);
|
|
147
151
|
|
|
148
|
-
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
149
|
-
`
|
|
150
|
-
const { withNxMetro } = require('@nrwl/react-native');
|
|
151
|
-
const { getDefaultConfig } = require('metro-config');
|
|
152
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
153
|
+
.toMatchInlineSnapshot(`
|
|
154
|
+
"const { withNxMetro } = require('@nrwl/react-native');
|
|
155
|
+
const { getDefaultConfig } = require('metro-config');
|
|
152
156
|
|
|
153
|
-
module.exports = (async () => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
157
|
+
module.exports = (async () => {
|
|
158
|
+
const {
|
|
159
|
+
resolver: { sourceExts, assetExts },
|
|
160
|
+
} = await getDefaultConfig();
|
|
161
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
162
|
+
return withNxMetro(
|
|
163
|
+
{
|
|
164
|
+
transformer: {
|
|
165
|
+
getTransformOptions: async () => ({
|
|
166
|
+
transform: {
|
|
167
|
+
experimentalImportSupport: false,
|
|
168
|
+
inlineRequires: true,
|
|
169
|
+
},
|
|
170
|
+
}),
|
|
171
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
172
|
+
},
|
|
173
|
+
resolver: {
|
|
174
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
175
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
176
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
177
|
+
},
|
|
165
178
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
// Useful if you have issues resolving modules
|
|
179
|
-
debug: false,
|
|
180
|
-
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
181
|
-
extensions: [],
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
})();
|
|
185
|
-
`
|
|
186
|
-
);
|
|
179
|
+
{
|
|
180
|
+
projectRoot: __dirname,
|
|
181
|
+
// Change this to true to see debugging info.
|
|
182
|
+
// Useful if you have issues resolving modules
|
|
183
|
+
debug: false,
|
|
184
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
185
|
+
extensions: [],
|
|
186
|
+
}
|
|
187
|
+
);
|
|
188
|
+
})();
|
|
189
|
+
"
|
|
190
|
+
`);
|
|
187
191
|
});
|
|
188
192
|
});
|
|
@@ -30,7 +30,7 @@ describe('Change from main tag to className tag', () => {
|
|
|
30
30
|
await update(tree);
|
|
31
31
|
|
|
32
32
|
expect(tree.read('apps/products/src/main.tsx', 'utf-8')).toEqual(
|
|
33
|
-
`AppRegistry.registerComponent('Products', () => App)
|
|
33
|
+
`AppRegistry.registerComponent('Products', () => App);\n`
|
|
34
34
|
);
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -147,44 +147,44 @@ module.exports = (async () => {
|
|
|
147
147
|
);
|
|
148
148
|
await update(tree);
|
|
149
149
|
|
|
150
|
-
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
151
|
-
`
|
|
152
|
-
const { withNxMetro } = require('@nrwl/react-native');
|
|
153
|
-
const { getDefaultConfig } = require('metro-config');
|
|
150
|
+
expect(tree.read('apps/products/metro.config.js', 'utf-8'))
|
|
151
|
+
.toMatchInlineSnapshot(`
|
|
152
|
+
"const { withNxMetro } = require('@nrwl/react-native');
|
|
153
|
+
const { getDefaultConfig } = require('metro-config');
|
|
154
154
|
|
|
155
|
-
module.exports = (async () => {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
155
|
+
module.exports = (async () => {
|
|
156
|
+
const {
|
|
157
|
+
resolver: { sourceExts, assetExts },
|
|
158
|
+
} = await getDefaultConfig();
|
|
159
|
+
// console.log(getModulesRunBeforeMainModule);
|
|
160
|
+
return withNxMetro(
|
|
161
|
+
{
|
|
162
|
+
transformer: {
|
|
163
|
+
getTransformOptions: async () => ({
|
|
164
|
+
transform: {
|
|
165
|
+
experimentalImportSupport: false,
|
|
166
|
+
inlineRequires: true,
|
|
167
|
+
},
|
|
168
|
+
}),
|
|
169
|
+
babelTransformerPath: require.resolve('react-native-svg-transformer'),
|
|
170
|
+
},
|
|
171
|
+
resolver: {
|
|
172
|
+
assetExts: assetExts.filter((ext) => ext !== 'svg'),
|
|
173
|
+
sourceExts: [...sourceExts, 'svg'],
|
|
174
|
+
resolverMainFields: ['sbmodern', 'browser', 'main'],
|
|
175
|
+
},
|
|
167
176
|
},
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
// Useful if you have issues resolving modules
|
|
181
|
-
debug: false,
|
|
182
|
-
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
183
|
-
extensions: [],
|
|
184
|
-
}
|
|
185
|
-
);
|
|
186
|
-
})();
|
|
187
|
-
`
|
|
188
|
-
);
|
|
177
|
+
{
|
|
178
|
+
projectRoot: __dirname,
|
|
179
|
+
// Change this to true to see debugging info.
|
|
180
|
+
// Useful if you have issues resolving modules
|
|
181
|
+
debug: false,
|
|
182
|
+
// all the file extensions used for imports other than 'ts', 'tsx', 'js', 'jsx'
|
|
183
|
+
extensions: [],
|
|
184
|
+
}
|
|
185
|
+
);
|
|
186
|
+
})();
|
|
187
|
+
"
|
|
188
|
+
`);
|
|
189
189
|
});
|
|
190
190
|
});
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
4
5
|
const add_babel_inputs_1 = require("@nrwl/js/src/utils/add-babel-inputs");
|
|
5
6
|
function default_1(tree) {
|
|
6
7
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
7
8
|
(0, add_babel_inputs_1.addBabelInputs)(tree);
|
|
9
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
8
10
|
});
|
|
9
11
|
}
|
|
10
12
|
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-babel-inputs.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"add-babel-inputs.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-15-0-0/add-babel-inputs.ts"],"names":[],"mappings":";;;AAAA,yCAAiD;AACjD,0EAAqE;AAErE,mBAA+B,IAAU;;QACvC,IAAA,iCAAc,EAAC,IAAI,CAAC,CAAC;QACrB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAHD,4BAGC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* Add build-ios target for react-native
|
|
7
|
+
*/
|
|
8
|
+
function update(tree) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const projects = (0, devkit_1.getProjects)(tree);
|
|
12
|
+
for (const [name, config] of projects.entries()) {
|
|
13
|
+
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') {
|
|
14
|
+
if (!config.targets['build-ios']) {
|
|
15
|
+
config.targets['build-ios'] = {
|
|
16
|
+
executor: '@nrwl/react-native:build-ios',
|
|
17
|
+
outputs: ['{projectRoot}/ios/build/Build'],
|
|
18
|
+
options: {},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (!config.targets['pod-install']) {
|
|
22
|
+
config.targets['pod-install'] = {
|
|
23
|
+
executor: '@nrwl/react-native:pod-install',
|
|
24
|
+
options: {},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
(0, devkit_1.updateProjectConfiguration)(tree, name, config);
|
|
29
|
+
}
|
|
30
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.default = update;
|
|
34
|
+
//# sourceMappingURL=add-build-ios-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-build-ios-target.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-15-9-1/add-build-ios-target.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AAEtB;;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,0CAAG,OAAO,CAAC,0CAAE,QAAQ,MAAK,0BAA0B,EAAE;gBACtE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;oBAChC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;wBAC5B,QAAQ,EAAE,8BAA8B;wBACxC,OAAO,EAAE,CAAC,+BAA+B,CAAC;wBAC1C,OAAO,EAAE,EAAE;qBACZ,CAAC;iBACH;gBACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;oBAClC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG;wBAC9B,QAAQ,EAAE,gCAAgC;wBAC1C,OAAO,EAAE,EAAE;qBACZ,CAAC;iBACH;aACF;YAED,IAAA,mCAA0B,EAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;SAChD;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;;CACzB;AAxBD,yBAwBC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { addProjectConfiguration, getProjects, Tree } from '@nrwl/devkit';
|
|
2
|
+
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
3
|
+
import update from './add-build-ios-target';
|
|
4
|
+
|
|
5
|
+
describe('add-build-ios-target', () => {
|
|
6
|
+
let tree: Tree;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
10
|
+
addProjectConfiguration(tree, 'product', {
|
|
11
|
+
root: 'apps/product',
|
|
12
|
+
sourceRoot: 'apps/product/src',
|
|
13
|
+
targets: {
|
|
14
|
+
start: {
|
|
15
|
+
executor: '@nrwl/react-native:start',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it(`should update project.json with target build-ios and pod-install`, async () => {
|
|
22
|
+
await update(tree);
|
|
23
|
+
|
|
24
|
+
getProjects(tree).forEach((project) => {
|
|
25
|
+
expect(project.targets['build-ios']).toEqual({
|
|
26
|
+
executor: '@nrwl/react-native:build-ios',
|
|
27
|
+
outputs: ['{projectRoot}/ios/build/Build'],
|
|
28
|
+
options: {},
|
|
29
|
+
});
|
|
30
|
+
expect(project.targets['pod-install']).toEqual({
|
|
31
|
+
executor: '@nrwl/react-native:pod-install',
|
|
32
|
+
options: {},
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
package/src/utils/add-jest.js
CHANGED
|
@@ -16,6 +16,7 @@ function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPack
|
|
|
16
16
|
setupFile: 'none',
|
|
17
17
|
compiler: 'babel',
|
|
18
18
|
skipPackageJson,
|
|
19
|
+
skipFormat: true,
|
|
19
20
|
});
|
|
20
21
|
// overwrite the jest.config.ts file because react native needs to have special transform property
|
|
21
22
|
const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'ts'}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-jest.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/add-jest.ts"],"names":[],"mappings":";;;;AACA,qCAAkD;AAElD,SAAsB,OAAO,CAC3B,IAAU,EACV,cAA+B,EAC/B,WAAmB,EACnB,cAAsB,EACtB,EAAW,EACX,eAAwB;;QAExB,IAAI,cAAc,KAAK,MAAM,EAAE;YAC7B,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAoB,EAAC,IAAI,EAAE;YAChD,EAAE;YACF,OAAO,EAAE,WAAW;YACpB,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,OAAO;YACjB,eAAe;
|
|
1
|
+
{"version":3,"file":"add-jest.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/add-jest.ts"],"names":[],"mappings":";;;;AACA,qCAAkD;AAElD,SAAsB,OAAO,CAC3B,IAAU,EACV,cAA+B,EAC/B,WAAmB,EACnB,cAAsB,EACtB,EAAW,EACX,eAAwB;;QAExB,IAAI,cAAc,KAAK,MAAM,EAAE;YAC7B,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;SACjB;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAoB,EAAC,IAAI,EAAE;YAChD,EAAE;YACF,OAAO,EAAE,WAAW;YACpB,UAAU,EAAE,IAAI;YAChB,eAAe,EAAE,IAAI;YACrB,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE,OAAO;YACjB,eAAe;YACf,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,kGAAkG;QAClG,MAAM,UAAU,GAAG,GAAG,cAAc,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG;kBACA,WAAW;;;;+CAIkB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;;;;GAI5D,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAEhC,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAtCD,0BAsCC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This function normalizes the options passed in to the Nx and returns an array of strings that can be passed to the React Native CLI.
|
|
3
|
+
* @param options Nx options
|
|
4
|
+
* @param optionKeysToIgnore Keys to ignore
|
|
5
|
+
* @param optionKeysInCamelName Keys that are in camel case. Most react native cli options are in kebab case, but some are in camel case.
|
|
6
|
+
* @returns options that can be passed to the React Native CLI
|
|
7
|
+
*/
|
|
8
|
+
export declare function getCliOptions<T>(options: T, optionKeysToIgnore?: string[], optionKeysInCamelName?: string[]): string[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCliOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
/**
|
|
6
|
+
* This function normalizes the options passed in to the Nx and returns an array of strings that can be passed to the React Native CLI.
|
|
7
|
+
* @param options Nx options
|
|
8
|
+
* @param optionKeysToIgnore Keys to ignore
|
|
9
|
+
* @param optionKeysInCamelName Keys that are in camel case. Most react native cli options are in kebab case, but some are in camel case.
|
|
10
|
+
* @returns options that can be passed to the React Native CLI
|
|
11
|
+
*/
|
|
12
|
+
function getCliOptions(options, optionKeysToIgnore = [], optionKeysInCamelName = []) {
|
|
13
|
+
return Object.keys(options).reduce((acc, optionKey) => {
|
|
14
|
+
const optionValue = options[optionKey];
|
|
15
|
+
if (!optionKeysToIgnore.includes(optionKey)) {
|
|
16
|
+
const cliKey = optionKeysInCamelName.includes(optionKey)
|
|
17
|
+
? (0, devkit_1.names)(optionKey).propertyName
|
|
18
|
+
: (0, devkit_1.names)(optionKey).fileName; // cli uses kebab case as default
|
|
19
|
+
if (typeof optionValue === 'boolean' && optionValue) {
|
|
20
|
+
// no need to pass in the value when it is true, just the flag name
|
|
21
|
+
acc.push(`--${cliKey}`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
acc.push(`--${cliKey}`, optionValue);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return acc;
|
|
28
|
+
}, []);
|
|
29
|
+
}
|
|
30
|
+
exports.getCliOptions = getCliOptions;
|
|
31
|
+
//# sourceMappingURL=get-cli-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-cli-options.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/get-cli-options.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAErC;;;;;;GAMG;AACH,SAAgB,aAAa,CAC3B,OAAU,EACV,qBAA+B,EAAE,EACjC,wBAAkC,EAAE;IAEpC,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;QACpD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAC3C,MAAM,MAAM,GAAG,qBAAqB,CAAC,QAAQ,CAAC,SAAS,CAAC;gBACtD,CAAC,CAAC,IAAA,cAAK,EAAC,SAAS,CAAC,CAAC,YAAY;gBAC/B,CAAC,CAAC,IAAA,cAAK,EAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,iCAAiC;YAChE,IAAI,OAAO,WAAW,KAAK,SAAS,IAAI,WAAW,EAAE;gBACnD,mEAAmE;gBACnE,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC;aACzB;iBAAM;gBACL,GAAG,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,EAAE,WAAW,CAAC,CAAC;aACtC;SACF;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AApBD,sCAoBC"}
|
|
@@ -4,5 +4,5 @@ import { GeneratorCallback } from '@nrwl/devkit';
|
|
|
4
4
|
* @param iosDirectory ios directory that contains Podfile
|
|
5
5
|
* @returns resolve with 0 if not error, reject with error otherwise
|
|
6
6
|
*/
|
|
7
|
-
export declare function runPodInstall(iosDirectory: string, install?: boolean): GeneratorCallback;
|
|
8
|
-
export declare function podInstall(iosDirectory: string): Promise<void>;
|
|
7
|
+
export declare function runPodInstall(iosDirectory: string, install?: boolean, buildFolder?: string): GeneratorCallback;
|
|
8
|
+
export declare function podInstall(iosDirectory: string, buildFolder?: string): Promise<void>;
|
|
@@ -5,6 +5,8 @@ const child_process_1 = require("child_process");
|
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const chalk = require("chalk");
|
|
7
7
|
const devkit_1 = require("@nrwl/devkit");
|
|
8
|
+
const fs_extra_1 = require("fs-extra");
|
|
9
|
+
const path_1 = require("path");
|
|
8
10
|
const podInstallErrorMessage = `
|
|
9
11
|
Running ${chalk.bold('pod install')} failed, see above.
|
|
10
12
|
Do you have CocoaPods (https://cocoapods.org/) installed?
|
|
@@ -20,7 +22,7 @@ ${chalk.bold('sudo xcode-select --switch /Applications/Xcode.app')}
|
|
|
20
22
|
* @param iosDirectory ios directory that contains Podfile
|
|
21
23
|
* @returns resolve with 0 if not error, reject with error otherwise
|
|
22
24
|
*/
|
|
23
|
-
function runPodInstall(iosDirectory, install = true) {
|
|
25
|
+
function runPodInstall(iosDirectory, install = true, buildFolder) {
|
|
24
26
|
return () => {
|
|
25
27
|
if ((0, os_1.platform)() !== 'darwin') {
|
|
26
28
|
devkit_1.logger.info('Skipping `pod install` on non-darwin platform');
|
|
@@ -31,17 +33,24 @@ function runPodInstall(iosDirectory, install = true) {
|
|
|
31
33
|
return;
|
|
32
34
|
}
|
|
33
35
|
devkit_1.logger.info(`Running \`pod install\` from "${iosDirectory}"`);
|
|
34
|
-
return podInstall(iosDirectory);
|
|
36
|
+
return podInstall(iosDirectory, buildFolder);
|
|
35
37
|
};
|
|
36
38
|
}
|
|
37
39
|
exports.runPodInstall = runPodInstall;
|
|
38
|
-
function podInstall(iosDirectory) {
|
|
40
|
+
function podInstall(iosDirectory, buildFolder) {
|
|
39
41
|
return new Promise((resolve, reject) => {
|
|
40
42
|
const result = (0, child_process_1.execSync)('pod install', {
|
|
41
43
|
cwd: iosDirectory,
|
|
42
44
|
});
|
|
43
45
|
devkit_1.logger.info(result.toString());
|
|
44
46
|
if (result.toString().includes('Pod installation complete')) {
|
|
47
|
+
// Remove build folder after pod install
|
|
48
|
+
if (buildFolder) {
|
|
49
|
+
buildFolder = (0, path_1.join)(iosDirectory, buildFolder);
|
|
50
|
+
if ((0, fs_extra_1.existsSync)(buildFolder)) {
|
|
51
|
+
(0, fs_extra_1.rmdirSync)(buildFolder, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
45
54
|
resolve();
|
|
46
55
|
}
|
|
47
56
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pod-install-task.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/pod-install-task.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,2BAA8B;AAC9B,+BAA+B;AAC/B,yCAAyD;
|
|
1
|
+
{"version":3,"file":"pod-install-task.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/pod-install-task.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,2BAA8B;AAC9B,+BAA+B;AAC/B,yCAAyD;AACzD,uCAAiD;AACjD,+BAA4B;AAE5B,MAAM,sBAAsB,GAAG;UACrB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;;;;EAIjC,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC;;;EAG5C,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC;CACjE,CAAC;AAEF;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,YAAoB,EACpB,UAAmB,IAAI,EACvB,WAAoB;IAEpB,OAAO,GAAG,EAAE;QACV,IAAI,IAAA,aAAQ,GAAE,KAAK,QAAQ,EAAE;YAC3B,eAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAC7D,OAAO;SACR;QAED,IAAI,CAAC,OAAO,EAAE;YACZ,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACtC,OAAO;SACR;QAED,eAAM,CAAC,IAAI,CAAC,iCAAiC,YAAY,GAAG,CAAC,CAAC;QAE9D,OAAO,UAAU,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC;AApBD,sCAoBC;AAED,SAAgB,UAAU,CACxB,YAAoB,EACpB,WAAoB;IAEpB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,aAAa,EAAE;YACrC,GAAG,EAAE,YAAY;SAClB,CAAC,CAAC;QACH,eAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/B,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE;YAC3D,wCAAwC;YACxC,IAAI,WAAW,EAAE;gBACf,WAAW,GAAG,IAAA,WAAI,EAAC,YAAY,EAAE,WAAW,CAAC,CAAC;gBAC9C,IAAI,IAAA,qBAAU,EAAC,WAAW,CAAC,EAAE;oBAC3B,IAAA,oBAAS,EAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC7C;aACF;YACD,OAAO,EAAE,CAAC;SACX;aAAM;YACL,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAtBD,gCAsBC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { GeneratorCallback } from '@nrwl/devkit';
|
|
2
|
-
export declare function runSymlink(
|
|
2
|
+
export declare function runSymlink(workspaceRoot: string, projectRoot: string): GeneratorCallback;
|
|
@@ -4,11 +4,11 @@ exports.runSymlink = void 0;
|
|
|
4
4
|
const ensure_node_modules_symlink_1 = require("./ensure-node-modules-symlink");
|
|
5
5
|
const chalk = require("chalk");
|
|
6
6
|
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
function runSymlink(
|
|
7
|
+
function runSymlink(workspaceRoot, projectRoot) {
|
|
8
8
|
return () => {
|
|
9
9
|
devkit_1.logger.info(`creating symlinks for ${chalk.bold(projectRoot)}`);
|
|
10
10
|
try {
|
|
11
|
-
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(
|
|
11
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(workspaceRoot, projectRoot);
|
|
12
12
|
}
|
|
13
13
|
catch (_a) {
|
|
14
14
|
throw new Error(`Failed to create symlinks for ${chalk.bold(projectRoot)}`);
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export declare const reactNativeVersion = "0.71.4";
|
|
|
3
3
|
export declare const typesReactNativeVersion = "0.71.3";
|
|
4
4
|
export declare const typesNodeVersion = "18.14.4";
|
|
5
5
|
export declare const metroVersion = "0.74.1";
|
|
6
|
-
export declare const reactNativeCommunityCli = "10.2.
|
|
7
|
-
export declare const reactNativeCommunityCliIos = "10.2.
|
|
6
|
+
export declare const reactNativeCommunityCli = "10.2.1";
|
|
7
|
+
export declare const reactNativeCommunityCliIos = "10.2.1";
|
|
8
8
|
export declare const reactNativeCommunityCliAndroid = "10.2.0";
|
|
9
9
|
export declare const reactVersion = "18.2.0";
|
|
10
10
|
export declare const reactDomVersion = "18.2.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -6,8 +6,8 @@ exports.reactNativeVersion = '0.71.4';
|
|
|
6
6
|
exports.typesReactNativeVersion = '0.71.3';
|
|
7
7
|
exports.typesNodeVersion = '18.14.4';
|
|
8
8
|
exports.metroVersion = '0.74.1';
|
|
9
|
-
exports.reactNativeCommunityCli = '10.2.
|
|
10
|
-
exports.reactNativeCommunityCliIos = '10.2.
|
|
9
|
+
exports.reactNativeCommunityCli = '10.2.1';
|
|
10
|
+
exports.reactNativeCommunityCliIos = '10.2.1';
|
|
11
11
|
exports.reactNativeCommunityCliAndroid = '10.2.0';
|
|
12
12
|
exports.reactVersion = '18.2.0';
|
|
13
13
|
exports.reactDomVersion = '18.2.0';
|