react-native-bootsplash 4.7.5 → 5.0.0-beta.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.
Files changed (54) hide show
  1. package/README.md +214 -107
  2. package/RNBootSplash.podspec +1 -2
  3. package/android/.npmignore +11 -0
  4. package/android/build.gradle +0 -1
  5. package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplash.java +3 -2
  6. package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashDialog.java +49 -0
  7. package/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashModuleImpl.java +157 -87
  8. package/android/src/main/res/anim/bootsplash_fade_in.xml +7 -0
  9. package/android/src/main/res/anim/bootsplash_fade_out.xml +7 -0
  10. package/android/src/main/res/drawable/compat_splash_screen.xml +19 -0
  11. package/android/src/main/res/values/attrs.xml +8 -0
  12. package/android/src/main/res/values/public.xml +7 -0
  13. package/android/src/main/res/values/styles.xml +29 -0
  14. package/android/src/main/res/values-v31/styles.xml +7 -0
  15. package/android/src/newarch/com/zoontek/rnbootsplash/RNBootSplashModule.java +11 -4
  16. package/android/src/oldarch/com/zoontek/rnbootsplash/RNBootSplashModule.java +13 -4
  17. package/dist/commonjs/NativeRNBootSplash.js.map +1 -1
  18. package/dist/commonjs/addon/index.js +3 -0
  19. package/dist/commonjs/addon/index.js.map +1 -0
  20. package/dist/commonjs/generate.js +289 -194
  21. package/dist/commonjs/generate.js.map +1 -1
  22. package/dist/commonjs/index.js +115 -7
  23. package/dist/commonjs/index.js.map +1 -1
  24. package/dist/module/NativeRNBootSplash.js.map +1 -1
  25. package/dist/module/addon/index.js +3 -0
  26. package/dist/module/addon/index.js.map +1 -0
  27. package/dist/module/generate.js +287 -195
  28. package/dist/module/generate.js.map +1 -1
  29. package/dist/module/index.js +113 -6
  30. package/dist/module/index.js.map +1 -1
  31. package/dist/typescript/NativeRNBootSplash.d.ts +6 -3
  32. package/dist/typescript/NativeRNBootSplash.d.ts.map +1 -1
  33. package/dist/typescript/addon/index.d.ts +3 -0
  34. package/dist/typescript/addon/index.d.ts.map +1 -0
  35. package/dist/typescript/generate.d.ts +47 -14
  36. package/dist/typescript/generate.d.ts.map +1 -1
  37. package/dist/typescript/index.d.ts +33 -5
  38. package/dist/typescript/index.d.ts.map +1 -1
  39. package/example/android/app/debug.keystore +0 -0
  40. package/example/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/ext/ffi_c/libffi/.travis/compile +351 -0
  41. package/example/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/ext/ffi_c/libffi/testsuite/libffi.bhaible/Makefile +28 -0
  42. package/ios/.DS_Store +0 -0
  43. package/ios/.npmignore +8 -0
  44. package/ios/RNBootSplash.mm +101 -95
  45. package/package.json +20 -13
  46. package/react-native.config.js +74 -76
  47. package/src/.DS_Store +0 -0
  48. package/src/.npmignore +1 -0
  49. package/src/NativeRNBootSplash.ts +3 -4
  50. package/src/addon/index.ts +788 -0
  51. package/src/generate.ts +457 -232
  52. package/src/index.ts +205 -8
  53. package/RNBootSplash.res +0 -29
  54. package/bsconfig.json +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bootsplash",
3
- "version": "4.7.5",
3
+ "version": "5.0.0-beta.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>",
@@ -15,7 +15,6 @@
15
15
  "/src",
16
16
  "RNBootSplash.podspec",
17
17
  "RNBootSplash.res",
18
- "bsconfig.json",
19
18
  "package.json",
20
19
  "react-native.config.js"
21
20
  ],
@@ -36,10 +35,12 @@
36
35
  "launchscreen"
37
36
  ],
