@expo/cli 0.17.4 → 0.17.6

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.
Files changed (36) hide show
  1. package/build/bin/cli +2 -2
  2. package/build/src/export/embed/exportEmbedAsync.js +1 -0
  3. package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
  4. package/build/src/export/exportApp.js +5 -1
  5. package/build/src/export/exportApp.js.map +1 -1
  6. package/build/src/export/fork-bundleAsync.js +3 -1
  7. package/build/src/export/fork-bundleAsync.js.map +1 -1
  8. package/build/src/export/index.js +2 -0
  9. package/build/src/export/index.js.map +1 -1
  10. package/build/src/export/resolveOptions.js +1 -0
  11. package/build/src/export/resolveOptions.js.map +1 -1
  12. package/build/src/export/saveAssets.js +0 -24
  13. package/build/src/export/saveAssets.js.map +1 -1
  14. package/build/src/start/server/AsyncNgrok.js +1 -5
  15. package/build/src/start/server/AsyncNgrok.js.map +1 -1
  16. package/build/src/start/server/UrlCreator.js +2 -2
  17. package/build/src/start/server/UrlCreator.js.map +1 -1
  18. package/build/src/start/server/getStaticRenderFunctions.js +5 -12
  19. package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
  20. package/build/src/start/server/metro/MetroBundlerDevServer.js +4 -2
  21. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  22. package/build/src/start/server/metro/MetroTerminalReporter.js +3 -3
  23. package/build/src/start/server/metro/MetroTerminalReporter.js.map +1 -1
  24. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js +2 -1
  25. package/build/src/start/server/middleware/ExpoGoManifestHandlerMiddleware.js.map +1 -1
  26. package/build/src/start/server/middleware/ManifestMiddleware.js +8 -5
  27. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  28. package/build/src/start/server/middleware/metroOptions.js +22 -10
  29. package/build/src/start/server/middleware/metroOptions.js.map +1 -1
  30. package/build/src/start/server/serverLogLikeMetro.js +147 -0
  31. package/build/src/start/server/serverLogLikeMetro.js.map +1 -0
  32. package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
  33. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  34. package/build/src/utils/createFileTransform.js +1 -0
  35. package/build/src/utils/createFileTransform.js.map +1 -1
  36. package/package.json +3 -2
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.logLikeMetro = logLikeMetro;
6
+ exports.formatStackLikeMetro = formatStackLikeMetro;
7
+ exports.augmentLogs = void 0;
8
+ var _metroConfig = require("@expo/metro-config");
9
+ var _chalk = _interopRequireDefault(require("chalk"));
10
+ var _path = _interopRequireDefault(require("path"));
11
+ var stackTraceParser = _interopRequireWildcard(require("stacktrace-parser"));
12
+ var _env = require("../../utils/env");
13
+ var _fn = require("../../utils/fn");
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ function _interopRequireWildcard(obj) {
20
+ if (obj && obj.__esModule) {
21
+ return obj;
22
+ } else {
23
+ var newObj = {};
24
+ if (obj != null) {
25
+ for(var key in obj){
26
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
27
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
28
+ if (desc.get || desc.set) {
29
+ Object.defineProperty(newObj, key, desc);
30
+ } else {
31
+ newObj[key] = obj[key];
32
+ }
33
+ }
34
+ }
35
+ }
36
+ newObj.default = obj;
37
+ return newObj;
38
+ }
39
+ }
40
+ const groupStack = [];
41
+ let collapsedGuardTimer;
42
+ function logLikeMetro(originalLogFunction, level, platform, ...data) {
43
+ // @ts-expect-error
44
+ const logFunction = console[level] && level !== "trace" ? level : "log";
45
+ const color = level === "error" ? _chalk.default.inverse.red : level === "warn" ? _chalk.default.inverse.yellow : _chalk.default.inverse.white;
46
+ if (level === "group") {
47
+ groupStack.push(level);
48
+ } else if (level === "groupCollapsed") {
49
+ groupStack.push(level);
50
+ clearTimeout(collapsedGuardTimer);
51
+ // Inform users that logs get swallowed if they forget to call `groupEnd`.
52
+ collapsedGuardTimer = setTimeout(()=>{
53
+ if (groupStack.includes("groupCollapsed")) {
54
+ originalLogFunction(_chalk.default.inverse.yellow.bold(" WARN "), "Expected `console.groupEnd` to be called after `console.groupCollapsed`.");
55
+ groupStack.length = 0;
56
+ }
57
+ }, 3000);
58
+ return;
59
+ } else if (level === "groupEnd") {
60
+ groupStack.pop();
61
+ if (!groupStack.length) {
62
+ clearTimeout(collapsedGuardTimer);
63
+ }
64
+ return;
65
+ }
66
+ if (!groupStack.includes("groupCollapsed")) {
67
+ // Remove excess whitespace at the end of a log message, if possible.
68
+ const lastItem = data[data.length - 1];
69
+ if (typeof lastItem === "string") {
70
+ data[data.length - 1] = lastItem.trimEnd();
71
+ }
72
+ const modePrefix = _chalk.default.bold`${platform}`;
73
+ originalLogFunction(modePrefix + " " + color.bold(` ${logFunction.toUpperCase()} `) + "".padEnd(groupStack.length * 2, " "), ...data);
74
+ }
75
+ }
76
+ const escapedPathSep = _path.default.sep === "\\" ? "\\\\" : _path.default.sep;
77
+ const SERVER_STACK_MATCHER = new RegExp(`${escapedPathSep}(react-dom|metro-runtime|expo-router)${escapedPathSep}`);
78
+ function augmentLogsInternal(projectRoot) {
79
+ const augmentLog = (name, fn)=>{
80
+ // @ts-expect-error: TypeScript doesn't know about polyfilled functions.
81
+ if (fn.__polyfilled) {
82
+ return fn;
83
+ }
84
+ const originalFn = fn.bind(console);
85
+ function logWithStack(...args) {
86
+ const stack = new Error().stack;
87
+ // Check if the log originates from the server.
88
+ const isServerLog = !!(stack == null ? void 0 : stack.match(SERVER_STACK_MATCHER));
89
+ if (isServerLog) {
90
+ if (name === "error" || name === "warn") {
91
+ args.push("\n" + formatStackLikeMetro(projectRoot, stack));
92
+ }
93
+ logLikeMetro(originalFn, name, "\u03BB", ...args);
94
+ } else {
95
+ originalFn(...args);
96
+ }
97
+ }
98
+ logWithStack.__polyfilled = true;
99
+ return logWithStack;
100
+ };
101
+ [
102
+ "trace",
103
+ "info",
104
+ "error",
105
+ "warn",
106
+ "log",
107
+ "group",
108
+ "groupCollapsed",
109
+ "groupEnd",
110
+ "debug"
111
+ ].forEach((name)=>{
112
+ // @ts-expect-error
113
+ console[name] = augmentLog(name, console[name]);
114
+ });
115
+ }
116
+ function formatStackLikeMetro(projectRoot, stack) {
117
+ // Remove `Error: ` from the beginning of the stack trace.
118
+ // Dim traces that match `INTERNAL_CALLSITES_REGEX`
119
+ const stackTrace = stackTraceParser.parse(stack);
120
+ return stackTrace.filter((line)=>line.file && line.file !== "<anonymous>" && // Ignore unsymbolicated stack frames. It's not clear how this is possible but it sometimes happens when the graph changes.
121
+ !/^https?:\/\//.test(line.file)
122
+ ).map((line)=>{
123
+ // Use the same regex we use in Metro config to filter out traces:
124
+ const isCollapsed = _metroConfig.INTERNAL_CALLSITES_REGEX.test(line.file);
125
+ if (isCollapsed && !_env.env.EXPO_DEBUG) {
126
+ return null;
127
+ }
128
+ // If a file is collapsed, print it with dim styling.
129
+ const style = isCollapsed ? _chalk.default.dim : _chalk.default.gray;
130
+ // Use the `at` prefix to match Node.js
131
+ let fileName = line.file;
132
+ if (fileName.startsWith(_path.default.sep)) {
133
+ fileName = _path.default.relative(projectRoot, fileName);
134
+ }
135
+ if (line.lineNumber != null) {
136
+ fileName += `:${line.lineNumber}`;
137
+ if (line.column != null) {
138
+ fileName += `:${line.column}`;
139
+ }
140
+ }
141
+ return style(` ${line.methodName} (${fileName})`);
142
+ }).filter(Boolean).join("\n");
143
+ }
144
+ const augmentLogs = (0, _fn).memoize(augmentLogsInternal);
145
+ exports.augmentLogs = augmentLogs;
146
+
147
+ //# sourceMappingURL=serverLogLikeMetro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/start/server/serverLogLikeMetro.ts"],"sourcesContent":["/**\n * Copyright © 2024 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { INTERNAL_CALLSITES_REGEX } from '@expo/metro-config';\nimport chalk from 'chalk';\nimport path from 'path';\nimport * as stackTraceParser from 'stacktrace-parser';\n\nimport { env } from '../../utils/env';\nimport { memoize } from '../../utils/fn';\n\nconst groupStack: any = [];\nlet collapsedGuardTimer: ReturnType<typeof setTimeout> | undefined;\n\nexport function logLikeMetro(\n originalLogFunction: (...args: any[]) => void,\n level: string,\n platform: string,\n ...data: any[]\n) {\n // @ts-expect-error\n const logFunction = console[level] && level !== 'trace' ? level : 'log';\n const color =\n level === 'error'\n ? chalk.inverse.red\n : level === 'warn'\n ? chalk.inverse.yellow\n : chalk.inverse.white;\n\n if (level === 'group') {\n groupStack.push(level);\n } else if (level === 'groupCollapsed') {\n groupStack.push(level);\n clearTimeout(collapsedGuardTimer);\n // Inform users that logs get swallowed if they forget to call `groupEnd`.\n collapsedGuardTimer = setTimeout(() => {\n if (groupStack.includes('groupCollapsed')) {\n originalLogFunction(\n chalk.inverse.yellow.bold(' WARN '),\n 'Expected `console.groupEnd` to be called after `console.groupCollapsed`.'\n );\n groupStack.length = 0;\n }\n }, 3000);\n return;\n } else if (level === 'groupEnd') {\n groupStack.pop();\n if (!groupStack.length) {\n clearTimeout(collapsedGuardTimer);\n }\n return;\n }\n\n if (!groupStack.includes('groupCollapsed')) {\n // Remove excess whitespace at the end of a log message, if possible.\n const lastItem = data[data.length - 1];\n if (typeof lastItem === 'string') {\n data[data.length - 1] = lastItem.trimEnd();\n }\n\n const modePrefix = chalk.bold`${platform}`;\n originalLogFunction(\n modePrefix +\n ' ' +\n color.bold(` ${logFunction.toUpperCase()} `) +\n ''.padEnd(groupStack.length * 2, ' '),\n ...data\n );\n }\n}\n\nconst escapedPathSep = path.sep === '\\\\' ? '\\\\\\\\' : path.sep;\nconst SERVER_STACK_MATCHER = new RegExp(\n `${escapedPathSep}(react-dom|metro-runtime|expo-router)${escapedPathSep}`\n);\n\nfunction augmentLogsInternal(projectRoot: string) {\n const augmentLog = (name: string, fn: typeof console.log) => {\n // @ts-expect-error: TypeScript doesn't know about polyfilled functions.\n if (fn.__polyfilled) {\n return fn;\n }\n const originalFn = fn.bind(console);\n function logWithStack(...args: any[]) {\n const stack = new Error().stack;\n // Check if the log originates from the server.\n const isServerLog = !!stack?.match(SERVER_STACK_MATCHER);\n if (isServerLog) {\n if (name === 'error' || name === 'warn') {\n args.push('\\n' + formatStackLikeMetro(projectRoot, stack!));\n }\n logLikeMetro(originalFn, name, 'λ', ...args);\n } else {\n originalFn(...args);\n }\n }\n logWithStack.__polyfilled = true;\n return logWithStack;\n };\n\n ['trace', 'info', 'error', 'warn', 'log', 'group', 'groupCollapsed', 'groupEnd', 'debug'].forEach(\n (name) => {\n // @ts-expect-error\n console[name] = augmentLog(name, console[name]);\n }\n );\n}\n\nexport function formatStackLikeMetro(projectRoot: string, stack: string) {\n // Remove `Error: ` from the beginning of the stack trace.\n // Dim traces that match `INTERNAL_CALLSITES_REGEX`\n\n const stackTrace = stackTraceParser.parse(stack);\n return stackTrace\n .filter(\n (line) =>\n line.file &&\n line.file !== '<anonymous>' &&\n // Ignore unsymbolicated stack frames. It's not clear how this is possible but it sometimes happens when the graph changes.\n !/^https?:\\/\\//.test(line.file)\n )\n .map((line) => {\n // Use the same regex we use in Metro config to filter out traces:\n const isCollapsed = INTERNAL_CALLSITES_REGEX.test(line.file!);\n if (isCollapsed && !env.EXPO_DEBUG) {\n return null;\n }\n // If a file is collapsed, print it with dim styling.\n const style = isCollapsed ? chalk.dim : chalk.gray;\n // Use the `at` prefix to match Node.js\n let fileName = line.file!;\n if (fileName.startsWith(path.sep)) {\n fileName = path.relative(projectRoot, fileName);\n }\n if (line.lineNumber != null) {\n fileName += `:${line.lineNumber}`;\n if (line.column != null) {\n fileName += `:${line.column}`;\n }\n }\n\n return style(` ${line.methodName} (${fileName})`);\n })\n .filter(Boolean)\n .join('\\n');\n}\n\n/** Augment console logs to check the stack trace and format like Metro logs if we think the log came from the SSR renderer or an API route. */\nexport const augmentLogs = memoize(augmentLogsInternal);\n"],"names":["logLikeMetro","formatStackLikeMetro","stackTraceParser","groupStack","collapsedGuardTimer","originalLogFunction","level","platform","data","logFunction","console","color","chalk","inverse","red","yellow","white","push","clearTimeout","setTimeout","includes","bold","length","pop","lastItem","trimEnd","modePrefix","toUpperCase","padEnd","escapedPathSep","path","sep","SERVER_STACK_MATCHER","RegExp","augmentLogsInternal","projectRoot","augmentLog","name","fn","__polyfilled","originalFn","bind","logWithStack","args","stack","Error","isServerLog","match","forEach","stackTrace","parse","filter","line","file","test","map","isCollapsed","INTERNAL_CALLSITES_REGEX","env","EXPO_DEBUG","style","dim","gray","fileName","startsWith","relative","lineNumber","column","methodName","Boolean","join","augmentLogs","memoize"],"mappings":"AAMA;;;;QAWgBA,YAAY,GAAZA,YAAY;QA8FZC,oBAAoB,GAApBA,oBAAoB;;AAzGK,IAAA,YAAoB,WAApB,oBAAoB,CAAA;AAC3C,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AACXC,IAAAA,gBAAgB,mCAAM,mBAAmB,EAAzB;AAER,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACb,IAAA,GAAgB,WAAhB,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAExC,MAAMC,UAAU,GAAQ,EAAE,AAAC;AAC3B,IAAIC,mBAAmB,AAA2C,AAAC;AAE5D,SAASJ,YAAY,CAC1BK,mBAA6C,EAC7CC,KAAa,EACbC,QAAgB,EAChB,GAAGC,IAAI,AAAO,EACd;IACA,mBAAmB;IACnB,MAAMC,WAAW,GAAGC,OAAO,CAACJ,KAAK,CAAC,IAAIA,KAAK,KAAK,OAAO,GAAGA,KAAK,GAAG,KAAK,AAAC;IACxE,MAAMK,KAAK,GACTL,KAAK,KAAK,OAAO,GACbM,MAAK,QAAA,CAACC,OAAO,CAACC,GAAG,GACjBR,KAAK,KAA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X,IAAI,CAACC,IAAI,AAAC,AAAC;QAC1B,IAAIU,QAAQ,CAACC,UAAU,CAAClC,KAAI,QAAA,CAACC,GAAG,CAAC,EAAE;YACjCgC,QAAQ,GAAGjC,KAAI,QAAA,CAACmC,QAAQ,CAAC9B,WAAW,EAAE4B,QAAQ,CAAC,CAAC;SACjD;QACD,IAAIX,IAAI,CAACc,UAAU,IAAI,IAAI,EAAE;YAC3BH,QAAQ,IAAI,CAAC,CAAC,EAAEX,IAAI,CAACc,UAAU,CAAC,CAAC,CAAC;YAClC,IAAId,IAAI,CAACe,MAAM,IAAI,IAAI,EAAE;gBACvBJ,QAAQ,IAAI,CAAC,CAAC,EAAEX,IAAI,CAACe,MAAM,CAAC,CAAC,CAAC;aAC/B;SACF;QAED,OAAOP,KAAK,CAAC,CAAC,EAAE,EAAER,IAAI,CAACgB,UAAU,CAAC,EAAE,EAAEL,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACpD,CAAC,CACDZ,MAAM,CAACkB,OAAO,CAAC,CACfC,IAAI,CAAC,IAAI,CAAC,CAAC;CACf;AAGM,MAAMC,WAAW,GAAGC,CAAAA,GAAAA,GAAO,AAAqB,CAAA,QAArB,CAACtC,mBAAmB,CAAC,AAAC;QAA3CqC,WAAW,GAAXA,WAAW"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/start/server/type-generation/__typetests__/fixtures/basic.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable import/export */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport type { LinkProps as OriginalLinkProps } from 'expo-router/build/link/Link';\nimport type { Router as OriginalRouter } from 'expo-router/build/types';\nexport * from 'expo-router/build';\n\n// prettier-ignore\ntype StaticRoutes = `/apple` | `/banana`;\n// prettier-ignore\ntype DynamicRoutes<T extends string> = `/colors/${SingleRoutePart<T>}` | `/animals/${CatchAllRoutePart<T>}` | `/mix/${SingleRoutePart<T>}/${SingleRoutePart<T>}/${CatchAllRoutePart<T>}`;\n// prettier-ignore\ntype DynamicRouteTemplate = `/colors/[color]` | `/animals/[...animal]` | `/mix/[fruit]/[color]/[...animals]`;\n\ntype RelativePathString = `./${string}` | `../${string}` | '..';\ntype AbsoluteRoute = DynamicRouteTemplate | StaticRoutes;\ntype ExternalPathString = `${string}:${string}`;\n\ntype ExpoRouterRoutes = DynamicRouteTemplate | StaticRoutes | RelativePathString;\nexport type AllRoutes = ExpoRouterRoutes | ExternalPathString;\n\n/****************\n * Route Utils *\n ****************/\n\ntype SearchOrHash = `?${string}` | `#${string}`;\ntype UnknownInputParams = Record<string, string | number | (string | number)[]>;\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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\ntype 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 */\nexport 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 */\nexport 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\nexport type Href<T> = T extends Record<'pathname', string> ? HrefObject<T> : Route<T>;\n\nexport 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\nexport 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. */\nexport declare const router: Router;\n\n/************\n * <Link /> *\n ************/\nexport interface LinkProps<T> extends OriginalLinkProps {\n href: Href<T>;\n}\n\nexport 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 */\nexport declare const Link: LinkComponent;\n\n/** Redirects to the href as soon as the component is mounted. */\nexport declare const Redirect: <T>(\n props: React.PropsWithChildren<{ href: Href<T> }>\n) => JSX.Element;\n\n/************\n * Hooks *\n ************/\nexport declare function useRouter(): Router;\n\nexport declare function useLocalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\n/** @deprecated renamed to `useGlobalSearchParams` */\nexport declare function useSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\nexport declare function useGlobalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\nexport declare function useSegments<\n T extends AbsoluteRoute | RouteSegments<AbsoluteRoute> | RelativePathString,\n>(): T extends AbsoluteRoute ? RouteSegments<T> : T extends string ? string[] : T;\n"],"names":[],"mappings":"AAIA;;;;6CAEc,mBAAmB;AAAjC,YAAA,MAAkC;;2CAAlC,MAAkC;;;;mBAAlC,MAAkC;;;EAAA"}
1
+ {"version":3,"sources":["../../../../../../../src/start/server/type-generation/__typetests__/fixtures/basic.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable import/export */\n/* eslint-disable @typescript-eslint/ban-types */\n\nimport type { LinkProps as OriginalLinkProps } from 'expo-router/build/link/Link';\nimport type { Router as OriginalRouter } from 'expo-router/build/types';\nexport * from 'expo-router/build';\n\n// prettier-ignore\ntype StaticRoutes = `/apple` | `/banana`;\n// prettier-ignore\ntype DynamicRoutes<T extends string> = `/colors/${SingleRoutePart<T>}` | `/animals/${CatchAllRoutePart<T>}` | `/mix/${SingleRoutePart<T>}/${SingleRoutePart<T>}/${CatchAllRoutePart<T>}`;\n// prettier-ignore\ntype DynamicRouteTemplate = `/colors/[color]` | `/animals/[...animal]` | `/mix/[fruit]/[color]/[...animals]`;\n\ntype RelativePathString = `./${string}` | `../${string}` | '..';\ntype AbsoluteRoute = DynamicRouteTemplate | StaticRoutes;\ntype ExternalPathString = `${string}:${string}`;\n\ntype ExpoRouterRoutes = DynamicRouteTemplate | StaticRoutes | RelativePathString;\nexport type AllRoutes = ExpoRouterRoutes | ExternalPathString;\n\n/****************\n * Route Utils *\n ****************/\n\ntype SearchOrHash = `?${string}` | `#${string}`;\ntype UnknownInputParams = Record<string, string | number | (string | number)[]>;\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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 */\ntype 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\ntype 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 */\nexport 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 */\nexport 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\nexport type Href<T> = T extends Record<'pathname', string> ? HrefObject<T> : Route<T>;\n\nexport 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\nexport 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. */\nexport declare const router: Router;\n\n/************\n * <Link /> *\n ************/\nexport interface LinkProps<T> extends OriginalLinkProps {\n href: Href<T>;\n}\n\nexport 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 */\nexport declare const Link: LinkComponent;\n\n/** Redirects to the href as soon as the component is mounted. */\nexport declare const Redirect: <T>(\n props: React.PropsWithChildren<{ href: Href<T> }>\n) => JSX.Element;\n\n/************\n * Hooks *\n ************/\nexport declare function useRouter(): Router;\n\nexport declare function useLocalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\n/** @deprecated renamed to `useGlobalSearchParams` */\nexport declare function useSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\nexport declare function useGlobalSearchParams<\n T extends AllRoutes | UnknownOutputParams = UnknownOutputParams,\n>(): T extends AllRoutes ? SearchParams<T> : T;\n\nexport declare function useSegments<\n T extends AbsoluteRoute | RouteSegments<AbsoluteRoute> | RelativePathString,\n>(): T extends AbsoluteRoute ? RouteSegments<T> : T extends string ? string[] : T;\n"],"names":[],"mappings":"AAIA;;;;6CAEc,mBAAmB;AAAjC,YAAA,MAAkC;;2CAAlC,MAAkC;;;;mBAAlC,MAAkC;;;EAAA"}
@@ -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.17.4",
97
+ source_version: "0.17.6",
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.17.4"
138
+ version: "0.17.6"
139
139
  },
