@expo/cli 55.0.18 → 55.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bin/cli +1 -1
- package/build/metro-require/require.js +4 -4
- package/build/src/events/index.js +1 -1
- package/build/src/export/createMetadataJson.js +7 -2
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +3 -2
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/exportApp.js +6 -4
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/run/android/runAndroidAsync.js.map +1 -1
- package/build/src/run/ios/launchApp.js +1 -1
- package/build/src/run/ios/launchApp.js.map +1 -1
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +3 -2
- package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
- package/build/src/start/platforms/android/AndroidPlatformManager.js.map +1 -1
- package/build/src/start/platforms/ios/ApplePlatformManager.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +18 -4
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js +72 -15
- package/build/src/start/server/metro/dev-server/createMetroMiddleware.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +1 -0
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +36 -8
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js +0 -3
- package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
- package/build/src/utils/resolveWatchFolders.js +67 -0
- package/build/src/utils/resolveWatchFolders.js.map +1 -0
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/DomComponentsMiddleware.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createBundleUrlPath, ExpoMetroOptions } from './metroOptions';\nimport type { ServerRequest, ServerResponse } from './server.types';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/DomComponentsMiddleware.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createBundleUrlPath, ExpoMetroOptions } from './metroOptions';\nimport type { ServerRequest, ServerResponse } from './server.types';\nimport { toPosixPath } from '../../../utils/filePath';\nimport { memoize } from '../../../utils/fn';\nimport { fileURLToFilePath } from '../metro/createServerComponentsMiddleware';\n\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const DOM_COMPONENTS_BUNDLE_DIR = 'www.bundle';\n\nconst checkWebViewInstalled = memoize((projectRoot: string) => {\n const webViewInstalled =\n resolveFrom.silent(projectRoot, 'react-native-webview') ||\n resolveFrom.silent(projectRoot, '@expo/dom-webview');\n if (!webViewInstalled) {\n throw new Error(\n `To use DOM Components, you must install the 'react-native-webview' package. Run 'npx expo install react-native-webview' to install it.`\n );\n }\n});\n\ntype CreateDomComponentsMiddlewareOptions = {\n /** The absolute metro or server root, used to calculate the relative dom entry path */\n metroRoot: string;\n /** The absolute project root, used to resolve the `expo/dom/entry.js` path */\n projectRoot: string;\n};\n\nexport function createDomComponentsMiddleware(\n { metroRoot, projectRoot }: CreateDomComponentsMiddlewareOptions,\n instanceMetroOptions: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'platform' | 'bytecode'>\n) {\n return (req: ServerRequest, res: ServerResponse, next: (err?: Error) => void) => {\n if (!req.url) return next();\n\n const url = coerceUrl(req.url);\n\n // Match `/_expo/@dom`.\n // This URL can contain additional paths like `/_expo/@dom/foo.js?file=...` to help the Safari dev tools.\n if (!url.pathname.startsWith('/_expo/@dom')) {\n return next();\n }\n\n const file = url.searchParams.get('file');\n\n if (!file || !file.startsWith('file://')) {\n res.statusCode = 400;\n res.statusMessage = 'Invalid file path: ' + file;\n return res.end();\n }\n\n checkWebViewInstalled(projectRoot);\n\n // Generate a unique entry file for the webview.\n const generatedEntry = toPosixPath(file.startsWith('file://') ? fileURLToFilePath(file) : file);\n const virtualEntry = toPosixPath(resolveFrom(projectRoot, 'expo/dom/entry.js'));\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport = './' + path.posix.relative(path.dirname(virtualEntry), generatedEntry);\n // Create the script URL\n const requestUrlBase = `http://${req.headers.host}`;\n const metroUrl = new URL(\n createBundleUrlPath({\n ...instanceMetroOptions,\n domRoot: encodeURI(relativeImport),\n baseUrl: '/',\n mainModuleName: path.relative(metroRoot, virtualEntry),\n bytecode: false,\n platform: 'web',\n isExporting: false,\n engine: 'hermes',\n // Required for ensuring bundler errors are caught in the root entry / async boundary and can be recovered from automatically.\n lazy: true,\n }),\n requestUrlBase\n ).toString();\n\n res.statusCode = 200;\n // Return HTML file\n res.setHeader('Content-Type', 'text/html');\n\n res.end(\n // Create the entry HTML file.\n getDomComponentHtml(metroUrl, { title: path.basename(file) })\n );\n };\n}\n\nfunction coerceUrl(url: string) {\n try {\n return new URL(url);\n } catch {\n return new URL(url, 'https://localhost:0');\n }\n}\n\nexport function getDomComponentHtml(src?: string, { title }: { title?: string } = {}) {\n // This HTML is not optimized for `react-native-web` since DOM Components are meant for general React DOM web development.\n return `\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\" />\n <meta httpEquiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">\n ${title ? `<title>${title}</title>` : ''}\n <style id=\"expo-dom-component-style\">\n /* These styles make the body full-height */\n html,\n body {\n -webkit-overflow-scrolling: touch; /* Enables smooth momentum scrolling */\n }\n /* These styles make the root element full-height */\n #root {\n display: flex;\n flex: 1;\n }\n </style>\n </head>\n <body>\n <noscript>DOM Components require <code>javaScriptEnabled</code></noscript>\n <!-- Root element for the DOM component. -->\n <div id=\"root\"></div>\n ${src ? `<script crossorigin src=\"${src.replace(/^https?:/, '')}\"></script>` : ''}\n </body>\n</html>`;\n}\n"],"names":["DOM_COMPONENTS_BUNDLE_DIR","createDomComponentsMiddleware","getDomComponentHtml","checkWebViewInstalled","memoize","projectRoot","webViewInstalled","resolveFrom","silent","Error","metroRoot","instanceMetroOptions","req","res","next","url","coerceUrl","pathname","startsWith","file","searchParams","get","statusCode","statusMessage","end","generatedEntry","toPosixPath","fileURLToFilePath","virtualEntry","relativeImport","path","posix","relative","dirname","requestUrlBase","headers","host","metroUrl","URL","createBundleUrlPath","domRoot","encodeURI","baseUrl","mainModuleName","bytecode","platform","isExporting","engine","lazy","toString","setHeader","title","basename","src","replace"],"mappings":";;;;;;;;;;;IAWaA,yBAAyB;eAAzBA;;IAoBGC,6BAA6B;eAA7BA;;IAmEAC,mBAAmB;eAAnBA;;;;gEAlGC;;;;;;;gEACO;;;;;;8BAE8B;0BAE1B;oBACJ;kDACU;;;;;;AAI3B,MAAMF,4BAA4B;AAEzC,MAAMG,wBAAwBC,IAAAA,WAAO,EAAC,CAACC;IACrC,MAAMC,mBACJC,sBAAW,CAACC,MAAM,CAACH,aAAa,2BAChCE,sBAAW,CAACC,MAAM,CAACH,aAAa;IAClC,IAAI,CAACC,kBAAkB;QACrB,MAAM,IAAIG,MACR,CAAC,sIAAsI,CAAC;IAE5I;AACF;AASO,SAASR,8BACd,EAAES,SAAS,EAAEL,WAAW,EAAwC,EAChEM,oBAA+F;IAE/F,OAAO,CAACC,KAAoBC,KAAqBC;QAC/C,IAAI,CAACF,IAAIG,GAAG,EAAE,OAAOD;QAErB,MAAMC,MAAMC,UAAUJ,IAAIG,GAAG;QAE7B,uBAAuB;QACvB,yGAAyG;QACzG,IAAI,CAACA,IAAIE,QAAQ,CAACC,UAAU,CAAC,gBAAgB;YAC3C,OAAOJ;QACT;QAEA,MAAMK,OAAOJ,IAAIK,YAAY,CAACC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G,CAAC,CAAC;IAClF,0HAA0H;IAC1H,OAAO,CAAC;;;;;;;QAOF,EAAEA,QAAQ,CAAC,OAAO,EAAEA,MAAM,QAAQ,CAAC,GAAG,GAAG;;;;;;;;;;;;;;;;;;QAkBzC,EAAEE,MAAM,CAAC,yBAAyB,EAAEA,IAAIC,OAAO,CAAC,YAAY,IAAI,WAAW,CAAC,GAAG,GAAG;;OAEnF,CAAC;AACR"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "resolveWatchFolders", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return resolveWatchFolders;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function _nodepath() {
|
|
12
|
+
const data = /*#__PURE__*/ _interop_require_default(require("node:path"));
|
|
13
|
+
_nodepath = function() {
|
|
14
|
+
return data;
|
|
15
|
+
};
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
18
|
+
function _interop_require_default(obj) {
|
|
19
|
+
return obj && obj.__esModule ? obj : {
|
|
20
|
+
default: obj
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
// NOTE(@kitten): This is a heuristic and shouldn't trigger. However, if we erroneously start the watch folders
|
|
24
|
+
// traversal, we never want to create a situation where (for whatever reason) it gets stuck,
|
|
25
|
+
// or slows the startup down by an unreasonable amount
|
|
26
|
+
const MAX_DEPTH = 6;
|
|
27
|
+
function resolveWatchFolders(pkgName, { deep }) {
|
|
28
|
+
const seen = new Set();
|
|
29
|
+
const folders = new Set();
|
|
30
|
+
const recurse = (pkgName, fromPath = undefined, depth = 0)=>{
|
|
31
|
+
if (seen.has(pkgName) || depth > MAX_DEPTH) {
|
|
32
|
+
return;
|
|
33
|
+
} else {
|
|
34
|
+
seen.add(pkgName);
|
|
35
|
+
}
|
|
36
|
+
let target;
|
|
37
|
+
try {
|
|
38
|
+
target = require.resolve(`${pkgName}/package.json`, {
|
|
39
|
+
paths: fromPath ? [
|
|
40
|
+
fromPath
|
|
41
|
+
] : undefined
|
|
42
|
+
});
|
|
43
|
+
} catch {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let folder = _nodepath().default.dirname(_nodepath().default.dirname(target));
|
|
47
|
+
if (pkgName[0] === '@') {
|
|
48
|
+
folder = _nodepath().default.dirname(folder);
|
|
49
|
+
}
|
|
50
|
+
folders.add(folder);
|
|
51
|
+
if (deep) {
|
|
52
|
+
const pkg = require(target);
|
|
53
|
+
if (pkg.dependencies != null && typeof pkg.dependencies === 'object') {
|
|
54
|
+
for(const pkgName in pkg.dependencies)recurse(pkgName, target, depth + 1);
|
|
55
|
+
}
|
|
56
|
+
if (pkg.peerDependencies != null && typeof pkg.peerDependencies === 'object') {
|
|
57
|
+
for(const pkgName in pkg.peerDependencies)recurse(pkgName, target, depth + 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
recurse(pkgName);
|
|
62
|
+
return [
|
|
63
|
+
...folders
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=resolveWatchFolders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/resolveWatchFolders.ts"],"sourcesContent":["import path from 'node:path';\n\n// NOTE(@kitten): This is a heuristic and shouldn't trigger. However, if we erroneously start the watch folders\n// traversal, we never want to create a situation where (for whatever reason) it gets stuck,\n// or slows the startup down by an unreasonable amount\nconst MAX_DEPTH = 6;\n\nexport function resolveWatchFolders(pkgName: string, { deep }: { deep: boolean }): string[] {\n const seen = new Set<string>();\n const folders = new Set<string>();\n const recurse = (pkgName: string, fromPath: string | undefined = undefined, depth = 0) => {\n if (seen.has(pkgName) || depth > MAX_DEPTH) {\n return;\n } else {\n seen.add(pkgName);\n }\n let target: string;\n try {\n target = require.resolve(`${pkgName}/package.json`, {\n paths: fromPath ? [fromPath] : undefined,\n });\n } catch {\n return;\n }\n let folder = path.dirname(path.dirname(target));\n if (pkgName[0] === '@') {\n folder = path.dirname(folder);\n }\n folders.add(folder);\n if (deep) {\n const pkg = require(target);\n if (pkg.dependencies != null && typeof pkg.dependencies === 'object') {\n for (const pkgName in pkg.dependencies) recurse(pkgName, target, depth + 1);\n }\n if (pkg.peerDependencies != null && typeof pkg.peerDependencies === 'object') {\n for (const pkgName in pkg.peerDependencies) recurse(pkgName, target, depth + 1);\n }\n }\n };\n recurse(pkgName);\n return [...folders];\n}\n"],"names":["resolveWatchFolders","MAX_DEPTH","pkgName","deep","seen","Set","folders","recurse","fromPath","undefined","depth","has","add","target","require","resolve","paths","folder","path","dirname","pkg","dependencies","peerDependencies"],"mappings":";;;;+BAOgBA;;;eAAAA;;;;gEAPC;;;;;;;;;;;AAEjB,+GAA+G;AAC/G,4FAA4F;AAC5F,sDAAsD;AACtD,MAAMC,YAAY;AAEX,SAASD,oBAAoBE,OAAe,EAAE,EAAEC,IAAI,EAAqB;IAC9E,MAAMC,OAAO,IAAIC;IACjB,MAAMC,UAAU,IAAID;IACpB,MAAME,UAAU,CAACL,SAAiBM,WAA+BC,SAAS,EAAEC,QAAQ,CAAC;QACnF,IAAIN,KAAKO,GAAG,CAACT,YAAYQ,QAAQT,WAAW;YAC1C;QACF,OAAO;YACLG,KAAKQ,GAAG,CAACV;QACX;QACA,IAAIW;QACJ,IAAI;YACFA,SAASC,QAAQC,OAAO,CAAC,GAAGb,QAAQ,aAAa,CAAC,EAAE;gBAClDc,OAAOR,WAAW;oBAACA;iBAAS,GAAGC;YACjC;QACF,EAAE,OAAM;YACN;QACF;QACA,IAAIQ,SAASC,mBAAI,CAACC,OAAO,CAACD,mBAAI,CAACC,OAAO,CAACN;QACvC,IAAIX,OAAO,CAAC,EAAE,KAAK,KAAK;YACtBe,SAASC,mBAAI,CAACC,OAAO,CAACF;QACxB;QACAX,QAAQM,GAAG,CAACK;QACZ,IAAId,MAAM;YACR,MAAMiB,MAAMN,QAAQD;YACpB,IAAIO,IAAIC,YAAY,IAAI,QAAQ,OAAOD,IAAIC,YAAY,KAAK,UAAU;gBACpE,IAAK,MAAMnB,WAAWkB,IAAIC,YAAY,CAAEd,QAAQL,SAASW,QAAQH,QAAQ;YAC3E;YACA,IAAIU,IAAIE,gBAAgB,IAAI,QAAQ,OAAOF,IAAIE,gBAAgB,KAAK,UAAU;gBAC5E,IAAK,MAAMpB,WAAWkB,IAAIE,gBAAgB,CAAEf,QAAQL,SAASW,QAAQH,QAAQ;YAC/E;QACF;IACF;IACAH,QAAQL;IACR,OAAO;WAAII;KAAQ;AACrB"}
|
|
@@ -26,7 +26,7 @@ class FetchClient {
|
|
|
26
26
|
this.headers = {
|
|
27
27
|
accept: 'application/json',
|
|
28
28
|
'content-type': 'application/json',
|
|
29
|
-
'user-agent': `expo-cli/${"55.0.
|
|
29
|
+
'user-agent': `expo-cli/${"55.0.19"}`,
|
|
30
30
|
authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
|
|
31
31
|
};
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.19",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/cli",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@expo/code-signing-certificates": "^0.0.6",
|
|
44
|
-
"@expo/config": "~55.0.
|
|
44
|
+
"@expo/config": "~55.0.11",
|
|
45
45
|
"@expo/config-plugins": "~55.0.7",
|
|
46
46
|
"@expo/devcert": "^1.2.1",
|
|
47
47
|
"@expo/env": "~2.1.1",
|
|
48
48
|
"@expo/image-utils": "^0.8.12",
|
|
49
49
|
"@expo/json-file": "^10.0.12",
|
|
50
|
-
"@expo/log-box": "55.0.
|
|
50
|
+
"@expo/log-box": "55.0.8",
|
|
51
51
|
"@expo/metro": "~54.2.0",
|
|
52
52
|
"@expo/metro-config": "~55.0.11",
|
|
53
53
|
"@expo/osascript": "^2.4.2",
|
|
54
54
|
"@expo/package-manager": "^1.10.3",
|
|
55
55
|
"@expo/plist": "^0.5.2",
|
|
56
|
-
"@expo/prebuild-config": "^55.0.
|
|
56
|
+
"@expo/prebuild-config": "^55.0.11",
|
|
57
57
|
"@expo/require-utils": "^55.0.3",
|
|
58
58
|
"@expo/router-server": "^55.0.11",
|
|
59
59
|
"@expo/schema-utils": "^55.0.2",
|
|
60
60
|
"@expo/spawn-async": "^1.7.2",
|
|
61
61
|
"@expo/ws-tunnel": "^1.0.1",
|
|
62
62
|
"@expo/xcpretty": "^4.4.0",
|
|
63
|
-
"@react-native/dev-middleware": "0.83.
|
|
63
|
+
"@react-native/dev-middleware": "0.83.4",
|
|
64
64
|
"accepts": "^1.3.8",
|
|
65
65
|
"arg": "^5.0.2",
|
|
66
66
|
"better-opn": "~3.0.2",
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"tree-kill": "^1.2.2",
|
|
159
159
|
"tsd": "^0.28.1"
|
|
160
160
|
},
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "f63217deac00dcd278f75d9846933c11e5c6f9a3"
|
|
162
162
|
}
|