react-native-bootsplash 6.2.6 → 6.3.1
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/README.md +5 -5
- package/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeRNBootSplashSpec.java +78 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/RNBootSplashSpec-generated.cpp +44 -0
- package/android/app/build/generated/source/codegen/jni/RNBootSplashSpec.h +31 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBootSplashSpec/RNBootSplashSpecJSI-generated.cpp +39 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNBootSplashSpec/RNBootSplashSpecJSI.h +85 -0
- package/cli.js +101 -0
- package/dist/commonjs/addon/index.js +31 -31
- package/dist/commonjs/expo.js +20 -6
- package/dist/commonjs/expo.js.map +1 -1
- package/dist/commonjs/generate.js +7 -6
- package/dist/commonjs/generate.js.map +1 -1
- package/dist/module/addon/index.js +31 -31
- package/dist/module/expo.js +21 -7
- package/dist/module/expo.js.map +1 -1
- package/dist/module/generate.js +7 -6
- package/dist/module/generate.js.map +1 -1
- package/dist/typescript/expo.d.ts +3 -3
- package/dist/typescript/expo.d.ts.map +1 -1
- package/dist/typescript/generate.d.ts +1 -4
- package/dist/typescript/generate.d.ts.map +1 -1
- package/package.json +20 -11
- package/react-native.config.js +14 -14
- package/src/expo.ts +49 -33
- package/src/generate.ts +6 -15
- package/dist/module/package.json +0 -1
package/src/expo.ts
CHANGED
|
@@ -5,18 +5,18 @@ import { mergeContents } from "@expo/config-plugins/build/utils/generateCode";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { dedent } from "ts-dedent";
|
|
7
7
|
import { Manifest } from ".";
|
|
8
|
-
import { cleanIOSAssets, getExpoConfig, hfs } from "./generate";
|
|
8
|
+
import { cleanIOSAssets, getExpoConfig, hfs, log } from "./generate";
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type Props = {
|
|
11
11
|
assetsDir?: string;
|
|
12
12
|
android?: {
|
|
13
13
|
parentTheme?: "TransparentStatus" | "EdgeToEdge";
|
|
14
14
|
darkContentBarsStyle?: boolean;
|
|
15
15
|
};
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
|
|
18
18
|
const withExpoVersionCheck =
|
|
19
|
-
(platform: "android" | "ios"):
|
|
19
|
+
(platform: "android" | "ios"): Expo.ConfigPlugin<Props> =>
|
|
20
20
|
(config) =>
|
|
21
21
|
Expo.withDangerousMod(config, [
|
|
22
22
|
platform,
|
|
@@ -26,7 +26,7 @@ const withExpoVersionCheck =
|
|
|
26
26
|
},
|
|
27
27
|
]);
|
|
28
28
|
|
|
29
|
-
const withAndroidAssets:
|
|
29
|
+
const withAndroidAssets: Expo.ConfigPlugin<Props> = (config, props) =>
|
|
30
30
|
Expo.withDangerousMod(config, [
|
|
31
31
|
"android",
|
|
32
32
|
(config) => {
|
|
@@ -35,6 +35,12 @@ const withAndroidAssets: ExpoPlugin = (config, props) =>
|
|
|
35
35
|
|
|
36
36
|
const srcDir = path.resolve(projectRoot, assetsDir, "android");
|
|
37
37
|
|
|
38
|
+
if (!hfs.exists(srcDir)) {
|
|
39
|
+
const error = `"${path.relative(projectRoot, srcDir)}" doesn't exist. Did you ran the asset generation command?`;
|
|
40
|
+
log.error(error);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
const destDir = path.resolve(
|
|
39
45
|
platformProjectRoot,
|
|
40
46
|
"app",
|
|
@@ -47,13 +53,15 @@ const withAndroidAssets: ExpoPlugin = (config, props) =>
|
|
|
47
53
|
const srcDrawableDir = path.join(srcDir, drawableDir);
|
|
48
54
|
const destDrawableDir = path.join(destDir, drawableDir);
|
|
49
55
|
|
|
50
|
-
hfs.
|
|
56
|
+
if (hfs.isDir(srcDrawableDir)) {
|
|
57
|
+
hfs.ensureDir(destDrawableDir);
|
|
51
58
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
59
|
+
for (const file of hfs.readDir(srcDrawableDir)) {
|
|
60
|
+
hfs.copy(
|
|
61
|
+
path.join(srcDrawableDir, file),
|
|
62
|
+
path.join(destDrawableDir, file),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
|
|
@@ -61,7 +69,7 @@ const withAndroidAssets: ExpoPlugin = (config, props) =>
|
|
|
61
69
|
},
|
|
62
70
|
]);
|
|
63
71
|
|
|
64
|
-
const withAndroidManifest:
|
|
72
|
+
const withAndroidManifest: Expo.ConfigPlugin<Props> = (config) =>
|
|
65
73
|
Expo.withAndroidManifest(config, (config) => {
|
|
66
74
|
config.modResults.manifest.application?.forEach((application) => {
|
|
67
75
|
if (application.$["android:name"] === ".MainApplication") {
|
|
@@ -78,7 +86,7 @@ const withAndroidManifest: ExpoPlugin = (config) =>
|
|
|
78
86
|
return config;
|
|
79
87
|
});
|
|
80
88
|
|
|
81
|
-
const withMainActivity:
|
|
89
|
+
const withMainActivity: Expo.ConfigPlugin<Props> = (config) =>
|
|
82
90
|
Expo.withMainActivity(config, (config) => {
|
|
83
91
|
const { modResults } = config;
|
|
84
92
|
const { language } = modResults;
|
|
@@ -113,7 +121,7 @@ const withMainActivity: ExpoPlugin = (config) =>
|
|
|
113
121
|
};
|
|
114
122
|
});
|
|
115
123
|
|
|
116
|
-
const withAndroidStyles:
|
|
124
|
+
const withAndroidStyles: Expo.ConfigPlugin<Props> = (config, props) =>
|
|
117
125
|
Expo.withAndroidStyles(config, async (config) => {
|
|
118
126
|
const { assetsDir = "assets/bootsplash", android = {} } = props;
|
|
119
127
|
const { parentTheme, darkContentBarsStyle } = android;
|
|
@@ -182,7 +190,7 @@ const withAndroidStyles: ExpoPlugin = (config, props) =>
|
|
|
182
190
|
};
|
|
183
191
|
});
|
|
184
192
|
|
|
185
|
-
const withAndroidColors:
|
|
193
|
+
const withAndroidColors: Expo.ConfigPlugin<Props> = (config, props) =>
|
|
186
194
|
Expo.withAndroidColors(config, async (config) => {
|
|
187
195
|
const { assetsDir = "assets/bootsplash" } = props;
|
|
188
196
|
const { projectRoot } = config.modRequest;
|
|
@@ -199,7 +207,7 @@ const withAndroidColors: ExpoPlugin = (config, props) =>
|
|
|
199
207
|
return config;
|
|
200
208
|
});
|
|
201
209
|
|
|
202
|
-
const withAndroidColorsNight:
|
|
210
|
+
const withAndroidColorsNight: Expo.ConfigPlugin<Props> = (config, props) =>
|
|
203
211
|
Expo.withAndroidColorsNight(config, async (config) => {
|
|
204
212
|
const { assetsDir = "assets/bootsplash" } = props;
|
|
205
213
|
const { projectRoot } = config.modRequest;
|
|
@@ -218,7 +226,7 @@ const withAndroidColorsNight: ExpoPlugin = (config, props) =>
|
|
|
218
226
|
return config;
|
|
219
227
|
});
|
|
220
228
|
|
|
221
|
-
const withIOSAssets:
|
|
229
|
+
const withIOSAssets: Expo.ConfigPlugin<Props> = (config, props) =>
|
|
222
230
|
Expo.withDangerousMod(config, [
|
|
223
231
|
"ios",
|
|
224
232
|
(config) => {
|
|
@@ -233,6 +241,12 @@ const withIOSAssets: ExpoPlugin = (config, props) =>
|
|
|
233
241
|
const srcDir = path.resolve(projectRoot, assetsDir, "ios");
|
|
234
242
|
const destDir = path.resolve(platformProjectRoot, projectName);
|
|
235
243
|
|
|
244
|
+
if (!hfs.exists(srcDir)) {
|
|
245
|
+
const error = `"${path.relative(projectRoot, srcDir)}" doesn't exist. Did you ran the asset generation command?`;
|
|
246
|
+
log.error(error);
|
|
247
|
+
process.exit(1);
|
|
248
|
+
}
|
|
249
|
+
|
|
236
250
|
cleanIOSAssets(destDir);
|
|
237
251
|
|
|
238
252
|
hfs.copy(
|
|
@@ -244,13 +258,15 @@ const withIOSAssets: ExpoPlugin = (config, props) =>
|
|
|
244
258
|
const srcXcassetsDir = path.join(srcDir, xcassetsDir);
|
|
245
259
|
const destXcassetsDir = path.join(destDir, xcassetsDir);
|
|
246
260
|
|
|
247
|
-
hfs.
|
|
261
|
+
if (hfs.isDir(srcXcassetsDir)) {
|
|
262
|
+
hfs.ensureDir(destXcassetsDir);
|
|
248
263
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
264
|
+
for (const file of hfs.readDir(srcXcassetsDir)) {
|
|
265
|
+
hfs.copy(
|
|
266
|
+
path.join(srcXcassetsDir, file),
|
|
267
|
+
path.join(destXcassetsDir, file),
|
|
268
|
+
);
|
|
269
|
+
}
|
|
254
270
|
}
|
|
255
271
|
}
|
|
256
272
|
|
|
@@ -258,7 +274,7 @@ const withIOSAssets: ExpoPlugin = (config, props) =>
|
|
|
258
274
|
},
|
|
259
275
|
]);
|
|
260
276
|
|
|
261
|
-
const withAppDelegate:
|
|
277
|
+
const withAppDelegate: Expo.ConfigPlugin<Props> = (config) =>
|
|
262
278
|
Expo.withAppDelegate(config, (config) => {
|
|
263
279
|
const { modResults } = config;
|
|
264
280
|
const { language } = modResults;
|
|
@@ -301,13 +317,13 @@ const withAppDelegate: ExpoPlugin = (config) =>
|
|
|
301
317
|
};
|
|
302
318
|
});
|
|
303
319
|
|
|
304
|
-
const withInfoPlist:
|
|
320
|
+
const withInfoPlist: Expo.ConfigPlugin<Props> = (config) =>
|
|
305
321
|
Expo.withInfoPlist(config, (config) => {
|
|
306
322
|
config.modResults["UILaunchStoryboardName"] = "BootSplash";
|
|
307
323
|
return config;
|
|
308
324
|
});
|
|
309
325
|
|
|
310
|
-
const withXcodeProject:
|
|
326
|
+
const withXcodeProject: Expo.ConfigPlugin<Props> = (config) =>
|
|
311
327
|
Expo.withXcodeProject(config, (config) => {
|
|
312
328
|
const { projectName = "" } = config.modRequest;
|
|
313
329
|
|
|
@@ -328,14 +344,14 @@ const withXcodeProject: ExpoPlugin = (config) =>
|
|
|
328
344
|
return config;
|
|
329
345
|
});
|
|
330
346
|
|
|
331
|
-
const withoutExpoSplashScreen:
|
|
332
|
-
(config) => config,
|
|
333
|
-
"expo-splash-screen",
|
|
334
|
-
"skip",
|
|
335
|
-
);
|
|
347
|
+
const withoutExpoSplashScreen: Expo.ConfigPlugin<Props> =
|
|
348
|
+
Expo.createRunOncePlugin((config) => config, "expo-splash-screen", "skip");
|
|
336
349
|
|
|
337
|
-
export const withBootSplash:
|
|
338
|
-
|
|
350
|
+
export const withBootSplash: Expo.ConfigPlugin<Props | undefined> = (
|
|
351
|
+
config,
|
|
352
|
+
props = {},
|
|
353
|
+
) => {
|
|
354
|
+
const plugins: Expo.ConfigPlugin<Props>[] = [];
|
|
339
355
|
const { platforms = [] } = config;
|
|
340
356
|
|
|
341
357
|
plugins.push(withoutExpoSplashScreen);
|
package/src/generate.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as Expo from "@expo/config-plugins";
|
|
2
2
|
import plist from "@expo/plist";
|
|
3
|
+
import { projectConfig as getAndroidProjectConfig } from "@react-native-community/cli-config-android";
|
|
4
|
+
import { getProjectConfig as getAppleProjectConfig } from "@react-native-community/cli-config-apple";
|
|
3
5
|
import { findProjectRoot } from "@react-native-community/cli-tools";
|
|
4
|
-
import {
|
|
5
|
-
AndroidProjectConfig,
|
|
6
|
-
IOSProjectConfig,
|
|
7
|
-
} from "@react-native-community/cli-types";
|
|
8
6
|
import childProcess from "child_process";
|
|
9
7
|
import crypto from "crypto";
|
|
10
8
|
import detectIndent from "detect-indent";
|
|
@@ -26,6 +24,10 @@ import { Manifest } from ".";
|
|
|
26
24
|
const workingPath = process.env.INIT_CWD ?? process.env.PWD ?? process.cwd();
|
|
27
25
|
const projectRoot = findProjectRoot(workingPath);
|
|
28
26
|
|
|
27
|
+
const getIOSProjectConfig = getAppleProjectConfig({ platformName: "ios" });
|
|
28
|
+
const ios = getIOSProjectConfig(projectRoot, {});
|
|
29
|
+
const android = getAndroidProjectConfig(projectRoot);
|
|
30
|
+
|
|
29
31
|
type PackageJson = {
|
|
30
32
|
version?: string;
|
|
31
33
|
dependencies?: Record<string, string>;
|
|
@@ -416,7 +418,6 @@ const ensureSupportedFormat = async (
|
|
|
416
418
|
};
|
|
417
419
|
|
|
418
420
|
const getAndroidOutputPath = ({
|
|
419
|
-
android,
|
|
420
421
|
assetsOutputPath,
|
|
421
422
|
brandHeight,
|
|
422
423
|
brandWidth,
|
|
@@ -426,7 +427,6 @@ const getAndroidOutputPath = ({
|
|
|
426
427
|
logoWidth,
|
|
427
428
|
platforms,
|
|
428
429
|
}: {
|
|
429
|
-
android: AndroidProjectConfig | undefined;
|
|
430
430
|
assetsOutputPath: string;
|
|
431
431
|
brandHeight: number;
|
|
432
432
|
brandWidth: number;
|
|
@@ -487,12 +487,10 @@ const getAndroidOutputPath = ({
|
|
|
487
487
|
};
|
|
488
488
|
|
|
489
489
|
const getIOSOutputPath = ({
|
|
490
|
-
ios,
|
|
491
490
|
assetsOutputPath,
|
|
492
491
|
isExpo,
|
|
493
492
|
platforms,
|
|
494
493
|
}: {
|
|
495
|
-
ios: IOSProjectConfig | undefined;
|
|
496
494
|
assetsOutputPath: string;
|
|
497
495
|
isExpo: boolean;
|
|
498
496
|
platforms: Platforms;
|
|
@@ -627,8 +625,6 @@ const requireAddon = ():
|
|
|
627
625
|
};
|
|
628
626
|
|
|
629
627
|
export const generate = async ({
|
|
630
|
-
android,
|
|
631
|
-
ios,
|
|
632
628
|
projectType,
|
|
633
629
|
platforms,
|
|
634
630
|
html,
|
|
@@ -636,9 +632,6 @@ export const generate = async ({
|
|
|
636
632
|
licenseKey,
|
|
637
633
|
...args
|
|
638
634
|
}: {
|
|
639
|
-
android?: AndroidProjectConfig;
|
|
640
|
-
ios?: IOSProjectConfig;
|
|
641
|
-
|
|
642
635
|
logo: string;
|
|
643
636
|
projectType: ProjectType;
|
|
644
637
|
platforms: Platforms;
|
|
@@ -756,7 +749,6 @@ export const generate = async ({
|
|
|
756
749
|
});
|
|
757
750
|
|
|
758
751
|
const androidOutputPath = getAndroidOutputPath({
|
|
759
|
-
android,
|
|
760
752
|
assetsOutputPath,
|
|
761
753
|
brandHeight,
|
|
762
754
|
brandWidth,
|
|
@@ -769,7 +761,6 @@ export const generate = async ({
|
|
|
769
761
|
|
|
770
762
|
const iosOutputPath = getIOSOutputPath({
|
|
771
763
|
assetsOutputPath,
|
|
772
|
-
ios,
|
|
773
764
|
isExpo,
|
|
774
765
|
platforms,
|
|
775
766
|
});
|
package/dist/module/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"type":"module"}
|