@expo/cli 56.1.16 → 56.1.18
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 +1 -1
- package/build/src/events/index.js +1 -1
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +6 -3
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +2 -1
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/exportApp.js +1 -1
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportHermes.js +9 -1
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/resolveOptions.js +9 -10
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/start/server/metro/createExpoAutolinkingResolver.js +21 -8
- package/build/src/start/server/metro/createExpoAutolinkingResolver.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +5 -2
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +88 -11
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +3 -1
- package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js +3 -1
- package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/resolvePlatform.js +4 -2
- package/build/src/start/server/middleware/resolvePlatform.js.map +1 -1
- package/build/src/start/server/platformBundlers.js +3 -1
- package/build/src/start/server/platformBundlers.js.map +1 -1
- package/build/src/utils/findUp.js +17 -19
- package/build/src/utils/findUp.js.map +1 -1
- package/build/src/utils/telemetry/Telemetry.js +5 -0
- package/build/src/utils/telemetry/Telemetry.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/agent.js +42 -0
- package/build/src/utils/telemetry/utils/agent.js.map +1 -0
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +19 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/InterstitialPageMiddleware.ts"],"sourcesContent":["import { getConfig, getNameFromConfig } from '@expo/config';\nimport { getRuntimeVersionNullableAsync } from '@expo/config-plugins/build/utils/Updates';\nimport { readFile } from 'fs/promises';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { disableResponseCache, ExpoMiddleware } from './ExpoMiddleware';\nimport type { RuntimePlatform } from './resolvePlatform';\nimport {\n assertMissingRuntimePlatform,\n assertRuntimePlatform,\n parsePlatformHeader,\n resolvePlatformFromUserAgentHeader,\n} from './resolvePlatform';\nimport type { ServerRequest, ServerResponse } from './server.types';\n\ntype ProjectVersion = {\n type: 'sdk' | 'runtime';\n version: string | null;\n};\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:interstitialPage'\n) as typeof console.log;\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nexport const LoadingEndpoint = '/_expo/loading';\n\nexport class InterstitialPageMiddleware extends ExpoMiddleware {\n constructor(\n projectRoot: string,\n protected options: { scheme: string | null } = { scheme: null }\n ) {\n super(projectRoot, [LoadingEndpoint]);\n }\n\n /** Get the template HTML page and inject values. */\n async _getPageAsync({\n appName,\n projectVersion,\n }: {\n appName: string;\n projectVersion: ProjectVersion;\n }): Promise<string> {\n const templatePath =\n // Production: This will resolve when installed in the project.\n resolveFrom.silent(this.projectRoot, 'expo/static/loading-page/index.html') ??\n // Development: This will resolve when testing locally.\n path.resolve(__dirname, '../../../../../static/loading-page/index.html');\n let content = (await readFile(templatePath)).toString('utf-8');\n\n content = content.replace(/{{\\s*AppName\\s*}}/, escapeHtml(appName));\n content = content.replace(/{{\\s*Path\\s*}}/, escapeHtml(this.projectRoot));\n content = content.replace(/{{\\s*Scheme\\s*}}/, escapeHtml(this.options.scheme ?? 'Unknown'));\n content = content.replace(\n /{{\\s*ProjectVersionType\\s*}}/,\n `${projectVersion.type === 'sdk' ? 'SDK' : 'Runtime'} version`\n );\n content = content.replace(\n /{{\\s*ProjectVersion\\s*}}/,\n escapeHtml(projectVersion.version ?? 'Undetected')\n );\n\n return content;\n }\n\n /** Get settings for the page from the project config. */\n async _getProjectOptionsAsync(platform: RuntimePlatform): Promise<{\n appName: string;\n projectVersion: ProjectVersion;\n }> {\n assertRuntimePlatform(platform);\n\n const { exp } = getConfig(this.projectRoot);\n const { appName } = getNameFromConfig(exp);\n const runtimeVersion = await getRuntimeVersionNullableAsync(this.projectRoot
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/InterstitialPageMiddleware.ts"],"sourcesContent":["import { getConfig, getNameFromConfig } from '@expo/config';\nimport { getRuntimeVersionNullableAsync } from '@expo/config-plugins/build/utils/Updates';\nimport { readFile } from 'fs/promises';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { disableResponseCache, ExpoMiddleware } from './ExpoMiddleware';\nimport type { RuntimePlatform } from './resolvePlatform';\nimport {\n assertMissingRuntimePlatform,\n assertRuntimePlatform,\n parsePlatformHeader,\n resolvePlatformFromUserAgentHeader,\n} from './resolvePlatform';\nimport type { ServerRequest, ServerResponse } from './server.types';\n\ntype ProjectVersion = {\n type: 'sdk' | 'runtime';\n version: string | null;\n};\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:interstitialPage'\n) as typeof console.log;\n\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n}\n\nexport const LoadingEndpoint = '/_expo/loading';\n\nexport class InterstitialPageMiddleware extends ExpoMiddleware {\n constructor(\n projectRoot: string,\n protected options: { scheme: string | null } = { scheme: null }\n ) {\n super(projectRoot, [LoadingEndpoint]);\n }\n\n /** Get the template HTML page and inject values. */\n async _getPageAsync({\n appName,\n projectVersion,\n }: {\n appName: string;\n projectVersion: ProjectVersion;\n }): Promise<string> {\n const templatePath =\n // Production: This will resolve when installed in the project.\n resolveFrom.silent(this.projectRoot, 'expo/static/loading-page/index.html') ??\n // Development: This will resolve when testing locally.\n path.resolve(__dirname, '../../../../../static/loading-page/index.html');\n let content = (await readFile(templatePath)).toString('utf-8');\n\n content = content.replace(/{{\\s*AppName\\s*}}/, escapeHtml(appName));\n content = content.replace(/{{\\s*Path\\s*}}/, escapeHtml(this.projectRoot));\n content = content.replace(/{{\\s*Scheme\\s*}}/, escapeHtml(this.options.scheme ?? 'Unknown'));\n content = content.replace(\n /{{\\s*ProjectVersionType\\s*}}/,\n `${projectVersion.type === 'sdk' ? 'SDK' : 'Runtime'} version`\n );\n content = content.replace(\n /{{\\s*ProjectVersion\\s*}}/,\n escapeHtml(projectVersion.version ?? 'Undetected')\n );\n\n return content;\n }\n\n /** Get settings for the page from the project config. */\n async _getProjectOptionsAsync(platform: RuntimePlatform): Promise<{\n appName: string;\n projectVersion: ProjectVersion;\n }> {\n assertRuntimePlatform(platform);\n\n const { exp } = getConfig(this.projectRoot);\n const { appName } = getNameFromConfig(exp);\n const runtimeVersion = await getRuntimeVersionNullableAsync(\n this.projectRoot,\n exp,\n // TODO(@kitten): Runtime-version resolution only reads ios/android config\n // tvos/macos fall back to the shared `runtimeVersion` until they get explicit support\n platform as 'android' | 'ios'\n );\n const sdkVersion = exp.sdkVersion ?? null;\n\n return {\n appName: appName ?? 'App',\n projectVersion:\n sdkVersion && !runtimeVersion\n ? { type: 'sdk', version: sdkVersion }\n : { type: 'runtime', version: runtimeVersion },\n };\n }\n\n async handleRequestAsync(req: ServerRequest, res: ServerResponse): Promise<void> {\n res = disableResponseCache(res);\n res.setHeader('Content-Type', 'text/html');\n\n const platform = parsePlatformHeader(req) ?? resolvePlatformFromUserAgentHeader(req);\n assertMissingRuntimePlatform(platform);\n assertRuntimePlatform(platform);\n\n const { appName, projectVersion } = await this._getProjectOptionsAsync(platform);\n debug(\n `Create loading page. (platform: ${platform}, appName: ${appName}, projectVersion: ${projectVersion.version}, type: ${projectVersion.type})`\n );\n const content = await this._getPageAsync({ appName, projectVersion });\n res.end(content);\n }\n}\n"],"names":["InterstitialPageMiddleware","LoadingEndpoint","debug","require","escapeHtml","value","replace","ExpoMiddleware","projectRoot","options","scheme","_getPageAsync","appName","projectVersion","templatePath","resolveFrom","silent","path","resolve","__dirname","content","readFile","toString","type","version","_getProjectOptionsAsync","platform","assertRuntimePlatform","exp","getConfig","getNameFromConfig","runtimeVersion","getRuntimeVersionNullableAsync","sdkVersion","handleRequestAsync","req","res","disableResponseCache","setHeader","parsePlatformHeader","resolvePlatformFromUserAgentHeader","assertMissingRuntimePlatform","end"],"mappings":";;;;;;;;;;;QAoCaA;eAAAA;;QAFAC;eAAAA;;;;yBAlCgC;;;;;;;yBACE;;;;;;;yBACtB;;;;;;;gEACR;;;;;;;gEACO;;;;;;gCAE6B;iCAO9C;;;;;;AAQP,MAAMC,QAAQC,QAAQ,SACpB;AAGF,SAASC,WAAWC,KAAa;IAC/B,OAAOA,MACJC,OAAO,CAAC,MAAM,SACdA,OAAO,CAAC,MAAM,QACdA,OAAO,CAAC,MAAM,QACdA,OAAO,CAAC,MAAM,UACdA,OAAO,CAAC,MAAM;AACnB;AAEO,MAAML,kBAAkB;AAExB,MAAMD,mCAAmCO,8BAAc;IAC5D,YACEC,WAAmB,EACnB,AAAUC,UAAqC;QAAEC,QAAQ;IAAK,CAAC,CAC/D;QACA,KAAK,CAACF,aAAa;YAACP;SAAgB,QAF1BQ,UAAAA;IAGZ;IAEA,kDAAkD,GAClD,MAAME,cAAc,EAClBC,OAAO,EACPC,cAAc,EAIf,EAAmB;QAClB,MAAMC,eACJ,+DAA+D;QAC/DC,sBAAW,CAACC,MAAM,CAAC,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AWa,IAAAA,oCAAmB,EAACJ,QAAQK,IAAAA,mDAAkC,EAACL;QAChFM,IAAAA,6CAA4B,EAACf;QAC7BC,IAAAA,sCAAqB,EAACD;QAEtB,MAAM,EAAEd,OAAO,EAAEC,cAAc,EAAE,GAAG,MAAM,IAAI,CAACY,uBAAuB,CAACC;QACvExB,MACE,CAAC,gCAAgC,EAAEwB,SAAS,WAAW,EAAEd,QAAQ,kBAAkB,EAAEC,eAAeW,OAAO,CAAC,QAAQ,EAAEX,eAAeU,IAAI,CAAC,CAAC,CAAC;QAE9I,MAAMH,UAAU,MAAM,IAAI,CAACT,aAAa,CAAC;YAAEC;YAASC;QAAe;QACnEuB,IAAIM,GAAG,CAACtB;IACV;AACF"}
|
|
@@ -62,9 +62,11 @@ function assertRuntimePlatform(platform) {
|
|
|
62
62
|
if (![
|
|
63
63
|
'android',
|
|
64
64
|
'ios',
|
|
65
|
-
'web'
|
|
65
|
+
'web',
|
|
66
|
+
'tvos',
|
|
67
|
+
'macos'
|
|
66
68
|
].includes(stringifiedPlatform)) {
|
|
67
|
-
throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", or "
|
|
69
|
+
throw new _errors.CommandError('PLATFORM_HEADER', `platform must be "android", "ios", "web", "tvos", or "macos". Received: "${platform}"`);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import { parse } from 'url';\n\nimport type { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported platforms */\nexport type RuntimePlatform =
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/resolvePlatform.ts"],"sourcesContent":["import type { NativePlatform } from '@expo/config';\nimport { parse } from 'url';\n\nimport type { ServerRequest } from './server.types';\nimport { CommandError } from '../../../utils/errors';\n\nconst debug = require('debug')(\n 'expo:start:server:middleware:resolvePlatform'\n) as typeof console.log;\n\n/** Supported native runtime platforms. */\nexport type RuntimePlatform = NativePlatform;\n\n/**\n * Extract the runtime platform from the server request.\n * 1. Query param `platform`: `?platform=ios`\n * 2. Header `expo-platform`: `'expo-platform': ios`\n * 3. Legacy header `exponent-platform`: `'exponent-platform': ios`\n *\n * Returns first item in the case of an array.\n */\nexport function parsePlatformHeader(req: ServerRequest): string | null {\n const url = parse(req.url!, /* parseQueryString */ true);\n const platform =\n url.query?.platform || req.headers['expo-platform'] || req.headers['exponent-platform'];\n return (Array.isArray(platform) ? platform[0] : platform) ?? null;\n}\n\n/** Guess the platform from the user-agent header. */\nexport function resolvePlatformFromUserAgentHeader(req: ServerRequest): string | null {\n let platform = null;\n const userAgent = req.headers['user-agent'];\n if (userAgent?.match(/Android/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/OculusBrowser|Quest/i)) {\n platform = 'android';\n }\n if (userAgent?.match(/iPhone|iPad/i)) {\n platform = 'ios';\n }\n debug(`Resolved platform ${platform} from user-agent header: ${userAgent}`);\n return platform;\n}\n\n/** Assert if the runtime platform is not included. */\nexport function assertMissingRuntimePlatform(platform?: any): asserts platform {\n if (!platform) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `Must specify \"expo-platform\" header or \"platform\" query parameter`\n );\n }\n}\n\n/** Assert if the runtime platform is not correct. */\nexport function assertRuntimePlatform(platform: string): asserts platform is RuntimePlatform {\n const stringifiedPlatform = String(platform);\n if (!['android', 'ios', 'web', 'tvos', 'macos'].includes(stringifiedPlatform)) {\n throw new CommandError(\n 'PLATFORM_HEADER',\n `platform must be \"android\", \"ios\", \"web\", \"tvos\", or \"macos\". Received: \"${platform}\"`\n );\n }\n}\n"],"names":["assertMissingRuntimePlatform","assertRuntimePlatform","parsePlatformHeader","resolvePlatformFromUserAgentHeader","debug","require","req","url","parse","platform","query","headers","Array","isArray","userAgent","match","CommandError","stringifiedPlat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
|
|
@@ -32,7 +32,9 @@ function getPlatformBundlers(projectRoot, exp) {
|
|
|
32
32
|
return {
|
|
33
33
|
ios: ((_exp_ios = exp.ios) == null ? void 0 : _exp_ios.bundler) ?? 'metro',
|
|
34
34
|
android: ((_exp_android = exp.android) == null ? void 0 : _exp_android.bundler) ?? 'metro',
|
|
35
|
-
web
|
|
35
|
+
web,
|
|
36
|
+
tvos: 'metro',
|
|
37
|
+
macos: 'metro'
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
40
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;
|
|
1
|
+
{"version":3,"sources":["../../../../src/start/server/platformBundlers.ts"],"sourcesContent":["import type { ExpoConfig, ExpoConfigWeb, Platform } from '@expo/config';\nimport resolveFrom from 'resolve-from';\n\n/** Which bundler each platform should use. */\nexport type PlatformBundlers = Record<Platform, 'metro' | 'webpack'>;\n\n/** XDL-schema doesn't have `ios.bundler` and `android.bundler`, since this is technically deprecated */\ntype WithBundlerConfig = Pick<ExpoConfigWeb, 'bundler'> | undefined | null;\n\n/** Get the platform bundlers mapping. */\nexport function getPlatformBundlers(\n projectRoot: string,\n exp: Partial<ExpoConfig>\n): PlatformBundlers {\n /**\n * SDK 50+: The web bundler is dynamic based upon the presence of the `@expo/webpack-config` package.\n */\n let web = exp.web?.bundler;\n if (!web) {\n const resolved = resolveFrom.silent(projectRoot, '@expo/webpack-config/package.json');\n web = resolved ? 'webpack' : 'metro';\n }\n\n return {\n ios: (exp.ios as WithBundlerConfig)?.bundler ?? 'metro',\n android: (exp.android as WithBundlerConfig)?.bundler ?? 'metro',\n web,\n tvos: 'metro',\n macos: 'metro',\n };\n}\n"],"names":["getPlatformBundlers","projectRoot","exp","web","bundler","resolved","resolveFrom","silent","ios","android","tvos","macos"],"mappings":";;;;+BAUgBA;;;eAAAA;;;;gEATQ;;;;;;;;;;;AASjB,SAASA,oBACdC,WAAmB,EACnBC,GAAwB;QAKdA,UAOFA,UACIA;IAXZ;;GAEC,GACD,IAAIC,OAAMD,WAAAA,IAAIC,GAAG,qBAAPD,SAASE,OAAO;IAC1B,IAAI,CAACD,KAAK;QACR,MAAME,WAAWC,sBAAW,CAACC,MAAM,CAACN,aAAa;QACjDE,MAAME,WAAW,YAAY;IAC/B;IAEA,OAAO;QACLG,KAAK,EAACN,WAAAA,IAAIM,GAAG,qBAAR,AAACN,SAA+BE,OAAO,KAAI;QAChDK,SAAS,EAACP,eAAAA,IAAIO,OAAO,qBAAZ,AAACP,aAAmCE,OAAO,KAAI;QACxDD;QACAO,MAAM;QACNC,OAAO;IACT;AACF"}
|
|
@@ -16,16 +16,16 @@ _export(exports, {
|
|
|
16
16
|
return findUpProjectRootOrAssert;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
function
|
|
20
|
-
const data = /*#__PURE__*/ _interop_require_default(require("
|
|
21
|
-
|
|
19
|
+
function _fs() {
|
|
20
|
+
const data = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
21
|
+
_fs = function() {
|
|
22
22
|
return data;
|
|
23
23
|
};
|
|
24
24
|
return data;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const data = /*#__PURE__*/ _interop_require_default(require("
|
|
28
|
-
|
|
26
|
+
function _path() {
|
|
27
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
28
|
+
_path = function() {
|
|
29
29
|
return data;
|
|
30
30
|
};
|
|
31
31
|
return data;
|
|
@@ -41,21 +41,19 @@ function findUpProjectRootOrAssert(cwd) {
|
|
|
41
41
|
if (!projectRoot) {
|
|
42
42
|
throw new _errors.CommandError(`Project root directory not found (working directory: ${cwd})`);
|
|
43
43
|
}
|
|
44
|
-
return projectRoot;
|
|
44
|
+
return _path().default.dirname(projectRoot);
|
|
45
45
|
}
|
|
46
|
-
function findUpProjectRoot(
|
|
47
|
-
|
|
48
|
-
if (found) return _path().default.dirname(found);
|
|
49
|
-
const parent = _path().default.dirname(cwd);
|
|
50
|
-
if (parent === cwd) return null;
|
|
51
|
-
return findUpProjectRoot(parent);
|
|
46
|
+
function findUpProjectRoot(root) {
|
|
47
|
+
return findFileInParents(root, 'package.json');
|
|
52
48
|
}
|
|
53
|
-
function findFileInParents(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
49
|
+
function findFileInParents(root, fileName) {
|
|
50
|
+
for(let dir = root; _path().default.dirname(dir) !== dir; dir = _path().default.dirname(dir)){
|
|
51
|
+
const file = _path().default.resolve(dir, fileName);
|
|
52
|
+
if (_fs().default.existsSync(file)) {
|
|
53
|
+
return file;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
//# sourceMappingURL=findUp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/findUp.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/findUp.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport { CommandError } from '../utils/errors';\n\n/** Look up directories until one with a `package.json` can be found, assert if none can be found. */\nexport function findUpProjectRootOrAssert(cwd: string): string {\n const projectRoot = findUpProjectRoot(cwd);\n if (!projectRoot) {\n throw new CommandError(`Project root directory not found (working directory: ${cwd})`);\n }\n return path.dirname(projectRoot);\n}\n\nfunction findUpProjectRoot(root: string): string | null {\n return findFileInParents(root, 'package.json');\n}\n\n/**\n * Find a file in the (closest) parent directories.\n * This will recursively look for the file, until the root directory is reached.\n */\nexport function findFileInParents(root: string, fileName: string): string | null {\n for (let dir = root; path.dirname(dir) !== dir; dir = path.dirname(dir)) {\n const file = path.resolve(dir, fileName);\n if (fs.existsSync(file)) {\n return file;\n }\n }\n return null;\n}\n"],"names":["findFileInParents","findUpProjectRootOrAssert","cwd","projectRoot","findUpProjectRoot","CommandError","path","dirname","root","fileName","dir","file","resolve","fs","existsSync"],"mappings":";;;;;;;;;;;QAsBgBA;eAAAA;;QAhBAC;eAAAA;;;;gEAND;;;;;;;gEACE;;;;;;wBAEY;;;;;;AAGtB,SAASA,0BAA0BC,GAAW;IACnD,MAAMC,cAAcC,kBAAkBF;IACtC,IAAI,CAACC,aAAa;QAChB,MAAM,IAAIE,oBAAY,CAAC,CAAC,qDAAqD,EAAEH,IAAI,CAAC,CAAC;IACvF;IACA,OAAOI,eAAI,CAACC,OAAO,CAACJ;AACtB;AAEA,SAASC,kBAAkBI,IAAY;IACrC,OAAOR,kBAAkBQ,MAAM;AACjC;AAMO,SAASR,kBAAkBQ,IAAY,EAAEC,QAAgB;IAC9D,IAAK,IAAIC,MAAMF,MAAMF,eAAI,CAACC,OAAO,CAACG,SAASA,KAAKA,MAAMJ,eAAI,CAACC,OAAO,CAACG,KAAM;QACvE,MAAMC,OAAOL,eAAI,CAACM,OAAO,CAACF,KAAKD;QAC/B,IAAII,aAAE,CAACC,UAAU,CAACH,OAAO;YACvB,OAAOA;QACT;IACF;IACA,OAAO;AACT"}
|
|
@@ -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":";;;;+
|
|
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,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,IA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AAK,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/${"56.1.
|
|
29
|
+
'user-agent': `expo-cli/${"56.1.18"}`,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "56.1.
|
|
3
|
+
"version": "56.1.18",
|
|
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": "~56.0.
|
|
43
|
-
"@expo/config-plugins": "~56.0.
|
|
42
|
+
"@expo/config": "~56.0.11",
|
|
43
|
+
"@expo/config-plugins": "~56.0.11",
|
|
44
44
|
"@expo/devcert": "^1.2.1",
|
|
45
|
-
"@expo/env": "~2.3.
|
|
46
|
-
"@expo/image-utils": "^0.10.
|
|
47
|
-
"@expo/inline-modules": "^0.0.
|
|
45
|
+
"@expo/env": "~2.3.1",
|
|
46
|
+
"@expo/image-utils": "^0.10.2",
|
|
47
|
+
"@expo/inline-modules": "^0.0.13",
|
|
48
48
|
"@expo/json-file": "^10.2.0",
|
|
49
|
-
"@expo/log-box": "^56.0.
|
|
49
|
+
"@expo/log-box": "^56.0.14",
|
|
50
50
|
"@expo/metro": "~56.0.0",
|
|
51
|
-
"@expo/metro-config": "~56.0.
|
|
51
|
+
"@expo/metro-config": "~56.0.16",
|
|
52
52
|
"@expo/metro-file-map": "^56.0.3",
|
|
53
53
|
"@expo/osascript": "^2.6.0",
|
|
54
54
|
"@expo/package-manager": "^1.12.1",
|
|
55
55
|
"@expo/plist": "^0.7.0",
|
|
56
|
-
"@expo/prebuild-config": "^56.0.
|
|
57
|
-
"@expo/require-utils": "^56.1.
|
|
58
|
-
"@expo/router-server": "^56.0.
|
|
59
|
-
"@expo/schema-utils": "^56.0.
|
|
56
|
+
"@expo/prebuild-config": "^56.0.18",
|
|
57
|
+
"@expo/require-utils": "^56.1.4",
|
|
58
|
+
"@expo/router-server": "^56.0.15",
|
|
59
|
+
"@expo/schema-utils": "^56.0.2",
|
|
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.85.3",
|
|
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",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"compression": "^1.7.4",
|
|
71
72
|
"connect": "^3.7.0",
|
|
72
73
|
"debug": "^4.3.4",
|
|
73
|
-
"dnssd-advertise": "^1.1.
|
|
74
|
+
"dnssd-advertise": "^1.1.6",
|
|
74
75
|
"expo-server": "^56.0.5",
|
|
75
76
|
"fetch-nodeshim": "^0.4.10",
|
|
76
77
|
"getenv": "^2.0.0",
|
|
@@ -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": "56.0.12",
|
|
160
160
|
"expo-module-scripts": "56.0.3",
|
|
161
|
-
"expo
|
|
162
|
-
"
|
|
163
|
-
"expo
|
|
161
|
+
"expo": "56.0.14",
|
|
162
|
+
"expo-modules-autolinking": "56.0.18",
|
|
163
|
+
"@expo/fingerprint": "0.19.6",
|
|
164
|
+
"expo-router": "56.2.13"
|
|
164
165
|
},
|
|
165
|
-
"gitHead": "
|
|
166
|
+
"gitHead": "b2e161a54f90a778ab7e5560c0c8f021bbfcaae2",
|
|
166
167
|
"scripts": {
|
|
167
168
|
"build": "taskr",
|
|
168
169
|
"clean": "expo-module clean",
|