@expo/cli 0.16.3 → 0.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bin/cli CHANGED
@@ -137,7 +137,7 @@ const args = (0, _arg).default({
137
137
  });
138
138
  if (args["--version"]) {
139
139
  // Version is added in the build script.
140
- console.log("0.16.3");
140
+ console.log("0.16.4");
141
141
  process.exit(0);
142
142
  }
143
143
  if (args["--non-interactive"]) {
@@ -271,7 +271,7 @@ commands[command]().then((exec)=>{
271
271
  logEventAsync("action", {
272
272
  action: `expo ${command}`,
273
273
  source: "expo/cli",
274
- source_version: "0.16.3"
274
+ source_version: "0.16.4"
275
275
  });
276
276
  }
277
277
  });
@@ -8,7 +8,7 @@ exports.getTypedRoutesUtils = getTypedRoutesUtils;
8
8
  exports.extrapolateGroupRoutes = extrapolateGroupRoutes;
9
9
  exports.setToUnionType = exports.TYPED_ROUTES_EXCLUSION_REGEX = exports.CAPTURE_GROUP_REGEX = exports.ARRAY_GROUP_REGEX = exports.SLUG = exports.CATCH_ALL = exports.CAPTURE_DYNAMIC_PARAMS = void 0;
10
10
  var _promises = _interopRequireDefault(require("fs/promises"));
11
- var _lodash = require("lodash");
11
+ var _lodashDebounce = _interopRequireDefault(require("lodash.debounce"));
12
12
  var _path = _interopRequireDefault(require("path"));
13
13
  var _dir = require("../../../utils/dir");
14
14
  var _template = require("../../../utils/template");