140
140
  ci: ciInfo.isCI ? {
141
141
  name: ciInfo.name,
@@ -76,6 +76,7 @@ function createFileTransform(name) {
76
76
  ".svg",
77
77
  ".jar",
78
78
  ".keystore",
79
+ ".gz",
79
80
  // Font files
80
81
  ".otf",
81
82
  ".ttf",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/createFileTransform.ts"],"sourcesContent":["import { IOSConfig } from '@expo/config-plugins';\nimport Minipass from 'minipass';\nimport path from 'path';\nimport picomatch from 'picomatch';\nimport { ReadEntry } from 'tar';\n\nconst debug = require('debug')('expo:file-transform') as typeof console.log;\n\nfunction escapeXMLCharacters(original: string): string {\n const noAmps = original.replace('&', '&amp;');\n const noLt = noAmps.replace('<', '&lt;');\n const noGt = noLt.replace('>', '&gt;');\n const noApos = noGt.replace('\"', '\\\\\"');\n return noApos.replace(\"'\", \"\\\\'\");\n}\n\nclass Transformer extends Minipass {\n data = '';\n\n constructor(private settings: { name: string; extension: string }) {\n super();\n }\n\n write(data: string) {\n this.data += data;\n return true;\n }\n\n getNormalizedName(): string {\n if (['.xml', '.plist'].includes(this.settings.extension)) {\n return escapeXMLCharacters(this.settings.name);\n }\n return this.settings.name;\n }\n\n end() {\n const name = this.getNormalizedName();\n const replaced = this.data\n .replace(/Hello App Display Name/g, name)\n .replace(/HelloWorld/g, IOSConfig.XcodeUtils.sanitizedName(name))\n .replace(/helloworld/g, IOSConfig.XcodeUtils.sanitizedName(name.toLowerCase()));\n super.write(replaced);\n return super.end();\n }\n}\n\nexport function createEntryResolver(name: string) {\n return (entry: ReadEntry) => {\n if (name) {\n // Rewrite paths for bare workflow\n entry.path = entry.path\n .replace(\n /HelloWorld/g,\n entry.path.includes('android')\n ? IOSConfig.XcodeUtils.sanitizedName(name.toLowerCase())\n : IOSConfig.XcodeUtils.sanitizedName(name)\n )\n .replace(/helloworld/g, IOSConfig.XcodeUtils.sanitizedName(name).toLowerCase());\n }\n if (entry.type && /^file$/i.test(entry.type) && path.basename(entry.path) === 'gitignore') {\n // Rename `gitignore` because npm ignores files named `.gitignore` when publishing.\n // See: https://github.com/npm/npm/issues/1862\n entry.path = entry.path.replace(/gitignore$/, '.gitignore');\n }\n };\n}\n\nexport function createFileTransform(name: string) {\n return (entry: ReadEntry) => {\n const extension = path.extname(entry.path);\n\n // Binary files, don't process these (avoid decoding as utf8)\n if (\n ![\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.psd',\n '.tiff',\n '.svg',\n '.jar',\n '.keystore',\n\n // Font files\n '.otf',\n '.ttf',\n ].includes(extension) &&\n name\n ) {\n return new Transformer({ name, extension });\n }\n return undefined;\n };\n}\n\nexport function createGlobFilter(\n globPattern: picomatch.Glob,\n options?: picomatch.PicomatchOptions\n) {\n const matcher = picomatch(globPattern, options);\n\n debug(\n 'filter: created for pattern(s) \"%s\" (%s)',\n Array.isArray(globPattern) ? globPattern.join('\", \"') : globPattern,\n options\n );\n\n return (path: string) => {\n const included = matcher(path);\n debug('filter: %s - %s', included ? 'include' : 'exclude', path);\n return included;\n };\n}\n"],"names":["createEntryResolver","createFileTransform","createGlobFilter","debug","require","escapeXMLCharacters","original","noAmps","replace","noLt","noGt","noApos","Transformer","Minipass","constructor","settings","data","write","getNormalizedName","includes","extension","name","end","replaced","IOSConfig","XcodeUtils","sanitizedName","toLowerCase","entry","path","type","test","basename","extname","undefined","globPattern","options","matcher","picomatch","Array","isArray","join","included"],"mappings":"AAAA;;;;QA8CgBA,mBAAmB,GAAnBA,mBAAmB;QAqBnBC,mBAAmB,GAAnBA,mBAAmB;QA8BnBC,gBAAgB,GAAhBA,gBAAgB;AAjGN,IAAA,cAAsB,WAAtB,sBAAsB,CAAA;AAC3B,IAAA,SAAU,kCAAV,UAAU,EAAA;AACd,IAAA,KAAM,kCAAN,MAAM,EAAA;AACD,IAAA,UAAW,kCAAX,WAAW,EAAA;;;;;;AAGjC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,qBAAqB,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N,OAAO;YACP,MAAM;YACN,OAAO;YACP,MAAM;YACN,MAAM;YACN,WAAW;YAEX,aAAa;YACb,MAAM;YACN,MAAM;SACP,CAACV,QAAQ,CAACC,SAAS,CAAC,IACrBC,IAAI,EACJ;YACA,OAAO,IAAIT,WAAW,CAAC;gBAAES,IAAI;gBAAED,SAAS;aAAE,CAAC,CAAC;SAC7C;QACD,OAAOc,SAAS,CAAC;KAClB,CAAC;CACH;AAEM,SAAShC,gBAAgB,CAC9BiC,WAA2B,EAC3BC,OAAoC,EACpC;IACA,MAAMC,OAAO,GAAGC,CAAAA,GAAAA,UAAS,AAAsB,CAAA,QAAtB,CAACH,WAAW,EAAEC,OAAO,CAAC,AAAC;IAEhDjC,KAAK,CACH,0CAA0C,EAC1CoC,KAAK,CAACC,OAAO,CAACL,WAAW,CAAC,GAAGA,WAAW,CAACM,IAAI,CAAC,MAAM,CAAC,GAAGN,WAAW,EACnEC,OAAO,CACR,CAAC;IAEF,OAAO,CAACP,IAAY,GAAK;QACvB,MAAMa,QAAQ,GAAGL,OAAO,CAACR,IAAI,CAAC,AAAC;QAC/B1B,KAAK,CAAC,iBAAiB,EAAEuC,QAAQ,GAAG,SAAS,GAAG,SAAS,EAAEb,IAAI,CAAC,CAAC;QACjE,OAAOa,QAAQ,CAAC;KACjB,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../src/utils/createFileTransform.ts"],"sourcesContent":["import { IOSConfig } from '@expo/config-plugins';\nimport Minipass from 'minipass';\nimport path from 'path';\nimport picomatch from 'picomatch';\nimport { ReadEntry } from 'tar';\n\nconst debug = require('debug')('expo:file-transform') as typeof console.log;\n\nfunction escapeXMLCharacters(original: string): string {\n const noAmps = original.replace('&', '&amp;');\n const noLt = noAmps.replace('<', '&lt;');\n const noGt = noLt.replace('>', '&gt;');\n const noApos = noGt.replace('\"', '\\\\\"');\n return noApos.replace(\"'\", \"\\\\'\");\n}\n\nclass Transformer extends Minipass {\n data = '';\n\n constructor(private settings: { name: string; extension: string }) {\n super();\n }\n\n write(data: string) {\n this.data += data;\n return true;\n }\n\n getNormalizedName(): string {\n if (['.xml', '.plist'].includes(this.settings.extension)) {\n return escapeXMLCharacters(this.settings.name);\n }\n return this.settings.name;\n }\n\n end() {\n const name = this.getNormalizedName();\n const replaced = this.data\n .replace(/Hello App Display Name/g, name)\n .replace(/HelloWorld/g, IOSConfig.XcodeUtils.sanitizedName(name))\n .replace(/helloworld/g, IOSConfig.XcodeUtils.sanitizedName(name.toLowerCase()));\n super.write(replaced);\n return super.end();\n }\n}\n\nexport function createEntryResolver(name: string) {\n return (entry: ReadEntry) => {\n if (name) {\n // Rewrite paths for bare workflow\n entry.path = entry.path\n .replace(\n /HelloWorld/g,\n entry.path.includes('android')\n ? IOSConfig.XcodeUtils.sanitizedName(name.toLowerCase())\n : IOSConfig.XcodeUtils.sanitizedName(name)\n )\n .replace(/helloworld/g, IOSConfig.XcodeUtils.sanitizedName(name).toLowerCase());\n }\n if (entry.type && /^file$/i.test(entry.type) && path.basename(entry.path) === 'gitignore') {\n // Rename `gitignore` because npm ignores files named `.gitignore` when publishing.\n // See: https://github.com/npm/npm/issues/1862\n entry.path = entry.path.replace(/gitignore$/, '.gitignore');\n }\n };\n}\n\nexport function createFileTransform(name: string) {\n return (entry: ReadEntry) => {\n const extension = path.extname(entry.path);\n\n // Binary files, don't process these (avoid decoding as utf8)\n if (\n ![\n '.png',\n '.jpg',\n '.jpeg',\n '.gif',\n '.webp',\n '.psd',\n '.tiff',\n '.svg',\n '.jar',\n '.keystore',\n '.gz',\n\n // Font files\n '.otf',\n '.ttf',\n ].includes(extension) &&\n name\n ) {\n return new Transformer({ name, extension });\n }\n return undefined;\n };\n}\n\nexport function createGlobFilter(\n globPattern: picomatch.Glob,\n options?: picomatch.PicomatchOptions\n) {\n const matcher = picomatch(globPattern, options);\n\n debug(\n 'filter: created for pattern(s) \"%s\" (%s)',\n Array.isArray(globPattern) ? globPattern.join('\", \"') : globPattern,\n options\n );\n\n return (path: string) => {\n const included = matcher(path);\n debug('filter: %s - %s', included ? 'include' : 'exclude', path);\n return included;\n };\n}\n"],"names":["createEntryResolver","createFileTransform","createGlobFilter","debug","require","escapeXMLCharacters","original","noAmps","replace","noLt","noGt","noApos","Transformer","Minipass","constructor","settings","data","write","getNormalizedName","includes","extension","name","end","replaced","IOSConfig","XcodeUtils","sanitizedName","toLowerCase","entry","path","type","test","basename","extname","undefined","globPattern","options","matcher","picomatch","Array","isArray","join","included"],"mappings":"AAAA;;;;QA8CgBA,mBAAmB,GAAnBA,mBAAmB;QAqBnBC,mBAAmB,GAAnBA,mBAAmB;QA+BnBC,gBAAgB,GAAhBA,gBAAgB;AAlGN,IAAA,cAAsB,WAAtB,sBAAsB,CAAA;AAC3B,IAAA,SAAU,kCAAV,UAAU,EAAA;AACd,IAAA,KAAM,kCAAN,MAAM,EAAA;AACD,IAAA,UAAW,kCAAX,WAAW,EAAA;;;;;;AAGjC,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,AAAsB,AAAC;AAE5E,SAASC,mBAAmB,CAACC,QAAgB,EAAU;IACrD,MAAMC,MAAM,GAAGD,QAAQ,CAACE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,AAAC;IAC9C,MAAMC,IAAI,GAAGF,MAAM,CAACC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,AAAC;IACzC,MAAME,IAAI,GAAGD,IAAI,CAACD,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,AAAC;IACvC,MAAMG,MAAM,GAAGD,IAAI,CAACF,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,AAAC;IACxC,OAAOG,MAAM,CAACH,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;CACnC;AAED,MAAMI,WAAW,SAASC,SAAQ,QAAA;IAGhCC,YAAoBC,QAA6C,CAAE;QACjE,KAAK,EAAE,CAAC;aADUA,QAA6C,GAA7CA,QAA6C;aAFjEC,IAAI,GAAG,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CAAC;IAEF,OAAO,CAACP,IAAY,GAAK;QACvB,MAAMa,QAAQ,GAAGL,OAAO,CAACR,IAAI,CAAC,AAAC;QAC/B1B,KAAK,CAAC,iBAAiB,EAAEuC,QAAQ,GAAG,SAAS,GAAG,SAAS,EAAEb,IAAI,CAAC,CAAC;QACjE,OAAOa,QAAQ,CAAC;KACjB,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.17.4",
3
+ "version": "0.17.6",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -103,6 +103,7 @@
103
103
  "send": "^0.18.0",
104
104
  "slugify": "^1.3.4",
105
105
  "source-map-support": "~0.5.21",
106
+ "stacktrace-parser": "^0.1.10",
106
107
  "structured-headers": "^0.4.1",
107
108
  "tar": "^6.0.5",
108
109
  "temp-dir": "^2.0.0",
@@ -167,5 +168,5 @@
167
168
  "tree-kill": "^1.2.2",
168
169
  "tsd": "^0.28.1"
169
170
  },
170
- "gitHead": "9e4890b069b18598ea429734b5114b40e3afeabb"
171
+ "gitHead": "e94e2aac39cbb7f8788869cd6798bbdeadc58f42"
171
172
  }