create-expo 5.0.0 → 5.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/{205.index.js → 589.index.js} +442 -128
- package/build/601.index.js +20 -11
- package/build/{525.index.js → 870.index.js} +423 -334
- package/build/Examples.d.ts +38 -0
- package/build/Template.d.ts +98 -0
- package/build/__mocks__/fs.d.ts +1 -0
- package/build/__mocks__/ora.d.ts +1 -0
- package/build/__tests__/Examples.test.d.ts +1 -0
- package/build/__tests__/Template.test.d.ts +1 -0
- package/build/__tests__/configureWorkspaces.test.d.ts +1 -0
- package/build/__tests__/createAsync.test.d.ts +1 -0
- package/build/__tests__/createExpoConfig.test.d.ts +1 -0
- package/build/__tests__/createFileTransformer.test.d.ts +1 -0
- package/build/__tests__/generateAgentFiles.test.d.ts +1 -0
- package/build/__tests__/promptSdkVersion.test.d.ts +1 -0
- package/build/__tests__/resolvePackageManager.test.d.ts +1 -0
- package/build/__tests__/sanitizeTemplate.test.d.ts +1 -0
- package/build/__tests__/telemetry.test.d.ts +1 -0
- package/build/agent-files/AGENTS.md +41 -0
- package/build/agent-files/CLAUDE.md +1 -0
- package/build/cli.d.ts +1 -0
- package/build/configureWorkspaces.d.ts +9 -0
- package/build/createAsync.d.ts +11 -0
- package/build/createExpoConfig.d.ts +38 -0
- package/build/createFileTransform.d.ts +5 -0
- package/build/error.d.ts +9 -0
- package/build/generateAgentFiles.d.ts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +38 -10
- package/build/legacyTemplates.d.ts +7 -0
- package/build/log.d.ts +12 -0
- package/build/paths.d.ts +2 -0
- package/build/promptSdkVersion.d.ts +23 -0
- package/build/resolvePackageManager.d.ts +12 -0
- package/build/resolveProjectRoot.d.ts +3 -0
- package/build/sessionStorage.d.ts +8 -0
- package/build/telemetry.d.ts +29 -0
- package/build/utils/__tests__/args.test.d.ts +1 -0
- package/build/utils/__tests__/array.test.d.ts +1 -0
- package/build/utils/__tests__/log.test.d.ts +1 -0
- package/build/utils/__tests__/npm.test.d.ts +1 -0
- package/build/utils/__tests__/obj.test.d.ts +1 -0
- package/build/utils/args.d.ts +33 -0
- package/build/utils/array.d.ts +1 -0
- package/build/utils/dir.d.ts +1 -0
- package/build/utils/env.d.ts +14 -0
- package/build/utils/fetch.d.ts +2 -0
- package/build/utils/git.d.ts +1 -0
- package/build/utils/github.d.ts +2 -0
- package/build/utils/log.d.ts +6 -0
- package/build/utils/npm.d.ts +52 -0
- package/build/utils/obj.d.ts +1 -0
- package/build/utils/tar.d.ts +10 -0
- package/build/utils/update-check.d.ts +2 -0
- package/package.json +33 -21
- package/template/agent-files/AGENTS.md +41 -0
- package/template/agent-files/CLAUDE.md +1 -0
- package/build/517.index.js +0 -1380
package/build/601.index.js
CHANGED
|
@@ -21,7 +21,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
21
21
|
|
|
22
22
|
// EXTERNAL MODULE: ../@expo/json-file/build/JsonFile.js
|
|
23
23
|
var JsonFile = __webpack_require__(3064);
|
|
24
|
-
var JsonFile_default = /*#__PURE__*/__webpack_require__.n(JsonFile);
|
|
25
24
|
// EXTERNAL MODULE: external "crypto"
|
|
26
25
|
var external_crypto_ = __webpack_require__(6982);
|
|
27
26
|
var external_crypto_default = /*#__PURE__*/__webpack_require__.n(external_crypto_);
|
|
@@ -63,7 +62,7 @@ const getStateJsonPath = () => external_path_default().join(dotExpoHomeDirectory
|
|
|
63
62
|
|
|
64
63
|
function getSession() {
|
|
65
64
|
try {
|
|
66
|
-
return
|
|
65
|
+
return JsonFile["default"].read(getStateJsonPath())?.auth ?? null;
|
|
67
66
|
}
|
|
68
67
|
catch (error) {
|
|
69
68
|
if (error.code === 'ENOENT') {
|
|
@@ -75,6 +74,8 @@ function getSession() {
|
|
|
75
74
|
|
|
76
75
|
// EXTERNAL MODULE: ./src/utils/env.ts
|
|
77
76
|
var utils_env = __webpack_require__(4342);
|
|
77
|
+
// EXTERNAL MODULE: ./src/utils/update-check.ts
|
|
78
|
+
var update_check = __webpack_require__(7517);
|
|
78
79
|
;// CONCATENATED MODULE: ./src/telemetry.ts
|
|
79
80
|
|
|
80
81
|
|
|
@@ -83,11 +84,19 @@ var utils_env = __webpack_require__(4342);
|
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
|
|
86
|
-
|
|
87
|
+
|
|
88
|
+
const getPackageJson = () => {
|
|
89
|
+
try {
|
|
90
|
+
return __webpack_require__(8330);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
87
96
|
const xdlUnifiedWriteKey = '1wabJGd5IiuF9Q8SGlcI90v8WTs';
|
|
88
97
|
const analyticsEndpoint = 'https://cdp.expo.dev/v1/batch';
|
|
89
98
|
const version = '1.0.0';
|
|
90
|
-
const library =
|
|
99
|
+
const library = update_check.PACKAGE_NAME;
|
|
91
100
|
const messageBatch = [];
|
|
92
101
|
let analyticsIdentity = null;
|
|
93
102
|
// jest does not clear global variables inbetween tests so we need this helper
|
|
@@ -144,7 +153,7 @@ function enqueue(type, message) {
|
|
|
144
153
|
message.originalTimestamp = new Date();
|
|
145
154
|
}
|
|
146
155
|
if (!message.messageId) {
|
|
147
|
-
// We md5 the
|
|
156
|
+
// We md5 the message to add more randomness. This is primarily meant
|
|
148
157
|
// for use in the browser where the uuid package falls back to Math.random()
|
|
149
158
|
// which is not a great source of randomness.
|
|
150
159
|
// Borrowed from analytics.js (https://github.com/segment-integrations/analytics.js-integration-segmentio/blob/a20d2a2d222aeb3ab2a8c7e72280f1df2618440e/lib/index.js#L255-L256).
|
|
@@ -154,7 +163,7 @@ function enqueue(type, message) {
|
|
|
154
163
|
}
|
|
155
164
|
messageBatch.push(message);
|
|
156
165
|
}
|
|
157
|
-
// very barebones
|
|
166
|
+
// very barebones implementation...
|
|
158
167
|
// does not support multiple concurrent flushes or large numbers of messages
|
|
159
168
|
async function flushAsync() {
|
|
160
169
|
if (utils_env.env.EXPO_NO_TELEMETRY)
|
|
@@ -180,7 +189,7 @@ async function flushAsync() {
|
|
|
180
189
|
await fetch(analyticsEndpoint, request);
|
|
181
190
|
}
|
|
182
191
|
catch {
|
|
183
|
-
//
|
|
192
|
+
// suppress errors - likely due to network connectivity or endpoint health
|
|
184
193
|
}
|
|
185
194
|
// clear array so we don't resend events in subsequent flushes
|
|
186
195
|
messageBatch.splice(0, messageBatch.length);
|
|
@@ -197,7 +206,7 @@ function getAnalyticsContext() {
|
|
|
197
206
|
return {
|
|
198
207
|
os: { name: platform, version: external_os_default().release() },
|
|
199
208
|
device: { type: platform, model: platform },
|
|
200
|
-
app: { name: library, version:
|
|
209
|
+
app: { name: library, version: getPackageJson()?.version ?? undefined },
|
|
201
210
|
};
|
|
202
211
|
}
|
|
203
212
|
//#endregion
|
|
@@ -208,7 +217,7 @@ function uuidv4() {
|
|
|
208
217
|
return external_crypto_default().randomUUID();
|
|
209
218
|
}
|
|
210
219
|
catch {
|
|
211
|
-
//
|
|
220
|
+
// suppress errors due to node 13 or less not having randomUUID
|
|
212
221
|
return null;
|
|
213
222
|
}
|
|
214
223
|
}
|
|
@@ -229,14 +238,14 @@ async function getAnalyticsIdentityAsync() {
|
|
|
229
238
|
if (!external_fs_default().existsSync(getStateJsonPath())) {
|
|
230
239
|
external_fs_default().writeFileSync(getStateJsonPath(), JSON.stringify({}));
|
|
231
240
|
}
|
|
232
|
-
const savedDeviceId = await
|
|
241
|
+
const savedDeviceId = await JsonFile["default"].getAsync(getStateJsonPath(), 'analyticsDeviceId', null);
|
|
233
242
|
const deviceId = savedDeviceId ?? uuidv4();
|
|
234
243
|
if (!deviceId) {
|
|
235
244
|
// unable to generate an id or load one from disk
|
|
236
245
|
return null;
|
|
237
246
|
}
|
|
238
247
|
if (!savedDeviceId) {
|
|
239
|
-
await
|
|
248
|
+
await JsonFile["default"].setAsync(getStateJsonPath(), 'analyticsDeviceId', deviceId);
|
|
240
249
|
}
|
|
241
250
|
const userId = getSession()?.userId ?? null;
|
|
242
251
|
return userId ? { anonymousId: deviceId, userId } : { anonymousId: deviceId };
|