@forthtilliath/expo-config-plugins 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Forthtilliath
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/README.md CHANGED
@@ -1,3 +1,82 @@
1
- # Temporary Holding Version
1
+ # @forthtilliath/expo-config-plugins
2
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.
3
+ Expo config plugins for sideloaded Android apps (APKs shared directly, not through a store).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install --save-dev @forthtilliath/expo-config-plugins
9
+ ```
10
+
11
+ `expo` is a peer dependency. Then list the plugins in `app.json`, and run `npx expo prebuild` again.
12
+
13
+ ```json
14
+ {
15
+ "expo": {
16
+ "plugins": [
17
+ [
18
+ "@forthtilliath/expo-config-plugins/withReleaseSigning",
19
+ { "propertyPrefix": "MYAPP" }
20
+ ],
21
+ "@forthtilliath/expo-config-plugins/withAndroidAbis",
22
+ "@forthtilliath/expo-config-plugins/withShortCxxPath",
23
+ "@forthtilliath/expo-config-plugins/withKotlinJvmTarget"
24
+ ]
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## `withReleaseSigning` — sign releases with your own key
30
+
31
+ Out of the box, an Expo release APK is signed with React Native's `debug.keystore` — **the same public key in every React Native project**: anyone could sign an APK that Android accepts as an update of yours. This plugin makes the release build use your upload key instead, read from Gradle properties that stay out of the repository:
32
+
33
+ ```properties
34
+ # ~/.gradle/gradle.properties (or ORG_GRADLE_PROJECT_MYAPP_UPLOAD_* variables)
35
+ MYAPP_UPLOAD_STORE_FILE=C:/keys/myapp-upload.jks
36
+ MYAPP_UPLOAD_STORE_PASSWORD=…
37
+ MYAPP_UPLOAD_KEY_ALIAS=upload
38
+ MYAPP_UPLOAD_KEY_PASSWORD=…
39
+ ```
40
+
41
+ Without these properties the release build **fails** ("Keystore file not set") rather than falling back to the debug key. If Expo's Gradle template changes and the signing block can't be found, the prebuild fails too. The debug build is untouched.
42
+
43
+ | Option | Type | Notes |
44
+ | ---------------- | -------- | ---------------------------------------------------------------------------------- |
45
+ | `propertyPrefix` | `string` | Required, upper case (`MYAPP` → `MYAPP_UPLOAD_*`). One prefix per app and per key. |
46
+
47
+ ## `withAndroidAbis` — real phones only
48
+
49
+ Ships native code for 32- and 64-bit ARM only: x86 / x86_64 only serve emulators and nearly double the APK's size. `expo run:android` still builds for the connected device's ABI.
50
+
51
+ | Option | Type | Default |
52
+ | ------ | ---------- | ------------------------------ |
53
+ | `abis` | `string[]` | `["armeabi-v7a", "arm64-v8a"]` |
54
+
55
+ ## `withShortCxxPath` — Windows path length
56
+
57
+ On Windows, release builds can overflow the 260-character path limit inside `android/app/.cxx` (react-native-gesture-handler's codegen paths). This plugin moves CMake's staging directory to a short path. It does nothing on other systems unless `stagingDir` is set.
58
+
59
+ | Option | Type | Default |
60
+ | ------------ | -------- | --------------------------------- |
61
+ | `stagingDir` | `string` | `C:/rncxx` on Windows, else unset |
62
+
63
+ ## `withKotlinJvmTarget` — one JVM target for Kotlin
64
+
65
+ Some native modules (e.g. `expo-dynamic-app-icon`) compile their Kotlin code for another JVM target than the project's Java code, and the build fails with "Inconsistent JVM-target compatibility". This plugin appends a block to `android/build.gradle` forcing every Kotlin compile task, in every subproject, to the same target.
66
+
67
+ | Option | Type | Default |
68
+ | ----------- | -------- | ------- |
69
+ | `jvmTarget` | `string` | `"17"` |
70
+
71
+ ## Testing your own setup
72
+
73
+ The transforms behind the plugins are exported as pure functions from `@forthtilliath/expo-config-plugins/transforms` (`applyReleaseSigning`, `applyAndroidAbis`, `applyShortCxxPath`, `applyKotlinJvmTarget`).
74
+
75
+ ## Scripts
76
+
77
+ | Script | What it does |
78
+ | ------------- | ------------------------------ |
79
+ | `build` | Compiles `src/` to CommonJS. |
80
+ | `test` | Runs the transform tests. |
81
+ | `lint` | ESLint, zero warnings allowed. |
82
+ | `check-types` | Type-checks without emitting. |
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Makes `android/app/build.gradle` sign release builds with the app's own
3
+ * upload key, read from `<PREFIX>_UPLOAD_*` Gradle properties, instead of
4
+ * React Native's **public** `debug.keystore`. The debug build is untouched;
5
+ * already-patched contents are returned as is.
6
+ *
7
+ * @throws When `prefix` isn't an upper-case identifier, or when the expected
8
+ * signing block isn't there — failing the prebuild beats shipping an APK
9
+ * signed with the debug key.
10
+ */
11
+ export declare function applyReleaseSigning(contents: string, prefix: string | undefined): string;
12
+ /** One entry of `gradle.properties`, as Expo's `withGradleProperties` exposes it. */
13
+ export type GradlePropertiesItem = {
14
+ type: "property";
15
+ key: string;
16
+ value: string;
17
+ } | {
18
+ type: "comment";
19
+ value: string;
20
+ } | {
21
+ type: "empty";
22
+ };
23
+ /** Real phones only: 32- and 64-bit ARM. */
24
+ export declare const ARM_ABIS: readonly string[];
25
+ /**
26
+ * Sets `reactNativeArchitectures` in `gradle.properties` (in place), so the
27
+ * APK only ships native code for `abis` — x86 / x86_64 only serve emulators
28
+ * and nearly double the APK's size. `expo run:android` still passes the
29
+ * device's own ABI, which wins over this value in development.
30
+ */
31
+ export declare function applyAndroidAbis(properties: GradlePropertiesItem[], abis?: readonly string[]): GradlePropertiesItem[];
32
+ /**
33
+ * Moves the CMake staging directory (`.cxx`) out of `android/app` to
34
+ * `stagingDir`: nested in the project, release builds overflow Windows'
35
+ * 260-character path limit on react-native-gesture-handler's codegen paths.
36
+ * Already-patched contents are returned as is.
37
+ *
38
+ * @throws When the `namespace` line to anchor on isn't found.
39
+ */
40
+ export declare function applyShortCxxPath(contents: string, stagingDir: string): string;
41
+ /**
42
+ * Appends to the root `android/build.gradle` a block forcing every Kotlin
43
+ * compile task, in every subproject, to target `jvmTarget` — the Java code's
44
+ * target: a native module compiling its Kotlin for another one (e.g.
45
+ * expo-dynamic-app-icon) fails the build with "Inconsistent JVM-target
46
+ * compatibility". Already-patched contents are returned as is.
47
+ *
48
+ * @throws When `jvmTarget` isn't a JVM version such as `17` or `1.8`.
49
+ */
50
+ export declare function applyKotlinJvmTarget(contents: string, jvmTarget?: string): string;
51
+ export interface KotlinJvmTargetOptions {
52
+ /** JVM version Kotlin compiles for, e.g. `"21"`. @defaultValue `"17"` */
53
+ jvmTarget?: string;
54
+ }
55
+ export interface ReleaseSigningOptions {
56
+ /**
57
+ * Prefix of the Gradle properties holding the upload key, e.g. `MYAPP` for
58
+ * `MYAPP_UPLOAD_STORE_FILE`, `MYAPP_UPLOAD_STORE_PASSWORD`,
59
+ * `MYAPP_UPLOAD_KEY_ALIAS`, `MYAPP_UPLOAD_KEY_PASSWORD`.
60
+ */
61
+ propertyPrefix?: string;
62
+ }
63
+ export interface AndroidAbisOptions {
64
+ /** @defaultValue `["armeabi-v7a", "arm64-v8a"]` — real phones only */
65
+ abis?: string[];
66
+ }
67
+ export interface ShortCxxPathOptions {
68
+ /**
69
+ * Where CMake stages native builds. Given, it always applies; omitted, the
70
+ * plugin only acts on Windows, with `C:/rncxx`.
71
+ */
72
+ stagingDir?: string;
73
+ }
74
+ //# sourceMappingURL=transforms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,MAAM,CAmBR;AAED,qFAAqF;AACrF,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChD;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEtB,4CAA4C;AAC5C,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAAiC,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,oBAAoB,EAAE,EAClC,IAAI,GAAE,SAAS,MAAM,EAAa,GACjC,oBAAoB,EAAE,CAcxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,MAAM,CAiBR;AAID;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,SAAS,SAAO,GACf,MAAM,CAkBR;AAED,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ // The plugins' actual work, as pure functions over the generated files'
3
+ // contents — testable without running `expo prebuild` — and their options.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.ARM_ABIS = void 0;
6
+ exports.applyReleaseSigning = applyReleaseSigning;
7
+ exports.applyAndroidAbis = applyAndroidAbis;
8
+ exports.applyShortCxxPath = applyShortCxxPath;
9
+ exports.applyKotlinJvmTarget = applyKotlinJvmTarget;
10
+ /** The `signingConfig signingConfigs.debug` of the `release` build type (not the `debug` one's). */
11
+ const RELEASE_USES_DEBUG_KEY = /(buildTypes\s*\{[\s\S]*?release\s*\{[^}]*?)signingConfig signingConfigs\.debug/;
12
+ function releaseSigningConfig(prefix) {
13
+ const property = (name) => `findProperty('${prefix}_UPLOAD_${name}')`;
14
+ return `signingConfigs {
15
+ release {
16
+ if (${property("STORE_FILE")}) {
17
+ storeFile file(${property("STORE_FILE")})
18
+ storePassword ${property("STORE_PASSWORD")}
19
+ keyAlias ${property("KEY_ALIAS")}
20
+ keyPassword ${property("KEY_PASSWORD")}
21
+ }
22
+ }`;
23
+ }
24
+ /**
25
+ * Makes `android/app/build.gradle` sign release builds with the app's own
26
+ * upload key, read from `<PREFIX>_UPLOAD_*` Gradle properties, instead of
27
+ * React Native's **public** `debug.keystore`. The debug build is untouched;
28
+ * already-patched contents are returned as is.
29
+ *
30
+ * @throws When `prefix` isn't an upper-case identifier, or when the expected
31
+ * signing block isn't there — failing the prebuild beats shipping an APK
32
+ * signed with the debug key.
33
+ */
34
+ function applyReleaseSigning(contents, prefix) {
35
+ if (prefix === undefined || !/^[A-Z][A-Z0-9_]*$/.test(prefix)) {
36
+ throw new Error("withReleaseSigning: missing or invalid propertyPrefix option (e.g. MYAPP)");
37
+ }
38
+ if (contents.includes("signingConfig signingConfigs.release"))
39
+ return contents;
40
+ if (!RELEASE_USES_DEBUG_KEY.test(contents) ||
41
+ !contents.includes("signingConfigs {")) {
42
+ throw new Error("withReleaseSigning: signing block not found in android/app/build.gradle");
43
+ }
44
+ return contents
45
+ .replace(RELEASE_USES_DEBUG_KEY, "$1signingConfig signingConfigs.release")
46
+ .replace("signingConfigs {", releaseSigningConfig(prefix));
47
+ }
48
+ /** Real phones only: 32- and 64-bit ARM. */
49
+ exports.ARM_ABIS = ["armeabi-v7a", "arm64-v8a"];
50
+ /**
51
+ * Sets `reactNativeArchitectures` in `gradle.properties` (in place), so the
52
+ * APK only ships native code for `abis` — x86 / x86_64 only serve emulators
53
+ * and nearly double the APK's size. `expo run:android` still passes the
54
+ * device's own ABI, which wins over this value in development.
55
+ */
56
+ function applyAndroidAbis(properties, abis = exports.ARM_ABIS) {
57
+ const value = abis.join(",");
58
+ const existing = properties.find((item) => item.type === "property" && item.key === "reactNativeArchitectures");
59
+ if (existing)
60
+ existing.value = value;
61
+ else
62
+ properties.push({
63
+ type: "property",
64
+ key: "reactNativeArchitectures",
65
+ value,
66
+ });
67
+ return properties;
68
+ }
69
+ /**
70
+ * Moves the CMake staging directory (`.cxx`) out of `android/app` to
71
+ * `stagingDir`: nested in the project, release builds overflow Windows'
72
+ * 260-character path limit on react-native-gesture-handler's codegen paths.
73
+ * Already-patched contents are returned as is.
74
+ *
75
+ * @throws When the `namespace` line to anchor on isn't found.
76
+ */
77
+ function applyShortCxxPath(contents, stagingDir) {
78
+ if (contents.includes("buildStagingDirectory"))
79
+ return contents;
80
+ if (!contents.includes(" namespace")) {
81
+ throw new Error("withShortCxxPath: `namespace` line not found in android/app/build.gradle");
82
+ }
83
+ return contents.replace(" namespace", ` externalNativeBuild {
84
+ cmake {
85
+ buildStagingDirectory "${stagingDir.replace(/\\/g, "/")}"
86
+ }
87
+ }
88
+
89
+ namespace`);
90
+ }
91
+ const KOTLIN_JVM_TARGET_MARKER = "withKotlinJvmTarget";
92
+ /**
93
+ * Appends to the root `android/build.gradle` a block forcing every Kotlin
94
+ * compile task, in every subproject, to target `jvmTarget` — the Java code's
95
+ * target: a native module compiling its Kotlin for another one (e.g.
96
+ * expo-dynamic-app-icon) fails the build with "Inconsistent JVM-target
97
+ * compatibility". Already-patched contents are returned as is.
98
+ *
99
+ * @throws When `jvmTarget` isn't a JVM version such as `17` or `1.8`.
100
+ */
101
+ function applyKotlinJvmTarget(contents, jvmTarget = "17") {
102
+ if (!/^(1\.8|\d{1,2})$/.test(jvmTarget)) {
103
+ throw new Error(`withKotlinJvmTarget: invalid jvmTarget option "${jvmTarget}" (e.g. 17)`);
104
+ }
105
+ if (contents.includes(KOTLIN_JVM_TARGET_MARKER))
106
+ return contents;
107
+ return `${contents.trimEnd()}
108
+
109
+ // ${KOTLIN_JVM_TARGET_MARKER}: Kotlin targets the same JVM as Java (avoids "Inconsistent JVM-target compatibility").
110
+ subprojects {
111
+ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
112
+ compilerOptions {
113
+ jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_${jvmTarget.replace(".", "_")})
114
+ }
115
+ }
116
+ }
117
+ `;
118
+ }
@@ -0,0 +1,13 @@
1
+ import { type ConfigPlugin } from "expo/config-plugins";
2
+ import { type AndroidAbisOptions } from "./transforms.js";
3
+ /**
4
+ * Ships native code for real phones only (32- and 64-bit ARM) by default:
5
+ * x86 / x86_64 only serve emulators and nearly double the APK's size.
6
+ * `expo run:android` still passes the device's own ABI in development.
7
+ *
8
+ * `"@forthtilliath/expo-config-plugins/withAndroidAbis"`, or
9
+ * `["@forthtilliath/expo-config-plugins/withAndroidAbis", { "abis": ["arm64-v8a"] }]`
10
+ */
11
+ declare const withAndroidAbis: ConfigPlugin<AndroidAbisOptions | undefined>;
12
+ export = withAndroidAbis;
13
+ //# sourceMappingURL=withAndroidAbis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withAndroidAbis.d.ts","sourceRoot":"","sources":["../src/withAndroidAbis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AAE5E;;;;;;;GAOG;AACH,QAAA,MAAM,eAAe,EAAE,YAAY,CAAC,kBAAkB,GAAG,SAAS,CAO9D,CAAC;AAEL,SAAS,eAAe,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ const config_plugins_1 = require("expo/config-plugins");
3
+ const transforms_js_1 = require("./transforms.js");
4
+ /**
5
+ * Ships native code for real phones only (32- and 64-bit ARM) by default:
6
+ * x86 / x86_64 only serve emulators and nearly double the APK's size.
7
+ * `expo run:android` still passes the device's own ABI in development.
8
+ *
9
+ * `"@forthtilliath/expo-config-plugins/withAndroidAbis"`, or
10
+ * `["@forthtilliath/expo-config-plugins/withAndroidAbis", { "abis": ["arm64-v8a"] }]`
11
+ */
12
+ const withAndroidAbis = (config, options) => (0, config_plugins_1.withGradleProperties)(config, (mod) => {
13
+ (0, transforms_js_1.applyAndroidAbis)(mod.modResults, options?.abis);
14
+ return mod;
15
+ });
16
+ module.exports = withAndroidAbis;
@@ -0,0 +1,14 @@
1
+ import { type ConfigPlugin } from "expo/config-plugins";
2
+ import { type KotlinJvmTargetOptions } from "./transforms.js";
3
+ /**
4
+ * Makes every Kotlin compile task target the same JVM as the Java code (17
5
+ * by default): some native modules (e.g. expo-dynamic-app-icon) compile
6
+ * their Kotlin for another target, and the build fails with "Inconsistent
7
+ * JVM-target compatibility".
8
+ *
9
+ * `"@forthtilliath/expo-config-plugins/withKotlinJvmTarget"`, or
10
+ * `["@forthtilliath/expo-config-plugins/withKotlinJvmTarget", { "jvmTarget": "21" }]`
11
+ */
12
+ declare const withKotlinJvmTarget: ConfigPlugin<KotlinJvmTargetOptions | undefined>;
13
+ export = withKotlinJvmTarget;
14
+ //# sourceMappingURL=withKotlinJvmTarget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withKotlinJvmTarget.d.ts","sourceRoot":"","sources":["../src/withKotlinJvmTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAA0B,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;GAQG;AACH,QAAA,MAAM,mBAAmB,EAAE,YAAY,CAAC,sBAAsB,GAAG,SAAS,CAUtE,CAAC;AAEL,SAAS,mBAAmB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ const config_plugins_1 = require("expo/config-plugins");
3
+ const transforms_js_1 = require("./transforms.js");
4
+ /**
5
+ * Makes every Kotlin compile task target the same JVM as the Java code (17
6
+ * by default): some native modules (e.g. expo-dynamic-app-icon) compile
7
+ * their Kotlin for another target, and the build fails with "Inconsistent
8
+ * JVM-target compatibility".
9
+ *
10
+ * `"@forthtilliath/expo-config-plugins/withKotlinJvmTarget"`, or
11
+ * `["@forthtilliath/expo-config-plugins/withKotlinJvmTarget", { "jvmTarget": "21" }]`
12
+ */
13
+ const withKotlinJvmTarget = (config, options) => (0, config_plugins_1.withProjectBuildGradle)(config, (mod) => {
14
+ mod.modResults.contents = (0, transforms_js_1.applyKotlinJvmTarget)(mod.modResults.contents, options?.jvmTarget);
15
+ return mod;
16
+ });
17
+ module.exports = withKotlinJvmTarget;
@@ -0,0 +1,15 @@
1
+ import { type ConfigPlugin } from "expo/config-plugins";
2
+ import { type ReleaseSigningOptions } from "./transforms.js";
3
+ /**
4
+ * Signs the release APK with the app's own upload key instead of React
5
+ * Native's public `debug.keystore` (the same key in every RN project: anyone
6
+ * could sign a fake update). The key and its passwords stay out of the repo,
7
+ * read as Gradle properties (`~/.gradle/gradle.properties` or
8
+ * `ORG_GRADLE_PROJECT_*` variables). Without them the release build fails
9
+ * ("Keystore file not set") instead of falling back to the debug key.
10
+ *
11
+ * `["@forthtilliath/expo-config-plugins/withReleaseSigning", { "propertyPrefix": "MYAPP" }]`
12
+ */
13
+ declare const withReleaseSigning: ConfigPlugin<ReleaseSigningOptions | undefined>;
14
+ export = withReleaseSigning;
15
+ //# sourceMappingURL=withReleaseSigning.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withReleaseSigning.d.ts","sourceRoot":"","sources":["../src/withReleaseSigning.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;;;GASG;AACH,QAAA,MAAM,kBAAkB,EAAE,YAAY,CAAC,qBAAqB,GAAG,SAAS,CAUpE,CAAC;AAEL,SAAS,kBAAkB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ const config_plugins_1 = require("expo/config-plugins");
3
+ const transforms_js_1 = require("./transforms.js");
4
+ /**
5
+ * Signs the release APK with the app's own upload key instead of React
6
+ * Native's public `debug.keystore` (the same key in every RN project: anyone
7
+ * could sign a fake update). The key and its passwords stay out of the repo,
8
+ * read as Gradle properties (`~/.gradle/gradle.properties` or
9
+ * `ORG_GRADLE_PROJECT_*` variables). Without them the release build fails
10
+ * ("Keystore file not set") instead of falling back to the debug key.
11
+ *
12
+ * `["@forthtilliath/expo-config-plugins/withReleaseSigning", { "propertyPrefix": "MYAPP" }]`
13
+ */
14
+ const withReleaseSigning = (config, options) => (0, config_plugins_1.withAppBuildGradle)(config, (mod) => {
15
+ mod.modResults.contents = (0, transforms_js_1.applyReleaseSigning)(mod.modResults.contents, options?.propertyPrefix);
16
+ return mod;
17
+ });
18
+ module.exports = withReleaseSigning;
@@ -0,0 +1,13 @@
1
+ import { type ConfigPlugin } from "expo/config-plugins";
2
+ import { type ShortCxxPathOptions } from "./transforms.js";
3
+ /**
4
+ * Moves the CMake staging directory (`.cxx`) out of the project: on Windows,
5
+ * release builds overflow the 260-character path limit on
6
+ * react-native-gesture-handler's codegen paths. A no-op on other systems
7
+ * unless `stagingDir` is set.
8
+ *
9
+ * `"@forthtilliath/expo-config-plugins/withShortCxxPath"`
10
+ */
11
+ declare const withShortCxxPath: ConfigPlugin<ShortCxxPathOptions | undefined>;
12
+ export = withShortCxxPath;
13
+ //# sourceMappingURL=withShortCxxPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withShortCxxPath.d.ts","sourceRoot":"","sources":["../src/withShortCxxPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAqB,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE9E;;;;;;;GAOG;AACH,QAAA,MAAM,gBAAgB,EAAE,YAAY,CAAC,mBAAmB,GAAG,SAAS,CAcnE,CAAC;AAEF,SAAS,gBAAgB,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ const config_plugins_1 = require("expo/config-plugins");
3
+ const transforms_js_1 = require("./transforms.js");
4
+ /**
5
+ * Moves the CMake staging directory (`.cxx`) out of the project: on Windows,
6
+ * release builds overflow the 260-character path limit on
7
+ * react-native-gesture-handler's codegen paths. A no-op on other systems
8
+ * unless `stagingDir` is set.
9
+ *
10
+ * `"@forthtilliath/expo-config-plugins/withShortCxxPath"`
11
+ */
12
+ const withShortCxxPath = (config, options) => {
13
+ const stagingDir = options?.stagingDir ?? (process.platform === "win32" ? "C:/rncxx" : null);
14
+ if (!stagingDir)
15
+ return config;
16
+ return (0, config_plugins_1.withAppBuildGradle)(config, (mod) => {
17
+ mod.modResults.contents = (0, transforms_js_1.applyShortCxxPath)(mod.modResults.contents, stagingDir);
18
+ return mod;
19
+ });
20
+ };
21
+ module.exports = withShortCxxPath;
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@forthtilliath/expo-config-plugins",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Expo config plugins for sideloaded Android apps: release signing with your own key, ARM-only native code, short CMake paths on Windows, one JVM target for Kotlin.",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/Forthtilliath/forthtilliath-packages.git",
12
+ "directory": "packages/expo-config-plugins"
13
+ },
14
+ "homepage": "https://github.com/Forthtilliath/forthtilliath-packages/tree/main/packages/expo-config-plugins#readme",
15
+ "bugs": "https://github.com/Forthtilliath/forthtilliath-packages/issues",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "exports": {
20
+ "./withReleaseSigning": "./dist/withReleaseSigning.js",
21
+ "./withAndroidAbis": "./dist/withAndroidAbis.js",
22
+ "./withShortCxxPath": "./dist/withShortCxxPath.js",
23
+ "./withKotlinJvmTarget": "./dist/withKotlinJvmTarget.js",
24
+ "./transforms": "./dist/transforms.js",
25
+ "./package.json": "./package.json"
26
+ },
27
+ "peerDependencies": {
28
+ "expo": ">=54.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^26.2.0",
32
+ "@vitest/coverage-v8": "5.0.5",
33
+ "eslint": "10.7.0",
34
+ "expo": "~57.0.9",
35
+ "typescript": "^5.9.3",
36
+ "vitest": "^5.0.5",
37
+ "@forthtilliath/eslint-config": "0.10.0",
38
+ "@forthtilliath/typescript-config": "0.1.1"
39
+ },
40
+ "scripts": {
41
+ "lint": "eslint . --max-warnings 0",
42
+ "check-types": "tsc --noEmit",
43
+ "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
44
+ "dev": "tsc --watch -p tsconfig.build.json",
45
+ "build": "pnpm run clean && tsc -p tsconfig.build.json",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest",
48
+ "coverage": "vitest run --coverage"
49
+ }
6
50
  }