@react-native/core-cli-utils 0.87.0-nightly-20260519-58cd1bf58 → 0.87.0-nightly-20260528-eaf770433
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/.eslintrc.json +6 -0
- package/README.md +11 -48
- package/package.json +8 -23
- package/src/index.js +21 -0
- package/src/private/android.js +129 -0
- package/src/private/app.js +247 -0
- package/src/private/apple.js +239 -0
- package/src/private/clean.js +227 -0
- package/{dist/private/types.js.flow → src/private/types.js} +2 -0
- package/src/private/utils.js +81 -0
- package/{dist/public/version.js.flow → src/public/version.js} +20 -15
- package/dist/index.d.ts +0 -26
- package/dist/index.js +0 -48
- package/dist/index.js.flow +0 -25
- package/dist/private/android.d.ts +0 -29
- package/dist/private/android.js +0 -74
- package/dist/private/android.js.flow +0 -41
- package/dist/private/app.d.ts +0 -37
- package/dist/private/app.js +0 -172
- package/dist/private/app.js.flow +0 -71
- package/dist/private/apple.d.ts +0 -56
- package/dist/private/apple.js +0 -179
- package/dist/private/apple.js.flow +0 -75
- package/dist/private/clean.d.ts +0 -59
- package/dist/private/clean.js +0 -140
- package/dist/private/clean.js.flow +0 -76
- package/dist/private/types.d.ts +0 -15
- package/dist/private/types.js +0 -1
- package/dist/private/utils.d.ts +0 -30
- package/dist/private/utils.js +0 -51
- package/dist/private/utils.js.flow +0 -37
- package/dist/public/version.d.ts +0 -33
- package/dist/public/version.js +0 -27
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*::
|
|
12
|
+
import type {Task} from './types';
|
|
13
|
+
import type {ExecaPromise} from 'execa';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const {assertDependencies, isOnPath, task} = require('./utils');
|
|
17
|
+
const execa = require('execa');
|
|
18
|
+
const fs = require('fs');
|
|
19
|
+
const path = require('path');
|
|
20
|
+
|
|
21
|
+
/*::
|
|
22
|
+
type AppleBuildMode = 'Debug' | 'Release';
|
|
23
|
+
|
|
24
|
+
type AppleBuildOptions = {
|
|
25
|
+
isWorkspace: boolean,
|
|
26
|
+
name: string,
|
|
27
|
+
mode: AppleBuildMode,
|
|
28
|
+
scheme?: string,
|
|
29
|
+
destination: 'device' | 'simulator' | string,
|
|
30
|
+
...AppleOptions,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
type AppleBootstrapOption = {
|
|
34
|
+
// Enabled by default
|
|
35
|
+
hermes: boolean,
|
|
36
|
+
newArchitecture: boolean,
|
|
37
|
+
frameworks?: 'static' | 'dynamic',
|
|
38
|
+
...AppleOptions,
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type AppleInstallApp = {
|
|
42
|
+
// Install the app on a simulator or device, typically this is the description from
|
|
43
|
+
// `xcrun simctl list devices`
|
|
44
|
+
device: string,
|
|
45
|
+
appPath: string,
|
|
46
|
+
bundleId: string,
|
|
47
|
+
...AppleOptions,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
type AppleOptions = {
|
|
51
|
+
// The directory where the Xcode project is located
|
|
52
|
+
cwd: string,
|
|
53
|
+
// The environment variables to pass to the build command
|
|
54
|
+
env?: {[key: string]: string | void, ...},
|
|
55
|
+
};
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
function checkPodfileInSyncWithManifest(
|
|
59
|
+
lockfilePath /*: string */,
|
|
60
|
+
manifestLockfilePath /*: string */,
|
|
61
|
+
) {
|
|
62
|
+
try {
|
|
63
|
+
const expected = fs.readFileSync(lockfilePath, 'utf8');
|
|
64
|
+
const found = fs.readFileSync(manifestLockfilePath, 'utf8');
|
|
65
|
+
if (expected !== found) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
'Please run: yarn bootstrap ios, Podfile.lock and Pods/Manifest.lock are out of sync',
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
} catch (e /*: unknown */) {
|
|
71
|
+
throw new Error('Please run: yarn run bootstrap ios: ' + String(e));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const FIRST = 1,
|
|
76
|
+
SECOND = 2,
|
|
77
|
+
THIRD = 3,
|
|
78
|
+
FOURTH = 4,
|
|
79
|
+
FIFTH = 5;
|
|
80
|
+
|
|
81
|
+
function getNodePackagePath(packageName /*: string */) /*: string */ {
|
|
82
|
+
// $FlowFixMe[prop-missing] type definition is incomplete
|
|
83
|
+
return require.resolve(packageName, {cwd: [process.cwd(), ...module.paths]});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/*::
|
|
87
|
+
type BootstrapTasks = {
|
|
88
|
+
cleanupBuildFolder: Task<void>,
|
|
89
|
+
runCodegen: Task<void>,
|
|
90
|
+
validate: Task<void>,
|
|
91
|
+
installRubyGems: Task<ExecaPromise>,
|
|
92
|
+
installDependencies: Task<ExecaPromise>,
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
type BuildTasks = {
|
|
96
|
+
validate: Task<void>,
|
|
97
|
+
hasPodsInstalled: Task<void>,
|
|
98
|
+
build: Task<ExecaPromise>,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type InstallTasks = {
|
|
102
|
+
validate: Task<void>,
|
|
103
|
+
install: Task<ExecaPromise>,
|
|
104
|
+
};
|
|
105
|
+
*/
|
|
106
|
+
|
|
107
|
+
/* eslint sort-keys: "off" */
|
|
108
|
+
const tasks = {
|
|
109
|
+
// 1. Setup your environment for building the iOS apps
|
|
110
|
+
bootstrap: (options /*: AppleBootstrapOption */) /*: BootstrapTasks */ => ({
|
|
111
|
+
cleanupBuildFolder: task(FIRST, 'Cleanup build folder', () => {
|
|
112
|
+
execa.sync('rm', ['-rf', 'build'], {
|
|
113
|
+
cwd: options.cwd,
|
|
114
|
+
});
|
|
115
|
+
}),
|
|
116
|
+
runCodegen: task(SECOND, 'Run codegen', () => {
|
|
117
|
+
const reactNativePath = path.dirname(getNodePackagePath('react-native'));
|
|
118
|
+
const codegenScript = path.join(
|
|
119
|
+
reactNativePath,
|
|
120
|
+
'scripts',
|
|
121
|
+
'generate-codegen-artifacts.js',
|
|
122
|
+
);
|
|
123
|
+
execa.sync('node', [
|
|
124
|
+
codegenScript,
|
|
125
|
+
'-p',
|
|
126
|
+
process.cwd(),
|
|
127
|
+
'-o',
|
|
128
|
+
options.cwd,
|
|
129
|
+
'-t',
|
|
130
|
+
'ios',
|
|
131
|
+
]);
|
|
132
|
+
}),
|
|
133
|
+
validate: task(THIRD, 'Check Cocoapods and bundle are available', () => {
|
|
134
|
+
assertDependencies(
|
|
135
|
+
isOnPath('pod', 'CocoaPods'),
|
|
136
|
+
isOnPath('bundle', "Bundler to manage Ruby's gems"),
|
|
137
|
+
);
|
|
138
|
+
}),
|
|
139
|
+
installRubyGems: task(FOURTH, 'Install Ruby Gems', () =>
|
|
140
|
+
execa('bundle', ['install'], {
|
|
141
|
+
cwd: options.cwd,
|
|
142
|
+
}),
|
|
143
|
+
),
|
|
144
|
+
installDependencies: task(FIFTH, 'Install CocoaPods dependencies', () => {
|
|
145
|
+
const env /*: {[string]: string | void} */ = {
|
|
146
|
+
RCT_NEW_ARCH_ENABLED: options.newArchitecture ? '1' : '0',
|
|
147
|
+
USE_FRAMEWORKS: options.frameworks,
|
|
148
|
+
USE_HERMES: options.hermes ? '1' : '0',
|
|
149
|
+
RCT_IGNORE_PODS_DEPRECATION: '1',
|
|
150
|
+
};
|
|
151
|
+
if (options.frameworks == null) {
|
|
152
|
+
delete env.USE_FRAMEWORKS;
|
|
153
|
+
}
|
|
154
|
+
return execa('bundle', ['exec', 'pod', 'install'], {
|
|
155
|
+
cwd: options.cwd,
|
|
156
|
+
env,
|
|
157
|
+
});
|
|
158
|
+
}),
|
|
159
|
+
}),
|
|
160
|
+
|
|
161
|
+
// 2. Build the iOS app using a setup environment
|
|
162
|
+
build: (
|
|
163
|
+
options /*: AppleBuildOptions */,
|
|
164
|
+
...args /*: ReadonlyArray<string> */
|
|
165
|
+
) /*: BuildTasks */ => ({
|
|
166
|
+
validate: task(
|
|
167
|
+
FIRST,
|
|
168
|
+
"Check you've run xcode-select --install for xcodebuild",
|
|
169
|
+
() => {
|
|
170
|
+
assertDependencies(isOnPath('xcodebuild', 'Xcode Commandline Tools'));
|
|
171
|
+
},
|
|
172
|
+
),
|
|
173
|
+
hasPodsInstalled: task(FIRST, 'Check Pods are installed', () => {
|
|
174
|
+
for (const file of ['Podfile.lock', 'Pods']) {
|
|
175
|
+
try {
|
|
176
|
+
fs.accessSync(
|
|
177
|
+
path.join(options.cwd, file),
|
|
178
|
+
/* eslint-disable-next-line no-bitwise */
|
|
179
|
+
fs.constants.F_OK | fs.constants.R_OK,
|
|
180
|
+
);
|
|
181
|
+
} catch (e /*: unknown */) {
|
|
182
|
+
throw new Error('Please run: yarn run bootstrap ios: ' + String(e));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
checkPodfileInSyncWithManifest(
|
|
186
|
+
path.join(options.cwd, 'Podfile.lock'),
|
|
187
|
+
path.join(options.cwd, 'Pods/Manifest.lock'),
|
|
188
|
+
);
|
|
189
|
+
}),
|
|
190
|
+
build: task(SECOND, 'build an app artifact', () => {
|
|
191
|
+
const _args = [
|
|
192
|
+
options.isWorkspace ? '-workspace' : '-project',
|
|
193
|
+
options.name,
|
|
194
|
+
'-configuration',
|
|
195
|
+
options.mode,
|
|
196
|
+
];
|
|
197
|
+
if (options.scheme != null) {
|
|
198
|
+
_args.push('-scheme', options.scheme);
|
|
199
|
+
}
|
|
200
|
+
if (options.destination != null) {
|
|
201
|
+
switch (options.destination) {
|
|
202
|
+
case 'simulator':
|
|
203
|
+
_args.push('-sdk', 'iphonesimulator');
|
|
204
|
+
break;
|
|
205
|
+
case 'device':
|
|
206
|
+
default:
|
|
207
|
+
_args.push('-destination', options.destination);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
_args.push(...args);
|
|
213
|
+
return execa('xcodebuild', _args, {cwd: options.cwd, env: options.env});
|
|
214
|
+
}),
|
|
215
|
+
}),
|
|
216
|
+
|
|
217
|
+
// 3. Install the built app on a simulator or device
|
|
218
|
+
ios: {
|
|
219
|
+
install: (options /*: AppleInstallApp */) /*: InstallTasks */ => ({
|
|
220
|
+
validate: task(
|
|
221
|
+
FIRST,
|
|
222
|
+
"Check you've run xcode-select --install for xcrun",
|
|
223
|
+
() => {
|
|
224
|
+
assertDependencies(
|
|
225
|
+
isOnPath('xcrun', 'An Xcode Commandline tool: xcrun'),
|
|
226
|
+
);
|
|
227
|
+
},
|
|
228
|
+
),
|
|
229
|
+
install: task(SECOND, 'Install the app on a simulator', () =>
|
|
230
|
+
execa('xcrun', ['simctl', 'install', options.device, options.appPath], {
|
|
231
|
+
cwd: options.cwd,
|
|
232
|
+
env: options.env,
|
|
233
|
+
}),
|
|
234
|
+
),
|
|
235
|
+
}),
|
|
236
|
+
},
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
module.exports = {tasks};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*::
|
|
12
|
+
import type {Task} from './types';
|
|
13
|
+
import type {ExecaPromise, Options as ExecaOptions} from 'execa';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
assertDependencies,
|
|
18
|
+
isMacOS,
|
|
19
|
+
isOnPath,
|
|
20
|
+
isWindows,
|
|
21
|
+
task,
|
|
22
|
+
} = require('./utils');
|
|
23
|
+
const execa = require('execa');
|
|
24
|
+
const {existsSync, readdirSync, rm} = require('fs');
|
|
25
|
+
const os = require('os');
|
|
26
|
+
const path = require('path');
|
|
27
|
+
|
|
28
|
+
const FIRST = 1,
|
|
29
|
+
SECOND = 2;
|
|
30
|
+
|
|
31
|
+
const rmrf = (pathname /*: string */) => {
|
|
32
|
+
if (!existsSync(pathname)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
rm(pathname, {force: true, maxRetries: 3, recursive: true});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Removes the contents of a directory matching a given pattern, but keeps the directory.
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
function deleteDirectoryContents(
|
|
43
|
+
directory /*: string */,
|
|
44
|
+
filePattern /*: RegExp */,
|
|
45
|
+
) /*: () => Promise<void> */ {
|
|
46
|
+
return async function deleteDirectoryContentsAction() {
|
|
47
|
+
const base = path.dirname(directory);
|
|
48
|
+
const files = readdirSync(base).filter((filename /*: string */) =>
|
|
49
|
+
filePattern.test(filename),
|
|
50
|
+
);
|
|
51
|
+
for (const filename of files) {
|
|
52
|
+
rmrf(path.join(base, filename));
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Removes a directory recursively.
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
function deleteDirectory(directory /*: string */) /*: () => Promise<void> */ {
|
|
62
|
+
return async function cleanDirectoryAction() {
|
|
63
|
+
rmrf(directory);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Deletes the contents of the tmp directory matching a given pattern.
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
function deleteTmpDirectoryContents(
|
|
72
|
+
filepattern /*: RegExp */,
|
|
73
|
+
) /*: () => Promise<void> */ {
|
|
74
|
+
return deleteDirectoryContents(os.tmpdir(), filepattern);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const platformGradlew = isWindows ? 'gradlew.bat' : 'gradlew';
|
|
78
|
+
|
|
79
|
+
/*::
|
|
80
|
+
type CocoaPodsClean = {
|
|
81
|
+
clean: Task<ExecaPromise>,
|
|
82
|
+
};
|
|
83
|
+
type AndroidClean = {
|
|
84
|
+
validate: Task<void>,
|
|
85
|
+
run: Task<ExecaPromise>,
|
|
86
|
+
};
|
|
87
|
+
type MetroClean = {
|
|
88
|
+
metro: Task<Promise<void>>,
|
|
89
|
+
haste: Task<Promise<void>>,
|
|
90
|
+
react_native: Task<Promise<void>>,
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type NpmClean = {
|
|
94
|
+
node_modules: Task<Promise<void>>,
|
|
95
|
+
verify_cache: Task<ExecaPromise>,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type WatchmanClean = {
|
|
99
|
+
stop: Task<ExecaPromise>,
|
|
100
|
+
cache: Task<ExecaPromise>,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
type YarnClean = {
|
|
104
|
+
clean: Task<ExecaPromise>,
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
type CleanTasks = {
|
|
108
|
+
android: (andoirdSrcDir: ?string, opts?: ExecaOptions) => AndroidClean,
|
|
109
|
+
cocoapods: CocoaPodsClean,
|
|
110
|
+
metro: () => MetroClean,
|
|
111
|
+
npm: (projectRootDir: string) => NpmClean,
|
|
112
|
+
watchman: (projectRootDir: string) => WatchmanClean,
|
|
113
|
+
yarn: (projectRootDir: string) => YarnClean,
|
|
114
|
+
cocoapods?: (projectRootDir: string) => CocoaPodsClean,
|
|
115
|
+
};
|
|
116
|
+
*/
|
|
117
|
+
|
|
118
|
+
// The tasks that cleanup various build artefacts.
|
|
119
|
+
/* eslint sort-keys: "off" */
|
|
120
|
+
const tasks /*: CleanTasks */ = {
|
|
121
|
+
/**
|
|
122
|
+
* Cleans up the Android Gradle cache
|
|
123
|
+
*/
|
|
124
|
+
android: (androidSrcDir /*: ?string */, opts /*: ?ExecaOptions */) => ({
|
|
125
|
+
validate: task(FIRST, 'Check gradlew is available', () => {
|
|
126
|
+
assertDependencies(isOnPath(platformGradlew, 'Gradle wrapper'));
|
|
127
|
+
}),
|
|
128
|
+
run: task(SECOND, '🧹 Clean Gradle cache', () => {
|
|
129
|
+
const gradlew = path.join(androidSrcDir ?? 'android', platformGradlew);
|
|
130
|
+
const script = path.basename(gradlew);
|
|
131
|
+
const cwd = path.dirname(gradlew);
|
|
132
|
+
return execa(isWindows ? script : './' + script, ['clean'], {
|
|
133
|
+
cwd,
|
|
134
|
+
...opts,
|
|
135
|
+
});
|
|
136
|
+
}),
|
|
137
|
+
}),
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Aggressively cleans up all Metro caches.
|
|
141
|
+
*/
|
|
142
|
+
metro: () => ({
|
|
143
|
+
metro: task(
|
|
144
|
+
FIRST,
|
|
145
|
+
'🧹 Clean Metro cache',
|
|
146
|
+
deleteTmpDirectoryContents(/^metro-.+/),
|
|
147
|
+
),
|
|
148
|
+
haste: task(
|
|
149
|
+
FIRST,
|
|
150
|
+
'🧹 Clean Haste cache',
|
|
151
|
+
deleteTmpDirectoryContents(/^haste-map-.+/),
|
|
152
|
+
),
|
|
153
|
+
react_native: task(
|
|
154
|
+
FIRST,
|
|
155
|
+
'🧹 Clean React Native cache',
|
|
156
|
+
deleteTmpDirectoryContents(/^react-.+/),
|
|
157
|
+
),
|
|
158
|
+
}),
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Cleans up the `node_modules` folder and optionally garbage collects the npm cache.
|
|
162
|
+
*/
|
|
163
|
+
npm: (projectRootDir /*: string */) => ({
|
|
164
|
+
node_modules: task(
|
|
165
|
+
FIRST,
|
|
166
|
+
'🧹 Clean node_modules',
|
|
167
|
+
deleteDirectory(path.join(projectRootDir, 'node_modules')),
|
|
168
|
+
),
|
|
169
|
+
verify_cache: task(
|
|
170
|
+
SECOND,
|
|
171
|
+
'🔬 Verify npm cache',
|
|
172
|
+
(opts /*: ?ExecaOptions */) =>
|
|
173
|
+
execa('npm', ['cache', 'verify'], {cwd: projectRootDir, ...opts}),
|
|
174
|
+
),
|
|
175
|
+
}),
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Stops Watchman and clears its cache
|
|
179
|
+
*/
|
|
180
|
+
watchman: (projectRootDir /*: string */) => ({
|
|
181
|
+
stop: task(FIRST, '✋ Stop Watchman', (opts /*: ?ExecaOptions */) =>
|
|
182
|
+
execa(isWindows ? 'tskill' : 'killall', ['watchman'], {
|
|
183
|
+
cwd: projectRootDir,
|
|
184
|
+
...opts,
|
|
185
|
+
}),
|
|
186
|
+
),
|
|
187
|
+
cache: task(
|
|
188
|
+
SECOND,
|
|
189
|
+
'🧹 Delete Watchman cache',
|
|
190
|
+
(opts /*: ?ExecaOptions */) =>
|
|
191
|
+
execa('watchman', ['watch-del-all'], {cwd: projectRootDir, ...opts}),
|
|
192
|
+
),
|
|
193
|
+
}),
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Cleans up the Yarn cache
|
|
197
|
+
*/
|
|
198
|
+
yarn: (projectRootDir /*: string */) => ({
|
|
199
|
+
clean: task(FIRST, '🧹 Clean Yarn cache', (opts /*: ?ExecaOptions */) =>
|
|
200
|
+
execa('yarn', ['cache', 'clean'], {cwd: projectRootDir, ...opts}),
|
|
201
|
+
),
|
|
202
|
+
}),
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
if (isMacOS) {
|
|
206
|
+
/**
|
|
207
|
+
* Cleans up the local and global CocoaPods cache
|
|
208
|
+
*/
|
|
209
|
+
tasks.cocoapods = (projectRootDir /*: string */) => ({
|
|
210
|
+
clean: task(
|
|
211
|
+
FIRST,
|
|
212
|
+
'🧹 Clean CocoaPods pod cache',
|
|
213
|
+
(opts /*: ?ExecaOptions */) =>
|
|
214
|
+
execa('bundle', ['exec', 'pod', 'deintegrate'], {
|
|
215
|
+
cwd: projectRootDir,
|
|
216
|
+
...opts,
|
|
217
|
+
}),
|
|
218
|
+
),
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
module.exports = {
|
|
223
|
+
deleteDirectory,
|
|
224
|
+
deleteDirectoryContents,
|
|
225
|
+
deleteTmpDirectoryContents,
|
|
226
|
+
tasks,
|
|
227
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict-local
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*::
|
|
12
|
+
import type {Task} from './types';
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const execa = require('execa');
|
|
16
|
+
const os = require('os');
|
|
17
|
+
|
|
18
|
+
function task /*:: <R> */(
|
|
19
|
+
order /*: number */,
|
|
20
|
+
label /*: string */,
|
|
21
|
+
action /*: Task<R>['action'] */,
|
|
22
|
+
) /*: Task<R> */ {
|
|
23
|
+
return {
|
|
24
|
+
action,
|
|
25
|
+
label,
|
|
26
|
+
order,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const isWindows = os.platform() === 'win32';
|
|
31
|
+
const isMacOS = os.platform() === 'darwin';
|
|
32
|
+
|
|
33
|
+
const toPascalCase = (label /*: string */) /*: string */ =>
|
|
34
|
+
label.length === 0 ? '' : label[0].toUpperCase() + label.slice(1);
|
|
35
|
+
|
|
36
|
+
/*::
|
|
37
|
+
type PathCheckResult = {
|
|
38
|
+
found: boolean,
|
|
39
|
+
dep: string,
|
|
40
|
+
description: string,
|
|
41
|
+
};
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
function isOnPath(
|
|
45
|
+
dep /*: string */,
|
|
46
|
+
description /*: string */,
|
|
47
|
+
) /*: PathCheckResult */ {
|
|
48
|
+
const cmd = isWindows ? ['where', [dep]] : ['command', ['-v', dep]];
|
|
49
|
+
try {
|
|
50
|
+
return {
|
|
51
|
+
dep,
|
|
52
|
+
description,
|
|
53
|
+
found: execa.sync(...cmd).exitCode === 0,
|
|
54
|
+
};
|
|
55
|
+
} catch {
|
|
56
|
+
return {
|
|
57
|
+
dep,
|
|
58
|
+
description,
|
|
59
|
+
found: false,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function assertDependencies(
|
|
65
|
+
...deps /*: ReadonlyArray<ReturnType<typeof isOnPath>> */
|
|
66
|
+
) {
|
|
67
|
+
for (const {found, dep, description} of deps) {
|
|
68
|
+
if (!found) {
|
|
69
|
+
throw new Error(`"${dep}" not found, ${description}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
module.exports = {
|
|
75
|
+
assertDependencies,
|
|
76
|
+
isMacOS,
|
|
77
|
+
isOnPath,
|
|
78
|
+
isWindows,
|
|
79
|
+
task,
|
|
80
|
+
toPascalCase,
|
|
81
|
+
};
|
|
@@ -26,24 +26,29 @@
|
|
|
26
26
|
//
|
|
27
27
|
// For react-native@0.75.0 you have to have a version of XCode >= 12
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
ANDROID_NDK:
|
|
31
|
-
ANDROID_SDK:
|
|
29
|
+
const android = {
|
|
30
|
+
ANDROID_NDK: '>= 23.x',
|
|
31
|
+
ANDROID_SDK: '>= 33.x',
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
const apple = {
|
|
35
|
+
COCOAPODS: '>= 1.10.0',
|
|
36
|
+
XCODE: '>= 12.x',
|
|
37
|
+
};
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
BUN:
|
|
38
|
-
JAVA:
|
|
39
|
-
NODE_JS:
|
|
40
|
-
NPM:
|
|
41
|
-
RUBY:
|
|
42
|
-
YARN:
|
|
39
|
+
const common = {
|
|
40
|
+
BUN: '>= 1.0.0',
|
|
41
|
+
JAVA: '>= 17 <= 20',
|
|
42
|
+
NODE_JS: '>= 18',
|
|
43
|
+
NPM: '>= 4.x',
|
|
44
|
+
RUBY: '>= 2.6.10',
|
|
45
|
+
YARN: '>= 1.10.x',
|
|
43
46
|
};
|
|
44
47
|
|
|
45
|
-
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
...
|
|
48
|
+
const all = {
|
|
49
|
+
...apple,
|
|
50
|
+
...android,
|
|
51
|
+
...common,
|
|
49
52
|
};
|
|
53
|
+
|
|
54
|
+
module.exports = {all, android, apple, common};
|
package/dist/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { tasks as _android } from "./private/android.js";
|
|
12
|
-
import { tasks as _app } from "./private/app.js";
|
|
13
|
-
import { tasks as _apple } from "./private/apple.js";
|
|
14
|
-
import { tasks as _clean } from "./private/clean.js";
|
|
15
|
-
import * as _version from "./public/version.js";
|
|
16
|
-
export declare const android: typeof _android;
|
|
17
|
-
export declare type android = typeof android;
|
|
18
|
-
export declare const app: typeof _app;
|
|
19
|
-
export declare type app = typeof app;
|
|
20
|
-
export declare const apple: typeof _apple;
|
|
21
|
-
export declare type apple = typeof apple;
|
|
22
|
-
export declare const clean: typeof _clean;
|
|
23
|
-
export declare type clean = typeof clean;
|
|
24
|
-
export declare const version: typeof _version;
|
|
25
|
-
export declare type version = typeof version;
|
|
26
|
-
export type { Task } from "./private/types";
|
package/dist/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true,
|
|
5
|
-
});
|
|
6
|
-
exports.version =
|
|
7
|
-
exports.clean =
|
|
8
|
-
exports.apple =
|
|
9
|
-
exports.app =
|
|
10
|
-
exports.android =
|
|
11
|
-
void 0;
|
|
12
|
-
var _android2 = require("./private/android.js");
|
|
13
|
-
var _app2 = require("./private/app.js");
|
|
14
|
-
var _apple2 = require("./private/apple.js");
|
|
15
|
-
var _clean2 = require("./private/clean.js");
|
|
16
|
-
var _version = _interopRequireWildcard(require("./public/version.js"));
|
|
17
|
-
function _interopRequireWildcard(e, t) {
|
|
18
|
-
if ("function" == typeof WeakMap)
|
|
19
|
-
var r = new WeakMap(),
|
|
20
|
-
n = new WeakMap();
|
|
21
|
-
return (_interopRequireWildcard = function (e, t) {
|
|
22
|
-
if (!t && e && e.__esModule) return e;
|
|
23
|
-
var o,
|
|
24
|
-
i,
|
|
25
|
-
f = { __proto__: null, default: e };
|
|
26
|
-
if (null === e || ("object" != typeof e && "function" != typeof e))
|
|
27
|
-
return f;
|
|
28
|
-
if ((o = t ? n : r)) {
|
|
29
|
-
if (o.has(e)) return o.get(e);
|
|
30
|
-
o.set(e, f);
|
|
31
|
-
}
|
|
32
|
-
for (const t in e)
|
|
33
|
-
"default" !== t &&
|
|
34
|
-
{}.hasOwnProperty.call(e, t) &&
|
|
35
|
-
((i =
|
|
36
|
-
(o = Object.defineProperty) &&
|
|
37
|
-
Object.getOwnPropertyDescriptor(e, t)) &&
|
|
38
|
-
(i.get || i.set)
|
|
39
|
-
? o(f, t, i)
|
|
40
|
-
: (f[t] = e[t]));
|
|
41
|
-
return f;
|
|
42
|
-
})(e, t);
|
|
43
|
-
}
|
|
44
|
-
const android = (exports.android = _android2.tasks);
|
|
45
|
-
const app = (exports.app = _app2.tasks);
|
|
46
|
-
const apple = (exports.apple = _apple2.tasks);
|
|
47
|
-
const clean = (exports.clean = _clean2.tasks);
|
|
48
|
-
const version = (exports.version = _version);
|
package/dist/index.js.flow
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict-local
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
// @babel/register doesn't like export {foo} from './bar'; statements,
|
|
12
|
-
// so we have to jump through hoops here.
|
|
13
|
-
import { tasks as _android } from "./private/android.js";
|
|
14
|
-
import { tasks as _app } from "./private/app.js";
|
|
15
|
-
import { tasks as _apple } from "./private/apple.js";
|
|
16
|
-
import { tasks as _clean } from "./private/clean.js";
|
|
17
|
-
import * as _version from "./public/version.js";
|
|
18
|
-
|
|
19
|
-
declare export const android: typeof _android;
|
|
20
|
-
declare export const app: typeof _app;
|
|
21
|
-
declare export const apple: typeof _apple;
|
|
22
|
-
declare export const clean: typeof _clean;
|
|
23
|
-
declare export const version: typeof _version;
|
|
24
|
-
|
|
25
|
-
export type { Task } from "./private/types";
|