eas-build-cache-provider 0.0.2 → 16.4.2
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 +21 -0
- package/README.md +19 -0
- package/build/helpers.d.ts +1 -2
- package/build/index.d.ts +3 -3
- package/build/index.js +8 -8
- package/package.json +4 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
# eas-build-cache-provider
|
|
2
2
|
|
|
3
3
|
A build cache provider plugin for the Expo CLI
|
|
4
|
+
|
|
5
|
+
To use the EAS remote build provider plugin, install the `eas-build-cache-provider` package as a developer dependency:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install --save-dev eas-build-cache-provider
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Then, update your **app.json** to include the `buildCacheProvider` property and its provider under `experiments`:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"expo": {
|
|
16
|
+
...
|
|
17
|
+
"experiments": {
|
|
18
|
+
"buildCacheProvider": "eas"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
package/build/helpers.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { RunOptions } from '@expo/config';
|
|
1
2
|
import { SpawnResult } from '@expo/spawn-async';
|
|
2
|
-
type RunOptions = any;
|
|
3
3
|
export declare function isSpawnResultError(obj: any): obj is Error & SpawnResult;
|
|
4
4
|
export declare function isDevClientBuild({ runOptions, projectRoot, }: {
|
|
5
5
|
runOptions: RunOptions;
|
|
6
6
|
projectRoot: string;
|
|
7
7
|
}): boolean;
|
|
8
8
|
export declare function hasDirectDevClientDependency(projectRoot: string): boolean;
|
|
9
|
-
export {};
|
package/build/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import { BuildCacheProviderPlugin } from '@expo/config';
|
|
2
|
+
declare const EASBuildCacheProvider: BuildCacheProviderPlugin;
|
|
3
|
+
export default EASBuildCacheProvider;
|
package/build/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
|
7
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const helpers_1 = require("./helpers");
|
|
9
9
|
const log_1 = tslib_1.__importDefault(require("./log"));
|
|
10
|
-
async function
|
|
10
|
+
async function resolveBuildCacheAsync({ projectRoot, platform, fingerprintHash, runOptions, }) {
|
|
11
11
|
const easJsonPath = path_1.default.join(projectRoot, 'eas.json');
|
|
12
12
|
if (!(await fs_extra_1.default.exists(easJsonPath))) {
|
|
13
13
|
log_1.default.debug('eas.json not found, skip checking for remote builds');
|
|
@@ -37,19 +37,19 @@ async function resolveRemoteBuildCacheAsync({ projectRoot, platform, fingerprint
|
|
|
37
37
|
log_1.default.debug('eas-cli error:', error);
|
|
38
38
|
// @TODO(2025-04-11): remove this in a future release
|
|
39
39
|
if ((0, helpers_1.isSpawnResultError)(error) && error.stderr.includes('command build:download not found')) {
|
|
40
|
-
log_1.default.warn(`To take advantage of
|
|
40
|
+
log_1.default.warn(`To take advantage of EAS build cache provider, upgrade your eas-cli installation to latest.`);
|
|
41
41
|
}
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
async function
|
|
45
|
+
async function uploadBuildCacheAsync({ projectRoot, platform, fingerprintHash, buildPath, }) {
|
|
46
46
|
const easJsonPath = path_1.default.join(projectRoot, 'eas.json');
|
|
47
47
|
if (!(await fs_extra_1.default.exists(easJsonPath))) {
|
|
48
48
|
log_1.default.debug('eas.json not found, skip uploading builds');
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
51
51
|
try {
|
|
52
|
-
log_1.default.log((0, chalk_1.default) `{whiteBright \u203A} {bold Uploading build to
|
|
52
|
+
log_1.default.log((0, chalk_1.default) `{whiteBright \u203A} {bold Uploading build to EAS}`);
|
|
53
53
|
const results = await (0, spawn_async_1.default)('npx', [
|
|
54
54
|
'eas-cli',
|
|
55
55
|
'upload',
|
|
@@ -90,9 +90,9 @@ async function calculateEASFingerprintHashAsync({ projectRoot, platform, }) {
|
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const EASBuildCacheProvider = {
|
|
94
|
+
resolveBuildCache: resolveBuildCacheAsync,
|
|
95
|
+
uploadBuildCache: uploadBuildCacheAsync,
|
|
96
96
|
calculateFingerprintHash: calculateEASFingerprintHashAsync,
|
|
97
97
|
};
|
|
98
|
-
exports.default =
|
|
98
|
+
exports.default = EASBuildCacheProvider;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eas-build-cache-provider",
|
|
3
3
|
"description": "A build cache provider plugin for the Expo CLI",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "16.4.2",
|
|
5
5
|
"author": "Expo <support@expo.dev>",
|
|
6
6
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@expo/config": "10.0.6",
|
|
9
8
|
"@babel/code-frame": "7.23.5",
|
|
9
|
+
"@expo/config": "11.0.10",
|
|
10
10
|
"@expo/spawn-async": "^1.7.2",
|
|
11
11
|
"chalk": "4.1.2",
|
|
12
12
|
"figures": "3.2.0",
|
|
@@ -54,5 +54,6 @@
|
|
|
54
54
|
"volta": {
|
|
55
55
|
"node": "20.11.0",
|
|
56
56
|
"yarn": "1.22.21"
|
|
57
|
-
}
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "25c77d05f408ee12ff36cd14aaf7c97d739c31a6"
|
|
58
59
|
}
|