expo-native-cache-provider 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/fingerprint/nativeFingerprint.d.ts +10 -0
- package/build/fingerprint/nativeFingerprint.d.ts.map +1 -0
- package/build/fingerprint/nativeFingerprint.js +20 -0
- package/build/fingerprint/nativeFingerprint.js.map +1 -0
- package/build/hybrid/HybridCache.d.ts +33 -0
- package/build/hybrid/HybridCache.d.ts.map +1 -0
- package/build/hybrid/HybridCache.js +82 -0
- package/build/hybrid/HybridCache.js.map +1 -0
- package/build/index.d.ts +20 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +246 -0
- package/build/index.js.map +1 -0
- package/build/local/DiskCache.d.ts +13 -0
- package/build/local/DiskCache.d.ts.map +1 -0
- package/build/local/DiskCache.js +85 -0
- package/build/local/DiskCache.js.map +1 -0
- package/build/repack/Repack.d.ts +69 -0
- package/build/repack/Repack.d.ts.map +1 -0
- package/build/repack/Repack.js +493 -0
- package/build/repack/Repack.js.map +1 -0
- package/build/s3/S3Cache.d.ts +33 -0
- package/build/s3/S3Cache.d.ts.map +1 -0
- package/build/s3/S3Cache.js +102 -0
- package/build/s3/S3Cache.js.map +1 -0
- package/build/utils/guards.d.ts +21 -0
- package/build/utils/guards.d.ts.map +1 -0
- package/build/utils/guards.js +60 -0
- package/build/utils/guards.js.map +1 -0
- package/build/utils/hash.d.ts +9 -0
- package/build/utils/hash.d.ts.map +1 -0
- package/build/utils/hash.js +18 -0
- package/build/utils/hash.js.map +1 -0
- package/build/utils/logger.d.ts +20 -0
- package/build/utils/logger.d.ts.map +1 -0
- package/build/utils/logger.js +39 -0
- package/build/utils/logger.js.map +1 -0
- package/package.json +36 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RunOptions } from "@expo/config";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a native-only fingerprint hash using @expo/fingerprint.
|
|
4
|
+
*
|
|
5
|
+
* Only native-affecting changes (SDK version, native directories, app.json,
|
|
6
|
+
* native module versions) are included. JS/TS source files are excluded,
|
|
7
|
+
* so the hash stays stable on JS-only changes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function calculateNativeFingerprint(projectRoot: string, platform: "android" | "ios", runOptions: RunOptions): Promise<string>;
|
|
10
|
+
//# sourceMappingURL=nativeFingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeFingerprint.d.ts","sourceRoot":"","sources":["../../src/fingerprint/nativeFingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC/C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,SAAS,GAAG,KAAK,EAC3B,UAAU,EAAE,UAAU,GACpB,OAAO,CAAC,MAAM,CAAC,CAWjB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createFingerprintAsync } from "@expo/fingerprint";
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a native-only fingerprint hash using @expo/fingerprint.
|
|
4
|
+
*
|
|
5
|
+
* Only native-affecting changes (SDK version, native directories, app.json,
|
|
6
|
+
* native module versions) are included. JS/TS source files are excluded,
|
|
7
|
+
* so the hash stays stable on JS-only changes.
|
|
8
|
+
*/
|
|
9
|
+
export async function calculateNativeFingerprint(projectRoot, platform, runOptions) {
|
|
10
|
+
try {
|
|
11
|
+
const fingerprint = await createFingerprintAsync(projectRoot, {
|
|
12
|
+
platforms: [platform],
|
|
13
|
+
});
|
|
14
|
+
return fingerprint.hash;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
throw new Error(`Failed to calculate native fingerprint using @expo/fingerprint: ${error}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=nativeFingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeFingerprint.js","sourceRoot":"","sources":["../../src/fingerprint/nativeFingerprint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC/C,WAAmB,EACnB,QAA2B,EAC3B,UAAsB;IAEtB,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC,WAAW,EAAE;YAC7D,SAAS,EAAE,CAAC,QAAQ,CAAC;SACrB,CAAC,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACd,mEAAmE,KAAK,EAAE,CAC1E,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type S3Config } from "../s3/S3Cache.js";
|
|
2
|
+
export interface HybridCacheConfig {
|
|
3
|
+
localCacheDir: string;
|
|
4
|
+
s3?: S3Config;
|
|
5
|
+
writeThrough?: boolean;
|
|
6
|
+
enableRepack?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Hybrid cache that implements local-first strategy with S3 fallback.
|
|
10
|
+
*/
|
|
11
|
+
export declare class HybridCache {
|
|
12
|
+
private readonly diskCache;
|
|
13
|
+
private readonly s3Cache;
|
|
14
|
+
private readonly writeThrough;
|
|
15
|
+
constructor(config: HybridCacheConfig);
|
|
16
|
+
/**
|
|
17
|
+
* Gets a value from cache (local-first, S3 fallback).
|
|
18
|
+
*/
|
|
19
|
+
get(key: string): Promise<Buffer | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Sets a value in cache (local + S3 if writeThrough enabled).
|
|
22
|
+
*/
|
|
23
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Checks if a key exists in cache.
|
|
26
|
+
*/
|
|
27
|
+
exists(key: string): Promise<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Clears all cached entries.
|
|
30
|
+
*/
|
|
31
|
+
clear(): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=HybridCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HybridCache.d.ts","sourceRoot":"","sources":["../../src/hybrid/HybridCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG1D,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,qBAAa,WAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAU;gBAE3B,MAAM,EAAE,iBAAiB;IAMrC;;OAEG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IA2B9C;;OAEG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUpD;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB3C;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAK5B"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DiskCache } from "../local/DiskCache.js";
|
|
2
|
+
import { S3Cache } from "../s3/S3Cache.js";
|
|
3
|
+
import { logger } from "../utils/logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* Hybrid cache that implements local-first strategy with S3 fallback.
|
|
6
|
+
*/
|
|
7
|
+
export class HybridCache {
|
|
8
|
+
diskCache;
|
|
9
|
+
s3Cache;
|
|
10
|
+
writeThrough;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.diskCache = new DiskCache(config.localCacheDir);
|
|
13
|
+
this.s3Cache = config.s3 && config.s3.bucket ? new S3Cache(config.s3) : null;
|
|
14
|
+
this.writeThrough = config.writeThrough ?? true;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Gets a value from cache (local-first, S3 fallback).
|
|
18
|
+
*/
|
|
19
|
+
async get(key) {
|
|
20
|
+
const localValue = await this.diskCache.get(key);
|
|
21
|
+
if (localValue !== null) {
|
|
22
|
+
logger.info(`Cache HIT (local): ${key}`);
|
|
23
|
+
return localValue;
|
|
24
|
+
}
|
|
25
|
+
if (this.s3Cache) {
|
|
26
|
+
logger.debug(`Cache MISS (local), checking S3: ${key}`);
|
|
27
|
+
try {
|
|
28
|
+
const s3Value = await this.s3Cache.get(key);
|
|
29
|
+
if (s3Value !== null) {
|
|
30
|
+
logger.info(`Cache HIT (S3), writing to local: ${key}`);
|
|
31
|
+
await this.diskCache.set(key, s3Value).catch((error) => {
|
|
32
|
+
logger.warn(`Failed to write S3 hit to local: ${key}`, error);
|
|
33
|
+
});
|
|
34
|
+
return s3Value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
logger.debug(`S3 check failed for key: ${key}`, error);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
logger.info(`Cache MISS (local and S3): ${key}`);
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Sets a value in cache (local + S3 if writeThrough enabled).
|
|
46
|
+
*/
|
|
47
|
+
async set(key, value) {
|
|
48
|
+
await this.diskCache.set(key, value);
|
|
49
|
+
if (this.writeThrough && this.s3Cache) {
|
|
50
|
+
await this.s3Cache.set(key, value).catch((error) => {
|
|
51
|
+
logger.warn(`Failed to write to S3: ${key}`, error);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Checks if a key exists in cache.
|
|
57
|
+
*/
|
|
58
|
+
async exists(key) {
|
|
59
|
+
const localExists = await this.diskCache.exists(key);
|
|
60
|
+
if (localExists)
|
|
61
|
+
return true;
|
|
62
|
+
if (this.s3Cache) {
|
|
63
|
+
try {
|
|
64
|
+
return await this.s3Cache.exists(key);
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
logger.debug(`S3 exists check failed: ${key}`, error);
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Clears all cached entries.
|
|
75
|
+
*/
|
|
76
|
+
async clear() {
|
|
77
|
+
await this.diskCache.clear();
|
|
78
|
+
// S3 clear is not implemented (would require listing all objects)
|
|
79
|
+
logger.warn("S3 cache clear is not implemented");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=HybridCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HybridCache.js","sourceRoot":"","sources":["../../src/hybrid/HybridCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAS5C;;GAEG;AACH,MAAM,OAAO,WAAW;IACN,SAAS,CAAY;IACrB,OAAO,CAAiB;IACxB,YAAY,CAAU;IAEvC,YAAY,MAAyB;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAA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Config } from "./hybrid/HybridCache.js";
|
|
3
|
+
/**
|
|
4
|
+
* Native-only cache provider plugin.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Caches native build artifacts only (APK/.app)
|
|
8
|
+
* - Does NOT invalidate on JS/TS changes
|
|
9
|
+
* - Blocks production builds
|
|
10
|
+
* - Supports development and qa profiles only
|
|
11
|
+
*/
|
|
12
|
+
declare const NativeCacheProvider: BuildCacheProviderPlugin<Partial<HybridCacheConfig> | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Generates a JavaScript bundle using Expo/Metro.
|
|
15
|
+
* Exported for use by root expo-cache-provider when enableRepack is true.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generateJSBundle(projectRoot: string, platform: "android" | "ios"): Promise<string>;
|
|
18
|
+
export { Repack } from "./repack/Repack.js";
|
|
19
|
+
export default NativeCacheProvider;
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,wBAAwB,EAIxB,MAAM,cAAc,CAAC;AAOtB,OAAO,EAAe,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AA0H9E;;;;;;;;GAQG;AACH,QAAA,MAAM,mBAAmB,EAAE,wBAAwB,CAClD,OAAO,CAAC,iBAAiB,CAAC,GAAG,SAAS,CAoFtC,CAAC;AAwBF;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAyCxG;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,eAAe,mBAAmB,CAAC"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { readFile, writeFile, cp, mkdir, stat, unlink } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { create, extract } from "tar";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { calculateNativeFingerprint } from "./fingerprint/nativeFingerprint.js";
|
|
6
|
+
import { detectProfile, shouldUseCache, buildCacheKey } from "./utils/guards.js";
|
|
7
|
+
import { HybridCache } from "./hybrid/HybridCache.js";
|
|
8
|
+
import { logger } from "./utils/logger.js";
|
|
9
|
+
import { Repack } from "./repack/Repack.js";
|
|
10
|
+
import { execSync } from "node:child_process";
|
|
11
|
+
import envPaths from "env-paths";
|
|
12
|
+
const packageName = "expo-native-cache-provider";
|
|
13
|
+
const BUNDLE_TIMEOUT_MS = 60_000;
|
|
14
|
+
function getDefaultCacheDir() {
|
|
15
|
+
return path.join(envPaths(packageName, { suffix: "" }).temp, "native-cache");
|
|
16
|
+
}
|
|
17
|
+
function makeTempFilePath(prefix) {
|
|
18
|
+
return path.join(tmpdir(), `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2)}.tar.gz`);
|
|
19
|
+
}
|
|
20
|
+
async function withTempFile(prefix, fn) {
|
|
21
|
+
const tempPath = makeTempFilePath(prefix);
|
|
22
|
+
try {
|
|
23
|
+
return await fn(tempPath);
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
await unlink(tempPath).catch(() => { });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function createTarballData(sourceDir) {
|
|
30
|
+
return withTempFile("native-cache", async (tempFile) => {
|
|
31
|
+
await create({ cwd: path.dirname(sourceDir), file: tempFile, gzip: true }, [path.basename(sourceDir)]);
|
|
32
|
+
return readFile(tempFile);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function extractTarballData(tarballData, targetDir) {
|
|
36
|
+
await withTempFile("native-cache-extract", async (tempFile) => {
|
|
37
|
+
await mkdir(path.dirname(targetDir), { recursive: true });
|
|
38
|
+
await writeFile(tempFile, tarballData);
|
|
39
|
+
await extract({ cwd: path.dirname(targetDir), file: tempFile, gzip: true });
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
async function readNativeBuildArtifact(buildPath) {
|
|
43
|
+
const buildStats = await stat(buildPath);
|
|
44
|
+
return buildStats.isDirectory() ? createTarballData(buildPath) : readFile(buildPath);
|
|
45
|
+
}
|
|
46
|
+
async function writeNativeCachedArtifact(data, cacheKey, targetPath) {
|
|
47
|
+
await mkdir(path.dirname(targetPath), { recursive: true });
|
|
48
|
+
if (cacheKey.endsWith(".app")) {
|
|
49
|
+
await extractTarballData(data, targetPath);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
await writeFile(targetPath, data);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function copyBuildToLocalDir(buildPath, cacheKey, localCacheDir) {
|
|
56
|
+
const localPath = path.join(localCacheDir, path.basename(cacheKey));
|
|
57
|
+
await mkdir(path.dirname(localPath), { recursive: true });
|
|
58
|
+
await cp(buildPath, localPath, { recursive: true });
|
|
59
|
+
return localPath;
|
|
60
|
+
}
|
|
61
|
+
async function repackWithFreshJS(targetPath, cacheKey, args, localCacheDir) {
|
|
62
|
+
try {
|
|
63
|
+
const jsBundlePath = await generateJSBundle(args.projectRoot, args.platform);
|
|
64
|
+
const repackedPath = path.join(localCacheDir, `repacked-${path.basename(cacheKey)}`);
|
|
65
|
+
if (args.platform === "android") {
|
|
66
|
+
await Repack.repackAndroid(targetPath, jsBundlePath, repackedPath, args.projectRoot);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
await Repack.repackIOS(targetPath, jsBundlePath, repackedPath, args.projectRoot);
|
|
70
|
+
}
|
|
71
|
+
logger.info(`Repacked binary with fresh JS: ${repackedPath}`);
|
|
72
|
+
return repackedPath;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
logger.warn(`Repack failed, using cached binary as-is: ${error}`);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Normalizes configuration with defaults.
|
|
81
|
+
*/
|
|
82
|
+
function normalizeConfig(options) {
|
|
83
|
+
const env = process.env;
|
|
84
|
+
return {
|
|
85
|
+
localCacheDir: options?.localCacheDir ||
|
|
86
|
+
env.EXPO_NATIVE_CACHE_LOCAL_DIR ||
|
|
87
|
+
getDefaultCacheDir(),
|
|
88
|
+
s3: options?.s3?.bucket
|
|
89
|
+
? {
|
|
90
|
+
bucket: options.s3.bucket,
|
|
91
|
+
region: options.s3.region || env.EXPO_NATIVE_CACHE_S3_REGION || "",
|
|
92
|
+
accessKeyId: options.s3.accessKeyId ||
|
|
93
|
+
env.EXPO_NATIVE_CACHE_S3_ACCESS_KEY_ID,
|
|
94
|
+
secretAccessKey: options.s3.secretAccessKey ||
|
|
95
|
+
env.EXPO_NATIVE_CACHE_S3_SECRET_ACCESS_KEY,
|
|
96
|
+
endpoint: options.s3.endpoint || env.EXPO_NATIVE_CACHE_S3_ENDPOINT,
|
|
97
|
+
prefix: options.s3.prefix || env.EXPO_NATIVE_CACHE_S3_PREFIX,
|
|
98
|
+
}
|
|
99
|
+
: undefined,
|
|
100
|
+
writeThrough: options?.writeThrough ?? true,
|
|
101
|
+
enableRepack: options?.enableRepack ?? false,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Native-only cache provider plugin.
|
|
106
|
+
*
|
|
107
|
+
* Features:
|
|
108
|
+
* - Caches native build artifacts only (APK/.app)
|
|
109
|
+
* - Does NOT invalidate on JS/TS changes
|
|
110
|
+
* - Blocks production builds
|
|
111
|
+
* - Supports development and qa profiles only
|
|
112
|
+
*/
|
|
113
|
+
const NativeCacheProvider = {
|
|
114
|
+
/**
|
|
115
|
+
* Custom fingerprint calculation that excludes JS/TS files.
|
|
116
|
+
*/
|
|
117
|
+
async calculateFingerprintHash(props, options) {
|
|
118
|
+
try {
|
|
119
|
+
const fingerprint = await calculateNativeFingerprint(props.projectRoot, props.platform, props.runOptions);
|
|
120
|
+
logger.debug(`Calculated native fingerprint: ${fingerprint.slice(0, 16)}...`);
|
|
121
|
+
return fingerprint;
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
logger.error("Failed to calculate native fingerprint", error);
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
async resolveBuildCache(args, options) {
|
|
129
|
+
try {
|
|
130
|
+
const profile = detectProfile(args.runOptions, args.projectRoot);
|
|
131
|
+
if (!shouldUseCache(profile)) {
|
|
132
|
+
logger.info(`Cache SKIP: ${profile} profile not cached`);
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
const cacheKey = buildCacheKey(profile, args.platform, args.fingerprintHash);
|
|
136
|
+
const config = normalizeConfig(options);
|
|
137
|
+
const cachedData = await new HybridCache(config).get(cacheKey);
|
|
138
|
+
if (cachedData === null) {
|
|
139
|
+
logger.info(`Cache MISS: ${cacheKey}`);
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
const targetPath = path.join(config.localCacheDir, path.basename(cacheKey));
|
|
143
|
+
await writeNativeCachedArtifact(cachedData, cacheKey, targetPath);
|
|
144
|
+
if (config.enableRepack) {
|
|
145
|
+
const repacked = await repackWithFreshJS(targetPath, cacheKey, args, config.localCacheDir);
|
|
146
|
+
if (repacked !== null)
|
|
147
|
+
return repacked;
|
|
148
|
+
}
|
|
149
|
+
logger.info(`Cache HIT: ${cacheKey}`);
|
|
150
|
+
return targetPath;
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
logger.error("Failed to resolve build cache", error);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
async uploadBuildCache(args, options) {
|
|
158
|
+
try {
|
|
159
|
+
const profile = detectProfile(args.runOptions, args.projectRoot);
|
|
160
|
+
if (!shouldUseCache(profile)) {
|
|
161
|
+
logger.info(`Cache SKIP: ${profile} profile not cached`);
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
const cacheKey = buildCacheKey(profile, args.platform, args.fingerprintHash);
|
|
165
|
+
const config = normalizeConfig(options);
|
|
166
|
+
const buildData = await readNativeBuildArtifact(args.buildPath);
|
|
167
|
+
await new HybridCache(config).set(cacheKey, buildData);
|
|
168
|
+
const localPath = await copyBuildToLocalDir(args.buildPath, cacheKey, config.localCacheDir);
|
|
169
|
+
logger.info(`Cache UPLOADED: ${cacheKey}`);
|
|
170
|
+
return localPath;
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
logger.error("Failed to upload build cache", error);
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Resolves the Metro/React Native entry file (Expo often uses index.ts or index.js, not index.android.js).
|
|
180
|
+
*/
|
|
181
|
+
async function resolveEntryFile(projectRoot, platform) {
|
|
182
|
+
const candidates = [];
|
|
183
|
+
try {
|
|
184
|
+
const pkgPath = path.join(projectRoot, "package.json");
|
|
185
|
+
const pkg = JSON.parse(await readFile(pkgPath, "utf-8"));
|
|
186
|
+
if (pkg.main)
|
|
187
|
+
candidates.push(pkg.main);
|
|
188
|
+
}
|
|
189
|
+
catch { }
|
|
190
|
+
candidates.push("index.ts", "index.tsx", "index.js", "index.jsx");
|
|
191
|
+
if (platform === "android")
|
|
192
|
+
candidates.push("index.android.js", "index.android.ts");
|
|
193
|
+
for (const name of candidates) {
|
|
194
|
+
const full = path.join(projectRoot, name);
|
|
195
|
+
try {
|
|
196
|
+
await stat(full);
|
|
197
|
+
return name;
|
|
198
|
+
}
|
|
199
|
+
catch { }
|
|
200
|
+
}
|
|
201
|
+
return "index.js";
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Generates a JavaScript bundle using Expo/Metro.
|
|
205
|
+
* Exported for use by root expo-cache-provider when enableRepack is true.
|
|
206
|
+
*/
|
|
207
|
+
export async function generateJSBundle(projectRoot, platform) {
|
|
208
|
+
const bundleExt = platform === "android" ? "android.bundle" : "jsbundle";
|
|
209
|
+
const tempBundle = path.join(tmpdir(), `jsbundle-${Date.now()}.${bundleExt}`);
|
|
210
|
+
const bundleName = platform === "android" ? "index.android.bundle" : "main.jsbundle";
|
|
211
|
+
try {
|
|
212
|
+
try {
|
|
213
|
+
execSync(`npx expo export:embed --platform ${platform}`, {
|
|
214
|
+
cwd: projectRoot,
|
|
215
|
+
stdio: "pipe",
|
|
216
|
+
timeout: BUNDLE_TIMEOUT_MS,
|
|
217
|
+
});
|
|
218
|
+
const possiblePaths = [
|
|
219
|
+
path.join(projectRoot, ".expo", "bundles", bundleName),
|
|
220
|
+
path.join(projectRoot, "dist", bundleName),
|
|
221
|
+
];
|
|
222
|
+
for (const bundlePath of possiblePaths) {
|
|
223
|
+
try {
|
|
224
|
+
await stat(bundlePath);
|
|
225
|
+
return bundlePath;
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
// try next candidate
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
logger.debug(`Expo export:embed failed, trying Metro directly: ${error}`);
|
|
234
|
+
}
|
|
235
|
+
const entryFile = await resolveEntryFile(projectRoot, platform);
|
|
236
|
+
execSync(`npx react-native bundle --platform ${platform} --dev false --entry-file ${entryFile} --bundle-output "${tempBundle}" --assets-dest "${path.dirname(tempBundle)}"`, { cwd: projectRoot, stdio: "pipe", timeout: BUNDLE_TIMEOUT_MS });
|
|
237
|
+
await stat(tempBundle);
|
|
238
|
+
return tempBundle;
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
throw new Error(`Failed to generate JS bundle: ${error}`);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
export { Repack } from "./repack/Repack.js";
|
|
245
|
+
export default NativeCacheProvider;
|
|
246
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":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B,CAAC;YACF,CAAC;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,MAAM,CAAC,KAAK,CAAC,oDAAoD,KAAK,EAAE,CAAC,CAAC;QAC3E,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;QAChE,QAAQ,CACP,sCAAsC,QAAQ,6BAA6B,SAAS,qBAAqB,UAAU,oBAAoB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,EAClK,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,CAC/D,CAAC;QAEF,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;QACvB,OAAO,UAAU,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACF,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local disk-based cache for native build artifacts.
|
|
3
|
+
*/
|
|
4
|
+
export declare class DiskCache {
|
|
5
|
+
private readonly cacheDir;
|
|
6
|
+
constructor(cacheDir: string);
|
|
7
|
+
get(key: string): Promise<Buffer | null>;
|
|
8
|
+
set(key: string, value: Buffer): Promise<void>;
|
|
9
|
+
exists(key: string): Promise<boolean>;
|
|
10
|
+
clear(): Promise<void>;
|
|
11
|
+
private keyToPath;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=DiskCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiskCache.d.ts","sourceRoot":"","sources":["../../src/local/DiskCache.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,qBAAa,SAAS;IACT,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,MAAM;IAMvC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAexC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY9C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IASrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB5B,OAAO,CAAC,SAAS;CAGjB"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { readFile, writeFile, unlink, access, mkdir, readdir, rm } from "node:fs/promises";
|
|
2
|
+
import { constants } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { logger } from "../utils/logger.js";
|
|
5
|
+
function isFileNotFoundError(error) {
|
|
6
|
+
return (error !== null &&
|
|
7
|
+
typeof error === "object" &&
|
|
8
|
+
"code" in error &&
|
|
9
|
+
error.code === "ENOENT");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Local disk-based cache for native build artifacts.
|
|
13
|
+
*/
|
|
14
|
+
export class DiskCache {
|
|
15
|
+
cacheDir;
|
|
16
|
+
constructor(cacheDir) {
|
|
17
|
+
this.cacheDir = cacheDir;
|
|
18
|
+
if (!cacheDir) {
|
|
19
|
+
throw new Error("cacheDir is required");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async get(key) {
|
|
23
|
+
try {
|
|
24
|
+
const data = await readFile(this.keyToPath(key));
|
|
25
|
+
logger.debug(`Disk cache HIT: ${key}`);
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
if (isFileNotFoundError(error)) {
|
|
30
|
+
logger.debug(`Disk cache MISS: ${key}`);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
logger.error(`Failed to read cache key: ${key}`, error);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async set(key, value) {
|
|
38
|
+
try {
|
|
39
|
+
const filePath = this.keyToPath(key);
|
|
40
|
+
await mkdir(path.dirname(filePath), { recursive: true });
|
|
41
|
+
await writeFile(filePath, value);
|
|
42
|
+
logger.debug(`Disk cache SET: ${key}`);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
logger.error(`Failed to write cache key: ${key}`, error);
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async exists(key) {
|
|
50
|
+
try {
|
|
51
|
+
await access(this.keyToPath(key), constants.F_OK);
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
async clear() {
|
|
59
|
+
try {
|
|
60
|
+
const entries = await readdir(this.cacheDir, { withFileTypes: true });
|
|
61
|
+
for (const entry of entries) {
|
|
62
|
+
const entryPath = path.join(this.cacheDir, entry.name);
|
|
63
|
+
if (entry.isDirectory()) {
|
|
64
|
+
await rm(entryPath, { recursive: true, force: true });
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
await unlink(entryPath);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
logger.info(`Cleared disk cache: ${this.cacheDir}`);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
if (isFileNotFoundError(error)) {
|
|
74
|
+
logger.debug(`Cache directory does not exist: ${this.cacheDir}`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
logger.error(`Failed to clear cache: ${this.cacheDir}`, error);
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
keyToPath(key) {
|
|
82
|
+
return path.join(this.cacheDir, key.replace(/\//g, path.sep));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=DiskCache.js.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AE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;gBACvD,CAAC;qBAAM,CAAC;oBACP,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC;gBACzB,CAAC;YACF,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,uBAAuB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACrD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAChC,MAAM,CAAC,KAAK,CAAC,mCAAmC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACjE,OAAO;YACR,CAAC;YACD,MAAM,CAAC,KAAK,CAAC,0BAA0B,IAAI,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;YAC/D,MAAM,KAAK,CAAC;QACb,CAAC;IACF,CAAC;IAEO,SAAS,CAAC,GAAW;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;CACD"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repacks a native binary with a new JavaScript bundle.
|
|
3
|
+
*
|
|
4
|
+
* For Android: Extracts APK, replaces JS bundle, re-signs, repackages
|
|
5
|
+
* For iOS: Extracts .app, replaces JS bundle, re-signs, repackages
|
|
6
|
+
*/
|
|
7
|
+
export declare class Repack {
|
|
8
|
+
/**
|
|
9
|
+
* Repacks an Android APK with a new JavaScript bundle.
|
|
10
|
+
*
|
|
11
|
+
* Edge cases handled:
|
|
12
|
+
* - Multiple bundle locations (Expo SDK variations)
|
|
13
|
+
* - Split APKs (base.apk only)
|
|
14
|
+
* - Different native architectures
|
|
15
|
+
* - APK signing v1/v2/v3
|
|
16
|
+
* - File permissions preservation
|
|
17
|
+
*/
|
|
18
|
+
static repackAndroid(apkPath: string, jsBundlePath: string, outputPath: string, projectRoot: string): Promise<string>;
|
|
19
|
+
/**
|
|
20
|
+
* Repacks an iOS .app bundle with a new JavaScript bundle.
|
|
21
|
+
*
|
|
22
|
+
* Edge cases handled:
|
|
23
|
+
* - Multiple bundle locations (Expo SDK variations)
|
|
24
|
+
* - Code signing with entitlements
|
|
25
|
+
* - Frameworks and PlugIns signing
|
|
26
|
+
* - Info.plist updates
|
|
27
|
+
* - Embedded frameworks preservation
|
|
28
|
+
*/
|
|
29
|
+
static repackIOS(appPath: string, jsBundlePath: string, outputPath: string, projectRoot: string): Promise<string>;
|
|
30
|
+
private static replaceJsBundle;
|
|
31
|
+
private static extractZip;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a ZIP file from all files in a directory.
|
|
34
|
+
*
|
|
35
|
+
* APK is a ZIP file with specific requirements:
|
|
36
|
+
* - Must not compress certain files (like .so native libraries)
|
|
37
|
+
* - Must preserve file permissions
|
|
38
|
+
* - Must use store (no compression) for .so, .dex files
|
|
39
|
+
*/
|
|
40
|
+
private static createZipFromDir;
|
|
41
|
+
/**
|
|
42
|
+
* Aligns an APK (required before signing).
|
|
43
|
+
* APK must be 4-byte aligned for memory mapping; zipalign must run before signing.
|
|
44
|
+
*/
|
|
45
|
+
private static alignApk;
|
|
46
|
+
private static findAndroidSdkTool;
|
|
47
|
+
private static findZipalign;
|
|
48
|
+
private static findApksigner;
|
|
49
|
+
/**
|
|
50
|
+
* Signs an Android APK with debug keystore.
|
|
51
|
+
* Supports APK signing v1, v2, and v3.
|
|
52
|
+
*/
|
|
53
|
+
private static signApk;
|
|
54
|
+
/**
|
|
55
|
+
* Signs an iOS app bundle.
|
|
56
|
+
*
|
|
57
|
+
* Signing order: main executable → Frameworks → PlugIns → WatchKit extensions → .app bundle
|
|
58
|
+
* Ad-hoc signing works for simulator and development; device deployment requires proper certificates.
|
|
59
|
+
*/
|
|
60
|
+
private static signIOSApp;
|
|
61
|
+
private static generateDebugKeystore;
|
|
62
|
+
private static copyFile;
|
|
63
|
+
private static copyDirectory;
|
|
64
|
+
private static fileExists;
|
|
65
|
+
private static findFiles;
|
|
66
|
+
private static removeCodeSignatures;
|
|
67
|
+
private static cleanup;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=Repack.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Repack.d.ts","sourceRoot":"","sources":["../../src/repack/Repack.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,qBAAa,MAAM;IAClB;;;;;;;;;OASG;WACU,aAAa,CACzB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;IA+DlB;;;;;;;;;OASG;WACU,SAAS,CACrB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC;mBAgEG,eAAe;mBAkBf,UAAU;IAQ/B;;;;;;;OAOG;mBACkB,gBAAgB;IAYrC;;;OAGG;mBACkB,QAAQ;IA+B7B,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAWjC,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B,OAAO,CAAC,MAAM,CAAC,aAAa;IAI5B;;;OAGG;mBACkB,OAAO;IA0D5B;;;;;OAKG;mBACkB,UAAU;mBA2GV,qBAAqB;mBAQrB,QAAQ;mBAMR,aAAa;mBAgBb,UAAU;mBASV,SAAS;mBAmBT,oBAAoB;mBA8BpB,OAAO;CAgB5B"}
|