@atonemi/expo-android-splits-plugin 0.0.0-stage → 0.1.1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yapeng322
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.
package/app.plugin.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("./build/withAndroidSplits");
@@ -0,0 +1,3 @@
1
+ import type { PluginOptions as Props } from "./withAndroidSplits";
2
+ declare const _default: (props?: Props) => [string, Props];
3
+ export default _default;
package/build/index.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = (props = {}) => ["expo-android-splits", props];
@@ -0,0 +1,6 @@
1
+ import type { ConfigPlugin } from "expo/config-plugins";
2
+ export interface PluginOptions {
3
+ buildArchs?: string[];
4
+ }
5
+ declare const withAndroidSplits: ConfigPlugin<PluginOptions>;
6
+ export default withAndroidSplits;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("expo/config-plugins");
4
+ const withAndroidSplits = (config, { buildArchs }) => {
5
+ return (0, config_plugins_1.withAppBuildGradle)(config, (config) => {
6
+ const buildGradle = config.modResults.contents;
7
+ const includes = buildArchs && buildArchs.length > 0
8
+ ? buildArchs
9
+ : ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
10
+ const splitsConfig = `
11
+ splits {
12
+ abi {
13
+ enable true
14
+ reset()
15
+ include ${includes.map((abi) => `"${abi}"`).join(", ")}
16
+ universalApk false
17
+ }
18
+ }
19
+ `;
20
+ if (!buildGradle.includes("splits {")) {
21
+ config.modResults.contents = buildGradle.replace(/android\s*{/, `android {\n${splitsConfig}`);
22
+ }
23
+ return config;
24
+ });
25
+ };
26
+ exports.default = withAndroidSplits;
package/package.json CHANGED
@@ -1,6 +1,49 @@
1
1
  {
2
2
  "name": "@atonemi/expo-android-splits-plugin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "",
5
+ "keywords": [
6
+ "android",
7
+ "android-splits",
8
+ "expo",
9
+ "react-native"
10
+ ],
11
+ "homepage": "https://github.com/atonemi/expo-plugins/tree/main/packages/expo-android-splits",
12
+ "bugs": {
13
+ "url": "https://github.com/atonemi/expo-plugins"
14
+ },
15
+ "license": "MIT",
16
+ "author": "https://github.com/atonemi",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/atonemi/expo-plugins.git",
20
+ "directory": "packages/expo-android-splits"
21
+ },
22
+ "main": "build/withAndroidSplits.js",
23
+ "types": "build/withAndroidSplits.d.ts",
24
+ "exports": {
25
+ ".": {
26
+ "expo-source": "./src/withAndroidSplits.ts",
27
+ "default": "./build/withAndroidSplits.js"
28
+ },
29
+ "./plugin": {
30
+ "expo-source": "./src/index.ts",
31
+ "default": "./build/index.js"
32
+ },
33
+ "./app.plugin.js": "./app.plugin.js",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "peerDependencies": {
37
+ "expo": ">=54"
38
+ },
39
+ "peerDependenciesMeta": {
40
+ "expo": {
41
+ "optional": true
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "expo-module build",
46
+ "clean": "expo-module clean",
47
+ "typecheck": "tsc -p tsconfig.json"
48
+ }
6
49
  }
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { PluginOptions as Props } from "./withAndroidSplits";
2
+
3
+ export default (props: Props = {}): [string, Props] => ["expo-android-splits", props];
@@ -0,0 +1,35 @@
1
+ import { withAppBuildGradle } from "expo/config-plugins";
2
+ import type { ConfigPlugin } from "expo/config-plugins";
3
+
4
+ export interface PluginOptions {
5
+ buildArchs?: string[];
6
+ }
7
+
8
+ const withAndroidSplits: ConfigPlugin<PluginOptions> = (config, { buildArchs }) => {
9
+ return withAppBuildGradle(config, (config) => {
10
+ const buildGradle = config.modResults.contents;
11
+ const includes =
12
+ buildArchs && buildArchs.length > 0
13
+ ? buildArchs
14
+ : ["armeabi-v7a", "arm64-v8a", "x86", "x86_64"];
15
+
16
+ const splitsConfig = `
17
+ splits {
18
+ abi {
19
+ enable true
20
+ reset()
21
+ include ${includes.map((abi) => `"${abi}"`).join(", ")}
22
+ universalApk false
23
+ }
24
+ }
25
+ `;
26
+
27
+ if (!buildGradle.includes("splits {")) {
28
+ config.modResults.contents = buildGradle.replace(/android\s*{/, `android {\n${splitsConfig}`);
29
+ }
30
+
31
+ return config;
32
+ });
33
+ };
34
+
35
+ export default withAndroidSplits;
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "expo-module-scripts/tsconfig.plugin",
3
+ "compilerOptions": {
4
+ "outDir": "./build",
5
+ "rootDir": "./src",
6
+ "types": ["node"]
7
+ },
8
+ "include": ["./src"]
9
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.