@expo/eas-json 3.8.0 → 3.9.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/build/accessor.d.ts +5 -1
- package/build/accessor.js +24 -5
- package/build/index.d.ts +1 -0
- package/build/index.js +3 -1
- package/package.json +3 -3
package/build/accessor.d.ts
CHANGED
|
@@ -6,11 +6,15 @@ export declare class EasJsonAccessor {
|
|
|
6
6
|
private easJsonRawContents;
|
|
7
7
|
private easJsonRawObject;
|
|
8
8
|
private easJsonPatched;
|
|
9
|
-
constructor(
|
|
9
|
+
private constructor();
|
|
10
|
+
private constructor();
|
|
11
|
+
static fromProjectPath(projectDir: string): EasJsonAccessor;
|
|
12
|
+
static fromRawString(easJsonRawContents: string): EasJsonAccessor;
|
|
10
13
|
static formatEasJsonPath(projectDir: string): string;
|
|
11
14
|
readAsync(): Promise<EasJson>;
|
|
12
15
|
writeAsync(): Promise<void>;
|
|
13
16
|
patch(fn: (easJsonRawObject: any) => any): void;
|
|
14
17
|
readRawJsonAsync(): Promise<any>;
|
|
18
|
+
private parseRawJson;
|
|
15
19
|
private resetState;
|
|
16
20
|
}
|
package/build/accessor.js
CHANGED
|
@@ -28,10 +28,17 @@ const customErrorMessageHandlers = [
|
|
|
28
28
|
},
|
|
29
29
|
];
|
|
30
30
|
class EasJsonAccessor {
|
|
31
|
-
constructor(projectDir) {
|
|
31
|
+
constructor({ projectDir, easJsonRawContents, }) {
|
|
32
32
|
this.isJson5 = false;
|
|
33
33
|
this.easJsonPatched = false;
|
|
34
|
-
this.easJsonPath = EasJsonAccessor.formatEasJsonPath(projectDir);
|
|
34
|
+
this.easJsonPath = projectDir && EasJsonAccessor.formatEasJsonPath(projectDir);
|
|
35
|
+
this.easJsonRawContents = easJsonRawContents;
|
|
36
|
+
}
|
|
37
|
+
static fromProjectPath(projectDir) {
|
|
38
|
+
return new EasJsonAccessor({ projectDir });
|
|
39
|
+
}
|
|
40
|
+
static fromRawString(easJsonRawContents) {
|
|
41
|
+
return new EasJsonAccessor({ easJsonRawContents });
|
|
35
42
|
}
|
|
36
43
|
static formatEasJsonPath(projectDir) {
|
|
37
44
|
return path_1.default.join(projectDir, 'eas.json');
|
|
@@ -58,6 +65,9 @@ class EasJsonAccessor {
|
|
|
58
65
|
return value;
|
|
59
66
|
}
|
|
60
67
|
async writeAsync() {
|
|
68
|
+
if (!this.easJsonPath) {
|
|
69
|
+
throw new Error('Updates are not supported for EasJsonAccessor created from string.');
|
|
70
|
+
}
|
|
61
71
|
if (!this.easJsonPatched) {
|
|
62
72
|
return;
|
|
63
73
|
}
|
|
@@ -65,6 +75,9 @@ class EasJsonAccessor {
|
|
|
65
75
|
this.resetState();
|
|
66
76
|
}
|
|
67
77
|
patch(fn) {
|
|
78
|
+
if (!this.easJsonPath) {
|
|
79
|
+
throw new Error('Updates are not supported for EasJsonAccessor created from string.');
|
|
80
|
+
}
|
|
68
81
|
(0, assert_1.default)(this.easJsonRawContents && this.easJsonRawObject, 'call readAsync/readRawJsonAsync first');
|
|
69
82
|
this.easJsonRawObject = fn(this.easJsonRawObject);
|
|
70
83
|
if (this.isJson5) {
|
|
@@ -76,10 +89,16 @@ class EasJsonAccessor {
|
|
|
76
89
|
this.easJsonPatched = true;
|
|
77
90
|
}
|
|
78
91
|
async readRawJsonAsync() {
|
|
79
|
-
if (
|
|
80
|
-
|
|
92
|
+
if (this.easJsonPath) {
|
|
93
|
+
if (!(await fs_extra_1.default.pathExists(this.easJsonPath))) {
|
|
94
|
+
throw new errors_1.MissingEasJsonError(`${chalk_1.default.bold('eas.json')} could not be found at ${this.easJsonPath}. Learn more at https://expo.fyi/eas-json`);
|
|
95
|
+
}
|
|
96
|
+
this.easJsonRawContents = await fs_extra_1.default.readFile(this.easJsonPath, 'utf-8');
|
|
81
97
|
}
|
|
82
|
-
this.
|
|
98
|
+
return this.parseRawJson();
|
|
99
|
+
}
|
|
100
|
+
parseRawJson() {
|
|
101
|
+
(0, assert_1.default)(this.easJsonRawContents !== undefined, 'easJsonRawContents needs to be set before calling parseRawJson');
|
|
83
102
|
if (this.easJsonRawContents.trim().length === 0) {
|
|
84
103
|
throw new errors_1.InvalidEasJsonError(`${chalk_1.default.bold('eas.json')} is empty.`);
|
|
85
104
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { AndroidReleaseStatus, AndroidReleaseTrack, SubmitProfile } from './submit/types';
|
|
2
2
|
export { getDefaultProfile as getDefaultSubmitProfile } from './submit/resolver';
|
|
3
3
|
export { EasJson, ProfileType, AppVersionSource } from './types';
|
|
4
|
+
export { Platform } from '@expo/eas-build-job';
|
|
4
5
|
export { AndroidVersionAutoIncrement, BuildProfile, CredentialsSource, DistributionType, IosEnterpriseProvisioning, IosVersionAutoIncrement, ResourceClass, } from './build/types';
|
|
5
6
|
export { EasJsonAccessor } from './accessor';
|
|
6
7
|
export { EasJsonUtils } from './utils';
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.errors = exports.EasJsonUtils = exports.EasJsonAccessor = exports.ResourceClass = exports.CredentialsSource = exports.AppVersionSource = exports.getDefaultSubmitProfile = exports.AndroidReleaseTrack = exports.AndroidReleaseStatus = void 0;
|
|
3
|
+
exports.errors = exports.EasJsonUtils = exports.EasJsonAccessor = exports.ResourceClass = exports.CredentialsSource = exports.Platform = exports.AppVersionSource = exports.getDefaultSubmitProfile = exports.AndroidReleaseTrack = exports.AndroidReleaseStatus = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var types_1 = require("./submit/types");
|
|
6
6
|
Object.defineProperty(exports, "AndroidReleaseStatus", { enumerable: true, get: function () { return types_1.AndroidReleaseStatus; } });
|
|
@@ -9,6 +9,8 @@ var resolver_1 = require("./submit/resolver");
|
|
|
9
9
|
Object.defineProperty(exports, "getDefaultSubmitProfile", { enumerable: true, get: function () { return resolver_1.getDefaultProfile; } });
|
|
10
10
|
var types_2 = require("./types");
|
|
11
11
|
Object.defineProperty(exports, "AppVersionSource", { enumerable: true, get: function () { return types_2.AppVersionSource; } });
|
|
12
|
+
var eas_build_job_1 = require("@expo/eas-build-job");
|
|
13
|
+
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return eas_build_job_1.Platform; } });
|
|
12
14
|
var types_3 = require("./build/types");
|
|
13
15
|
Object.defineProperty(exports, "CredentialsSource", { enumerable: true, get: function () { return types_3.CredentialsSource; } });
|
|
14
16
|
Object.defineProperty(exports, "ResourceClass", { enumerable: true, get: function () { return types_3.ResourceClass; } });
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/eas-json",
|
|
3
3
|
"description": "A library for interacting with eas.json",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.9.1",
|
|
5
5
|
"author": "Expo <support@expo.dev>",
|
|
6
6
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@babel/code-frame": "7.18.6",
|
|
9
|
-
"@expo/eas-build-job": "0.
|
|
9
|
+
"@expo/eas-build-job": "1.0.7",
|
|
10
10
|
"chalk": "4.1.2",
|
|
11
11
|
"env-string": "1.0.1",
|
|
12
12
|
"fs-extra": "10.1.0",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"node": "18.6.0",
|
|
52
52
|
"yarn": "1.22.19"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "1072b759273930292fc3dec6feda13e77bd49047"
|
|
55
55
|
}
|