@expo/cli 0.5.1 → 0.6.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/bin/cli +2 -2
- package/build/src/export/createBundles.js.map +1 -1
- package/build/src/export/exportApp.js +1 -2
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/install/checkPackages.js +3 -6
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/installAsync.js +37 -3
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/resolveOptions.js.map +1 -1
- package/build/src/run/ios/appleDevice/ClientManager.js +5 -1
- package/build/src/run/ios/appleDevice/ClientManager.js.map +1 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js +5 -1
- package/build/src/run/ios/appleDevice/client/LockdowndClient.js.map +1 -1
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js +18 -0
- package/build/src/run/ios/appleDevice/protocol/AbstractProtocol.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +13 -3
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +6 -2
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js +1 -1
- package/build/src/start/doctor/typescript/updateTSConfig.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +14 -10
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +4 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +30 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/resolveEntryPoint.js +5 -1
- package/build/src/start/server/middleware/resolveEntryPoint.js.map +1 -1
- package/build/src/utils/FileNotifier.js +11 -2
- package/build/src/utils/FileNotifier.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/array.js +11 -0
- package/build/src/utils/array.js.map +1 -1
- package/build/src/utils/env.js +3 -0
- package/build/src/utils/env.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/ManifestMiddleware.ts"],"sourcesContent":["import { ExpoConfig, ExpoGoConfig, getConfig, ProjectConfig } from '@expo/config';\nimport { resolve } from 'url';\n\nimport * as Log from '../../../log';\nimport { stripExtension } from '../../../utils/url';\nimport * as ProjectDevices from '../../project/devices';\nimport { UrlCreator } from '../UrlCreator';\nimport { getPlatformBundlers } from '../platformBundlers';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../webTemplate';\nimport { ExpoMiddleware } from './ExpoMiddleware';\nimport { resolveGoogleServicesFile, resolveManifestAssets } from './resolveAssets';\nimport { resolveEntryPoint } from './resolveEntryPoint';\nimport { parsePlatformHeader, RuntimePlatform } from './resolvePlatform';\nimport { ServerHeaders, ServerNext, ServerRequest, ServerResponse } from './server.types';\n\n/** Info about the computer hosting the dev server. */\nexport interface HostInfo {\n host: string;\n server: 'expo';\n serverVersion: string;\n serverDriver: string | null;\n serverOS: NodeJS.Platform;\n serverOSVersion: string;\n}\n\n/** Parsed values from the supported request headers. */\nexport interface ManifestRequestInfo {\n /** Should return the signed manifest. */\n acceptSignature: boolean;\n /** Platform to serve. */\n platform: RuntimePlatform;\n /** Requested host name. */\n hostname?: string | null;\n}\n\n/** Project related info. */\nexport type ResponseProjectSettings = {\n expoGoConfig: ExpoGoConfig;\n hostUri: string;\n bundleUrl: string;\n exp: ExpoConfig;\n};\n\nexport const DEVELOPER_TOOL = 'expo-cli';\n\nexport type ManifestMiddlewareOptions = {\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n constructUrl: UrlCreator['constructUrl'];\n isNativeWebpack?: boolean;\n privateKeyPath?: string;\n};\n\n/** Base middleware creator for serving the Expo manifest (like the index.html but for native runtimes). */\nexport abstract class ManifestMiddleware<\n TManifestRequestInfo extends ManifestRequestInfo\n> extends ExpoMiddleware {\n private initialProjectConfig: ProjectConfig;\n\n constructor(protected projectRoot: string, protected options: ManifestMiddlewareOptions) {\n super(\n projectRoot,\n /**\n * Only support `/`, `/manifest`, `/index.exp` for the manifest middleware.\n */\n ['/', '/manifest', '/index.exp']\n );\n this.initialProjectConfig = getConfig(projectRoot);\n }\n\n /** Exposed for testing. */\n public async _resolveProjectSettingsAsync({\n platform,\n hostname,\n }: Pick<TManifestRequestInfo, 'hostname' | 'platform'>): Promise<ResponseProjectSettings> {\n // Read the config\n const projectConfig = getConfig(this.projectRoot);\n\n // Read from headers\n const mainModuleName = this.resolveMainModuleName(projectConfig, platform);\n\n // Create the manifest and set fields within it\n const expoGoConfig = this.getExpoGoConfig({\n mainModuleName,\n hostname,\n });\n\n const hostUri = this.options.constructUrl({ scheme: '', hostname });\n\n const bundleUrl = this._getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n });\n\n // Resolve all assets and set them on the manifest as URLs\n await this.mutateManifestWithAssetsAsync(projectConfig.exp, bundleUrl);\n\n return {\n expoGoConfig,\n hostUri,\n bundleUrl,\n exp: projectConfig.exp,\n };\n }\n\n /** Get the main entry module ID (file) relative to the project root. */\n private resolveMainModuleName(projectConfig: ProjectConfig, platform: string): string {\n let entryPoint = resolveEntryPoint(this.projectRoot, platform, projectConfig);\n // NOTE(Bacon): Webpack is currently hardcoded to index.bundle on native\n // in the future (TODO) we should move this logic into a Webpack plugin and use\n // a generated file name like we do on web.\n // const server = getDefaultDevServer();\n // // TODO: Move this into BundlerDevServer and read this info from self.\n // const isNativeWebpack = server instanceof WebpackBundlerDevServer && server.isTargetingNative();\n if (this.options.isNativeWebpack) {\n entryPoint = 'index.js';\n }\n\n return stripExtension(entryPoint, 'js');\n }\n\n /** Parse request headers into options. */\n public abstract getParsedHeaders(req: ServerRequest): TManifestRequestInfo;\n\n /** Store device IDs that were sent in the request headers. */\n private async saveDevicesAsync(req: ServerRequest) {\n const deviceIds = req.headers?.['expo-dev-client-id'];\n if (deviceIds) {\n await ProjectDevices.saveDevicesAsync(this.projectRoot, deviceIds).catch((e) =>\n Log.exception(e)\n );\n }\n }\n\n /** Create the bundle URL (points to the single JS entry file). Exposed for testing. */\n public _getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n }: {\n platform: string;\n hostname?: string | null;\n mainModuleName: string;\n }): string {\n const path = this._getBundleUrlPath({ platform, mainModuleName });\n\n return (\n this.options.constructUrl({\n scheme: 'http',\n // hostType: this.options.location.hostType,\n hostname,\n }) + path\n );\n }\n\n public _getBundleUrlPath({\n platform,\n mainModuleName,\n }: {\n platform: string;\n mainModuleName: string;\n }): string {\n const queryParams = new URLSearchParams({\n platform: encodeURIComponent(platform),\n dev: String(this.options.mode !== 'production'),\n // TODO: Is this still needed?\n hot: String(false),\n });\n\n if (this.options.minify) {\n queryParams.append('minify', String(this.options.minify));\n }\n\n return `/${encodeURI(mainModuleName)}.bundle?${queryParams.toString()}`;\n }\n\n /** Log telemetry. */\n protected abstract trackManifest(version?: string): void;\n\n /** Get the manifest response to return to the runtime. This file contains info regarding where the assets can be loaded from. Exposed for testing. */\n public abstract _getManifestResponseAsync(options: TManifestRequestInfo): Promise<{\n body: string;\n version: string;\n headers: ServerHeaders;\n }>;\n\n private getExpoGoConfig({\n mainModuleName,\n hostname,\n }: {\n mainModuleName: string;\n hostname?: string | null;\n }): ExpoGoConfig {\n return {\n // localhost:19000\n debuggerHost: this.options.constructUrl({ scheme: '', hostname }),\n // http://localhost:19000/logs -- used to send logs to the CLI for displaying in the terminal.\n // This is deprecated in favor of the WebSocket connection setup in Metro.\n logUrl: this.options.constructUrl({ scheme: 'http', hostname }) + '/logs',\n // Required for Expo Go to function.\n developer: {\n tool: DEVELOPER_TOOL,\n projectRoot: this.projectRoot,\n },\n packagerOpts: {\n // Required for dev client.\n dev: this.options.mode !== 'production',\n },\n // Indicates the name of the main bundle.\n mainModuleName,\n // Add this string to make Flipper register React Native / Metro as \"running\".\n // Can be tested by running:\n // `METRO_SERVER_PORT=19000 open -a flipper.app`\n // Where 19000 is the port where the Expo project is being hosted.\n __flipperHack: 'React Native packager is running',\n };\n }\n\n /** Resolve all assets and set them on the manifest as URLs */\n private async mutateManifestWithAssetsAsync(manifest: ExpoConfig, bundleUrl: string) {\n await resolveManifestAssets(this.projectRoot, {\n manifest,\n resolver: async (path) => {\n if (this.options.isNativeWebpack) {\n // When using our custom dev server, just do assets normally\n // without the `assets/` subpath redirect.\n return resolve(bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0], path);\n }\n return bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0] + 'assets/' + path;\n },\n });\n // The server normally inserts this but if we're offline we'll do it here\n await resolveGoogleServicesFile(this.projectRoot, manifest);\n }\n\n /**\n * Web platforms should create an index.html response using the same script resolution as native.\n *\n * Instead of adding a `bundleUrl` to a `manifest.json` (native) we'll add a `<script src=\"\">`\n * to an `index.html`, this enables the web platform to load JavaScript from the server.\n */\n private async handleWebRequestAsync(req: ServerRequest, res: ServerResponse) {\n const platform = 'web';\n // Read from headers\n const mainModuleName = this.resolveMainModuleName(this.initialProjectConfig, platform);\n const bundleUrl = this._getBundleUrlPath({\n platform,\n mainModuleName,\n });\n\n res.setHeader('Content-Type', 'text/html');\n\n res.end(\n await createTemplateHtmlFromExpoConfigAsync(this.projectRoot, {\n exp: this.initialProjectConfig.exp,\n scripts: [bundleUrl],\n })\n );\n }\n\n /** Exposed for testing. */\n async checkBrowserRequestAsync(req: ServerRequest, res: ServerResponse) {\n // Read the config\n const bundlers = getPlatformBundlers(this.initialProjectConfig.exp);\n if (bundlers.web === 'metro') {\n // NOTE(EvanBacon): This effectively disables the safety check we do on custom runtimes to ensure\n // the `expo-platform` header is included. When `web.bundler=web`, if the user has non-standard Expo\n // code loading then they'll get a web bundle without a clear assertion of platform support.\n const platform = parsePlatformHeader(req);\n // On web, serve the public folder\n if (!platform || platform === 'web') {\n await this.handleWebRequestAsync(req, res);\n return true;\n }\n }\n return false;\n }\n\n async handleRequestAsync(\n req: ServerRequest,\n res: ServerResponse,\n next: ServerNext\n ): Promise<void> {\n // First check for standard JavaScript runtimes (aka legacy browsers like Chrome).\n if (await this.checkBrowserRequestAsync(req, res)) {\n return;\n }\n\n // Save device IDs for dev client.\n await this.saveDevicesAsync(req);\n\n // Read from headers\n const options = this.getParsedHeaders(req);\n const { body, version, headers } = await this._getManifestResponseAsync(options);\n for (const [headerName, headerValue] of headers) {\n res.setHeader(headerName, headerValue);\n }\n res.end(body);\n\n // Log analytics\n this.trackManifest(version ?? null);\n }\n}\n"],"names":["Log","ProjectDevices","DEVELOPER_TOOL","ManifestMiddleware","ExpoMiddleware","constructor","projectRoot","options","initialProjectConfig","getConfig","_resolveProjectSettingsAsync","platform","hostname","projectConfig","mainModuleName","resolveMainModuleName","expoGoConfig","getExpoGoConfig","hostUri","constructUrl","scheme","bundleUrl","_getBundleUrl","mutateManifestWithAssetsAsync","exp","entryPoint","resolveEntryPoint","isNativeWebpack","stripExtension","saveDevicesAsync","req","deviceIds","headers","catch","e","exception","path","_getBundleUrlPath","queryParams","URLSearchParams","encodeURIComponent","dev","String","mode","hot","minify","append","encodeURI","toString","debuggerHost","logUrl","developer","tool","packagerOpts","__flipperHack","manifest","resolveManifestAssets","resolver","resolve","match","resolveGoogleServicesFile","handleWebRequestAsync","res","setHeader","end","createTemplateHtmlFromExpoConfigAsync","scripts","checkBrowserRequestAsync","bundlers","getPlatformBundlers","web","parsePlatformHeader","handleRequestAsync","next","getParsedHeaders","body","version","_getManifestResponseAsync","headerName","headerValue","trackManifest"],"mappings":"AAAA;;;;;AAAmE,IAAA,OAAc,WAAd,cAAc,CAAA;AACzD,IAAA,IAAK,WAAL,KAAK,CAAA;AAEjBA,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACgB,IAAA,KAAoB,WAApB,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kBAAkB,CACtB1C,GAAkB,EAClBgC,GAAmB,EACnBW,IAAgB,EACD;QACf,kFAAkF;QAClF,IAAI,MAAM,IAAI,CAACN,wBAAwB,CAACrC,GAAG,EAAEgC,GAAG,CAAC,EAAE;YACjD,OAAO;SACR;QAED,kCAAkC;QAClC,MAAM,IAAI,CAACjC,gBAAgB,CAACC,GAAG,CAAC,CAAC;QAEjC,oBAAoB;QACpB,MAAMvB,OAAO,GAAG,IAAI,CAACmE,gBAAgB,CAAC5C,GAAG,CAAC,AAAC;QAC3C,MAAM,EAAE6C,IAAI,CAAA,EAAEC,OAAO,CAAA,EAAE5C,OAAO,CAAA,EAAE,GAAG,MAAM,IAAI,CAAC6C,yBAAyB,CAACtE,OAAO,CAAC,AAAC;QACjF,KAAK,MAAM,CAACuE,UAAU,EAAEC,WAAW,CAAC,IAAI/C,OAAO,CAAE;YAC/C8B,GAAG,CAACC,SAAS,CAACe,UAAU,EAAEC,WAAW,CAAC,CAAC;SACxC;QACDjB,GAAG,CAACE,GAAG,CAACW,IAAI,CAAC,CAAC;QAEd,gBAAgB;QAChB,IAAI,CAACK,aAAa,CAACJ,OAAO,WAAPA,OAAO,GAAI,IAAI,CAAC,CAAC;KACrC;CACF;QAzPqBzE,kBAAkB,GAAlBA,kBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/ManifestMiddleware.ts"],"sourcesContent":["import { ExpoConfig, ExpoGoConfig, getConfig, ProjectConfig } from '@expo/config';\nimport findWorkspaceRoot from 'find-yarn-workspace-root';\nimport path from 'path';\nimport { resolve } from 'url';\n\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\nimport { stripExtension } from '../../../utils/url';\nimport * as ProjectDevices from '../../project/devices';\nimport { UrlCreator } from '../UrlCreator';\nimport { getPlatformBundlers } from '../platformBundlers';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../webTemplate';\nimport { ExpoMiddleware } from './ExpoMiddleware';\nimport { resolveGoogleServicesFile, resolveManifestAssets } from './resolveAssets';\nimport { resolveAbsoluteEntryPoint } from './resolveEntryPoint';\nimport { parsePlatformHeader, RuntimePlatform } from './resolvePlatform';\nimport { ServerHeaders, ServerNext, ServerRequest, ServerResponse } from './server.types';\n\nconst debug = require('debug')('expo:start:server:middleware:manifest') as typeof console.log;\n\n/** Wraps `findWorkspaceRoot` and guards against having an empty `package.json` file in an upper directory. */\nexport function getWorkspaceRoot(projectRoot: string): string | null {\n try {\n return findWorkspaceRoot(projectRoot);\n } catch (error: any) {\n if (error.message.includes('Unexpected end of JSON input')) {\n return null;\n }\n throw error;\n }\n}\n\nexport function getMetroServerRoot(projectRoot: string) {\n if (env.EXPO_USE_METRO_WORKSPACE_ROOT) {\n return getWorkspaceRoot(projectRoot) ?? projectRoot;\n }\n\n return projectRoot;\n}\n\n/** Info about the computer hosting the dev server. */\nexport interface HostInfo {\n host: string;\n server: 'expo';\n serverVersion: string;\n serverDriver: string | null;\n serverOS: NodeJS.Platform;\n serverOSVersion: string;\n}\n\n/** Parsed values from the supported request headers. */\nexport interface ManifestRequestInfo {\n /** Should return the signed manifest. */\n acceptSignature: boolean;\n /** Platform to serve. */\n platform: RuntimePlatform;\n /** Requested host name. */\n hostname?: string | null;\n}\n\n/** Project related info. */\nexport type ResponseProjectSettings = {\n expoGoConfig: ExpoGoConfig;\n hostUri: string;\n bundleUrl: string;\n exp: ExpoConfig;\n};\n\nexport const DEVELOPER_TOOL = 'expo-cli';\n\nexport type ManifestMiddlewareOptions = {\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n constructUrl: UrlCreator['constructUrl'];\n isNativeWebpack?: boolean;\n privateKeyPath?: string;\n};\n\n/** Base middleware creator for serving the Expo manifest (like the index.html but for native runtimes). */\nexport abstract class ManifestMiddleware<\n TManifestRequestInfo extends ManifestRequestInfo\n> extends ExpoMiddleware {\n private initialProjectConfig: ProjectConfig;\n\n constructor(protected projectRoot: string, protected options: ManifestMiddlewareOptions) {\n super(\n projectRoot,\n /**\n * Only support `/`, `/manifest`, `/index.exp` for the manifest middleware.\n */\n ['/', '/manifest', '/index.exp']\n );\n this.initialProjectConfig = getConfig(projectRoot);\n }\n\n /** Exposed for testing. */\n public async _resolveProjectSettingsAsync({\n platform,\n hostname,\n }: Pick<TManifestRequestInfo, 'hostname' | 'platform'>): Promise<ResponseProjectSettings> {\n // Read the config\n const projectConfig = getConfig(this.projectRoot);\n\n // Read from headers\n const mainModuleName = this.resolveMainModuleName(projectConfig, platform);\n\n // Create the manifest and set fields within it\n const expoGoConfig = this.getExpoGoConfig({\n mainModuleName,\n hostname,\n });\n\n const hostUri = this.options.constructUrl({ scheme: '', hostname });\n\n const bundleUrl = this._getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n });\n\n // Resolve all assets and set them on the manifest as URLs\n await this.mutateManifestWithAssetsAsync(projectConfig.exp, bundleUrl);\n\n return {\n expoGoConfig,\n hostUri,\n bundleUrl,\n exp: projectConfig.exp,\n };\n }\n\n /** Get the main entry module ID (file) relative to the project root. */\n private resolveMainModuleName(projectConfig: ProjectConfig, platform: string): string {\n let entryPoint = path.relative(\n getMetroServerRoot(this.projectRoot),\n resolveAbsoluteEntryPoint(this.projectRoot, platform, projectConfig)\n );\n\n debug(`Resolved entry point: ${entryPoint} (project root: ${this.projectRoot})`);\n\n // NOTE(Bacon): Webpack is currently hardcoded to index.bundle on native\n // in the future (TODO) we should move this logic into a Webpack plugin and use\n // a generated file name like we do on web.\n // const server = getDefaultDevServer();\n // // TODO: Move this into BundlerDevServer and read this info from self.\n // const isNativeWebpack = server instanceof WebpackBundlerDevServer && server.isTargetingNative();\n if (this.options.isNativeWebpack) {\n entryPoint = 'index.js';\n }\n\n return stripExtension(entryPoint, 'js');\n }\n\n /** Parse request headers into options. */\n public abstract getParsedHeaders(req: ServerRequest): TManifestRequestInfo;\n\n /** Store device IDs that were sent in the request headers. */\n private async saveDevicesAsync(req: ServerRequest) {\n const deviceIds = req.headers?.['expo-dev-client-id'];\n if (deviceIds) {\n await ProjectDevices.saveDevicesAsync(this.projectRoot, deviceIds).catch((e) =>\n Log.exception(e)\n );\n }\n }\n\n /** Create the bundle URL (points to the single JS entry file). Exposed for testing. */\n public _getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n }: {\n platform: string;\n hostname?: string | null;\n mainModuleName: string;\n }): string {\n const path = this._getBundleUrlPath({ platform, mainModuleName });\n\n return (\n this.options.constructUrl({\n scheme: 'http',\n // hostType: this.options.location.hostType,\n hostname,\n }) + path\n );\n }\n\n public _getBundleUrlPath({\n platform,\n mainModuleName,\n }: {\n platform: string;\n mainModuleName: string;\n }): string {\n const queryParams = new URLSearchParams({\n platform: encodeURIComponent(platform),\n dev: String(this.options.mode !== 'production'),\n // TODO: Is this still needed?\n hot: String(false),\n });\n\n if (this.options.minify) {\n queryParams.append('minify', String(this.options.minify));\n }\n\n return `/${encodeURI(mainModuleName)}.bundle?${queryParams.toString()}`;\n }\n\n /** Log telemetry. */\n protected abstract trackManifest(version?: string): void;\n\n /** Get the manifest response to return to the runtime. This file contains info regarding where the assets can be loaded from. Exposed for testing. */\n public abstract _getManifestResponseAsync(options: TManifestRequestInfo): Promise<{\n body: string;\n version: string;\n headers: ServerHeaders;\n }>;\n\n private getExpoGoConfig({\n mainModuleName,\n hostname,\n }: {\n mainModuleName: string;\n hostname?: string | null;\n }): ExpoGoConfig {\n return {\n // localhost:19000\n debuggerHost: this.options.constructUrl({ scheme: '', hostname }),\n // http://localhost:19000/logs -- used to send logs to the CLI for displaying in the terminal.\n // This is deprecated in favor of the WebSocket connection setup in Metro.\n logUrl: this.options.constructUrl({ scheme: 'http', hostname }) + '/logs',\n // Required for Expo Go to function.\n developer: {\n tool: DEVELOPER_TOOL,\n projectRoot: this.projectRoot,\n },\n packagerOpts: {\n // Required for dev client.\n dev: this.options.mode !== 'production',\n },\n // Indicates the name of the main bundle.\n mainModuleName,\n // Add this string to make Flipper register React Native / Metro as \"running\".\n // Can be tested by running:\n // `METRO_SERVER_PORT=19000 open -a flipper.app`\n // Where 19000 is the port where the Expo project is being hosted.\n __flipperHack: 'React Native packager is running',\n };\n }\n\n /** Resolve all assets and set them on the manifest as URLs */\n private async mutateManifestWithAssetsAsync(manifest: ExpoConfig, bundleUrl: string) {\n await resolveManifestAssets(this.projectRoot, {\n manifest,\n resolver: async (path) => {\n if (this.options.isNativeWebpack) {\n // When using our custom dev server, just do assets normally\n // without the `assets/` subpath redirect.\n return resolve(bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0], path);\n }\n return bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0] + 'assets/' + path;\n },\n });\n // The server normally inserts this but if we're offline we'll do it here\n await resolveGoogleServicesFile(this.projectRoot, manifest);\n }\n\n /**\n * Web platforms should create an index.html response using the same script resolution as native.\n *\n * Instead of adding a `bundleUrl` to a `manifest.json` (native) we'll add a `<script src=\"\">`\n * to an `index.html`, this enables the web platform to load JavaScript from the server.\n */\n private async handleWebRequestAsync(req: ServerRequest, res: ServerResponse) {\n const platform = 'web';\n // Read from headers\n const mainModuleName = this.resolveMainModuleName(this.initialProjectConfig, platform);\n const bundleUrl = this._getBundleUrlPath({\n platform,\n mainModuleName,\n });\n\n res.setHeader('Content-Type', 'text/html');\n\n res.end(\n await createTemplateHtmlFromExpoConfigAsync(this.projectRoot, {\n exp: this.initialProjectConfig.exp,\n scripts: [bundleUrl],\n })\n );\n }\n\n /** Exposed for testing. */\n async checkBrowserRequestAsync(req: ServerRequest, res: ServerResponse) {\n // Read the config\n const bundlers = getPlatformBundlers(this.initialProjectConfig.exp);\n if (bundlers.web === 'metro') {\n // NOTE(EvanBacon): This effectively disables the safety check we do on custom runtimes to ensure\n // the `expo-platform` header is included. When `web.bundler=web`, if the user has non-standard Expo\n // code loading then they'll get a web bundle without a clear assertion of platform support.\n const platform = parsePlatformHeader(req);\n // On web, serve the public folder\n if (!platform || platform === 'web') {\n await this.handleWebRequestAsync(req, res);\n return true;\n }\n }\n return false;\n }\n\n async handleRequestAsync(\n req: ServerRequest,\n res: ServerResponse,\n next: ServerNext\n ): Promise<void> {\n // First check for standard JavaScript runtimes (aka legacy browsers like Chrome).\n if (await this.checkBrowserRequestAsync(req, res)) {\n return;\n }\n\n // Save device IDs for dev client.\n await this.saveDevicesAsync(req);\n\n // Read from headers\n const options = this.getParsedHeaders(req);\n const { body, version, headers } = await this._getManifestResponseAsync(options);\n for (const [headerName, headerValue] of headers) {\n res.setHeader(headerName, headerValue);\n }\n res.end(body);\n\n // Log analytics\n this.trackManifest(version ?? null);\n }\n}\n"],"names":["getWorkspaceRoot","getMetroServerRoot","Log","ProjectDevices","debug","require","projectRoot","findWorkspaceRoot","error","message","includes","env","EXPO_USE_METRO_WORKSPACE_ROOT","DEVELOPER_TOOL","ManifestMiddleware","ExpoMiddleware","constructor","options","initialProjectConfig","getConfig","_resolveProjectSettingsAsync","platform","hostname","projectConfig","mainModuleName","resolveMainModuleName","expoGoConfig","getExpoGoConfig","hostUri","constructUrl","scheme","bundleUrl","_getBundleUrl","mutateManifestWithAssetsAsync","exp","entryPoint","path","relative","resolveAbsoluteEntryPoint","isNativeWebpack","stripExtension","saveDevicesAsync","req","deviceIds","headers","catch","e","exception","_getBundleUrlPath","queryParams","URLSearchParams","encodeURIComponent","dev","String","mode","hot","minify","append","encodeURI","toString","debuggerHost","logUrl","developer","tool","packagerOpts","__flipperHack","manifest","resolveManifestAssets","resolver","resolve","match","resolveGoogleServicesFile","handleWebRequestAsync","res","setHeader","end","createTemplateHtmlFromExpoConfigAsync","scripts","checkBrowserRequestAsync","bundlers","getPlatformBundlers","web","parsePlatformHeader","handleRequestAsync","next","getParsedHeaders","body","version","_getManifestResponseAsync","headerName","headerValue","trackManifest"],"mappings":"AAAA;;;;QAqBgBA,gBAAgB,GAAhBA,gBAAgB;QAWhBC,kBAAkB,GAAlBA,kBAAkB;;AAhCiC,IAAA,OAAc,WAAd,cAAc,CAAA;AACnD,IAAA,sBAA0B,kCA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B,CAACC,GAAG,CAAC,CAAC;QAEjC,oBAAoB;QACpB,MAAMzB,OAAO,GAAG,IAAI,CAACoE,gBAAgB,CAAC3C,GAAG,CAAC,AAAC;QAC3C,MAAM,EAAE4C,IAAI,CAAA,EAAEC,OAAO,CAAA,EAAE3C,OAAO,CAAA,EAAE,GAAG,MAAM,IAAI,CAAC4C,yBAAyB,CAACvE,OAAO,CAAC,AAAC;QACjF,KAAK,MAAM,CAACwE,UAAU,EAAEC,WAAW,CAAC,IAAI9C,OAAO,CAAE;YAC/C6B,GAAG,CAACC,SAAS,CAACe,UAAU,EAAEC,WAAW,CAAC,CAAC;SACxC;QACDjB,GAAG,CAACE,GAAG,CAACW,IAAI,CAAC,CAAC;QAEd,gBAAgB;QAChB,IAAI,CAACK,aAAa,CAACJ,OAAO,WAAPA,OAAO,GAAI,IAAI,CAAC,CAAC;KACrC;CACF;QA/PqBzE,kBAAkB,GAAlBA,kBAAkB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
exports.resolveEntryPoint = resolveEntryPoint;
|
|
6
|
+
exports.resolveAbsoluteEntryPoint = resolveAbsoluteEntryPoint;
|
|
6
7
|
var _paths = require("@expo/config/paths");
|
|
7
8
|
var _chalk = _interopRequireDefault(require("chalk"));
|
|
8
9
|
var _path = _interopRequireDefault(require("path"));
|
|
@@ -19,6 +20,9 @@ const supportedPlatforms = [
|
|
|
19
20
|
"none"
|
|
20
21
|
];
|
|
21
22
|
function resolveEntryPoint(projectRoot, platform, projectConfig) {
|
|
23
|
+
return _path.default.relative(projectRoot, resolveAbsoluteEntryPoint(projectRoot, platform, projectConfig));
|
|
24
|
+
}
|
|
25
|
+
function resolveAbsoluteEntryPoint(projectRoot, platform, projectConfig) {
|
|
22
26
|
if (platform && !supportedPlatforms.includes(platform)) {
|
|
23
27
|
throw new _errors.CommandError(`Failed to resolve the project's entry file: The platform "${platform}" is not supported.`);
|
|
24
28
|
}
|
|
@@ -32,7 +36,7 @@ function resolveEntryPoint(projectRoot, platform, projectConfig) {
|
|
|
32
36
|
// NOTE(Bacon): I purposefully don't mention all possible resolutions here since the package.json is the most standard and users should opt towards that.
|
|
33
37
|
throw new _errors.CommandError(_chalk.default`The project entry file could not be resolved. Please define it in the {bold package.json} "main" field.`);
|
|
34
38
|
}
|
|
35
|
-
return
|
|
39
|
+
return entry;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
//# sourceMappingURL=resolveEntryPoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveEntryPoint.ts"],"sourcesContent":["import { ProjectConfig } from '@expo/config';\nimport { getEntryPoint } from '@expo/config/paths';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { CommandError } from '../../../utils/errors';\n\nconst supportedPlatforms = ['ios', 'android', 'web', 'none'];\n\n/**
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/resolveEntryPoint.ts"],"sourcesContent":["import { ProjectConfig } from '@expo/config';\nimport { getEntryPoint } from '@expo/config/paths';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { CommandError } from '../../../utils/errors';\n\nconst supportedPlatforms = ['ios', 'android', 'web', 'none'];\n\n/** @returns the relative entry file for the project. */\nexport function resolveEntryPoint(\n projectRoot: string,\n platform?: string,\n projectConfig?: ProjectConfig\n): string {\n return path.relative(\n projectRoot,\n resolveAbsoluteEntryPoint(projectRoot, platform, projectConfig)\n );\n}\n\n/** @returns the absolute entry file for the project. */\nexport function resolveAbsoluteEntryPoint(\n projectRoot: string,\n platform?: string,\n projectConfig?: ProjectConfig\n): string {\n if (platform && !supportedPlatforms.includes(platform)) {\n throw new CommandError(\n `Failed to resolve the project's entry file: The platform \"${platform}\" is not supported.`\n );\n }\n // TODO(Bacon): support platform extension resolution like .ios, .native\n // const platforms = [platform, 'native'].filter(Boolean) as string[];\n const platforms: string[] = [];\n\n const entry = getEntryPoint(projectRoot, ['./index'], platforms, projectConfig);\n if (!entry) {\n // NOTE(Bacon): I purposefully don't mention all possible resolutions here since the package.json is the most standard and users should opt towards that.\n throw new CommandError(\n chalk`The project entry file could not be resolved. Please define it in the {bold package.json} \"main\" field.`\n );\n }\n\n return entry;\n}\n"],"names":["resolveEntryPoint","resolveAbsoluteEntryPoint","supportedPlatforms","projectRoot","platform","projectConfig","path","relative","includes","CommandError","platforms","entry","getEntryPoint","chalk"],"mappings":"AAAA;;;;QAUgBA,iBAAiB,GAAjBA,iBAAiB;QAYjBC,yBAAyB,GAAzBA,yBAAyB;AArBX,IAAA,MAAoB,WAApB,oBAAoB,CAAA;AAChC,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEM,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;;;;;;AAEpD,MAAMC,kBAAkB,GAAG;IAAC,KAAK;IAAE,SAAS;IAAE,KAAK;IAAE,MAAM;CAAC,AAAC;AAGtD,SAASF,iBAAiB,CAC/BG,WAAmB,EACnBC,QAAiB,EACjBC,aAA6B,EACrB;IACR,OAAOC,KAAI,QAAA,CAACC,QAAQ,CAClBJ,WAAW,EACXF,yBAAyB,CAACE,WAAW,EAAEC,QAAQ,EAAEC,aAAa,CAAC,CAChE,CAAC;CACH;AAGM,SAASJ,yBAAyB,CACvCE,WAAmB,EACnBC,QAAiB,EACjBC,aAA6B,EACrB;IACR,IAAID,QAAQ,IAAI,CAACF,kBAAkB,CAACM,QAAQ,CAACJ,QAAQ,CAAC,EAAE;QACtD,MAAM,IAAIK,OAAY,aAAA,CACpB,CAAC,0DAA0D,EAAEL,QAAQ,CAAC,mBAAmB,CAAC,CAC3F,CAAC;KACH;IACD,wEAAwE;IACxE,sEAAsE;IACtE,MAAMM,SAAS,GAAa,EAAE,AAAC;IAE/B,MAAMC,KAAK,GAAGC,CAAAA,GAAAA,MAAa,AAAoD,CAAA,cAApD,CAACT,WAAW,EAAE;QAAC,SAAS;KAAC,EAAEO,SAAS,EAAEL,aAAa,CAAC,AAAC;IAChF,IAAI,CAACM,KAAK,EAAE;QACV,yJAAyJ;QACzJ,MAAM,IAAIF,OAAY,aAAA,CACpBI,MAAK,QAAA,CAAC,uGAAuG,CAAC,CAC/G,CAAC;KACH;IAED,OAAOF,KAAK,CAAC;CACd"}
|
|
@@ -40,6 +40,7 @@ class FileNotifier {
|
|
|
40
40
|
this.projectRoot = projectRoot;
|
|
41
41
|
this.moduleIds = moduleIds;
|
|
42
42
|
this.settings = settings;
|
|
43
|
+
this.unsubscribe = null;
|
|
43
44
|
this.watchFile = (0, _fn).memoize(this.startWatchingFile.bind(this));
|
|
44
45
|
}
|
|
45
46
|
/** Get the file in the project. */ resolveFilePath() {
|
|
@@ -59,13 +60,21 @@ class FileNotifier {
|
|
|
59
60
|
}
|
|
60
61
|
return configPath;
|
|
61
62
|
}
|
|
63
|
+
stopObserving() {
|
|
64
|
+
var _obj, ref;
|
|
65
|
+
(ref = (_obj = this).unsubscribe) == null ? void 0 : ref.call(_obj);
|
|
66
|
+
}
|
|
62
67
|
startWatchingFile(filePath) {
|
|
63
68
|
const configName = _path.default.relative(this.projectRoot, filePath);
|
|
64
|
-
|
|
69
|
+
const listener = (cur, prev)=>{
|
|
65
70
|
if (prev.size || cur.size) {
|
|
66
71
|
Log.log(`\u203A Detected a change in ${_chalk.default.bold(configName)}. Restart the server to see the new results.` + (this.settings.additionalWarning || ""));
|
|
67
72
|
}
|
|
68
|
-
}
|
|
73
|
+
};
|
|
74
|
+
const watcher = (0, _fs).watchFile(filePath, listener);
|
|
75
|
+
this.unsubscribe = ()=>{
|
|
76
|
+
watcher.unref();
|
|
77
|
+
};
|
|
69
78
|
return filePath;
|
|
70
79
|
}
|
|
71
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/FileNotifier.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { watchFile } from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport * as Log from '../log';\nimport { memoize } from './fn';\n\nconst debug = require('debug')('expo:utils:fileNotifier') as typeof console.log;\n\n/** Observes and reports file changes. */\nexport class FileNotifier {\n constructor(\n /** Project root to resolve the module IDs relative to. */\n private projectRoot: string,\n /** List of module IDs sorted by priority. Only the first file that exists will be observed. */\n private moduleIds: string[],\n private settings: {\n /** An additional warning message to add to the notice. */\n additionalWarning?: string;\n } = {}\n ) {}\n\n /** Get the file in the project. */\n private resolveFilePath(): string | null {\n for (const moduleId of this.moduleIds) {\n const filePath = resolveFrom.silent(this.projectRoot, moduleId);\n if (filePath) {\n return filePath;\n }\n }\n return null;\n }\n\n public startObserving() {\n const configPath = this.resolveFilePath();\n if (configPath) {\n debug(`Observing ${configPath}`);\n return this.watchFile(configPath);\n }\n return configPath;\n }\n\n /** Watch the file and warn to reload the CLI if it changes. */\n public watchFile = memoize(this.startWatchingFile.bind(this));\n\n private startWatchingFile(filePath: string): string {\n const configName = path.relative(this.projectRoot, filePath);\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/FileNotifier.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { watchFile } from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport * as Log from '../log';\nimport { memoize } from './fn';\n\nconst debug = require('debug')('expo:utils:fileNotifier') as typeof console.log;\n\n/** Observes and reports file changes. */\nexport class FileNotifier {\n private unsubscribe: (() => void) | null = null;\n constructor(\n /** Project root to resolve the module IDs relative to. */\n private projectRoot: string,\n /** List of module IDs sorted by priority. Only the first file that exists will be observed. */\n private moduleIds: string[],\n private settings: {\n /** An additional warning message to add to the notice. */\n additionalWarning?: string;\n } = {}\n ) {}\n\n /** Get the file in the project. */\n private resolveFilePath(): string | null {\n for (const moduleId of this.moduleIds) {\n const filePath = resolveFrom.silent(this.projectRoot, moduleId);\n if (filePath) {\n return filePath;\n }\n }\n return null;\n }\n\n public startObserving() {\n const configPath = this.resolveFilePath();\n if (configPath) {\n debug(`Observing ${configPath}`);\n return this.watchFile(configPath);\n }\n return configPath;\n }\n\n public stopObserving() {\n this.unsubscribe?.();\n }\n\n /** Watch the file and warn to reload the CLI if it changes. */\n public watchFile = memoize(this.startWatchingFile.bind(this));\n\n private startWatchingFile(filePath: string): string {\n const configName = path.relative(this.projectRoot, filePath);\n const listener = (cur: any, prev: any) => {\n if (prev.size || cur.size) {\n Log.log(\n `\\u203A Detected a change in ${chalk.bold(\n configName\n )}. Restart the server to see the new results.` + (this.settings.additionalWarning || '')\n );\n }\n };\n\n const watcher = watchFile(filePath, listener);\n\n this.unsubscribe = () => {\n watcher.unref();\n };\n\n return filePath;\n }\n}\n"],"names":["Log","debug","require","FileNotifier","constructor","projectRoot","moduleIds","settings","unsubscribe","watchFile","memoize","startWatchingFile","bind","resolveFilePath","moduleId","filePath","resolveFrom","silent","startObserving","configPath","stopObserving","configName","path","relative","listener","cur","prev","size","log","chalk","bold","additionalWarning","watcher","unref"],"mappings":"AAAA;;;;AAAkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACC,IAAA,GAAI,WAAJ,IAAI,CAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAE1BA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACS,IAAA,GAAM,WAAN,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,AAAsB,AAAC;AAGzE,MAAMC,YAAY;IAEvBC,YAEUC,WAAmB,EAEnBC,SAAmB,EACnBC,QAGP,GAAG,EAAE,CACN;aAPQF,WAAmB,GAAnBA,WAAmB;aAEnBC,SAAmB,GAAnBA,SAAmB;aACnBC,QAGP,GAHOA,QAGP;aATKC,WAAW,GAAwB,IAAI;aAqCxCC,SAAS,GAAGC,CAAAA,GAAAA,GAAO,AAAmC,CAAA,QAA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CAAC,GAAG,CAAC,IAAI,CAACd,QAAQ,CAACwB,iBAAiB,IAAI,EAAE,CAAC,CAC1F,CAAC;aACH;SACF,AAAC;QAEF,MAAMC,OAAO,GAAGvB,CAAAA,GAAAA,GAAS,AAAoB,CAAA,UAApB,CAACM,QAAQ,EAAES,QAAQ,CAAC,AAAC;QAE9C,IAAI,CAAChB,WAAW,GAAG,IAAM;YACvBwB,OAAO,CAACC,KAAK,EAAE,CAAC;SACjB,CAAC;QAEF,OAAOlB,QAAQ,CAAC;KACjB;CACF;QA5DYZ,YAAY,GAAZA,YAAY"}
|
|
@@ -94,7 +94,7 @@ async function logEventAsync(event, properties = {}) {
|
|
|
94
94
|
}
|
|
95
95
|
const { userId , deviceId } = identifyData;
|
|
96
96
|
const commonEventProperties = {
|
|
97
|
-
source_version: "0.
|
|
97
|
+
source_version: "0.6.0",
|
|
98
98
|
source: "expo"
|
|
99
99
|
};
|
|
100
100
|
const identity = {
|
|
@@ -135,7 +135,7 @@ function getContext() {
|
|
|
135
135
|
},
|
|
136
136
|
app: {
|
|
137
137
|
name: "expo",
|
|
138
|
-
version: "0.
|
|
138
|
+
version: "0.6.0"
|
|
139
139
|
},
|
|
140
140
|
ci: ciInfo.isCI ? {
|
|
141
141
|
name: ciInfo.name,
|
package/build/src/utils/array.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.intersecting = intersecting;
|
|
|
7
7
|
exports.replaceValue = replaceValue;
|
|
8
8
|
exports.uniqBy = uniqBy;
|
|
9
9
|
exports.chunk = chunk;
|
|
10
|
+
exports.groupBy = groupBy;
|
|
10
11
|
function findLastIndex(array, predicate) {
|
|
11
12
|
for(let i = array.length - 1; i >= 0; i--){
|
|
12
13
|
if (predicate(array[i])) {
|
|
@@ -52,5 +53,15 @@ function chunk(array, size) {
|
|
|
52
53
|
}
|
|
53
54
|
return chunked;
|
|
54
55
|
}
|
|
56
|
+
function groupBy(list, getKey) {
|
|
57
|
+
return list.reduce((previous, currentItem)=>{
|
|
58
|
+
const group = getKey(currentItem);
|
|
59
|
+
if (!previous[group]) {
|
|
60
|
+
previous[group] = [];
|
|
61
|
+
}
|
|
62
|
+
previous[group].push(currentItem);
|
|
63
|
+
return previous;
|
|
64
|
+
}, {});
|
|
65
|
+
}
|
|
55
66
|
|
|
56
67
|
//# sourceMappingURL=array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/array.ts"],"sourcesContent":["/** Returns the last index of an item based on a given criteria. */\nexport function findLastIndex<T>(array: T[], predicate: (item: T) => boolean) {\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n return i;\n }\n }\n return -1;\n}\n\n/** Returns a list of items that intersect between two given arrays. */\nexport function intersecting<T>(a: T[], b: T[]): T[] {\n const [c, d] = a.length > b.length ? [a, b] : [b, a];\n return c.filter((value) => d.includes(value));\n}\n\nexport function replaceValue<T>(values: T[], original: T, replacement: T): T[] {\n const index = values.indexOf(original);\n if (index > -1) {\n values[index] = replacement;\n }\n return values;\n}\n\n/** lodash.uniqBy */\nexport function uniqBy<T>(array: T[], key: (item: T) => string): T[] {\n const seen: { [key: string]: boolean } = {};\n return array.filter((item) => {\n const k = key(item);\n if (seen[k]) {\n return false;\n }\n seen[k] = true;\n return true;\n });\n}\n\n/** `lodash.chunk` */\nexport function chunk<T>(array: T[], size: number): T[][] {\n const chunked = [];\n let index = 0;\n while (index < array.length) {\n chunked.push(array.slice(index, (index += size)));\n }\n return chunked;\n}\n"],"names":["findLastIndex","intersecting","replaceValue","uniqBy","chunk","array","predicate","i","length","a","b","c","d","filter","value","includes","values","original","replacement","index","indexOf","key","seen","item","k","size","chunked","push","slice"],"mappings":"AACA;;;;QAAgBA,aAAa,GAAbA,aAAa;QAUbC,YAAY,GAAZA,YAAY;QAKZC,YAAY,GAAZA,YAAY;QASZC,MAAM,GAANA,MAAM;QAaNC,KAAK,GAALA,KAAK;
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/array.ts"],"sourcesContent":["/** Returns the last index of an item based on a given criteria. */\nexport function findLastIndex<T>(array: T[], predicate: (item: T) => boolean) {\n for (let i = array.length - 1; i >= 0; i--) {\n if (predicate(array[i])) {\n return i;\n }\n }\n return -1;\n}\n\n/** Returns a list of items that intersect between two given arrays. */\nexport function intersecting<T>(a: T[], b: T[]): T[] {\n const [c, d] = a.length > b.length ? [a, b] : [b, a];\n return c.filter((value) => d.includes(value));\n}\n\nexport function replaceValue<T>(values: T[], original: T, replacement: T): T[] {\n const index = values.indexOf(original);\n if (index > -1) {\n values[index] = replacement;\n }\n return values;\n}\n\n/** lodash.uniqBy */\nexport function uniqBy<T>(array: T[], key: (item: T) => string): T[] {\n const seen: { [key: string]: boolean } = {};\n return array.filter((item) => {\n const k = key(item);\n if (seen[k]) {\n return false;\n }\n seen[k] = true;\n return true;\n });\n}\n\n/** `lodash.chunk` */\nexport function chunk<T>(array: T[], size: number): T[][] {\n const chunked = [];\n let index = 0;\n while (index < array.length) {\n chunked.push(array.slice(index, (index += size)));\n }\n return chunked;\n}\n\n/** `lodash.groupBy` */\nexport function groupBy<T, K extends keyof any>(list: T[], getKey: (item: T) => K): Record<K, T[]> {\n return list.reduce((previous, currentItem) => {\n const group = getKey(currentItem);\n if (!previous[group]) {\n previous[group] = [];\n }\n previous[group].push(currentItem);\n return previous;\n }, {} as Record<K, T[]>);\n}\n"],"names":["findLastIndex","intersecting","replaceValue","uniqBy","chunk","groupBy","array","predicate","i","length","a","b","c","d","filter","value","includes","values","original","replacement","index","indexOf","key","seen","item","k","size","chunked","push","slice","list","getKey","reduce","previous","currentItem","group"],"mappings":"AACA;;;;QAAgBA,aAAa,GAAbA,aAAa;QAUbC,YAAY,GAAZA,YAAY;QAKZC,YAAY,GAAZA,YAAY;QASZC,MAAM,GAANA,MAAM;QAaNC,KAAK,GAALA,KAAK;QAULC,OAAO,GAAPA,OAAO;AA/ChB,SAASL,aAAa,CAAIM,KAAU,EAAEC,SAA+B,EAAE;IAC5E,IAAK,IAAIC,C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EAAEoB,IAAY,EAAS;IACxD,MAAMC,OAAO,GAAG,EAAE,AAAC;IACnB,IAAIP,KAAK,GAAG,CAAC,AAAC;IACd,MAAOA,KAAK,GAAGd,KAAK,CAACG,MAAM,CAAE;QAC3BkB,OAAO,CAACC,IAAI,CAACtB,KAAK,CAACuB,KAAK,CAACT,KAAK,EAAGA,KAAK,IAAIM,IAAI,CAAE,CAAC,CAAC;KACnD;IACD,OAAOC,OAAO,CAAC;CAChB;AAGM,SAAStB,OAAO,CAAyByB,IAAS,EAAEC,MAAsB,EAAkB;IACjG,OAAOD,IAAI,CAACE,MAAM,CAAC,CAACC,QAAQ,EAAEC,WAAW,GAAK;QAC5C,MAAMC,KAAK,GAAGJ,MAAM,CAACG,WAAW,CAAC,AAAC;QAClC,IAAI,CAACD,QAAQ,CAACE,KAAK,CAAC,EAAE;YACpBF,QAAQ,CAACE,KAAK,CAAC,GAAG,EAAE,CAAC;SACtB;QACDF,QAAQ,CAACE,KAAK,CAAC,CAACP,IAAI,CAACM,WAAW,CAAC,CAAC;QAClC,OAAOD,QAAQ,CAAC;KACjB,EAAE,EAAE,CAAmB,CAAC;CAC1B"}
|
package/build/src/utils/env.js
CHANGED
|
@@ -61,6 +61,9 @@ class Env {
|
|
|
61
61
|
/** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */ get EXPO_EDITOR() {
|
|
62
62
|
return (0, _getenv).string("EXPO_EDITOR", "");
|
|
63
63
|
}
|
|
64
|
+
/** Enable auto server root detection for Metro. This will change the server root to the workspace root. */ get EXPO_USE_METRO_WORKSPACE_ROOT() {
|
|
65
|
+
return (0, _getenv).boolish("EXPO_USE_METRO_WORKSPACE_ROOT", false);
|
|
66
|
+
}
|
|
64
67
|
/**
|
|
65
68
|
* Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.
|
|
66
69
|
* This is useful for browser editors that require custom proxy URLs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","EXPO_EDITOR","EXPO_PACKAGER_PROXY_URL","EXPO_TUNNEL_SUBDOMAIN","subdomain","includes","EXPO_METRO_NO_MAIN_FIELD_OVERRIDE","HTTP_PROXY","process","env","http_proxy"],"mappings":"AAAA;;;;;AAAqC,IAAA,OAAQ,WAAR,QAAQ,CAAA;AAE7C,mFAAmF;AAEnF,6CAA6C;AAE7C,MAAMA,GAAG;IACP,+BAA+B,CAC/B,IAAIC,YAAY,GAAG;QACjB,OAAOC,CAAAA,GAAAA,OAAO,AAAuB,CAAA,QAAvB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,2BAA2B,CAC3B,IAAIC,UAAU,GAAG;QACf,OAAOD,CAAAA,GAAAA,OAAO,AAAqB,CAAA,QAArB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,wGAAwG,CACxG,IAAIE,SAAS,GAAG;QACd,OAAOF,CAAAA,GAAAA,OAAO,AAAoB,CAAA,QAApB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;KACpC;IAED,qCAAqC,CACrC,IAAIG,YAAY,GAAG;QACjB,OAAOH,CAAAA,GAAAA,OAAO,AAAuB,CAAA,QAAvB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,mCAAmC,CACnC,IAAII,UAAU,GAA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Ic,qBAAqB,GAAG;QAC1B,OAAOd,CAAAA,GAAAA,OAAO,AAAgC,CAAA,QAAhC,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;KAChD;IACD,6EAA6E,CAC7E,IAAIe,cAAc,GAAG;QACnB,OAAOC,CAAAA,GAAAA,OAAG,AAAqB,CAAA,IAArB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;KACjC;IACD,oDAAoD,CACpD,IAAIC,mCAAmC,GAAY;QACjD,OAAO,CAAC,CAACT,CAAAA,GAAAA,OAAM,AAAuC,CAAA,OAAvC,CAAC,qCAAqC,CAAC,CAAC;KACxD;IAED,2EAA2E,CAC3E,IAAIU,kBAAkB,GAAW;QAC/B,OAAOV,CAAAA,GAAAA,OAAM,AAAgC,CAAA,OAAhC,CAAC,oBAAoB,EAAE,QAAQ,CAAC,CAAC;KAC/C;IAED,kHAAkH,CAClH,IAAIW,WAAW,GAAW;QACxB,OAAOX,CAAAA,GAAAA,OAAM,AAAmB,CAAA,OAAnB,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;KAClC;IAED;;;KAGG,CACH,
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Disable the app select redirect page. */\n get EXPO_NO_REDIRECT_PAGE() {\n return boolish('EXPO_NO_REDIRECT_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n\n /** Higher priority `$EDIOTR` variable for indicating which editor to use when pressing `o` in the Terminal UI. */\n get EXPO_EDITOR(): string {\n return string('EXPO_EDITOR', '');\n }\n\n /** Enable auto server root detection for Metro. This will change the server root to the workspace root. */\n get EXPO_USE_METRO_WORKSPACE_ROOT(): boolean {\n return boolish('EXPO_USE_METRO_WORKSPACE_ROOT', false);\n }\n\n /**\n * Overwrite the dev server URL, disregarding the `--port`, `--host`, `--tunnel`, `--lan`, `--localhost` arguments.\n * This is useful for browser editors that require custom proxy URLs.\n */\n get EXPO_PACKAGER_PROXY_URL(): string {\n return string('EXPO_PACKAGER_PROXY_URL', '');\n }\n\n /**\n * **Experimental** - Disable using `exp.direct` as the hostname for\n * `--tunnel` connections. This enables **https://** forwarding which\n * can be used to test universal links on iOS.\n *\n * This may cause issues with `expo-linking` and Expo Go.\n *\n * Select the exact subdomain by passing a string value that is not one of: `true`, `false`, `1`, `0`.\n */\n get EXPO_TUNNEL_SUBDOMAIN(): string | boolean {\n const subdomain = string('EXPO_TUNNEL_SUBDOMAIN', '');\n if (['0', 'false', ''].includes(subdomain)) {\n return false;\n } else if (['1', 'true'].includes(subdomain)) {\n return true;\n }\n return subdomain;\n }\n\n /**\n * Force Expo CLI to use the [`resolver.resolverMainFields`](https://facebook.github.io/metro/docs/configuration/#resolvermainfields) from the project `metro.config.js` for all platforms.\n *\n * By default, Expo CLI will use `['browser', 'module', 'main']` (default for Webpack) for web and the user-defined main fields for other platforms.\n */\n get EXPO_METRO_NO_MAIN_FIELD_OVERRIDE(): boolean {\n return boolish('EXPO_METRO_NO_MAIN_FIELD_OVERRIDE', false);\n }\n\n /**\n * HTTP/HTTPS proxy to connect to for network requests. Configures [https-proxy-agent](https://www.npmjs.com/package/https-proxy-agent).\n */\n get HTTP_PROXY(): string {\n return process.env.HTTP_PROXY || process.env.http_proxy || '';\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_NO_REDIRECT_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUB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AO,CAACC,GAAG,CAACC,UAAU,IAAI,EAAE,CAAC;KAC/D;CACF;AAEM,MAAMD,GAAG,GAAG,IAAI9B,GAAG,EAAE,AAAC;QAAhB8B,GAAG,GAAHA,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@expo/code-signing-certificates": "0.0.5",
|
|
41
41
|
"@expo/config": "~8.0.0",
|
|
42
42
|
"@expo/config-plugins": "~6.0.0",
|
|
43
|
-
"@expo/dev-server": "0.2.
|
|
43
|
+
"@expo/dev-server": "0.2.2",
|
|
44
44
|
"@expo/devcert": "^1.0.0",
|
|
45
45
|
"@expo/json-file": "^8.2.37",
|
|
46
|
-
"@expo/metro-config": "~0.
|
|
46
|
+
"@expo/metro-config": "~0.7.0",
|
|
47
47
|
"@expo/osascript": "^2.0.31",
|
|
48
48
|
"@expo/package-manager": "~0.0.53",
|
|
49
49
|
"@expo/plist": "^0.0.20",
|
|
@@ -139,5 +139,5 @@
|
|
|
139
139
|
"structured-headers": "^0.4.1",
|
|
140
140
|
"taskr": "1.1.0"
|
|
141
141
|
},
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "c8107d57eabaedff5d53bc8036d062db12a473c8"
|
|
143
143
|
}
|