@expo/cli 57.0.2 → 57.0.4

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/bin/cli CHANGED
@@ -139,7 +139,7 @@ const args = (0, _arg().default)({
139
139
  });
140
140
  if (args['--version']) {
141
141
  // Version is added in the build script.
142
- console.log("57.0.2");
142
+ console.log("57.0.4");
143
143
  process.exit(0);
144
144
  }
145
145
  if (args['--non-interactive']) {
@@ -76,7 +76,7 @@ function getInitMetadata() {
76
76
  return {
77
77
  format: 'v0-jsonl',
78
78
  // Version is added in the build script.
79
- version: "57.0.2" ?? 'UNVERSIONED'
79
+ version: "57.0.4" ?? 'UNVERSIONED'
80
80
  };
81
81
  }
82
82
  function getWellKnownTemporaryLogFile(projectRoot, command) {
@@ -17,6 +17,7 @@ function _nodecrypto() {
17
17
  }
18
18
  const _FetchClient = require("./clients/FetchClient");
19
19
  const _FetchDetachedClient = require("./clients/FetchDetachedClient");
20
+ const _agent = require("./utils/agent");
20
21
  const _context = require("./utils/context");
21
22
  const _UserSettings = require("../../api/user/UserSettings");
22
23
  const _env = require("../env");
@@ -74,6 +75,7 @@ class Telemetry {
74
75
  }
75
76
  }
76
77
  recordInternal(records) {
78
+ const agent = (0, _agent.getAgentTelemetryContext)();
77
79
  return this.client.record(records.map((record)=>({
78
80
  ...record,
79
81
  type: 'track',
@@ -84,6 +86,9 @@ class Telemetry {
84
86
  context: {
85
87
  ...this.context,
86
88
  sessionId: this.actor.sessionId,
89
+ ...agent ? {
90
+ agent
91
+ } : {},
87
92
  client: {
88
93
  mode: this.client.strategy
89
94
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/utils/telemetry/Telemetry.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nimport { FetchClient } from './clients/FetchClient';\nimport { FetchDetachedClient } from './clients/FetchDetachedClient';\nimport type { TelemetryClient, TelemetryClientStrategy, TelemetryRecord } from './types';\nimport { createContext } from './utils/context';\nimport { getAnonymousId } from '../../api/user/UserSettings';\nimport { env } from '../env';\n\nconst debug = require('debug')('expo:telemetry') as typeof console.log;\n\ntype TelemetryOptions = {\n /** A locally generated ID, untracable to an actual user */\n anonymousId?: string;\n /** A locally generated ID, per CLI invocation */\n sessionId?: string;\n /** The authenticated user ID, this is used to generate an untracable hash */\n userId?: string;\n /** The underlying telemetry strategy to use */\n strategy?: TelemetryClientStrategy;\n};\n\ntype TelemetryActor = Required<Pick<TelemetryOptions, 'anonymousId' | 'sessionId'>> & {\n /**\n * Hashed version of the user ID, untracable to an actual user.\n * If this value is set to `undefined`, telemetry is considered uninitialized and will wait until its set.\n * If this value is set to `null`, telemetry is considered initialized without an authenticated user.\n * If this value is set to a string, telemetry is considered initialized with an authenticated user.\n */\n userHash?: string | null;\n};\n\nexport class Telemetry {\n private context = createContext();\n private client: TelemetryClient = new FetchDetachedClient();\n private actor: TelemetryActor;\n\n /** A list of all events, recorded before the telemetry was fully initialized */\n private earlyRecords: TelemetryRecord[] = [];\n\n constructor({\n anonymousId = getAnonymousId(),\n sessionId = crypto.randomUUID(),\n userId,\n strategy = 'detached',\n }: TelemetryOptions = {}) {\n this.actor = { anonymousId, sessionId };\n this.setStrategy(env.EXPO_NO_TELEMETRY_DETACH ? 'debug' : strategy);\n\n if (userId) {\n this.initialize({ userId });\n }\n }\n\n get strategy() {\n return this.client.strategy;\n }\n\n setStrategy(strategy: TelemetryOptions['strategy']) {\n // Abort when client is already using the correct strategy\n if (this.client.strategy === strategy) return;\n // Abort when debugging the telemetry\n if (env.EXPO_NO_TELEMETRY_DETACH && strategy !== 'debug') return;\n\n debug('Switching strategy from %s to %s', this.client.strategy, strategy);\n\n // Load and instantiate the correct client, based on strategy\n const client = createClientFromStrategy(strategy);\n // Replace the client, and re-record any pending records\n this.client.abort().forEach((record) => client.record([record]));\n this.client = client;\n\n return this;\n }\n\n get isInitialized() {\n return this.actor.userHash !== undefined;\n }\n\n initialize({ userId }: { userId: string | null }) {\n this.actor.userHash = userId ? hashUserId(userId) : null;\n this.flushEarlyRecords();\n }\n\n private flushEarlyRecords() {\n if (this.earlyRecords.length) {\n this.recordInternal(this.earlyRecords);\n this.earlyRecords = [];\n }\n }\n\n private recordInternal(records: TelemetryRecord[]) {\n return this.client.record(\n records.map((record) => ({\n ...record,\n type: 'track' as const,\n sentAt: new Date(),\n messageId: createMessageId(record),\n anonymousId: this.actor.anonymousId,\n userHash: this.actor.userHash,\n context: {\n ...this.context,\n sessionId: this.actor.sessionId,\n client: { mode: this.client.strategy },\n },\n }))\n );\n }\n\n record(record: TelemetryRecord | TelemetryRecord[]) {\n const records = Array.isArray(record) ? record : [record];\n\n debug('Recording %d event(s)', records.length);\n\n if (!this.isInitialized) {\n this.earlyRecords.push(...records);\n return;\n }\n\n return this.recordInternal(records);\n }\n\n flush() {\n debug('Flushing events...');\n this.flushEarlyRecords();\n return this.client.flush();\n }\n\n flushOnExit() {\n this.setStrategy('detached');\n this.flushEarlyRecords();\n return this.client.flush();\n }\n}\n\nfunction createClientFromStrategy(strategy: TelemetryOptions['strategy']) {\n // When debugging, use the actual Rudderstack client, but lazy load it\n if (env.EXPO_NO_TELEMETRY_DETACH || strategy === 'debug' || strategy === 'instant') {\n return new FetchClient();\n }\n\n return new FetchDetachedClient();\n}\n\n/** Generate a unique message ID using a random hash and UUID */\nfunction createMessageId(record: TelemetryRecord) {\n const uuid = crypto.randomUUID();\n const md5 = crypto.createHash('md5').update(JSON.stringify(record)).digest('hex');\n\n return `node-${md5}-${uuid}`;\n}\n\n/** Hash the user identifier to make it untracable */\nfunction hashUserId(userId: string) {\n return crypto.createHash('sha256').update(userId).digest('hex');\n}\n"],"names":["Telemetry","debug","require","anonymousId","getAnonymousId","sessionId","crypto","randomUUID","userId","strategy","context","createContext","client","FetchDetachedClient","earlyRecords","actor","setStrategy","env","EXPO_NO_TELEMETRY_DETACH","initialize","createClientFromStrategy","abort","forEach","record","isInitialized","userHash","undefined","hashUserId","flushEarlyRecords","length","recordInternal","records","map","type","sentAt","Date","messageId","createMessageId","mode","Array","isArray","push","flush","flushOnExit","FetchClient","uuid","md5","createHash","update","JSON","stringify","digest"],"mappings":";;;;+BAgCaA;;;eAAAA;;;;gEAhCM;;;;;;6BAES;qCACQ;yBAEN;8BACC;qBACX;;;;;;AAEpB,MAAMC,QAAQC,QAAQ,SAAS;AAuBxB,MAAMF;IAQX,YAAY,EACVG,cAAcC,IAAAA,4BAAc,GAAE,EAC9BC,YAAYC,qBAAM,CAACC,UAAU,EAAE,EAC/BC,MAAM,EACNC,WAAW,UAAU,EACJ,GAAG,CAAC,CAAC,CAAE;aAZlBC,UAAUC,IAAAA,sBAAa;aACvBC,SAA0B,IAAIC,wCAAmB;QAGzD,8EAA8E,QACtEC,eAAkC,EAAE;QAQ1C,IAAI,CAACC,KAAK,GAAG;YAAEZ;YAAaE;QAAU;QACtC,IAAI,CAACW,WAAW,CAACC,QAAG,CAACC,wBAAwB,GAAG,UAAUT;QAE1D,IAAID,QAAQ;YACV,IAAI,CAACW,UAAU,CAAC;gBAAEX;YAAO;QAC3B;IACF;IAEA,IAAIC,WAAW;QACb,OAAO,IAAI,CAACG,MAAM,CAACH,QAAQ;IAC7B;IAEAO,YAAYP,QAAsC,EAAE;QAClD,0DAA0D;QAC1D,IAAI,IAAI,CAACG,MAAM,CAACH,QAAQ,KAAKA,UAAU;QACvC,qCAAqC;QACrC,IAAIQ,QAAG,CAACC,wBAAwB,IAAIT,aAAa,SAAS;QAE1DR,MAAM,oCAAoC,IAAI,CAACW,MAAM,CAACH,QAAQ,EAAEA;QAEhE,6DAA6D;QAC7D,MAAMG,SAASQ,yBAAyBX;QACxC,wDAAwD;QACxD,IAAI,CAACG,MAAM,CAACS,KAAK,GAAGC,OAAO,CAAC,CAACC,SAAWX,OAAOW,MAAM,CAAC;gBAACA;aAAO;QAC9D,IAAI,CAACX,MAAM,GAAGA;QAEd,OAAO,IAAI;IACb;IAEA,IAAIY,gBAAgB;QAClB,OAAO,IAAI,CAACT,KAAK,C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WAAW,CAAC;QACjB,IAAI,CAACY,iBAAiB;QACtB,OAAO,IAAI,CAAChB,MAAM,CAAC8B,KAAK;IAC1B;AACF;AAEA,SAAStB,yBAAyBX,QAAsC;IACtE,sEAAsE;IACtE,IAAIQ,QAAG,CAACC,wBAAwB,IAAIT,aAAa,WAAWA,aAAa,WAAW;QAClF,OAAO,IAAImC,wBAAW;IACxB;IAEA,OAAO,IAAI/B,wCAAmB;AAChC;AAEA,8DAA8D,GAC9D,SAASwB,gBAAgBd,MAAuB;IAC9C,MAAMsB,OAAOvC,qBAAM,CAACC,UAAU;IAC9B,MAAMuC,MAAMxC,qBAAM,CAACyC,UAAU,CAAC,OAAOC,MAAM,CAACC,KAAKC,SAAS,CAAC3B,SAAS4B,MAAM,CAAC;IAE3E,OAAO,CAAC,KAAK,EAAEL,IAAI,CAAC,EAAED,MAAM;AAC9B;AAEA,mDAAmD,GACnD,SAASlB,WAAWnB,MAAc;IAChC,OAAOF,qBAAM,CAACyC,UAAU,CAAC,UAAUC,MAAM,CAACxC,QAAQ2C,MAAM,CAAC;AAC3D"}
1
+ {"version":3,"sources":["../../../../src/utils/telemetry/Telemetry.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nimport { FetchClient } from './clients/FetchClient';\nimport { FetchDetachedClient } from './clients/FetchDetachedClient';\nimport type { TelemetryClient, TelemetryClientStrategy, TelemetryRecord } from './types';\nimport { getAgentTelemetryContext } from './utils/agent';\nimport { createContext } from './utils/context';\nimport { getAnonymousId } from '../../api/user/UserSettings';\nimport { env } from '../env';\n\nconst debug = require('debug')('expo:telemetry') as typeof console.log;\n\ntype TelemetryOptions = {\n /** A locally generated ID, untracable to an actual user */\n anonymousId?: string;\n /** A locally generated ID, per CLI invocation */\n sessionId?: string;\n /** The authenticated user ID, this is used to generate an untracable hash */\n userId?: string;\n /** The underlying telemetry strategy to use */\n strategy?: TelemetryClientStrategy;\n};\n\ntype TelemetryActor = Required<Pick<TelemetryOptions, 'anonymousId' | 'sessionId'>> & {\n /**\n * Hashed version of the user ID, untracable to an actual user.\n * If this value is set to `undefined`, telemetry is considered uninitialized and will wait until its set.\n * If this value is set to `null`, telemetry is considered initialized without an authenticated user.\n * If this value is set to a string, telemetry is considered initialized with an authenticated user.\n */\n userHash?: string | null;\n};\n\nexport class Telemetry {\n private context = createContext();\n private client: TelemetryClient = new FetchDetachedClient();\n private actor: TelemetryActor;\n\n /** A list of all events, recorded before the telemetry was fully initialized */\n private earlyRecords: TelemetryRecord[] = [];\n\n constructor({\n anonymousId = getAnonymousId(),\n sessionId = crypto.randomUUID(),\n userId,\n strategy = 'detached',\n }: TelemetryOptions = {}) {\n this.actor = { anonymousId, sessionId };\n this.setStrategy(env.EXPO_NO_TELEMETRY_DETACH ? 'debug' : strategy);\n\n if (userId) {\n this.initialize({ userId });\n }\n }\n\n get strategy() {\n return this.client.strategy;\n }\n\n setStrategy(strategy: TelemetryOptions['strategy']) {\n // Abort when client is already using the correct strategy\n if (this.client.strategy === strategy) return;\n // Abort when debugging the telemetry\n if (env.EXPO_NO_TELEMETRY_DETACH && strategy !== 'debug') return;\n\n debug('Switching strategy from %s to %s', this.client.strategy, strategy);\n\n // Load and instantiate the correct client, based on strategy\n const client = createClientFromStrategy(strategy);\n // Replace the client, and re-record any pending records\n this.client.abort().forEach((record) => client.record([record]));\n this.client = client;\n\n return this;\n }\n\n get isInitialized() {\n return this.actor.userHash !== undefined;\n }\n\n initialize({ userId }: { userId: string | null }) {\n this.actor.userHash = userId ? hashUserId(userId) : null;\n this.flushEarlyRecords();\n }\n\n private flushEarlyRecords() {\n if (this.earlyRecords.length) {\n this.recordInternal(this.earlyRecords);\n this.earlyRecords = [];\n }\n }\n\n private recordInternal(records: TelemetryRecord[]) {\n const agent = getAgentTelemetryContext();\n\n return this.client.record(\n records.map((record) => ({\n ...record,\n type: 'track' as const,\n sentAt: new Date(),\n messageId: createMessageId(record),\n anonymousId: this.actor.anonymousId,\n userHash: this.actor.userHash,\n context: {\n ...this.context,\n sessionId: this.actor.sessionId,\n ...(agent ? { agent } : {}),\n client: { mode: this.client.strategy },\n },\n }))\n );\n }\n\n record(record: TelemetryRecord | TelemetryRecord[]) {\n const records = Array.isArray(record) ? record : [record];\n\n debug('Recording %d event(s)', records.length);\n\n if (!this.isInitialized) {\n this.earlyRecords.push(...records);\n return;\n }\n\n return this.recordInternal(records);\n }\n\n flush() {\n debug('Flushing events...');\n this.flushEarlyRecords();\n return this.client.flush();\n }\n\n flushOnExit() {\n this.setStrategy('detached');\n this.flushEarlyRecords();\n return this.client.flush();\n }\n}\n\nfunction createClientFromStrategy(strategy: TelemetryOptions['strategy']) {\n // When debugging, use the actual Rudderstack client, but lazy load it\n if (env.EXPO_NO_TELEMETRY_DETACH || strategy === 'debug' || strategy === 'instant') {\n return new FetchClient();\n }\n\n return new FetchDetachedClient();\n}\n\n/** Generate a unique message ID using a random hash and UUID */\nfunction createMessageId(record: TelemetryRecord) {\n const uuid = crypto.randomUUID();\n const md5 = crypto.createHash('md5').update(JSON.stringify(record)).digest('hex');\n\n return `node-${md5}-${uuid}`;\n}\n\n/** Hash the user identifier to make it untracable */\nfunction hashUserId(userId: string) {\n return crypto.createHash('sha256').update(userId).digest('hex');\n}\n"],"names":["Telemetry","debug","require","anonymousId","getAnonymousId","sessionId","crypto","randomUUID","userId","strategy","context","createContext","client","FetchDetachedClient","earlyRecords","actor","setStrategy","env","EXPO_NO_TELEMETRY_DETACH","initialize","createClientFromStrategy","abort","forEach","record","isInitialized","userHash","undefined","hashUserId","flushEarlyRecords","length","recordInternal","records","agent","getAgentTelemetryContext","map","type","sentAt","Date","messageId","createMessageId","mode","Array","isArray","push","flush","flushOnExit","FetchClient","uuid","md5","createHash","update","JSON","stringify","digest"],"mappings":";;;;+BAiCaA;;;eAAAA;;;;gEAjCM;;;;;;6BAES;qCACQ;uBAEK;yBACX;8BACC;qBACX;;;;;;AAEpB,MAAMC,QAAQC,QAAQ,SAAS;AAuBxB,MAAMF;IAQX,YAAY,EACVG,cAAcC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,QAAG,CAACC,wBAAwB,IAAIT,aAAa,WAAWA,aAAa,WAAW;QAClF,OAAO,IAAIqC,wBAAW;IACxB;IAEA,OAAO,IAAIjC,wCAAmB;AAChC;AAEA,8DAA8D,GAC9D,SAAS0B,gBAAgBhB,MAAuB;IAC9C,MAAMwB,OAAOzC,qBAAM,CAACC,UAAU;IAC9B,MAAMyC,MAAM1C,qBAAM,CAAC2C,UAAU,CAAC,OAAOC,MAAM,CAACC,KAAKC,SAAS,CAAC7B,SAAS8B,MAAM,CAAC;IAE3E,OAAO,CAAC,KAAK,EAAEL,IAAI,CAAC,EAAED,MAAM;AAC9B;AAEA,mDAAmD,GACnD,SAASpB,WAAWnB,MAAc;IAChC,OAAOF,qBAAM,CAAC2C,UAAU,CAAC,UAAUC,MAAM,CAAC1C,QAAQ6C,MAAM,CAAC;AAC3D"}
@@ -26,7 +26,7 @@ class FetchClient {
26
26
  this.headers = {
27
27
  accept: 'application/json',
28
28
  'content-type': 'application/json',
29
- 'user-agent': `expo-cli/${"57.0.2"}`,
29
+ 'user-agent': `expo-cli/${"57.0.4"}`,
30
30
  authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
31
31
  };
32
32
  }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "getAgentTelemetryContext", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return getAgentTelemetryContext;
9
+ }
10
+ });
11
+ function _agentclidetector() {
12
+ const data = require("agent-cli-detector");
13
+ _agentclidetector = function() {
14
+ return data;
15
+ };
16
+ return data;
17
+ }
18
+ const debug = require('debug')('expo:telemetry:agent');
19
+ let agentTelemetryContext;
20
+ function getAgentTelemetryContext() {
21
+ if (agentTelemetryContext === undefined) {
22
+ agentTelemetryContext = resolveAgentTelemetryContext();
23
+ }
24
+ return agentTelemetryContext;
25
+ }
26
+ function resolveAgentTelemetryContext() {
27
+ try {
28
+ const { agent, detected } = (0, _agentclidetector().detectAgent)();
29
+ if (!detected || agent == null) {
30
+ return null;
31
+ }
32
+ return {
33
+ id: agent.id,
34
+ sessionId: agent.sessionId
35
+ };
36
+ } catch (error) {
37
+ debug('Failed to detect coding agent: %s', (error == null ? void 0 : error.message) ?? error);
38
+ return null;
39
+ }
40
+ }
41
+
42
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/utils/telemetry/utils/agent.ts"],"sourcesContent":["import { detectAgent } from 'agent-cli-detector';\n\nconst debug = require('debug')('expo:telemetry:agent') as typeof console.log;\n\nexport type AgentTelemetryContext = {\n id: string;\n sessionId: string | undefined;\n};\n\nlet agentTelemetryContext: AgentTelemetryContext | null | undefined;\n\nexport function getAgentTelemetryContext(): AgentTelemetryContext | null {\n if (agentTelemetryContext === undefined) {\n agentTelemetryContext = resolveAgentTelemetryContext();\n }\n\n return agentTelemetryContext;\n}\n\nfunction resolveAgentTelemetryContext(): AgentTelemetryContext | null {\n try {\n const { agent, detected } = detectAgent();\n if (!detected || agent == null) {\n return null;\n }\n return { id: agent.id, sessionId: agent.sessionId };\n } catch (error: any) {\n debug('Failed to detect coding agent: %s', error?.message ?? error);\n return null;\n }\n}\n"],"names":["getAgentTelemetryContext","debug","require","agentTelemetryContext","undefined","resolveAgentTelemetryContext","agent","detected","detectAgent","id","sessionId","error","message"],"mappings":";;;;+BAWgBA;;;eAAAA;;;;yBAXY;;;;;;AAE5B,MAAMC,QAAQC,QAAQ,SAAS;AAO/B,IAAIC;AAEG,SAASH;IACd,IAAIG,0BAA0BC,WAAW;QACvCD,wBAAwBE;IAC1B;IAEA,OAAOF;AACT;AAEA,SAASE;IACP,IAAI;QACF,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,IAAAA,+BAAW;QACvC,IAAI,CAACD,YAAYD,SAAS,MAAM;YAC9B,OAAO;QACT;QACA,OAAO;YAAEG,IAAIH,MAAMG,EAAE;YAAEC,WAAWJ,MAAMI,SAAS;QAAC;IACpD,EAAE,OAAOC,OAAY;QACnBV,MAAM,qCAAqCU,CAAAA,yBAAAA,MAAOC,OAAO,KAAID;QAC7D,OAAO;IACT;AACF"}
@@ -83,7 +83,7 @@ function createContext() {
83
83
  cpu: summarizeCpuInfo(),
84
84
  app: {
85
85
  name: 'expo/cli',
86
- version: "57.0.2"
86
+ version: "57.0.4"
87
87
  },
88
88
  ci: _ciinfo().isCI ? {
89
89
  name: _ciinfo().name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "57.0.2",
3
+ "version": "57.0.4",
4
4
  "description": "The Expo CLI",
5
5
  "main": "main.js",
6
6
  "bin": {
@@ -39,29 +39,30 @@
39
39
  "homepage": "https://github.com/expo/expo/tree/main/packages/@expo/cli",
40
40
  "dependencies": {
41
41
  "@expo/code-signing-certificates": "^0.0.6",
42
- "@expo/config": "~57.0.1",
43
- "@expo/config-plugins": "~57.0.1",
42
+ "@expo/config": "~57.0.2",
43
+ "@expo/config-plugins": "~57.0.2",
44
44
  "@expo/devcert": "^1.2.1",
45
- "@expo/env": "~2.4.0",
46
- "@expo/image-utils": "^0.11.0",
45
+ "@expo/env": "~2.4.1",
46
+ "@expo/image-utils": "^0.11.1",
47
47
  "@expo/inline-modules": "^0.1.1",
48
48
  "@expo/json-file": "^11.0.0",
49
49
  "@expo/log-box": "^57.0.0",
50
50
  "@expo/metro": "~56.0.0",
51
- "@expo/metro-config": "~57.0.2",
51
+ "@expo/metro-config": "~57.0.3",
52
52
  "@expo/metro-file-map": "^57.0.0",
53
53
  "@expo/osascript": "^2.7.0",
54
54
  "@expo/package-manager": "^1.13.0",
55
55
  "@expo/plist": "^0.8.0",
56
- "@expo/prebuild-config": "^57.0.2",
57
- "@expo/require-utils": "^57.0.0",
56
+ "@expo/prebuild-config": "^57.0.4",
57
+ "@expo/require-utils": "^57.0.1",
58
58
  "@expo/router-server": "^57.0.1",
59
- "@expo/schema-utils": "^57.0.0",
59
+ "@expo/schema-utils": "^57.0.1",
60
60
  "@expo/spawn-async": "^1.8.0",
61
61
  "@expo/ws-tunnel": "^2.0.0",
62
62
  "@expo/xcpretty": "^4.4.4",
63
63
  "@react-native/dev-middleware": "0.86.0",
64
64
  "accepts": "^1.3.8",
65
+ "agent-cli-detector": "^0.1.2",
65
66
  "arg": "^5.0.2",
66
67
  "bplist-creator": "0.1.0",
67
68
  "bplist-parser": "^0.3.1",
@@ -156,13 +157,13 @@
156
157
  "playwright": "^1.59.0",
157
158
  "taskr": "^1.1.0",
158
159
  "tree-kill": "^1.2.2",
159
- "@expo/fingerprint": "0.20.1",
160
160
  "expo-module-scripts": "56.0.3",
161
- "expo": "57.0.0",
162
- "expo-modules-autolinking": "57.0.2",
163
- "expo-router": "57.0.2"
161
+ "expo": "57.0.2",
162
+ "expo-modules-autolinking": "57.0.4",
163
+ "expo-router": "57.0.3",
164
+ "@expo/fingerprint": "0.20.2"
164
165
  },
165
- "gitHead": "ab82681fbcef61d5283c1938290ba5cfe42e9cfd",
166
+ "gitHead": "5104cb89c3938bc9653e0cbad43da3a43a2e77a7",
166
167
  "scripts": {
167
168
  "build": "taskr",
168
169
  "clean": "expo-module clean",