@expo/config 7.0.3 → 8.0.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/Config.d.ts +1 -13
- package/build/Config.js +49 -369
- package/build/Config.js.map +1 -1
- package/build/Config.types.d.ts +18 -21
- package/build/Config.types.js +0 -5
- package/build/Config.types.js.map +1 -1
- package/build/Errors.js +3 -7
- package/build/Errors.js.map +1 -1
- package/build/Serialize.js +4 -24
- package/build/Serialize.js.map +1 -1
- package/build/evalConfig.d.ts +2 -2
- package/build/evalConfig.js +12 -44
- package/build/evalConfig.js.map +1 -1
- package/build/getAccountUsername.d.ts +9 -0
- package/build/{getFullName.js → getAccountUsername.js} +8 -21
- package/build/getAccountUsername.js.map +1 -0
- package/build/getConfig.js +2 -23
- package/build/getConfig.js.map +1 -1
- package/build/getExpoSDKVersion.d.ts +6 -0
- package/build/getExpoSDKVersion.js +60 -0
- package/build/getExpoSDKVersion.js.map +1 -0
- package/build/getUserState.d.ts +3 -3
- package/build/getUserState.js +0 -20
- package/build/getUserState.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.js +8 -19
- package/build/index.js.map +1 -1
- package/build/paths/extensions.d.ts +1 -2
- package/build/paths/extensions.js +8 -35
- package/build/paths/extensions.js.map +1 -1
- package/build/paths/index.js +0 -4
- package/build/paths/index.js.map +1 -1
- package/build/paths/paths.js +37 -67
- package/build/paths/paths.js.map +1 -1
- package/build/plugins/withConfigPlugins.js +2 -13
- package/build/plugins/withConfigPlugins.js.map +1 -1
- package/build/plugins/withInternal.js +1 -8
- package/build/plugins/withInternal.js.map +1 -1
- package/build/resolvePackageJson.js +1 -21
- package/build/resolvePackageJson.js.map +1 -1
- package/package.json +5 -5
- package/build/Project.d.ts +0 -2
- package/build/Project.js +0 -64
- package/build/Project.js.map +0 -1
- package/build/getFullName.d.ts +0 -10
- package/build/getFullName.js.map +0 -1
- package/build/isLegacyImportsEnabled.d.ts +0 -7
- package/build/isLegacyImportsEnabled.js +0 -61
- package/build/isLegacyImportsEnabled.js.map +0 -1
package/build/evalConfig.js
CHANGED
|
@@ -5,59 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.evalConfig = evalConfig;
|
|
7
7
|
exports.resolveConfigExport = resolveConfigExport;
|
|
8
|
-
|
|
9
8
|
function _fs() {
|
|
10
9
|
const data = require("fs");
|
|
11
|
-
|
|
12
10
|
_fs = function () {
|
|
13
11
|
return data;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return data;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
function _requireFromString() {
|
|
20
16
|
const data = _interopRequireDefault(require("require-from-string"));
|
|
21
|
-
|
|
22
17
|
_requireFromString = function () {
|
|
23
18
|
return data;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
return data;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
function _sucrase() {
|
|
30
23
|
const data = require("sucrase");
|
|
31
|
-
|
|
32
24
|
_sucrase = function () {
|
|
33
25
|
return data;
|
|
34
26
|
};
|
|
35
|
-
|
|
36
27
|
return data;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
function _Errors() {
|
|
40
30
|
const data = require("./Errors");
|
|
41
|
-
|
|
42
31
|
_Errors = function () {
|
|
43
32
|
return data;
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
return data;
|
|
47
35
|
}
|
|
48
|
-
|
|
49
36
|
function _Serialize() {
|
|
50
37
|
const data = require("./Serialize");
|
|
51
|
-
|
|
52
38
|
_Serialize = function () {
|
|
53
39
|
return data;
|
|
54
40
|
};
|
|
55
|
-
|
|
56
41
|
return data;
|
|
57
42
|
}
|
|
58
|
-
|
|
59
43
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
60
|
-
|
|
61
44
|
/**
|
|
62
45
|
* Transpile and evaluate the dynamic config object.
|
|
63
46
|
* This method is shared between the standard reading method in getConfig, and the headless script.
|
|
@@ -68,7 +51,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
68
51
|
function evalConfig(configFile, request) {
|
|
69
52
|
const contents = (0, _fs().readFileSync)(configFile, 'utf8');
|
|
70
53
|
let result;
|
|
71
|
-
|
|
72
54
|
try {
|
|
73
55
|
const {
|
|
74
56
|
code
|
|
@@ -78,13 +60,13 @@ function evalConfig(configFile, request) {
|
|
|
78
60
|
});
|
|
79
61
|
result = (0, _requireFromString().default)(code, configFile);
|
|
80
62
|
} catch (error) {
|
|
81
|
-
const location = extractLocationFromSyntaxError(error);
|
|
63
|
+
const location = extractLocationFromSyntaxError(error);
|
|
82
64
|
|
|
65
|
+
// Apply a code frame preview to the error if possible, sucrase doesn't do this by default.
|
|
83
66
|
if (location) {
|
|
84
67
|
const {
|
|
85
68
|
codeFrameColumns
|
|
86
69
|
} = require('@babel/code-frame');
|
|
87
|
-
|
|
88
70
|
const codeFrame = codeFrameColumns(contents, {
|
|
89
71
|
start: error.loc
|
|
90
72
|
}, {
|
|
@@ -94,57 +76,50 @@ function evalConfig(configFile, request) {
|
|
|
94
76
|
error.message += `\n${codeFrame}`;
|
|
95
77
|
} else {
|
|
96
78
|
const importantStack = extractImportantStackFromNodeError(error);
|
|
97
|
-
|
|
98
79
|
if (importantStack) {
|
|
99
80
|
error.message += `\n${importantStack}`;
|
|
100
81
|
}
|
|
101
82
|
}
|
|
102
|
-
|
|
103
83
|
throw error;
|
|
104
84
|
}
|
|
105
|
-
|
|
106
85
|
return resolveConfigExport(result, configFile, request);
|
|
107
86
|
}
|
|
108
|
-
|
|
109
87
|
function extractLocationFromSyntaxError(error) {
|
|
110
88
|
// sucrase provides the `loc` object
|
|
111
89
|
if (error.loc) {
|
|
112
90
|
return error.loc;
|
|
113
|
-
}
|
|
114
|
-
|
|
91
|
+
}
|
|
115
92
|
|
|
93
|
+
// `SyntaxError`s provide the `lineNumber` and `columnNumber` properties
|
|
116
94
|
if ('lineNumber' in error && 'columnNumber' in error) {
|
|
117
95
|
return {
|
|
118
96
|
line: error.lineNumber,
|
|
119
97
|
column: error.columnNumber
|
|
120
98
|
};
|
|
121
99
|
}
|
|
122
|
-
|
|
123
100
|
return null;
|
|
124
|
-
}
|
|
125
|
-
// An example is a module that includes an import statement.
|
|
126
|
-
|
|
101
|
+
}
|
|
127
102
|
|
|
103
|
+
// These kinda errors often come from syntax errors in files that were imported by the main file.
|
|
104
|
+
// An example is a module that includes an import statement.
|
|
128
105
|
function extractImportantStackFromNodeError(error) {
|
|
129
106
|
if (isSyntaxError(error)) {
|
|
130
107
|
var _error$stack;
|
|
131
|
-
|
|
132
108
|
const traces = (_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : _error$stack.split('\n').filter(line => !line.startsWith(' at '));
|
|
133
|
-
if (!traces) return null;
|
|
109
|
+
if (!traces) return null;
|
|
134
110
|
|
|
111
|
+
// Remove redundant line
|
|
135
112
|
if (traces[traces.length - 1].startsWith('SyntaxError:')) {
|
|
136
113
|
traces.pop();
|
|
137
114
|
}
|
|
138
|
-
|
|
139
115
|
return traces.join('\n');
|
|
140
116
|
}
|
|
141
|
-
|
|
142
117
|
return null;
|
|
143
118
|
}
|
|
144
|
-
|
|
145
119
|
function isSyntaxError(error) {
|
|
146
120
|
return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';
|
|
147
121
|
}
|
|
122
|
+
|
|
148
123
|
/**
|
|
149
124
|
* - Resolve the exported contents of an Expo config (be it default or module.exports)
|
|
150
125
|
* - Assert no promise exports
|
|
@@ -155,32 +130,25 @@ function isSyntaxError(error) {
|
|
|
155
130
|
* @param configFile
|
|
156
131
|
* @param request
|
|
157
132
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
133
|
function resolveConfigExport(result, configFile, request) {
|
|
161
134
|
var _result;
|
|
162
|
-
|
|
163
135
|
if (result.default != null) {
|
|
164
136
|
result = result.default;
|
|
165
137
|
}
|
|
166
|
-
|
|
167
138
|
const exportedObjectType = typeof result;
|
|
168
|
-
|
|
169
139
|
if (typeof result === 'function') {
|
|
170
140
|
result = result(request);
|
|
171
141
|
}
|
|
172
|
-
|
|
173
142
|
if (result instanceof Promise) {
|
|
174
143
|
throw new (_Errors().ConfigError)(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');
|
|
175
|
-
}
|
|
176
|
-
|
|
144
|
+
}
|
|
177
145
|
|
|
146
|
+
// If the expo object exists, ignore all other values.
|
|
178
147
|
if ((_result = result) !== null && _result !== void 0 && _result.expo) {
|
|
179
148
|
result = (0, _Serialize().serializeSkippingMods)(result.expo);
|
|
180
149
|
} else {
|
|
181
150
|
result = (0, _Serialize().serializeSkippingMods)(result);
|
|
182
151
|
}
|
|
183
|
-
|
|
184
152
|
return {
|
|
185
153
|
config: result,
|
|
186
154
|
exportedObjectType
|
package/build/evalConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evalConfig.js","names":["evalConfig","configFile","request","contents","readFileSync","result","code","transform","filePath","transforms","requireString","error","location","extractLocationFromSyntaxError","codeFrameColumns","require","codeFrame","start","loc","highlightCode","message","importantStack","extractImportantStackFromNodeError","resolveConfigExport","line","lineNumber","column","columnNumber","isSyntaxError","traces","stack","split","filter","startsWith","length","pop","join","SyntaxError","constructor","name","default","exportedObjectType","Promise","ConfigError","expo","serializeSkippingMods","config"],"sources":["../src/evalConfig.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport requireString from 'require-from-string';\nimport { transform } from 'sucrase';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { serializeSkippingMods } from './Serialize';\n\ntype RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;\n\nexport type DynamicConfigResults = { config: RawDynamicConfig; exportedObjectType: string };\n\n/**\n * Transpile and evaluate the dynamic config object.\n * This method is shared between the standard reading method in getConfig, and the headless script.\n *\n * @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.\n * @returns the serialized and evaluated config along with the exported object type (object or function).\n */\nexport function evalConfig(\n configFile: string,\n request: ConfigContext | null\n): DynamicConfigResults {\n const contents = readFileSync(configFile, 'utf8');\n let result: any;\n try {\n const { code } = transform(contents, {\n filePath: configFile,\n transforms: ['typescript', 'imports'],\n });\n\n result = requireString(code, configFile);\n } catch (error: any) {\n const location = extractLocationFromSyntaxError(error);\n\n // Apply a code frame preview to the error if possible, sucrase doesn't do this by default.\n if (location) {\n const { codeFrameColumns } = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(contents, { start: error.loc }, { highlightCode: true });\n error.codeFrame = codeFrame;\n error.message += `\\n${codeFrame}`;\n } else {\n const importantStack = extractImportantStackFromNodeError(error);\n\n if (importantStack) {\n error.message += `\\n${importantStack}`;\n }\n }\n throw error;\n }\n return resolveConfigExport(result, configFile, request);\n}\n\nfunction extractLocationFromSyntaxError(\n error: Error | any\n): { line: number; column?: number } | null {\n // sucrase provides the `loc` object\n if (error.loc) {\n return error.loc;\n }\n\n // `SyntaxError`s provide the `lineNumber` and `columnNumber` properties\n if ('lineNumber' in error && 'columnNumber' in error) {\n return { line: error.lineNumber, column: error.columnNumber };\n }\n\n return null;\n}\n\n// These kinda errors often come from syntax errors in files that were imported by the main file.\n// An example is a module that includes an import statement.\nfunction extractImportantStackFromNodeError(error: any): string | null {\n if (isSyntaxError(error)) {\n const traces = error.stack?.split('\\n').filter((line) => !line.startsWith(' at '));\n if (!traces) return null;\n\n // Remove redundant line\n if (traces[traces.length - 1].startsWith('SyntaxError:')) {\n traces.pop();\n }\n return traces.join('\\n');\n }\n return null;\n}\n\nfunction isSyntaxError(error: any): error is SyntaxError {\n return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param result\n * @param configFile\n * @param request\n */\nexport function resolveConfigExport(\n result: any,\n configFile: string,\n request: ConfigContext | null\n) {\n if (result.default != null) {\n result = result.default;\n }\n const exportedObjectType = typeof result;\n if (typeof result === 'function') {\n result = result(request);\n }\n\n if (result instanceof Promise) {\n throw new ConfigError(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');\n }\n\n // If the expo object exists, ignore all other values.\n if (result?.expo) {\n result = serializeSkippingMods(result.expo);\n } else {\n result = serializeSkippingMods(result);\n }\n\n return { config: result, exportedObjectType };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"evalConfig.js","names":["evalConfig","configFile","request","contents","readFileSync","result","code","transform","filePath","transforms","requireString","error","location","extractLocationFromSyntaxError","codeFrameColumns","require","codeFrame","start","loc","highlightCode","message","importantStack","extractImportantStackFromNodeError","resolveConfigExport","line","lineNumber","column","columnNumber","isSyntaxError","traces","stack","split","filter","startsWith","length","pop","join","SyntaxError","constructor","name","default","exportedObjectType","Promise","ConfigError","expo","serializeSkippingMods","config"],"sources":["../src/evalConfig.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport requireString from 'require-from-string';\nimport { transform } from 'sucrase';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { serializeSkippingMods } from './Serialize';\n\ntype RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;\n\nexport type DynamicConfigResults = { config: RawDynamicConfig; exportedObjectType: string };\n\n/**\n * Transpile and evaluate the dynamic config object.\n * This method is shared between the standard reading method in getConfig, and the headless script.\n *\n * @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.\n * @returns the serialized and evaluated config along with the exported object type (object or function).\n */\nexport function evalConfig(\n configFile: string,\n request: ConfigContext | null\n): DynamicConfigResults {\n const contents = readFileSync(configFile, 'utf8');\n let result: any;\n try {\n const { code } = transform(contents, {\n filePath: configFile,\n transforms: ['typescript', 'imports'],\n });\n\n result = requireString(code, configFile);\n } catch (error: any) {\n const location = extractLocationFromSyntaxError(error);\n\n // Apply a code frame preview to the error if possible, sucrase doesn't do this by default.\n if (location) {\n const { codeFrameColumns } = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(contents, { start: error.loc }, { highlightCode: true });\n error.codeFrame = codeFrame;\n error.message += `\\n${codeFrame}`;\n } else {\n const importantStack = extractImportantStackFromNodeError(error);\n\n if (importantStack) {\n error.message += `\\n${importantStack}`;\n }\n }\n throw error;\n }\n return resolveConfigExport(result, configFile, request);\n}\n\nfunction extractLocationFromSyntaxError(\n error: Error | any\n): { line: number; column?: number } | null {\n // sucrase provides the `loc` object\n if (error.loc) {\n return error.loc;\n }\n\n // `SyntaxError`s provide the `lineNumber` and `columnNumber` properties\n if ('lineNumber' in error && 'columnNumber' in error) {\n return { line: error.lineNumber, column: error.columnNumber };\n }\n\n return null;\n}\n\n// These kinda errors often come from syntax errors in files that were imported by the main file.\n// An example is a module that includes an import statement.\nfunction extractImportantStackFromNodeError(error: any): string | null {\n if (isSyntaxError(error)) {\n const traces = error.stack?.split('\\n').filter((line) => !line.startsWith(' at '));\n if (!traces) return null;\n\n // Remove redundant line\n if (traces[traces.length - 1].startsWith('SyntaxError:')) {\n traces.pop();\n }\n return traces.join('\\n');\n }\n return null;\n}\n\nfunction isSyntaxError(error: any): error is SyntaxError {\n return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param result\n * @param configFile\n * @param request\n */\nexport function resolveConfigExport(\n result: any,\n configFile: string,\n request: ConfigContext | null\n) {\n if (result.default != null) {\n result = result.default;\n }\n const exportedObjectType = typeof result;\n if (typeof result === 'function') {\n result = result(request);\n }\n\n if (result instanceof Promise) {\n throw new ConfigError(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');\n }\n\n // If the expo object exists, ignore all other values.\n if (result?.expo) {\n result = serializeSkippingMods(result.expo);\n } else {\n result = serializeSkippingMods(result);\n }\n\n return { config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,CAACmC,OAAO,IAAI,IAAI,EAAE;IAC1BnC,MAAM,GAAGA,MAAM,CAACmC,OAAO;EACzB;EACA,MAAMC,kBAAkB,GAAG,OAAOpC,MAAM;EACxC,IAAI,OAAOA,MAAM,KAAK,UAAU,EAAE;IAChCA,MAAM,GAAGA,MAAM,CAACH,OAAO,CAAC;EAC1B;EAEA,IAAIG,MAAM,YAAYqC,OAAO,EAAE;IAC7B,MAAM,KAAIC,qBAAW,EAAE,eAAc1C,UAAW,2BAA0B,EAAE,gBAAgB,CAAC;EAC/F;;EAEA;EACA,eAAII,MAAM,oCAAN,QAAQuC,IAAI,EAAE;IAChBvC,MAAM,GAAG,IAAAwC,kCAAqB,EAACxC,MAAM,CAACuC,IAAI,CAAC;EAC7C,CAAC,MAAM;IACLvC,MAAM,GAAG,IAAAwC,kCAAqB,EAACxC,MAAM,CAAC;EACxC;EAEA,OAAO;IAAEyC,MAAM,EAAEzC,MAAM;IAAEoC;EAAmB,CAAC;AAC/C"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
/**
|
|
3
|
+
* Get the owner of the project from the manifest if specified, falling back to a bunch of different things
|
|
4
|
+
* which may or may not be the owner of the project.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using
|
|
7
|
+
* the EAS project ID, falling back to the `owner` field.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getAccountUsername(manifest?: Pick<ExpoConfig, 'owner'>): string;
|
|
@@ -4,43 +4,30 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getAccountUsername = getAccountUsername;
|
|
7
|
-
exports.getFullName = getFullName;
|
|
8
|
-
|
|
9
7
|
function _getUserState() {
|
|
10
8
|
const data = require("./getUserState");
|
|
11
|
-
|
|
12
9
|
_getUserState = function () {
|
|
13
10
|
return data;
|
|
14
11
|
};
|
|
15
|
-
|
|
16
12
|
return data;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
const ANONYMOUS_USERNAME = 'anonymous';
|
|
15
|
+
|
|
20
16
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* Get the owner of the project from the manifest if specified, falling back to a bunch of different things
|
|
18
|
+
* which may or may not be the owner of the project.
|
|
23
19
|
*
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
20
|
+
* @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using
|
|
21
|
+
* the EAS project ID, falling back to the `owner` field.
|
|
26
22
|
*/
|
|
27
|
-
|
|
28
|
-
function getFullName(manifest) {
|
|
29
|
-
const username = getAccountUsername(manifest);
|
|
30
|
-
return `@${username}/${manifest.slug}`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
23
|
function getAccountUsername(manifest = {}) {
|
|
34
24
|
var _getUserState$read$au;
|
|
35
|
-
|
|
36
25
|
// TODO: Must match what's generated in Expo Go.
|
|
37
26
|
const username = manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;
|
|
38
|
-
|
|
39
27
|
if (username) {
|
|
40
28
|
return username;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
}
|
|
30
|
+
// Statically get the username from the global user state.
|
|
44
31
|
return ((_getUserState$read$au = (0, _getUserState().getUserState)().read().auth) === null || _getUserState$read$au === void 0 ? void 0 : _getUserState$read$au.username) || ANONYMOUS_USERNAME;
|
|
45
32
|
}
|
|
46
|
-
//# sourceMappingURL=
|
|
33
|
+
//# sourceMappingURL=getAccountUsername.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccountUsername.js","names":["ANONYMOUS_USERNAME","getAccountUsername","manifest","username","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","getUserState","read","auth"],"sources":["../src/getAccountUsername.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { getUserState } from './getUserState';\n\nconst ANONYMOUS_USERNAME = 'anonymous';\n\n/**\n * Get the owner of the project from the manifest if specified, falling back to a bunch of different things\n * which may or may not be the owner of the project.\n *\n * @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using\n * the EAS project ID, falling back to the `owner` field.\n */\nexport function getAccountUsername(manifest: Pick<ExpoConfig, 'owner'> = {}): string {\n // TODO: Must match what's generated in Expo Go.\n const username =\n manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;\n if (username) {\n return username;\n }\n // Statically get the username from the global user state.\n return getUserState().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"mappings":";;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,kBAAkB,GAAG,WAAW;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkB,CAACC,QAAmC,GAAG,CAAC,CAAC,EAAU;EAAA;EACnF;EACA,MAAMC,QAAQ,GACZD,QAAQ,CAACE,KAAK,IAAIC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAIF,OAAO,CAACC,GAAG,CAACE,kBAAkB;EACnF,IAAIL,QAAQ,EAAE;IACZ,OAAOA,QAAQ;EACjB;EACA;EACA,OAAO,8BAAAM,4BAAY,GAAE,CAACC,IAAI,EAAE,CAACC,IAAI,0DAA1B,sBAA4BR,QAAQ,KAAIH,kBAAkB;AACnE"}
|
package/build/getConfig.js
CHANGED
|
@@ -5,49 +5,35 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getDynamicConfig = getDynamicConfig;
|
|
7
7
|
exports.getStaticConfig = getStaticConfig;
|
|
8
|
-
|
|
9
8
|
function _jsonFile() {
|
|
10
9
|
const data = _interopRequireDefault(require("@expo/json-file"));
|
|
11
|
-
|
|
12
10
|
_jsonFile = function () {
|
|
13
11
|
return data;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return data;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
function _fs() {
|
|
20
16
|
const data = require("fs");
|
|
21
|
-
|
|
22
17
|
_fs = function () {
|
|
23
18
|
return data;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
return data;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
function _Errors() {
|
|
30
23
|
const data = require("./Errors");
|
|
31
|
-
|
|
32
24
|
_Errors = function () {
|
|
33
25
|
return data;
|
|
34
26
|
};
|
|
35
|
-
|
|
36
27
|
return data;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
function _evalConfig() {
|
|
40
30
|
const data = require("./evalConfig");
|
|
41
|
-
|
|
42
31
|
_evalConfig = function () {
|
|
43
32
|
return data;
|
|
44
33
|
};
|
|
45
|
-
|
|
46
34
|
return data;
|
|
47
35
|
}
|
|
48
|
-
|
|
49
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
50
|
-
|
|
51
37
|
// We cannot use async config resolution right now because Next.js doesn't support async configs.
|
|
52
38
|
// If they don't add support for async Webpack configs then we may need to pull support for Next.js.
|
|
53
39
|
function readConfigFile(configFile, context) {
|
|
@@ -55,7 +41,6 @@ function readConfigFile(configFile, context) {
|
|
|
55
41
|
if (!(0, _fs().existsSync)(configFile)) {
|
|
56
42
|
return null;
|
|
57
43
|
}
|
|
58
|
-
|
|
59
44
|
try {
|
|
60
45
|
return (0, _evalConfig().evalConfig)(configFile, context);
|
|
61
46
|
} catch (error) {
|
|
@@ -65,29 +50,23 @@ function readConfigFile(configFile, context) {
|
|
|
65
50
|
throw error;
|
|
66
51
|
}
|
|
67
52
|
}
|
|
68
|
-
|
|
69
53
|
function getDynamicConfig(configPath, request) {
|
|
70
54
|
const config = readConfigFile(configPath, request);
|
|
71
|
-
|
|
72
55
|
if (config) {
|
|
73
56
|
// The config must be serialized and evaluated ahead of time so the spawned process can send it over.
|
|
74
57
|
return config;
|
|
75
|
-
}
|
|
58
|
+
}
|
|
59
|
+
// TODO: It seems this is only thrown if the file cannot be found (which may never happen).
|
|
76
60
|
// If so we should throw a more helpful error.
|
|
77
|
-
|
|
78
|
-
|
|
79
61
|
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
|
|
80
62
|
}
|
|
81
|
-
|
|
82
63
|
function getStaticConfig(configPath) {
|
|
83
64
|
const config = _jsonFile().default.read(configPath, {
|
|
84
65
|
json5: true
|
|
85
66
|
});
|
|
86
|
-
|
|
87
67
|
if (config) {
|
|
88
68
|
return config;
|
|
89
69
|
}
|
|
90
|
-
|
|
91
70
|
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
|
|
92
71
|
}
|
|
93
72
|
//# sourceMappingURL=getConfig.js.map
|
package/build/getConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getConfig.js","names":["readConfigFile","configFile","context","existsSync","evalConfig","error","isConfigError","message","getDynamicConfig","configPath","request","config","ConfigError","getStaticConfig","JsonFile","read","json5"],"sources":["../src/getConfig.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { existsSync } from 'fs';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { DynamicConfigResults, evalConfig } from './evalConfig';\n\n// We cannot use async config resolution right now because Next.js doesn't support async configs.\n// If they don't add support for async Webpack configs then we may need to pull support for Next.js.\nfunction readConfigFile(configFile: string, context: ConfigContext): null | DynamicConfigResults {\n // If the file doesn't exist then we should skip it and continue searching.\n if (!existsSync(configFile)) {\n return null;\n }\n try {\n return evalConfig(configFile, context);\n } catch (error: any) {\n // @ts-ignore\n error.isConfigError = true;\n error.message = `Error reading Expo config at ${configFile}:\\n\\n${error.message}`;\n throw error;\n }\n}\n\nexport function getDynamicConfig(configPath: string, request: ConfigContext): DynamicConfigResults {\n const config = readConfigFile(configPath, request);\n if (config) {\n // The config must be serialized and evaluated ahead of time so the spawned process can send it over.\n return config;\n }\n // TODO: It seems this is only thrown if the file cannot be found (which may never happen).\n // If so we should throw a more helpful error.\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n\nexport function getStaticConfig(configPath: string): AppJSONConfig | ExpoConfig {\n const config = JsonFile.read(configPath, { json5: true });\n if (config) {\n return config as any;\n }\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getConfig.js","names":["readConfigFile","configFile","context","existsSync","evalConfig","error","isConfigError","message","getDynamicConfig","configPath","request","config","ConfigError","getStaticConfig","JsonFile","read","json5"],"sources":["../src/getConfig.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { existsSync } from 'fs';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { DynamicConfigResults, evalConfig } from './evalConfig';\n\n// We cannot use async config resolution right now because Next.js doesn't support async configs.\n// If they don't add support for async Webpack configs then we may need to pull support for Next.js.\nfunction readConfigFile(configFile: string, context: ConfigContext): null | DynamicConfigResults {\n // If the file doesn't exist then we should skip it and continue searching.\n if (!existsSync(configFile)) {\n return null;\n }\n try {\n return evalConfig(configFile, context);\n } catch (error: any) {\n // @ts-ignore\n error.isConfigError = true;\n error.message = `Error reading Expo config at ${configFile}:\\n\\n${error.message}`;\n throw error;\n }\n}\n\nexport function getDynamicConfig(configPath: string, request: ConfigContext): DynamicConfigResults {\n const config = readConfigFile(configPath, request);\n if (config) {\n // The config must be serialized and evaluated ahead of time so the spawned process can send it over.\n return config;\n }\n // TODO: It seems this is only thrown if the file cannot be found (which may never happen).\n // If so we should throw a more helpful error.\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n\nexport function getStaticConfig(configPath: string): AppJSONConfig | ExpoConfig {\n const config = JsonFile.read(configPath, { json5: true });\n if (config) {\n return config as any;\n }\n thro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from './Config.types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the Expo SDK Version either from the input Expo config or from the installed
|
|
4
|
+
* version of the `expo` package.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getExpoSDKVersion(projectRoot: string, exp?: Pick<ExpoConfig, 'sdkVersion'>): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getExpoSDKVersion = getExpoSDKVersion;
|
|
7
|
+
function _jsonFile() {
|
|
8
|
+
const data = _interopRequireDefault(require("@expo/json-file"));
|
|
9
|
+
_jsonFile = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
function _resolveFrom() {
|
|
15
|
+
const data = _interopRequireDefault(require("resolve-from"));
|
|
16
|
+
_resolveFrom = function () {
|
|
17
|
+
return data;
|
|
18
|
+
};
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
function _Errors() {
|
|
22
|
+
const data = require("./Errors");
|
|
23
|
+
_Errors = function () {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the Expo SDK Version either from the input Expo config or from the installed
|
|
31
|
+
* version of the `expo` package.
|
|
32
|
+
*/
|
|
33
|
+
function getExpoSDKVersion(projectRoot, exp = {}) {
|
|
34
|
+
var _exp$sdkVersion;
|
|
35
|
+
return (_exp$sdkVersion = exp === null || exp === void 0 ? void 0 : exp.sdkVersion) !== null && _exp$sdkVersion !== void 0 ? _exp$sdkVersion : getExpoSDKVersionFromPackage(projectRoot);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the Expo SDK Version either from the input Expo config or from the installed
|
|
40
|
+
* version of the `expo` package.
|
|
41
|
+
*/
|
|
42
|
+
function getExpoSDKVersionFromPackage(projectRoot) {
|
|
43
|
+
const packageJsonPath = _resolveFrom().default.silent(projectRoot, 'expo/package.json');
|
|
44
|
+
if (!packageJsonPath) {
|
|
45
|
+
throw new (_Errors().ConfigError)(`Cannot determine which native SDK version your project uses because the module \`expo\` is not installed. Please install it with \`yarn add expo\` and try again.`, 'MODULE_NOT_FOUND');
|
|
46
|
+
}
|
|
47
|
+
const expoPackageJson = _jsonFile().default.read(packageJsonPath, {
|
|
48
|
+
json5: true
|
|
49
|
+
});
|
|
50
|
+
const {
|
|
51
|
+
version: packageVersion
|
|
52
|
+
} = expoPackageJson;
|
|
53
|
+
if (!(typeof packageVersion === 'string')) {
|
|
54
|
+
// This is technically impossible.
|
|
55
|
+
throw new (_Errors().ConfigError)(`Cannot determine which native SDK version your project uses because the module \`expo\` has an invalid package.json (missing \`version\` field). Try reinstalling node modules and trying again.`, 'MODULE_NOT_FOUND');
|
|
56
|
+
}
|
|
57
|
+
const majorVersion = packageVersion.split('.').shift();
|
|
58
|
+
return `${majorVersion}.0.0`;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=getExpoSDKVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getExpoSDKVersion.js","names":["getExpoSDKVersion","projectRoot","exp","sdkVersion","getExpoSDKVersionFromPackage","packageJsonPath","resolveFrom","silent","ConfigError","expoPackageJson","JsonFile","read","json5","version","packageVersion","majorVersion","split","shift"],"sources":["../src/getExpoSDKVersion.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\n\nimport { ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nexport function getExpoSDKVersion(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'> = {}\n): string {\n return exp?.sdkVersion ?? getExpoSDKVersionFromPackage(projectRoot);\n}\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nfunction getExpoSDKVersionFromPackage(projectRoot: string): string {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (!packageJsonPath) {\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` is not installed. Please install it with \\`yarn add expo\\` and try again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n const expoPackageJson = JsonFile.read(packageJsonPath, { json5: true });\n const { version: packageVersion } = expoPackageJson;\n\n if (!(typeof packageVersion === 'string')) {\n // This is technically impossible.\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` has an invalid package.json (missing \\`version\\` field). Try reinstalling node modules and trying again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n\n const majorVersion = packageVersion.split('.').shift();\n return `${majorVersion}.0.0`;\n}\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAGA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAuC;AAEvC;AACA;AACA;AACA;AACO,SAASA,iBAAiB,CAC/BC,WAAmB,EACnBC,GAAmC,GAAG,CAAC,CAAC,EAChC;EAAA;EACR,0BAAOA,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEC,UAAU,6DAAIC,4BAA4B,CAACH,WAAW,CAAC;AACrE;;AAEA;AACA;AACA;AACA;AACA,SAASG,4BAA4B,CAACH,WAAmB,EAAU;EACjE,MAAMI,eAAe,GAAGC,sBAAW,CAACC,MAAM,CAACN,WAAW,EAAE,mBAAmB,CAAC;EAC5E,IAAI,CAACI,eAAe,EAAE;IACpB,MAAM,KAAIG,qBAAW,EAClB,mKAAkK,EACnK,kBAAkB,CACnB;EACH;EACA,MAAMC,eAAe,GAAGC,mBAAQ,CAACC,IAAI,CAACN,eAAe,EAAE;IAAEO,KAAK,EAAE;EAAK,CAAC,CAAC;EACvE,MAAM;IAAEC,OAAO,EAAEC;EAAe,CAAC,GAAGL,eAAe;EAEnD,IAAI,EAAE,OAAOK,cAAc,KAAK,QAAQ,CAAC,EAAE;IACzC;IACA,MAAM,KAAIN,qBAAW,EAClB,kMAAiM,EAClM,kBAAkB,CACnB;EACH;EAEA,MAAMO,YAAY,GAAGD,cAAc,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,KAAK,EAAE;EACtD,OAAQ,GAAEF,YAAa,MAAK;AAC9B"}
|
package/build/getUserState.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import JsonFile from '@expo/json-file';
|
|
2
|
-
export
|
|
2
|
+
export type UserSettingsData = {
|
|
3
3
|
developmentCodeSigningId?: string;
|
|
4
4
|
appleId?: string;
|
|
5
5
|
accessToken?: string;
|
|
@@ -10,14 +10,14 @@ export declare type UserSettingsData = {
|
|
|
10
10
|
sendTo?: string;
|
|
11
11
|
uuid?: string;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type UserData = {
|
|
14
14
|
appleId?: string;
|
|
15
15
|
userId?: string;
|
|
16
16
|
username?: string;
|
|
17
17
|
currentConnection?: ConnectionType;
|
|
18
18
|
sessionSecret?: string;
|
|
19
19
|
};
|
|
20
|
-
export
|
|
20
|
+
export type ConnectionType = 'Access-Token-Authentication' | 'Username-Password-Authentication' | 'facebook' | 'google-oauth2' | 'github';
|
|
21
21
|
export declare function getExpoHomeDirectory(): string;
|
|
22
22
|
export declare function getUserStatePath(): string;
|
|
23
23
|
export declare function getUserState(): JsonFile<UserSettingsData>;
|
package/build/getUserState.js
CHANGED
|
@@ -6,58 +6,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getExpoHomeDirectory = getExpoHomeDirectory;
|
|
7
7
|
exports.getUserState = getUserState;
|
|
8
8
|
exports.getUserStatePath = getUserStatePath;
|
|
9
|
-
|
|
10
9
|
function _jsonFile() {
|
|
11
10
|
const data = _interopRequireDefault(require("@expo/json-file"));
|
|
12
|
-
|
|
13
11
|
_jsonFile = function () {
|
|
14
12
|
return data;
|
|
15
13
|
};
|
|
16
|
-
|
|
17
14
|
return data;
|
|
18
15
|
}
|
|
19
|
-
|
|
20
16
|
function _getenv() {
|
|
21
17
|
const data = require("getenv");
|
|
22
|
-
|
|
23
18
|
_getenv = function () {
|
|
24
19
|
return data;
|
|
25
20
|
};
|
|
26
|
-
|
|
27
21
|
return data;
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
function _os() {
|
|
31
24
|
const data = require("os");
|
|
32
|
-
|
|
33
25
|
_os = function () {
|
|
34
26
|
return data;
|
|
35
27
|
};
|
|
36
|
-
|
|
37
28
|
return data;
|
|
38
29
|
}
|
|
39
|
-
|
|
40
30
|
function path() {
|
|
41
31
|
const data = _interopRequireWildcard(require("path"));
|
|
42
|
-
|
|
43
32
|
path = function () {
|
|
44
33
|
return data;
|
|
45
34
|
};
|
|
46
|
-
|
|
47
35
|
return data;
|
|
48
36
|
}
|
|
49
|
-
|
|
50
37
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
-
|
|
52
38
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
-
|
|
54
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
55
|
-
|
|
56
40
|
// The ~/.expo directory is used to store authentication sessions,
|
|
57
41
|
// which are shared between EAS CLI and Expo CLI.
|
|
58
42
|
function getExpoHomeDirectory() {
|
|
59
43
|
const home = (0, _os().homedir)();
|
|
60
|
-
|
|
61
44
|
if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {
|
|
62
45
|
return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;
|
|
63
46
|
} else if ((0, _getenv().boolish)('EXPO_STAGING', false)) {
|
|
@@ -65,14 +48,11 @@ function getExpoHomeDirectory() {
|
|
|
65
48
|
} else if ((0, _getenv().boolish)('EXPO_LOCAL', false)) {
|
|
66
49
|
return path().join(home, '.expo-local');
|
|
67
50
|
}
|
|
68
|
-
|
|
69
51
|
return path().join(home, '.expo');
|
|
70
52
|
}
|
|
71
|
-
|
|
72
53
|
function getUserStatePath() {
|
|
73
54
|
return path().join(getExpoHomeDirectory(), 'state.json');
|
|
74
55
|
}
|
|
75
|
-
|
|
76
56
|
function getUserState() {
|
|
77
57
|
return new (_jsonFile().default)(getUserStatePath(), {
|
|
78
58
|
jsonParseErrorDefault: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserState.js","names":["getExpoHomeDirectory","home","homedir","process","env","__UNSAFE_EXPO_HOME_DIRECTORY","boolish","path","join","getUserStatePath","getUserState","JsonFile","jsonParseErrorDefault","cantReadFileDefault"],"sources":["../src/getUserState.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { boolish } from 'getenv';\nimport { homedir } from 'os';\nimport * as path from 'path';\n\nexport type UserSettingsData = {\n developmentCodeSigningId?: string;\n appleId?: string;\n accessToken?: string;\n auth?: UserData | null;\n ignoreBundledBinaries?: string[];\n openDevToolsAtStartup?: boolean;\n PATH?: string;\n sendTo?: string;\n uuid?: string;\n};\n\nexport type UserData = {\n appleId?: string;\n userId?: string;\n username?: string;\n currentConnection?: ConnectionType;\n sessionSecret?: string;\n};\n\nexport type ConnectionType =\n | 'Access-Token-Authentication'\n | 'Username-Password-Authentication'\n | 'facebook'\n | 'google-oauth2'\n | 'github';\n\n// The ~/.expo directory is used to store authentication sessions,\n// which are shared between EAS CLI and Expo CLI.\nexport function getExpoHomeDirectory() {\n const home = homedir();\n\n if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {\n return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;\n } else if (boolish('EXPO_STAGING', false)) {\n return path.join(home, '.expo-staging');\n } else if (boolish('EXPO_LOCAL', false)) {\n return path.join(home, '.expo-local');\n }\n return path.join(home, '.expo');\n}\n\nexport function getUserStatePath() {\n return path.join(getExpoHomeDirectory(), 'state.json');\n}\n\nexport function getUserState() {\n return new JsonFile<UserSettingsData>(getUserStatePath(), {\n jsonParseErrorDefault: {},\n // This will ensure that an error isn't thrown if the file doesn't exist.\n cantReadFileDefault: {},\n });\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getUserState.js","names":["getExpoHomeDirectory","home","homedir","process","env","__UNSAFE_EXPO_HOME_DIRECTORY","boolish","path","join","getUserStatePath","getUserState","JsonFile","jsonParseErrorDefault","cantReadFileDefault"],"sources":["../src/getUserState.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { boolish } from 'getenv';\nimport { homedir } from 'os';\nimport * as path from 'path';\n\nexport type UserSettingsData = {\n developmentCodeSigningId?: string;\n appleId?: string;\n accessToken?: string;\n auth?: UserData | null;\n ignoreBundledBinaries?: string[];\n openDevToolsAtStartup?: boolean;\n PATH?: string;\n sendTo?: string;\n uuid?: string;\n};\n\nexport type UserData = {\n appleId?: string;\n userId?: string;\n username?: string;\n currentConnection?: ConnectionType;\n sessionSecret?: string;\n};\n\nexport type ConnectionType =\n | 'Access-Token-Authentication'\n | 'Username-Password-Authentication'\n | 'facebook'\n | 'google-oauth2'\n | 'github';\n\n// The ~/.expo directory is used to store authentication sessions,\n// which are shared between EAS CLI and Expo CLI.\nexport function getExpoHomeDirectory() {\n const home = homedir();\n\n if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {\n return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;\n } else if (boolish('EXPO_STAGING', false)) {\n return path.join(home, '.expo-staging');\n } else if (boolish('EXPO_LOCAL', false)) {\n return path.join(home, '.expo-local');\n }\n return path.join(home, '.expo');\n}\n\nexport function getUserStatePath() {\n return path.join(getExpoHomeDirectory(), 'state.json');\n}\n\nexport function getUserState() {\n return new JsonFile<UserSettingsData>(getUserStatePath(), {\n jsonParseErrorDefault: {},\n // This will ensure that an error isn't thrown if the file doesn't exist.\n cantReadFileDefault: {},\n });\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA6B;AAAA;AAAA;AA6B7B;AACA;AACO,SAASA,oBAAoB,GAAG;EACrC,MAAMC,IAAI,GAAG,IAAAC,aAAO,GAAE;EAEtB,IAAIC,OAAO,CAACC,GAAG,CAACC,4BAA4B,EAAE;IAC5C,OAAOF,OAAO,CAACC,GAAG,CAACC,4BAA4B;EACjD,CAAC,MAAM,IAAI,IAAAC,iBAAO,EAAC,cAAc,EAAE,KAAK,CAAC,EAAE;IACzC,OAAOC,IAAI,GAACC,IAAI,CAACP,IAAI,EAAE,eAAe,CAAC;EACzC,CAAC,MAAM,IAAI,IAAAK,iBAAO,EAAC,YAAY,EAAE,KAAK,CAAC,EAAE;IACvC,OAAOC,IAAI,GAACC,IAAI,CAACP,IAAI,EAAE,aAAa,CAAC;EACvC;EACA,OAAOM,IAAI,GAACC,IAAI,CAACP,IAAI,EAAE,OAAO,CAAC;AACjC;AAEO,SAASQ,gBAAgB,GAAG;EACjC,OAAOF,IAAI,GAACC,IAAI,CAACR,oBAAoB,EAAE,EAAE,YAAY,CAAC;AACxD;AAEO,SAASU,YAAY,GAAG;EAC7B,OAAO,KAAIC,mBAAQ,EAAmBF,gBAAgB,EAAE,EAAE;IACxDG,qBAAqB,EAAE,CAAC,CAAC;IACzB;IACAC,mBAAmB,EAAE,CAAC;EACxB,CAAC,CAAC;AACJ"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from './Config';
|
|
2
2
|
export * from './Config.types';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './getExpoSDKVersion';
|
|
4
4
|
export * from './Errors';
|
|
5
|
-
export { getAccountUsername } from './
|
|
5
|
+
export { getAccountUsername } from './getAccountUsername';
|