@expo/prebuild-config 2.1.0 → 3.0.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/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.d.ts +4 -0
- package/build/plugins/unversioned/expo-splash-screen/{withAndroidSplashMainActivity.js → withAndroidSplashLegacyMainActivity.js} +7 -7
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -0
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +67 -4
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.d.ts +3 -0
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +63 -0
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -0
- package/build/plugins/withDefaultPlugins.js +1 -1
- package/build/plugins/withDefaultPlugins.js.map +1 -1
- package/package.json +5 -4
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.d.ts +0 -4
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.js.map +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
+
export declare const withAndroidSplashLegacyMainActivity: ConfigPlugin;
|
|
4
|
+
export declare function setSplashScreenLegacyMainActivity(config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>, mainActivity: string, language: 'java' | 'kt'): string;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
6
|
+
exports.setSplashScreenLegacyMainActivity = setSplashScreenLegacyMainActivity;
|
|
7
|
+
exports.withAndroidSplashLegacyMainActivity = void 0;
|
|
8
8
|
|
|
9
9
|
function _configPlugins() {
|
|
10
10
|
const data = require("@expo/config-plugins");
|
|
@@ -52,16 +52,16 @@ const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:and
|
|
|
52
52
|
|
|
53
53
|
const SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';
|
|
54
54
|
|
|
55
|
-
const
|
|
55
|
+
const withAndroidSplashLegacyMainActivity = config => {
|
|
56
56
|
return (0, _configPlugins().withMainActivity)(config, config => {
|
|
57
|
-
config.modResults.contents =
|
|
57
|
+
config.modResults.contents = setSplashScreenLegacyMainActivity(config, config.modResults.contents, config.modResults.language);
|
|
58
58
|
return config;
|
|
59
59
|
});
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
exports.
|
|
62
|
+
exports.withAndroidSplashLegacyMainActivity = withAndroidSplashLegacyMainActivity;
|
|
63
63
|
|
|
64
|
-
function
|
|
64
|
+
function setSplashScreenLegacyMainActivity(config, mainActivity, language) {
|
|
65
65
|
var _config$androidStatus;
|
|
66
66
|
|
|
67
67
|
debug(`Modify with language: "${language}"`);
|
|
@@ -126,4 +126,4 @@ function setSplashScreenMainActivity(config, mainActivity, language) {
|
|
|
126
126
|
|
|
127
127
|
return mainActivity;
|
|
128
128
|
}
|
|
129
|
-
//# sourceMappingURL=
|
|
129
|
+
//# sourceMappingURL=withAndroidSplashLegacyMainActivity.js.map
|
package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.ts"],"names":["debug","SHOW_SPLASH_ID","withAndroidSplashLegacyMainActivity","config","modResults","contents","setSplashScreenLegacyMainActivity","language","mainActivity","splashConfig","mod","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","AndroidConfig","UserInterfaceStyle","addJavaImports","match","onCreateBlock","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAMA,KAAK,GAAG,sBAAM,8DAAN,CAAd,C,CAEA;;AACA,MAAMC,cAAc,GAAG,sDAAvB;;AAEO,MAAMC,mCAAiD,GAAGC,MAAM,IAAI;AACzE,SAAO,uCAAiBA,MAAjB,EAAyBA,MAAM,IAAI;AACxCA,IAAAA,MAAM,CAACC,UAAP,CAAkBC,QAAlB,GAA6BC,iCAAiC,CAC5DH,MAD4D,EAE5DA,MAAM,CAACC,UAAP,CAAkBC,QAF0C,EAG5DF,MAAM,CAACC,UAAP,CAAkBG,QAH0C,CAA9D;AAKA,WAAOJ,MAAP;AACD,GAPM,CAAP;AAQD,CATM;;;;AAWA,SAASG,iCAAT,CACLH,MADK,EAELK,YAFK,EAGLD,QAHK,EAIG;AAAA;;AACRP,EAAAA,KAAK,CAAE,0BAAyBO,QAAS,GAApC,CAAL;AACA,QAAME,YAAY,GAAG,sDAAuBN,MAAvB,CAArB;;AAEA,MAAI,CAACM,YAAL,EAAmB;AACjB;AACA,UAAMC,GAAG,GAAG,oCAAe;AACzBC,MAAAA,GAAG,EAAEH,YADoB;AAEzBI,MAAAA,GAAG,EAAEX;AAFoB,KAAf,CAAZ;AAKAO,IAAAA,YAAY,GAAGE,GAAG,CAACL,QAAnB;;AACA,QAAIK,GAAG,CAACG,QAAR,EAAkB;AAChBb,MAAAA,KAAK,CAAC,6BAAD,CAAL;AACD;;AACD,WAAOQ,YAAP;AACD,GAhBO,CAiBR;;;AACA,QAAMM,oBAAoB,GAAG,CAAC,2BAACX,MAAM,CAACY,gBAAR,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AY,GAAG,mCAAc;AAC3BG,IAAAA,GAAG,EAAEH,YADsB;AAE3B;AACAiB,IAAAA,MAAM,EAAE,6BAHmB;AAI3BC,IAAAA,MAAM,EAAE,CAJmB;AAK3BC,IAAAA,OAAO,EAAE,IALkB;AAM3Bf,IAAAA,GAAG,EAAEX,cANsB;AAO3B2B,IAAAA,MAAM,EAAG,2DAA0DX,UAAU,CAACiB,WAAX,EAAyB,kBAC1FhB,MAAM,GAAG,QAAH,GAAc,cACrB,KAAIJ,oBAAqB,IAAGK,EAAG;AATL,GAAd,EAUZd,QAVH,CA5EQ,CAwFR;;AAEA,SAAOG,YAAP;AACD","sourcesContent":["import { AndroidConfig, ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashLegacyMainActivity: ConfigPlugin = config => {\n return withMainActivity(config, config => {\n config.modResults.contents = setSplashScreenLegacyMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenLegacyMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = AndroidConfig.UserInterfaceStyle.addJavaImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter(line => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\n}\n"],"file":"withAndroidSplashLegacyMainActivity.js"}
|
|
@@ -15,6 +15,36 @@ function _configPlugins() {
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function _jsonFile() {
|
|
19
|
+
const data = _interopRequireDefault(require("@expo/json-file"));
|
|
20
|
+
|
|
21
|
+
_jsonFile = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _resolveFrom() {
|
|
29
|
+
const data = _interopRequireDefault(require("resolve-from"));
|
|
30
|
+
|
|
31
|
+
_resolveFrom = function () {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _semver() {
|
|
39
|
+
const data = _interopRequireDefault(require("semver"));
|
|
40
|
+
|
|
41
|
+
_semver = function () {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
18
48
|
function _getAndroidSplashConfig() {
|
|
19
49
|
const data = require("./getAndroidSplashConfig");
|
|
20
50
|
|
|
@@ -45,10 +75,20 @@ function _withAndroidSplashImages() {
|
|
|
45
75
|
return data;
|
|
46
76
|
}
|
|
47
77
|
|
|
48
|
-
function
|
|
49
|
-
const data = require("./
|
|
78
|
+
function _withAndroidSplashLegacyMainActivity() {
|
|
79
|
+
const data = require("./withAndroidSplashLegacyMainActivity");
|
|
80
|
+
|
|
81
|
+
_withAndroidSplashLegacyMainActivity = function () {
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _withAndroidSplashStrings() {
|
|
89
|
+
const data = require("./withAndroidSplashStrings");
|
|
50
90
|
|
|
51
|
-
|
|
91
|
+
_withAndroidSplashStrings = function () {
|
|
52
92
|
return data;
|
|
53
93
|
};
|
|
54
94
|
|
|
@@ -65,6 +105,8 @@ function _withAndroidSplashStyles() {
|
|
|
65
105
|
return data;
|
|
66
106
|
}
|
|
67
107
|
|
|
108
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
109
|
+
|
|
68
110
|
const withAndroidSplashScreen = config => {
|
|
69
111
|
var _config$androidStatus;
|
|
70
112
|
|
|
@@ -84,8 +126,29 @@ const withAndroidSplashScreen = config => {
|
|
|
84
126
|
config.androidStatusBar.backgroundColor = backgroundColor;
|
|
85
127
|
}
|
|
86
128
|
|
|
87
|
-
return (0, _configPlugins().withPlugins)(config, [_withAndroidSplashImages().withAndroidSplashImages, [_withAndroidSplashDrawables().withAndroidSplashDrawables, splashConfig],
|
|
129
|
+
return (0, _configPlugins().withPlugins)(config, [_withAndroidSplashImages().withAndroidSplashImages, [_withAndroidSplashDrawables().withAndroidSplashDrawables, splashConfig], ...(shouldUpdateLegacyMainActivity(config) ? [_withAndroidSplashLegacyMainActivity().withAndroidSplashLegacyMainActivity] : []), _withAndroidSplashStyles().withAndroidSplashStyles, _withAndroidSplashStrings().withAndroidSplashStrings]);
|
|
88
130
|
};
|
|
89
131
|
|
|
90
132
|
exports.withAndroidSplashScreen = withAndroidSplashScreen;
|
|
133
|
+
|
|
134
|
+
function shouldUpdateLegacyMainActivity(config) {
|
|
135
|
+
try {
|
|
136
|
+
var _config$_internal;
|
|
137
|
+
|
|
138
|
+
const projectRoot = (_config$_internal = config._internal) === null || _config$_internal === void 0 ? void 0 : _config$_internal.projectRoot;
|
|
139
|
+
const packagePath = (0, _resolveFrom().default)(projectRoot, 'expo-splash-screen/package.json');
|
|
140
|
+
|
|
141
|
+
if (packagePath) {
|
|
142
|
+
var _JsonFile$read$versio, _JsonFile$read$versio2;
|
|
143
|
+
|
|
144
|
+
const version = (_JsonFile$read$versio = (_JsonFile$read$versio2 = _jsonFile().default.read(packagePath).version) === null || _JsonFile$read$versio2 === void 0 ? void 0 : _JsonFile$read$versio2.toString()) !== null && _JsonFile$read$versio !== void 0 ? _JsonFile$read$versio : '';
|
|
145
|
+
return _semver().default.lt(version, '0.12.0');
|
|
146
|
+
} // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
return !!(config.sdkVersion && _semver().default.lt(config.sdkVersion, '43.0.0'));
|
|
150
|
+
} catch {}
|
|
151
|
+
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
91
154
|
//# sourceMappingURL=withAndroidSplashScreen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"names":["withAndroidSplashScreen","config","splashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withAndroidSplashImages","withAndroidSplashDrawables","
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.ts"],"names":["withAndroidSplashScreen","config","splashConfig","backgroundColor","androidStatusBar","toLowerCase","WarningAggregator","addWarningAndroid","withAndroidSplashImages","withAndroidSplashDrawables","shouldUpdateLegacyMainActivity","withAndroidSplashLegacyMainActivity","withAndroidSplashStyles","withAndroidSplashStrings","projectRoot","_internal","packagePath","version","JsonFile","read","toString","semver","lt","sdkVersion"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAA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A2BC,OAA9B,2DAAG,uBAAoCG,QAApC,EAAH,yEAAqD,EAAlE;AACA,aAAOC,kBAAOC,EAAP,CAAUL,OAAV,EAAmB,QAAnB,CAAP;AACD,KANC,CAOF;;;AACA,WAAO,CAAC,EAAEhB,MAAM,CAACsB,UAAP,IAAqBF,kBAAOC,EAAP,CAAUrB,MAAM,CAACsB,UAAjB,EAA6B,QAA7B,CAAvB,CAAR;AACD,GATD,CASE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD","sourcesContent":["import { ConfigPlugin, WarningAggregator, withPlugins } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\nimport { withAndroidSplashDrawables } from './withAndroidSplashDrawables';\nimport { withAndroidSplashImages } from './withAndroidSplashImages';\nimport { withAndroidSplashLegacyMainActivity } from './withAndroidSplashLegacyMainActivity';\nimport { withAndroidSplashStrings } from './withAndroidSplashStrings';\nimport { withAndroidSplashStyles } from './withAndroidSplashStyles';\n\nexport const withAndroidSplashScreen: ConfigPlugin = config => {\n const splashConfig = getAndroidSplashConfig(config);\n\n // Update the android status bar to match the splash screen\n // androidStatusBar applies info to the app activity style.\n const backgroundColor = splashConfig?.backgroundColor || '#ffffff';\n if (config.androidStatusBar?.backgroundColor) {\n if (\n backgroundColor.toLowerCase() !== config.androidStatusBar?.backgroundColor?.toLowerCase?.()\n ) {\n WarningAggregator.addWarningAndroid(\n 'androidStatusBar.backgroundColor',\n 'Color conflicts with the splash.backgroundColor'\n );\n }\n } else {\n if (!config.androidStatusBar) config.androidStatusBar = {};\n config.androidStatusBar.backgroundColor = backgroundColor;\n }\n\n return withPlugins(config, [\n withAndroidSplashImages,\n [withAndroidSplashDrawables, splashConfig],\n ...(shouldUpdateLegacyMainActivity(config) ? [withAndroidSplashLegacyMainActivity] : []),\n withAndroidSplashStyles,\n withAndroidSplashStrings,\n ]);\n};\n\nfunction shouldUpdateLegacyMainActivity(config: ExpoConfig): boolean {\n try {\n const projectRoot = config._internal?.projectRoot;\n const packagePath = resolveFrom(projectRoot, 'expo-splash-screen/package.json');\n if (packagePath) {\n const version = JsonFile.read(packagePath).version?.toString() ?? '';\n return semver.lt(version, '0.12.0');\n }\n // If expo-splash-screen didn't be installed or included in template, we check the sdkVersion instead.\n return !!(config.sdkVersion && semver.lt(config.sdkVersion, '43.0.0'));\n } catch {}\n return false;\n}\n"],"file":"withAndroidSplashScreen.js"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AndroidConfig, ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
export declare const withAndroidSplashStrings: ConfigPlugin;
|
|
3
|
+
export declare function setSplashStrings(strings: AndroidConfig.Resources.ResourceXML, resizeMode: string, statusBarTranslucent: boolean): AndroidConfig.Resources.ResourceXML;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setSplashStrings = setSplashStrings;
|
|
7
|
+
exports.withAndroidSplashStrings = void 0;
|
|
8
|
+
|
|
9
|
+
function _configPlugins() {
|
|
10
|
+
const data = require("@expo/config-plugins");
|
|
11
|
+
|
|
12
|
+
_configPlugins = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function _getAndroidSplashConfig() {
|
|
20
|
+
const data = require("./getAndroidSplashConfig");
|
|
21
|
+
|
|
22
|
+
_getAndroidSplashConfig = function () {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';
|
|
30
|
+
const STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';
|
|
31
|
+
|
|
32
|
+
const withAndroidSplashStrings = config => {
|
|
33
|
+
return (0, _configPlugins().withStringsXml)(config, config => {
|
|
34
|
+
const splashConfig = (0, _getAndroidSplashConfig().getAndroidSplashConfig)(config);
|
|
35
|
+
|
|
36
|
+
if (splashConfig) {
|
|
37
|
+
var _config$androidStatus;
|
|
38
|
+
|
|
39
|
+
const {
|
|
40
|
+
resizeMode
|
|
41
|
+
} = splashConfig;
|
|
42
|
+
const statusBarTranslucent = !!((_config$androidStatus = config.androidStatusBar) !== null && _config$androidStatus !== void 0 && _config$androidStatus.translucent);
|
|
43
|
+
config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return config;
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.withAndroidSplashStrings = withAndroidSplashStrings;
|
|
51
|
+
|
|
52
|
+
function setSplashStrings(strings, resizeMode, statusBarTranslucent) {
|
|
53
|
+
return _configPlugins().AndroidConfig.Strings.setStringItem([_configPlugins().AndroidConfig.Resources.buildResourceItem({
|
|
54
|
+
name: RESIZE_MODE_KEY,
|
|
55
|
+
value: resizeMode,
|
|
56
|
+
translatable: false
|
|
57
|
+
}), _configPlugins().AndroidConfig.Resources.buildResourceItem({
|
|
58
|
+
name: STATUS_BAR_TRANSLUCENT_KEY,
|
|
59
|
+
value: String(statusBarTranslucent),
|
|
60
|
+
translatable: false
|
|
61
|
+
})], strings);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=withAndroidSplashStrings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.ts"],"names":["RESIZE_MODE_KEY","STATUS_BAR_TRANSLUCENT_KEY","withAndroidSplashStrings","config","splashConfig","resizeMode","statusBarTranslucent","androidStatusBar","translucent","modResults","setSplashStrings","strings","AndroidConfig","Strings","setStringItem","Resources","buildResourceItem","name","value","translatable","String"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA,MAAMA,eAAe,GAAG,gCAAxB;AACA,MAAMC,0BAA0B,GAAG,2CAAnC;;AAEO,MAAMC,wBAAsC,GAAGC,MAAM,IAAI;AAC9D,SAAO,qCAAeA,MAAf,EAAuBA,MAAM,IAAI;AACtC,UAAMC,YAAY,GAAG,sDAAuBD,MAAvB,CAArB;;AACA,QAAIC,YAAJ,EAAkB;AAAA;;AAChB,YAAM;AAAEC,QAAAA;AAAF,UAAiBD,YAAvB;AACA,YAAME,oBAAoB,GAAG,CAAC,2BAACH,MAAM,CAACI,gBAAR,kDAAC,sBAAyBC,WAA1B,CAA9B;AACAL,MAAAA,MAAM,CAACM,UAAP,GAAoBC,gBAAgB,CAACP,MAAM,CAACM,UAAR,EAAoBJ,UAApB,EAAgCC,oBAAhC,CAApC;AACD;;AACD,WAAOH,MAAP;AACD,GARM,CAAP;AASD,CAVM;;;;AAYA,SAASO,gBAAT,CACLC,OADK,EAELN,UAFK,EAGLC,oBAHK,EAIgC;AACrC,SAAOM,+BAAcC,OAAd,CAAsBC,aAAtB,CACL,CACEF,+BAAcG,SAAd,CAAwBC,iBAAxB,CAA0C;AACxCC,IAAAA,IAAI,EAAEjB,eADkC;AAExCkB,IAAAA,KAAK,EAAEb,UAFiC;AAGxCc,IAAAA,YAAY,EAAE;AAH0B,GAA1C,CADF,EAMEP,+BAAcG,SAAd,CAAwBC,iBAAxB,CAA0C;AACxCC,IAAAA,IAAI,EAAEhB,0BADkC;AAExCiB,IAAAA,KAAK,EAAEE,MAAM,CAACd,oBAAD,CAF2B;AAGxCa,IAAAA,YAAY,EAAE;AAH0B,GAA1C,CANF,CADK,EAaLR,OAbK,CAAP;AAeD","sourcesContent":["import { AndroidConfig, ConfigPlugin, withStringsXml } from '@expo/config-plugins';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst RESIZE_MODE_KEY = 'expo_splash_screen_resize_mode';\nconst STATUS_BAR_TRANSLUCENT_KEY = 'expo_splash_screen_status_bar_translucent';\n\nexport const withAndroidSplashStrings: ConfigPlugin = config => {\n return withStringsXml(config, config => {\n const splashConfig = getAndroidSplashConfig(config);\n if (splashConfig) {\n const { resizeMode } = splashConfig;\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n config.modResults = setSplashStrings(config.modResults, resizeMode, statusBarTranslucent);\n }\n return config;\n });\n};\n\nexport function setSplashStrings(\n strings: AndroidConfig.Resources.ResourceXML,\n resizeMode: string,\n statusBarTranslucent: boolean\n): AndroidConfig.Resources.ResourceXML {\n return AndroidConfig.Strings.setStringItem(\n [\n AndroidConfig.Resources.buildResourceItem({\n name: RESIZE_MODE_KEY,\n value: resizeMode,\n translatable: false,\n }),\n AndroidConfig.Resources.buildResourceItem({\n name: STATUS_BAR_TRANSLUCENT_KEY,\n value: String(statusBarTranslucent),\n translatable: false,\n }),\n ],\n strings\n );\n}\n"],"file":"withAndroidSplashStrings.js"}
|
|
@@ -156,7 +156,7 @@ const withIosExpoPlugins = (config, {
|
|
|
156
156
|
config.ios.bundleIdentifier = bundleIdentifier;
|
|
157
157
|
return (0, _configPlugins().withPlugins)(config, [[_configPlugins().IOSConfig.BundleIdentifier.withBundleIdentifier, {
|
|
158
158
|
bundleIdentifier
|
|
159
|
-
}], _configPlugins().IOSConfig.Swift.withSwiftBridgingHeader, _configPlugins().IOSConfig.Swift.withNoopSwiftFile, _configPlugins().IOSConfig.Google.withGoogle, _configPlugins().IOSConfig.Name.withDisplayName, _configPlugins().IOSConfig.Orientation.withOrientation, _configPlugins().IOSConfig.RequiresFullScreen.withRequiresFullScreen, _configPlugins().IOSConfig.RootViewBackgroundColor.withRootViewBackgroundColor, _configPlugins().IOSConfig.Scheme.withScheme, _configPlugins().IOSConfig.UserInterfaceStyle.withUserInterfaceStyle, _configPlugins().IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption, _configPlugins().IOSConfig.Version.withBuildNumber, _configPlugins().IOSConfig.Version.withVersion, _configPlugins().IOSConfig.Google.withGoogleServicesFile, // Entitlements
|
|
159
|
+
}], _configPlugins().IOSConfig.Swift.withSwiftBridgingHeader, _configPlugins().IOSConfig.Swift.withNoopSwiftFile, _configPlugins().IOSConfig.Google.withGoogle, _configPlugins().IOSConfig.Name.withDisplayName, _configPlugins().IOSConfig.Orientation.withOrientation, _configPlugins().IOSConfig.RequiresFullScreen.withRequiresFullScreen, _configPlugins().IOSConfig.RootViewBackgroundColor.withRootViewBackgroundColor, _configPlugins().IOSConfig.Scheme.withScheme, _configPlugins().IOSConfig.UserInterfaceStyle.withUserInterfaceStyle, _configPlugins().IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption, _configPlugins().IOSConfig.Version.withBuildNumber, _configPlugins().IOSConfig.Version.withVersion, _configPlugins().IOSConfig.Google.withGoogleServicesFile, _configPlugins().IOSConfig.JsEngine.withJsEnginePodfileProps, // Entitlements
|
|
160
160
|
_configPlugins().IOSConfig.Entitlements.withAssociatedDomains, // XcodeProject
|
|
161
161
|
_configPlugins().IOSConfig.DeviceFamily.withDeviceFamily, _configPlugins().IOSConfig.Locales.withLocales, // Dangerous
|
|
162
162
|
_withIosIcons().withIosIcons]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/plugins/withDefaultPlugins.ts"],"names":["withIosExpoPlugins","config","bundleIdentifier","ios","IOSConfig","BundleIdentifier","withBundleIdentifier","Swift","withSwiftBridgingHeader","withNoopSwiftFile","Google","withGoogle","Name","withDisplayName","Orientation","withOrientation","RequiresFullScreen","withRequiresFullScreen","RootViewBackgroundColor","withRootViewBackgroundColor","Scheme","withScheme","UserInterfaceStyle","withUserInterfaceStyle","UsesNonExemptEncryption","withUsesNonExemptEncryption","Version","withBuildNumber","withVersion","withGoogleServicesFile","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Locales","withLocales","withIosIcons","withAndroidExpoPlugins","props","android","package","AndroidConfig","JsEngine","withJsEngineGradleProps","withNameSettingsGradle","GoogleServices","withClassPath","withApplyPlugin","Package","withPackageGradle","withPackageManifest","AllowBackup","withAllowBackup","WindowSoftInputMode","withWindowSoftInputMode","IntentFilters","withAndroidIntentFilters","Permissions","withPermissions","withUiModeManifest","withUiModeMainActivity","withName","NavigationBar","withNavigationBar","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","c","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSplashScreen","getAutoPlugins","concat","legacyExpoPlugins","expoManagedVersionedPlugins","getLegacyExpoPlugins","withOptionalLegacyPlugins","plugins","reduce","prev","plugin","_isLegacyPlugin","fallback","withLegacyExpoPlugins","Set"],"mappings":";;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAUA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAxBA;AACA;AACA;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AiBD,IAAjB,EAAuB;AAC5B;AACAE,MAAAA,eAAe,EAAE,IAFW;AAG5BD,MAAAA,MAH4B;AAI5B;AACAE,MAAAA,QAAQ,EAAE7F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GARM,EAQJA,MARI,CAAP;AASD,CAVD;;AAYO,SAAS8F,qBAAT,CAA+B9F,MAA/B,EAAmD;AACxD,SAAOuF,yBAAyB,CAACvF,MAAD,EAAS,CACvC,GAAG,IAAI+F,GAAJ,CAAQV,2BAA2B,CAACF,MAA5B,CAAmCC,iBAAnC,CAAR,CADoC,CAAT,CAAhC;AAGD","sourcesContent":["/**\n * These are the versioned first-party plugins with some of the future third-party plugins mixed in for legacy support.\n */\nimport {\n AndroidConfig,\n ConfigPlugin,\n IOSConfig,\n StaticPlugin,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport { withAndroidIcons } from './icons/withAndroidIcons';\nimport { withIosIcons } from './icons/withIosIcons';\nimport withAdMob from './unversioned/expo-ads-admob/expo-ads-admob';\nimport withAppleAuthentication from './unversioned/expo-apple-authentication';\nimport withBranch from './unversioned/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook';\nimport withNotifications from './unversioned/expo-notifications/expo-notifications';\nimport withSplashScreen from './unversioned/expo-splash-screen/expo-splash-screen';\nimport withUpdates from './unversioned/expo-updates';\nimport withMaps from './unversioned/react-native-maps';\n\n/**\n * Config plugin to apply all of the custom Expo iOS config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withIosExpoPlugins: ConfigPlugin<{\n bundleIdentifier: string;\n}> = (config, { bundleIdentifier }) => {\n // Set the bundle ID ahead of time.\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier = bundleIdentifier;\n\n return withPlugins(config, [\n [IOSConfig.BundleIdentifier.withBundleIdentifier, { bundleIdentifier }],\n IOSConfig.Swift.withSwiftBridgingHeader,\n IOSConfig.Swift.withNoopSwiftFile,\n IOSConfig.Google.withGoogle,\n IOSConfig.Name.withDisplayName,\n IOSConfig.Orientation.withOrientation,\n IOSConfig.RequiresFullScreen.withRequiresFullScreen,\n IOSConfig.RootViewBackgroundColor.withRootViewBackgroundColor,\n IOSConfig.Scheme.withScheme,\n IOSConfig.UserInterfaceStyle.withUserInterfaceStyle,\n IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption,\n IOSConfig.Version.withBuildNumber,\n IOSConfig.Version.withVersion,\n IOSConfig.Google.withGoogleServicesFile,\n // Entitlements\n IOSConfig.Entitlements.withAssociatedDomains,\n // XcodeProject\n IOSConfig.DeviceFamily.withDeviceFamily,\n IOSConfig.Locales.withLocales,\n // Dangerous\n withIosIcons,\n ]);\n};\n\n/**\n * Config plugin to apply all of the custom Expo Android config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withAndroidExpoPlugins: ConfigPlugin<{\n package: string;\n}> = (config, props) => {\n // Set the package name ahead of time.\n if (!config.android) config.android = {};\n config.android.package = props.package;\n\n return withPlugins(config, [\n // gradle.properties\n AndroidConfig.JsEngine.withJsEngineGradleProps,\n\n // settings.gradle\n AndroidConfig.Name.withNameSettingsGradle,\n\n // project build.gradle\n AndroidConfig.GoogleServices.withClassPath,\n\n // app/build.gradle\n AndroidConfig.GoogleServices.withApplyPlugin,\n AndroidConfig.Package.withPackageGradle,\n AndroidConfig.Version.withVersion,\n\n // AndroidManifest.xml\n AndroidConfig.Package.withPackageManifest,\n AndroidConfig.AllowBackup.withAllowBackup,\n AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode,\n // Note: The withAndroidIntentFilters plugin must appear before the withScheme\n // plugin or withScheme will override the output of withAndroidIntentFilters.\n AndroidConfig.IntentFilters.withAndroidIntentFilters,\n AndroidConfig.Scheme.withScheme,\n AndroidConfig.Orientation.withOrientation,\n AndroidConfig.Permissions.withPermissions,\n AndroidConfig.UserInterfaceStyle.withUiModeManifest,\n\n // MainActivity.*\n AndroidConfig.UserInterfaceStyle.withUiModeMainActivity,\n\n // strings.xml\n AndroidConfig.Name.withName,\n\n // Dangerous -- these plugins run in reverse order.\n AndroidConfig.GoogleServices.withGoogleServicesFile,\n\n // Modify colors.xml and styles.xml\n AndroidConfig.RootViewBackgroundColor.withRootViewBackgroundColor,\n AndroidConfig.NavigationBar.withNavigationBar,\n AndroidConfig.StatusBar.withStatusBar,\n AndroidConfig.PrimaryColor.withPrimaryColor,\n\n c => withAndroidIcons(c),\n // If we renamed the package, we should also move it around and rename it in source files\n // Added last to ensure this plugin runs first. Out of tree solutions will mistakenly resolve the package incorrectly otherwise.\n AndroidConfig.Package.withPackageRefactor,\n ]);\n};\n\n// Must keep in sync with `withVersionedExpoSDKPlugins`\nconst versionedExpoSDKPackages: string[] = [\n 'react-native-maps',\n 'expo-ads-admob',\n 'expo-apple-authentication',\n 'expo-contacts',\n 'expo-notifications',\n 'expo-updates',\n 'expo-branch',\n 'expo-document-picker',\n 'expo-facebook',\n 'expo-splash-screen',\n];\n\nexport const withVersionedExpoSDKPlugins: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withPlugins(config, [\n withMaps,\n withAdMob,\n withAppleAuthentication,\n withContacts,\n withNotifications,\n [withUpdates, { expoUsername }],\n withBranch,\n withDocumentPicker,\n withFacebook,\n withSplashScreen,\n ]);\n};\n\nexport function getAutoPlugins() {\n return versionedExpoSDKPackages.concat(legacyExpoPlugins).concat(expoManagedVersionedPlugins);\n}\n\nexport function getLegacyExpoPlugins() {\n return legacyExpoPlugins;\n}\n\n// Expo managed packages that require extra update.\n// These get applied automatically to create parity with expo build in eas build.\nconst legacyExpoPlugins = [\n 'expo-app-auth',\n 'expo-av',\n 'expo-background-fetch',\n 'expo-barcode-scanner',\n 'expo-brightness',\n 'expo-calendar',\n 'expo-camera',\n 'expo-cellular',\n 'expo-dev-menu',\n 'expo-dev-launcher',\n 'expo-dev-client',\n 'expo-image-picker',\n 'expo-file-system',\n 'expo-ads-facebook',\n 'expo-location',\n 'expo-media-library',\n 'expo-screen-orientation',\n 'expo-sensors',\n 'expo-task-manager',\n 'expo-local-authentication',\n];\n\n// Plugins that need to be automatically applied, but also get applied by expo-cli if the versioned plugin isn't available.\n// These are split up because the user doesn't need to be prompted to setup these packages.\nconst expoManagedVersionedPlugins = [\n 'expo-firebase-analytics',\n 'expo-firebase-core',\n 'expo-google-sign-in',\n];\n\nconst withOptionalLegacyPlugins: ConfigPlugin<(StaticPlugin | string)[]> = (config, plugins) => {\n return plugins.reduce((prev, plugin) => {\n return withStaticPlugin(prev, {\n // hide errors\n _isLegacyPlugin: true,\n plugin,\n // If a plugin doesn't exist, do nothing.\n fallback: config => config,\n });\n }, config);\n};\n\nexport function withLegacyExpoPlugins(config: ExpoConfig) {\n return withOptionalLegacyPlugins(config, [\n ...new Set(expoManagedVersionedPlugins.concat(legacyExpoPlugins)),\n ]);\n}\n"],"file":"withDefaultPlugins.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/plugins/withDefaultPlugins.ts"],"names":["withIosExpoPlugins","config","bundleIdentifier","ios","IOSConfig","BundleIdentifier","withBundleIdentifier","Swift","withSwiftBridgingHeader","withNoopSwiftFile","Google","withGoogle","Name","withDisplayName","Orientation","withOrientation","RequiresFullScreen","withRequiresFullScreen","RootViewBackgroundColor","withRootViewBackgroundColor","Scheme","withScheme","UserInterfaceStyle","withUserInterfaceStyle","UsesNonExemptEncryption","withUsesNonExemptEncryption","Version","withBuildNumber","withVersion","withGoogleServicesFile","JsEngine","withJsEnginePodfileProps","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Locales","withLocales","withIosIcons","withAndroidExpoPlugins","props","android","package","AndroidConfig","withJsEngineGradleProps","withNameSettingsGradle","GoogleServices","withClassPath","withApplyPlugin","Package","withPackageGradle","withPackageManifest","AllowBackup","withAllowBackup","WindowSoftInputMode","withWindowSoftInputMode","IntentFilters","withAndroidIntentFilters","Permissions","withPermissions","withUiModeManifest","withUiModeMainActivity","withName","NavigationBar","withNavigationBar","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","c","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSplashScreen","getAutoPlugins","concat","legacyExpoPlugins","expoManagedVersionedPlugins","getLegacyExpoPlugins","withOptionalLegacyPlugins","plugins","reduce","prev","plugin","_isLegacyPlugin","fallback","withLegacyExpoPlugins","Set"],"mappings":";;;;;;;;;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAUA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAxBA;AACA;AACA;;AAwBA;AACA;AACA;AACA;AACO,MAAMA,kBAEX,GAAG,CAACC,MAAD,EAAS;AAAEC,EAAAA;AAAF,CAAT,KAAkC;AACrC;AACA,MAAI,CAACD,MAAM,CAACE,GAAZ,EAAiBF,MAAM,CAACE,GAAP,GAAa,EAAb;AACjBF,EAAAA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OD,GARM,EAQJA,MARI,CAAP;AASD,CAVD;;AAYO,SAAS+F,qBAAT,CAA+B/F,MAA/B,EAAmD;AACxD,SAAOwF,yBAAyB,CAACxF,MAAD,EAAS,CACvC,GAAG,IAAIgG,GAAJ,CAAQV,2BAA2B,CAACF,MAA5B,CAAmCC,iBAAnC,CAAR,CADoC,CAAT,CAAhC;AAGD","sourcesContent":["/**\n * These are the versioned first-party plugins with some of the future third-party plugins mixed in for legacy support.\n */\nimport {\n AndroidConfig,\n ConfigPlugin,\n IOSConfig,\n StaticPlugin,\n withPlugins,\n withStaticPlugin,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nimport { withAndroidIcons } from './icons/withAndroidIcons';\nimport { withIosIcons } from './icons/withIosIcons';\nimport withAdMob from './unversioned/expo-ads-admob/expo-ads-admob';\nimport withAppleAuthentication from './unversioned/expo-apple-authentication';\nimport withBranch from './unversioned/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook';\nimport withNotifications from './unversioned/expo-notifications/expo-notifications';\nimport withSplashScreen from './unversioned/expo-splash-screen/expo-splash-screen';\nimport withUpdates from './unversioned/expo-updates';\nimport withMaps from './unversioned/react-native-maps';\n\n/**\n * Config plugin to apply all of the custom Expo iOS config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withIosExpoPlugins: ConfigPlugin<{\n bundleIdentifier: string;\n}> = (config, { bundleIdentifier }) => {\n // Set the bundle ID ahead of time.\n if (!config.ios) config.ios = {};\n config.ios.bundleIdentifier = bundleIdentifier;\n\n return withPlugins(config, [\n [IOSConfig.BundleIdentifier.withBundleIdentifier, { bundleIdentifier }],\n IOSConfig.Swift.withSwiftBridgingHeader,\n IOSConfig.Swift.withNoopSwiftFile,\n IOSConfig.Google.withGoogle,\n IOSConfig.Name.withDisplayName,\n IOSConfig.Orientation.withOrientation,\n IOSConfig.RequiresFullScreen.withRequiresFullScreen,\n IOSConfig.RootViewBackgroundColor.withRootViewBackgroundColor,\n IOSConfig.Scheme.withScheme,\n IOSConfig.UserInterfaceStyle.withUserInterfaceStyle,\n IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption,\n IOSConfig.Version.withBuildNumber,\n IOSConfig.Version.withVersion,\n IOSConfig.Google.withGoogleServicesFile,\n IOSConfig.JsEngine.withJsEnginePodfileProps,\n // Entitlements\n IOSConfig.Entitlements.withAssociatedDomains,\n // XcodeProject\n IOSConfig.DeviceFamily.withDeviceFamily,\n IOSConfig.Locales.withLocales,\n // Dangerous\n withIosIcons,\n ]);\n};\n\n/**\n * Config plugin to apply all of the custom Expo Android config plugins we support by default.\n * TODO: In the future most of this should go into versioned packages like expo-facebook, expo-updates, etc...\n */\nexport const withAndroidExpoPlugins: ConfigPlugin<{\n package: string;\n}> = (config, props) => {\n // Set the package name ahead of time.\n if (!config.android) config.android = {};\n config.android.package = props.package;\n\n return withPlugins(config, [\n // gradle.properties\n AndroidConfig.JsEngine.withJsEngineGradleProps,\n\n // settings.gradle\n AndroidConfig.Name.withNameSettingsGradle,\n\n // project build.gradle\n AndroidConfig.GoogleServices.withClassPath,\n\n // app/build.gradle\n AndroidConfig.GoogleServices.withApplyPlugin,\n AndroidConfig.Package.withPackageGradle,\n AndroidConfig.Version.withVersion,\n\n // AndroidManifest.xml\n AndroidConfig.Package.withPackageManifest,\n AndroidConfig.AllowBackup.withAllowBackup,\n AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode,\n // Note: The withAndroidIntentFilters plugin must appear before the withScheme\n // plugin or withScheme will override the output of withAndroidIntentFilters.\n AndroidConfig.IntentFilters.withAndroidIntentFilters,\n AndroidConfig.Scheme.withScheme,\n AndroidConfig.Orientation.withOrientation,\n AndroidConfig.Permissions.withPermissions,\n AndroidConfig.UserInterfaceStyle.withUiModeManifest,\n\n // MainActivity.*\n AndroidConfig.UserInterfaceStyle.withUiModeMainActivity,\n\n // strings.xml\n AndroidConfig.Name.withName,\n\n // Dangerous -- these plugins run in reverse order.\n AndroidConfig.GoogleServices.withGoogleServicesFile,\n\n // Modify colors.xml and styles.xml\n AndroidConfig.RootViewBackgroundColor.withRootViewBackgroundColor,\n AndroidConfig.NavigationBar.withNavigationBar,\n AndroidConfig.StatusBar.withStatusBar,\n AndroidConfig.PrimaryColor.withPrimaryColor,\n\n c => withAndroidIcons(c),\n // If we renamed the package, we should also move it around and rename it in source files\n // Added last to ensure this plugin runs first. Out of tree solutions will mistakenly resolve the package incorrectly otherwise.\n AndroidConfig.Package.withPackageRefactor,\n ]);\n};\n\n// Must keep in sync with `withVersionedExpoSDKPlugins`\nconst versionedExpoSDKPackages: string[] = [\n 'react-native-maps',\n 'expo-ads-admob',\n 'expo-apple-authentication',\n 'expo-contacts',\n 'expo-notifications',\n 'expo-updates',\n 'expo-branch',\n 'expo-document-picker',\n 'expo-facebook',\n 'expo-splash-screen',\n];\n\nexport const withVersionedExpoSDKPlugins: ConfigPlugin<{ expoUsername: string | null }> = (\n config,\n { expoUsername }\n) => {\n return withPlugins(config, [\n withMaps,\n withAdMob,\n withAppleAuthentication,\n withContacts,\n withNotifications,\n [withUpdates, { expoUsername }],\n withBranch,\n withDocumentPicker,\n withFacebook,\n withSplashScreen,\n ]);\n};\n\nexport function getAutoPlugins() {\n return versionedExpoSDKPackages.concat(legacyExpoPlugins).concat(expoManagedVersionedPlugins);\n}\n\nexport function getLegacyExpoPlugins() {\n return legacyExpoPlugins;\n}\n\n// Expo managed packages that require extra update.\n// These get applied automatically to create parity with expo build in eas build.\nconst legacyExpoPlugins = [\n 'expo-app-auth',\n 'expo-av',\n 'expo-background-fetch',\n 'expo-barcode-scanner',\n 'expo-brightness',\n 'expo-calendar',\n 'expo-camera',\n 'expo-cellular',\n 'expo-dev-menu',\n 'expo-dev-launcher',\n 'expo-dev-client',\n 'expo-image-picker',\n 'expo-file-system',\n 'expo-ads-facebook',\n 'expo-location',\n 'expo-media-library',\n 'expo-screen-orientation',\n 'expo-sensors',\n 'expo-task-manager',\n 'expo-local-authentication',\n];\n\n// Plugins that need to be automatically applied, but also get applied by expo-cli if the versioned plugin isn't available.\n// These are split up because the user doesn't need to be prompted to setup these packages.\nconst expoManagedVersionedPlugins = [\n 'expo-firebase-analytics',\n 'expo-firebase-core',\n 'expo-google-sign-in',\n];\n\nconst withOptionalLegacyPlugins: ConfigPlugin<(StaticPlugin | string)[]> = (config, plugins) => {\n return plugins.reduce((prev, plugin) => {\n return withStaticPlugin(prev, {\n // hide errors\n _isLegacyPlugin: true,\n plugin,\n // If a plugin doesn't exist, do nothing.\n fallback: config => config,\n });\n }, config);\n};\n\nexport function withLegacyExpoPlugins(config: ExpoConfig) {\n return withOptionalLegacyPlugins(config, [\n ...new Set(expoManagedVersionedPlugins.concat(legacyExpoPlugins)),\n ]);\n}\n"],"file":"withDefaultPlugins.js"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/prebuild-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,14 +34,15 @@
|
|
|
34
34
|
"@types/debug": "^4.1.5"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@expo/config": "
|
|
38
|
-
"@expo/config-plugins": "
|
|
37
|
+
"@expo/config": "6.0.0",
|
|
38
|
+
"@expo/config-plugins": "4.0.0",
|
|
39
39
|
"@expo/config-types": "^42.0.0",
|
|
40
40
|
"@expo/image-utils": "0.3.16",
|
|
41
41
|
"@expo/json-file": "8.2.33",
|
|
42
42
|
"debug": "^4.3.1",
|
|
43
43
|
"fs-extra": "^9.0.0",
|
|
44
|
-
"resolve-from": "^5.0.0"
|
|
44
|
+
"resolve-from": "^5.0.0",
|
|
45
|
+
"semver": "7.3.2"
|
|
45
46
|
},
|
|
46
47
|
"publishConfig": {
|
|
47
48
|
"access": "public"
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
-
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
-
export declare const withAndroidSplashMainActivity: ConfigPlugin;
|
|
4
|
-
export declare function setSplashScreenMainActivity(config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>, mainActivity: string, language: 'java' | 'kt'): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashMainActivity.ts"],"names":["debug","SHOW_SPLASH_ID","withAndroidSplashMainActivity","config","modResults","contents","setSplashScreenMainActivity","language","mainActivity","splashConfig","mod","src","tag","didClear","statusBarTranslucent","androidStatusBar","translucent","resizeMode","isJava","LE","AndroidConfig","UserInterfaceStyle","addJavaImports","match","onCreateBlock","anchor","offset","comment","newSrc","join","split","filter","line","test","toUpperCase"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA,MAAMA,KAAK,GAAG,sBAAM,8DAAN,CAAd,C,CAEA;;AACA,MAAMC,cAAc,GAAG,sDAAvB;;AAEO,MAAMC,6BAA2C,GAAGC,MAAM,IAAI;AACnE,SAAO,uCAAiBA,MAAjB,EAAyBA,MAAM,IAAI;AACxCA,IAAAA,MAAM,CAACC,UAAP,CAAkBC,QAAlB,GAA6BC,2BAA2B,CACtDH,MADsD,EAEtDA,MAAM,CAACC,UAAP,CAAkBC,QAFoC,EAGtDF,MAAM,CAACC,UAAP,CAAkBG,QAHoC,CAAxD;AAKA,WAAOJ,MAAP;AACD,GAPM,CAAP;AAQD,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AAAA,MAAM,EAAE,CANmB;AAO3BC,MAAAA,OAAO,EAAE,IAPkB;AAQ3Bf,MAAAA,GAAG,EAAE,0CARsB;AAS3BgB,MAAAA,MAAM,EAAEJ,aAAa,CAACK,IAAd,CAAmB,IAAnB;AATmB,KAAd,EAUZxB,QAVH;AAWD,GA3DO,CA6DR;;;AACAG,EAAAA,YAAY,GAAG,oCAAe;AAC5BG,IAAAA,GAAG,EAAEH,YADuB;AAE5BI,IAAAA,GAAG,EAAEX;AAFuB,GAAf,EAGZI,QAHH,CA9DQ,CAmER;;AACAG,EAAAA,YAAY,GAAGA,YAAY,CACxBsB,KADY,CACN,IADM,EAEZC,MAFY,CAELC,IAAI,IAAI;AACd,WAAO,CAAC,4DAA4DC,IAA5D,CAAiED,IAAjE,CAAR;AACD,GAJY,EAKZH,IALY,CAKP,IALO,CAAf,CApEQ,CA2ER;;AACArB,EAAAA,YAAY,GAAG,mCAAc;AAC3BG,IAAAA,GAAG,EAAEH,YADsB;AAE3B;AACAiB,IAAAA,MAAM,EAAE,6BAHmB;AAI3BC,IAAAA,MAAM,EAAE,CAJmB;AAK3BC,IAAAA,OAAO,EAAE,IALkB;AAM3Bf,IAAAA,GAAG,EAAEX,cANsB;AAO3B2B,IAAAA,MAAM,EAAG,2DAA0DX,UAAU,CAACiB,WAAX,EAAyB,kBAC1FhB,MAAM,GAAG,QAAH,GAAc,cACrB,KAAIJ,oBAAqB,IAAGK,EAAG;AATL,GAAd,EAUZd,QAVH,CA5EQ,CAwFR;;AAEA,SAAOG,YAAP;AACD","sourcesContent":["import { AndroidConfig, ConfigPlugin, withMainActivity } from '@expo/config-plugins';\nimport { mergeContents, removeContents } from '@expo/config-plugins/build/utils/generateCode';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { getAndroidSplashConfig } from './getAndroidSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:android:mainActivity');\n\n// DO NOT CHANGE\nconst SHOW_SPLASH_ID = 'expo-splash-screen-mainActivity-onCreate-show-splash';\n\nexport const withAndroidSplashMainActivity: ConfigPlugin = config => {\n return withMainActivity(config, config => {\n config.modResults.contents = setSplashScreenMainActivity(\n config,\n config.modResults.contents,\n config.modResults.language\n );\n return config;\n });\n};\n\nexport function setSplashScreenMainActivity(\n config: Pick<ExpoConfig, 'android' | 'androidStatusBar' | 'userInterfaceStyle'>,\n mainActivity: string,\n language: 'java' | 'kt'\n): string {\n debug(`Modify with language: \"${language}\"`);\n const splashConfig = getAndroidSplashConfig(config);\n\n if (!splashConfig) {\n // Remove our generated code safely...\n const mod = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n });\n\n mainActivity = mod.contents;\n if (mod.didClear) {\n debug('Removed SplashScreen.show()');\n }\n return mainActivity;\n }\n // TODO: Translucent is weird\n const statusBarTranslucent = !!config.androidStatusBar?.translucent;\n\n const { resizeMode } = splashConfig;\n const isJava = language === 'java';\n const LE = isJava ? ';' : '';\n\n mainActivity = AndroidConfig.UserInterfaceStyle.addJavaImports(\n mainActivity,\n [\n 'expo.modules.splashscreen.SplashScreen',\n 'expo.modules.splashscreen.SplashScreenImageResizeMode',\n 'android.os.Bundle',\n ],\n isJava\n );\n\n if (!mainActivity.match(/(?<=^.*super\\.onCreate.*$)/m)) {\n const onCreateBlock = isJava\n ? [\n ' @Override',\n ' protected void onCreate(Bundle savedInstanceState) {',\n ' super.onCreate(savedInstanceState);',\n ' }',\n ]\n : [\n ' override fun onCreate(savedInstanceState: Bundle?) {',\n ' super.onCreate(savedInstanceState)',\n ' }',\n ];\n\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: isJava\n ? /(?<=public\\s+class\\s+.*\\s+extends\\s+.*\\s+{.*$)/m\n : /(?<=class\\s+.*\\s+:\\s+.*\\s+{.*$)/m,\n offset: 1,\n comment: '//',\n tag: 'expo-splash-screen-mainActivity-onCreate',\n newSrc: onCreateBlock.join('\\n'),\n }).contents;\n }\n\n // Remove our generated code safely...\n mainActivity = removeContents({\n src: mainActivity,\n tag: SHOW_SPLASH_ID,\n }).contents;\n\n // Remove code from `@expo/configure-splash-screen`\n mainActivity = mainActivity\n .split('\\n')\n .filter(line => {\n return !/SplashScreen\\.show\\(this,\\s?SplashScreenImageResizeMode\\./.test(line);\n })\n .join('\\n');\n\n // Reapply generated code.\n mainActivity = mergeContents({\n src: mainActivity,\n // insert just below super.onCreate\n anchor: /(?<=^.*super\\.onCreate.*$)/m,\n offset: 1,\n comment: '//',\n tag: SHOW_SPLASH_ID,\n newSrc: ` SplashScreen.show(this, SplashScreenImageResizeMode.${resizeMode.toUpperCase()}, ReactRootView${\n isJava ? '.class' : '::class.java'\n }, ${statusBarTranslucent})${LE}`,\n }).contents;\n\n // TODO: Remove old `SplashScreen.show`\n\n return mainActivity;\n}\n"],"file":"withAndroidSplashMainActivity.js"}
|