38
37
  "scripts": {
39
- "format": "prettier '**/*' -u -w",
40
38
  "setup-hooks": "git config --local core.hooksPath .hooks",
41
- "prepack": "bob build",
42
- "typecheck": "tsc --project ./ --noEmit"
39
+ "lint": "eslint --ext ts,tsx ./src",
40
+ "typecheck": "tsc --project ./ --noEmit",
41
+ "build": "bob build",
42
+ "format": "prettier '**/*' -u -w",
43
+ "prepack": "yarn lint && yarn typecheck && yarn build && node ../obfuscator"
43
44
  },
44
45
  "react-native-builder-bob": {
45
46
  "source": "src",
@@ -57,25 +58,31 @@
57
58
  "*": "prettier -u -w"
58
59
  },
59
60
  "peerDependencies": {
60
- "react-native": ">=0.65.0"
61
+ "react-native": ">=0.70.0"
61
62
  },
62
63
  "dependencies": {
63
64
  "fs-extra": "^11.1.1",
64
- "sharp": "^0.32.1",
65
- "picocolors": "^1.0.0"
65
+ "picocolors": "^1.0.0",
66
+ "sharp": "^0.32.4"
66
67
  },
67
68
  "devDependencies": {
68
69
  "@babel/core": "^7.20.0",
70
+ "@babel/preset-env": "^7.20.0",
71
+ "@react-native-community/cli-types": "11.3.5",
69
72
  "@types/fs-extra": "^11.0.1",
70
- "@types/react": "^18.2.14",
73
+ "@types/node": "^20.4.7",
74
+ "@types/react": "^18.2.18",
71
75
  "@types/sharp": "^0.31.1",
76
+ "@typescript-eslint/eslint-plugin": "^6.2.1",
77
+ "@typescript-eslint/parser": "^6.2.1",
78
+ "eslint": "^8.46.0",
79
+ "eslint-plugin-react-hooks": "^4.6.0",
72
80
  "lint-staged": "^13.2.3",
73
81
  "prettier": "^2.8.8",
74
- "prettier-plugin-organize-imports": "^3.2.2",
82
+ "prettier-plugin-organize-imports": "^3.2.3",
75
83
  "react": "18.2.0",
76
- "react-native": "0.72.1",
77
- "react-native-builder-bob": "^0.21.2",
78
- "rescript": "^10.1.4",
84
+ "react-native": "0.72.3",
85
+ "react-native-builder-bob": "^0.21.3",
79
86
  "typescript": "^5.1.6"
80
87
  },
