react-native-bootsplash 6.2.6 → 6.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bootsplash",
3
- "version": "6.2.6",
3
+ "version": "6.3.0",
4
4
  "license": "MIT",
5
5
  "description": "Display a bootsplash on your app starts. Hide it when you want.",
6
6
  "author": "Mathieu Acthernoene <zoontek@gmail.com>",
@@ -20,8 +20,12 @@
20
20
  "!src/addon",
21
21
  "RNBootSplash.podspec",
22
22
  "app.plugin.js",
23
+ "cli.js",
23
24
  "react-native.config.js"
24
25
  ],
26
+ "bin": {
27
+ "react-native-bootsplash": "./cli.js"
28
+ },
25
29
  "repository": {
26
30
  "type": "git",
27
31
  "url": "https://github.com/zoontek/react-native-bootsplash.git"
@@ -43,7 +47,7 @@
43
47
  "format": "prettier '**/*' -u -w",
44
48
  "lint": "eslint --ext ts,tsx ./src",
45
49
  "typecheck": "tsc --noEmit",
46
- "build": "yarn clean && bob build && rm -rf dist/commonjs/package.json",
50
+ "build": "yarn clean && bob build && rm -rf dist/*/package.json",
47
51
  "prepack": "prettier '**/*' -u -c && yarn lint && yarn typecheck && yarn build && node ../obfuscator"
48
52
  },
49
53
  "react-native-builder-bob": {
@@ -66,10 +70,14 @@
66
70
  },
67
71
  "dependencies": {
68
72
  "@expo/config-plugins": "^8.0.4",
73
+ "@react-native-community/cli-config-android": "^15.0.0",
74
+ "@react-native-community/cli-config-apple": "^15.0.0",
75
+ "@react-native-community/cli-tools": "^15.0.0",
76
+ "commander": "^12.1.0",
69
77
  "detect-indent": "^6.1.0",
70
78
  "fs-extra": "^11.2.0",
71
79
  "node-html-parser": "^6.1.13",
72
- "picocolors": "^1.1.0",
80
+ "picocolors": "^1.1.1",
73
81
  "prettier": "^3.3.3",
74
82
  "react-native-is-edge-to-edge": "^1.1.6",
75
83
  "sharp": "^0.32.6",
@@ -77,22 +85,23 @@
77
85
  "xml-formatter": "^3.6.3"
78
86
  },
79
87
  "devDependencies": {
80
- "@babel/core": "^7.20.0",
81
- "@babel/preset-env": "^7.20.0",
88
+ "@babel/core": "^7.25.2",
89
+ "@babel/preset-env": "^7.25.3",
90
+ "@react-native-community/cli-types": "^15.0.0",
82
91
  "@types/fs-extra": "^11.0.4",
83
- "@types/node": "^20.16.11",
92
+ "@types/node": "^20.17.6",
84
93
  "@types/react": "^18.2.6",
85
94
  "@types/semver": "^7.5.8",
86
- "@typescript-eslint/eslint-plugin": "^8.8.1",
87
- "@typescript-eslint/parser": "^8.8.1",
95
+ "@typescript-eslint/eslint-plugin": "^8.13.0",
96
+ "@typescript-eslint/parser": "^8.13.0",
88
97
  "eslint": "^8.57.0",
89
98
  "eslint-plugin-react-hooks": "^4.6.2",
90
99
  "prettier-plugin-organize-imports": "^4.1.0",
91
100
  "react": "18.3.1",
92
- "react-native": "0.75.4",
93
- "react-native-builder-bob": "^0.30.2",
101
+ "react-native": "0.76.1",
102
+ "react-native-builder-bob": "^0.31.0",
94
103
  "semver": "^7.6.3",
95
- "typescript": "^5.5.3"
104
+ "typescript": "^5.6.3"
96
105
  },
97
106
  "codegenConfig": {
98
107
  "name": "RNBootSplashSpec",
@@ -1,5 +1,5 @@
1
- const platforms = ["android", "ios", "web"];
2
- const projectTypes = ["detect", "bare", "expo"];
1
+ const validProjectTypes = ["detect", "bare", "expo"];
2
+ const validPlatforms = ["android", "ios", "web"];
3
3
 
4
4
  /** @type {import("@react-native-community/cli-types").Command} */
5
5
  const generateBootSplash = {
@@ -10,22 +10,22 @@ const generateBootSplash = {
10
10
  name: "--project-type <string>",
11
11
  description: 'Project type ("detect", "bare" or "expo")',
12
12
  default: "detect",
13
- parse: (value) => {
14
- const type = value.toLowerCase();
15
- return projectTypes.includes(type) ? type : "detect";
16
- },
13
+ parse: (projectType) =>
14
+ validProjectTypes.includes(projectType.toLowerCase())
15
+ ? projectType.toLowerCase()
16
+ : "detect",
17
17
  },
18
18
  {
19
19
  name: "--platforms <list>",
20
20
  description: "Platforms to generate for, separated by a comma",
21
- default: platforms.join(","),
22
- parse: (value) => [
21
+ default: validPlatforms.join(","),
22
+ parse: (platforms) => [
23
23
  ...new Set(
24
- value
24
+ platforms
25
25
  .toLowerCase()
26
26
  .split(/[ ,;|]/)
27
27
  .map((platform) => platform.trim())
28
- .filter((item) => platforms.includes(item)),
28
+ .filter((item) => validPlatforms.includes(item)),
29
29
  ),
30
30
  ],
31
31
  },
@@ -39,7 +39,7 @@ const generateBootSplash = {
39
39
  description:
40
40
  "Logo width at @1x (in dp - we recommend approximately ~100)",
41
41
  default: 100,
42
- parse: (value) => Number.parseInt(value, 10),
42
+ parse: (logoWidth) => Number.parseInt(logoWidth, 10),
43
43
  },
44
44
  {
45
45
  name: "--assets-output <string>",
@@ -71,7 +71,7 @@ const generateBootSplash = {
71
71
  description:
72
72
  "Brand width at @1x (in dp - we recommend approximately ~80)",
73
73
  default: 80,
74
- parse: (value) => Number.parseInt(value, 10),
74
+ parse: (brandWidth) => Number.parseInt(brandWidth, 10),
75
75
  },
76
76
  {
77
77
  name: "--dark-background <string>",
@@ -86,10 +86,10 @@ const generateBootSplash = {
86
86
  description: "[dark mode] Brand file path (PNG or SVG)",
87
87
  },
88
88
  ],
89
- func: ([logo], { project: { android, ios } }, args) => {
89
+ func: ([logo], _config, args) => {
90
90
  const { generate } = require("./dist/commonjs/generate");
91
91
 
92
- generate({ android, ios, logo, ...args }).catch((error) => {
92
+ generate({ logo, ...args }).catch((error) => {
93
93
  console.error(error);
94
94
  process.exit(1);
95
95
  });
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
  });
@@ -1 +0,0 @@
1
- {"type":"module"}