Skip to content

Commit 7246d6a

Browse files
committed
chore: update dependencies and refactor build cache methods
- Updated @expo/config from 11.0.10 to ^12.0.9 - Updated chalk from 4.1.2 to ^5.6.2 - Updated expo-module-scripts from ^4.1.7 to ^5.0.7 - Refactored build cache methods: renamed resolveRemoteBuildCache to resolveBuildCache and uploadRemoteBuildCache to uploadBuildCache
1 parent de65ba1 commit 7246d6a

7 files changed

Lines changed: 704 additions & 98 deletions

File tree

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A remote build cache provider plugin for Expo that uses GitHub Releases to store
44

55
## What is this?
66

7-
This library implements Expo's [remote build cache provider interface](https://docs.expo.dev/guides/cache-builds-remotely/) using GitHub Releases as the storage backend. Build caching is an experimental Expo feature that speeds up `npx expo run:ios` and `npx expo run:android` commands by caching builds remotely based on your project's [fingerprint](https://docs.expo.dev/versions/latest/sdk/fingerprint/).
7+
This library implements Expo's [remote build cache provider interface](https://docs.expo.dev/guides/cache-builds-remotely/) using GitHub Releases as the storage backend. Build caching is an Expo feature that speeds up `npx expo run:ios` and `npx expo run:android` commands by caching builds remotely based on your project's [fingerprint](https://docs.expo.dev/versions/latest/sdk/fingerprint/).
88

99
### How it works with Expo's caching system
1010

@@ -53,15 +53,11 @@ Add the build cache provider to your `app.json` or `app.config.js`:
5353
```json
5454
{
5555
"expo": {
56-
"experiments": {
57-
"remoteBuildCache": {
58-
"provider": {
59-
"plugin": "@eggl-js/expo-github-cache",
60-
"options": {
61-
"owner": "demo-org",
62-
"repo": "demo-repo",
63-
}
64-
}
56+
"buildCacheProvider": {
57+
"plugin": "@eggl-js/expo-github-cache",
58+
"options": {
59+
"owner": "demo-org",
60+
"repo": "demo-repo",
6561
}
6662
}
6763
}

__tests__/basic.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("GitHub Cache Plugin Basic Tests", () => {
1919
// When buildCache is false, the function should return null immediately
2020
const props = createDummyProps("ios");
2121

22-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
22+
const result = await buildCachePlugin.resolveBuildCache(props, {
2323
owner: "owner",
2424
repo: "repo",
2525
});
@@ -35,7 +35,7 @@ describe("GitHub Cache Plugin Basic Tests", () => {
3535
};
3636

3737
// Since GITHUB_TOKEN is missing, this should return null but still generate the tag name internally
38-
const result = await buildCachePlugin.uploadRemoteBuildCache(uploadProps, {
38+
const result = await buildCachePlugin.uploadBuildCache(uploadProps, {
3939
owner: "owner",
4040
repo: "repo",
4141
});
@@ -51,7 +51,7 @@ describe("GitHub Cache Plugin Basic Tests", () => {
5151
};
5252

5353
// Since GITHUB_TOKEN is missing, this should return null but still generate the tag name internally
54-
const result = await buildCachePlugin.uploadRemoteBuildCache(uploadProps, {
54+
const result = await buildCachePlugin.uploadBuildCache(uploadProps, {
5555
owner: "owner",
5656
repo: "repo",
5757
});

__tests__/edge-cases.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("Build Cache Edge Cases", () => {
1313
},
1414
};
1515

16-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
16+
const result = await buildCachePlugin.resolveBuildCache(props, {
1717
owner: "owner",
1818
repo: "repo",
1919
});
@@ -31,7 +31,7 @@ describe("Build Cache Edge Cases", () => {
3131
},
3232
};
3333

34-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
34+
const result = await buildCachePlugin.resolveBuildCache(props, {
3535
owner: "owner",
3636
repo: "repo",
3737
});
@@ -47,7 +47,7 @@ describe("Build Cache Edge Cases", () => {
4747
runOptions: {} as any, // Empty runOptions
4848
};
4949

50-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
50+
const result = await buildCachePlugin.resolveBuildCache(props, {
5151
owner: "owner",
5252
repo: "repo",
5353
});
@@ -67,14 +67,14 @@ describe("Build Cache Edge Cases", () => {
6767
};
6868

6969
// Test with empty owner
70-
const result1 = await buildCachePlugin.resolveRemoteBuildCache(props, {
70+
const result1 = await buildCachePlugin.resolveBuildCache(props, {
7171
owner: "",
7272
repo: "repo",
7373
});
7474
expect(result1).toBeNull();
7575

7676
// Test with empty repo
77-
const result2 = await buildCachePlugin.resolveRemoteBuildCache(props, {
77+
const result2 = await buildCachePlugin.resolveBuildCache(props, {
7878
owner: "owner",
7979
repo: "",
8080
});
@@ -96,7 +96,7 @@ describe("Build Cache Edge Cases", () => {
9696
const originalToken = process.env.GITHUB_TOKEN;
9797
delete process.env.GITHUB_TOKEN;
9898

99-
const result = await buildCachePlugin.uploadRemoteBuildCache(props, {
99+
const result = await buildCachePlugin.uploadBuildCache(props, {
100100
owner: "owner",
101101
repo: "repo",
102102
});

__tests__/index.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ describe("GitHub Cache Plugin - Environment Variable Tests", () => {
2929
process.env = { ...originalEnv };
3030
});
3131

32-
describe("resolveRemoteBuildCache", () => {
32+
describe("resolveBuildCache", () => {
3333
test("should return null when GITHUB_TOKEN is missing", async () => {
3434
// Ensure GITHUB_TOKEN is not set
3535
delete process.env.GITHUB_TOKEN;
3636

37-
const result = await buildCachePlugin.resolveRemoteBuildCache(
37+
const result = await buildCachePlugin.resolveBuildCache(
3838
createDummyProps("ios"),
3939
{ owner: "owner", repo: "repo" },
4040
);
@@ -48,7 +48,7 @@ describe("GitHub Cache Plugin - Environment Variable Tests", () => {
4848
const props = createDummyProps("ios");
4949
props.runOptions.buildCache = false;
5050

51-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
51+
const result = await buildCachePlugin.resolveBuildCache(props, {
5252
owner: "owner",
5353
repo: "repo",
5454
});
@@ -67,10 +67,10 @@ describe("GitHub Cache Plugin - Environment Variable Tests", () => {
6767
buildPath: "/fake/build/path/app.zip",
6868
};
6969

70-
const result = await buildCachePlugin.uploadRemoteBuildCache(
71-
uploadProps,
72-
{ owner: "owner", repo: "repo" },
73-
);
70+
const result = await buildCachePlugin.uploadBuildCache(uploadProps, {
71+
owner: "owner",
72+
repo: "repo",
73+
});
7474

7575
expect(result).toBeNull();
7676
});
@@ -82,7 +82,7 @@ describe("GitHub Cache Plugin - Environment Variable Tests", () => {
8282
const props = createDummyProps("ios");
8383
props.runOptions.buildCache = false; // Disable to avoid API calls
8484

85-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
85+
const result = await buildCachePlugin.resolveBuildCache(props, {
8686
owner: "owner",
8787
repo: "repo",
8888
});
@@ -95,7 +95,7 @@ describe("GitHub Cache Plugin - Environment Variable Tests", () => {
9595
const props = createDummyProps("android");
9696
props.runOptions.buildCache = false; // Disable to avoid API calls
9797

98-
const result = await buildCachePlugin.resolveRemoteBuildCache(props, {
98+
const result = await buildCachePlugin.resolveBuildCache(props, {
9999
owner: "owner",
100100
repo: "repo",
101101
});

0 commit comments

Comments
 (0)