@@ -84,7 +84,7 @@ async function setupTypedRoutes({ server , metro , typesDirectory , projectRoot
84
84
  /**
85
85
  * Generate a router.d.ts file that contains all of the routes in the project.
86
86
  * Should be debounced as its very common for developers to make changes to multiple files at once (eg Save All)
87
- */ const regenerateRouterDotTS = (0, _lodash).debounce(async (typesDir, staticRoutes, dynamicRoutes, dynamicRouteTemplates)=>{
87
+ */ const regenerateRouterDotTS = (0, _lodashDebounce).default(async (typesDir, staticRoutes, dynamicRoutes, dynamicRouteTemplates)=>{
88
88
  await _promises.default.mkdir(typesDir, {
89
89
  recursive: true
90
90
  });
@@ -443,7 +443,7 @@ declare module "expo-router" {
443
443
  * @param props.className On web, this sets the HTML \`class\` directly. On native, this can be used with CSS interop tools like Nativewind.
444
444
  */
445
445
  export const Link: LinkComponent;
446
-
446
+
447
447
  /** Redirects to the href as soon as the component is mounted. */
448
448
  export const Redirect: <T>(
449
449
  props: React.PropsWithChildren<{ href: Href<T> }>
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/start/server/type-generation/routes.ts"],"sourcesContent":["import fs from 'fs/promises';\nimport { debounce } from 'lodash';\nimport { Server } from 'metro';\nimport path from 'path';\n\nimport { directoryExistsAsync } from '../../../utils/dir';\nimport { unsafeTemplate } from '../../../utils/template';\nimport { ServerLike } from '../BundlerDevServer';\nimport { metroWatchTypeScriptFiles } from '../metro/metroWatchTypeScriptFiles';\n\n// /test/[...param1]/[param2]/[param3] - captures [\"param1\", \"param2\", \"param3\"]\nexport const CAPTURE_DYNAMIC_PARAMS = /\\[(?:\\.{3})?(\\w*?)[\\]$]/g;\n// /[...param1]/ - Match [...param1]\nexport const CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\n// /[param1] - Match [param1]\nexport const SLUG = /\\[.+?\\]/g;\n// /(group1,group2,group3)/test - match (group1,group2,group3)\nexport const ARRAY_GROUP_REGEX = /\\(\\s*\\w[\\w\\s]*?,.*?\\)/g;\n// /(group1,group2,group3)/test - captures [\"group1\", \"group2\", \"group3\"]\nexport const CAPTURE_GROUP_REGEX = /[\\\\(,]\\s*(\\w[\\w\\s]*?)\\s*(?=[,\\\\)])/g;\n/**\n * Match:\n * - _layout files, +html, +not-found, string+api, etc\n * - Routes can still use `+`, but it cannot be in the last segment.\n */\nexport const TYPED_ROUTES_EXCLUSION_REGEX = /(_layout|[^/]*?\\+[^/]*?)\\.[tj]sx?$/;\n\nexport interface SetupTypedRoutesOptions {\n server?: ServerLike;\n metro?: Server | null;\n typesDirectory: string;\n projectRoot: string;\n /** Absolute expo router routes directory. */\n routerDirectory: string;\n}\n\nexport async function setupTypedRoutes({\n server,\n metro,\n typesDirectory,\n projectRoot,\n routerDirectory,\n}: SetupTypedRoutesOptions) {\n const { filePathToRoute, staticRoutes, dynamicRoutes, addFilePath, isRouteFile } =\n getTypedRoutesUtils(routerDirectory);\n\n if (metro && server) {\n // Setup out watcher first\n metroWatchTypeScriptFiles({\n projectRoot,\n server,\n metro,\n eventTypes: ['add', 'delete', 'change'],\n async callback({ filePath, type }) {\n if (!isRouteFile(filePath)) {\n return;\n }\n\n let shouldRegenerate = false;\n\n if (type === 'delete') {\n const route = filePathToRoute(filePath);\n staticRoutes.delete(route);\n dynamicRoutes.delete(route);\n shouldRegenerate = true;\n } else {\n shouldRegenerate = addFilePath(filePath);\n }\n\n if (shouldRegenerate) {\n regenerateRouterDotTS(\n typesDirectory,\n new Set([...staticRoutes.values()].flatMap((v) => Array.from(v))),\n new Set([...dynamicRoutes.values()].flatMap((v) => Array.from(v))),\n new Set(dynamicRoutes.keys())\n );\n }\n },\n });\n }\n\n if (await directoryExistsAsync(routerDirectory)) {\n // Do we need to walk the entire tree on startup?\n // Idea: Store the list of files in the last write, then simply check Git for what files have changed\n await walk(routerDirectory, addFilePath);\n }\n\n regenerateRouterDotTS(\n typesDirectory,\n new Set([...staticRoutes.values()].flatMap((v) => Array.from(v))),\n new Set([...dynamicRoutes.values()].flatMap((v) => Array.from(v))),\n new Set(dynamicRoutes.keys())\n );\n}\n\n/**\n * Generate a router.d.ts file that contains all of the routes in the project.\n * Should be debounced as its very common for developers to make changes to multiple files at once (eg Save All)\n */\nconst regenerateRouterDotTS = debounce(\n async (\n typesDir: string,\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteTemplates: Set<string>\n ) => {\n await fs.mkdir(typesDir, { recursive: true });\n await fs.writeFile(\n path.resolve(typesDir, './router.d.ts'),\n getTemplateString(staticRoutes, dynamicRoutes, dynamicRouteTemplates)\n );\n },\n 100\n);\n\n/*\n * This is exported for testing purposes\n */\nexport function getTemplateString(\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteTemplates: Set<string>\n) {\n return routerDotTSTemplate({\n staticRoutes: setToUnionType(staticRoutes),\n dynamicRoutes: setToUnionType(dynamicRoutes),\n dynamicRouteParams: setToUnionType(dynamicRouteTemplates),\n });\n}\n\n/**\n * Utility functions for typed routes\n *\n * These are extracted for easier testing\n */\nexport function getTypedRoutesUtils(appRoot: string, filePathSeperator = path.sep) {\n /*\n * staticRoutes are a map where the key if the route without groups and the value\n * is another set of all group versions of the route. e.g,\n * Map([\n * [\"/\", [\"/(app)/(notes)\", \"/(app)/(profile)\"]\n * ])\n */\n const staticRoutes = new Map<string, Set<string>>([['/', new Set('/')]]);\n /*\n * dynamicRoutes are the same as staticRoutes (key if the resolved route,\n * and the value is a set of possible routes). e.g:\n *\n * /[...fruits] -> /${CatchAllRoutePart<T>}\n * /color/[color] -> /color/${SingleRoutePart<T>}\n *\n * The keys of this map are also important, as they can be used as \"static\" types\n * <Link href={{ pathname: \"/[...fruits]\",params: { fruits: [\"apple\"] } }} />\n */\n const dynamicRoutes = new Map<string, Set<string>>();\n\n function normalizedFilePath(filePath: string) {\n return filePath.replaceAll(filePathSeperator, '/');\n }\n\n const normalizedAppRoot = normalizedFilePath(appRoot);\n\n const filePathToRoute = (filePath: string) => {\n return normalizedFilePath(filePath)\n .replace(normalizedAppRoot, '')\n .replace(/index\\.[jt]sx?/, '')\n .replace(/\\.[jt]sx?$/, '');\n };\n\n const isRouteFile = (filePath: string) => {\n if (filePath.match(TYPED_ROUTES_EXCLUSION_REGEX)) {\n return false;\n }\n\n // Route files must be nested with in the appRoot\n const relative = path.relative(appRoot, filePath);\n return relative && !relative.startsWith('..') && !path.isAbsolute(relative);\n };\n\n const addFilePath = (filePath: string): boolean => {\n if (!isRouteFile(filePath)) {\n return false;\n }\n\n const route = filePathToRoute(filePath);\n\n // We have already processed this file\n if (staticRoutes.has(route) || dynamicRoutes.has(route)) {\n return false;\n }\n\n const dynamicParams = new Set(\n [...route.matchAll(CAPTURE_DYNAMIC_PARAMS)].map((match) => match[1])\n );\n const isDynamic = dynamicParams.size > 0;\n\n const addRoute = (originalRoute: string, route: string) => {\n if (isDynamic) {\n let set = dynamicRoutes.get(originalRoute);\n\n if (!set) {\n set = new Set();\n dynamicRoutes.set(originalRoute, set);\n }\n\n set.add(\n route\n .replaceAll(CATCH_ALL, '${CatchAllRoutePart<T>}')\n .replaceAll(SLUG, '${SingleRoutePart<T>}')\n );\n } else {\n let set = staticRoutes.get(originalRoute);\n\n if (!set) {\n set = new Set();\n staticRoutes.set(originalRoute, set);\n }\n\n set.add(route);\n }\n };\n\n if (!route.match(ARRAY_GROUP_REGEX)) {\n addRoute(route, route);\n }\n\n // Does this route have a group? eg /(group)\n if (route.includes('/(')) {\n const routeWithoutGroups = route.replace(/\\/\\(.+?\\)/g, '');\n addRoute(route, routeWithoutGroups);\n\n // If there are multiple groups, we need to expand them\n // eg /(test1,test2)/page => /test1/page & /test2/page\n for (const routeWithSingleGroup of extrapolateGroupRoutes(route)) {\n addRoute(route, routeWithSingleGroup);\n }\n }\n\n return true;\n };\n\n return {\n staticRoutes,\n dynamicRoutes,\n filePathToRoute,\n addFilePath,\n isRouteFile,\n };\n}\n\nexport const setToUnionType = <T>(set: Set<T>) => {\n return set.size > 0 ? [...set].map((s) => `\\`${s}\\``).join(' | ') : 'never';\n};\n\n/**\n * Recursively walk a directory and call the callback with the file path.\n */\nasync function walk(directory: string, callback: (filePath: string) => void) {\n const files = await fs.readdir(directory);\n for (const file of files) {\n const p = path.join(directory, file);\n if ((await fs.stat(p)).isDirectory()) {\n await walk(p, callback);\n } else {\n // Normalise the paths so they are easier to convert to URLs\n const normalizedPath = p.replaceAll(path.sep, '/');\n callback(normalizedPath);\n }\n }\n}\n\n/**\n * Given a route, return all possible routes that could be generated from it.\n */\nexport function extrapolateGroupRoutes(\n route: string,\n routes: Set<string> = new Set()\n): Set<string> {\n // Create a version with no groups. We will then need to cleanup double and/or trailing slashes\n routes.add(route.replaceAll(ARRAY_GROUP_REGEX, '').replaceAll(/\\/+/g, '/').replace(/\\/$/, ''));\n\n const match = route.match(ARRAY_GROUP_REGEX);\n\n if (!match) {\n routes.add(route);\n return routes;\n }\n\n const groupsMatch = match[0];\n\n for (const group of groupsMatch.matchAll(CAPTURE_GROUP_REGEX)) {\n extrapolateGroupRoutes(route.replace(groupsMatch, `(${group[1].trim()})`), routes);\n }\n\n return routes;\n}\n\n/**\n * NOTE: This code refers to a specific version of `expo-router` and is therefore unsafe to\n * mix with arbitrary versions.\n * TODO: Version this code with `expo-router` or version expo-router with `@expo/cli`.\n */\nconst routerDotTSTemplate = unsafeTemplate`/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable import/export */\n/* eslint-disable @typescript-eslint/ban-types */\ndeclare module \"expo-router\" {\n import type { LinkProps as OriginalLinkProps } from 'expo-router/build/link/Link';\n import type { Router as OriginalRouter } from 'expo-router/src/types';\n export * from 'expo-router/build';\n\n // prettier-ignore\n type StaticRoutes = ${'staticRoutes'};\n // prettier-ignore\n type DynamicRoutes<T extends string> = ${'dynamicRoutes'};\n // prettier-ignore\n type DynamicRouteTemplate = ${'dynamicRouteParams'};\n\n type RelativePathString = \\`./\\${string}\\` | \\`../\\${string}\\` | '..';\n type AbsoluteRoute = DynamicRouteTemplate | StaticRoutes;\n type ExternalPathString = \\`\\${string}:\\${string}\\`;\n\n type ExpoRouterRoutes = DynamicRouteTemplate | StaticRoutes | RelativePathString;\n type AllRoutes = ExpoRouterRoutes | ExternalPathString;\n\n /****************\n * Route Utils *\n ****************/\n\n type SearchOrHash = \\`?\\${string}\\` | \\`#\\${string}\\`;\n type UnknownInputParams = Record<string, string | number | (string | number)[]>;\n type UnknownOutputParams = Record<string, string | string[]>;\n\n /**\n * Return only the RoutePart of a string. If the string has multiple parts return never\n *\n * string | type\n * ---------|------\n * 123 | 123\n * /123/abc | never\n * 123?abc | never\n * ./123 | never\n * /123 | never\n * 123/../ | never\n */\n type SingleRoutePart<S extends string> = S extends \\`\\${string}/\\${string}\\`\n ? never\n : S extends \\`\\${string}\\${SearchOrHash}\\`\n ? never\n : S extends ''\n ? never\n : S extends \\`(\\${string})\\`\n ? never\n : S extends \\`[\\${string}]\\`\n ? never\n : S;\n\n /**\n * Return only the CatchAll router part. If the string has search parameters or a hash return never\n */\n type CatchAllRoutePart<S extends string> = S extends \\`\\${string}\\${SearchOrHash}\\`\n ? never\n : S extends ''\n ? never\n : S extends \\`\\${string}(\\${string})\\${string}\\`\n ? never\n : S extends \\`\\${string}[\\${string}]\\${string}\\`\n ? never\n : S;\n\n // type OptionalCatchAllRoutePart<S extends string> = S extends \\`\\${string}\\${SearchOrHash}\\` ? never : S\n\n /**\n * Return the name of a route parameter\n * '[test]' -> 'test'\n * 'test' -> never\n * '[...test]' -> '...test'\n */\n type IsParameter<Part> = Part extends \\`[\\${infer ParamName}]\\` ? ParamName : never;\n\n /**\n * Return a union of all parameter names. If there are no names return never\n *\n * /[test] -> 'test'\n * /[abc]/[...def] -> 'abc'|'...def'\n */\n type ParameterNames<Path> = Path extends \\`\\${infer PartA}/\\${infer PartB}\\`\n ? IsParameter<PartA> | ParameterNames<PartB>\n : IsParameter<Path>;\n\n /**\n * Returns all segements of a route.\n *\n * /(group)/123/abc/[id]/[...rest] -> ['(group)', '123', 'abc', '[id]', '[...rest]'\n */\n type RouteSegments<Path> = Path extends \\`\\${infer PartA}/\\${infer PartB}\\`\n ? PartA extends '' | '.'\n ? [...RouteSegments<PartB>]\n : [PartA, ...RouteSegments<PartB>]\n : Path extends ''\n ? []\n : [Path];\n\n /**\n * Returns a Record of the routes parameters as strings and CatchAll parameters\n *\n * There are two versions, input and output, as you can input 'string | number' but\n * the output will always be 'string'\n *\n * /[id]/[...rest] -> { id: string, rest: string[] }\n * /no-params -> {}\n */\n type InputRouteParams<Path> = {\n [Key in ParameterNames<Path> as Key extends \\`...\\${infer Name}\\`\n ? Name\n : Key]: Key extends \\`...\\${string}\\` ? (string | number)[] : string | number;\n } & UnknownInputParams;\n\n type OutputRouteParams<Path> = {\n [Key in ParameterNames<Path> as Key extends \\`...\\${infer Name}\\`\n ? Name\n : Key]: Key extends \\`...\\${string}\\` ? string[] : string;\n } & UnknownOutputParams;\n\n /**\n * Returns the search parameters for a route.\n */\n export type SearchParams<T extends AllRoutes> = T extends DynamicRouteTemplate\n ? OutputRouteParams<T>\n : T extends StaticRoutes\n ? never\n : UnknownOutputParams;\n\n /**\n * Route is mostly used as part of Href to ensure that a valid route is provided\n *\n * Given a dynamic route, this will return never. This is helpful for conditional logic\n *\n * /test -> /test, /test2, etc\n * /test/[abc] -> never\n * /test/resolve -> /test, /test2, etc\n *\n * Note that if we provide a value for [abc] then the route is allowed\n *\n * This is named Route to prevent confusion, as users they will often see it in tooltips\n */\n export type Route<T> = T extends string\n ? T extends DynamicRouteTemplate\n ? never\n :\n | StaticRoutes\n | RelativePathString\n | ExternalPathString\n | (T extends \\`\\${infer P}\\${SearchOrHash}\\`\n ? P extends DynamicRoutes<infer _>\n ? T\n : never\n : T extends DynamicRoutes<infer _>\n ? T\n : never)\n : never;\n\n /*********\n * Href *\n *********/\n\n export type Href<T> = T extends Record<'pathname', string> ? HrefObject<T> : Route<T>;\n\n export type HrefObject<\n R extends Record<'pathname', string>,\n P = R['pathname'],\n > = P extends DynamicRouteTemplate\n ? { pathname: P; params: InputRouteParams<P> }\n : P extends Route<P>\n ? { pathname: Route<P> | DynamicRouteTemplate; params?: never | InputRouteParams<never> }\n : never;\n\n /***********************\n * Expo Router Exports *\n ***********************/\n\n export type Router = Omit<OriginalRouter, 'push' | 'replace' | 'setParams'> & {\n /** Navigate to the provided href. */\n push: <T>(href: Href<T>) => void;\n /** Navigate to route without appending to the history. */\n replace: <T>(href: Href<T>) => void;\n /** Update the current route query params. */\n setParams: <T = ''>(params?: T extends '' ? Record<string, string> : InputRouteParams<T>) => void;\n };\n\n /** The imperative router. */\n export const router: Router;\n\n /************\n * <Link /> *\n ************/\n export interface LinkProps<T> extends OriginalLinkProps {\n href: Href<T>;\n }\n\n export interface LinkComponent {\n <T>(props: React.PropsWithChildren<LinkProps<T>>): JSX.Element;\n /** Helper method to resolve an Href object into a string. */\n resolveHref: <T>(href: Href<T>) => string;\n }\n\n /**\n * Component to render link to another route using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.href Absolute path to route (e.g. \\`/feeds/hot\\`).\n * @param props.replace Should replace the current route without adding to the history.\n * @param props.asChild Forward props to child component. Useful for custom buttons.\n * @param props.children Child elements to render the content.\n * @param props.className On web, this sets the HTML \\`class\\` directly. On native, this can be used with CSS interop tools like Nativewind.\n */\n export const Link: LinkComponent;\n \n /** Redirects to the href as soon as the component is mounted. */\n export const Redirect: <T>(\n props: React.PropsWithChildren<{ href: Href<T> }>\n ) => JSX.Element;\n\n /************\n * Hooks *\n ************/\n export function useRouter(): Router;\n\n export function useLocalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n /** @deprecated renamed to \\`useGlobalSearchParams\\` */\n export function useSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n export function useGlobalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n export function useSegments<\n T extends AbsoluteRoute | RouteSegments<AbsoluteRoute> | RelativePathString,\n >(): T extends AbsoluteRoute ? RouteSegments<T> : T extends string ? string[] : T;\n}\n`;\n"],"names":["setupTypedRoutes","getTemplateString","getTypedRoutesUtils","extrapolateGroupRoutes","CAPTURE_DYNAMIC_PARAMS","CATCH_ALL","SLUG","ARRAY_GROUP_REGEX","CAPTURE_GROUP_REGEX","TYPED_ROUTES_EXCLUSION_REGEX","server","metro","typesDirectory","projectRoot","routerDirectory","filePathToRoute","staticRoutes","dynamicRoutes","addFilePath","isRouteFile","metroWatchTypeScriptFiles","eventTypes","callback","filePath","type","shouldRegenerate","route","delete","regenerateRouterDotTS","Set","values","flatMap","v","Array","from","keys","directoryExistsAsync","walk","debounce","typesDir","dynamicRouteTemplates","fs","mkdir","recursive","writeFile","path","resolve","routerDotTSTemplate","setToUnionType","dynamicRouteParams","appRoot","filePathSeperator","sep","Map","normalizedFilePath","replaceAll","normalizedAppRoot","replace","match","relative","startsWith","isAbsolute","has","dynamicParams","matchAll","map","isDynamic","size","addRoute","originalRoute","set","get","add","includes","routeWithoutGroups","routeWithSingleGroup","s","join","directory","files","readdir","file","p","stat","isDirectory","normalizedPath","routes","groupsMatch","group","trim","unsafeTemplate"],"mappings":"AAAA;;;;QAoCsBA,gBAAgB,GAAhBA,gBAAgB;QAkFtBC,iBAAiB,GAAjBA,iBAAiB;QAiBjBC,mBAAmB,GAAnBA,mBAAmB;QA2InBC,sBAAsB,GAAtBA,sBAAsB;;AAlRvB,IAAA,SAAa,kCAAb,aAAa,EAAA;AACH,IAAA,OAAQ,WAAR,QAAQ,CAAA;AAEhB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEc,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AAC1B,IAAA,SAAyB,WAAzB,yBAAyB,CAAA;AAEd,IAAA,0BAAoC,WAApC,oCAAoC,CAAA;;;;;;AAGvE,MAAMC,sBAAsB,6BAA6B,AAAC;QAApDA,sBAAsB,GAAtBA,sBAAsB;AAE5B,MAAMC,SAAS,mBAAmB,AAAC;QAA7BA,SAAS,GAATA,SAAS;AAEf,MAAMC,IAAI,aAAa,AAAC;QAAlBA,IAAI,GAAJA,IAAI;AAEV,MAAMC,iBAAiB,2BAA2B,AAAC;QAA7CA,iBAAiB,GAAjBA,iBAAiB;AAEvB,MAAMC,mBAAmB,wCAAwC,AAAC;QAA5DA,mBAAmB,GAAnBA,mBAAmB;AAMzB,MAAMC,4BAA4B,uCAAuC,AAAC;QAApEA,4BAA4B,GAA5BA,4BAA4B;AAWlC,eAAeT,gBAAgB,CAAC,EACrCU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,CAAE;QAC7DL,sBAAsB,CAACuB,KAAK,CAAC+B,OAAO,CAAC8B,WAAW,EAAE,CAAC,CAAC,EAAEC,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAEH,MAAM,CAAC,CAAC;KACpF;IAED,OAAOA,MAAM,CAAC;CACf;AAED;;;;GAIG,CACH,MAAMvC,mBAAmB,GAAG2C,SAAc,eAAA,CAAC;;;;;;;;;sBASrB,EAAE,cAAc,CAAC;;yCAEE,EAAE,eAAe,CAAC;;8BAE7B,EAAE,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqOrD,CAAC,AAAC"}
1
+ {"version":3,"sources":["../../../../../src/start/server/type-generation/routes.ts"],"sourcesContent":["import fs from 'fs/promises';\nimport debounce from 'lodash.debounce';\nimport { Server } from 'metro';\nimport path from 'path';\n\nimport { directoryExistsAsync } from '../../../utils/dir';\nimport { unsafeTemplate } from '../../../utils/template';\nimport { ServerLike } from '../BundlerDevServer';\nimport { metroWatchTypeScriptFiles } from '../metro/metroWatchTypeScriptFiles';\n\n// /test/[...param1]/[param2]/[param3] - captures [\"param1\", \"param2\", \"param3\"]\nexport const CAPTURE_DYNAMIC_PARAMS = /\\[(?:\\.{3})?(\\w*?)[\\]$]/g;\n// /[...param1]/ - Match [...param1]\nexport const CATCH_ALL = /\\[\\.\\.\\..+?\\]/g;\n// /[param1] - Match [param1]\nexport const SLUG = /\\[.+?\\]/g;\n// /(group1,group2,group3)/test - match (group1,group2,group3)\nexport const ARRAY_GROUP_REGEX = /\\(\\s*\\w[\\w\\s]*?,.*?\\)/g;\n// /(group1,group2,group3)/test - captures [\"group1\", \"group2\", \"group3\"]\nexport const CAPTURE_GROUP_REGEX = /[\\\\(,]\\s*(\\w[\\w\\s]*?)\\s*(?=[,\\\\)])/g;\n/**\n * Match:\n * - _layout files, +html, +not-found, string+api, etc\n * - Routes can still use `+`, but it cannot be in the last segment.\n */\nexport const TYPED_ROUTES_EXCLUSION_REGEX = /(_layout|[^/]*?\\+[^/]*?)\\.[tj]sx?$/;\n\nexport interface SetupTypedRoutesOptions {\n server?: ServerLike;\n metro?: Server | null;\n typesDirectory: string;\n projectRoot: string;\n /** Absolute expo router routes directory. */\n routerDirectory: string;\n}\n\nexport async function setupTypedRoutes({\n server,\n metro,\n typesDirectory,\n projectRoot,\n routerDirectory,\n}: SetupTypedRoutesOptions) {\n const { filePathToRoute, staticRoutes, dynamicRoutes, addFilePath, isRouteFile } =\n getTypedRoutesUtils(routerDirectory);\n\n if (metro && server) {\n // Setup out watcher first\n metroWatchTypeScriptFiles({\n projectRoot,\n server,\n metro,\n eventTypes: ['add', 'delete', 'change'],\n async callback({ filePath, type }) {\n if (!isRouteFile(filePath)) {\n return;\n }\n\n let shouldRegenerate = false;\n\n if (type === 'delete') {\n const route = filePathToRoute(filePath);\n staticRoutes.delete(route);\n dynamicRoutes.delete(route);\n shouldRegenerate = true;\n } else {\n shouldRegenerate = addFilePath(filePath);\n }\n\n if (shouldRegenerate) {\n regenerateRouterDotTS(\n typesDirectory,\n new Set([...staticRoutes.values()].flatMap((v) => Array.from(v))),\n new Set([...dynamicRoutes.values()].flatMap((v) => Array.from(v))),\n new Set(dynamicRoutes.keys())\n );\n }\n },\n });\n }\n\n if (await directoryExistsAsync(routerDirectory)) {\n // Do we need to walk the entire tree on startup?\n // Idea: Store the list of files in the last write, then simply check Git for what files have changed\n await walk(routerDirectory, addFilePath);\n }\n\n regenerateRouterDotTS(\n typesDirectory,\n new Set([...staticRoutes.values()].flatMap((v) => Array.from(v))),\n new Set([...dynamicRoutes.values()].flatMap((v) => Array.from(v))),\n new Set(dynamicRoutes.keys())\n );\n}\n\n/**\n * Generate a router.d.ts file that contains all of the routes in the project.\n * Should be debounced as its very common for developers to make changes to multiple files at once (eg Save All)\n */\nconst regenerateRouterDotTS = debounce(\n async (\n typesDir: string,\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteTemplates: Set<string>\n ) => {\n await fs.mkdir(typesDir, { recursive: true });\n await fs.writeFile(\n path.resolve(typesDir, './router.d.ts'),\n getTemplateString(staticRoutes, dynamicRoutes, dynamicRouteTemplates)\n );\n },\n 100\n);\n\n/*\n * This is exported for testing purposes\n */\nexport function getTemplateString(\n staticRoutes: Set<string>,\n dynamicRoutes: Set<string>,\n dynamicRouteTemplates: Set<string>\n) {\n return routerDotTSTemplate({\n staticRoutes: setToUnionType(staticRoutes),\n dynamicRoutes: setToUnionType(dynamicRoutes),\n dynamicRouteParams: setToUnionType(dynamicRouteTemplates),\n });\n}\n\n/**\n * Utility functions for typed routes\n *\n * These are extracted for easier testing\n */\nexport function getTypedRoutesUtils(appRoot: string, filePathSeperator = path.sep) {\n /*\n * staticRoutes are a map where the key if the route without groups and the value\n * is another set of all group versions of the route. e.g,\n * Map([\n * [\"/\", [\"/(app)/(notes)\", \"/(app)/(profile)\"]\n * ])\n */\n const staticRoutes = new Map<string, Set<string>>([['/', new Set('/')]]);\n /*\n * dynamicRoutes are the same as staticRoutes (key if the resolved route,\n * and the value is a set of possible routes). e.g:\n *\n * /[...fruits] -> /${CatchAllRoutePart<T>}\n * /color/[color] -> /color/${SingleRoutePart<T>}\n *\n * The keys of this map are also important, as they can be used as \"static\" types\n * <Link href={{ pathname: \"/[...fruits]\",params: { fruits: [\"apple\"] } }} />\n */\n const dynamicRoutes = new Map<string, Set<string>>();\n\n function normalizedFilePath(filePath: string) {\n return filePath.replaceAll(filePathSeperator, '/');\n }\n\n const normalizedAppRoot = normalizedFilePath(appRoot);\n\n const filePathToRoute = (filePath: string) => {\n return normalizedFilePath(filePath)\n .replace(normalizedAppRoot, '')\n .replace(/index\\.[jt]sx?/, '')\n .replace(/\\.[jt]sx?$/, '');\n };\n\n const isRouteFile = (filePath: string) => {\n if (filePath.match(TYPED_ROUTES_EXCLUSION_REGEX)) {\n return false;\n }\n\n // Route files must be nested with in the appRoot\n const relative = path.relative(appRoot, filePath);\n return relative && !relative.startsWith('..') && !path.isAbsolute(relative);\n };\n\n const addFilePath = (filePath: string): boolean => {\n if (!isRouteFile(filePath)) {\n return false;\n }\n\n const route = filePathToRoute(filePath);\n\n // We have already processed this file\n if (staticRoutes.has(route) || dynamicRoutes.has(route)) {\n return false;\n }\n\n const dynamicParams = new Set(\n [...route.matchAll(CAPTURE_DYNAMIC_PARAMS)].map((match) => match[1])\n );\n const isDynamic = dynamicParams.size > 0;\n\n const addRoute = (originalRoute: string, route: string) => {\n if (isDynamic) {\n let set = dynamicRoutes.get(originalRoute);\n\n if (!set) {\n set = new Set();\n dynamicRoutes.set(originalRoute, set);\n }\n\n set.add(\n route\n .replaceAll(CATCH_ALL, '${CatchAllRoutePart<T>}')\n .replaceAll(SLUG, '${SingleRoutePart<T>}')\n );\n } else {\n let set = staticRoutes.get(originalRoute);\n\n if (!set) {\n set = new Set();\n staticRoutes.set(originalRoute, set);\n }\n\n set.add(route);\n }\n };\n\n if (!route.match(ARRAY_GROUP_REGEX)) {\n addRoute(route, route);\n }\n\n // Does this route have a group? eg /(group)\n if (route.includes('/(')) {\n const routeWithoutGroups = route.replace(/\\/\\(.+?\\)/g, '');\n addRoute(route, routeWithoutGroups);\n\n // If there are multiple groups, we need to expand them\n // eg /(test1,test2)/page => /test1/page & /test2/page\n for (const routeWithSingleGroup of extrapolateGroupRoutes(route)) {\n addRoute(route, routeWithSingleGroup);\n }\n }\n\n return true;\n };\n\n return {\n staticRoutes,\n dynamicRoutes,\n filePathToRoute,\n addFilePath,\n isRouteFile,\n };\n}\n\nexport const setToUnionType = <T>(set: Set<T>) => {\n return set.size > 0 ? [...set].map((s) => `\\`${s}\\``).join(' | ') : 'never';\n};\n\n/**\n * Recursively walk a directory and call the callback with the file path.\n */\nasync function walk(directory: string, callback: (filePath: string) => void) {\n const files = await fs.readdir(directory);\n for (const file of files) {\n const p = path.join(directory, file);\n if ((await fs.stat(p)).isDirectory()) {\n await walk(p, callback);\n } else {\n // Normalise the paths so they are easier to convert to URLs\n const normalizedPath = p.replaceAll(path.sep, '/');\n callback(normalizedPath);\n }\n }\n}\n\n/**\n * Given a route, return all possible routes that could be generated from it.\n */\nexport function extrapolateGroupRoutes(\n route: string,\n routes: Set<string> = new Set()\n): Set<string> {\n // Create a version with no groups. We will then need to cleanup double and/or trailing slashes\n routes.add(route.replaceAll(ARRAY_GROUP_REGEX, '').replaceAll(/\\/+/g, '/').replace(/\\/$/, ''));\n\n const match = route.match(ARRAY_GROUP_REGEX);\n\n if (!match) {\n routes.add(route);\n return routes;\n }\n\n const groupsMatch = match[0];\n\n for (const group of groupsMatch.matchAll(CAPTURE_GROUP_REGEX)) {\n extrapolateGroupRoutes(route.replace(groupsMatch, `(${group[1].trim()})`), routes);\n }\n\n return routes;\n}\n\n/**\n * NOTE: This code refers to a specific version of `expo-router` and is therefore unsafe to\n * mix with arbitrary versions.\n * TODO: Version this code with `expo-router` or version expo-router with `@expo/cli`.\n */\nconst routerDotTSTemplate = unsafeTemplate`/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable import/export */\n/* eslint-disable @typescript-eslint/ban-types */\ndeclare module \"expo-router\" {\n import type { LinkProps as OriginalLinkProps } from 'expo-router/build/link/Link';\n import type { Router as OriginalRouter } from 'expo-router/src/types';\n export * from 'expo-router/build';\n\n // prettier-ignore\n type StaticRoutes = ${'staticRoutes'};\n // prettier-ignore\n type DynamicRoutes<T extends string> = ${'dynamicRoutes'};\n // prettier-ignore\n type DynamicRouteTemplate = ${'dynamicRouteParams'};\n\n type RelativePathString = \\`./\\${string}\\` | \\`../\\${string}\\` | '..';\n type AbsoluteRoute = DynamicRouteTemplate | StaticRoutes;\n type ExternalPathString = \\`\\${string}:\\${string}\\`;\n\n type ExpoRouterRoutes = DynamicRouteTemplate | StaticRoutes | RelativePathString;\n type AllRoutes = ExpoRouterRoutes | ExternalPathString;\n\n /****************\n * Route Utils *\n ****************/\n\n type SearchOrHash = \\`?\\${string}\\` | \\`#\\${string}\\`;\n type UnknownInputParams = Record<string, string | number | (string | number)[]>;\n type UnknownOutputParams = Record<string, string | string[]>;\n\n /**\n * Return only the RoutePart of a string. If the string has multiple parts return never\n *\n * string | type\n * ---------|------\n * 123 | 123\n * /123/abc | never\n * 123?abc | never\n * ./123 | never\n * /123 | never\n * 123/../ | never\n */\n type SingleRoutePart<S extends string> = S extends \\`\\${string}/\\${string}\\`\n ? never\n : S extends \\`\\${string}\\${SearchOrHash}\\`\n ? never\n : S extends ''\n ? never\n : S extends \\`(\\${string})\\`\n ? never\n : S extends \\`[\\${string}]\\`\n ? never\n : S;\n\n /**\n * Return only the CatchAll router part. If the string has search parameters or a hash return never\n */\n type CatchAllRoutePart<S extends string> = S extends \\`\\${string}\\${SearchOrHash}\\`\n ? never\n : S extends ''\n ? never\n : S extends \\`\\${string}(\\${string})\\${string}\\`\n ? never\n : S extends \\`\\${string}[\\${string}]\\${string}\\`\n ? never\n : S;\n\n // type OptionalCatchAllRoutePart<S extends string> = S extends \\`\\${string}\\${SearchOrHash}\\` ? never : S\n\n /**\n * Return the name of a route parameter\n * '[test]' -> 'test'\n * 'test' -> never\n * '[...test]' -> '...test'\n */\n type IsParameter<Part> = Part extends \\`[\\${infer ParamName}]\\` ? ParamName : never;\n\n /**\n * Return a union of all parameter names. If there are no names return never\n *\n * /[test] -> 'test'\n * /[abc]/[...def] -> 'abc'|'...def'\n */\n type ParameterNames<Path> = Path extends \\`\\${infer PartA}/\\${infer PartB}\\`\n ? IsParameter<PartA> | ParameterNames<PartB>\n : IsParameter<Path>;\n\n /**\n * Returns all segements of a route.\n *\n * /(group)/123/abc/[id]/[...rest] -> ['(group)', '123', 'abc', '[id]', '[...rest]'\n */\n type RouteSegments<Path> = Path extends \\`\\${infer PartA}/\\${infer PartB}\\`\n ? PartA extends '' | '.'\n ? [...RouteSegments<PartB>]\n : [PartA, ...RouteSegments<PartB>]\n : Path extends ''\n ? []\n : [Path];\n\n /**\n * Returns a Record of the routes parameters as strings and CatchAll parameters\n *\n * There are two versions, input and output, as you can input 'string | number' but\n * the output will always be 'string'\n *\n * /[id]/[...rest] -> { id: string, rest: string[] }\n * /no-params -> {}\n */\n type InputRouteParams<Path> = {\n [Key in ParameterNames<Path> as Key extends \\`...\\${infer Name}\\`\n ? Name\n : Key]: Key extends \\`...\\${string}\\` ? (string | number)[] : string | number;\n } & UnknownInputParams;\n\n type OutputRouteParams<Path> = {\n [Key in ParameterNames<Path> as Key extends \\`...\\${infer Name}\\`\n ? Name\n : Key]: Key extends \\`...\\${string}\\` ? string[] : string;\n } & UnknownOutputParams;\n\n /**\n * Returns the search parameters for a route.\n */\n export type SearchParams<T extends AllRoutes> = T extends DynamicRouteTemplate\n ? OutputRouteParams<T>\n : T extends StaticRoutes\n ? never\n : UnknownOutputParams;\n\n /**\n * Route is mostly used as part of Href to ensure that a valid route is provided\n *\n * Given a dynamic route, this will return never. This is helpful for conditional logic\n *\n * /test -> /test, /test2, etc\n * /test/[abc] -> never\n * /test/resolve -> /test, /test2, etc\n *\n * Note that if we provide a value for [abc] then the route is allowed\n *\n * This is named Route to prevent confusion, as users they will often see it in tooltips\n */\n export type Route<T> = T extends string\n ? T extends DynamicRouteTemplate\n ? never\n :\n | StaticRoutes\n | RelativePathString\n | ExternalPathString\n | (T extends \\`\\${infer P}\\${SearchOrHash}\\`\n ? P extends DynamicRoutes<infer _>\n ? T\n : never\n : T extends DynamicRoutes<infer _>\n ? T\n : never)\n : never;\n\n /*********\n * Href *\n *********/\n\n export type Href<T> = T extends Record<'pathname', string> ? HrefObject<T> : Route<T>;\n\n export type HrefObject<\n R extends Record<'pathname', string>,\n P = R['pathname'],\n > = P extends DynamicRouteTemplate\n ? { pathname: P; params: InputRouteParams<P> }\n : P extends Route<P>\n ? { pathname: Route<P> | DynamicRouteTemplate; params?: never | InputRouteParams<never> }\n : never;\n\n /***********************\n * Expo Router Exports *\n ***********************/\n\n export type Router = Omit<OriginalRouter, 'push' | 'replace' | 'setParams'> & {\n /** Navigate to the provided href. */\n push: <T>(href: Href<T>) => void;\n /** Navigate to route without appending to the history. */\n replace: <T>(href: Href<T>) => void;\n /** Update the current route query params. */\n setParams: <T = ''>(params?: T extends '' ? Record<string, string> : InputRouteParams<T>) => void;\n };\n\n /** The imperative router. */\n export const router: Router;\n\n /************\n * <Link /> *\n ************/\n export interface LinkProps<T> extends OriginalLinkProps {\n href: Href<T>;\n }\n\n export interface LinkComponent {\n <T>(props: React.PropsWithChildren<LinkProps<T>>): JSX.Element;\n /** Helper method to resolve an Href object into a string. */\n resolveHref: <T>(href: Href<T>) => string;\n }\n\n /**\n * Component to render link to another route using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.href Absolute path to route (e.g. \\`/feeds/hot\\`).\n * @param props.replace Should replace the current route without adding to the history.\n * @param props.asChild Forward props to child component. Useful for custom buttons.\n * @param props.children Child elements to render the content.\n * @param props.className On web, this sets the HTML \\`class\\` directly. On native, this can be used with CSS interop tools like Nativewind.\n */\n export const Link: LinkComponent;\n\n /** Redirects to the href as soon as the component is mounted. */\n export const Redirect: <T>(\n props: React.PropsWithChildren<{ href: Href<T> }>\n ) => JSX.Element;\n\n /************\n * Hooks *\n ************/\n export function useRouter(): Router;\n\n export function useLocalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n /** @deprecated renamed to \\`useGlobalSearchParams\\` */\n export function useSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n export function useGlobalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n >(): T extends AllRoutes ? SearchParams<T> : T;\n\n export function useSegments<\n T extends AbsoluteRoute | RouteSegments<AbsoluteRoute> | RelativePathString,\n >(): T extends AbsoluteRoute ? RouteSegments<T> : T extends string ? string[] : T;\n}\n`;\n"],"names":["setupTypedRoutes","getTemplateString","getTypedRoutesUtils","extrapolateGroupRoutes","CAPTURE_DYNAMIC_PARAMS","CATCH_ALL","SLUG","ARRAY_GROUP_REGEX","CAPTURE_GROUP_REGEX","TYPED_ROUTES_EXCLUSION_REGEX","server","metro","typesDirectory","projectRoot","routerDirectory","filePathToRoute","staticRoutes","dynamicRoutes","addFilePath","isRouteFile","metroWatchTypeScriptFiles","eventTypes","callback","filePath","type","shouldRegenerate","route","delete","regenerateRouterDotTS","Set","values","flatMap","v","Array","from","keys","directoryExistsAsync","walk","debounce","typesDir","dynamicRouteTemplates","fs","mkdir","recursive","writeFile","path","resolve","routerDotTSTemplate","setToUnionType","dynamicRouteParams","appRoot","filePathSeperator","sep","Map","normalizedFilePath","replaceAll","normalizedAppRoot","replace","match","relative","startsWith","isAbsolute","has","dynamicParams","matchAll","map","isDynamic","size","addRoute","originalRoute","set","get","add","includes","routeWithoutGroups","routeWithSingleGroup","s","join","directory","files","readdir","file","p","stat","isDirectory","normalizedPath","routes","groupsMatch","group","trim","unsafeTemplate"],"mappings":"AAAA;;;;QAoCsBA,gBAAgB,GAAhBA,gBAAgB;QAkFtBC,iBAAiB,GAAjBA,iBAAiB;QAiBjBC,mBAAmB,GAAnBA,mBAAmB;QA2InBC,sBAAsB,GAAtBA,sBAAsB;;AAlRvB,IAAA,SAAa,kCAAb,aAAa,EAAA;AACP,IAAA,eAAiB,kCAAjB,iBAAiB,EAAA;AAErB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEc,IAAA,IAAoB,WAApB,oBAAoB,CAAA;AAC1B,IAAA,SAAyB,WAAzB,yBAAyB,CAAA;AAEd,IAAA,0BAAoC,WAApC,oCAAoC,CAAA;;;;;;AAGvE,MAAMC,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AAiB,EAAE,EAAE,CAAC,CAACgD,UAAU,SAAS,GAAG,CAAC,CAACE,OAAO,QAAQ,EAAE,CAAC,CAAC,CAAC;IAE/F,MAAMC,KAAK,GAAGhC,KAAK,CAACgC,KAAK,CAACnD,iBAAiB,CAAC,AAAC;IAE7C,IAAI,CAACmD,KAAK,EAAE;QACV4B,MAAM,CAACd,GAAG,CAAC9C,KAAK,CAAC,CAAC;QAClB,OAAO4D,MAAM,CAAC;KACf;IAED,MAAMC,WAAW,GAAG7B,KAAK,CAAC,CAAC,CAAC,AAAC;IAE7B,KAAK,MAAM8B,KAAK,IAAID,WAAW,CAACvB,QAAQ,CAACxD,mBAAmB,CAAC,CAAE;QAC7DL,sBAAsB,CAACuB,KAAK,CAAC+B,OAAO,CAAC8B,WAAW,EAAE,CAAC,CAAC,EAAEC,KAAK,CAAC,CAAC,CAAC,CAACC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAEH,MAAM,CAAC,CAAC;KACpF;IAED,OAAOA,MAAM,CAAC;CACf;AAED;;;;GAIG,CACH,MAAMvC,mBAAmB,GAAG2C,SAAc,eAAA,CAAC;;;;;;;;;sBASrB,EAAE,cAAc,CAAC;;yCAEE,EAAE,eAAe,CAAC;;8BAE7B,EAAE,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqOrD,CAAC,AAAC"}
@@ -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.16.3",
97
+ source_version: "0.16.4",
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.16.3"
138
+ version: "0.16.4"
139
139
  },
140
140
  ci: ciInfo.isCI ? {
141
141
  name: ciInfo.name,
@@ -121,7 +121,6 @@ async function installCocoaPodsAsync(projectRoot) {
121
121
  }
122
122
  try {
123
123
  await packageManager.installAsync({
124
- // @ts-expect-error: multiple versions in the monorepo
125
124
  spinner: step
126
125
  });
127
126
  // Create cached list for later
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/cocoapods.ts"],"sourcesContent":["import { getPackageJson, PackageJSONConfig } from '@expo/config';\nimport JsonFile from '@expo/json-file';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { ensureDirectoryAsync } from './dir';\nimport { env } from './env';\nimport { AbortCommandError } from './errors';\nimport { logNewSection } from './ora';\nimport * as Log from '../log';\nimport { hashForDependencyMap } from '../prebuild/updatePackageJson';\n\ntype PackageChecksums = {\n /** checksum for the `package.json` dependency object. */\n dependencies: string;\n /** checksum for the `package.json` devDependency object. */\n devDependencies: string;\n};\n\nconst PROJECT_PREBUILD_SETTINGS = '.expo/prebuild';\nconst CACHED_PACKAGE_JSON = 'cached-packages.json';\n\nfunction getTempPrebuildFolder(projectRoot: string): string {\n return path.join(projectRoot, PROJECT_PREBUILD_SETTINGS);\n}\n\nfunction hasNewDependenciesSinceLastBuild(\n projectRoot: string,\n packageChecksums: PackageChecksums\n): boolean {\n // TODO: Maybe comparing lock files would be better...\n const templateDirectory = getTempPrebuildFolder(projectRoot);\n const tempPkgJsonPath = path.join(templateDirectory, CACHED_PACKAGE_JSON);\n if (!fs.existsSync(tempPkgJsonPath)) {\n return true;\n }\n const { dependencies, devDependencies } = JsonFile.read(tempPkgJsonPath);\n // Only change the dependencies if the normalized hash changes, this helps to reduce meaningless changes.\n const hasNewDependencies = packageChecksums.dependencies !== dependencies;\n const hasNewDevDependencies = packageChecksums.devDependencies !== devDependencies;\n\n return hasNewDependencies || hasNewDevDependencies;\n}\n\nfunction createPackageChecksums(pkg: PackageJSONConfig): PackageChecksums {\n return {\n dependencies: hashForDependencyMap(pkg.dependencies || {}),\n devDependencies: hashForDependencyMap(pkg.devDependencies || {}),\n };\n}\n\n/** @returns `true` if the package.json dependency hash does not match the cached hash from the last run. */\nexport async function hasPackageJsonDependencyListChangedAsync(\n projectRoot: string\n): Promise<boolean> {\n const pkg = getPackageJson(projectRoot);\n\n const packages = createPackageChecksums(pkg);\n const hasNewDependencies = hasNewDependenciesSinceLastBuild(projectRoot, packages);\n\n // Cache package.json\n await ensureDirectoryAsync(getTempPrebuildFolder(projectRoot));\n const templateDirectory = path.join(getTempPrebuildFolder(projectRoot), CACHED_PACKAGE_JSON);\n await JsonFile.writeAsync(templateDirectory, packages);\n\n return hasNewDependencies;\n}\n\nexport async function installCocoaPodsAsync(projectRoot: string): Promise<boolean> {\n let step = logNewSection('Installing CocoaPods...');\n if (process.platform !== 'darwin') {\n step.succeed('Skipped installing CocoaPods because operating system is not on macOS.');\n return false;\n }\n\n const packageManager = new PackageManager.CocoaPodsPackageManager({\n cwd: path.join(projectRoot, 'ios'),\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n\n if (!(await packageManager.isCLIInstalledAsync())) {\n try {\n // prompt user -- do you want to install cocoapods right now?\n step.text = 'CocoaPods CLI not found in your PATH, installing it now.';\n step.stopAndPersist();\n await PackageManager.CocoaPodsPackageManager.installCLIAsync({\n nonInteractive: true,\n spawnOptions: {\n ...packageManager.options,\n // Don't silence this part\n stdio: ['inherit', 'inherit', 'pipe'],\n },\n });\n step.succeed('Installed CocoaPods CLI.');\n step = logNewSection('Running `pod install` in the `ios` directory.');\n } catch (error: any) {\n step.stopAndPersist({\n symbol: '⚠️ ',\n text: chalk.red('Unable to install the CocoaPods CLI.'),\n });\n if (error instanceof PackageManager.CocoaPodsError) {\n Log.log(error.message);\n } else {\n Log.log(`Unknown error: ${error.message}`);\n }\n return false;\n }\n }\n\n try {\n await packageManager.installAsync({\n // @ts-expect-error: multiple versions in the monorepo\n spinner: step,\n });\n // Create cached list for later\n await hasPackageJsonDependencyListChangedAsync(projectRoot).catch(() => null);\n step.succeed('Installed CocoaPods');\n return true;\n } catch (error: any) {\n step.stopAndPersist({\n symbol: '⚠️ ',\n text: chalk.red('Something went wrong running `pod install` in the `ios` directory.'),\n });\n if (error instanceof PackageManager.CocoaPodsError) {\n Log.log(error.message);\n } else {\n Log.log(`Unknown error: ${error.message}`);\n }\n return false;\n }\n}\n\nfunction doesProjectUseCocoaPods(projectRoot: string): boolean {\n return fs.existsSync(path.join(projectRoot, 'ios', 'Podfile'));\n}\n\nfunction isLockfileCreated(projectRoot: string): boolean {\n const podfileLockPath = path.join(projectRoot, 'ios', 'Podfile.lock');\n return fs.existsSync(podfileLockPath);\n}\n\nfunction isPodFolderCreated(projectRoot: string): boolean {\n const podFolderPath = path.join(projectRoot, 'ios', 'Pods');\n return fs.existsSync(podFolderPath);\n}\n\n// TODO: Same process but with app.config changes + default plugins.\n// This will ensure the user is prompted for extra setup.\nexport async function maybePromptToSyncPodsAsync(projectRoot: string) {\n if (!doesProjectUseCocoaPods(projectRoot)) {\n // Project does not use CocoaPods\n return;\n }\n if (!isLockfileCreated(projectRoot) || !isPodFolderCreated(projectRoot)) {\n if (!(await installCocoaPodsAsync(projectRoot))) {\n throw new AbortCommandError();\n }\n return;\n }\n\n // Getting autolinked packages can be heavy, optimize around checking every time.\n if (!(await hasPackageJsonDependencyListChangedAsync(projectRoot))) {\n return;\n }\n\n await promptToInstallPodsAsync(projectRoot, []);\n}\n\nasync function promptToInstallPodsAsync(projectRoot: string, missingPods?: string[]) {\n if (missingPods?.length) {\n Log.log(\n `Could not find the following native modules: ${missingPods\n .map((pod) => chalk.bold(pod))\n .join(', ')}. Did you forget to run \"${chalk.bold('pod install')}\" ?`\n );\n }\n\n try {\n if (!(await installCocoaPodsAsync(projectRoot))) {\n throw new AbortCommandError();\n }\n } catch (error) {\n await fs.promises.rm(path.join(getTempPrebuildFolder(projectRoot), CACHED_PACKAGE_JSON), {\n recursive: true,\n force: true,\n });\n throw error;\n }\n}\n"],"names":["hasPackageJsonDependencyListChangedAsync","installCocoaPodsAsync","maybePromptToSyncPodsAsync","PackageManager","Log","PROJECT_PREBUILD_SETTINGS","CACHED_PACKAGE_JSON","getTempPrebuildFolder","projectRoot","path","join","hasNewDependenciesSinceLastBuild","packageChecksums","templateDirectory","tempPkgJsonPath","fs","existsSync","dependencies","devDependencies","JsonFile","read","hasNewDependencies","hasNewDevDependencies","createPackageChecksums","pkg","hashForDependencyMap","getPackageJson","packages","ensureDirectoryAsync","writeAsync","step","logNewSection","process","platform","succeed","packageManager","CocoaPodsPackageManager","cwd","silent","env","EXPO_DEBUG","CI","isCLIInstalledAsync","text","stopAndPersist","installCLIAsync","nonInteractive","spawnOptions","options","stdio","error","symbol","chalk","red","CocoaPodsError","log","message","installAsync","spinner","catch","doesProjectUseCocoaPods","isLockfileCreated","podfileLockPath","isPodFolderCreated","podFolderPath","AbortCommandError","promptToInstallPodsAsync","missingPods","length","map","pod","bold","promises","rm","recursive","force"],"mappings":"AAAA;;;;QAsDsBA,wCAAwC,GAAxCA,wCAAwC;QAgBxCC,qBAAqB,GAArBA,qBAAqB;QAgFrBC,0BAA0B,GAA1BA,0BAA0B;AAtJE,IAAA,OAAc,WAAd,cAAc,CAAA;AAC3C,IAAA,SAAiB,kCAAjB,iBAAiB,EAAA;AAC1BC,IAAAA,cAAc,mCAAM,uBAAuB,EAA7B;AACR,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEc,IAAA,IAAO,WAAP,OAAO,CAAA;AACxB,IAAA,IAAO,WAAP,OAAO,CAAA;AACO,IAAA,OAAU,WAAV,UAAU,CAAA;AACd,IAAA,IAAO,W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E;QACvE,IAAI,CAAE,MAAMP,qBAAqB,CAACO,WAAW,CAAC,AAAC,EAAE;YAC/C,MAAM,IAAIyD,OAAiB,kBAAA,EAAE,CAAC;SAC/B;QACD,OAAO;KACR;IAED,iFAAiF;IACjF,IAAI,CAAE,MAAMjE,wCAAwC,CAACQ,WAAW,CAAC,AAAC,EAAE;QAClE,OAAO;KACR;IAED,MAAM0D,wBAAwB,CAAC1D,WAAW,EAAE,EAAE,CAAC,CAAC;CACjD;AAED,eAAe0D,wBAAwB,CAAC1D,WAAmB,EAAE2D,WAAsB,EAAE;IACnF,IAAIA,WAAW,QAAQ,GAAnBA,KAAAA,CAAmB,GAAnBA,WAAW,CAAEC,MAAM,EAAE;QACvBhE,GAAG,CAACmD,GAAG,CACL,CAAC,6CAA6C,EAAEY,WAAW,CACxDE,GAAG,CAAC,CAACC,GAAG,GAAKlB,MAAK,QAAA,CAACmB,IAAI,CAACD,GAAG,CAAC;QAAA,CAAC,CAC7B5D,IAAI,CAAC,IAAI,CAAC,CAAC,yBAAyB,EAAE0C,MAAK,QAAA,CAACmB,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CACxE,CAAC;KACH;IAED,IAAI;QACF,IAAI,CAAE,MAAMtE,qBAAqB,CAACO,WAAW,CAAC,AAAC,EAAE;YAC/C,MAAM,IAAIyD,OAAiB,kBAAA,EAAE,CAAC;SAC/B;KACF,CAAC,OAAOf,KAAK,EAAE;QACd,MAAMnC,GAAE,QAAA,CAACyD,QAAQ,CAACC,EAAE,CAAChE,KAAI,QAAA,CAACC,IAAI,CAACH,qBAAqB,CAACC,WAAW,CAAC,EAAEF,mBAAmB,CAAC,EAAE;YACvFoE,SAAS,EAAE,IAAI;YACfC,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QACH,MAAMzB,KAAK,CAAC;KACb;CACF"}
1
+ {"version":3,"sources":["../../../src/utils/cocoapods.ts"],"sourcesContent":["import { getPackageJson, PackageJSONConfig } from '@expo/config';\nimport JsonFile from '@expo/json-file';\nimport * as PackageManager from '@expo/package-manager';\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\n\nimport { ensureDirectoryAsync } from './dir';\nimport { env } from './env';\nimport { AbortCommandError } from './errors';\nimport { logNewSection } from './ora';\nimport * as Log from '../log';\nimport { hashForDependencyMap } from '../prebuild/updatePackageJson';\n\ntype PackageChecksums = {\n /** checksum for the `package.json` dependency object. */\n dependencies: string;\n /** checksum for the `package.json` devDependency object. */\n devDependencies: string;\n};\n\nconst PROJECT_PREBUILD_SETTINGS = '.expo/prebuild';\nconst CACHED_PACKAGE_JSON = 'cached-packages.json';\n\nfunction getTempPrebuildFolder(projectRoot: string): string {\n return path.join(projectRoot, PROJECT_PREBUILD_SETTINGS);\n}\n\nfunction hasNewDependenciesSinceLastBuild(\n projectRoot: string,\n packageChecksums: PackageChecksums\n): boolean {\n // TODO: Maybe comparing lock files would be better...\n const templateDirectory = getTempPrebuildFolder(projectRoot);\n const tempPkgJsonPath = path.join(templateDirectory, CACHED_PACKAGE_JSON);\n if (!fs.existsSync(tempPkgJsonPath)) {\n return true;\n }\n const { dependencies, devDependencies } = JsonFile.read(tempPkgJsonPath);\n // Only change the dependencies if the normalized hash changes, this helps to reduce meaningless changes.\n const hasNewDependencies = packageChecksums.dependencies !== dependencies;\n const hasNewDevDependencies = packageChecksums.devDependencies !== devDependencies;\n\n return hasNewDependencies || hasNewDevDependencies;\n}\n\nfunction createPackageChecksums(pkg: PackageJSONConfig): PackageChecksums {\n return {\n dependencies: hashForDependencyMap(pkg.dependencies || {}),\n devDependencies: hashForDependencyMap(pkg.devDependencies || {}),\n };\n}\n\n/** @returns `true` if the package.json dependency hash does not match the cached hash from the last run. */\nexport async function hasPackageJsonDependencyListChangedAsync(\n projectRoot: string\n): Promise<boolean> {\n const pkg = getPackageJson(projectRoot);\n\n const packages = createPackageChecksums(pkg);\n const hasNewDependencies = hasNewDependenciesSinceLastBuild(projectRoot, packages);\n\n // Cache package.json\n await ensureDirectoryAsync(getTempPrebuildFolder(projectRoot));\n const templateDirectory = path.join(getTempPrebuildFolder(projectRoot), CACHED_PACKAGE_JSON);\n await JsonFile.writeAsync(templateDirectory, packages);\n\n return hasNewDependencies;\n}\n\nexport async function installCocoaPodsAsync(projectRoot: string): Promise<boolean> {\n let step = logNewSection('Installing CocoaPods...');\n if (process.platform !== 'darwin') {\n step.succeed('Skipped installing CocoaPods because operating system is not on macOS.');\n return false;\n }\n\n const packageManager = new PackageManager.CocoaPodsPackageManager({\n cwd: path.join(projectRoot, 'ios'),\n silent: !(env.EXPO_DEBUG || env.CI),\n });\n\n if (!(await packageManager.isCLIInstalledAsync())) {\n try {\n // prompt user -- do you want to install cocoapods right now?\n step.text = 'CocoaPods CLI not found in your PATH, installing it now.';\n step.stopAndPersist();\n await PackageManager.CocoaPodsPackageManager.installCLIAsync({\n nonInteractive: true,\n spawnOptions: {\n ...packageManager.options,\n // Don't silence this part\n stdio: ['inherit', 'inherit', 'pipe'],\n },\n });\n step.succeed('Installed CocoaPods CLI.');\n step = logNewSection('Running `pod install` in the `ios` directory.');\n } catch (error: any) {\n step.stopAndPersist({\n symbol: '⚠️ ',\n text: chalk.red('Unable to install the CocoaPods CLI.'),\n });\n if (error instanceof PackageManager.CocoaPodsError) {\n Log.log(error.message);\n } else {\n Log.log(`Unknown error: ${error.message}`);\n }\n return false;\n }\n }\n\n try {\n await packageManager.installAsync({ spinner: step });\n // Create cached list for later\n await hasPackageJsonDependencyListChangedAsync(projectRoot).catch(() => null);\n step.succeed('Installed CocoaPods');\n return true;\n } catch (error: any) {\n step.stopAndPersist({\n symbol: '⚠️ ',\n text: chalk.red('Something went wrong running `pod install` in the `ios` directory.'),\n });\n if (error instanceof PackageManager.CocoaPodsError) {\n Log.log(error.message);\n } else {\n Log.log(`Unknown error: ${error.message}`);\n }\n return false;\n }\n}\n\nfunction doesProjectUseCocoaPods(projectRoot: string): boolean {\n return fs.existsSync(path.join(projectRoot, 'ios', 'Podfile'));\n}\n\nfunction isLockfileCreated(projectRoot: string): boolean {\n const podfileLockPath = path.join(projectRoot, 'ios', 'Podfile.lock');\n return fs.existsSync(podfileLockPath);\n}\n\nfunction isPodFolderCreated(projectRoot: string): boolean {\n const podFolderPath = path.join(projectRoot, 'ios', 'Pods');\n return fs.existsSync(podFolderPath);\n}\n\n// TODO: Same process but with app.config changes + default plugins.\n// This will ensure the user is prompted for extra setup.\nexport async function maybePromptToSyncPodsAsync(projectRoot: string) {\n if (!doesProjectUseCocoaPods(projectRoot)) {\n // Project does not use CocoaPods\n return;\n }\n if (!isLockfileCreated(projectRoot) || !isPodFolderCreated(projectRoot)) {\n if (!(await installCocoaPodsAsync(projectRoot))) {\n throw new AbortCommandError();\n }\n return;\n }\n\n // Getting autolinked packages can be heavy, optimize around checking every time.\n if (!(await hasPackageJsonDependencyListChangedAsync(projectRoot))) {\n return;\n }\n\n await promptToInstallPodsAsync(projectRoot, []);\n}\n\nasync function promptToInstallPodsAsync(projectRoot: string, missingPods?: string[]) {\n if (missingPods?.length) {\n Log.log(\n `Could not find the following native modules: ${missingPods\n .map((pod) => chalk.bold(pod))\n .join(', ')}. Did you forget to run \"${chalk.bold('pod install')}\" ?`\n );\n }\n\n try {\n if (!(await installCocoaPodsAsync(projectRoot))) {\n throw new AbortCommandError();\n }\n } catch (error) {\n await fs.promises.rm(path.join(getTempPrebuildFolder(projectRoot), CACHED_PACKAGE_JSON), {\n recursive: true,\n force: true,\n });\n throw error;\n }\n}\n"],"names":["hasPackageJsonDependencyListChangedAsync","installCocoaPodsAsync","maybePromptToSyncPodsAsync","PackageManager","Log","PROJECT_PREBUILD_SETTINGS","CACHED_PACKAGE_JSON","getTempPrebuildFolder","projectRoot","path","join","hasNewDependenciesSinceLastBuild","packageChecksums","templateDirectory","tempPkgJsonPath","fs","existsSync","dependencies","devDependencies","JsonFile","read","hasNewDependencies","hasNewDevDependencies","createPackageChecksums","pkg","hashForDependencyMap","getPackageJson","packages","ensureDirectoryAsync","writeAsync","step","logNewSection","process","platform","succeed","packageManager","CocoaPodsPackageManager","cwd","silent","env","EXPO_DEBUG","CI","isCLIInstalledAsync","text","stopAndPersist","installCLIAsync","nonInteractive","spawnOptions","options","stdio","error","symbol","chalk","red","CocoaPodsError","log","message","installAsync","spinner","catch","doesProjectUseCocoaPods","isLockfileCreated","podfileLockPath","isPodFolderCreated","podFolderPath","AbortCommandError","promptToInstallPodsAsync","missingPods","length","map","pod","bold","promises","rm","recursive","force"],"mappings":"AAAA;;;;QAsDsBA,wCAAwC,GAAxCA,wCAAwC;QAgBxCC,qBAAqB,GAArBA,qBAAqB;QA6ErBC,0BAA0B,GAA1BA,0BAA0B;AAnJE,IAAA,OAAc,WAAd,cAAc,CAAA;AAC3C,IAAA,SAAiB,kCAAjB,iBAAiB,EAAA;AAC1BC,IAAAA,cAAc,mCAAM,uBAAuB,EAA7B;AACR,IAAA,MAAO,kCAAP,OAAO,EAAA;AACV,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEc,IAAA,IAAO,WAAP,OAAO,CAAA;AACxB,IAAA,IAAO,WAAP,OAAO,CAAA;AACO,IAAA,OAAU,WAAV,UAAU,CAAA;AACd,IAAA,IAAO,WAAP,OAAO,CAAA;AACzBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACsB,IAAA,kBAA+B,WAA/B,+BAA+B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AASpE,MAAMC,yBAAyB,GAAG,gBAAgB,AAAC;AACnD,MAAMC,mBAAmB,GAAG,sBAAsB,AAAC;AAEnD,SAASC,qBAAqB,CAACC,WAAmB,EAAU;IAC1D,OAAOC,KAAI,QAAA,CAACC,IAAI,CAACF,WAAW,EAAEH,yBAAyB,CAAC,CAAC;CAC1D;AAED,SAASM,gCAAgC,CACvCH,WAAmB,EACnBI,gBAAkC,EACzB;IACT,sDAAsD;IACtD,MAAMC,iBAAiB,GAAGN,qBAAqB,CAACC,WAAW,CAAC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AC,6CAA6C,EAAEY,WAAW,CACxDE,GAAG,CAAC,CAACC,GAAG,GAAKlB,MAAK,QAAA,CAACmB,IAAI,CAACD,GAAG,CAAC;QAAA,CAAC,CAC7B5D,IAAI,CAAC,IAAI,CAAC,CAAC,yBAAyB,EAAE0C,MAAK,QAAA,CAACmB,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,CACxE,CAAC;KACH;IAED,IAAI;QACF,IAAI,CAAE,MAAMtE,qBAAqB,CAACO,WAAW,CAAC,AAAC,EAAE;YAC/C,MAAM,IAAIyD,OAAiB,kBAAA,EAAE,CAAC;SAC/B;KACF,CAAC,OAAOf,KAAK,EAAE;QACd,MAAMnC,GAAE,QAAA,CAACyD,QAAQ,CAACC,EAAE,CAAChE,KAAI,QAAA,CAACC,IAAI,CAACH,qBAAqB,CAACC,WAAW,CAAC,EAAEF,mBAAmB,CAAC,EAAE;YACvFoE,SAAS,EAAE,IAAI;YACfC,KAAK,EAAE,IAAI;SACZ,CAAC,CAAC;QACH,MAAMzB,KAAK,CAAC;KACb;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.16.3",
3
+ "version": "0.16.4",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -43,16 +43,18 @@
43
43
  "@expo/config-plugins": "~7.8.0",
44
44
  "@expo/devcert": "^1.0.0",
45
45
  "@expo/env": "~0.2.0",
46
+ "@expo/image-utils": "^0.4.0",
46
47
  "@expo/json-file": "^8.2.37",
47
48
  "@expo/metro-config": "~0.17.0",
48
49
  "@expo/osascript": "^2.0.31",
49
50
  "@expo/package-manager": "^1.1.1",
50
51
  "@expo/plist": "^0.1.0",
51
- "@expo/prebuild-config": "6.7.1",
52
+ "@expo/prebuild-config": "6.7.2",
52
53
  "@expo/rudder-sdk-node": "1.1.1",
53
54
  "@expo/server": "^0.3.0",
54
55
  "@expo/spawn-async": "1.5.0",
55
- "@expo/xcpretty": "^4.2.1",
56
+ "@expo/xcpretty": "^4.3.0",
57
+ "@react-native/dev-middleware": "^0.73.6",
56
58
  "@urql/core": "2.3.6",
57
59
  "@urql/exchange-retry": "0.3.0",
58
60
  "accepts": "^1.3.8",
@@ -65,6 +67,7 @@
65
67
  "connect": "^3.7.0",
66
68
  "debug": "^4.3.4",
67
69
  "env-editor": "^0.4.1",
70
+ "find-yarn-workspace-root": "~2.0.0",
68
71
  "form-data": "^3.0.1",
69
72
  "freeport-async": "2.0.0",
70
73
  "fs-extra": "~8.1.0",
@@ -78,6 +81,7 @@
78
81
  "is-wsl": "^2.1.1",
79
82
  "js-yaml": "^3.13.1",
80
83
  "json-schema-deref-sync": "^0.13.0",
84
+ "lodash.debounce": "^4.0.8",
81
85
  "md5hex": "^1.0.0",
82
86
  "minimatch": "^3.0.4",
83
87
  "minipass": "3.3.6",
@@ -133,6 +137,7 @@
133
137
  "@types/getenv": "^1.0.0",
134
138
  "@types/js-yaml": "^3.12.2",
135
139
  "@types/klaw-sync": "^6.0.0",
140
+ "@types/lodash.debounce": "^4.0.9",
136
141
  "@types/npm-package-arg": "^6.1.0",
137
142
  "@types/progress": "^2.0.5",
138
143
  "@types/prompts": "^2.0.6",
@@ -159,5 +164,5 @@
159
164
  "tree-kill": "^1.2.2",
160
165
  "tsd": "^0.28.1"
161
166
  },
162
- "gitHead": "1a7c4e8ffed182e00cf1cf654ca2401441a7377a"
167
+ "gitHead": "43f1b4f8a5a9bca649e4e7ca6e4155482a162431"
163
168
  }