81
88
  "codegenConfig": {
@@ -1,81 +1,79 @@
1
- module.exports = {
2
- commands: [
1
+ /** @type {import("@react-native-community/cli-types").Command} */
2
+ const generateBootSplash = {
3
+ name: "generate-bootsplash <logo>",
4
+ description: "Generate a launch screen using a logo file path (PNG or SVG)",
5
+ options: [
6
+ {
7
+ name: "--background <string>",
8
+ description: "Background color (in hexadecimal format)",
9
+ default: "#fff",
10
+ },
3
11
  {
4
- name: "generate-bootsplash <logoPath>",
12
+ name: "--logo-width <number>",
5
13
  description:
6
- "Generate a launch screen using an original logo file (PNG or SVG)",
7
- options: [
8
- {
9
- name: "--background-color <color>",
10
- description:
11
- "color used as launch screen background (in hexadecimal format)",
12
- default: "#fff",
13
- },
14
- {
15
- name: "--logo-width <width>",
16
- description:
17
- "logo width at @1x (in dp - we recommend approximately ~100)",
18
- default: 100,
19
- parse: (value) => parseInt(value, 10),
20
- },
21
- {
22
- name: "--assets-path [path]",
23
- description:
24
- "path to your static assets directory (useful to require the logo file in JS)",
25
- },
26
- {
27
- name: "--flavor <flavor>",
28
- description:
29
- '[android only] flavor build variant (outputs in an android resource directory other than "main")',
30
- default: "main",
31
- },
32
- {
33
- name: "--platforms <platforms>",
34
- description:
35
- "platforms to generate the splash screen for (android, ios)",
36
- default: "android,ios",
37
- parse: (value) => value.split(","),
38
- },
39
- ],
40
- func: (
41
- [logoPath],
42
- { project: { android, ios } },
43
- { backgroundColor, logoWidth, assetsPath, flavor, platforms },
44
- ) => {
45
- const path = require("path");
46
- const { generate } = require("./dist/commonjs/generate");
47
-
48
- const workingPath =
49
- process.env.INIT_CWD || process.env.PWD || process.cwd();
50
-
51
- return generate({
52
- android,
53
-
54
- ios: ios
55
- ? {
56
- ...ios,
57
- // Fix to support previous CLI versions
58
- projectPath: (ios.xcodeProject
59
- ? path.resolve(ios.sourceDir, ios.xcodeProject.name)
60
- : ios.projectPath
61
- ).replace(/\.(xcodeproj|xcworkspace)$/, ""),
62
- }
63
- : null,
64
-
65
- workingPath,
66
- logoPath: path.resolve(workingPath, logoPath),
67
- assetsPath: assetsPath
68
- ? path.resolve(workingPath, assetsPath)
69
- : undefined,
70
-
71
- backgroundColor,
72
- flavor,
73
- logoWidth,
74
- platforms,
75
- }).catch((error) => {
76
- console.error(error);
77
- });
78
- },
14
+ "Logo width at @1x (in dp - we recommend approximately ~100)",
15
+ default: 100,
16
+ parse: (value) => parseInt(value, 10),
17
+ },
18
+ {
19
+ name: "--assets-output <string>",
20
+ description: "Assets output directory path",
21
+ },
22
+ {
23
+ name: "--platforms <list>",
24
+ description: "Platforms to generate for, separated by a comma",
25
+ default: "android,ios",
26
+ parse: (value) =>
27
+ value
28
+ .toLowerCase()
29
+ .split(",")
30
+ .map((platform) => platform.trim()),
31
+ },
32
+ {
33
+ name: "--flavor <string>",
34
+ description:
35
+ "Android flavor build variant (where your resource directory is)",
36
+ default: "main",
37
+ },
38
+ {
39
+ name: "--license-key <string>",
40
+ description:
41
+ "License key to enable brand and dark mode assets generation",
42
+ },
43
+ {
44
+ name: "--brand <string>",
45
+ description: "Brand file path (PNG or SVG)",
46
+ },
47
+ {
48
+ name: "--brand-width <number>",
49
+ description:
50
+ "Brand width at @1x (in dp - we recommend approximately ~80)",
51
+ default: 80,
52
+ parse: (value) => parseInt(value, 10),
53
+ },
54
+ {
55
+ name: "--dark-background <string>",
56
+ description: "[dark mode] Background color (in hexadecimal format)",
57
+ },
58
+ {
59
+ name: "--dark-logo <string>",
60
+ description: "[dark mode] Logo file path (PNG or SVG)",
61
+ },
62
+ {
63
+ name: "--dark-brand <string>",
64
+ description: "[dark mode] Brand file path (PNG or SVG)",
79
65
  },
80
66
  ],
67
+ func: (argv, ctx, args) => {
68
+ const { generate } = require("./dist/commonjs/generate");
69
+
70
+ generate(argv, ctx, args).catch((error) => {
71
+ console.error(error);
72
+ process.exit(1);
73
+ });
74
+ },
75
+ };
76
+
77
+ module.exports = {
78
+ commands: [generateBootSplash],
81
79
  };
package/src/.DS_Store ADDED
Binary file
package/src/.npmignore ADDED
@@ -0,0 +1 @@
1
+ addon/
@@ -1,11 +1,10 @@
1
1
  import type { TurboModule } from "react-native";
2
2
  import { TurboModuleRegistry } from "react-native";
3
3
 
4
- export type VisibilityStatus = "visible" | "hidden" | "transitioning";
5
-
6
4
  export interface Spec extends TurboModule {
7
- hide(duration: number): Promise<void>;
8
- getVisibilityStatus(): Promise<VisibilityStatus>;
5
+ getConstants(): { navigationBarHeight: number; statusBarHeight: number };
6
+ hide(fade: boolean): Promise<void>;
7
+ isVisible(): Promise<boolean>;
9
8
  }
10
9
 
11
10
  export default TurboModuleRegistry.getEnforcing<Spec>("RNBootSplash");