@expo/config
Advanced tools
Comparing version 9.1.0-canary-20240719-83ee47b to 9.1.0-canary-20240814-ce0f7d5
@@ -10,1 +10,12 @@ import { PackageJSONConfig } from '../Config.types'; | ||
export declare function getFileWithExtensions(fromDirectory: string, moduleId: string, extensions: string[]): string | null; | ||
/** | ||
* Convert an absolute entry point to a server or project root relative filepath. | ||
* This is useful on Android where the entry point is an absolute path. | ||
*/ | ||
export declare function convertEntryPointToRelative(projectRoot: string, absolutePath: string): string; | ||
/** | ||
* Resolve the entry point relative to either the server or project root. | ||
* This relative entry path should be used to pass non-absolute paths to Metro, | ||
* accounting for possible monorepos and keeping the cache sharable (no absolute paths). | ||
*/ | ||
export declare const resolveRelativeEntryPoint: typeof resolveEntryPoint; |
@@ -6,2 +6,3 @@ "use strict"; | ||
}); | ||
exports.convertEntryPointToRelative = convertEntryPointToRelative; | ||
exports.ensureSlash = ensureSlash; | ||
@@ -11,2 +12,3 @@ exports.getFileWithExtensions = getFileWithExtensions; | ||
exports.resolveEntryPoint = resolveEntryPoint; | ||
exports.resolveRelativeEntryPoint = void 0; | ||
function _fs() { | ||
@@ -33,2 +35,9 @@ const data = _interopRequireDefault(require("fs")); | ||
} | ||
function _env() { | ||
const data = require("./env"); | ||
_env = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _extensions() { | ||
@@ -41,2 +50,9 @@ const data = require("./extensions"); | ||
} | ||
function _workspaces() { | ||
const data = require("./workspaces"); | ||
_workspaces = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _Config() { | ||
@@ -61,3 +77,3 @@ const data = require("../Config"); | ||
if (hasSlash && !needsSlash) { | ||
return inputPath.substr(0, inputPath.length - 1); | ||
return inputPath.substring(0, inputPath.length - 1); | ||
} else if (!hasSlash && needsSlash) { | ||
@@ -140,2 +156,30 @@ return `${inputPath}/`; | ||
} | ||
/** Get the Metro server root, when working in monorepos */ | ||
function getMetroServerRoot(projectRoot) { | ||
if (_env().env.EXPO_NO_METRO_WORKSPACE_ROOT) { | ||
return projectRoot; | ||
} | ||
return (0, _workspaces().findWorkspaceRoot)(projectRoot) ?? projectRoot; | ||
} | ||
/** | ||
* Convert an absolute entry point to a server or project root relative filepath. | ||
* This is useful on Android where the entry point is an absolute path. | ||
*/ | ||
function convertEntryPointToRelative(projectRoot, absolutePath) { | ||
// The project root could be using a different root on MacOS (`/var` vs `/private/var`) | ||
// We need to make sure to get the non-symlinked path to the server or project root. | ||
return _path().default.relative(_fs().default.realpathSync(getMetroServerRoot(projectRoot)), _fs().default.realpathSync(absolutePath)); | ||
} | ||
/** | ||
* Resolve the entry point relative to either the server or project root. | ||
* This relative entry path should be used to pass non-absolute paths to Metro, | ||
* accounting for possible monorepos and keeping the cache sharable (no absolute paths). | ||
*/ | ||
const resolveRelativeEntryPoint = (projectRoot, options) => { | ||
return convertEntryPointToRelative(projectRoot, resolveEntryPoint(projectRoot, options)); | ||
}; | ||
exports.resolveRelativeEntryPoint = resolveRelativeEntryPoint; | ||
//# sourceMappingURL=paths.js.map |
{ | ||
"name": "@expo/config", | ||
"version": "9.1.0-canary-20240719-83ee47b", | ||
"version": "9.1.0-canary-20240814-ce0f7d5", | ||
"description": "A library for interacting with the app.json", | ||
@@ -37,5 +37,6 @@ "main": "build/index.js", | ||
"@babel/code-frame": "~7.10.4", | ||
"@expo/config-plugins": "8.0.9-canary-20240719-83ee47b", | ||
"@expo/config-types": "52.0.0-canary-20240719-83ee47b", | ||
"@expo/json-file": "8.3.4-canary-20240719-83ee47b", | ||
"@expo/config-plugins": "8.0.9-canary-20240814-ce0f7d5", | ||
"@expo/config-types": "52.0.0-canary-20240814-ce0f7d5", | ||
"@expo/json-file": "8.3.4-canary-20240814-ce0f7d5", | ||
"find-yarn-workspace-root": "^2.0.0", | ||
"getenv": "^1.0.0", | ||
@@ -51,3 +52,3 @@ "glob": "^10.4.2", | ||
"@types/require-from-string": "^1.2.1", | ||
"expo-module-scripts": "3.6.0-canary-20240719-83ee47b" | ||
"expo-module-scripts": "3.6.0-canary-20240814-ce0f7d5" | ||
}, | ||
@@ -57,3 +58,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "83ee47b5c89c7f1b1a5101189580eaf3555f5962" | ||
"gitHead": "ce0f7d5c7eaec2c8d06ee4e0dc0e58cd6c1612ed" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
160377
62
1924
12
+ Added@expo/config-plugins@8.0.9-canary-20240814-ce0f7d5(transitive)
+ Added@expo/config-types@52.0.0-canary-20240814-ce0f7d5(transitive)
+ Added@expo/json-file@8.3.4-canary-20240814-ce0f7d5(transitive)
+ Added@expo/plist@0.1.4-canary-20240814-ce0f7d5(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfind-yarn-workspace-root@2.0.0(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedto-regex-range@5.0.1(transitive)
- Removed@expo/config-plugins@8.0.9-canary-20240719-83ee47b(transitive)
- Removed@expo/config-types@52.0.0-canary-20240719-83ee47b(transitive)
- Removed@expo/json-file@8.3.4-canary-20240719-83ee47b(transitive)
- Removed@expo/plist@0.1.4-canary-20240719-83ee47b(transitive)