@expo/prebuild-config 3.0.6 → 3.0.7
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/InterfaceBuilder.js +11 -4
- package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +30 -17
- package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +38 -11
- package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.d.ts +2 -0
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +64 -0
- package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.d.ts +6 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +70 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.d.ts +2 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +34 -0
- package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -0
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.d.ts +5 -0
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +73 -0
- package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -0
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.d.ts +5 -0
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +65 -0
- package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -0
- package/build/plugins/withDefaultPlugins.js +17 -6
- package/build/plugins/withDefaultPlugins.js.map +1 -1
- package/package.json +3 -3
|
@@ -7,10 +7,10 @@ exports.applyImageToSplashScreenXML = applyImageToSplashScreenXML;
|
|
|
7
7
|
exports.createTemplateSplashScreenAsync = createTemplateSplashScreenAsync;
|
|
8
8
|
exports.toString = toString;
|
|
9
9
|
|
|
10
|
-
function
|
|
11
|
-
const data = require("
|
|
10
|
+
function _crypto() {
|
|
11
|
+
const data = _interopRequireDefault(require("crypto"));
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
_crypto = function () {
|
|
14
14
|
return data;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -27,6 +27,8 @@ function _xml2js() {
|
|
|
27
27
|
return data;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
30
32
|
function createConstraint([firstItem, firstAttribute], [secondItem, secondAttribute]) {
|
|
31
33
|
return {
|
|
32
34
|
$: {
|
|
@@ -34,11 +36,16 @@ function createConstraint([firstItem, firstAttribute], [secondItem, secondAttrib
|
|
|
34
36
|
firstAttribute,
|
|
35
37
|
secondItem,
|
|
36
38
|
secondAttribute,
|
|
37
|
-
|
|
39
|
+
// Prevent updating between runs
|
|
40
|
+
id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute)
|
|
38
41
|
}
|
|
39
42
|
};
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
function createConstraintId(...attributes) {
|
|
46
|
+
return _crypto().default.createHash('sha1').update(attributes.join('-')).digest('hex');
|
|
47
|
+
}
|
|
48
|
+
|
|
42
49
|
function applyImageToSplashScreenXML(xml, {
|
|
43
50
|
imageName,
|
|
44
51
|
contentMode
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"names":["createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","$","id","applyImageToSplashScreenXML","xml","imageName","contentMode","imageId","containerId","width","height","imageView","userLabel","image","horizontalHuggingPriority","verticalHuggingPriority","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","rect","key","x","y","document","scenes","scene","objects","viewController","view","subviews","push","constraints","constraint","resources","name","createTemplateSplashScreenAsync","contents","Parser","parseStringPromise","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAmKA,SAASA,gBAAT,CACE,CAACC,SAAD,EAAYC,cAAZ,CADF,EAEE,CAACC,UAAD,EAAaC,eAAb,CAFF,EAGgB;AACd,SAAO;AACLC,IAAAA,CAAC,EAAE;AACDJ,MAAAA,SADC;AAEDC,MAAAA,cAFC;AAGDC,MAAAA,UAHC;AAIDC,MAAAA,eAJC;AAKDE,MAAAA,EAAE,EAAE;AALH;AADE,GAAP;AASD;;AAEM,SAASC,2BAAT,CACLC,GADK,EAEL;AACEC,EAAAA,SADF;AAEEC,EAAAA;AAFF,CAFK,EASmB;AACxB,QAAMC,OAAO,GAAG,mBAAhB;AACA,QAAMC,WAAW,GAAG,oBAApB;AACA,QAAMC,KAAK,GAAG,GAAd;AACA,QAAMC,MAAM,GAAG,GAAf;AAEA,QAAMC,SAAsB,GAAG;AAC7BV,IAAAA,CAAC,EAAE;AACDC,MAAAA,EAAE,EAAEK,OADH;AAEDK,MAAAA,SAAS,EAAEP,SAFV;AAGDQ,MAAAA,KAAK,EAAER,SAHN;AAIDC,MAAAA,WAJC;AAKDQ,MAAAA,yBAAyB,EAAE,GAL1B;AAMDC,MAAAA,uBAAuB,EAAE,GANxB;AAODC,MAAAA,aAAa,EAAE,IAPd;AAQDC,MAAAA,sBAAsB,EAAE,KARvB;AASDC,MAAAA,yCAAyC,EAAE;AAT1C,KAD0B;AAY7BC,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,KAA1B,CAAgCiB,IAAhC,CAAqC;AACnC;AACA7B,IAAAA,CAAC,EAAE;AACDiC,MAAAA,IAAI,EAAE7B,SADL;AAEDI,MAAAA,KAFC;AAGDC,MAAAA;AAHC;AAFgC,GAArC;AASA,SAAON,GAAP;AACD;;AAEM,eAAe+B,+BAAf,GAAkF;AACvF,QAAMC,QAAQ,GAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAzEE;AA0EA,SAAO,MAAM,KAAIC,gBAAJ,IAAaC,kBAAb,CAAgCF,QAAhC,CAAb;AACD,C,CAED;;;AACO,SAASG,QAAT,CAAkBnC,GAAlB,EAAoC;AACzC,QAAMoC,OAAO,GAAG,KAAIC,iBAAJ,EAAY;AAC1BC,IAAAA,qBAAqB,EAAE,IADG;AAE1BC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,KADH;AAENC,MAAAA,QAAQ,EAAE;AAFJ,KAFkB;AAM1BC,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE,IADE;AAEVC,MAAAA,MAAM,EAAE;AAFE;AANc,GAAZ,CAAhB;AAWA,SAAOR,OAAO,CAACS,WAAR,CAAoB7C,GAApB,CAAP;AACD","sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { Builder, Parser } from 'xml2js';\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any }\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleAspectFill';\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n systemColor: string | 'systemBackgroundColor';\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\ntype IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\ntype IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n }[];\n }\n >;\n};\n\nfunction createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute]\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n id: uuidv4(),\n },\n };\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n }\n): IBSplashScreenDocument {\n const imageId = 'EXPO-SplashScreen';\n const containerId = 'EXPO-ContainerView';\n const width = 414;\n const height = 736;\n\n const imageView: IBImageView = {\n $: {\n id: imageId,\n userLabel: imageName,\n image: imageName,\n contentMode,\n horizontalHuggingPriority: 251,\n verticalHuggingPriority: 251,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x: 0.0,\n y: 0.0,\n width,\n height,\n },\n },\n ],\n };\n\n // Add ImageView\n xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0].subviews[0].imageView.push(\n imageView\n );\n\n // Add Constraints\n xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0].constraints[0].constraint.push(\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n createConstraint([imageId, 'top'], [containerId, 'top']),\n createConstraint([imageId, 'leading'], [containerId, 'leading']),\n createConstraint([imageId, 'trailing'], [containerId, 'trailing']),\n createConstraint([imageId, 'bottom'], [containerId, 'bottom'])\n );\n\n // Add resource\n xml.document.resources[0].image.push({\n // <image name=\"SplashScreen\" width=\"414\" height=\"736\"/>\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n return xml;\n}\n\nexport async function createTemplateSplashScreenAsync(): Promise<IBSplashScreenDocument> {\n const contents = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <document\n type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\"\n version=\"3.0\"\n toolsVersion=\"16096\"\n targetRuntime=\"iOS.CocoaTouch\"\n propertyAccessControl=\"none\"\n useAutolayout=\"YES\"\n launchScreen=\"YES\"\n useTraitCollections=\"YES\"\n useSafeAreas=\"YES\"\n colorMatched=\"YES\"\n initialViewController=\"EXPO-VIEWCONTROLLER-1\"\n >\n <device id=\"retina5_5\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"16087\"/>\n <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"EXPO-SCENE-1\">\n <objects>\n <viewController\n storyboardIdentifier=\"SplashScreenViewController\"\n id=\"EXPO-VIEWCONTROLLER-1\"\n sceneMemberID=\"viewController\"\n >\n <view\n key=\"view\"\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleToFill\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n id=\"EXPO-ContainerView\"\n userLabel=\"ContainerView\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n <subviews>\n <imageView\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleAspectFill\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n image=\"SplashScreenBackground\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n id=\"EXPO-SplashScreenBackground\"\n userLabel=\"SplashScreenBackground\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>\n </subviews>\n <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n <constraints>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"1gX-mQ-vu6\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"6tX-OG-Sck\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"ABX-8g-7v4\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"jkI-2V-eW5\"/>\n </constraints>\n <viewLayoutGuide key=\"safeArea\" id=\"Rmq-lb-GrQ\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"EXPO-PLACEHOLDER-1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"140.625\" y=\"129.4921875\"/>\n </scene>\n </scenes>\n <resources>\n <image name=\"SplashScreenBackground\" width=\"1\" height=\"1\"/>\n </resources>\n </document>`;\n return await new Parser().parseStringPromise(contents);\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n"],"file":"InterfaceBuilder.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/InterfaceBuilder.ts"],"names":["createConstraint","firstItem","firstAttribute","secondItem","secondAttribute","$","id","createConstraintId","attributes","crypto","createHash","update","join","digest","applyImageToSplashScreenXML","xml","imageName","contentMode","imageId","containerId","width","height","imageView","userLabel","image","horizontalHuggingPriority","verticalHuggingPriority","clipsSubviews","userInteractionEnabled","translatesAutoresizingMaskIntoConstraints","rect","key","x","y","document","scenes","scene","objects","viewController","view","subviews","push","constraints","constraint","resources","name","createTemplateSplashScreenAsync","contents","Parser","parseStringPromise","toString","builder","Builder","preserveChildrenOrder","xmldec","version","encoding","renderOpts","pretty","indent","buildObject"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAmKA,SAASA,gBAAT,CACE,CAACC,SAAD,EAAYC,cAAZ,CADF,EAEE,CAACC,UAAD,EAAaC,eAAb,CAFF,EAGgB;AACd,SAAO;AACLC,IAAAA,CAAC,EAAE;AACDJ,MAAAA,SADC;AAEDC,MAAAA,cAFC;AAGDC,MAAAA,UAHC;AAIDC,MAAAA,eAJC;AAKD;AACAE,MAAAA,EAAE,EAAEC,kBAAkB,CAACN,SAAD,EAAYC,cAAZ,EAA4BC,UAA5B,EAAwCC,eAAxC;AANrB;AADE,GAAP;AAUD;;AAED,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAzEE;AA0EA,SAAO,MAAM,KAAIC,gBAAJ,IAAaC,kBAAb,CAAgCF,QAAhC,CAAb;AACD,C,CAED;;;AACO,SAASG,QAAT,CAAkBnC,GAAlB,EAAoC;AACzC,QAAMoC,OAAO,GAAG,KAAIC,iBAAJ,EAAY;AAC1BC,IAAAA,qBAAqB,EAAE,IADG;AAE1BC,IAAAA,MAAM,EAAE;AACNC,MAAAA,OAAO,EAAE,KADH;AAENC,MAAAA,QAAQ,EAAE;AAFJ,KAFkB;AAM1BC,IAAAA,UAAU,EAAE;AACVC,MAAAA,MAAM,EAAE,IADE;AAEVC,MAAAA,MAAM,EAAE;AAFE;AANc,GAAZ,CAAhB;AAWA,SAAOR,OAAO,CAACS,WAAR,CAAoB7C,GAApB,CAAP;AACD","sourcesContent":["import crypto from 'crypto';\nimport { Builder, Parser } from 'xml2js';\n\nexport type IBBoolean = 'YES' | 'NO' | boolean;\n\nexport type IBItem<\n H extends Record<string, any>,\n B extends Record<string, any[]> = { [key: string]: any }\n> = {\n $: H;\n} & B;\n\nexport type Rect = {\n key: string;\n x: number;\n y: number;\n width: number;\n height: number;\n};\n\nexport type IBRect = IBItem<Rect>;\n\nexport type ImageContentMode = 'scaleAspectFit' | 'scaleAspectFill';\n\nexport type ConstraintAttribute = 'top' | 'bottom' | 'trailing' | 'leading';\n\nexport type IBImageView = IBItem<\n {\n id: string;\n userLabel: string;\n image: string;\n clipsSubviews?: IBBoolean;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleAspectFill';\n horizontalHuggingPriority: number;\n verticalHuggingPriority: number;\n insetsLayoutMarginsFromSafeArea?: IBBoolean;\n translatesAutoresizingMaskIntoConstraints?: IBBoolean;\n },\n {\n rect: IBRect[];\n }\n>;\n\nexport type IBConstraint = IBItem<{\n firstItem: string;\n firstAttribute: ConstraintAttribute;\n secondItem: string;\n secondAttribute: ConstraintAttribute;\n id: string;\n}>;\n\nexport type IBViewController = IBItem<\n {\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n },\n {\n view: IBItem<\n {\n id: string;\n key: string;\n userInteractionEnabled: IBBoolean;\n contentMode: string | 'scaleToFill';\n insetsLayoutMarginsFromSafeArea: IBBoolean;\n userLabel: string;\n },\n {\n rect: IBRect[];\n autoresizingMask: IBItem<{\n key: string;\n flexibleMaxX: IBBoolean;\n flexibleMaxY: IBBoolean;\n }>[];\n\n subviews: IBItem<\n object,\n {\n imageView: IBImageView[];\n }\n >[];\n color: IBItem<{\n key: string | 'backgroundColor';\n systemColor: string | 'systemBackgroundColor';\n }>[];\n constraints: IBItem<\n object,\n {\n constraint: IBConstraint[];\n }\n >[];\n viewLayoutGuide: IBItem<{\n id: string;\n key: string | 'safeArea';\n }>[];\n }\n >[];\n }\n>;\n\nexport type IBPoint = IBItem<{\n key: string | 'canvasLocation';\n x: number;\n y: number;\n}>;\n\nexport type IBScene = IBItem<\n { sceneID: string },\n {\n objects: {\n viewController: IBViewController[];\n placeholder: IBItem<{\n id: string;\n placeholderIdentifier?: string;\n userLabel: string;\n sceneMemberID: string;\n }>[];\n }[];\n point: IBPoint[];\n }\n>;\n\ntype IBResourceImage = IBItem<{\n name: string;\n width: number;\n height: number;\n}>;\n\ntype IBDevice = IBItem<{\n id: string;\n orientation: string | 'portrait';\n appearance: string | 'light';\n}>;\n\nexport type IBSplashScreenDocument = {\n document: IBItem<\n {\n type: 'com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB' | string;\n version: '3.0' | string;\n toolsVersion: number;\n targetRuntime: 'iOS.CocoaTouch' | string;\n propertyAccessControl: 'none' | string;\n useAutolayout: IBBoolean;\n launchScreen: IBBoolean;\n useTraitCollections: IBBoolean;\n useSafeAreas: IBBoolean;\n colorMatched: IBBoolean;\n initialViewController: string;\n },\n {\n device: IBDevice[];\n dependencies: unknown[];\n scenes: {\n scene: IBScene[];\n }[];\n resources: {\n image: IBResourceImage[];\n }[];\n }\n >;\n};\n\nfunction createConstraint(\n [firstItem, firstAttribute]: [string, ConstraintAttribute],\n [secondItem, secondAttribute]: [string, ConstraintAttribute]\n): IBConstraint {\n return {\n $: {\n firstItem,\n firstAttribute,\n secondItem,\n secondAttribute,\n // Prevent updating between runs\n id: createConstraintId(firstItem, firstAttribute, secondItem, secondAttribute),\n },\n };\n}\n\nfunction createConstraintId(...attributes: string[]) {\n return crypto.createHash('sha1').update(attributes.join('-')).digest('hex');\n}\n\nexport function applyImageToSplashScreenXML(\n xml: IBSplashScreenDocument,\n {\n imageName,\n contentMode,\n }: {\n imageName: string;\n contentMode: ImageContentMode;\n }\n): IBSplashScreenDocument {\n const imageId = 'EXPO-SplashScreen';\n const containerId = 'EXPO-ContainerView';\n const width = 414;\n const height = 736;\n\n const imageView: IBImageView = {\n $: {\n id: imageId,\n userLabel: imageName,\n image: imageName,\n contentMode,\n horizontalHuggingPriority: 251,\n verticalHuggingPriority: 251,\n clipsSubviews: true,\n userInteractionEnabled: false,\n translatesAutoresizingMaskIntoConstraints: false,\n },\n rect: [\n {\n $: {\n key: 'frame',\n x: 0.0,\n y: 0.0,\n width,\n height,\n },\n },\n ],\n };\n\n // Add ImageView\n xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0].subviews[0].imageView.push(\n imageView\n );\n\n // Add Constraints\n xml.document.scenes[0].scene[0].objects[0].viewController[0].view[0].constraints[0].constraint.push(\n // <constraint firstItem=\"EXPO-SplashScreen\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"2VS-Uz-0LU\"/>\n createConstraint([imageId, 'top'], [containerId, 'top']),\n createConstraint([imageId, 'leading'], [containerId, 'leading']),\n createConstraint([imageId, 'trailing'], [containerId, 'trailing']),\n createConstraint([imageId, 'bottom'], [containerId, 'bottom'])\n );\n\n // Add resource\n xml.document.resources[0].image.push({\n // <image name=\"SplashScreen\" width=\"414\" height=\"736\"/>\n $: {\n name: imageName,\n width,\n height,\n },\n });\n\n return xml;\n}\n\nexport async function createTemplateSplashScreenAsync(): Promise<IBSplashScreenDocument> {\n const contents = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <document\n type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\"\n version=\"3.0\"\n toolsVersion=\"16096\"\n targetRuntime=\"iOS.CocoaTouch\"\n propertyAccessControl=\"none\"\n useAutolayout=\"YES\"\n launchScreen=\"YES\"\n useTraitCollections=\"YES\"\n useSafeAreas=\"YES\"\n colorMatched=\"YES\"\n initialViewController=\"EXPO-VIEWCONTROLLER-1\"\n >\n <device id=\"retina5_5\" orientation=\"portrait\" appearance=\"light\"/>\n <dependencies>\n <deployment identifier=\"iOS\"/>\n <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"16087\"/>\n <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n </dependencies>\n <scenes>\n <!--View Controller-->\n <scene sceneID=\"EXPO-SCENE-1\">\n <objects>\n <viewController\n storyboardIdentifier=\"SplashScreenViewController\"\n id=\"EXPO-VIEWCONTROLLER-1\"\n sceneMemberID=\"viewController\"\n >\n <view\n key=\"view\"\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleToFill\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n id=\"EXPO-ContainerView\"\n userLabel=\"ContainerView\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n <subviews>\n <imageView\n userInteractionEnabled=\"NO\"\n contentMode=\"scaleAspectFill\"\n horizontalHuggingPriority=\"251\"\n verticalHuggingPriority=\"251\"\n insetsLayoutMarginsFromSafeArea=\"NO\"\n image=\"SplashScreenBackground\"\n translatesAutoresizingMaskIntoConstraints=\"NO\"\n id=\"EXPO-SplashScreenBackground\"\n userLabel=\"SplashScreenBackground\"\n >\n <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"414\" height=\"736\"/>\n </imageView>\n </subviews>\n <color key=\"backgroundColor\" systemColor=\"systemBackgroundColor\"/>\n <constraints>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"top\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"top\" id=\"1gX-mQ-vu6\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"leading\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"leading\" id=\"6tX-OG-Sck\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"trailing\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"trailing\" id=\"ABX-8g-7v4\"/>\n <constraint firstItem=\"EXPO-SplashScreenBackground\" firstAttribute=\"bottom\" secondItem=\"EXPO-ContainerView\" secondAttribute=\"bottom\" id=\"jkI-2V-eW5\"/>\n </constraints>\n <viewLayoutGuide key=\"safeArea\" id=\"Rmq-lb-GrQ\"/>\n </view>\n </viewController>\n <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"EXPO-PLACEHOLDER-1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n </objects>\n <point key=\"canvasLocation\" x=\"140.625\" y=\"129.4921875\"/>\n </scene>\n </scenes>\n <resources>\n <image name=\"SplashScreenBackground\" width=\"1\" height=\"1\"/>\n </resources>\n </document>`;\n return await new Parser().parseStringPromise(contents);\n}\n\n// Attempt to copy Xcode formatting.\nexport function toString(xml: any): string {\n const builder = new Builder({\n preserveChildrenOrder: true,\n xmldec: {\n version: '1.0',\n encoding: 'UTF-8',\n },\n renderOpts: {\n pretty: true,\n indent: ' ',\n },\n });\n return builder.buildObject(xml);\n}\n"],"file":"InterfaceBuilder.js"}
|
|
@@ -17,6 +17,16 @@ function _configPlugins() {
|
|
|
17
17
|
return data;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
function _imageUtils() {
|
|
21
|
+
const data = require("@expo/image-utils");
|
|
22
|
+
|
|
23
|
+
_imageUtils = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
function _fsExtra() {
|
|
21
31
|
const data = _interopRequireDefault(require("fs-extra"));
|
|
22
32
|
|
|
@@ -49,6 +59,7 @@ function _getAndroidSplashConfig() {
|
|
|
49
59
|
|
|
50
60
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
61
|
|
|
62
|
+
const IMAGE_CACHE_NAME = 'splash-android';
|
|
52
63
|
const SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';
|
|
53
64
|
const DRAWABLES_CONFIGS = {
|
|
54
65
|
default: {
|
|
@@ -169,27 +180,29 @@ async function setSplashImageDrawablesForThemeAsync(config, theme, projectRoot)
|
|
|
169
180
|
const image = config[imageKey];
|
|
170
181
|
|
|
171
182
|
if (image) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
// Using this method will cache the images in `.expo` based on the properties used to generate them.
|
|
184
|
+
// this method also supports remote URLs and using the global sharp instance.
|
|
185
|
+
const {
|
|
186
|
+
source
|
|
187
|
+
} = await (0, _imageUtils().generateImageAsync)({
|
|
188
|
+
projectRoot,
|
|
189
|
+
cacheType: IMAGE_CACHE_NAME
|
|
190
|
+
}, {
|
|
191
|
+
src: image
|
|
192
|
+
}); // Get output path for drawable.
|
|
175
193
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* @param srcPath Absolute path
|
|
181
|
-
* @param dstPath Absolute path
|
|
182
|
-
*/
|
|
194
|
+
const outputPath = _path().default.join(androidMainPath, // @ts-ignore
|
|
195
|
+
DRAWABLES_CONFIGS[imageKey].modes[theme].path); // Ensure directory exists.
|
|
183
196
|
|
|
184
197
|
|
|
185
|
-
|
|
186
|
-
if (!srcPath) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
198
|
+
const folder = _path().default.dirname(outputPath);
|
|
189
199
|
|
|
190
|
-
|
|
200
|
+
await _fsExtra().default.ensureDir(folder); // Write image buffer to the file system.
|
|
191
201
|
|
|
192
|
-
|
|
193
|
-
|
|
202
|
+
await _fsExtra().default.writeFile(outputPath, source);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return null;
|
|
206
|
+
}));
|
|
194
207
|
}
|
|
195
208
|
//# sourceMappingURL=withAndroidSplashImages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"names":["SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","default","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","setSplashImageDrawablesAsync","modRequest","projectRoot","clearAllExistingSplashImagesAsync","splash","darkSplash","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.ts"],"names":["IMAGE_CACHE_NAME","SPLASH_SCREEN_FILENAME","DRAWABLES_CONFIGS","default","modes","light","path","dark","dimensionsMultiplier","mdpi","hdpi","xhdpi","xxhdpi","xxxhdpi","withAndroidSplashImages","config","setSplashImageDrawablesAsync","modRequest","projectRoot","clearAllExistingSplashImagesAsync","splash","darkSplash","Promise","all","setSplashImageDrawablesForThemeAsync","androidMainPath","join","Object","values","map","filePath","fs","pathExists","resolve","remove","theme","imageKey","image","source","cacheType","src","outputPath","folder","dirname","ensureDir","writeFile"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;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;AAA1B,OAAnB,EAAiE;AACxFwC,QAAAA,GAAG,EAAEH;AADmF,OAAjE,CAAzB,CAHS,CAOT;;AACA,YAAMI,UAAU,GAAGnC,gBAAKoB,IAAL,CACjBD,eADiB,EAEjB;AACAvB,MAAAA,iBAAiB,CAACkC,QAAD,CAAjB,CAA4BhC,KAA5B,CAAkC+B,KAAlC,EAAyC7B,IAHxB,CAAnB,CARS,CAaT;;;AACA,YAAMoC,MAAM,GAAGpC,gBAAKqC,OAAL,CAAaF,UAAb,CAAf;;AACA,YAAMV,mBAAGa,SAAH,CAAaF,MAAb,CAAN,CAfS,CAgBT;;AACA,YAAMX,mBAAGc,SAAH,CAAaJ,UAAb,EAAyBH,MAAzB,CAAN;AACD;;AACD,WAAO,IAAP;AACD,GAvBD,CADI,CAAN;AA0BD","sourcesContent":["import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport { generateImageAsync } from '@expo/image-utils';\nimport fs from 'fs-extra';\nimport path from 'path';\n\nimport {\n getAndroidDarkSplashConfig,\n getAndroidSplashConfig,\n SplashScreenConfig,\n} from './getAndroidSplashConfig';\n\ntype DRAWABLE_SIZE = 'default' | 'mdpi' | 'hdpi' | 'xhdpi' | 'xxhdpi' | 'xxxhdpi';\ntype THEME = 'light' | 'dark';\n\nconst IMAGE_CACHE_NAME = 'splash-android';\nconst SPLASH_SCREEN_FILENAME = 'splashscreen_image.png';\nconst DRAWABLES_CONFIGS: {\n [key in DRAWABLE_SIZE]: {\n modes: {\n [key in THEME]: {\n path: string;\n };\n };\n dimensionsMultiplier: number;\n };\n} = {\n default: {\n modes: {\n light: {\n path: `./res/drawable/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n mdpi: {\n modes: {\n light: {\n path: `./res/drawable-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-mdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1,\n },\n hdpi: {\n modes: {\n light: {\n path: `./res/drawable-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-hdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 1.5,\n },\n xhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 2,\n },\n xxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 3,\n },\n xxxhdpi: {\n modes: {\n light: {\n path: `./res/drawable-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n dark: {\n path: `./res/drawable-night-xxxhdpi/${SPLASH_SCREEN_FILENAME}`,\n },\n },\n dimensionsMultiplier: 4,\n },\n};\n\nexport const withAndroidSplashImages: ConfigPlugin = config => {\n return withDangerousMod(config, [\n 'android',\n async config => {\n await setSplashImageDrawablesAsync(config, config.modRequest.projectRoot);\n return config;\n },\n ]);\n};\n\n/**\n * Deletes all previous splash_screen_images and copies new one to desired drawable directory.\n * If path isn't provided then no new image is placed in drawable directories.\n * @see https://developer.android.com/training/multiscreen/screendensities\n *\n * @param androidMainPath Absolute path to the main directory containing code and resources in Android project. In general that would be `android/app/src/main`.\n */\nexport async function setSplashImageDrawablesAsync(\n config: Pick<ExpoConfig, 'android' | 'splash'>,\n projectRoot: string\n) {\n await clearAllExistingSplashImagesAsync(projectRoot);\n\n const splash = getAndroidSplashConfig(config);\n const darkSplash = getAndroidDarkSplashConfig(config);\n\n await Promise.all([\n setSplashImageDrawablesForThemeAsync(splash, 'light', projectRoot),\n setSplashImageDrawablesForThemeAsync(darkSplash, 'dark', projectRoot),\n ]);\n}\n\nasync function clearAllExistingSplashImagesAsync(projectRoot: string) {\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n Object.values(DRAWABLES_CONFIGS).map(async ({ modes }) => {\n await Promise.all(\n Object.values(modes).map(async ({ path: filePath }) => {\n if (await fs.pathExists(path.resolve(androidMainPath, filePath))) {\n await fs.remove(path.resolve(androidMainPath, filePath));\n }\n })\n );\n })\n );\n}\n\nexport async function setSplashImageDrawablesForThemeAsync(\n config: SplashScreenConfig | null,\n theme: 'dark' | 'light',\n projectRoot: string\n) {\n if (!config) return;\n const androidMainPath = path.join(projectRoot, 'android/app/src/main');\n\n await Promise.all(\n ['mdpi', 'hdpi', 'xhdpi', 'xxhdpi', 'xxxhdpi'].map(async imageKey => {\n // @ts-ignore\n const image = config[imageKey];\n if (image) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: image,\n } as any);\n\n // Get output path for drawable.\n const outputPath = path.join(\n androidMainPath,\n // @ts-ignore\n DRAWABLES_CONFIGS[imageKey].modes[theme].path\n );\n // Ensure directory exists.\n const folder = path.dirname(outputPath);\n await fs.ensureDir(folder);\n // Write image buffer to the file system.\n await fs.writeFile(outputPath, source);\n }\n return null;\n })\n );\n}\n"],"file":"withAndroidSplashImages.js"}
|
|
@@ -16,6 +16,16 @@ function _configPlugins() {
|
|
|
16
16
|
return data;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
function _imageUtils() {
|
|
20
|
+
const data = require("@expo/image-utils");
|
|
21
|
+
|
|
22
|
+
_imageUtils = function () {
|
|
23
|
+
return data;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
|
|
19
29
|
function _debug() {
|
|
20
30
|
const data = _interopRequireDefault(require("debug"));
|
|
21
31
|
|
|
@@ -74,6 +84,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
74
84
|
|
|
75
85
|
// @ts-ignore
|
|
76
86
|
const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:assets');
|
|
87
|
+
const IMAGE_CACHE_NAME = 'splash-ios';
|
|
77
88
|
const IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';
|
|
78
89
|
const BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';
|
|
79
90
|
const PNG_FILENAME = 'image.png';
|
|
@@ -89,14 +100,15 @@ const withIosSplashAssets = (config, splash) => {
|
|
|
89
100
|
return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
|
|
90
101
|
var _splash$dark, _splash$dark2;
|
|
91
102
|
|
|
92
|
-
const
|
|
103
|
+
const iosNamedProjectRoot = _configPlugins().IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);
|
|
93
104
|
|
|
94
105
|
await createSplashScreenBackgroundImageAsync({
|
|
95
|
-
iosNamedProjectRoot
|
|
106
|
+
iosNamedProjectRoot,
|
|
96
107
|
splash
|
|
97
108
|
});
|
|
98
109
|
await configureImageAssets({
|
|
99
|
-
|
|
110
|
+
projectRoot: config.modRequest.projectRoot,
|
|
111
|
+
iosNamedProjectRoot,
|
|
100
112
|
image: splash.image,
|
|
101
113
|
darkImage: (_splash$dark = splash.dark) === null || _splash$dark === void 0 ? void 0 : _splash$dark.image,
|
|
102
114
|
tabletImage: splash.tabletImage,
|
|
@@ -113,13 +125,14 @@ const withIosSplashAssets = (config, splash) => {
|
|
|
113
125
|
exports.withIosSplashAssets = withIosSplashAssets;
|
|
114
126
|
|
|
115
127
|
async function configureImageAssets({
|
|
116
|
-
|
|
128
|
+
projectRoot,
|
|
129
|
+
iosNamedProjectRoot,
|
|
117
130
|
image,
|
|
118
131
|
darkImage,
|
|
119
132
|
tabletImage,
|
|
120
133
|
darkTabletImage
|
|
121
134
|
}) {
|
|
122
|
-
const imageSetPath = path().resolve(
|
|
135
|
+
const imageSetPath = path().resolve(iosNamedProjectRoot, IMAGESET_PATH); // ensure old SplashScreen imageSet is removed
|
|
123
136
|
|
|
124
137
|
await _fsExtra().default.remove(imageSetPath);
|
|
125
138
|
|
|
@@ -135,7 +148,8 @@ async function configureImageAssets({
|
|
|
135
148
|
darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null
|
|
136
149
|
});
|
|
137
150
|
await copyImageFiles({
|
|
138
|
-
|
|
151
|
+
projectRoot,
|
|
152
|
+
iosNamedProjectRoot,
|
|
139
153
|
image,
|
|
140
154
|
darkImage,
|
|
141
155
|
tabletImage,
|
|
@@ -149,7 +163,7 @@ async function createPngFileAsync(color, filePath) {
|
|
|
149
163
|
}
|
|
150
164
|
|
|
151
165
|
async function createBackgroundImagesAsync({
|
|
152
|
-
|
|
166
|
+
iosNamedProjectRoot,
|
|
153
167
|
color,
|
|
154
168
|
darkColor,
|
|
155
169
|
tabletColor,
|
|
@@ -157,7 +171,7 @@ async function createBackgroundImagesAsync({
|
|
|
157
171
|
}) {
|
|
158
172
|
await generateImagesAssetsAsync({
|
|
159
173
|
async generateImageAsset(item, fileName) {
|
|
160
|
-
await createPngFileAsync(item, path().resolve(
|
|
174
|
+
await createPngFileAsync(item, path().resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName));
|
|
161
175
|
},
|
|
162
176
|
|
|
163
177
|
anyItem: color,
|
|
@@ -168,7 +182,8 @@ async function createBackgroundImagesAsync({
|
|
|
168
182
|
}
|
|
169
183
|
|
|
170
184
|
async function copyImageFiles({
|
|
171
|
-
|
|
185
|
+
projectRoot,
|
|
186
|
+
iosNamedProjectRoot,
|
|
172
187
|
image,
|
|
173
188
|
darkImage,
|
|
174
189
|
tabletImage,
|
|
@@ -176,7 +191,19 @@ async function copyImageFiles({
|
|
|
176
191
|
}) {
|
|
177
192
|
await generateImagesAssetsAsync({
|
|
178
193
|
async generateImageAsset(item, fileName) {
|
|
179
|
-
|
|
194
|
+
// Using this method will cache the images in `.expo` based on the properties used to generate them.
|
|
195
|
+
// this method also supports remote URLs and using the global sharp instance.
|
|
196
|
+
const {
|
|
197
|
+
source
|
|
198
|
+
} = await (0, _imageUtils().generateImageAsync)({
|
|
199
|
+
projectRoot,
|
|
200
|
+
cacheType: IMAGE_CACHE_NAME
|
|
201
|
+
}, {
|
|
202
|
+
src: item
|
|
203
|
+
}); // Write image buffer to the file system.
|
|
204
|
+
// const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);
|
|
205
|
+
|
|
206
|
+
await _fsExtra().default.writeFile(path().resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);
|
|
180
207
|
},
|
|
181
208
|
|
|
182
209
|
anyItem: image,
|
|
@@ -212,7 +239,7 @@ async function createSplashScreenBackgroundImageAsync({
|
|
|
212
239
|
await _fsExtra().default.remove(imagesetPath);
|
|
213
240
|
await _fsExtra().default.ensureDir(imagesetPath);
|
|
214
241
|
await createBackgroundImagesAsync({
|
|
215
|
-
|
|
242
|
+
iosNamedProjectRoot,
|
|
216
243
|
color,
|
|
217
244
|
darkColor: darkColor ? darkColor : null,
|
|
218
245
|
tabletColor: tabletColor ? tabletColor : null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"names":["debug","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","projectPath","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","iosNamedProjectRoot","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","copyFile","items","filter","Promise","all","map","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","idiom","filename","scale","appearances","undefined","Boolean","images"],"mappings":";;;;;;;;AAAA;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;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AAJA;AAYA,MAAMA,KAAK,GAAG,sBAAM,oDAAN,CAAd;AAEA,MAAMC,aAAa,GAAG,uCAAtB;AACA,MAAMC,wBAAwB,GAAG,iDAAjC;AACA,MAAMC,YAAY,GAAG,WAArB;AACA,MAAMC,iBAAiB,GAAG,gBAA1B;AACA,MAAMC,mBAAmB,GAAG,kBAA5B;AACA,MAAMC,wBAAwB,GAAG,uBAAjC;;AAEO,MAAMC,mBAAkD,GAAG,CAACC,MAAD,EAASC,MAAT,KAAoB;AACpF,MAAI,CAACA,MAAL,EAAa;AACX,WAAOD,MAAP;AACD;;AACD,SAAO,uCAAiBA,MAAjB,EAAyB,CAC9B,KAD8B,EAE9B,MAAMA,MAAN,IAAgB;AAAA;;AACd,UAAME,WAAW,GAAGC,2BAAUC,KAAV,CAAgBC,aAAhB,CAA8BL,MAAM,CAACM,UAAP,CAAkBC,WAAhD,CAApB;;AAEA,UAAMC,sCAAsC,CAAC;AAC3CC,MAAAA,mBAAmB,EAAEP,WADsB;AAE3CD,MAAAA;AAF2C,KAAD,CAA5C;AAKA,UAAMS,oBAAoB,CAAC;AACzBR,MAAAA,WADyB;AAE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B;AAAiCC,IAAAA;AAAjC,GAAD,CAAtC;AAEAvB,EAAAA,KAAK,CAAE,uBAAF,EAA0B8B,SAA1B,CAAL;AACA9B,EAAAA,KAAK,CAAE,aAAF,EAAgBuE,MAAhB,CAAL;AACA,QAAM,6CAAuBzC,SAAvB,EAAkC;AAAEyC,IAAAA;AAAF,GAAlC,CAAN;AACD","sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async config => {\n const projectPath = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot: projectPath,\n splash,\n });\n\n await configureImageAssets({\n projectPath,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectPath: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(projectPath, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({ projectPath, image, darkImage, tabletImage, darkTabletImage });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n projectPath,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n projectPath: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(item, path.resolve(projectPath, BACKGROUND_IMAGESET_PATH, fileName));\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectPath: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await fs.copyFile(item, path.resolve(projectPath, IMAGESET_PATH, fileName));\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = ([\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown) as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n projectPath: iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}\n"],"file":"withIosSplashAssets.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"names":["debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","cacheType","src","writeFile","items","filter","Promise","all","map","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","idiom","filename","scale","appearances","undefined","Boolean","images"],"mappings":";;;;;;;;AAAA;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;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;;;AAJA;AAYA,MAAMA,KAAK,GAAG,sBAAM,oDAAN,CAAd;AAEA,MAAMC,gBAAgB,GAAG,YAAzB;AACA,MAAMC,aAAa,GAAG,uCAAtB;AACA,MAAMC,wBAAwB,GAAG,iDAAjC;AACA,MAAMC,YAAY,GAAG,WAArB;AACA,MAAMC,iBAAiB,GAAG,gBAA1B;AACA,MAAMC,mBAAmB,GAAG,kBAA5B;AACA,MAAMC,wBAAwB,GAAG,uBAAjC;;AAEO,MAAMC,mBAAkD,GAAG,CAACC,MAAD,EAASC,MAAT,KAAoB;AACpF,MAAI,CAACA,MAAL,EAAa;AACX,WAAOD,MAAP;AACD;;AACD,SAAO,uCAAiBA,MAAjB,EAAyB,CAC9B,KAD8B,EAE9B,MAAMA,MAAN,IAAgB;AAAA;;AACd,UAAME,mBAAm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IAAAA,QAAQ,EAAE9C,eAAF,aAAEA,eAAF,cAAEA,eAAF,GAAqBiD,SAHR;AAIrBF,IAAAA,KAAK,EAAE;AAJc,GAAvB,CAjDG,EAuDL/C,eAAe,IACb,6CAAuB;AACrB6C,IAAAA,KAAK,EAAE,MADc;AAErBG,IAAAA,WAAW,EAAEP,eAFQ;AAGrBM,IAAAA,KAAK,EAAE;AAHc,GAAvB,CAxDG,EA6DLf,MA7DK,CA6DEkB,OA7DF,CAAP;AA8DD;;AAED,eAAe5C,0BAAf,CAA0C;AACxCC,EAAAA,SADwC;AAExCX,EAAAA,KAFwC;AAGxCC,EAAAA,SAHwC;AAIxCE,EAAAA,WAJwC;AAKxCC,EAAAA;AALwC,CAA1C,EAYG;AACD,QAAMmD,MAAM,GAAGP,uBAAuB,CAAC;AAAEhD,IAAAA,KAAF;AAASC,IAAAA,SAAT;AAAoBE,IAAAA,WAApB;AAAiCC,IAAAA;AAAjC,GAAD,CAAtC;AAEAvB,EAAAA,KAAK,CAAE,uBAAF,EAA0B8B,SAA1B,CAAL;AACA9B,EAAAA,KAAK,CAAE,aAAF,EAAgB0E,MAAhB,CAAL;AACA,QAAM,6CAAuB5C,SAAvB,EAAkC;AAAE4C,IAAAA;AAAF,GAAlC,CAAN;AACD","sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async config => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = ([\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown) as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}\n"],"file":"withIosSplashAssets.js"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
function _createLegacyPlugin() {
|
|
9
|
+
const data = require("../createLegacyPlugin");
|
|
10
|
+
|
|
11
|
+
_createLegacyPlugin = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function _withAndroidRootViewBackgroundColor() {
|
|
19
|
+
const data = require("./withAndroidRootViewBackgroundColor");
|
|
20
|
+
|
|
21
|
+
_withAndroidRootViewBackgroundColor = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function _withAndroidUserInterfaceStyle() {
|
|
29
|
+
const data = require("./withAndroidUserInterfaceStyle");
|
|
30
|
+
|
|
31
|
+
_withAndroidUserInterfaceStyle = function () {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function _withIosRootViewBackgroundColor() {
|
|
39
|
+
const data = require("./withIosRootViewBackgroundColor");
|
|
40
|
+
|
|
41
|
+
_withIosRootViewBackgroundColor = function () {
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return data;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function _withIosUserInterfaceStyle() {
|
|
49
|
+
const data = require("./withIosUserInterfaceStyle");
|
|
50
|
+
|
|
51
|
+
_withIosUserInterfaceStyle = function () {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var _default = (0, _createLegacyPlugin().createLegacyPlugin)({
|
|
59
|
+
packageName: 'expo-system-ui',
|
|
60
|
+
fallback: [_withAndroidRootViewBackgroundColor().withAndroidRootViewBackgroundColor, _withIosRootViewBackgroundColor().withIosRootViewBackgroundColor, _withAndroidUserInterfaceStyle().withAndroidUserInterfaceStyle, _withIosUserInterfaceStyle().withIosUserInterfaceStyle]
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
exports.default = _default;
|
|
64
|
+
//# sourceMappingURL=expo-system-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-system-ui/expo-system-ui.ts"],"names":["packageName","fallback","withAndroidRootViewBackgroundColor","withIosRootViewBackgroundColor","withAndroidUserInterfaceStyle","withIosUserInterfaceStyle"],"mappings":";;;;;;;AAAA;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;;eAEe,8CAAmB;AAChCA,EAAAA,WAAW,EAAE,gBADmB;AAEhCC,EAAAA,QAAQ,EAAE,CACRC,wEADQ,EAERC,gEAFQ,EAGRC,8DAHQ,EAIRC,sDAJQ;AAFsB,CAAnB,C","sourcesContent":["import { createLegacyPlugin } from '../createLegacyPlugin';\nimport { withAndroidRootViewBackgroundColor } from './withAndroidRootViewBackgroundColor';\nimport { withAndroidUserInterfaceStyle } from './withAndroidUserInterfaceStyle';\nimport { withIosRootViewBackgroundColor } from './withIosRootViewBackgroundColor';\nimport { withIosUserInterfaceStyle } from './withIosUserInterfaceStyle';\n\nexport default createLegacyPlugin({\n packageName: 'expo-system-ui',\n fallback: [\n withAndroidRootViewBackgroundColor,\n withIosRootViewBackgroundColor,\n withAndroidUserInterfaceStyle,\n withIosUserInterfaceStyle,\n ],\n});\n"],"file":"expo-system-ui.js"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
+
export declare const withAndroidRootViewBackgroundColor: ConfigPlugin;
|
|
4
|
+
export declare const withRootViewBackgroundColorColors: ConfigPlugin;
|
|
5
|
+
export declare const withRootViewBackgroundColorStyles: ConfigPlugin;
|
|
6
|
+
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'android' | 'backgroundColor'>): string | null;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
7
|
+
exports.withRootViewBackgroundColorStyles = exports.withRootViewBackgroundColorColors = exports.withAndroidRootViewBackgroundColor = 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
|
+
const {
|
|
20
|
+
assignColorValue
|
|
21
|
+
} = _configPlugins().AndroidConfig.Colors;
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
assignStylesValue,
|
|
25
|
+
getAppThemeLightNoActionBarGroup
|
|
26
|
+
} = _configPlugins().AndroidConfig.Styles;
|
|
27
|
+
|
|
28
|
+
const ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';
|
|
29
|
+
const WINDOW_BACKGROUND_COLOR = 'activityBackground';
|
|
30
|
+
|
|
31
|
+
const withAndroidRootViewBackgroundColor = config => {
|
|
32
|
+
config = withRootViewBackgroundColorColors(config);
|
|
33
|
+
config = withRootViewBackgroundColorStyles(config);
|
|
34
|
+
return config;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
exports.withAndroidRootViewBackgroundColor = withAndroidRootViewBackgroundColor;
|
|
38
|
+
|
|
39
|
+
const withRootViewBackgroundColorColors = config => {
|
|
40
|
+
return (0, _configPlugins().withAndroidColors)(config, async config => {
|
|
41
|
+
config.modResults = assignColorValue(config.modResults, {
|
|
42
|
+
value: getRootViewBackgroundColor(config),
|
|
43
|
+
name: WINDOW_BACKGROUND_COLOR
|
|
44
|
+
});
|
|
45
|
+
return config;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
exports.withRootViewBackgroundColorColors = withRootViewBackgroundColorColors;
|
|
50
|
+
|
|
51
|
+
const withRootViewBackgroundColorStyles = config => {
|
|
52
|
+
return (0, _configPlugins().withAndroidStyles)(config, async config => {
|
|
53
|
+
config.modResults = assignStylesValue(config.modResults, {
|
|
54
|
+
add: !!getRootViewBackgroundColor(config),
|
|
55
|
+
parent: getAppThemeLightNoActionBarGroup(),
|
|
56
|
+
name: ANDROID_WINDOW_BACKGROUND,
|
|
57
|
+
value: `@color/${WINDOW_BACKGROUND_COLOR}`
|
|
58
|
+
});
|
|
59
|
+
return config;
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.withRootViewBackgroundColorStyles = withRootViewBackgroundColorStyles;
|
|
64
|
+
|
|
65
|
+
function getRootViewBackgroundColor(config) {
|
|
66
|
+
var _config$android;
|
|
67
|
+
|
|
68
|
+
return ((_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.backgroundColor) || config.backgroundColor || null;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=withAndroidRootViewBackgroundColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.ts"],"names":["assignColorValue","AndroidConfig","Colors","assignStylesValue","getAppThemeLightNoActionBarGroup","Styles","ANDROID_WINDOW_BACKGROUND","WINDOW_BACKGROUND_COLOR","withAndroidRootViewBackgroundColor","config","withRootViewBackgroundColorColors","withRootViewBackgroundColorStyles","modResults","value","getRootViewBackgroundColor","name","add","parent","android","backgroundColor"],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAQA,MAAM;AAAEA,EAAAA;AAAF,IAAuBC,+BAAcC,MAA3C;;AACA,MAAM;AAAEC,EAAAA,iBAAF;AAAqBC,EAAAA;AAArB,IAA0DH,+BAAcI,MAA9E;;AAEA,MAAMC,yBAAyB,GAAG,0BAAlC;AACA,MAAMC,uBAAuB,GAAG,oBAAhC;;AAEO,MAAMC,kCAAgD,GAAGC,MAAM,IAAI;AACxEA,EAAAA,MAAM,GAAGC,iCAAiC,CAACD,MAAD,CAA1C;AACAA,EAAAA,MAAM,GAAGE,iCAAiC,CAACF,MAAD,CAA1C;AACA,SAAOA,MAAP;AACD,CAJM;;;;AAMA,MAAMC,iCAA+C,GAAGD,MAAM,IAAI;AACvE,SAAO,wCAAkBA,MAAlB,EAA0B,MAAMA,MAAN,IAAgB;AAC/CA,IAAAA,MAAM,CAACG,UAAP,GAAoBZ,gBAAgB,CAACS,MAAM,CAACG,UAAR,EAAoB;AACtDC,MAAAA,KAAK,EAAEC,0BAA0B,CAACL,MAAD,CADqB;AAEtDM,MAAAA,IAAI,EAAER;AAFgD,KAApB,CAApC;AAIA,WAAOE,MAAP;AACD,GANM,CAAP;AAOD,CARM;;;;AAUA,MAAME,iCAA+C,GAAGF,MAAM,IAAI;AACvE,SAAO,wCAAkBA,MAAlB,EAA0B,MAAMA,MAAN,IAAgB;AAC/CA,IAAAA,MAAM,CAACG,UAAP,GAAoBT,iBAAiB,CAACM,MAAM,CAACG,UAAR,EAAoB;AACvDI,MAAAA,GAAG,EAAE,CAAC,CAACF,0BAA0B,CAACL,MAAD,CADsB;AAEvDQ,MAAAA,MAAM,EAAEb,gCAAgC,EAFe;AAGvDW,MAAAA,IAAI,EAAET,yBAHiD;AAIvDO,MAAAA,KAAK,EAAG,UAASN,uBAAwB;AAJc,KAApB,CAArC;AAMA,WAAOE,MAAP;AACD,GARM,CAAP;AASD,CAVM;;;;AAYA,SAASK,0BAAT,CACLL,MADK,EAEL;AAAA;;AACA,SAAO,oBAAAA,MAAM,CAACS,OAAP,oEAAgBC,eAAhB,KAAmCV,MAAM,CAACU,eAA1C,IAA6D,IAApE;AACD","sourcesContent":["import {\n AndroidConfig,\n ConfigPlugin,\n withAndroidColors,\n withAndroidStyles,\n} from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nconst { assignColorValue } = AndroidConfig.Colors;\nconst { assignStylesValue, getAppThemeLightNoActionBarGroup } = AndroidConfig.Styles;\n\nconst ANDROID_WINDOW_BACKGROUND = 'android:windowBackground';\nconst WINDOW_BACKGROUND_COLOR = 'activityBackground';\n\nexport const withAndroidRootViewBackgroundColor: ConfigPlugin = config => {\n config = withRootViewBackgroundColorColors(config);\n config = withRootViewBackgroundColorStyles(config);\n return config;\n};\n\nexport const withRootViewBackgroundColorColors: ConfigPlugin = config => {\n return withAndroidColors(config, async config => {\n config.modResults = assignColorValue(config.modResults, {\n value: getRootViewBackgroundColor(config),\n name: WINDOW_BACKGROUND_COLOR,\n });\n return config;\n });\n};\n\nexport const withRootViewBackgroundColorStyles: ConfigPlugin = config => {\n return withAndroidStyles(config, async config => {\n config.modResults = assignStylesValue(config.modResults, {\n add: !!getRootViewBackgroundColor(config),\n parent: getAppThemeLightNoActionBarGroup(),\n name: ANDROID_WINDOW_BACKGROUND,\n value: `@color/${WINDOW_BACKGROUND_COLOR}`,\n });\n return config;\n });\n};\n\nexport function getRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'android' | 'backgroundColor'>\n) {\n return config.android?.backgroundColor || config.backgroundColor || null;\n}\n"],"file":"withAndroidRootViewBackgroundColor.js"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withAndroidUserInterfaceStyle = void 0;
|
|
7
|
+
|
|
8
|
+
function _configPlugins() {
|
|
9
|
+
const data = require("@expo/config-plugins");
|
|
10
|
+
|
|
11
|
+
_configPlugins = function () {
|
|
12
|
+
return data;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const withAndroidUserInterfaceStyle = config => {
|
|
19
|
+
return (0, _configPlugins().withStringsXml)(config, config => {
|
|
20
|
+
var _config$android$userI, _config$android;
|
|
21
|
+
|
|
22
|
+
const userInterfaceStyle = (_config$android$userI = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.userInterfaceStyle) !== null && _config$android$userI !== void 0 ? _config$android$userI : config.userInterfaceStyle;
|
|
23
|
+
|
|
24
|
+
if (userInterfaceStyle) {
|
|
25
|
+
_configPlugins().WarningAggregator.addWarningAndroid('userInterfaceStyle', // TODO: Maybe warn that they need a certain version of React Native as well?
|
|
26
|
+
'Install expo-system-ui in your project to enable this feature.');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return config;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.withAndroidUserInterfaceStyle = withAndroidUserInterfaceStyle;
|
|
34
|
+
//# sourceMappingURL=withAndroidUserInterfaceStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.ts"],"names":["withAndroidUserInterfaceStyle","config","userInterfaceStyle","android","WarningAggregator","addWarningAndroid"],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEO,MAAMA,6BAAiD,GAAGC,MAAM,IAAI;AACzE,SAAO,qCAAeA,MAAf,EAAuBA,MAAM,IAAI;AAAA;;AACtC,UAAMC,kBAAkB,+CAAGD,MAAM,CAACE,OAAV,oDAAG,gBAAgBD,kBAAnB,yEAAyCD,MAAM,CAACC,kBAAxE;;AACA,QAAIA,kBAAJ,EAAwB;AACtBE,yCAAkBC,iBAAlB,CACE,oBADF,EAEE;AACA,sEAHF;AAKD;;AAED,WAAOJ,MAAP;AACD,GAXM,CAAP;AAYD,CAbM","sourcesContent":["import { ConfigPlugin, WarningAggregator, withStringsXml } from '@expo/config-plugins';\n\nexport const withAndroidUserInterfaceStyle: ConfigPlugin<void> = config => {\n return withStringsXml(config, config => {\n const userInterfaceStyle = config.android?.userInterfaceStyle ?? config.userInterfaceStyle;\n if (userInterfaceStyle) {\n WarningAggregator.addWarningAndroid(\n 'userInterfaceStyle',\n // TODO: Maybe warn that they need a certain version of React Native as well?\n 'Install expo-system-ui in your project to enable this feature.'\n );\n }\n\n return config;\n });\n};\n"],"file":"withAndroidUserInterfaceStyle.js"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigPlugin, InfoPlist } from '@expo/config-plugins';
|
|
2
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
+
export declare const withIosRootViewBackgroundColor: ConfigPlugin;
|
|
4
|
+
export declare function setRootViewBackgroundColor(config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>, infoPlist: InfoPlist): InfoPlist;
|
|
5
|
+
export declare function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>): string | null;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setRootViewBackgroundColor = setRootViewBackgroundColor;
|
|
7
|
+
exports.getRootViewBackgroundColor = getRootViewBackgroundColor;
|
|
8
|
+
exports.withIosRootViewBackgroundColor = void 0;
|
|
9
|
+
|
|
10
|
+
function _configPlugins() {
|
|
11
|
+
const data = require("@expo/config-plugins");
|
|
12
|
+
|
|
13
|
+
_configPlugins = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function _normalizeColor() {
|
|
21
|
+
const data = _interopRequireDefault(require("@react-native/normalize-color"));
|
|
22
|
+
|
|
23
|
+
_normalizeColor = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
32
|
+
// @ts-ignore: uses flow
|
|
33
|
+
// Maps to the template AppDelegate.m
|
|
34
|
+
const BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';
|
|
35
|
+
|
|
36
|
+
const debug = require('debug')('expo:system-ui:plugin:ios');
|
|
37
|
+
|
|
38
|
+
const withIosRootViewBackgroundColor = config => {
|
|
39
|
+
config = (0, _configPlugins().withInfoPlist)(config, config => {
|
|
40
|
+
config.modResults = setRootViewBackgroundColor(config, config.modResults);
|
|
41
|
+
return config;
|
|
42
|
+
});
|
|
43
|
+
return config;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.withIosRootViewBackgroundColor = withIosRootViewBackgroundColor;
|
|
47
|
+
|
|
48
|
+
function setRootViewBackgroundColor(config, infoPlist) {
|
|
49
|
+
const backgroundColor = getRootViewBackgroundColor(config);
|
|
50
|
+
|
|
51
|
+
if (!backgroundColor) {
|
|
52
|
+
delete infoPlist[BACKGROUND_COLOR_KEY];
|
|
53
|
+
} else {
|
|
54
|
+
let color = (0, _normalizeColor().default)(backgroundColor);
|
|
55
|
+
|
|
56
|
+
if (!color) {
|
|
57
|
+
throw new Error('Invalid background color on iOS');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
color = (color << 24 | color >>> 8) >>> 0;
|
|
61
|
+
infoPlist[BACKGROUND_COLOR_KEY] = color;
|
|
62
|
+
debug(`Convert color: ${backgroundColor} -> ${color}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return infoPlist;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getRootViewBackgroundColor(config) {
|
|
69
|
+
var _config$ios;
|
|
70
|
+
|
|
71
|
+
return ((_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.backgroundColor) || config.backgroundColor || null;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=withIosRootViewBackgroundColor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.ts"],"names":["BACKGROUND_COLOR_KEY","debug","require","withIosRootViewBackgroundColor","config","modResults","setRootViewBackgroundColor","infoPlist","backgroundColor","getRootViewBackgroundColor","color","Error","ios"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AADA;AAGA;AACA,MAAMA,oBAAoB,GAAG,4BAA7B;;AAEA,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAD,CAAP,CAAiB,2BAAjB,CAAd;;AAEO,MAAMC,8BAA4C,GAAGC,MAAM,IAAI;AACpEA,EAAAA,MAAM,GAAG,oCAAcA,MAAd,EAAsBA,MAAM,IAAI;AACvCA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,0BAA0B,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAA9C;AACA,WAAOD,MAAP;AACD,GAHQ,CAAT;AAIA,SAAOA,MAAP;AACD,CANM;;;;AAQA,SAASE,0BAAT,CACLF,MADK,EAELG,SAFK,EAGM;AACX,QAAMC,eAAe,GAAGC,0BAA0B,CAACL,MAAD,CAAlD;;AACA,MAAI,CAACI,eAAL,EAAsB;AACpB,WAAOD,SAAS,CAACP,oBAAD,CAAhB;AACD,GAFD,MAEO;AACL,QAAIU,KAAK,GAAG,+BAAeF,eAAf,CAAZ;;AACA,QAAI,CAACE,KAAL,EAAY;AACV,YAAM,IAAIC,KAAJ,CAAU,iCAAV,CAAN;AACD;;AACDD,IAAAA,KAAK,GAAG,CAAEA,KAAK,IAAI,EAAV,GAAiBA,KAAK,KAAK,CAA5B,MAAoC,CAA5C;AACAH,IAAAA,SAAS,CAACP,oBAAD,CAAT,GAAkCU,KAAlC;AAEAT,IAAAA,KAAK,CAAE,kBAAiBO,eAAgB,OAAME,KAAM,EAA/C,CAAL;AACD;;AACD,SAAOH,SAAP;AACD;;AAEM,SAASE,0BAAT,CAAoCL,MAApC,EAAyF;AAAA;;AAC9F,SAAO,gBAAAA,MAAM,CAACQ,GAAP,4DAAYJ,eAAZ,KAA+BJ,MAAM,CAACI,eAAtC,IAAyD,IAAhE;AACD","sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n// @ts-ignore: uses flow\nimport normalizeColor from '@react-native/normalize-color';\n\n// Maps to the template AppDelegate.m\nconst BACKGROUND_COLOR_KEY = 'RCTRootViewBackgroundColor';\n\nconst debug = require('debug')('expo:system-ui:plugin:ios');\n\nexport const withIosRootViewBackgroundColor: ConfigPlugin = config => {\n config = withInfoPlist(config, config => {\n config.modResults = setRootViewBackgroundColor(config, config.modResults);\n return config;\n });\n return config;\n};\n\nexport function setRootViewBackgroundColor(\n config: Pick<ExpoConfig, 'backgroundColor' | 'ios'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const backgroundColor = getRootViewBackgroundColor(config);\n if (!backgroundColor) {\n delete infoPlist[BACKGROUND_COLOR_KEY];\n } else {\n let color = normalizeColor(backgroundColor);\n if (!color) {\n throw new Error('Invalid background color on iOS');\n }\n color = ((color << 24) | (color >>> 8)) >>> 0;\n infoPlist[BACKGROUND_COLOR_KEY] = color;\n\n debug(`Convert color: ${backgroundColor} -> ${color}`);\n }\n return infoPlist;\n}\n\nexport function getRootViewBackgroundColor(config: Pick<ExpoConfig, 'ios' | 'backgroundColor'>) {\n return config.ios?.backgroundColor || config.backgroundColor || null;\n}\n"],"file":"withIosRootViewBackgroundColor.js"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigPlugin, InfoPlist } from '@expo/config-plugins';
|
|
2
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
3
|
+
export declare const withIosUserInterfaceStyle: ConfigPlugin;
|
|
4
|
+
export declare function getUserInterfaceStyle(config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>): string;
|
|
5
|
+
export declare function setUserInterfaceStyle(config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>, { UIUserInterfaceStyle, ...infoPlist }: InfoPlist): InfoPlist;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getUserInterfaceStyle = getUserInterfaceStyle;
|
|
7
|
+
exports.setUserInterfaceStyle = setUserInterfaceStyle;
|
|
8
|
+
exports.withIosUserInterfaceStyle = void 0;
|
|
9
|
+
|
|
10
|
+
function _configPlugins() {
|
|
11
|
+
const data = require("@expo/config-plugins");
|
|
12
|
+
|
|
13
|
+
_configPlugins = function () {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const withIosUserInterfaceStyle = config => {
|
|
21
|
+
return (0, _configPlugins().withInfoPlist)(config, config => {
|
|
22
|
+
config.modResults = setUserInterfaceStyle(config, config.modResults);
|
|
23
|
+
return config;
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.withIosUserInterfaceStyle = withIosUserInterfaceStyle;
|
|
28
|
+
|
|
29
|
+
function getUserInterfaceStyle(config) {
|
|
30
|
+
var _ref, _config$ios$userInter, _config$ios;
|
|
31
|
+
|
|
32
|
+
return (_ref = (_config$ios$userInter = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.userInterfaceStyle) !== null && _config$ios$userInter !== void 0 ? _config$ios$userInter : config.userInterfaceStyle) !== null && _ref !== void 0 ? _ref : 'light';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function setUserInterfaceStyle(config, {
|
|
36
|
+
UIUserInterfaceStyle,
|
|
37
|
+
...infoPlist
|
|
38
|
+
}) {
|
|
39
|
+
const userInterfaceStyle = getUserInterfaceStyle(config);
|
|
40
|
+
const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);
|
|
41
|
+
|
|
42
|
+
if (!style) {
|
|
43
|
+
return infoPlist;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return { ...infoPlist,
|
|
47
|
+
UIUserInterfaceStyle: style
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function mapUserInterfaceStyleForInfoPlist(userInterfaceStyle) {
|
|
52
|
+
switch (userInterfaceStyle) {
|
|
53
|
+
case 'light':
|
|
54
|
+
return 'Light';
|
|
55
|
+
|
|
56
|
+
case 'dark':
|
|
57
|
+
return 'Dark';
|
|
58
|
+
|
|
59
|
+
case 'automatic':
|
|
60
|
+
return 'Automatic';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=withIosUserInterfaceStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.ts"],"names":["withIosUserInterfaceStyle","config","modResults","setUserInterfaceStyle","getUserInterfaceStyle","ios","userInterfaceStyle","UIUserInterfaceStyle","infoPlist","style","mapUserInterfaceStyleForInfoPlist"],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGO,MAAMA,yBAAuC,GAAGC,MAAM,IAAI;AAC/D,SAAO,oCAAcA,MAAd,EAAsBA,MAAM,IAAI;AACrCA,IAAAA,MAAM,CAACC,UAAP,GAAoBC,qBAAqB,CAACF,MAAD,EAASA,MAAM,CAACC,UAAhB,CAAzC;AACA,WAAOD,MAAP;AACD,GAHM,CAAP;AAID,CALM;;;;AAOA,SAASG,qBAAT,CACLH,MADK,EAEG;AAAA;;AACR,yDAAOA,MAAM,CAACI,GAAd,gDAAO,YAAYC,kBAAnB,yEAAyCL,MAAM,CAACK,kBAAhD,uCAAsE,OAAtE;AACD;;AAEM,SAASH,qBAAT,CACLF,MADK,EAEL;AAAEM,EAAAA,oBAAF;AAAwB,KAAGC;AAA3B,CAFK,EAGM;AACX,QAAMF,kBAAkB,GAAGF,qBAAqB,CAACH,MAAD,CAAhD;AACA,QAAMQ,KAAK,GAAGC,iCAAiC,CAACJ,kBAAD,CAA/C;;AAEA,MAAI,CAACG,KAAL,EAAY;AACV,WAAOD,SAAP;AACD;;AAED,SAAO,EACL,GAAGA,SADE;AAELD,IAAAA,oBAAoB,EAAEE;AAFjB,GAAP;AAID;;AAED,SAASC,iCAAT,CACEJ,kBADF,EAEyD;AACvD,UAAQA,kBAAR;AACE,SAAK,OAAL;AACE,aAAO,OAAP;;AACF,SAAK,MAAL;AACE,aAAO,MAAP;;AACF,SAAK,WAAL;AACE,aAAO,WAAP;AANJ;;AASA,SAAO,IAAP;AACD","sourcesContent":["import { ConfigPlugin, InfoPlist, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport const withIosUserInterfaceStyle: ConfigPlugin = config => {\n return withInfoPlist(config, config => {\n config.modResults = setUserInterfaceStyle(config, config.modResults);\n return config;\n });\n};\n\nexport function getUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>\n): string {\n return config.ios?.userInterfaceStyle ?? config.userInterfaceStyle ?? 'light';\n}\n\nexport function setUserInterfaceStyle(\n config: Pick<ExpoConfig, 'ios' | 'userInterfaceStyle'>,\n { UIUserInterfaceStyle, ...infoPlist }: InfoPlist\n): InfoPlist {\n const userInterfaceStyle = getUserInterfaceStyle(config);\n const style = mapUserInterfaceStyleForInfoPlist(userInterfaceStyle);\n\n if (!style) {\n return infoPlist;\n }\n\n return {\n ...infoPlist,\n UIUserInterfaceStyle: style,\n };\n}\n\nfunction mapUserInterfaceStyleForInfoPlist(\n userInterfaceStyle: string\n): NonNullable<InfoPlist['UIUserInterfaceStyle']> | null {\n switch (userInterfaceStyle) {\n case 'light':\n return 'Light';\n case 'dark':\n return 'Dark';\n case 'automatic':\n return 'Automatic';\n }\n\n return null;\n}\n"],"file":"withIosUserInterfaceStyle.js"}
|
|
@@ -128,6 +128,16 @@ function _expoSplashScreen() {
|
|
|
128
128
|
return data;
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
function _expoSystemUi() {
|
|
132
|
+
const data = _interopRequireDefault(require("./unversioned/expo-system-ui/expo-system-ui"));
|
|
133
|
+
|
|
134
|
+
_expoSystemUi = function () {
|
|
135
|
+
return data;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
return data;
|
|
139
|
+
}
|
|
140
|
+
|
|
131
141
|
function _expoUpdates() {
|
|
132
142
|
const data = _interopRequireDefault(require("./unversioned/expo-updates"));
|
|
133
143
|
|
|
@@ -166,7 +176,7 @@ const withIosExpoPlugins = (config, {
|
|
|
166
176
|
config.ios.bundleIdentifier = bundleIdentifier;
|
|
167
177
|
return (0, _configPlugins().withPlugins)(config, [[_configPlugins().IOSConfig.BundleIdentifier.withBundleIdentifier, {
|
|
168
178
|
bundleIdentifier
|
|
169
|
-
}], _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.
|
|
179
|
+
}], _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.Scheme.withScheme, _configPlugins().IOSConfig.UsesNonExemptEncryption.withUsesNonExemptEncryption, _configPlugins().IOSConfig.Version.withBuildNumber, _configPlugins().IOSConfig.Version.withVersion, _configPlugins().IOSConfig.Google.withGoogleServicesFile, _configPlugins().IOSConfig.JsEngine.withJsEnginePodfileProps, // Entitlements
|
|
170
180
|
_configPlugins().IOSConfig.Entitlements.withAssociatedDomains, // XcodeProject
|
|
171
181
|
_configPlugins().IOSConfig.DeviceFamily.withDeviceFamily, _configPlugins().IOSConfig.Bitcode.withBitcode, _configPlugins().IOSConfig.Locales.withLocales, // Dangerous
|
|
172
182
|
_withIosIcons().withIosIcons]);
|
|
@@ -190,25 +200,26 @@ const withAndroidExpoPlugins = (config, props) => {
|
|
|
190
200
|
_configPlugins().AndroidConfig.GoogleServices.withApplyPlugin, _configPlugins().AndroidConfig.Package.withPackageGradle, _configPlugins().AndroidConfig.Version.withVersion, // AndroidManifest.xml
|
|
191
201
|
_configPlugins().AndroidConfig.Package.withPackageManifest, _configPlugins().AndroidConfig.AllowBackup.withAllowBackup, _configPlugins().AndroidConfig.WindowSoftInputMode.withWindowSoftInputMode, // Note: The withAndroidIntentFilters plugin must appear before the withScheme
|
|
192
202
|
// plugin or withScheme will override the output of withAndroidIntentFilters.
|
|
193
|
-
_configPlugins().AndroidConfig.IntentFilters.withAndroidIntentFilters, _configPlugins().AndroidConfig.Scheme.withScheme, _configPlugins().AndroidConfig.Orientation.withOrientation, _configPlugins().AndroidConfig.Permissions.withPermissions,
|
|
194
|
-
_configPlugins().AndroidConfig.UserInterfaceStyle.withUiModeMainActivity, // strings.xml
|
|
203
|
+
_configPlugins().AndroidConfig.IntentFilters.withAndroidIntentFilters, _configPlugins().AndroidConfig.Scheme.withScheme, _configPlugins().AndroidConfig.Orientation.withOrientation, _configPlugins().AndroidConfig.Permissions.withPermissions, // strings.xml
|
|
195
204
|
_configPlugins().AndroidConfig.Name.withName, // Dangerous -- these plugins run in reverse order.
|
|
196
205
|
_configPlugins().AndroidConfig.GoogleServices.withGoogleServicesFile, // Modify colors.xml and styles.xml
|
|
197
|
-
_configPlugins().AndroidConfig.
|
|
206
|
+
_configPlugins().AndroidConfig.StatusBar.withStatusBar, _configPlugins().AndroidConfig.PrimaryColor.withPrimaryColor, c => (0, _withAndroidIcons().withAndroidIcons)(c), // If we renamed the package, we should also move it around and rename it in source files
|
|
198
207
|
// Added last to ensure this plugin runs first. Out of tree solutions will mistakenly resolve the package incorrectly otherwise.
|
|
199
208
|
_configPlugins().AndroidConfig.Package.withPackageRefactor]);
|
|
200
209
|
}; // Must keep in sync with `withVersionedExpoSDKPlugins`
|
|
201
210
|
|
|
202
211
|
|
|
203
212
|
exports.withAndroidExpoPlugins = withAndroidExpoPlugins;
|
|
204
|
-
const versionedExpoSDKPackages = ['react-native-maps', 'expo-ads-admob', 'expo-apple-authentication', 'expo-contacts', 'expo-notifications', 'expo-updates', 'expo-branch', 'expo-navigation-bar', 'expo-document-picker', 'expo-facebook', 'expo-splash-screen'];
|
|
213
|
+
const versionedExpoSDKPackages = ['react-native-maps', 'expo-ads-admob', 'expo-apple-authentication', 'expo-contacts', 'expo-notifications', 'expo-updates', 'expo-branch', 'expo-navigation-bar', 'expo-document-picker', 'expo-facebook', 'expo-splash-screen', 'expo-system-ui'];
|
|
205
214
|
|
|
206
215
|
const withVersionedExpoSDKPlugins = (config, {
|
|
207
216
|
expoUsername
|
|
208
217
|
}) => {
|
|
209
218
|
return (0, _configPlugins().withPlugins)(config, [_reactNativeMaps().default, _expoAdsAdmob().default, _expoAppleAuthentication().default, _expoContacts().default, _expoNotifications().default, [_expoUpdates().default, {
|
|
210
219
|
expoUsername
|
|
211
|
-
}], _expoBranch().default, _expoDocumentPicker().default, _expoFacebook().default,
|
|
220
|
+
}], _expoBranch().default, _expoDocumentPicker().default, _expoFacebook().default, // System UI must come before splash screen as they overlap
|
|
221
|
+
// and splash screen will warn about conflicting rules.
|
|
222
|
+
_expoSystemUi().default, _expoSplashScreen().default, _expoNavigationBar().default]);
|
|
212
223
|
};
|
|
213
224
|
|
|
214
225
|
exports.withVersionedExpoSDKPlugins = withVersionedExpoSDKPlugins;
|
|
@@ -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","JsEngine","withJsEnginePodfileProps","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Bitcode","withBitcode","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","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","c","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSplashScreen","withNavigationBar","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;;AAA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YxB,mBAZwB,EAaxB,kBAbwB,EAcxB,mBAdwB,EAexB,eAfwB,EAgBxB,oBAhBwB,EAiBxB,yBAjBwB,EAkBxB,cAlBwB,EAmBxB,mBAnBwB,EAoBxB,2BApBwB,CAA1B,C,CAuBA;AACA;;AACA,MAAMC,2BAA2B,GAAG,CAClC,yBADkC,EAElC,oBAFkC,EAGlC,qBAHkC,CAApC;;AAMA,MAAME,yBAAkE,GAAG,CAACzF,MAAD,EAAS0F,OAAT,KAAqB;AAC9F,SAAOA,OAAO,CAACC,MAAR,CAAe,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACtC,WAAO,uCAAiBD,IAAjB,EAAuB;AAC5B;AACAE,MAAAA,eAAe,EAAE,IAFW;AAG5BD,MAAAA,MAH4B;AAI5B;AACAE,MAAAA,QAAQ,EAAE/F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GARM,EAQJA,MARI,CAAP;AASD,CAVD;;AAYO,SAASgG,qBAAT,CAA+BhG,MAA/B,EAAmD;AACxD,SAAOyF,yBAAyB,CAACzF,MAAD,EAAS,CACvC,GAAG,IAAIiG,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/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook/expo-facebook';\nimport withNavigationBar from './unversioned/expo-navigation-bar/expo-navigation-bar';\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.Bitcode.withBitcode,\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.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-navigation-bar',\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 withNavigationBar,\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","Scheme","withScheme","UsesNonExemptEncryption","withUsesNonExemptEncryption","Version","withBuildNumber","withVersion","withGoogleServicesFile","JsEngine","withJsEnginePodfileProps","Entitlements","withAssociatedDomains","DeviceFamily","withDeviceFamily","Bitcode","withBitcode","Locales","withLocales","withIosIcons","withAndroidExpoPlugins","props","android","package","AndroidConfig","withJsEngineGradleProps","withNameSettingsGradle","GoogleServices","withClassPath","withApplyPlugin","Package","withPackageGradle","withPackageManifest","AllowBackup","withAllowBackup","WindowSoftInputMode","withWindowSoftInputMode","IntentFilters","withAndroidIntentFilters","Permissions","withPermissions","withName","StatusBar","withStatusBar","PrimaryColor","withPrimaryColor","c","withPackageRefactor","versionedExpoSDKPackages","withVersionedExpoSDKPlugins","expoUsername","withMaps","withAdMob","withAppleAuthentication","withContacts","withNotifications","withUpdates","withBranch","withDocumentPicker","withFacebook","withSystemUI","withSplashScreen","withNavigationBar","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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AACA;;AACA,MAAMC,2BAA2B,GAAG,CAClC,yBADkC,EAElC,oBAFkC,EAGlC,qBAHkC,CAApC;;AAMA,MAAME,yBAAkE,GAAG,CAACpF,MAAD,EAASqF,OAAT,KAAqB;AAC9F,SAAOA,OAAO,CAACC,MAAR,CAAe,CAACC,IAAD,EAAOC,MAAP,KAAkB;AACtC,WAAO,uCAAiBD,IAAjB,EAAuB;AAC5B;AACAE,MAAAA,eAAe,EAAE,IAFW;AAG5BD,MAAAA,MAH4B;AAI5B;AACAE,MAAAA,QAAQ,EAAE1F,MAAM,IAAIA;AALQ,KAAvB,CAAP;AAOD,GARM,EAQJA,MARI,CAAP;AASD,CAVD;;AAYO,SAAS2F,qBAAT,CAA+B3F,MAA/B,EAAmD;AACxD,SAAOoF,yBAAyB,CAACpF,MAAD,EAAS,CACvC,GAAG,IAAI4F,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/expo-branch';\nimport withContacts from './unversioned/expo-contacts';\nimport withDocumentPicker from './unversioned/expo-document-picker';\nimport withFacebook from './unversioned/expo-facebook/expo-facebook';\nimport withNavigationBar from './unversioned/expo-navigation-bar/expo-navigation-bar';\nimport withNotifications from './unversioned/expo-notifications/expo-notifications';\nimport withSplashScreen from './unversioned/expo-splash-screen/expo-splash-screen';\nimport withSystemUI from './unversioned/expo-system-ui/expo-system-ui';\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.Scheme.withScheme,\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.Bitcode.withBitcode,\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\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.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-navigation-bar',\n 'expo-document-picker',\n 'expo-facebook',\n 'expo-splash-screen',\n 'expo-system-ui',\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 // System UI must come before splash screen as they overlap\n // and splash screen will warn about conflicting rules.\n withSystemUI,\n withSplashScreen,\n withNavigationBar,\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.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"description": "Get the prebuild config",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@types/debug": "^4.1.5"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@expo/config": "6.0.
|
|
38
|
-
"@expo/config-plugins": "4.0.
|
|
37
|
+
"@expo/config": "6.0.7",
|
|
38
|
+
"@expo/config-plugins": "4.0.7",
|
|
39
39
|
"@expo/config-types": "^43.0.1",
|
|
40
40
|
"@expo/image-utils": "0.3.17",
|
|
41
41
|
"@expo/json-file": "8.2.33",
|