@expo/config-plugins 0.0.0-canary-20231122-1af9191
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/LICENSE +22 -0
- package/README.md +34 -0
- package/build/Plugin.types.d.ts +169 -0
- package/build/Plugin.types.js +51 -0
- package/build/Plugin.types.js.map +1 -0
- package/build/android/AllowBackup.d.ts +6 -0
- package/build/android/AllowBackup.js +47 -0
- package/build/android/AllowBackup.js.map +1 -0
- package/build/android/BuildProperties.d.ts +28 -0
- package/build/android/BuildProperties.js +82 -0
- package/build/android/BuildProperties.js.map +1 -0
- package/build/android/Colors.d.ts +29 -0
- package/build/android/Colors.js +109 -0
- package/build/android/Colors.js.map +1 -0
- package/build/android/EasBuild.d.ts +3 -0
- package/build/android/EasBuild.js +67 -0
- package/build/android/EasBuild.js.map +1 -0
- package/build/android/EasBuildGradleScript.d.ts +2 -0
- package/build/android/EasBuildGradleScript.js +83 -0
- package/build/android/EasBuildGradleScript.js.map +1 -0
- package/build/android/GoogleMapsApiKey.d.ts +5 -0
- package/build/android/GoogleMapsApiKey.js +48 -0
- package/build/android/GoogleMapsApiKey.js.map +1 -0
- package/build/android/GoogleServices.d.ts +17 -0
- package/build/android/GoogleServices.js +139 -0
- package/build/android/GoogleServices.js.map +1 -0
- package/build/android/IntentFilters.d.ts +8 -0
- package/build/android/IntentFilters.js +89 -0
- package/build/android/IntentFilters.js.map +1 -0
- package/build/android/Manifest.d.ts +156 -0
- package/build/android/Manifest.js +230 -0
- package/build/android/Manifest.js.map +1 -0
- package/build/android/Name.d.ts +20 -0
- package/build/android/Name.js +93 -0
- package/build/android/Name.js.map +1 -0
- package/build/android/Orientation.d.ts +6 -0
- package/build/android/Orientation.js +41 -0
- package/build/android/Orientation.js.map +1 -0
- package/build/android/Package.d.ts +18 -0
- package/build/android/Package.js +307 -0
- package/build/android/Package.js.map +1 -0
- package/build/android/Paths.d.ts +30 -0
- package/build/android/Paths.js +154 -0
- package/build/android/Paths.js.map +1 -0
- package/build/android/Permissions.d.ts +20 -0
- package/build/android/Permissions.js +211 -0
- package/build/android/Permissions.js.map +1 -0
- package/build/android/PrimaryColor.d.ts +6 -0
- package/build/android/PrimaryColor.js +63 -0
- package/build/android/PrimaryColor.js.map +1 -0
- package/build/android/Properties.d.ts +12 -0
- package/build/android/Properties.js +55 -0
- package/build/android/Properties.js.map +1 -0
- package/build/android/Resources.d.ts +87 -0
- package/build/android/Resources.js +148 -0
- package/build/android/Resources.js.map +1 -0
- package/build/android/Scheme.d.ts +20 -0
- package/build/android/Scheme.js +240 -0
- package/build/android/Scheme.js.map +1 -0
- package/build/android/StatusBar.d.ts +16 -0
- package/build/android/StatusBar.js +123 -0
- package/build/android/StatusBar.js.map +1 -0
- package/build/android/Strings.d.ts +6 -0
- package/build/android/Strings.js +56 -0
- package/build/android/Strings.js.map +1 -0
- package/build/android/Styles.d.ts +61 -0
- package/build/android/Styles.js +170 -0
- package/build/android/Styles.js.map +1 -0
- package/build/android/Updates.d.ts +27 -0
- package/build/android/Updates.js +220 -0
- package/build/android/Updates.js.map +1 -0
- package/build/android/Version.d.ts +16 -0
- package/build/android/Version.js +90 -0
- package/build/android/Version.js.map +1 -0
- package/build/android/WindowSoftInputMode.d.ts +6 -0
- package/build/android/WindowSoftInputMode.js +49 -0
- package/build/android/WindowSoftInputMode.js.map +1 -0
- package/build/android/codeMod.d.ts +20 -0
- package/build/android/codeMod.js +93 -0
- package/build/android/codeMod.js.map +1 -0
- package/build/android/index.d.ts +25 -0
- package/build/android/index.js +308 -0
- package/build/android/index.js.map +1 -0
- package/build/index.d.ts +35 -0
- package/build/index.js +408 -0
- package/build/index.js.map +1 -0
- package/build/ios/Bitcode.d.ts +33 -0
- package/build/ios/Bitcode.js +111 -0
- package/build/ios/Bitcode.js.map +1 -0
- package/build/ios/BuildProperties.d.ts +27 -0
- package/build/ios/BuildProperties.js +71 -0
- package/build/ios/BuildProperties.js.map +1 -0
- package/build/ios/BuildScheme.d.ts +10 -0
- package/build/ios/BuildScheme.js +117 -0
- package/build/ios/BuildScheme.js.map +1 -0
- package/build/ios/BundleIdentifier.d.ts +50 -0
- package/build/ios/BundleIdentifier.js +243 -0
- package/build/ios/BundleIdentifier.js.map +1 -0
- package/build/ios/DeviceFamily.d.ts +19 -0
- package/build/ios/DeviceFamily.js +95 -0
- package/build/ios/DeviceFamily.js.map +1 -0
- package/build/ios/Entitlements.d.ts +9 -0
- package/build/ios/Entitlements.js +135 -0
- package/build/ios/Entitlements.js.map +1 -0
- package/build/ios/Google.d.ts +14 -0
- package/build/ios/Google.js +141 -0
- package/build/ios/Google.js.map +1 -0
- package/build/ios/IosConfig.types.d.ts +45 -0
- package/build/ios/IosConfig.types.js +2 -0
- package/build/ios/IosConfig.types.js.map +1 -0
- package/build/ios/Locales.d.ts +14 -0
- package/build/ios/Locales.js +133 -0
- package/build/ios/Locales.js.map +1 -0
- package/build/ios/Maps.d.ts +17 -0
- package/build/ios/Maps.js +230 -0
- package/build/ios/Maps.js.map +1 -0
- package/build/ios/Name.d.ts +20 -0
- package/build/ios/Name.js +114 -0
- package/build/ios/Name.js.map +1 -0
- package/build/ios/Orientation.d.ts +7 -0
- package/build/ios/Orientation.js +46 -0
- package/build/ios/Orientation.js.map +1 -0
- package/build/ios/Paths.d.ts +36 -0
- package/build/ios/Paths.js +287 -0
- package/build/ios/Paths.js.map +1 -0
- package/build/ios/Permissions.d.ts +9 -0
- package/build/ios/Permissions.js +58 -0
- package/build/ios/Permissions.js.map +1 -0
- package/build/ios/ProvisioningProfile.d.ts +8 -0
- package/build/ios/ProvisioningProfile.js +67 -0
- package/build/ios/ProvisioningProfile.js.map +1 -0
- package/build/ios/RequiresFullScreen.d.ts +5 -0
- package/build/ios/RequiresFullScreen.js +103 -0
- package/build/ios/RequiresFullScreen.js.map +1 -0
- package/build/ios/Scheme.d.ts +11 -0
- package/build/ios/Scheme.js +114 -0
- package/build/ios/Scheme.js.map +1 -0
- package/build/ios/Swift.d.ts +34 -0
- package/build/ios/Swift.js +196 -0
- package/build/ios/Swift.js.map +1 -0
- package/build/ios/Target.d.ts +27 -0
- package/build/ios/Target.js +137 -0
- package/build/ios/Target.js.map +1 -0
- package/build/ios/Updates.d.ts +32 -0
- package/build/ios/Updates.js +184 -0
- package/build/ios/Updates.js.map +1 -0
- package/build/ios/UsesNonExemptEncryption.d.ts +5 -0
- package/build/ios/UsesNonExemptEncryption.js +40 -0
- package/build/ios/UsesNonExemptEncryption.js.map +1 -0
- package/build/ios/Version.d.ts +8 -0
- package/build/ios/Version.js +47 -0
- package/build/ios/Version.js.map +1 -0
- package/build/ios/XcodeProjectFile.d.ts +31 -0
- package/build/ios/XcodeProjectFile.js +99 -0
- package/build/ios/XcodeProjectFile.js.map +1 -0
- package/build/ios/codeMod.d.ts +81 -0
- package/build/ios/codeMod.js +265 -0
- package/build/ios/codeMod.js.map +1 -0
- package/build/ios/index.d.ts +26 -0
- package/build/ios/index.js +329 -0
- package/build/ios/index.js.map +1 -0
- package/build/ios/utils/Xcodeproj.d.ts +93 -0
- package/build/ios/utils/Xcodeproj.js +490 -0
- package/build/ios/utils/Xcodeproj.js.map +1 -0
- package/build/ios/utils/getInfoPlistPath.d.ts +12 -0
- package/build/ios/utils/getInfoPlistPath.js +50 -0
- package/build/ios/utils/getInfoPlistPath.js.map +1 -0
- package/build/ios/utils/string.d.ts +1 -0
- package/build/ios/utils/string.js +10 -0
- package/build/ios/utils/string.js.map +1 -0
- package/build/plugins/android-plugins.d.ts +89 -0
- package/build/plugins/android-plugins.js +210 -0
- package/build/plugins/android-plugins.js.map +1 -0
- package/build/plugins/createBaseMod.d.ts +31 -0
- package/build/plugins/createBaseMod.js +130 -0
- package/build/plugins/createBaseMod.js.map +1 -0
- package/build/plugins/ios-plugins.d.ts +70 -0
- package/build/plugins/ios-plugins.js +191 -0
- package/build/plugins/ios-plugins.js.map +1 -0
- package/build/plugins/mod-compiler.d.ts +38 -0
- package/build/plugins/mod-compiler.js +222 -0
- package/build/plugins/mod-compiler.js.map +1 -0
- package/build/plugins/withAndroidBaseMods.d.ts +38 -0
- package/build/plugins/withAndroidBaseMods.js +516 -0
- package/build/plugins/withAndroidBaseMods.js.map +1 -0
- package/build/plugins/withDangerousMod.d.ts +10 -0
- package/build/plugins/withDangerousMod.js +30 -0
- package/build/plugins/withDangerousMod.js.map +1 -0
- package/build/plugins/withIosBaseMods.d.ts +29 -0
- package/build/plugins/withIosBaseMods.js +413 -0
- package/build/plugins/withIosBaseMods.js.map +1 -0
- package/build/plugins/withMod.d.ts +46 -0
- package/build/plugins/withMod.js +210 -0
- package/build/plugins/withMod.js.map +1 -0
- package/build/plugins/withPlugins.d.ts +8 -0
- package/build/plugins/withPlugins.js +35 -0
- package/build/plugins/withPlugins.js.map +1 -0
- package/build/plugins/withRunOnce.d.ts +20 -0
- package/build/plugins/withRunOnce.js +55 -0
- package/build/plugins/withRunOnce.js.map +1 -0
- package/build/plugins/withStaticPlugin.d.ts +17 -0
- package/build/plugins/withStaticPlugin.js +140 -0
- package/build/plugins/withStaticPlugin.js.map +1 -0
- package/build/utils/BuildProperties.types.d.ts +25 -0
- package/build/utils/BuildProperties.types.js +2 -0
- package/build/utils/BuildProperties.types.js.map +1 -0
- package/build/utils/Updates.d.ts +23 -0
- package/build/utils/Updates.js +214 -0
- package/build/utils/Updates.js.map +1 -0
- package/build/utils/XML.d.ts +27 -0
- package/build/utils/XML.js +165 -0
- package/build/utils/XML.js.map +1 -0
- package/build/utils/commonCodeMod.d.ts +32 -0
- package/build/utils/commonCodeMod.js +63 -0
- package/build/utils/commonCodeMod.js.map +1 -0
- package/build/utils/errors.d.ts +15 -0
- package/build/utils/errors.js +27 -0
- package/build/utils/errors.js.map +1 -0
- package/build/utils/fs.d.ts +4 -0
- package/build/utils/fs.js +45 -0
- package/build/utils/fs.js.map +1 -0
- package/build/utils/generateCode.d.ts +36 -0
- package/build/utils/generateCode.js +128 -0
- package/build/utils/generateCode.js.map +1 -0
- package/build/utils/history.d.ts +11 -0
- package/build/utils/history.js +25 -0
- package/build/utils/history.js.map +1 -0
- package/build/utils/matchBrackets.d.ts +7 -0
- package/build/utils/matchBrackets.js +65 -0
- package/build/utils/matchBrackets.js.map +1 -0
- package/build/utils/modules.d.ts +3 -0
- package/build/utils/modules.js +44 -0
- package/build/utils/modules.js.map +1 -0
- package/build/utils/obj.d.ts +2 -0
- package/build/utils/obj.js +20 -0
- package/build/utils/obj.js.map +1 -0
- package/build/utils/plugin-resolver.d.ts +33 -0
- package/build/utils/plugin-resolver.js +220 -0
- package/build/utils/plugin-resolver.js.map +1 -0
- package/build/utils/sortObject.d.ts +4 -0
- package/build/utils/sortObject.js +42 -0
- package/build/utils/sortObject.js.map +1 -0
- package/build/utils/versions.d.ts +3 -0
- package/build/utils/versions.js +42 -0
- package/build/utils/versions.js.map +1 -0
- package/build/utils/warnings.d.ts +26 -0
- package/build/utils/warnings.js +52 -0
- package/build/utils/warnings.js.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-present 650 Industries, Inc. (aka Expo)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<!-- Title -->
|
|
2
|
+
<h1 align="center">
|
|
3
|
+
👋 Welcome to <br><code>@expo/config-plugins</code>
|
|
4
|
+
</h1>
|
|
5
|
+
|
|
6
|
+
<p align="center">A powerful tool for generating native app code from a unified JavaScript interface.</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img src="https://flat.badgen.net/packagephobia/install/@expo/config-plugins">
|
|
10
|
+
|
|
11
|
+
<a href="https://www.npmjs.com/package/@expo/config-plugins">
|
|
12
|
+
<img src="https://flat.badgen.net/npm/dw/@expo/config-plugins" target="_blank" />
|
|
13
|
+
</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<!-- Body -->
|
|
17
|
+
|
|
18
|
+
Most basic functionality can be controlled by using the [static Expo config](https://docs.expo.dev/versions/latest/config/app/), but some features require manipulation of the native project files. To support complex behavior we've created config plugins, and mods (short for modifiers).
|
|
19
|
+
|
|
20
|
+
For more info, please refer to the official Expo docs: [Config Plugins](https://docs.expo.dev/config-plugins/introduction/).
|
|
21
|
+
|
|
22
|
+
## Environment Variables
|
|
23
|
+
|
|
24
|
+
### `EXPO_DEBUG`
|
|
25
|
+
|
|
26
|
+
Print debug information related to static plugin resolution.
|
|
27
|
+
|
|
28
|
+
### `EXPO_CONFIG_PLUGIN_VERBOSE_ERRORS`
|
|
29
|
+
|
|
30
|
+
Show all error info related to static plugin resolution. Requires `EXPO_DEBUG` to be enabled.
|
|
31
|
+
|
|
32
|
+
### `EXPO_USE_UNVERSIONED_PLUGINS`
|
|
33
|
+
|
|
34
|
+
Force using the fallback unversioned plugins instead of a local versioned copy from installed packages, this should only be used for testing the CLI.
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import { JSONObject } from '@expo/json-file';
|
|
3
|
+
import { XcodeProject } from 'xcode';
|
|
4
|
+
import { Properties } from './android';
|
|
5
|
+
import { AndroidManifest } from './android/Manifest';
|
|
6
|
+
import * as AndroidPaths from './android/Paths';
|
|
7
|
+
import { ResourceXML } from './android/Resources';
|
|
8
|
+
import { ExpoPlist, InfoPlist } from './ios/IosConfig.types';
|
|
9
|
+
import { AppDelegateProjectFile } from './ios/Paths';
|
|
10
|
+
type OptionalPromise<T> = Promise<T> | T;
|
|
11
|
+
type Plist = JSONObject;
|
|
12
|
+
export interface ModProps<T = any> {
|
|
13
|
+
/**
|
|
14
|
+
* Project root directory for the universal app.
|
|
15
|
+
*/
|
|
16
|
+
readonly projectRoot: string;
|
|
17
|
+
/**
|
|
18
|
+
* Project root for the specific platform.
|
|
19
|
+
*/
|
|
20
|
+
readonly platformProjectRoot: string;
|
|
21
|
+
/**
|
|
22
|
+
* Name of the mod.
|
|
23
|
+
*/
|
|
24
|
+
readonly modName: string;
|
|
25
|
+
/**
|
|
26
|
+
* Name of the platform used in the mods config.
|
|
27
|
+
*/
|
|
28
|
+
readonly platform: ModPlatform;
|
|
29
|
+
/**
|
|
30
|
+
* If the mod is being evaluated in introspection mode.
|
|
31
|
+
* No file system modifications should be made when introspect is `true`.
|
|
32
|
+
*/
|
|
33
|
+
readonly introspect: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* [iOS]: The path component used for querying project files.
|
|
36
|
+
*
|
|
37
|
+
* @example projectRoot/ios/[projectName]/
|
|
38
|
+
*/
|
|
39
|
+
readonly projectName?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Ignore any of the user's local native files and solely rely on the generated files.
|
|
42
|
+
* This makes prebuild data, like entitlements, more aligned to what users expects.
|
|
43
|
+
* When enabling this, users must be informed and have a way to disable this exclusion.
|
|
44
|
+
*/
|
|
45
|
+
readonly ignoreExistingNativeFiles?: boolean;
|
|
46
|
+
nextMod?: Mod<T>;
|
|
47
|
+
}
|
|
48
|
+
export interface ExportedConfig extends ExpoConfig {
|
|
49
|
+
mods?: ModConfig | null;
|
|
50
|
+
}
|
|
51
|
+
export interface ExportedConfigWithProps<Data = any> extends ExportedConfig {
|
|
52
|
+
/**
|
|
53
|
+
* The Object representation of a complex file type.
|
|
54
|
+
*/
|
|
55
|
+
modResults: Data;
|
|
56
|
+
modRequest: ModProps<Data>;
|
|
57
|
+
/**
|
|
58
|
+
* A frozen representation of the original file contents,
|
|
59
|
+
* this can be used as a reference into the user's original intent.
|
|
60
|
+
*
|
|
61
|
+
* For example, you could infer that the user defined a certain
|
|
62
|
+
* value explicitly and disable any automatic changes.
|
|
63
|
+
*/
|
|
64
|
+
readonly modRawConfig: ExpoConfig;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A helper type to get the properties of a plugin.
|
|
68
|
+
*/
|
|
69
|
+
export type PluginParameters<T extends ConfigPlugin<any>> = T extends (config: any, props: infer P) => any ? P : never;
|
|
70
|
+
export type ConfigPlugin<Props = void> = (config: ExpoConfig, props: Props) => ExpoConfig;
|
|
71
|
+
export type StaticPlugin<T = any> = [string | ConfigPlugin<T>, T];
|
|
72
|
+
export type Mod<Props = any> = ((config: ExportedConfigWithProps<Props>) => OptionalPromise<ExportedConfigWithProps<Props>>) & {
|
|
73
|
+
/**
|
|
74
|
+
* Indicates that the mod provides data upstream to other mods.
|
|
75
|
+
* This mod should always be the last one added.
|
|
76
|
+
*/
|
|
77
|
+
isProvider?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* If the mod supports introspection, and avoids making any filesystem modifications during compilation.
|
|
80
|
+
* By enabling, this mod, and all of its descendants will be run in introspection mode.
|
|
81
|
+
* This should only be used for static files like JSON or XML, and not for application files that require regexes,
|
|
82
|
+
* or complex static files that require other files to be generated like Xcode `.pbxproj`.
|
|
83
|
+
*/
|
|
84
|
+
isIntrospective?: boolean;
|
|
85
|
+
};
|
|
86
|
+
export interface ModConfig {
|
|
87
|
+
android?: {
|
|
88
|
+
/**
|
|
89
|
+
* Dangerously make a modification before any other android mods have been run.
|
|
90
|
+
*/
|
|
91
|
+
dangerous?: Mod<unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).
|
|
94
|
+
*/
|
|
95
|
+
manifest?: Mod<AndroidManifest>;
|
|
96
|
+
/**
|
|
97
|
+
* Modify the `android/app/src/main/res/values/strings.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).
|
|
98
|
+
*/
|
|
99
|
+
strings?: Mod<ResourceXML>;
|
|
100
|
+
/**
|
|
101
|
+
* Modify the `android/app/src/main/res/values/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).
|
|
102
|
+
*/
|
|
103
|
+
colors?: Mod<ResourceXML>;
|
|
104
|
+
/**
|
|
105
|
+
* Modify the `android/app/src/main/res/values-night/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).
|
|
106
|
+
*/
|
|
107
|
+
colorsNight?: Mod<ResourceXML>;
|
|
108
|
+
/**
|
|
109
|
+
* Modify the `android/app/src/main/res/values/styles.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).
|
|
110
|
+
*/
|
|
111
|
+
styles?: Mod<ResourceXML>;
|
|
112
|
+
/**
|
|
113
|
+
* Modify the `android/app/src/main/<package>/MainActivity.java` as a string.
|
|
114
|
+
*/
|
|
115
|
+
mainActivity?: Mod<AndroidPaths.ApplicationProjectFile>;
|
|
116
|
+
/**
|
|
117
|
+
* Modify the `android/app/src/main/<package>/MainApplication.java` as a string.
|
|
118
|
+
*/
|
|
119
|
+
mainApplication?: Mod<AndroidPaths.ApplicationProjectFile>;
|
|
120
|
+
/**
|
|
121
|
+
* Modify the `android/app/build.gradle` as a string.
|
|
122
|
+
*/
|
|
123
|
+
appBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;
|
|
124
|
+
/**
|
|
125
|
+
* Modify the `android/build.gradle` as a string.
|
|
126
|
+
*/
|
|
127
|
+
projectBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;
|
|
128
|
+
/**
|
|
129
|
+
* Modify the `android/settings.gradle` as a string.
|
|
130
|
+
*/
|
|
131
|
+
settingsGradle?: Mod<AndroidPaths.GradleProjectFile>;
|
|
132
|
+
/**
|
|
133
|
+
* Modify the `android/gradle.properties` as a `Properties.PropertiesItem[]`.
|
|
134
|
+
*/
|
|
135
|
+
gradleProperties?: Mod<Properties.PropertiesItem[]>;
|
|
136
|
+
};
|
|
137
|
+
ios?: {
|
|
138
|
+
/**
|
|
139
|
+
* Dangerously make a modification before any other android mods have been run.
|
|
140
|
+
*/
|
|
141
|
+
dangerous?: Mod<unknown>;
|
|
142
|
+
/**
|
|
143
|
+
* Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).
|
|
144
|
+
*/
|
|
145
|
+
infoPlist?: Mod<InfoPlist>;
|
|
146
|
+
/**
|
|
147
|
+
* Modify the `ios/<name>/<product-name>.entitlements` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).
|
|
148
|
+
*/
|
|
149
|
+
entitlements?: Mod<Plist>;
|
|
150
|
+
/**
|
|
151
|
+
* Modify the `ios/<name>/Expo.plist` as JSON (Expo updates config for iOS) (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).
|
|
152
|
+
*/
|
|
153
|
+
expoPlist?: Mod<Plist>;
|
|
154
|
+
/**
|
|
155
|
+
* Modify the `ios/<name>.xcodeproj` as an `XcodeProject` (parsed with [`xcode`](https://www.npmjs.com/package/xcode))
|
|
156
|
+
*/
|
|
157
|
+
xcodeproj?: Mod<XcodeProject>;
|
|
158
|
+
/**
|
|
159
|
+
* Modify the `ios/<name>/AppDelegate.m` as a string (dangerous)
|
|
160
|
+
*/
|
|
161
|
+
appDelegate?: Mod<AppDelegateProjectFile>;
|
|
162
|
+
/**
|
|
163
|
+
* Modify the `ios/Podfile.properties.json` as key-value pairs
|
|
164
|
+
*/
|
|
165
|
+
podfileProperties?: Mod<Record<string, string>>;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
export type ModPlatform = keyof ModConfig;
|
|
169
|
+
export { XcodeProject, InfoPlist, ExpoPlist, AndroidManifest };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AndroidManifest", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Manifest().AndroidManifest;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "ExpoPlist", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _IosConfig().ExpoPlist;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "InfoPlist", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _IosConfig().InfoPlist;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "XcodeProject", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _xcode().XcodeProject;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
function _xcode() {
|
|
31
|
+
const data = require("xcode");
|
|
32
|
+
_xcode = function () {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
function _Manifest() {
|
|
38
|
+
const data = require("./android/Manifest");
|
|
39
|
+
_Manifest = function () {
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
return data;
|
|
43
|
+
}
|
|
44
|
+
function _IosConfig() {
|
|
45
|
+
const data = require("./ios/IosConfig.types");
|
|
46
|
+
_IosConfig = function () {
|
|
47
|
+
return data;
|
|
48
|
+
};
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=Plugin.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.types.js","names":["_xcode","data","require","_Manifest","_IosConfig"],"sources":["../src/Plugin.types.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport { JSONObject } from '@expo/json-file';\nimport { XcodeProject } from 'xcode';\n\nimport { Properties } from './android';\nimport { AndroidManifest } from './android/Manifest';\nimport * as AndroidPaths from './android/Paths';\nimport { ResourceXML } from './android/Resources';\nimport { ExpoPlist, InfoPlist } from './ios/IosConfig.types';\nimport { AppDelegateProjectFile } from './ios/Paths';\n\ntype OptionalPromise<T> = Promise<T> | T;\n\ntype Plist = JSONObject;\n\nexport interface ModProps<T = any> {\n /**\n * Project root directory for the universal app.\n */\n readonly projectRoot: string;\n\n /**\n * Project root for the specific platform.\n */\n readonly platformProjectRoot: string;\n\n /**\n * Name of the mod.\n */\n readonly modName: string;\n\n /**\n * Name of the platform used in the mods config.\n */\n readonly platform: ModPlatform;\n\n /**\n * If the mod is being evaluated in introspection mode.\n * No file system modifications should be made when introspect is `true`.\n */\n readonly introspect: boolean;\n\n /**\n * [iOS]: The path component used for querying project files.\n *\n * @example projectRoot/ios/[projectName]/\n */\n readonly projectName?: string;\n\n /**\n * Ignore any of the user's local native files and solely rely on the generated files.\n * This makes prebuild data, like entitlements, more aligned to what users expects.\n * When enabling this, users must be informed and have a way to disable this exclusion.\n */\n readonly ignoreExistingNativeFiles?: boolean;\n\n nextMod?: Mod<T>;\n}\n\n// TODO: Migrate ProjectConfig to using expo instead if exp\nexport interface ExportedConfig extends ExpoConfig {\n mods?: ModConfig | null;\n}\n\nexport interface ExportedConfigWithProps<Data = any> extends ExportedConfig {\n /**\n * The Object representation of a complex file type.\n */\n modResults: Data;\n modRequest: ModProps<Data>;\n /**\n * A frozen representation of the original file contents,\n * this can be used as a reference into the user's original intent.\n *\n * For example, you could infer that the user defined a certain\n * value explicitly and disable any automatic changes.\n */\n readonly modRawConfig: ExpoConfig;\n}\n\n/**\n * A helper type to get the properties of a plugin.\n */\nexport type PluginParameters<T extends ConfigPlugin<any>> = T extends (\n config: any,\n props: infer P\n) => any\n ? P\n : never;\n\nexport type ConfigPlugin<Props = void> = (config: ExpoConfig, props: Props) => ExpoConfig;\n\nexport type StaticPlugin<T = any> = [string | ConfigPlugin<T>, T];\n\nexport type Mod<Props = any> = ((\n config: ExportedConfigWithProps<Props>\n) => OptionalPromise<ExportedConfigWithProps<Props>>) & {\n /**\n * Indicates that the mod provides data upstream to other mods.\n * This mod should always be the last one added.\n */\n isProvider?: boolean;\n /**\n * If the mod supports introspection, and avoids making any filesystem modifications during compilation.\n * By enabling, this mod, and all of its descendants will be run in introspection mode.\n * This should only be used for static files like JSON or XML, and not for application files that require regexes,\n * or complex static files that require other files to be generated like Xcode `.pbxproj`.\n */\n isIntrospective?: boolean;\n};\n\nexport interface ModConfig {\n android?: {\n /**\n * Dangerously make a modification before any other android mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Modify the `android/app/src/main/AndroidManifest.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n manifest?: Mod<AndroidManifest>;\n /**\n * Modify the `android/app/src/main/res/values/strings.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n strings?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colors?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values-night/colors.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n colorsNight?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/res/values/styles.xml` as JSON (parsed with [`xml2js`](https://www.npmjs.com/package/xml2js)).\n */\n styles?: Mod<ResourceXML>;\n /**\n * Modify the `android/app/src/main/<package>/MainActivity.java` as a string.\n */\n mainActivity?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/src/main/<package>/MainApplication.java` as a string.\n */\n mainApplication?: Mod<AndroidPaths.ApplicationProjectFile>;\n /**\n * Modify the `android/app/build.gradle` as a string.\n */\n appBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/build.gradle` as a string.\n */\n projectBuildGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/settings.gradle` as a string.\n */\n settingsGradle?: Mod<AndroidPaths.GradleProjectFile>;\n /**\n * Modify the `android/gradle.properties` as a `Properties.PropertiesItem[]`.\n */\n gradleProperties?: Mod<Properties.PropertiesItem[]>;\n };\n ios?: {\n /**\n * Dangerously make a modification before any other android mods have been run.\n */\n dangerous?: Mod<unknown>;\n /**\n * Modify the `ios/<name>/Info.plist` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n infoPlist?: Mod<InfoPlist>;\n /**\n * Modify the `ios/<name>/<product-name>.entitlements` as JSON (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n entitlements?: Mod<Plist>;\n /**\n * Modify the `ios/<name>/Expo.plist` as JSON (Expo updates config for iOS) (parsed with [`@expo/plist`](https://www.npmjs.com/package/@expo/plist)).\n */\n expoPlist?: Mod<Plist>;\n /**\n * Modify the `ios/<name>.xcodeproj` as an `XcodeProject` (parsed with [`xcode`](https://www.npmjs.com/package/xcode))\n */\n xcodeproj?: Mod<XcodeProject>;\n /**\n * Modify the `ios/<name>/AppDelegate.m` as a string (dangerous)\n */\n appDelegate?: Mod<AppDelegateProjectFile>;\n /**\n * Modify the `ios/Podfile.properties.json` as key-value pairs\n */\n podfileProperties?: Mod<Record<string, string>>;\n };\n}\n\nexport type ModPlatform = keyof ModConfig;\n\nexport { XcodeProject, InfoPlist, ExpoPlist, AndroidManifest };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAE,UAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import { AndroidManifest } from './Manifest';
|
|
3
|
+
export declare const withAllowBackup: import("..").ConfigPlugin;
|
|
4
|
+
export declare function getAllowBackup(config: Pick<ExpoConfig, 'android'>): boolean;
|
|
5
|
+
export declare function setAllowBackup(config: Pick<ExpoConfig, 'android'>, androidManifest: AndroidManifest): AndroidManifest;
|
|
6
|
+
export declare function getAllowBackupFromManifest(androidManifest: AndroidManifest): boolean | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAllowBackup = getAllowBackup;
|
|
7
|
+
exports.getAllowBackupFromManifest = getAllowBackupFromManifest;
|
|
8
|
+
exports.setAllowBackup = setAllowBackup;
|
|
9
|
+
exports.withAllowBackup = void 0;
|
|
10
|
+
function _Manifest() {
|
|
11
|
+
const data = require("./Manifest");
|
|
12
|
+
_Manifest = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
function _androidPlugins() {
|
|
18
|
+
const data = require("../plugins/android-plugins");
|
|
19
|
+
_androidPlugins = function () {
|
|
20
|
+
return data;
|
|
21
|
+
};
|
|
22
|
+
return data;
|
|
23
|
+
}
|
|
24
|
+
const withAllowBackup = (0, _androidPlugins().createAndroidManifestPlugin)(setAllowBackup, 'withAllowBackup');
|
|
25
|
+
exports.withAllowBackup = withAllowBackup;
|
|
26
|
+
function getAllowBackup(config) {
|
|
27
|
+
var _config$android$allow, _config$android;
|
|
28
|
+
// Defaults to true.
|
|
29
|
+
// https://docs.expo.dev/versions/latest/config/app/#allowbackup
|
|
30
|
+
return (_config$android$allow = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.allowBackup) !== null && _config$android$allow !== void 0 ? _config$android$allow : true;
|
|
31
|
+
}
|
|
32
|
+
function setAllowBackup(config, androidManifest) {
|
|
33
|
+
const allowBackup = getAllowBackup(config);
|
|
34
|
+
const mainApplication = (0, _Manifest().getMainApplication)(androidManifest);
|
|
35
|
+
if (mainApplication !== null && mainApplication !== void 0 && mainApplication.$) {
|
|
36
|
+
mainApplication.$['android:allowBackup'] = String(allowBackup);
|
|
37
|
+
}
|
|
38
|
+
return androidManifest;
|
|
39
|
+
}
|
|
40
|
+
function getAllowBackupFromManifest(androidManifest) {
|
|
41
|
+
const mainApplication = (0, _Manifest().getMainApplication)(androidManifest);
|
|
42
|
+
if (mainApplication !== null && mainApplication !== void 0 && mainApplication.$) {
|
|
43
|
+
return String(mainApplication.$['android:allowBackup']) === 'true';
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=AllowBackup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AllowBackup.js","names":["_Manifest","data","require","_androidPlugins","withAllowBackup","createAndroidManifestPlugin","setAllowBackup","exports","getAllowBackup","config","_config$android$allow","_config$android","android","allowBackup","androidManifest","mainApplication","getMainApplication","$","String","getAllowBackupFromManifest"],"sources":["../../src/android/AllowBackup.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { AndroidManifest, getMainApplication, StringBoolean } from './Manifest';\nimport { createAndroidManifestPlugin } from '../plugins/android-plugins';\n\nexport const withAllowBackup = createAndroidManifestPlugin(setAllowBackup, 'withAllowBackup');\n\nexport function getAllowBackup(config: Pick<ExpoConfig, 'android'>) {\n // Defaults to true.\n // https://docs.expo.dev/versions/latest/config/app/#allowbackup\n return config.android?.allowBackup ?? true;\n}\n\nexport function setAllowBackup(\n config: Pick<ExpoConfig, 'android'>,\n androidManifest: AndroidManifest\n) {\n const allowBackup = getAllowBackup(config);\n\n const mainApplication = getMainApplication(androidManifest);\n if (mainApplication?.$) {\n mainApplication.$['android:allowBackup'] = String(allowBackup) as StringBoolean;\n }\n\n return androidManifest;\n}\n\nexport function getAllowBackupFromManifest(androidManifest: AndroidManifest): boolean | null {\n const mainApplication = getMainApplication(androidManifest);\n\n if (mainApplication?.$) {\n return String(mainApplication.$['android:allowBackup']) === 'true';\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAMG,eAAe,GAAG,IAAAC,6CAA2B,EAACC,cAAc,EAAE,iBAAiB,CAAC;AAACC,OAAA,CAAAH,eAAA,GAAAA,eAAA;AAEvF,SAASI,cAAcA,CAACC,MAAmC,EAAE;EAAA,IAAAC,qBAAA,EAAAC,eAAA;EAClE;EACA;EACA,QAAAD,qBAAA,IAAAC,eAAA,GAAOF,MAAM,CAACG,OAAO,cAAAD,eAAA,uBAAdA,eAAA,CAAgBE,WAAW,cAAAH,qBAAA,cAAAA,qBAAA,GAAI,IAAI;AAC5C;AAEO,SAASJ,cAAcA,CAC5BG,MAAmC,EACnCK,eAAgC,EAChC;EACA,MAAMD,WAAW,GAAGL,cAAc,CAACC,MAAM,CAAC;EAE1C,MAAMM,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAC3D,IAAIC,eAAe,aAAfA,eAAe,eAAfA,eAAe,CAAEE,CAAC,EAAE;IACtBF,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,GAAGC,MAAM,CAACL,WAAW,CAAkB;EACjF;EAEA,OAAOC,eAAe;AACxB;AAEO,SAASK,0BAA0BA,CAACL,eAAgC,EAAkB;EAC3F,MAAMC,eAAe,GAAG,IAAAC,8BAAkB,EAACF,eAAe,CAAC;EAE3D,IAAIC,eAAe,aAAfA,eAAe,eAAfA,eAAe,CAAEE,CAAC,EAAE;IACtB,OAAOC,MAAM,CAACH,eAAe,CAACE,CAAC,CAAC,qBAAqB,CAAC,CAAC,KAAK,MAAM;EACpE;EAEA,OAAO,IAAI;AACb"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import type { PropertiesItem } from './Properties';
|
|
3
|
+
import type { ConfigPlugin } from '../Plugin.types';
|
|
4
|
+
import { BuildPropertiesConfig, ConfigToPropertyRuleType } from '../utils/BuildProperties.types';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.
|
|
7
|
+
*
|
|
8
|
+
* The factory supports two modes from generic type inference
|
|
9
|
+
* ```ts
|
|
10
|
+
* // config-plugin without `props`, it will implicitly use the expo config as source config.
|
|
11
|
+
* createBuildGradlePropsConfigPlugin<ExpoConfig>(): ConfigPlugin<void>;
|
|
12
|
+
*
|
|
13
|
+
* // config-plugin with a parameter `props: CustomType`, it will use the `props` as source config.
|
|
14
|
+
* createBuildGradlePropsConfigPlugin<CustomType>(): ConfigPlugin<CustomType>;
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param configToPropertyRules config to property mapping rules
|
|
18
|
+
* @param name the config plugin name
|
|
19
|
+
*/
|
|
20
|
+
export declare function createBuildGradlePropsConfigPlugin<SourceConfigType extends BuildPropertiesConfig>(configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[], name?: string): ConfigPlugin<SourceConfigType extends ExpoConfig ? void : SourceConfigType>;
|
|
21
|
+
/**
|
|
22
|
+
* A config-plugin to update `android/gradle.properties` from the `jsEngine` in expo config
|
|
23
|
+
*/
|
|
24
|
+
export declare const withJsEngineGradleProps: ConfigPlugin<void>;
|
|
25
|
+
export declare function updateAndroidBuildPropertiesFromConfig<SourceConfigType extends BuildPropertiesConfig>(config: SourceConfigType, gradleProperties: PropertiesItem[], configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[]): PropertiesItem[];
|
|
26
|
+
export declare function updateAndroidBuildProperty(gradleProperties: PropertiesItem[], name: string, value: string | null | undefined, options?: {
|
|
27
|
+
removePropWhenValueIsNull?: boolean;
|
|
28
|
+
}): PropertiesItem[];
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBuildGradlePropsConfigPlugin = createBuildGradlePropsConfigPlugin;
|
|
7
|
+
exports.updateAndroidBuildPropertiesFromConfig = updateAndroidBuildPropertiesFromConfig;
|
|
8
|
+
exports.updateAndroidBuildProperty = updateAndroidBuildProperty;
|
|
9
|
+
exports.withJsEngineGradleProps = void 0;
|
|
10
|
+
function _androidPlugins() {
|
|
11
|
+
const data = require("../plugins/android-plugins");
|
|
12
|
+
_androidPlugins = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.
|
|
19
|
+
*
|
|
20
|
+
* The factory supports two modes from generic type inference
|
|
21
|
+
* ```ts
|
|
22
|
+
* // config-plugin without `props`, it will implicitly use the expo config as source config.
|
|
23
|
+
* createBuildGradlePropsConfigPlugin<ExpoConfig>(): ConfigPlugin<void>;
|
|
24
|
+
*
|
|
25
|
+
* // config-plugin with a parameter `props: CustomType`, it will use the `props` as source config.
|
|
26
|
+
* createBuildGradlePropsConfigPlugin<CustomType>(): ConfigPlugin<CustomType>;
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param configToPropertyRules config to property mapping rules
|
|
30
|
+
* @param name the config plugin name
|
|
31
|
+
*/
|
|
32
|
+
function createBuildGradlePropsConfigPlugin(configToPropertyRules, name) {
|
|
33
|
+
const withUnknown = (config, sourceConfig) => (0, _androidPlugins().withGradleProperties)(config, config => {
|
|
34
|
+
config.modResults = updateAndroidBuildPropertiesFromConfig(sourceConfig !== null && sourceConfig !== void 0 ? sourceConfig : config, config.modResults, configToPropertyRules);
|
|
35
|
+
return config;
|
|
36
|
+
});
|
|
37
|
+
if (name) {
|
|
38
|
+
Object.defineProperty(withUnknown, 'name', {
|
|
39
|
+
value: name
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return withUnknown;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A config-plugin to update `android/gradle.properties` from the `jsEngine` in expo config
|
|
47
|
+
*/
|
|
48
|
+
const withJsEngineGradleProps = createBuildGradlePropsConfigPlugin([{
|
|
49
|
+
propName: 'hermesEnabled',
|
|
50
|
+
propValueGetter: config => {
|
|
51
|
+
var _ref, _config$android$jsEng, _config$android;
|
|
52
|
+
return (((_ref = (_config$android$jsEng = (_config$android = config.android) === null || _config$android === void 0 ? void 0 : _config$android.jsEngine) !== null && _config$android$jsEng !== void 0 ? _config$android$jsEng : config.jsEngine) !== null && _ref !== void 0 ? _ref : 'hermes') === 'hermes').toString();
|
|
53
|
+
}
|
|
54
|
+
}], 'withJsEngineGradleProps');
|
|
55
|
+
exports.withJsEngineGradleProps = withJsEngineGradleProps;
|
|
56
|
+
function updateAndroidBuildPropertiesFromConfig(config, gradleProperties, configToPropertyRules) {
|
|
57
|
+
for (const configToProperty of configToPropertyRules) {
|
|
58
|
+
const value = configToProperty.propValueGetter(config);
|
|
59
|
+
updateAndroidBuildProperty(gradleProperties, configToProperty.propName, value);
|
|
60
|
+
}
|
|
61
|
+
return gradleProperties;
|
|
62
|
+
}
|
|
63
|
+
function updateAndroidBuildProperty(gradleProperties, name, value, options) {
|
|
64
|
+
const oldPropIndex = gradleProperties.findIndex(prop => prop.type === 'property' && prop.key === name);
|
|
65
|
+
if (value) {
|
|
66
|
+
// found the matched value, add or merge new property
|
|
67
|
+
const newProp = {
|
|
68
|
+
type: 'property',
|
|
69
|
+
key: name,
|
|
70
|
+
value
|
|
71
|
+
};
|
|
72
|
+
if (oldPropIndex >= 0) {
|
|
73
|
+
gradleProperties[oldPropIndex] = newProp;
|
|
74
|
+
} else {
|
|
75
|
+
gradleProperties.push(newProp);
|
|
76
|
+
}
|
|
77
|
+
} else if (options !== null && options !== void 0 && options.removePropWhenValueIsNull && oldPropIndex >= 0) {
|
|
78
|
+
gradleProperties.splice(oldPropIndex, 1);
|
|
79
|
+
}
|
|
80
|
+
return gradleProperties;
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=BuildProperties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildProperties.js","names":["_androidPlugins","data","require","createBuildGradlePropsConfigPlugin","configToPropertyRules","name","withUnknown","config","sourceConfig","withGradleProperties","modResults","updateAndroidBuildPropertiesFromConfig","Object","defineProperty","value","withJsEngineGradleProps","propName","propValueGetter","_ref","_config$android$jsEng","_config$android","android","jsEngine","toString","exports","gradleProperties","configToProperty","updateAndroidBuildProperty","options","oldPropIndex","findIndex","prop","type","key","newProp","push","removePropWhenValueIsNull","splice"],"sources":["../../src/android/BuildProperties.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config-types';\n\nimport type { PropertiesItem } from './Properties';\nimport type { ConfigPlugin } from '../Plugin.types';\nimport { withGradleProperties } from '../plugins/android-plugins';\nimport { BuildPropertiesConfig, ConfigToPropertyRuleType } from '../utils/BuildProperties.types';\n\n/**\n * Creates a `withGradleProperties` config-plugin based on given config to property mapping rules.\n *\n * The factory supports two modes from generic type inference\n * ```ts\n * // config-plugin without `props`, it will implicitly use the expo config as source config.\n * createBuildGradlePropsConfigPlugin<ExpoConfig>(): ConfigPlugin<void>;\n *\n * // config-plugin with a parameter `props: CustomType`, it will use the `props` as source config.\n * createBuildGradlePropsConfigPlugin<CustomType>(): ConfigPlugin<CustomType>;\n * ```\n *\n * @param configToPropertyRules config to property mapping rules\n * @param name the config plugin name\n */\nexport function createBuildGradlePropsConfigPlugin<SourceConfigType extends BuildPropertiesConfig>(\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[],\n name?: string\n) {\n const withUnknown: ConfigPlugin<SourceConfigType extends ExpoConfig ? void : SourceConfigType> = (\n config,\n sourceConfig\n ) =>\n withGradleProperties(config, (config) => {\n config.modResults = updateAndroidBuildPropertiesFromConfig(\n (sourceConfig ?? config) as SourceConfigType,\n config.modResults,\n configToPropertyRules\n );\n return config;\n });\n if (name) {\n Object.defineProperty(withUnknown, 'name', {\n value: name,\n });\n }\n return withUnknown;\n}\n\n/**\n * A config-plugin to update `android/gradle.properties` from the `jsEngine` in expo config\n */\nexport const withJsEngineGradleProps = createBuildGradlePropsConfigPlugin<ExpoConfig>(\n [\n {\n propName: 'hermesEnabled',\n propValueGetter: (config) =>\n ((config.android?.jsEngine ?? config.jsEngine ?? 'hermes') === 'hermes').toString(),\n },\n ],\n 'withJsEngineGradleProps'\n);\n\nexport function updateAndroidBuildPropertiesFromConfig<\n SourceConfigType extends BuildPropertiesConfig,\n>(\n config: SourceConfigType,\n gradleProperties: PropertiesItem[],\n configToPropertyRules: ConfigToPropertyRuleType<SourceConfigType>[]\n) {\n for (const configToProperty of configToPropertyRules) {\n const value = configToProperty.propValueGetter(config);\n updateAndroidBuildProperty(gradleProperties, configToProperty.propName, value);\n }\n\n return gradleProperties;\n}\n\nexport function updateAndroidBuildProperty(\n gradleProperties: PropertiesItem[],\n name: string,\n value: string | null | undefined,\n options?: { removePropWhenValueIsNull?: boolean }\n) {\n const oldPropIndex = gradleProperties.findIndex(\n (prop) => prop.type === 'property' && prop.key === name\n );\n\n if (value) {\n // found the matched value, add or merge new property\n const newProp: PropertiesItem = {\n type: 'property',\n key: name,\n value,\n };\n\n if (oldPropIndex >= 0) {\n gradleProperties[oldPropIndex] = newProp;\n } else {\n gradleProperties.push(newProp);\n }\n } else if (options?.removePropWhenValueIsNull && oldPropIndex >= 0) {\n gradleProperties.splice(oldPropIndex, 1);\n }\n\n return gradleProperties;\n}\n"],"mappings":";;;;;;;;;AAIA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,kCAAkCA,CAChDC,qBAAmE,EACnEC,IAAa,EACb;EACA,MAAMC,WAAwF,GAAGA,CAC/FC,MAAM,EACNC,YAAY,KAEZ,IAAAC,sCAAoB,EAACF,MAAM,EAAGA,MAAM,IAAK;IACvCA,MAAM,CAACG,UAAU,GAAGC,sCAAsC,CACvDH,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAID,MAAM,EACvBA,MAAM,CAACG,UAAU,EACjBN,qBAAqB,CACtB;IACD,OAAOG,MAAM;EACf,CAAC,CAAC;EACJ,IAAIF,IAAI,EAAE;IACRO,MAAM,CAACC,cAAc,CAACP,WAAW,EAAE,MAAM,EAAE;MACzCQ,KAAK,EAAET;IACT,CAAC,CAAC;EACJ;EACA,OAAOC,WAAW;AACpB;;AAEA;AACA;AACA;AACO,MAAMS,uBAAuB,GAAGZ,kCAAkC,CACvE,CACE;EACEa,QAAQ,EAAE,eAAe;EACzBC,eAAe,EAAGV,MAAM;IAAA,IAAAW,IAAA,EAAAC,qBAAA,EAAAC,eAAA;IAAA,OACtB,CAAC,EAAAF,IAAA,IAAAC,qBAAA,IAAAC,eAAA,GAACb,MAAM,CAACc,OAAO,cAAAD,eAAA,uBAAdA,eAAA,CAAgBE,QAAQ,cAAAH,qBAAA,cAAAA,qBAAA,GAAIZ,MAAM,CAACe,QAAQ,cAAAJ,IAAA,cAAAA,IAAA,GAAI,QAAQ,MAAM,QAAQ,EAAEK,QAAQ,EAAE;EAAA;AACvF,CAAC,CACF,EACD,yBAAyB,CAC1B;AAACC,OAAA,CAAAT,uBAAA,GAAAA,uBAAA;AAEK,SAASJ,sCAAsCA,CAGpDJ,MAAwB,EACxBkB,gBAAkC,EAClCrB,qBAAmE,EACnE;EACA,KAAK,MAAMsB,gBAAgB,IAAItB,qBAAqB,EAAE;IACpD,MAAMU,KAAK,GAAGY,gBAAgB,CAACT,eAAe,CAACV,MAAM,CAAC;IACtDoB,0BAA0B,CAACF,gBAAgB,EAAEC,gBAAgB,CAACV,QAAQ,EAAEF,KAAK,CAAC;EAChF;EAEA,OAAOW,gBAAgB;AACzB;AAEO,SAASE,0BAA0BA,CACxCF,gBAAkC,EAClCpB,IAAY,EACZS,KAAgC,EAChCc,OAAiD,EACjD;EACA,MAAMC,YAAY,GAAGJ,gBAAgB,CAACK,SAAS,CAC5CC,IAAI,IAAKA,IAAI,CAACC,IAAI,KAAK,UAAU,IAAID,IAAI,CAACE,GAAG,KAAK5B,IAAI,CACxD;EAED,IAAIS,KAAK,EAAE;IACT;IACA,MAAMoB,OAAuB,GAAG;MAC9BF,IAAI,EAAE,UAAU;MAChBC,GAAG,EAAE5B,IAAI;MACTS;IACF,CAAC;IAED,IAAIe,YAAY,IAAI,CAAC,EAAE;MACrBJ,gBAAgB,CAACI,YAAY,CAAC,GAAGK,OAAO;IAC1C,CAAC,MAAM;MACLT,gBAAgB,CAACU,IAAI,CAACD,OAAO,CAAC;IAChC;EACF,CAAC,MAAM,IAAIN,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEQ,yBAAyB,IAAIP,YAAY,IAAI,CAAC,EAAE;IAClEJ,gBAAgB,CAACY,MAAM,CAACR,YAAY,EAAE,CAAC,CAAC;EAC1C;EAEA,OAAOJ,gBAAgB;AACzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ResourceItemXML, ResourceKind, ResourceXML } from './Resources';
|
|
2
|
+
export declare function getProjectColorsXMLPathAsync(projectRoot: string, { kind }?: {
|
|
3
|
+
kind?: ResourceKind;
|
|
4
|
+
}): Promise<string>;
|
|
5
|
+
export declare function setColorItem(itemToAdd: ResourceItemXML, colorFileContentsJSON: ResourceXML): ResourceXML;
|
|
6
|
+
export declare function removeColorItem(named: string, contents: ResourceXML): ResourceXML;
|
|
7
|
+
/**
|
|
8
|
+
* Set or remove value in XML based on nullish factor of the `value` property.
|
|
9
|
+
*/
|
|
10
|
+
export declare function assignColorValue(xml: ResourceXML, { value, name, }: {
|
|
11
|
+
value?: string | null;
|
|
12
|
+
name: string;
|
|
13
|
+
}): ResourceXML;
|
|
14
|
+
/**
|
|
15
|
+
* Helper to convert a basic XML object into a simple k/v pair.
|
|
16
|
+
* `colors.xml` is a very basic XML file so this is pretty safe to do.
|
|
17
|
+
* Added for testing purposes.
|
|
18
|
+
*
|
|
19
|
+
* @param xml
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function getColorsAsObject(xml: ResourceXML): Record<string, string> | null;
|
|
23
|
+
/**
|
|
24
|
+
* Helper to convert a basic k/v object to a colors XML object.
|
|
25
|
+
*
|
|
26
|
+
* @param xml
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
export declare function getObjectAsColorsXml(obj: Record<string, string>): ResourceXML;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.assignColorValue = assignColorValue;
|
|
7
|
+
exports.getColorsAsObject = getColorsAsObject;
|
|
8
|
+
exports.getObjectAsColorsXml = getObjectAsColorsXml;
|
|
9
|
+
exports.getProjectColorsXMLPathAsync = getProjectColorsXMLPathAsync;
|
|
10
|
+
exports.removeColorItem = removeColorItem;
|
|
11
|
+
exports.setColorItem = setColorItem;
|
|
12
|
+
function _Paths() {
|
|
13
|
+
const data = require("./Paths");
|
|
14
|
+
_Paths = function () {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
function _Resources() {
|
|
20
|
+
const data = require("./Resources");
|
|
21
|
+
_Resources = function () {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
24
|
+
return data;
|
|
25
|
+
}
|
|
26
|
+
function getProjectColorsXMLPathAsync(projectRoot, {
|
|
27
|
+
kind
|
|
28
|
+
} = {}) {
|
|
29
|
+
return (0, _Paths().getResourceXMLPathAsync)(projectRoot, {
|
|
30
|
+
kind,
|
|
31
|
+
name: 'colors'
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function setColorItem(itemToAdd, colorFileContentsJSON) {
|
|
35
|
+
var _colorFileContentsJSO;
|
|
36
|
+
if ((_colorFileContentsJSO = colorFileContentsJSON.resources) !== null && _colorFileContentsJSO !== void 0 && _colorFileContentsJSO.color) {
|
|
37
|
+
const colorNameExists = colorFileContentsJSON.resources.color.filter(e => e.$.name === itemToAdd.$.name)[0];
|
|
38
|
+
if (colorNameExists) {
|
|
39
|
+
colorNameExists._ = itemToAdd._;
|
|
40
|
+
} else {
|
|
41
|
+
colorFileContentsJSON.resources.color.push(itemToAdd);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
if (!colorFileContentsJSON.resources || typeof colorFileContentsJSON.resources === 'string') {
|
|
45
|
+
//file was empty and JSON is `{resources : ''}`
|
|
46
|
+
colorFileContentsJSON.resources = {};
|
|
47
|
+
}
|
|
48
|
+
colorFileContentsJSON.resources.color = [itemToAdd];
|
|
49
|
+
}
|
|
50
|
+
return colorFileContentsJSON;
|
|
51
|
+
}
|
|
52
|
+
function removeColorItem(named, contents) {
|
|
53
|
+
var _contents$resources;
|
|
54
|
+
if ((_contents$resources = contents.resources) !== null && _contents$resources !== void 0 && _contents$resources.color) {
|
|
55
|
+
const index = contents.resources.color.findIndex(e => e.$.name === named);
|
|
56
|
+
if (index > -1) {
|
|
57
|
+
// replace the previous value
|
|
58
|
+
contents.resources.color.splice(index, 1);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return contents;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Set or remove value in XML based on nullish factor of the `value` property.
|
|
66
|
+
*/
|
|
67
|
+
function assignColorValue(xml, {
|
|
68
|
+
value,
|
|
69
|
+
name
|
|
70
|
+
}) {
|
|
71
|
+
if (value) {
|
|
72
|
+
return setColorItem((0, _Resources().buildResourceItem)({
|
|
73
|
+
name,
|
|
74
|
+
value
|
|
75
|
+
}), xml);
|
|
76
|
+
}
|
|
77
|
+
return removeColorItem(name, xml);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Helper to convert a basic XML object into a simple k/v pair.
|
|
82
|
+
* `colors.xml` is a very basic XML file so this is pretty safe to do.
|
|
83
|
+
* Added for testing purposes.
|
|
84
|
+
*
|
|
85
|
+
* @param xml
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
88
|
+
function getColorsAsObject(xml) {
|
|
89
|
+
var _xml$resources;
|
|
90
|
+
if (!(xml !== null && xml !== void 0 && (_xml$resources = xml.resources) !== null && _xml$resources !== void 0 && _xml$resources.color)) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
return (0, _Resources().getResourceItemsAsObject)(xml.resources.color);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Helper to convert a basic k/v object to a colors XML object.
|
|
98
|
+
*
|
|
99
|
+
* @param xml
|
|
100
|
+
* @returns
|
|
101
|
+
*/
|
|
102
|
+
function getObjectAsColorsXml(obj) {
|
|
103
|
+
return {
|
|
104
|
+
resources: {
|
|
105
|
+
color: (0, _Resources().getObjectAsResourceItems)(obj)
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=Colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Colors.js","names":["_Paths","data","require","_Resources","getProjectColorsXMLPathAsync","projectRoot","kind","getResourceXMLPathAsync","name","setColorItem","itemToAdd","colorFileContentsJSON","_colorFileContentsJSO","resources","color","colorNameExists","filter","e","$","_","push","removeColorItem","named","contents","_contents$resources","index","findIndex","splice","assignColorValue","xml","value","buildResourceItem","getColorsAsObject","_xml$resources","getResourceItemsAsObject","getObjectAsColorsXml","obj","getObjectAsResourceItems"],"sources":["../../src/android/Colors.ts"],"sourcesContent":["import { getResourceXMLPathAsync } from './Paths';\nimport {\n buildResourceItem,\n getObjectAsResourceItems,\n getResourceItemsAsObject,\n ResourceItemXML,\n ResourceKind,\n ResourceXML,\n} from './Resources';\n\nexport function getProjectColorsXMLPathAsync(\n projectRoot: string,\n { kind }: { kind?: ResourceKind } = {}\n) {\n return getResourceXMLPathAsync(projectRoot, { kind, name: 'colors' });\n}\n\nexport function setColorItem(itemToAdd: ResourceItemXML, colorFileContentsJSON: ResourceXML) {\n if (colorFileContentsJSON.resources?.color) {\n const colorNameExists = colorFileContentsJSON.resources.color.filter(\n (e: ResourceItemXML) => e.$.name === itemToAdd.$.name\n )[0];\n if (colorNameExists) {\n colorNameExists._ = itemToAdd._;\n } else {\n colorFileContentsJSON.resources.color.push(itemToAdd);\n }\n } else {\n if (!colorFileContentsJSON.resources || typeof colorFileContentsJSON.resources === 'string') {\n //file was empty and JSON is `{resources : ''}`\n colorFileContentsJSON.resources = {};\n }\n colorFileContentsJSON.resources.color = [itemToAdd];\n }\n return colorFileContentsJSON;\n}\n\nexport function removeColorItem(named: string, contents: ResourceXML) {\n if (contents.resources?.color) {\n const index = contents.resources.color.findIndex((e: ResourceItemXML) => e.$.name === named);\n if (index > -1) {\n // replace the previous value\n contents.resources.color.splice(index, 1);\n }\n }\n return contents;\n}\n\n/**\n * Set or remove value in XML based on nullish factor of the `value` property.\n */\nexport function assignColorValue(\n xml: ResourceXML,\n {\n value,\n name,\n }: {\n value?: string | null;\n name: string;\n }\n) {\n if (value) {\n return setColorItem(\n buildResourceItem({\n name,\n value,\n }),\n xml\n );\n }\n\n return removeColorItem(name, xml);\n}\n\n/**\n * Helper to convert a basic XML object into a simple k/v pair.\n * `colors.xml` is a very basic XML file so this is pretty safe to do.\n * Added for testing purposes.\n *\n * @param xml\n * @returns\n */\nexport function getColorsAsObject(xml: ResourceXML): Record<string, string> | null {\n if (!xml?.resources?.color) {\n return null;\n }\n\n return getResourceItemsAsObject(xml.resources.color);\n}\n\n/**\n * Helper to convert a basic k/v object to a colors XML object.\n *\n * @param xml\n * @returns\n */\nexport function getObjectAsColorsXml(obj: Record<string, string>): ResourceXML {\n return {\n resources: {\n color: getObjectAsResourceItems(obj),\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASO,SAASG,4BAA4BA,CAC1CC,WAAmB,EACnB;EAAEC;AAA8B,CAAC,GAAG,CAAC,CAAC,EACtC;EACA,OAAO,IAAAC,gCAAuB,EAACF,WAAW,EAAE;IAAEC,IAAI;IAAEE,IAAI,EAAE;EAAS,CAAC,CAAC;AACvE;AAEO,SAASC,YAAYA,CAACC,SAA0B,EAAEC,qBAAkC,EAAE;EAAA,IAAAC,qBAAA;EAC3F,KAAAA,qBAAA,GAAID,qBAAqB,CAACE,SAAS,cAAAD,qBAAA,eAA/BA,qBAAA,CAAiCE,KAAK,EAAE;IAC1C,MAAMC,eAAe,GAAGJ,qBAAqB,CAACE,SAAS,CAACC,KAAK,CAACE,MAAM,CACjEC,CAAkB,IAAKA,CAAC,CAACC,CAAC,CAACV,IAAI,KAAKE,SAAS,CAACQ,CAAC,CAACV,IAAI,CACtD,CAAC,CAAC,CAAC;IACJ,IAAIO,eAAe,EAAE;MACnBA,eAAe,CAACI,CAAC,GAAGT,SAAS,CAACS,CAAC;IACjC,CAAC,MAAM;MACLR,qBAAqB,CAACE,SAAS,CAACC,KAAK,CAACM,IAAI,CAACV,SAAS,CAAC;IACvD;EACF,CAAC,MAAM;IACL,IAAI,CAACC,qBAAqB,CAACE,SAAS,IAAI,OAAOF,qBAAqB,CAACE,SAAS,KAAK,QAAQ,EAAE;MAC3F;MACAF,qBAAqB,CAACE,SAAS,GAAG,CAAC,CAAC;IACtC;IACAF,qBAAqB,CAACE,SAAS,CAACC,KAAK,GAAG,CAACJ,SAAS,CAAC;EACrD;EACA,OAAOC,qBAAqB;AAC9B;AAEO,SAASU,eAAeA,CAACC,KAAa,EAAEC,QAAqB,EAAE;EAAA,IAAAC,mBAAA;EACpE,KAAAA,mBAAA,GAAID,QAAQ,CAACV,SAAS,cAAAW,mBAAA,eAAlBA,mBAAA,CAAoBV,KAAK,EAAE;IAC7B,MAAMW,KAAK,GAAGF,QAAQ,CAACV,SAAS,CAACC,KAAK,CAACY,SAAS,CAAET,CAAkB,IAAKA,CAAC,CAACC,CAAC,CAACV,IAAI,KAAKc,KAAK,CAAC;IAC5F,IAAIG,KAAK,GAAG,CAAC,CAAC,EAAE;MACd;MACAF,QAAQ,CAACV,SAAS,CAACC,KAAK,CAACa,MAAM,CAACF,KAAK,EAAE,CAAC,CAAC;IAC3C;EACF;EACA,OAAOF,QAAQ;AACjB;;AAEA;AACA;AACA;AACO,SAASK,gBAAgBA,CAC9BC,GAAgB,EAChB;EACEC,KAAK;EACLtB;AAIF,CAAC,EACD;EACA,IAAIsB,KAAK,EAAE;IACT,OAAOrB,YAAY,CACjB,IAAAsB,8BAAiB,EAAC;MAChBvB,IAAI;MACJsB;IACF,CAAC,CAAC,EACFD,GAAG,CACJ;EACH;EAEA,OAAOR,eAAe,CAACb,IAAI,EAAEqB,GAAG,CAAC;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAACH,GAAgB,EAAiC;EAAA,IAAAI,cAAA;EACjF,IAAI,EAACJ,GAAG,aAAHA,GAAG,gBAAAI,cAAA,GAAHJ,GAAG,CAAEhB,SAAS,cAAAoB,cAAA,eAAdA,cAAA,CAAgBnB,KAAK,GAAE;IAC1B,OAAO,IAAI;EACb;EAEA,OAAO,IAAAoB,qCAAwB,EAACL,GAAG,CAAChB,SAAS,CAACC,KAAK,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,SAASqB,oBAAoBA,CAACC,GAA2B,EAAe;EAC7E,OAAO;IACLvB,SAAS,EAAE;MACTC,KAAK,EAAE,IAAAuB,qCAAwB,EAACD,GAAG;IACrC;EACF,CAAC;AACH"}
|