@vxrn/vite-plugin-metro 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.cjs +23 -1
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.native.cjs +28 -1
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.native.js +28 -1
- package/dist/cjs/metro-config/getMetroConfigFromViteConfig.native.js.map +1 -1
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.cjs +1 -1
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.native.cjs +1 -1
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.native.js +1 -1
- package/dist/cjs/rn-commands/bundle/buildBundleWithConfig.native.js.map +1 -1
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.mjs +24 -2
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.mjs.map +1 -1
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.native.js +29 -2
- package/dist/esm/metro-config/getMetroConfigFromViteConfig.native.js.map +1 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.mjs +1 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.mjs.map +1 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.native.js +1 -1
- package/dist/esm/rn-commands/bundle/buildBundleWithConfig.native.js.map +1 -1
- package/package.json +9 -7
- package/src/__tests__/getMetroConfigFromViteConfig.test.ts +166 -3
- package/src/metro-config/getMetroConfigFromViteConfig.ts +47 -23
- package/src/rn-commands/bundle/buildBundleWithConfig.ts +1 -1
- package/types/metro-config/getMetroConfigFromViteConfig.d.ts.map +1 -1
|
@@ -32,7 +32,10 @@ __export(getMetroConfigFromViteConfig_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(getMetroConfigFromViteConfig_exports);
|
|
33
33
|
var import_vite = require("vite");
|
|
34
34
|
var import_node_child_process = require("node:child_process");
|
|
35
|
+
var import_node_fs = require("node:fs");
|
|
35
36
|
var import_node_path = require("node:path");
|
|
37
|
+
var import_resolve_workspace_root = __toESM(require("resolve-workspace-root"), 1);
|
|
38
|
+
var import_tinyglobby = require("tinyglobby");
|
|
36
39
|
var import_micromatch = __toESM(require("micromatch"), 1);
|
|
37
40
|
var import_metro_config = require("@react-native/metro-config");
|
|
38
41
|
var import_compiler = require("@vxrn/compiler");
|
|
@@ -70,9 +73,28 @@ const metroWatchExclusions = [
|
|
|
70
73
|
function enforceWorkspaceVisibility(config, projectRoot) {
|
|
71
74
|
const workspaceRoot = (0, import_vite.searchForWorkspaceRoot)(projectRoot);
|
|
72
75
|
if (workspaceRoot === projectRoot) return config;
|
|
76
|
+
let packages = [];
|
|
77
|
+
try {
|
|
78
|
+
packages = (import_resolve_workspace_root.default.getWorkspaceGlobs(workspaceRoot) ?? []).flatMap((pattern) => (0, import_tinyglobby.globSync)(import_node_path.posix.join(pattern, "package.json"), {
|
|
79
|
+
cwd: workspaceRoot,
|
|
80
|
+
absolute: true,
|
|
81
|
+
expandDirectories: false,
|
|
82
|
+
caseSensitiveMatch: process.platform !== "darwin" && process.platform !== "win32",
|
|
83
|
+
ignore: ["**/@(Carthage|Pods|node_modules)/**"]
|
|
84
|
+
})).filter((manifest) => {
|
|
85
|
+
try {
|
|
86
|
+
JSON.parse((0, import_node_fs.readFileSync)(manifest, "utf8"));
|
|
87
|
+
return true;
|
|
88
|
+
} catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}).map((manifest) => (0, import_node_path.dirname)(manifest));
|
|
92
|
+
} catch {
|
|
93
|
+
packages = [];
|
|
94
|
+
}
|
|
73
95
|
return {
|
|
74
96
|
...config,
|
|
75
|
-
watchFolders: [.../* @__PURE__ */ new Set([...config.watchFolders ?? [], workspaceRoot])],
|
|
97
|
+
watchFolders: [.../* @__PURE__ */ new Set([...config.watchFolders ?? [], ...packages.length ? [(0, import_node_path.resolve)(workspaceRoot, "node_modules"), ...packages] : []])],
|
|
76
98
|
resolver: {
|
|
77
99
|
...config.resolver,
|
|
78
100
|
nodeModulesPaths: [.../* @__PURE__ */ new Set([
|
|
@@ -34,7 +34,10 @@ __export(getMetroConfigFromViteConfig_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(getMetroConfigFromViteConfig_exports);
|
|
35
35
|
var import_vite = require("vite");
|
|
36
36
|
var import_child_process = require("child_process");
|
|
37
|
+
var import_fs = require("fs");
|
|
37
38
|
var import_path = require("path");
|
|
39
|
+
var import_resolve_workspace_root = __toESM(require("resolve-workspace-root"), 1);
|
|
40
|
+
var import_tinyglobby = require("tinyglobby");
|
|
38
41
|
var import_micromatch = __toESM(require("micromatch"), 1);
|
|
39
42
|
var import_metro_config = require("@react-native/metro-config");
|
|
40
43
|
var import_compiler = require("@vxrn/compiler");
|
|
@@ -74,9 +77,33 @@ function enforceWorkspaceVisibility(config, projectRoot) {
|
|
|
74
77
|
var _config_resolver;
|
|
75
78
|
var workspaceRoot = (0, import_vite.searchForWorkspaceRoot)(projectRoot);
|
|
76
79
|
if (workspaceRoot === projectRoot) return config;
|
|
80
|
+
var packages = [];
|
|
81
|
+
try {
|
|
82
|
+
var _workspace_getWorkspaceGlobs;
|
|
83
|
+
packages = ((_workspace_getWorkspaceGlobs = import_resolve_workspace_root.default.getWorkspaceGlobs(workspaceRoot)) !== null && _workspace_getWorkspaceGlobs !== void 0 ? _workspace_getWorkspaceGlobs : []).flatMap(function(pattern) {
|
|
84
|
+
return (0, import_tinyglobby.globSync)(import_path.posix.join(pattern, "package.json"), {
|
|
85
|
+
cwd: workspaceRoot,
|
|
86
|
+
absolute: true,
|
|
87
|
+
expandDirectories: false,
|
|
88
|
+
caseSensitiveMatch: process.platform !== "darwin" && process.platform !== "win32",
|
|
89
|
+
ignore: ["**/@(Carthage|Pods|node_modules)/**"]
|
|
90
|
+
});
|
|
91
|
+
}).filter(function(manifest) {
|
|
92
|
+
try {
|
|
93
|
+
JSON.parse((0, import_fs.readFileSync)(manifest, "utf8"));
|
|
94
|
+
return true;
|
|
95
|
+
} catch (unused) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}).map(function(manifest) {
|
|
99
|
+
return (0, import_path.dirname)(manifest);
|
|
100
|
+
});
|
|
101
|
+
} catch (unused) {
|
|
102
|
+
packages = [];
|
|
103
|
+
}
|
|
77
104
|
return {
|
|
78
105
|
...config,
|
|
79
|
-
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], workspaceRoot])],
|
|
106
|
+
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], ...packages.length ? [(0, import_path.resolve)(workspaceRoot, "node_modules"), ...packages] : []])],
|
|
80
107
|
resolver: {
|
|
81
108
|
...config.resolver,
|
|
82
109
|
nodeModulesPaths: [.../* @__PURE__ */ new Set([
|
|
@@ -34,7 +34,10 @@ __export(getMetroConfigFromViteConfig_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(getMetroConfigFromViteConfig_exports);
|
|
35
35
|
var import_vite = require("vite");
|
|
36
36
|
var import_child_process = require("child_process");
|
|
37
|
+
var import_fs = require("fs");
|
|
37
38
|
var import_path = require("path");
|
|
39
|
+
var import_resolve_workspace_root = __toESM(require("resolve-workspace-root"), 1);
|
|
40
|
+
var import_tinyglobby = require("tinyglobby");
|
|
38
41
|
var import_micromatch = __toESM(require("micromatch"), 1);
|
|
39
42
|
var import_metro_config = require("@react-native/metro-config");
|
|
40
43
|
var import_compiler = require("@vxrn/compiler");
|
|
@@ -74,9 +77,33 @@ function enforceWorkspaceVisibility(config, projectRoot) {
|
|
|
74
77
|
var _config_resolver;
|
|
75
78
|
var workspaceRoot = (0, import_vite.searchForWorkspaceRoot)(projectRoot);
|
|
76
79
|
if (workspaceRoot === projectRoot) return config;
|
|
80
|
+
var packages = [];
|
|
81
|
+
try {
|
|
82
|
+
var _workspace_getWorkspaceGlobs;
|
|
83
|
+
packages = ((_workspace_getWorkspaceGlobs = import_resolve_workspace_root.default.getWorkspaceGlobs(workspaceRoot)) !== null && _workspace_getWorkspaceGlobs !== void 0 ? _workspace_getWorkspaceGlobs : []).flatMap(function(pattern) {
|
|
84
|
+
return (0, import_tinyglobby.globSync)(import_path.posix.join(pattern, "package.json"), {
|
|
85
|
+
cwd: workspaceRoot,
|
|
86
|
+
absolute: true,
|
|
87
|
+
expandDirectories: false,
|
|
88
|
+
caseSensitiveMatch: process.platform !== "darwin" && process.platform !== "win32",
|
|
89
|
+
ignore: ["**/@(Carthage|Pods|node_modules)/**"]
|
|
90
|
+
});
|
|
91
|
+
}).filter(function(manifest) {
|
|
92
|
+
try {
|
|
93
|
+
JSON.parse((0, import_fs.readFileSync)(manifest, "utf8"));
|
|
94
|
+
return true;
|
|
95
|
+
} catch (unused) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}).map(function(manifest) {
|
|
99
|
+
return (0, import_path.dirname)(manifest);
|
|
100
|
+
});
|
|
101
|
+
} catch (unused) {
|
|
102
|
+
packages = [];
|
|
103
|
+
}
|
|
77
104
|
return {
|
|
78
105
|
...config,
|
|
79
|
-
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], workspaceRoot])],
|
|
106
|
+
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], ...packages.length ? [(0, import_path.resolve)(workspaceRoot, "node_modules"), ...packages] : []])],
|
|
80
107
|
resolver: {
|
|
81
108
|
...config.resolver,
|
|
82
109
|
nodeModulesPaths: [.../* @__PURE__ */ new Set([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetroConfigFromViteConfig.native.js","names":[],"sources":["cjs/metro-config/getMetroConfigFromViteConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getMetroConfigFromViteConfig_exports = {};\n__export(getMetroConfigFromViteConfig_exports, {\n buildMetroConfigInputFromViteConfig: () => buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig: () => getMetroConfigFromViteConfig\n});\nmodule.exports = __toCommonJS(getMetroConfigFromViteConfig_exports);\nvar import_vite = require(\"vite\");\nvar import_child_process = require(\"child_process\");\nvar import_path = require(\"path\");\nvar import_micromatch = __toESM(require(\"micromatch\"), 1);\nvar import_metro_config = require(\"@react-native/metro-config\");\nvar import_compiler = require(\"@vxrn/compiler\");\nvar import_desktopReactNativeResolve = require(\"@vxrn/utils/desktopReactNativeResolve\");\nvar import_projectImport = require(\"../utils/projectImport\");\nvar import_getTerminalReporter = require(\"../utils/getTerminalReporter\");\nvar WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nvar expoEnvAdditionalExts = [\n \"env\",\n \"local\",\n \"development\"\n];\nvar metroSourceExts = [\n \"js\",\n \"jsx\",\n \"json\",\n \"ts\",\n \"tsx\",\n \"mjs\",\n \"cjs\",\n \"swift\",\n \"kt\"\n];\nvar watchmanResponsivePromises = /* @__PURE__ */ new Map();\nvar didWarnAboutWatchmanFallback = false;\nvar rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nvar expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nvar metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n var _config_watchFolders, _ref;\n var _config_resolver;\n var workspaceRoot = (0, import_vite.searchForWorkspaceRoot)(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n return {\n ...config,\n watchFolders: [\n .../* @__PURE__ */ new Set([\n ...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [],\n workspaceRoot\n ])\n ],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.nodeModulesPaths) !== null && _ref !== void 0 ? _ref : [],\n (0, import_path.resolve)(projectRoot, \"node_modules\"),\n (0, import_path.resolve)(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n var _ref;\n var _config_resolver;\n var config = enforceWorkspaceVisibility((0, import_metro_config.getDefaultConfig)(projectRoot), projectRoot);\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.assetExts) !== null && _ref !== void 0 ? _ref : [],\n \"glb\"\n ])\n ]\n }\n };\n}\nvar oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n var file = (0, import_desktopReactNativeResolve.desktopReactNativeFile)(origin, moduleName, oneRootFor(projectRoot, platform), platform);\n if (!file) return null;\n return {\n type: \"sourceFile\",\n filePath: file\n };\n}\nfunction oneRootFor(projectRoot, platform) {\n var root = oneRoots.get(projectRoot);\n if (!root) {\n root = (0, import_desktopReactNativeResolve.requireOnePackageRoot)(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n var _url_match;\n var platform = (_url_match = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)) === null || _url_match === void 0 ? void 0 : _url_match[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\") return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n var resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(rootIndexBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n }\n return url.replace(expoVirtualEntryBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n var _config_resolver;\n var dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n var rootOrigin = (0, import_path.resolve)(projectRoot, \"package.json\");\n var innerResolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n var request = bareMain !== null && bareMain !== void 0 ? bareMain : moduleName;\n var packageEnd = request.indexOf(\"/\", request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0);\n var packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n var resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? {\n ...context,\n originModulePath: rootOrigin\n } : context;\n var resolveRequest2 = innerResolveRequest || context.resolveRequest;\n return resolveRequest2(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n var probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise(function(resolve2) {\n var settled = false;\n var finish = function finish2(value) {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n var child = (0, import_child_process.spawn)(\"watchman\", [\n \"watch-project\",\n projectRoot\n ], {\n stdio: \"ignore\"\n });\n var timeout = setTimeout(function() {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", function() {\n finish(false);\n });\n child.once(\"exit\", function(code) {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n var userBabelConfigPath = projectRoot ? (0, import_compiler.findUserBabelConfig)(projectRoot) : null;\n var hasUserBabelConfig = Boolean(userBabelConfigPath);\n var isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(`[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`);\n }\n return {\n isNativeTransforms,\n userBabelConfigPath\n };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = (0, import_path.resolve)((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (import_micromatch.default.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await (0, import_getTerminalReporter.getTerminalReporter)(projectRoot)\n };\n var merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(enforceWorkspaceVisibility(merged, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = (0, import_path.resolve)((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var { loadConfig } = await (0, import_projectImport.projectImport)(projectRoot, \"metro\");\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (import_micromatch.default.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await (0, import_getTerminalReporter.getTerminalReporter)(projectRoot)\n };\n var metroConfig = await loadConfig({\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n }, {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n });\n return {\n ...enforcePackageResolution(enforceWorkspaceVisibility(metroConfig, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n ...extraConfig\n };\n}\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AA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pB,iBAAiB,iBACnB,IAAI,CAAC;EACL,UAAU,OAAO,GAAG,2BAA2B,oBAAmB,CAAE,WAAW;CACjF;CACA,IAAI,cAAc,MAAM,WAAW;EACjC,KAAK;EACL;EACA,eAAe,CAAC,CAAC,QAAQ,IAAI;EAC7B,GAAG;CACL,GAAG;EACD,GAAG;EACH,GAAG,OAAO,2BAA2B,aAAa,uBAAuB,aAAa,IAAI;CAC5F,CAAC;CACD,OAAO;EACL,GAAG,yBAAyB,2BAA2B,aAAa,WAAW,GAAG,iBAAiB,SAAS,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,YAAY,QAAQ,UAAU,KAAK,IAAI,QAAQ,CAAC,GAAG,WAAW;EAC9Q,GAAG;CACL;AACF"}
|
|
1
|
+
{"version":3,"file":"getMetroConfigFromViteConfig.native.js","names":[],"sources":["cjs/metro-config/getMetroConfigFromViteConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar getMetroConfigFromViteConfig_exports = {};\n__export(getMetroConfigFromViteConfig_exports, {\n buildMetroConfigInputFromViteConfig: () => buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig: () => getMetroConfigFromViteConfig\n});\nmodule.exports = __toCommonJS(getMetroConfigFromViteConfig_exports);\nvar import_vite = require(\"vite\");\nvar import_child_process = require(\"child_process\");\nvar import_fs = require(\"fs\");\nvar import_path = require(\"path\");\nvar import_resolve_workspace_root = __toESM(require(\"resolve-workspace-root\"), 1);\nvar import_tinyglobby = require(\"tinyglobby\");\nvar import_micromatch = __toESM(require(\"micromatch\"), 1);\nvar import_metro_config = require(\"@react-native/metro-config\");\nvar import_compiler = require(\"@vxrn/compiler\");\nvar import_desktopReactNativeResolve = require(\"@vxrn/utils/desktopReactNativeResolve\");\nvar import_projectImport = require(\"../utils/projectImport\");\nvar import_getTerminalReporter = require(\"../utils/getTerminalReporter\");\nvar WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nvar expoEnvAdditionalExts = [\n \"env\",\n \"local\",\n \"development\"\n];\nvar metroSourceExts = [\n \"js\",\n \"jsx\",\n \"json\",\n \"ts\",\n \"tsx\",\n \"mjs\",\n \"cjs\",\n \"swift\",\n \"kt\"\n];\nvar watchmanResponsivePromises = /* @__PURE__ */ new Map();\nvar didWarnAboutWatchmanFallback = false;\nvar rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nvar expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nvar metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n var _config_watchFolders, _ref;\n var _config_resolver;\n var workspaceRoot = (0, import_vite.searchForWorkspaceRoot)(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n var packages = [];\n try {\n var _workspace_getWorkspaceGlobs;\n packages = ((_workspace_getWorkspaceGlobs = import_resolve_workspace_root.default.getWorkspaceGlobs(workspaceRoot)) !== null && _workspace_getWorkspaceGlobs !== void 0 ? _workspace_getWorkspaceGlobs : []).flatMap(function(pattern) {\n return (0, import_tinyglobby.globSync)(import_path.posix.join(pattern, \"package.json\"), {\n cwd: workspaceRoot,\n absolute: true,\n expandDirectories: false,\n caseSensitiveMatch: process.platform !== \"darwin\" && process.platform !== \"win32\",\n ignore: [\n \"**/@(Carthage|Pods|node_modules)/**\"\n ]\n });\n }).filter(function(manifest) {\n try {\n JSON.parse((0, import_fs.readFileSync)(manifest, \"utf8\"));\n return true;\n } catch (unused) {\n return false;\n }\n }).map(function(manifest) {\n return (0, import_path.dirname)(manifest);\n });\n } catch (unused) {\n packages = [];\n }\n return {\n ...config,\n watchFolders: [\n .../* @__PURE__ */ new Set([\n ...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [],\n ...packages.length ? [\n (0, import_path.resolve)(workspaceRoot, \"node_modules\"),\n ...packages\n ] : []\n ])\n ],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.nodeModulesPaths) !== null && _ref !== void 0 ? _ref : [],\n (0, import_path.resolve)(projectRoot, \"node_modules\"),\n (0, import_path.resolve)(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n var _ref;\n var _config_resolver;\n var config = enforceWorkspaceVisibility((0, import_metro_config.getDefaultConfig)(projectRoot), projectRoot);\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.assetExts) !== null && _ref !== void 0 ? _ref : [],\n \"glb\"\n ])\n ]\n }\n };\n}\nvar oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n var file = (0, import_desktopReactNativeResolve.desktopReactNativeFile)(origin, moduleName, oneRootFor(projectRoot, platform), platform);\n if (!file) return null;\n return {\n type: \"sourceFile\",\n filePath: file\n };\n}\nfunction oneRootFor(projectRoot, platform) {\n var root = oneRoots.get(projectRoot);\n if (!root) {\n root = (0, import_desktopReactNativeResolve.requireOnePackageRoot)(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n var _url_match;\n var platform = (_url_match = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)) === null || _url_match === void 0 ? void 0 : _url_match[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\") return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n var resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(rootIndexBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n }\n return url.replace(expoVirtualEntryBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n var _config_resolver;\n var dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n var rootOrigin = (0, import_path.resolve)(projectRoot, \"package.json\");\n var innerResolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n var request = bareMain !== null && bareMain !== void 0 ? bareMain : moduleName;\n var packageEnd = request.indexOf(\"/\", request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0);\n var packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n var resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? {\n ...context,\n originModulePath: rootOrigin\n } : context;\n var resolveRequest2 = innerResolveRequest || context.resolveRequest;\n return resolveRequest2(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n var probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise(function(resolve2) {\n var settled = false;\n var finish = function finish2(value) {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n var child = (0, import_child_process.spawn)(\"watchman\", [\n \"watch-project\",\n projectRoot\n ], {\n stdio: \"ignore\"\n });\n var timeout = setTimeout(function() {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", function() {\n finish(false);\n });\n child.once(\"exit\", function(code) {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n var userBabelConfigPath = projectRoot ? (0, import_compiler.findUserBabelConfig)(projectRoot) : null;\n var hasUserBabelConfig = Boolean(userBabelConfigPath);\n var isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(`[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`);\n }\n return {\n isNativeTransforms,\n userBabelConfigPath\n };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = (0, import_path.resolve)((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (import_micromatch.default.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await (0, import_getTerminalReporter.getTerminalReporter)(projectRoot)\n };\n var merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(enforceWorkspaceVisibility(merged, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = (0, import_path.resolve)((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var { loadConfig } = await (0, import_projectImport.projectImport)(projectRoot, \"metro\");\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (import_micromatch.default.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: (0, import_projectImport.projectResolve)(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await (0, import_getTerminalReporter.getTerminalReporter)(projectRoot)\n };\n var metroConfig = await loadConfig({\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n }, {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n });\n return {\n ...enforcePackageResolution(enforceWorkspaceVisibility(metroConfig, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n ...extraConfig\n };\n}\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AAC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G,iBAAiB,SAAS,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,YAAY,QAAQ,UAAU,KAAK,IAAI,QAAQ,CAAC,GAAG,WAAW;EAC9Q,GAAG;CACL;AACF"}
|
|
@@ -54,7 +54,7 @@ async function buildBundleWithConfig(args, config, bundleImpl = import_bundle.de
|
|
|
54
54
|
unstable_transformProfile: args.unstableTransformProfile,
|
|
55
55
|
customResolverOptions
|
|
56
56
|
};
|
|
57
|
-
const server = new Server(config);
|
|
57
|
+
const server = new Server(config, { watch: false });
|
|
58
58
|
if (patchServer) {
|
|
59
59
|
patchServer(server);
|
|
60
60
|
}
|
|
@@ -59,7 +59,7 @@ async function buildBundleWithConfig(args, config) {
|
|
|
59
59
|
unstable_transformProfile: args.unstableTransformProfile,
|
|
60
60
|
customResolverOptions
|
|
61
61
|
};
|
|
62
|
-
var server = new Server(config);
|
|
62
|
+
var server = new Server(config, { watch: false });
|
|
63
63
|
if (patchServer) {
|
|
64
64
|
patchServer(server);
|
|
65
65
|
}
|
|
@@ -59,7 +59,7 @@ async function buildBundleWithConfig(args, config) {
|
|
|
59
59
|
unstable_transformProfile: args.unstableTransformProfile,
|
|
60
60
|
customResolverOptions
|
|
61
61
|
};
|
|
62
|
-
var server = new Server(config);
|
|
62
|
+
var server = new Server(config, { watch: false });
|
|
63
63
|
if (patchServer) {
|
|
64
64
|
patchServer(server);
|
|
65
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBundleWithConfig.native.js","names":[],"sources":["cjs/rn-commands/bundle/buildBundleWithConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar buildBundleWithConfig_exports = {};\n__export(buildBundleWithConfig_exports, {\n buildBundleWithConfig: () => buildBundleWithConfig\n});\nmodule.exports = __toCommonJS(buildBundleWithConfig_exports);\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_fs = require(\"fs\");\nvar import_Server = __toESM(require(\"metro/private/Server\"), 1);\nvar import_bundle = __toESM(require(\"metro/private/shared/output/bundle\"), 1);\nvar import_saveAssets = __toESM(require(\"./saveAssets\"), 1);\nvar Server = import_Server.default.default;\nasync function buildBundleWithConfig(args, config) {\n var bundleImpl = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_bundle.default, { patchServer } = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};\n var customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(`Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`);\n console.info(`Available platforms are: ${config.resolver.platforms.map(function(x) {\n return `\"${x}\"`;\n }).join(\", \")}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n var sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = import_path.default.basename(sourceMapUrl);\n }\n var requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n var server = new Server(config);\n if (patchServer) {\n patchServer(server);\n }\n try {\n var bundle = await bundleImpl.build(server, requestOpts);\n await import_fs.promises.mkdir(import_path.default.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n var outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await (0, import_saveAssets.default)(outputAssets, args.platform, args.assetsDest, args.assetCatalogDest);\n } finally {\n await server.end();\n }\n}\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,C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MAAM,IAAI,MAAM,iBAAiB;CACnC;CACA,QAAQ,IAAI,WAAW,KAAK,MAAM,gBAAgB;CAClD,IAAI,eAAe,KAAK;CACxB,IAAI,gBAAgB,QAAQ,CAAC,KAAK,0BAA0B;EAC1D,eAAe,YAAY,QAAQ,SAAS,YAAY;CAC1D;CACA,IAAI,cAAc;EAChB,WAAW,KAAK;EAChB;EACA,KAAK,KAAK;EACV,QAAQ,KAAK,WAAW,KAAK,IAAI,KAAK,SAAS,CAAC,KAAK;EACrD,UAAU,KAAK;EACf,2BAA2B,KAAK;EAChC;CACF;CACA,IAAI,SAAS,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"buildBundleWithConfig.native.js","names":[],"sources":["cjs/rn-commands/bundle/buildBundleWithConfig.native.js"],"sourcesContent":["\"use strict\";\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar buildBundleWithConfig_exports = {};\n__export(buildBundleWithConfig_exports, {\n buildBundleWithConfig: () => buildBundleWithConfig\n});\nmodule.exports = __toCommonJS(buildBundleWithConfig_exports);\nvar import_path = __toESM(require(\"path\"), 1);\nvar import_fs = require(\"fs\");\nvar import_Server = __toESM(require(\"metro/private/Server\"), 1);\nvar import_bundle = __toESM(require(\"metro/private/shared/output/bundle\"), 1);\nvar import_saveAssets = __toESM(require(\"./saveAssets\"), 1);\nvar Server = import_Server.default.default;\nasync function buildBundleWithConfig(args, config) {\n var bundleImpl = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : import_bundle.default, { patchServer } = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};\n var customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(`Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`);\n console.info(`Available platforms are: ${config.resolver.platforms.map(function(x) {\n return `\"${x}\"`;\n }).join(\", \")}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n var sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = import_path.default.basename(sourceMapUrl);\n }\n var requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n var server = new Server(config, {\n watch: false\n });\n if (patchServer) {\n patchServer(server);\n }\n try {\n var bundle = await bundleImpl.build(server, requestOpts);\n await import_fs.promises.mkdir(import_path.default.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n var outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await (0, import_saveAssets.default)(outputAssets, args.platform, args.assetsDest, args.assetCatalogDest);\n } finally {\n await server.end();\n }\n}\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;AACA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,YAAY,QAAQ,QAAQ;CAC9B,KAAK,IAAI,QAAQ,KACf,UAAU,QAAQ,MAAM;EAAE,KAAK,IAAI;EAAO,YAAY;CAAK,CAAC;AAChE;AACA,IAAI,eAAe,IAAI,MAAM,QAAQ,SAAS;CAC5C,IAAI,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY;EAClE,KAAK,IAAI,OAAO,kBAAkB,IAAI,GACpC,IAAI,CAAC,aAAa,KAAK,IAAI,GAAG,KAAK,QAAQ,QACzC,UAAU,IAAI,KAAK;GAAE,WAAW,KAAK;GAAM,YAAY,EAAE,OAAO,iBAAiB,MAAM,GAAG,MAAM,KAAK;EAAW,CAAC;CACvH;CACA,OAAO;AACT;AACA,IAAI,WAAW,KAAK,YAAY,YAAY,SAAS,OAAO,OAAO,SAAS,aAAa,GAAG,CAAC,IAAI,CAAC,GAAG,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;AAAK,CAAC,IAAI,QACzG,GACF;AACA,IAAI,gBAAgB,QAAQ,YAAY,UAAU,CAAC,GAAG,cAAc,EAAE,OAAO,KAAK,CAAC,GAAG,GAAG;AACzF,IAAI,gCAAgC,CAAC;AACrC,SAAS,+BAA+B,EACtC,6BAA6B,sBAC/B,CAAC;AACD,OAAO,UAAU,aAAa,6BAA6B;AAC3D,IAAI,cAAc,QAAQ,QAAQ,MAAM,GAAG,CAAC;AAC5C,IAAI,YAAY,QAAQ,IAAI;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ACvD,MAAM,UAAU,SAAS,MAAM,YAAY,QAAQ,QAAQ,KAAK,YAAY,GAAG;GAC7E,WAAW;GACX,MAAM;EACR,CAAC;EACD,MAAM,WAAW,KAAK,QAAQ,MAAM,QAAQ,IAAI;EAChD,IAAI,eAAe,MAAM,OAAO,UAAU;GACxC,GAAG,OAAO;GACV,GAAG;EACL,CAAC;EACD,OAAO,OAAO,GAAG,kBAAkB,QAAO,CAAE,cAAc,KAAK,UAAU,KAAK,YAAY,KAAK,gBAAgB;CACjH,UAAU;EACR,MAAM,OAAO,IAAI;CACnB;AACF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { searchForWorkspaceRoot } from "vite";
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
import {
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import { dirname, posix, resolve } from "node:path";
|
|
5
|
+
import workspace from "resolve-workspace-root";
|
|
6
|
+
import { globSync } from "tinyglobby";
|
|
4
7
|
import micromatch from "micromatch";
|
|
5
8
|
import { getDefaultConfig } from "@react-native/metro-config";
|
|
6
9
|
import { findUserBabelConfig } from "@vxrn/compiler";
|
|
@@ -39,9 +42,28 @@ const metroWatchExclusions = [
|
|
|
39
42
|
function enforceWorkspaceVisibility(config, projectRoot) {
|
|
40
43
|
const workspaceRoot = searchForWorkspaceRoot(projectRoot);
|
|
41
44
|
if (workspaceRoot === projectRoot) return config;
|
|
45
|
+
let packages = [];
|
|
46
|
+
try {
|
|
47
|
+
packages = (workspace.getWorkspaceGlobs(workspaceRoot) ?? []).flatMap((pattern) => globSync(posix.join(pattern, "package.json"), {
|
|
48
|
+
cwd: workspaceRoot,
|
|
49
|
+
absolute: true,
|
|
50
|
+
expandDirectories: false,
|
|
51
|
+
caseSensitiveMatch: process.platform !== "darwin" && process.platform !== "win32",
|
|
52
|
+
ignore: ["**/@(Carthage|Pods|node_modules)/**"]
|
|
53
|
+
})).filter((manifest) => {
|
|
54
|
+
try {
|
|
55
|
+
JSON.parse(readFileSync(manifest, "utf8"));
|
|
56
|
+
return true;
|
|
57
|
+
} catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}).map((manifest) => dirname(manifest));
|
|
61
|
+
} catch {
|
|
62
|
+
packages = [];
|
|
63
|
+
}
|
|
42
64
|
return {
|
|
43
65
|
...config,
|
|
44
|
-
watchFolders: [.../* @__PURE__ */ new Set([...config.watchFolders ?? [], workspaceRoot])],
|
|
66
|
+
watchFolders: [.../* @__PURE__ */ new Set([...config.watchFolders ?? [], ...packages.length ? [resolve(workspaceRoot, "node_modules"), ...packages] : []])],
|
|
45
67
|
resolver: {
|
|
46
68
|
...config.resolver,
|
|
47
69
|
nodeModulesPaths: [.../* @__PURE__ */ new Set([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetroConfigFromViteConfig.js","names":[],"sources":["esm/metro-config/getMetroConfigFromViteConfig.js"],"sourcesContent":["import { searchForWorkspaceRoot } from \"vite\";\nimport { spawn } from \"node:child_process\";\nimport { resolve } from \"node:path\";\nimport micromatch from \"micromatch\";\nimport { getDefaultConfig } from \"@react-native/metro-config\";\nimport { findUserBabelConfig } from \"@vxrn/compiler\";\nimport {\n desktopReactNativeFile,\n requireOnePackageRoot\n} from \"@vxrn/utils/desktopReactNativeResolve\";\nimport { projectImport, projectResolve } from \"../utils/projectImport\";\nimport { getTerminalReporter } from \"../utils/getTerminalReporter\";\nconst WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nconst expoEnvAdditionalExts = [\"env\", \"local\", \"development\"];\nconst metroSourceExts = [\"js\", \"jsx\", \"json\", \"ts\", \"tsx\", \"mjs\", \"cjs\", \"swift\", \"kt\"];\nconst watchmanResponsivePromises = /* @__PURE__ */ new Map();\nlet didWarnAboutWatchmanFallback = false;\nconst rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nconst expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nconst metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n const workspaceRoot = searchForWorkspaceRoot(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n return {\n ...config,\n watchFolders: [.../* @__PURE__ */ new Set([...config.watchFolders ?? [], workspaceRoot])],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...config.resolver?.nodeModulesPaths ?? [],\n resolve(projectRoot, \"node_modules\"),\n resolve(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n const config = enforceWorkspaceVisibility(\n getDefaultConfig(projectRoot),\n projectRoot\n );\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [.../* @__PURE__ */ new Set([...config.resolver?.assetExts ?? [], \"glb\"])]\n }\n };\n}\nconst oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n const file = desktopReactNativeFile(\n origin,\n moduleName,\n oneRootFor(projectRoot, platform),\n platform\n );\n if (!file) return null;\n return { type: \"sourceFile\", filePath: file };\n}\nfunction oneRootFor(projectRoot, platform) {\n let root = oneRoots.get(projectRoot);\n if (!root) {\n root = requireOnePackageRoot(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n const platform = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)?.[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\")\n return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n const resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(\n rootIndexBundleRequestPattern,\n `$1/${resolvedMainModulePath}.bundle`\n );\n }\n return url.replace(\n expoVirtualEntryBundleRequestPattern,\n `$1/${resolvedMainModulePath}.bundle`\n );\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n const dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n const rootOrigin = resolve(projectRoot, \"package.json\");\n const innerResolveRequest = config.resolver?.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: (context, moduleName, platform) => {\n const bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n const request = bareMain ?? moduleName;\n const packageEnd = request.indexOf(\n \"/\",\n request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0\n );\n const packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n const resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? { ...context, originModulePath: rootOrigin } : context;\n const resolveRequest = innerResolveRequest || context.resolveRequest;\n return resolveRequest(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n let probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise((resolve2) => {\n let settled = false;\n const finish = (value) => {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n const child = spawn(\"watchman\", [\"watch-project\", projectRoot], {\n stdio: \"ignore\"\n });\n const timeout = setTimeout(() => {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", () => {\n finish(false);\n });\n child.once(\"exit\", (code) => {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n const userBabelConfigPath = projectRoot ? findUserBabelConfig(projectRoot) : null;\n const hasUserBabelConfig = Boolean(userBabelConfigPath);\n const isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(\n `[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`\n );\n }\n return { isNativeTransforms, userBabelConfigPath };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n const extraConfig = {};\n const projectRoot = resolve(metroPluginOptions.argv?.projectRoot ?? config.root);\n const { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n const useWatchman = watchman ?? await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\n \"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\"\n );\n }\n const _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n const origRewriteRequestUrl = _defaultConfig.server?.rewriteRequestUrl;\n const resolveMainModuleName = () => mainModuleName;\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = (url) => {\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return origRewriteRequestUrl?.(url) ?? url;\n };\n }\n const existingBlockList = _defaultConfig?.resolver?.blockList;\n const blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [existingBlockList] : [],\n ...metroWatchExclusions\n ];\n const { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n let nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\"\n );\n }\n const defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig?.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.watcher?.additionalExts ?? [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig?.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.resolver?.platforms ?? [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: (context, moduleName, platform) => {\n const origResolveRequestFn = _defaultConfig?.resolver?.resolveRequest || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(\n context,\n \"@vxrn/utils/empty\",\n platform\n );\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n const contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(\n (c) => c !== \"import\"\n )\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n const desktopRedirect = redirectDesktopReactNative(\n projectRoot,\n context.originModulePath,\n moduleName,\n platform\n );\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig?.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/babel-transformer\"\n )\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? { transformerPath: nativeWorkerPath } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n const merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(\n enforceWorkspaceVisibility(merged, projectRoot),\n mainModuleName,\n config.resolve?.dedupe ?? [],\n projectRoot\n ),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n const extraConfig = {};\n const projectRoot = resolve(metroPluginOptions.argv?.projectRoot ?? config.root);\n const { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n const useWatchman = watchman ?? await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\n \"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\"\n );\n }\n const { loadConfig } = await projectImport(projectRoot, \"metro\");\n const _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n const origRewriteRequestUrl = _defaultConfig.server?.rewriteRequestUrl;\n const resolveMainModuleName = () => mainModuleName;\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = (url) => {\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return origRewriteRequestUrl?.(url) ?? url;\n };\n }\n const existingBlockList = _defaultConfig?.resolver?.blockList;\n const blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [existingBlockList] : [],\n ...metroWatchExclusions\n ];\n const { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n let nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\"\n );\n }\n const defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig?.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.watcher?.additionalExts ?? [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig?.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.resolver?.platforms ?? [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: (context, moduleName, platform) => {\n const origResolveRequestFn = _defaultConfig?.resolver?.resolveRequest || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(\n context,\n \"@vxrn/utils/empty\",\n platform\n );\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n const contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(\n (c) => c !== \"import\"\n )\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n const desktopRedirect = redirectDesktopReactNative(\n projectRoot,\n context.originModulePath,\n moduleName,\n platform\n );\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig?.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/babel-transformer\"\n )\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? { transformerPath: nativeWorkerPath } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n const metroConfig = await loadConfig(\n {\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n },\n {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n }\n );\n return {\n ...enforcePackageResolution(\n enforceWorkspaceVisibility(metroConfig, projectRoot),\n mainModuleName,\n config.resolve?.dedupe ?? [],\n projectRoot\n ),\n ...extraConfig\n };\n}\nexport {\n buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig\n};\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,4BAA4B;AAClC,MAAM,wBAAwB;CAAC;CAAO;CAAS;AAAa;AAC5D,MAAM,kBAAkB;CAAC;CAAM;CAAO;CAAQ;CAAM;CAAO;CAAO;CAAO;CAAS;AAAI;AACtF,MAAM,6CAA6C,IAAI,IAAI;AAC3D,IAAI,+BAA+B;AACnC,MAAM,gCAAgC;AACtC,MAAM,uCAAuC;AAC7C,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,2BAA2B,QAAQ,aAAa;CACvD,MAAM,gBAAgB,uBAAuB,WAAW;CACxD,IAAI,kBAAkB,aAAa,OAAO;CAC1C,OAAO;EACL,GAAG;EACH,cAAc,CAAC,mBAAmB,IAAI,IAAI,CAAC,GAAG,OAAO,gBAAgB,CAAC,GAAG,aAAa,CAAC,CAAC;EACxF,UAAU;GACR,GAAG,OAAO;GACV,kBAAkB,C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ACxB;EACE,KAAK;EACL;EACA,eAAe,CAAC,CAAC,QAAQ,IAAI;EAC7B,GAAG;CACL,GACA;EACE,GAAG;EACH,GAAG,OAAO,2BAA2B,aAAa,uBAAuB,aAAa,IAAI;CAC5F,CACF;CACA,OAAO;EACL,GAAG,yBACD,2BAA2B,aAAa,WAAW,GACnD,gBACA,OAAO,SAAS,UAAU,CAAC,GAC3B,WACF;EACA,GAAG;CACL;AACF"}
|
|
1
|
+
{"version":3,"file":"getMetroConfigFromViteConfig.js","names":["globPackagesSync"],"sources":["esm/metro-config/getMetroConfigFromViteConfig.js"],"sourcesContent":["import { searchForWorkspaceRoot } from \"vite\";\nimport { spawn } from \"node:child_process\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, posix, resolve } from \"node:path\";\nimport workspace from \"resolve-workspace-root\";\nimport { globSync as globPackagesSync } from \"tinyglobby\";\nimport micromatch from \"micromatch\";\nimport { getDefaultConfig } from \"@react-native/metro-config\";\nimport { findUserBabelConfig } from \"@vxrn/compiler\";\nimport {\n desktopReactNativeFile,\n requireOnePackageRoot\n} from \"@vxrn/utils/desktopReactNativeResolve\";\nimport { projectImport, projectResolve } from \"../utils/projectImport\";\nimport { getTerminalReporter } from \"../utils/getTerminalReporter\";\nconst WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nconst expoEnvAdditionalExts = [\"env\", \"local\", \"development\"];\nconst metroSourceExts = [\"js\", \"jsx\", \"json\", \"ts\", \"tsx\", \"mjs\", \"cjs\", \"swift\", \"kt\"];\nconst watchmanResponsivePromises = /* @__PURE__ */ new Map();\nlet didWarnAboutWatchmanFallback = false;\nconst rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nconst expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nconst metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n const workspaceRoot = searchForWorkspaceRoot(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n let packages = [];\n try {\n packages = (workspace.getWorkspaceGlobs(workspaceRoot) ?? []).flatMap(\n (pattern) => globPackagesSync(posix.join(pattern, \"package.json\"), {\n cwd: workspaceRoot,\n absolute: true,\n expandDirectories: false,\n caseSensitiveMatch: process.platform !== \"darwin\" && process.platform !== \"win32\",\n ignore: [\"**/@(Carthage|Pods|node_modules)/**\"]\n })\n ).filter((manifest) => {\n try {\n JSON.parse(readFileSync(manifest, \"utf8\"));\n return true;\n } catch {\n return false;\n }\n }).map((manifest) => dirname(manifest));\n } catch {\n packages = [];\n }\n return {\n ...config,\n watchFolders: [\n .../* @__PURE__ */ new Set([\n ...config.watchFolders ?? [],\n ...packages.length ? [resolve(workspaceRoot, \"node_modules\"), ...packages] : []\n ])\n ],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...config.resolver?.nodeModulesPaths ?? [],\n resolve(projectRoot, \"node_modules\"),\n resolve(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n const config = enforceWorkspaceVisibility(\n getDefaultConfig(projectRoot),\n projectRoot\n );\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [.../* @__PURE__ */ new Set([...config.resolver?.assetExts ?? [], \"glb\"])]\n }\n };\n}\nconst oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n const file = desktopReactNativeFile(\n origin,\n moduleName,\n oneRootFor(projectRoot, platform),\n platform\n );\n if (!file) return null;\n return { type: \"sourceFile\", filePath: file };\n}\nfunction oneRootFor(projectRoot, platform) {\n let root = oneRoots.get(projectRoot);\n if (!root) {\n root = requireOnePackageRoot(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n const platform = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)?.[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\")\n return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n const resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(\n rootIndexBundleRequestPattern,\n `$1/${resolvedMainModulePath}.bundle`\n );\n }\n return url.replace(\n expoVirtualEntryBundleRequestPattern,\n `$1/${resolvedMainModulePath}.bundle`\n );\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n const dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n const rootOrigin = resolve(projectRoot, \"package.json\");\n const innerResolveRequest = config.resolver?.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: (context, moduleName, platform) => {\n const bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n const request = bareMain ?? moduleName;\n const packageEnd = request.indexOf(\n \"/\",\n request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0\n );\n const packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n const resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? { ...context, originModulePath: rootOrigin } : context;\n const resolveRequest = innerResolveRequest || context.resolveRequest;\n return resolveRequest(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n let probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise((resolve2) => {\n let settled = false;\n const finish = (value) => {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n const child = spawn(\"watchman\", [\"watch-project\", projectRoot], {\n stdio: \"ignore\"\n });\n const timeout = setTimeout(() => {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", () => {\n finish(false);\n });\n child.once(\"exit\", (code) => {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n const userBabelConfigPath = projectRoot ? findUserBabelConfig(projectRoot) : null;\n const hasUserBabelConfig = Boolean(userBabelConfigPath);\n const isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(\n `[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`\n );\n }\n return { isNativeTransforms, userBabelConfigPath };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n const extraConfig = {};\n const projectRoot = resolve(metroPluginOptions.argv?.projectRoot ?? config.root);\n const { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n const useWatchman = watchman ?? await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\n \"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\"\n );\n }\n const _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n const origRewriteRequestUrl = _defaultConfig.server?.rewriteRequestUrl;\n const resolveMainModuleName = () => mainModuleName;\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = (url) => {\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return origRewriteRequestUrl?.(url) ?? url;\n };\n }\n const existingBlockList = _defaultConfig?.resolver?.blockList;\n const blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [existingBlockList] : [],\n ...metroWatchExclusions\n ];\n const { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n let nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\"\n );\n }\n const defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig?.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.watcher?.additionalExts ?? [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig?.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([..._defaultConfig?.resolver?.platforms ?? [], \"macos\", \"linux\"])\n ],\n resolveRequest: (context, moduleName, platform) => {\n const origResolveRequestFn = _defaultConfig?.resolver?.resolveRequest || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n const contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(\n (c) => c !== \"import\"\n )\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n const desktopRedirect = redirectDesktopReactNative(\n projectRoot,\n context.originModulePath,\n moduleName,\n platform\n );\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig?.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/babel-transformer\"\n )\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? { transformerPath: nativeWorkerPath } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n const merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(\n enforceWorkspaceVisibility(merged, projectRoot),\n mainModuleName,\n config.resolve?.dedupe ?? [],\n projectRoot\n ),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n const extraConfig = {};\n const projectRoot = resolve(metroPluginOptions.argv?.projectRoot ?? config.root);\n const { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n const useWatchman = watchman ?? await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\n \"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\"\n );\n }\n const { loadConfig } = await projectImport(projectRoot, \"metro\");\n const _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n const origRewriteRequestUrl = _defaultConfig.server?.rewriteRequestUrl;\n const resolveMainModuleName = () => mainModuleName;\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = (url) => {\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return origRewriteRequestUrl?.(url) ?? url;\n };\n }\n const existingBlockList = _defaultConfig?.resolver?.blockList;\n const blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [existingBlockList] : [],\n ...metroWatchExclusions\n ];\n const { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n let nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\"\n );\n }\n const defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig?.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ..._defaultConfig?.watcher?.additionalExts ?? [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig?.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([..._defaultConfig?.resolver?.platforms ?? [], \"macos\", \"linux\"])\n ],\n resolveRequest: (context, moduleName, platform) => {\n const origResolveRequestFn = _defaultConfig?.resolver?.resolveRequest || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n const contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(\n (c) => c !== \"import\"\n )\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n const desktopRedirect = redirectDesktopReactNative(\n projectRoot,\n context.originModulePath,\n moduleName,\n platform\n );\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig?.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(\n projectRoot,\n \"@vxrn/vite-plugin-metro/babel-transformer\"\n )\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? { transformerPath: nativeWorkerPath } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n const metroConfig = await loadConfig(\n {\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n },\n {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n }\n );\n return {\n ...enforcePackageResolution(\n enforceWorkspaceVisibility(metroConfig, projectRoot),\n mainModuleName,\n config.resolve?.dedupe ?? [],\n projectRoot\n ),\n ...extraConfig\n };\n}\nexport {\n buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig\n};\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,4BAA4B;AAClC,MAAM,wBAAwB;CAAC;CAAO;CAAS;AAAa;AAC5D,MAAM,kBAAkB;CAAC;CAAM;CAAO;CAAQ;CAAM;CAAO;CAAO;CAAO;CAAS;AAAI;AACtF,MAAM,6CAA6C,IAAI,IAAI;AAC3D,IAAI,+BAA+B;AACnC,MAAM,gCAAgC;AACtC,MAAM,uCAAuC;AAC7C,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,2BAA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AW,CACT,mBAAmB,IAAI,IAAI;IAAC,GAAG,gBAAgB,UAAU,aAAa,CAAC;IAAG;IAAS;GAAO,CAAC,CAC7F;GACA,iBAAiB,SAAS,YAAY,aAAa;IACjD,MAAM,uBAAuB,gBAAgB,UAAU,kBAAkB,QAAQ;IACjF,IAAI,kBAAkB,eAAe,SAAS,GAAG;KAC/C,IAAI,WAAW,QAAQ,YAAY,cAAc,GAAG;MAClD,OAAO,qBAAqB,SAAS,qBAAqB,QAAQ;KACpE;IACF;IACA,IAAI,WAAW,WAAW,gBAAgB,GAAG;KAC3C,MAAM,kBAAkB;MACtB,GAAG;MACH,yBAAyB,QAAQ,wBAAwB,QACtD,MAAM,MAAM,QACf;KACF;KACA,OAAO,qBAAqB,iBAAiB,YAAY,QAAQ;IACnE;IACA,MAAM,kBAAkB,2BACtB,aACA,QAAQ,kBACR,YACA,QACF;IACA,IAAI,iBAAiB,OAAO;IAC5B,OAAO,qBAAqB,SAAS,YAAY,QAAQ;GAC3D;EACF;EACA,aAAa;GACX,GAAG,gBAAgB;GAInB,8BAA8B;GAC9B,sBAAsB,eACpB,aACA,2CACF;EACF;EAGA,GAAG,mBAAmB,EAAE,iBAAiB,iBAAiB,IAAI,CAAC;EAC/D,UAAU,MAAM,oBAAoB,WAAW;CACjD;CACA,MAAM,cAAc,MAAM,WACxB;EACE,KAAK;EACL;EACA,eAAe,CAAC,CAAC,QAAQ,IAAI;EAC7B,GAAG;CACL,GACA;EACE,GAAG;EACH,GAAG,OAAO,2BAA2B,aAAa,uBAAuB,aAAa,IAAI;CAC5F,CACF;CACA,OAAO;EACL,GAAG,yBACD,2BAA2B,aAAa,WAAW,GACnD,gBACA,OAAO,SAAS,UAAU,CAAC,GAC3B,WACF;EACA,GAAG;CACL;AACF"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { searchForWorkspaceRoot } from "vite";
|
|
2
2
|
import { spawn } from "child_process";
|
|
3
|
-
import {
|
|
3
|
+
import { readFileSync } from "fs";
|
|
4
|
+
import { dirname, posix, resolve } from "path";
|
|
5
|
+
import workspace from "resolve-workspace-root";
|
|
6
|
+
import { globSync } from "tinyglobby";
|
|
4
7
|
import micromatch from "micromatch";
|
|
5
8
|
import { getDefaultConfig } from "@react-native/metro-config";
|
|
6
9
|
import { findUserBabelConfig } from "@vxrn/compiler";
|
|
@@ -41,9 +44,33 @@ function enforceWorkspaceVisibility(config, projectRoot) {
|
|
|
41
44
|
var _config_resolver;
|
|
42
45
|
var workspaceRoot = searchForWorkspaceRoot(projectRoot);
|
|
43
46
|
if (workspaceRoot === projectRoot) return config;
|
|
47
|
+
var packages = [];
|
|
48
|
+
try {
|
|
49
|
+
var _workspace_getWorkspaceGlobs;
|
|
50
|
+
packages = ((_workspace_getWorkspaceGlobs = workspace.getWorkspaceGlobs(workspaceRoot)) !== null && _workspace_getWorkspaceGlobs !== void 0 ? _workspace_getWorkspaceGlobs : []).flatMap(function(pattern) {
|
|
51
|
+
return globSync(posix.join(pattern, "package.json"), {
|
|
52
|
+
cwd: workspaceRoot,
|
|
53
|
+
absolute: true,
|
|
54
|
+
expandDirectories: false,
|
|
55
|
+
caseSensitiveMatch: process.platform !== "darwin" && process.platform !== "win32",
|
|
56
|
+
ignore: ["**/@(Carthage|Pods|node_modules)/**"]
|
|
57
|
+
});
|
|
58
|
+
}).filter(function(manifest) {
|
|
59
|
+
try {
|
|
60
|
+
JSON.parse(readFileSync(manifest, "utf8"));
|
|
61
|
+
return true;
|
|
62
|
+
} catch (unused) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}).map(function(manifest) {
|
|
66
|
+
return dirname(manifest);
|
|
67
|
+
});
|
|
68
|
+
} catch (unused) {
|
|
69
|
+
packages = [];
|
|
70
|
+
}
|
|
44
71
|
return {
|
|
45
72
|
...config,
|
|
46
|
-
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], workspaceRoot])],
|
|
73
|
+
watchFolders: [.../* @__PURE__ */ new Set([...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [], ...packages.length ? [resolve(workspaceRoot, "node_modules"), ...packages] : []])],
|
|
47
74
|
resolver: {
|
|
48
75
|
...config.resolver,
|
|
49
76
|
nodeModulesPaths: [.../* @__PURE__ */ new Set([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetroConfigFromViteConfig.native.js","names":[],"sources":["esm/metro-config/getMetroConfigFromViteConfig.native.js"],"sourcesContent":["import { searchForWorkspaceRoot } from \"vite\";\nimport { spawn } from \"child_process\";\nimport { resolve } from \"path\";\nimport micromatch from \"micromatch\";\nimport { getDefaultConfig } from \"@react-native/metro-config\";\nimport { findUserBabelConfig } from \"@vxrn/compiler\";\nimport { desktopReactNativeFile, requireOnePackageRoot } from \"@vxrn/utils/desktopReactNativeResolve\";\nimport { projectImport, projectResolve } from \"../utils/projectImport\";\nimport { getTerminalReporter } from \"../utils/getTerminalReporter\";\nvar WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nvar expoEnvAdditionalExts = [\n \"env\",\n \"local\",\n \"development\"\n];\nvar metroSourceExts = [\n \"js\",\n \"jsx\",\n \"json\",\n \"ts\",\n \"tsx\",\n \"mjs\",\n \"cjs\",\n \"swift\",\n \"kt\"\n];\nvar watchmanResponsivePromises = /* @__PURE__ */ new Map();\nvar didWarnAboutWatchmanFallback = false;\nvar rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nvar expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nvar metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n var _config_watchFolders, _ref;\n var _config_resolver;\n var workspaceRoot = searchForWorkspaceRoot(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n return {\n ...config,\n watchFolders: [\n .../* @__PURE__ */ new Set([\n ...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [],\n workspaceRoot\n ])\n ],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.nodeModulesPaths) !== null && _ref !== void 0 ? _ref : [],\n resolve(projectRoot, \"node_modules\"),\n resolve(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n var _ref;\n var _config_resolver;\n var config = enforceWorkspaceVisibility(getDefaultConfig(projectRoot), projectRoot);\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.assetExts) !== null && _ref !== void 0 ? _ref : [],\n \"glb\"\n ])\n ]\n }\n };\n}\nvar oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n var file = desktopReactNativeFile(origin, moduleName, oneRootFor(projectRoot, platform), platform);\n if (!file) return null;\n return {\n type: \"sourceFile\",\n filePath: file\n };\n}\nfunction oneRootFor(projectRoot, platform) {\n var root = oneRoots.get(projectRoot);\n if (!root) {\n root = requireOnePackageRoot(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n var _url_match;\n var platform = (_url_match = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)) === null || _url_match === void 0 ? void 0 : _url_match[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\") return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n var resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(rootIndexBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n }\n return url.replace(expoVirtualEntryBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n var _config_resolver;\n var dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n var rootOrigin = resolve(projectRoot, \"package.json\");\n var innerResolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n var request = bareMain !== null && bareMain !== void 0 ? bareMain : moduleName;\n var packageEnd = request.indexOf(\"/\", request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0);\n var packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n var resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? {\n ...context,\n originModulePath: rootOrigin\n } : context;\n var resolveRequest2 = innerResolveRequest || context.resolveRequest;\n return resolveRequest2(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n var probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise(function(resolve2) {\n var settled = false;\n var finish = function finish2(value) {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n var child = spawn(\"watchman\", [\n \"watch-project\",\n projectRoot\n ], {\n stdio: \"ignore\"\n });\n var timeout = setTimeout(function() {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", function() {\n finish(false);\n });\n child.once(\"exit\", function(code) {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n var userBabelConfigPath = projectRoot ? findUserBabelConfig(projectRoot) : null;\n var hasUserBabelConfig = Boolean(userBabelConfigPath);\n var isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(`[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`);\n }\n return {\n isNativeTransforms,\n userBabelConfigPath\n };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = resolve((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n var merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(enforceWorkspaceVisibility(merged, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = resolve((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var { loadConfig } = await projectImport(projectRoot, \"metro\");\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n var metroConfig = await loadConfig({\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n }, {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n });\n return {\n ...enforcePackageResolution(enforceWorkspaceVisibility(metroConfig, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n ...extraConfig\n };\n}\nexport {\n buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig\n};\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;;;;;;;;;AASA,IAAI,4BAA4B;AAChC,IAAI,wBAAwB;CAC1B;CACA;CACA;AACF;AACA,IAAI,kBAAkB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,IAAI,6CAA6C,IAAI,IAAI;AACzD,IAAI,+BAA+B;AACnC,IAAI,gCAAgC;AACpC,IAAI,uCAAuC;AAC3C,IAAI,uBAAuB;CACzB;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,2BAA2B,QAAQ,aAAa;CACvD,IAAI,sBAAsB;CAC1B,IAAI;CACJ,IAAI,gBAAgB,uBAAuB,WAAW;CACtD,IAAI,kBAAkB,aAAa,OAAO;CAC1C,OAAO;EACL,GAAG;EACH,cAAc,CACZ,mBAAmB,IAAI,IAAI,CACzB,IAAI,uBAAuB,OAAO,kBAAkB,QAAQ,yBAAyB,KAAK,IAAI,uBAAuB,CAAC,GACtH,aACF,CAAC,CACH;EACA,UAAU;GACR,GAAG,OAAO;GACV,kBAAkB,CAChB,mBAAmB,IAAI,IAAI;IACzB,IAAI,QAAQ,mBAAmB,OAAO,cAAc,QAAQ,qBAAqB,KAAK,IAAI,KAAK,IAAI,iBAAiB,sBAAsB,QAAQ,SAAS,KAAK,IAAI,OAAO,CAAC;IAC5K,QAAQ,aAAa,cAAc;IACnC,QAAQ,eAAe,cAAc;GACvC,CAAC,CACH;EACF;CACF;AACF;AACA,SAAS,4BA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M,oBAAoB,WAAW;CACjD;CACA,IAAI,cAAc,MAAM,WAAW;EACjC,KAAK;EACL;EACA,eAAe,CAAC,CAAC,QAAQ,IAAI;EAC7B,GAAG;CACL,GAAG;EACD,GAAG;EACH,GAAG,OAAO,2BAA2B,aAAa,uBAAuB,aAAa,IAAI;CAC5F,CAAC;CACD,OAAO;EACL,GAAG,yBAAyB,2BAA2B,aAAa,WAAW,GAAG,iBAAiB,SAAS,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,YAAY,QAAQ,UAAU,KAAK,IAAI,QAAQ,CAAC,GAAG,WAAW;EAC9Q,GAAG;CACL;AACF"}
|
|
1
|
+
{"version":3,"file":"getMetroConfigFromViteConfig.native.js","names":["globPackagesSync"],"sources":["esm/metro-config/getMetroConfigFromViteConfig.native.js"],"sourcesContent":["import { searchForWorkspaceRoot } from \"vite\";\nimport { spawn } from \"child_process\";\nimport { readFileSync } from \"fs\";\nimport { dirname, posix, resolve } from \"path\";\nimport workspace from \"resolve-workspace-root\";\nimport { globSync as globPackagesSync } from \"tinyglobby\";\nimport micromatch from \"micromatch\";\nimport { getDefaultConfig } from \"@react-native/metro-config\";\nimport { findUserBabelConfig } from \"@vxrn/compiler\";\nimport { desktopReactNativeFile, requireOnePackageRoot } from \"@vxrn/utils/desktopReactNativeResolve\";\nimport { projectImport, projectResolve } from \"../utils/projectImport\";\nimport { getTerminalReporter } from \"../utils/getTerminalReporter\";\nvar WATCHMAN_PROBE_TIMEOUT_MS = 2e3;\nvar expoEnvAdditionalExts = [\n \"env\",\n \"local\",\n \"development\"\n];\nvar metroSourceExts = [\n \"js\",\n \"jsx\",\n \"json\",\n \"ts\",\n \"tsx\",\n \"mjs\",\n \"cjs\",\n \"swift\",\n \"kt\"\n];\nvar watchmanResponsivePromises = /* @__PURE__ */ new Map();\nvar didWarnAboutWatchmanFallback = false;\nvar rootIndexBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/index\\.bundle(?=$|[?#])/;\nvar expoVirtualEntryBundleRequestPattern = /^(https?:\\/\\/[^/]+)?\\/\\.expo\\/\\.virtual-metro-entry\\.bundle(?=$|[?#])/;\nvar metroWatchExclusions = [\n /^(?!.*[/\\\\]node_modules[/\\\\]).*[/\\\\]dist[/\\\\](?:static|server)(?:[/\\\\]|$)/,\n /[/\\\\]tests[/\\\\][^/\\\\]+[/\\\\]dist(?:[/\\\\]|$)/,\n /[/\\\\]\\.docker(?:[/\\\\]|$)/,\n /[/\\\\]\\.vite(?:[/\\\\]|$)/,\n /[/\\\\]node_modules[/\\\\]\\.vxrn(?:[/\\\\]|$)/\n];\nfunction enforceWorkspaceVisibility(config, projectRoot) {\n var _config_watchFolders, _ref;\n var _config_resolver;\n var workspaceRoot = searchForWorkspaceRoot(projectRoot);\n if (workspaceRoot === projectRoot) return config;\n var packages = [];\n try {\n var _workspace_getWorkspaceGlobs;\n packages = ((_workspace_getWorkspaceGlobs = workspace.getWorkspaceGlobs(workspaceRoot)) !== null && _workspace_getWorkspaceGlobs !== void 0 ? _workspace_getWorkspaceGlobs : []).flatMap(function(pattern) {\n return globPackagesSync(posix.join(pattern, \"package.json\"), {\n cwd: workspaceRoot,\n absolute: true,\n expandDirectories: false,\n caseSensitiveMatch: process.platform !== \"darwin\" && process.platform !== \"win32\",\n ignore: [\n \"**/@(Carthage|Pods|node_modules)/**\"\n ]\n });\n }).filter(function(manifest) {\n try {\n JSON.parse(readFileSync(manifest, \"utf8\"));\n return true;\n } catch (unused) {\n return false;\n }\n }).map(function(manifest) {\n return dirname(manifest);\n });\n } catch (unused) {\n packages = [];\n }\n return {\n ...config,\n watchFolders: [\n .../* @__PURE__ */ new Set([\n ...(_config_watchFolders = config.watchFolders) !== null && _config_watchFolders !== void 0 ? _config_watchFolders : [],\n ...packages.length ? [\n resolve(workspaceRoot, \"node_modules\"),\n ...packages\n ] : []\n ])\n ],\n resolver: {\n ...config.resolver,\n nodeModulesPaths: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.nodeModulesPaths) !== null && _ref !== void 0 ? _ref : [],\n resolve(projectRoot, \"node_modules\"),\n resolve(workspaceRoot, \"node_modules\")\n ])\n ]\n }\n };\n}\nfunction getReactNativeDefaultConfig(projectRoot) {\n var _ref;\n var _config_resolver;\n var config = enforceWorkspaceVisibility(getDefaultConfig(projectRoot), projectRoot);\n return {\n ...config,\n resolver: {\n ...config.resolver,\n assetExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.assetExts) !== null && _ref !== void 0 ? _ref : [],\n \"glb\"\n ])\n ]\n }\n };\n}\nvar oneRoots = /* @__PURE__ */ new Map();\nfunction redirectDesktopReactNative(projectRoot, origin, moduleName, platform) {\n if (platform !== \"macos\" && platform !== \"linux\") return null;\n var file = desktopReactNativeFile(origin, moduleName, oneRootFor(projectRoot, platform), platform);\n if (!file) return null;\n return {\n type: \"sourceFile\",\n filePath: file\n };\n}\nfunction oneRootFor(projectRoot, platform) {\n var root = oneRoots.get(projectRoot);\n if (!root) {\n root = requireOnePackageRoot(projectRoot, platform);\n oneRoots.set(projectRoot, root);\n }\n return root;\n}\nfunction getPlatformFromBundleUrl(url) {\n var _url_match;\n var platform = (_url_match = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)) === null || _url_match === void 0 ? void 0 : _url_match[1];\n if (platform === \"ios\" || platform === \"android\" || platform === \"macos\" || platform === \"linux\") return platform;\n return \"ios\";\n}\nfunction rewriteMainModuleBundleUrl(url, resolveMainModuleName) {\n var resolvedMainModulePath = resolveMainModuleName({\n platform: getPlatformFromBundleUrl(url)\n });\n if (rootIndexBundleRequestPattern.test(url)) {\n return url.replace(rootIndexBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n }\n return url.replace(expoVirtualEntryBundleRequestPattern, `$1/${resolvedMainModulePath}.bundle`);\n}\nfunction isMainModuleBundleRequest(url) {\n return rootIndexBundleRequestPattern.test(url) || expoVirtualEntryBundleRequestPattern.test(url);\n}\nfunction isBareSpecifier(name) {\n return name !== \"\" && !name.startsWith(\".\") && !name.startsWith(\"/\");\n}\nfunction bareMainModuleForRequest(moduleName, mainModuleName) {\n if (!mainModuleName || !isBareSpecifier(mainModuleName)) return void 0;\n if (moduleName === `./${mainModuleName}`) return mainModuleName;\n return void 0;\n}\nfunction enforcePackageResolution(config, mainModuleName, dedupe, projectRoot) {\n var _config_resolver;\n var dedupedPackages = new Set(dedupe);\n if ((!mainModuleName || !isBareSpecifier(mainModuleName)) && !dedupedPackages.size) {\n return config;\n }\n var rootOrigin = resolve(projectRoot, \"package.json\");\n var innerResolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;\n return {\n ...config,\n resolver: {\n ...config.resolver,\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var bareMain = bareMainModuleForRequest(moduleName, mainModuleName);\n var request = bareMain !== null && bareMain !== void 0 ? bareMain : moduleName;\n var packageEnd = request.indexOf(\"/\", request.startsWith(\"@\") ? request.indexOf(\"/\") + 1 : 0);\n var packageName = packageEnd === -1 ? request : request.slice(0, packageEnd);\n var resolutionContext = isBareSpecifier(request) && dedupedPackages.has(packageName) ? {\n ...context,\n originModulePath: rootOrigin\n } : context;\n var resolveRequest2 = innerResolveRequest || context.resolveRequest;\n return resolveRequest2(resolutionContext, request, platform);\n }\n }\n };\n}\nasync function isWatchmanResponsive(projectRoot) {\n var probe = watchmanResponsivePromises.get(projectRoot);\n if (probe) {\n return probe;\n }\n probe = new Promise(function(resolve2) {\n var settled = false;\n var finish = function finish2(value) {\n if (settled) return;\n settled = true;\n clearTimeout(timeout);\n resolve2(value);\n };\n var child = spawn(\"watchman\", [\n \"watch-project\",\n projectRoot\n ], {\n stdio: \"ignore\"\n });\n var timeout = setTimeout(function() {\n child.kill();\n finish(false);\n }, WATCHMAN_PROBE_TIMEOUT_MS);\n child.once(\"error\", function() {\n finish(false);\n });\n child.once(\"exit\", function(code) {\n finish(code === 0);\n });\n });\n watchmanResponsivePromises.set(projectRoot, probe);\n return probe;\n}\nfunction resolveNativeTransforms(projectRoot, metroPluginOptions) {\n var userBabelConfigPath = projectRoot ? findUserBabelConfig(projectRoot) : null;\n var hasUserBabelConfig = Boolean(userBabelConfigPath);\n var isNativeTransforms = process.env.ONE_METRO_NATIVE_TRANSFORMS === \"0\" ? false : process.env.ONE_METRO_NATIVE_TRANSFORMS === \"1\" ? true : metroPluginOptions.nativeTransforms === false ? false : metroPluginOptions.nativeTransforms === true ? true : hasUserBabelConfig ? false : true;\n if (userBabelConfigPath && isNativeTransforms) {\n console.warn(`[vxrn/metro] Ignoring user babel config at ${userBabelConfigPath} because native transforms are explicitly enabled (nativeTransforms: true or ONE_METRO_NATIVE_TRANSFORMS=1). Port its plugins to nativeTransformModules, or set nativeTransforms: false (or ONE_METRO_NATIVE_TRANSFORMS=0) to use the babel transformer.`);\n }\n return {\n isNativeTransforms,\n userBabelConfigPath\n };\n}\nasync function buildMetroConfigInputFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = resolve((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n var merged = {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n };\n return {\n defaultConfig: enforcePackageResolution(enforceWorkspaceVisibility(merged, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n projectRoot,\n extraConfig\n };\n}\nasync function getMetroConfigFromViteConfig(config, metroPluginOptions) {\n var _ref, _ref1, _ref2, _ref3;\n var _metroPluginOptions_argv, _defaultConfig_resolver, _defaultConfig_watcher, _defaultConfig_resolver1, _config_resolve;\n var extraConfig = {};\n var projectRoot = resolve((_ref = (_metroPluginOptions_argv = metroPluginOptions.argv) === null || _metroPluginOptions_argv === void 0 ? void 0 : _metroPluginOptions_argv.projectRoot) !== null && _ref !== void 0 ? _ref : config.root);\n var { mainModuleName, argv, defaultConfigOverrides, watchman, excludeModules } = metroPluginOptions;\n var useWatchman = watchman !== null && watchman !== void 0 ? watchman : await isWatchmanResponsive(projectRoot);\n if (watchman === void 0 && !useWatchman && !didWarnAboutWatchmanFallback) {\n didWarnAboutWatchmanFallback = true;\n console.warn(\"[vxrn/metro] Watchman is unavailable or unresponsive; falling back to Node file watching.\");\n }\n var { loadConfig } = await projectImport(projectRoot, \"metro\");\n var _defaultConfig = getReactNativeDefaultConfig(projectRoot);\n if (mainModuleName) {\n var _defaultConfig_server;\n var origRewriteRequestUrl = (_defaultConfig_server = _defaultConfig.server) === null || _defaultConfig_server === void 0 ? void 0 : _defaultConfig_server.rewriteRequestUrl;\n var resolveMainModuleName = function resolveMainModuleName2() {\n return mainModuleName;\n };\n extraConfig.getResolveMainModuleName = resolveMainModuleName;\n _defaultConfig.server.rewriteRequestUrl = function(url) {\n var _ref4;\n if (isMainModuleBundleRequest(url)) {\n return rewriteMainModuleBundleUrl(url, resolveMainModuleName);\n }\n return (_ref4 = origRewriteRequestUrl === null || origRewriteRequestUrl === void 0 ? void 0 : origRewriteRequestUrl(url)) !== null && _ref4 !== void 0 ? _ref4 : url;\n };\n }\n var existingBlockList = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver = _defaultConfig.resolver) === null || _defaultConfig_resolver === void 0 ? void 0 : _defaultConfig_resolver.blockList;\n var blockList = [\n ...existingBlockList ? Array.isArray(existingBlockList) ? existingBlockList : [\n existingBlockList\n ] : [],\n ...metroWatchExclusions\n ];\n var { isNativeTransforms } = resolveNativeTransforms(projectRoot, metroPluginOptions);\n var nativeWorkerPath;\n if (isNativeTransforms) {\n nativeWorkerPath = projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/transformer/metroNativeWorker\");\n }\n var defaultConfig = {\n ..._defaultConfig,\n watcher: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.watcher,\n additionalExts: [\n .../* @__PURE__ */ new Set([\n ...(_ref1 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_watcher = _defaultConfig.watcher) === null || _defaultConfig_watcher === void 0 ? void 0 : _defaultConfig_watcher.additionalExts) !== null && _ref1 !== void 0 ? _ref1 : [],\n ...expoEnvAdditionalExts\n ])\n ]\n },\n resolver: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.resolver,\n useWatchman,\n blockList,\n sourceExts: metroSourceExts,\n platforms: [\n .../* @__PURE__ */ new Set([\n ...(_ref2 = _defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver1 = _defaultConfig.resolver) === null || _defaultConfig_resolver1 === void 0 ? void 0 : _defaultConfig_resolver1.platforms) !== null && _ref2 !== void 0 ? _ref2 : [],\n \"macos\",\n \"linux\"\n ])\n ],\n resolveRequest: function resolveRequest(context, moduleName, platform) {\n var _defaultConfig_resolver2;\n var origResolveRequestFn = (_defaultConfig === null || _defaultConfig === void 0 ? void 0 : (_defaultConfig_resolver2 = _defaultConfig.resolver) === null || _defaultConfig_resolver2 === void 0 ? void 0 : _defaultConfig_resolver2.resolveRequest) || context.resolveRequest;\n if (excludeModules && excludeModules.length > 0) {\n if (micromatch.isMatch(moduleName, excludeModules)) {\n return origResolveRequestFn(context, \"@vxrn/utils/empty\", platform);\n }\n }\n if (moduleName.startsWith(\"@babel/runtime\")) {\n var contextOverride = {\n ...context,\n unstable_conditionNames: context.unstable_conditionNames.filter(function(c) {\n return c !== \"import\";\n })\n };\n return origResolveRequestFn(contextOverride, moduleName, platform);\n }\n var desktopRedirect = redirectDesktopReactNative(projectRoot, context.originModulePath, moduleName, platform);\n if (desktopRedirect) return desktopRedirect;\n return origResolveRequestFn(context, moduleName, platform);\n }\n },\n transformer: {\n ..._defaultConfig === null || _defaultConfig === void 0 ? void 0 : _defaultConfig.transformer,\n // one's router and Expo's optional development env module both use\n // require.context. Metro installs a throwing runtime stub unless this\n // graph feature is enabled.\n unstable_allowRequireContext: true,\n babelTransformerPath: projectResolve(projectRoot, \"@vxrn/vite-plugin-metro/babel-transformer\")\n },\n // transformerPath is a TOP-LEVEL metro config key, not a transformer option.\n // nesting it under transformer silently leaves metro on its default worker.\n ...nativeWorkerPath ? {\n transformerPath: nativeWorkerPath\n } : {},\n reporter: await getTerminalReporter(projectRoot)\n };\n var metroConfig = await loadConfig({\n cwd: projectRoot,\n projectRoot,\n \"reset-cache\": !!process.env.METRO_RESET_CACHE,\n ...argv\n }, {\n ...defaultConfig,\n ...typeof defaultConfigOverrides === \"function\" ? defaultConfigOverrides(defaultConfig) : defaultConfigOverrides\n });\n return {\n ...enforcePackageResolution(enforceWorkspaceVisibility(metroConfig, projectRoot), mainModuleName, (_ref3 = (_config_resolve = config.resolve) === null || _config_resolve === void 0 ? void 0 : _config_resolve.dedupe) !== null && _ref3 !== void 0 ? _ref3 : [], projectRoot),\n ...extraConfig\n };\n}\nexport {\n buildMetroConfigInputFromViteConfig,\n getMetroConfigFromViteConfig\n};\n//# sourceMappingURL=getMetroConfigFromViteConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;AAYA,IAAI,4BAA4B;AAChC,IAAI,wBAAwB;CAC1B;CACA;CACA;AACF;AACA,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B,SAAS,YAAY,QAAQ;GAC3D;EACF;EACA,aAAa;GACX,GAAG,mBAAmB,QAAQ,mBAAmB,KAAK,IAAI,KAAK,IAAI,eAAe;GAIlF,8BAA8B;GAC9B,sBAAsB,eAAe,aAAa,2CAA2C;EAC/F;EAGA,GAAG,mBAAmB,EACpB,iBAAiB,iBACnB,IAAI,CAAC;EACL,UAAU,MAAM,oBAAoB,WAAW;CACjD;CACA,IAAI,cAAc,MAAM,WAAW;EACjC,KAAK;EACL;EACA,eAAe,CAAC,CAAC,QAAQ,IAAI;EAC7B,GAAG;CACL,GAAG;EACD,GAAG;EACH,GAAG,OAAO,2BAA2B,aAAa,uBAAuB,aAAa,IAAI;CAC5F,CAAC;CACD,OAAO;EACL,GAAG,yBAAyB,2BAA2B,aAAa,WAAW,GAAG,iBAAiB,SAAS,kBAAkB,OAAO,aAAa,QAAQ,oBAAoB,KAAK,IAAI,KAAK,IAAI,gBAAgB,YAAY,QAAQ,UAAU,KAAK,IAAI,QAAQ,CAAC,GAAG,WAAW;EAC9Q,GAAG;CACL;AACF"}
|
|
@@ -26,7 +26,7 @@ async function buildBundleWithConfig(args, config, bundleImpl = metroBundle, { p
|
|
|
26
26
|
unstable_transformProfile: args.unstableTransformProfile,
|
|
27
27
|
customResolverOptions
|
|
28
28
|
};
|
|
29
|
-
const server = new Server(config);
|
|
29
|
+
const server = new Server(config, { watch: false });
|
|
30
30
|
if (patchServer) {
|
|
31
31
|
patchServer(server);
|
|
32
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBundleWithConfig.js","names":["fs"],"sources":["esm/rn-commands/bundle/buildBundleWithConfig.js"],"sourcesContent":["import path from \"node:path\";\nimport { promises as fs } from \"node:fs\";\nimport ServerModule from \"metro/private/Server\";\nimport metroBundle from \"metro/private/shared/output/bundle\";\nimport saveAssets from \"./saveAssets\";\nconst Server = ServerModule.default;\nasync function buildBundleWithConfig(args, config, bundleImpl = metroBundle, { patchServer } = {}) {\n const customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(\n `Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`\n );\n console.info(\n `Available platforms are: ${config.resolver.platforms.map((x) => `\"${x}\"`).join(\n \", \"\n )}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`\n );\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n let sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n const requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n const server = new Server(config);\n if (patchServer) {\n patchServer(server);\n }\n try {\n const bundle = await bundleImpl.build(server, requestOpts);\n await fs.mkdir(path.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n const outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await saveAssets(\n outputAssets,\n args.platform,\n args.assetsDest,\n args.assetCatalogDest\n );\n } finally {\n await server.end();\n }\n}\nexport {\n buildBundleWithConfig\n};\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;;;;;AAKA,MAAM,SAAS,aAAa;AAC5B,eAAe,sBAAsB,MAAM,QAAQ,aAAa,aAAa,EAAE,gBAAgB,CAAC,GAAG;CACjG,MAAM,wBAAwB,CAAC;CAC/B,IAAI,OAAO,SAAS,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC,GAAG;EAC3D,QAAQ,MACN,oBAAoB,KAAK,WAAW,IAAI,KAAK,SAAS,MAAM,GAAG,UACjE;EACA,QAAQ,KACN,4BAA4B,OAAO,SAAS,UAAU,KAAK,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,KACzE,IACF,EAAE,oFACJ;EACA,MAAM,IAAI,MAAM,iBAAiB;CACnC;CACA,QAAQ,IAAI,WAAW,KAAK,MAAM,gBAAgB;CAClD,IAAI,eAAe,KAAK;CACxB,IAAI,gBAAgB,QAAQ,CAAC,KAAK,0BAA0B;EAC1D,eAAe,KAAK,SAAS,YAAY;CAC3C;CACA,MAAM,cAAc;EAClB,WAAW,KAAK;EAChB;EACA,KAAK,KAAK;EACV,QAAQ,KAAK,WAAW,KAAK,IAAI,KAAK,SAAS,CAAC,KAAK;EACrD,UAAU,KAAK;EACf,2BAA2B,KAAK;EAChC;CACF;CACA,MAAM,SAAS,IAAI,OAAO,MAAM;
|
|
1
|
+
{"version":3,"file":"buildBundleWithConfig.js","names":["fs"],"sources":["esm/rn-commands/bundle/buildBundleWithConfig.js"],"sourcesContent":["import path from \"node:path\";\nimport { promises as fs } from \"node:fs\";\nimport ServerModule from \"metro/private/Server\";\nimport metroBundle from \"metro/private/shared/output/bundle\";\nimport saveAssets from \"./saveAssets\";\nconst Server = ServerModule.default;\nasync function buildBundleWithConfig(args, config, bundleImpl = metroBundle, { patchServer } = {}) {\n const customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(\n `Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`\n );\n console.info(\n `Available platforms are: ${config.resolver.platforms.map((x) => `\"${x}\"`).join(\n \", \"\n )}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`\n );\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n let sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n const requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n const server = new Server(config, { watch: false });\n if (patchServer) {\n patchServer(server);\n }\n try {\n const bundle = await bundleImpl.build(server, requestOpts);\n await fs.mkdir(path.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n const outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await saveAssets(\n outputAssets,\n args.platform,\n args.assetsDest,\n args.assetCatalogDest\n );\n } finally {\n await server.end();\n }\n}\nexport {\n buildBundleWithConfig\n};\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;;;;;AAKA,MAAM,SAAS,aAAa;AAC5B,eAAe,sBAAsB,MAAM,QAAQ,aAAa,aAAa,EAAE,gBAAgB,CAAC,GAAG;CACjG,MAAM,wBAAwB,CAAC;CAC/B,IAAI,OAAO,SAAS,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC,GAAG;EAC3D,QAAQ,MACN,oBAAoB,KAAK,WAAW,IAAI,KAAK,SAAS,MAAM,GAAG,UACjE;EACA,QAAQ,KACN,4BAA4B,OAAO,SAAS,UAAU,KAAK,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC,KACzE,IACF,EAAE,oFACJ;EACA,MAAM,IAAI,MAAM,iBAAiB;CACnC;CACA,QAAQ,IAAI,WAAW,KAAK,MAAM,gBAAgB;CAClD,IAAI,eAAe,KAAK;CACxB,IAAI,gBAAgB,QAAQ,CAAC,KAAK,0BAA0B;EAC1D,eAAe,KAAK,SAAS,YAAY;CAC3C;CACA,MAAM,cAAc;EAClB,WAAW,KAAK;EAChB;EACA,KAAK,KAAK;EACV,QAAQ,KAAK,WAAW,KAAK,IAAI,KAAK,SAAS,CAAC,KAAK;EACrD,UAAU,KAAK;EACf,2BAA2B,KAAK;EAChC;CACF;CACA,MAAM,SAAS,IAAI,OAAO,QAAQ,EAAE,OAAO,MAAM,CAAC;CAClD,IAAI,aAAa;EACf,YAAY,MAAM;CACpB;CACA,IAAI;EACF,MAAM,SAAS,MAAM,WAAW,MAAM,QAAQ,WAAW;EACzD,MAAMA,SAAG,MAAM,KAAK,QAAQ,KAAK,YAAY,GAAG;GAC9C,WAAW;GACX,MAAM;EACR,CAAC;EACD,MAAM,WAAW,KAAK,QAAQ,MAAM,QAAQ,IAAI;EAChD,MAAM,eAAe,MAAM,OAAO,UAAU;GAC1C,GAAG,OAAO;GACV,GAAG;EACL,CAAC;EACD,OAAO,MAAM,WACX,cACA,KAAK,UACL,KAAK,YACL,KAAK,gBACP;CACF,UAAU;EACR,MAAM,OAAO,IAAI;CACnB;AACF"}
|
|
@@ -29,7 +29,7 @@ async function buildBundleWithConfig(args, config) {
|
|
|
29
29
|
unstable_transformProfile: args.unstableTransformProfile,
|
|
30
30
|
customResolverOptions
|
|
31
31
|
};
|
|
32
|
-
var server = new Server(config);
|
|
32
|
+
var server = new Server(config, { watch: false });
|
|
33
33
|
if (patchServer) {
|
|
34
34
|
patchServer(server);
|
|
35
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildBundleWithConfig.native.js","names":["fs"],"sources":["esm/rn-commands/bundle/buildBundleWithConfig.native.js"],"sourcesContent":["import path from \"path\";\nimport { promises as fs } from \"fs\";\nimport ServerModule from \"metro/private/Server\";\nimport metroBundle from \"metro/private/shared/output/bundle\";\nimport saveAssets from \"./saveAssets\";\nvar Server = ServerModule.default;\nasync function buildBundleWithConfig(args, config) {\n var bundleImpl = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : metroBundle, { patchServer } = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};\n var customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(`Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`);\n console.info(`Available platforms are: ${config.resolver.platforms.map(function(x) {\n return `\"${x}\"`;\n }).join(\", \")}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n var sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n var requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n var server = new Server(config);\n if (patchServer) {\n patchServer(server);\n }\n try {\n var bundle = await bundleImpl.build(server, requestOpts);\n await fs.mkdir(path.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n var outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await saveAssets(outputAssets, args.platform, args.assetsDest, args.assetCatalogDest);\n } finally {\n await server.end();\n }\n}\nexport {\n buildBundleWithConfig\n};\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,SAAS,aAAa;AAC1B,eAAe,sBAAsB,MAAM,QAAQ;CACjD,IAAI,aAAa,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,aAAa,EAAE,gBAAgB,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CACnL,IAAI,wBAAwB,CAAC;CAC7B,IAAI,OAAO,SAAS,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC,GAAG;EAC3D,QAAQ,MAAM,oBAAoB,KAAK,WAAW,IAAI,KAAK,SAAS,MAAM,GAAG,UAAU;EACvF,QAAQ,KAAK,4BAA4B,OAAO,SAAS,UAAU,IAAI,SAAS,GAAG;GACjF,OAAO,IAAI,EAAE;EACf,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,oFAAoF;EAClG,MAAM,IAAI,MAAM,iBAAiB;CACnC;CACA,QAAQ,IAAI,WAAW,KAAK,MAAM,gBAAgB;CAClD,IAAI,eAAe,KAAK;CACxB,IAAI,gBAAgB,QAAQ,CAAC,KAAK,0BAA0B;EAC1D,eAAe,KAAK,SAAS,YAAY;CAC3C;CACA,IAAI,cAAc;EAChB,WAAW,KAAK;EAChB;EACA,KAAK,KAAK;EACV,QAAQ,KAAK,WAAW,KAAK,IAAI,KAAK,SAAS,CAAC,KAAK;EACrD,UAAU,KAAK;EACf,2BAA2B,KAAK;EAChC;CACF;CACA,IAAI,SAAS,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"buildBundleWithConfig.native.js","names":["fs"],"sources":["esm/rn-commands/bundle/buildBundleWithConfig.native.js"],"sourcesContent":["import path from \"path\";\nimport { promises as fs } from \"fs\";\nimport ServerModule from \"metro/private/Server\";\nimport metroBundle from \"metro/private/shared/output/bundle\";\nimport saveAssets from \"./saveAssets\";\nvar Server = ServerModule.default;\nasync function buildBundleWithConfig(args, config) {\n var bundleImpl = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : metroBundle, { patchServer } = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};\n var customResolverOptions = {};\n if (config.resolver.platforms.indexOf(args.platform) === -1) {\n console.error(`Invalid platform ${args.platform ? `\"${args.platform}\" ` : \"\"}selected.`);\n console.info(`Available platforms are: ${config.resolver.platforms.map(function(x) {\n return `\"${x}\"`;\n }).join(\", \")}. If you are trying to bundle for an out-of-tree platform, it may not be installed.`);\n throw new Error(\"Bundling failed\");\n }\n process.env.NODE_ENV = args.dev ? \"development\" : \"production\";\n var sourceMapUrl = args.sourcemapOutput;\n if (sourceMapUrl != null && !args.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n var requestOpts = {\n entryFile: args.entryFile,\n sourceMapUrl,\n dev: args.dev,\n minify: args.minify !== void 0 ? args.minify : !args.dev,\n platform: args.platform,\n unstable_transformProfile: args.unstableTransformProfile,\n customResolverOptions\n };\n var server = new Server(config, {\n watch: false\n });\n if (patchServer) {\n patchServer(server);\n }\n try {\n var bundle = await bundleImpl.build(server, requestOpts);\n await fs.mkdir(path.dirname(args.bundleOutput), {\n recursive: true,\n mode: 493\n });\n await bundleImpl.save(bundle, args, console.info);\n var outputAssets = await server.getAssets({\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...requestOpts\n });\n return await saveAssets(outputAssets, args.platform, args.assetsDest, args.assetCatalogDest);\n } finally {\n await server.end();\n }\n}\nexport {\n buildBundleWithConfig\n};\n//# sourceMappingURL=buildBundleWithConfig.js.map\n"],"mappings":";;;;;;;AAKA,IAAI,SAAS,aAAa;AAC1B,eAAe,sBAAsB,MAAM,QAAQ;CACjD,IAAI,aAAa,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,aAAa,EAAE,gBAAgB,UAAU,SAAS,KAAK,UAAU,OAAO,KAAK,IAAI,UAAU,KAAK,CAAC;CACnL,IAAI,wBAAwB,CAAC;CAC7B,IAAI,OAAO,SAAS,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC,GAAG;EAC3D,QAAQ,MAAM,oBAAoB,KAAK,WAAW,IAAI,KAAK,SAAS,MAAM,GAAG,UAAU;EACvF,QAAQ,KAAK,4BAA4B,OAAO,SAAS,UAAU,IAAI,SAAS,GAAG;GACjF,OAAO,IAAI,EAAE;EACf,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,oFAAoF;EAClG,MAAM,IAAI,MAAM,iBAAiB;CACnC;CACA,QAAQ,IAAI,WAAW,KAAK,MAAM,gBAAgB;CAClD,IAAI,eAAe,KAAK;CACxB,IAAI,gBAAgB,QAAQ,CAAC,KAAK,0BAA0B;EAC1D,eAAe,KAAK,SAAS,YAAY;CAC3C;CACA,IAAI,cAAc;EAChB,WAAW,KAAK;EAChB;EACA,KAAK,KAAK;EACV,QAAQ,KAAK,WAAW,KAAK,IAAI,KAAK,SAAS,CAAC,KAAK;EACrD,UAAU,KAAK;EACf,2BAA2B,KAAK;EAChC;CACF;CACA,IAAI,SAAS,IAAI,OAAO,QAAQ,EAC9B,OAAO,MACT,CAAC;CACD,IAAI,aAAa;EACf,YAAY,MAAM;CACpB;CACA,IAAI;EACF,IAAI,SAAS,MAAM,WAAW,MAAM,QAAQ,WAAW;EACvD,MAAMA,SAAG,MAAM,KAAK,QAAQ,KAAK,YAAY,GAAG;GAC9C,WAAW;GACX,MAAM;EACR,CAAC;EACD,MAAM,WAAW,KAAK,QAAQ,MAAM,QAAQ,IAAI;EAChD,IAAI,eAAe,MAAM,OAAO,UAAU;GACxC,GAAG,OAAO;GACV,GAAG;EACL,CAAC;EACD,OAAO,MAAM,WAAW,cAAc,KAAK,UAAU,KAAK,YAAY,KAAK,gBAAgB;CAC7F,UAAU;EACR,MAAM,OAAO,IAAI;CACnB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxrn/vite-plugin-metro",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -69,17 +69,19 @@
|
|
|
69
69
|
"@oxc-project/runtime": "^0.112.0",
|
|
70
70
|
"@react-native/babel-preset": "^0.88.0",
|
|
71
71
|
"@react-native/metro-config": "^0.88.0",
|
|
72
|
-
"@vxrn/compiler": "2.
|
|
73
|
-
"@vxrn/debug": "2.
|
|
74
|
-
"@vxrn/utils": "2.
|
|
75
|
-
"esbuild": "^0.
|
|
72
|
+
"@vxrn/compiler": "2.17.0",
|
|
73
|
+
"@vxrn/debug": "2.17.0",
|
|
74
|
+
"@vxrn/utils": "2.17.0",
|
|
75
|
+
"esbuild": "^0.28.1",
|
|
76
76
|
"flow-parser": "^0.336.0",
|
|
77
77
|
"launch-editor": "^2.14.2",
|
|
78
78
|
"magic-string": "^0.30.21",
|
|
79
79
|
"micromatch": "^4.0.8",
|
|
80
80
|
"oxc-parser": "^0.112.0",
|
|
81
81
|
"oxc-transform": "^0.148.0",
|
|
82
|
-
"picocolors": "^1.0.0"
|
|
82
|
+
"picocolors": "^1.0.0",
|
|
83
|
+
"resolve-workspace-root": "^2.0.1",
|
|
84
|
+
"tinyglobby": "^0.2.17"
|
|
83
85
|
},
|
|
84
86
|
"devDependencies": {
|
|
85
87
|
"@biomejs/biome": "2.5.15",
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"publishConfig": {
|
|
98
100
|
"access": "public"
|
|
99
101
|
},
|
|
100
|
-
"releaseSourceCommit": "
|
|
102
|
+
"releaseSourceCommit": "3b9704636a5a718fd58951d0e3bf5007cb6137fa",
|
|
101
103
|
"repository": {
|
|
102
104
|
"type": "git",
|
|
103
105
|
"url": "git+https://github.com/onejs/one.git",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import fs from 'node:fs'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
+
import os from 'node:os'
|
|
3
4
|
import { createRequire } from 'node:module'
|
|
4
5
|
import { runInNewContext } from 'node:vm'
|
|
5
6
|
import { resolveConfig } from 'vite'
|
|
@@ -144,16 +145,20 @@ require('@fixture/registry-extra'), require('plain'), require('./local'), requir
|
|
|
144
145
|
resolver: { ...config?.resolver, ...resolver },
|
|
145
146
|
}),
|
|
146
147
|
} satisfies MetroPluginOptions
|
|
148
|
+
const require = createRequire(path.join(workspaceRoot, 'package.json'))
|
|
149
|
+
const { loadConfig } = require('metro-config')
|
|
147
150
|
const config =
|
|
148
151
|
mode === 'input'
|
|
149
|
-
?
|
|
152
|
+
? await loadConfig(
|
|
153
|
+
{ cwd: fixtureRoot, projectRoot: fixtureRoot },
|
|
154
|
+
(await buildMetroConfigInputFromViteConfig(viteConfig, options)).defaultConfig
|
|
155
|
+
)
|
|
150
156
|
: await getMetroConfigFromViteConfig(viteConfig, options)
|
|
151
157
|
const entry = path.join(fixtureRoot, 'entry.js')
|
|
152
158
|
fs.writeFileSync(
|
|
153
159
|
entry,
|
|
154
160
|
"globalThis.values=[require('@fixture/first'),require('@fixture/second')];"
|
|
155
161
|
)
|
|
156
|
-
const require = createRequire(path.join(workspaceRoot, 'package.json'))
|
|
157
162
|
const Server = require('metro/private/Server').default
|
|
158
163
|
const output = require('metro/private/shared/output/bundle')
|
|
159
164
|
const server = new Server({ ...config, maxWorkers: 1 })
|
|
@@ -209,7 +214,10 @@ describe('bare main module entry', () => {
|
|
|
209
214
|
} as any
|
|
210
215
|
)
|
|
211
216
|
|
|
212
|
-
expect((defaultConfig as any).watchFolders).toContain(workspaceRoot)
|
|
217
|
+
expect((defaultConfig as any).watchFolders).not.toContain(workspaceRoot)
|
|
218
|
+
expect((defaultConfig as any).watchFolders).toContain(
|
|
219
|
+
path.join(workspaceRoot, 'node_modules')
|
|
220
|
+
)
|
|
213
221
|
expect((defaultConfig as any).resolver.nodeModulesPaths).toContain(
|
|
214
222
|
path.join(workspaceRoot, 'node_modules')
|
|
215
223
|
)
|
|
@@ -267,3 +275,158 @@ describe('watch exclusions', () => {
|
|
|
267
275
|
).toBe(false)
|
|
268
276
|
})
|
|
269
277
|
})
|
|
278
|
+
|
|
279
|
+
describe('workspace visibility', () => {
|
|
280
|
+
it.each(['array', 'object', 'pnpm', 'recursive'])(
|
|
281
|
+
'watches workspace packages from %s globs without exposing build output',
|
|
282
|
+
async (kind) => {
|
|
283
|
+
const scratch = path.join(os.homedir(), '.scratch', 'metro-workspace-visibility')
|
|
284
|
+
fs.mkdirSync(scratch, { recursive: true })
|
|
285
|
+
const workspaceRoot = fs.mkdtempSync(path.join(scratch, 'fixture-'))
|
|
286
|
+
tmpDirs.push(workspaceRoot)
|
|
287
|
+
const projectRoot = path.join(workspaceRoot, 'app')
|
|
288
|
+
const shared = path.join(workspaceRoot, 'packages/shared')
|
|
289
|
+
const custom = path.join(workspaceRoot, 'custom')
|
|
290
|
+
const modules = path.join(workspaceRoot, 'node_modules')
|
|
291
|
+
const installedModules = path.resolve(__dirname, '../../../../node_modules')
|
|
292
|
+
const globs = ['app', kind === 'recursive' ? 'packages/**' : 'packages/*']
|
|
293
|
+
fs.writeFileSync(
|
|
294
|
+
path.join(workspaceRoot, 'package.json'),
|
|
295
|
+
JSON.stringify({
|
|
296
|
+
private: true,
|
|
297
|
+
workspaces:
|
|
298
|
+
kind === 'pnpm'
|
|
299
|
+
? ['wrong/*']
|
|
300
|
+
: kind === 'object'
|
|
301
|
+
? { packages: globs }
|
|
302
|
+
: globs,
|
|
303
|
+
})
|
|
304
|
+
)
|
|
305
|
+
if (kind === 'pnpm') {
|
|
306
|
+
fs.writeFileSync(
|
|
307
|
+
path.join(workspaceRoot, 'pnpm-workspace.yaml'),
|
|
308
|
+
'packages: &paths\n - app\n - "packages/*" # workspace packages\n'
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
for (const directory of [
|
|
312
|
+
projectRoot,
|
|
313
|
+
shared,
|
|
314
|
+
custom,
|
|
315
|
+
modules,
|
|
316
|
+
path.join(workspaceRoot, 'target'),
|
|
317
|
+
]) {
|
|
318
|
+
fs.mkdirSync(directory, { recursive: true })
|
|
319
|
+
}
|
|
320
|
+
fs.writeFileSync(path.join(projectRoot, 'package.json'), '{"private":true}')
|
|
321
|
+
fs.symlinkSync(installedModules, path.join(projectRoot, 'node_modules'), 'dir')
|
|
322
|
+
fs.writeFileSync(
|
|
323
|
+
path.join(shared, 'package.json'),
|
|
324
|
+
'{"name":"shared","main":"index.js"}'
|
|
325
|
+
)
|
|
326
|
+
fs.writeFileSync(path.join(shared, 'index.js'), "module.exports='workspace';")
|
|
327
|
+
fs.writeFileSync(path.join(custom, 'index.js'), "module.exports='custom';")
|
|
328
|
+
fs.mkdirSync(path.join(modules, 'root-only'))
|
|
329
|
+
fs.writeFileSync(path.join(modules, 'root-only/index.js'), "module.exports='root';")
|
|
330
|
+
fs.writeFileSync(
|
|
331
|
+
path.join(workspaceRoot, 'target/build-output.js'),
|
|
332
|
+
"module.exports='target';"
|
|
333
|
+
)
|
|
334
|
+
for (const excluded of [
|
|
335
|
+
'missing-manifest',
|
|
336
|
+
'invalid',
|
|
337
|
+
'Pods/hidden',
|
|
338
|
+
'Carthage/hidden',
|
|
339
|
+
'node_modules/hidden',
|
|
340
|
+
]) {
|
|
341
|
+
const directory = path.join(workspaceRoot, 'packages', excluded)
|
|
342
|
+
fs.mkdirSync(directory, { recursive: true })
|
|
343
|
+
if (excluded !== 'missing-manifest') {
|
|
344
|
+
fs.writeFileSync(
|
|
345
|
+
path.join(directory, 'package.json'),
|
|
346
|
+
excluded === 'invalid' ? '{' : '{}'
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
const { defaultConfig } = await buildMetroConfigInputFromViteConfig(
|
|
351
|
+
{ root: projectRoot } as any,
|
|
352
|
+
{
|
|
353
|
+
watchman: false,
|
|
354
|
+
defaultConfigOverrides: (config: any) => ({
|
|
355
|
+
watchFolders: [custom, installedModules, custom],
|
|
356
|
+
resolver: { ...config.resolver, nodeModulesPaths: [modules] },
|
|
357
|
+
}),
|
|
358
|
+
} as any
|
|
359
|
+
)
|
|
360
|
+
expect(defaultConfig.watchFolders).toEqual([
|
|
361
|
+
custom,
|
|
362
|
+
installedModules,
|
|
363
|
+
modules,
|
|
364
|
+
projectRoot,
|
|
365
|
+
shared,
|
|
366
|
+
])
|
|
367
|
+
expect(defaultConfig.resolver.nodeModulesPaths).toEqual([
|
|
368
|
+
modules,
|
|
369
|
+
path.join(projectRoot, 'node_modules'),
|
|
370
|
+
])
|
|
371
|
+
|
|
372
|
+
if (kind !== 'array') return
|
|
373
|
+
const require = createRequire(path.join(installedModules, '../package.json'))
|
|
374
|
+
const Server = require('metro/private/Server').default
|
|
375
|
+
const output = require('metro/private/shared/output/bundle')
|
|
376
|
+
const entry = path.join(projectRoot, 'entry.js')
|
|
377
|
+
const forbiddenEntry = path.join(projectRoot, 'forbidden.js')
|
|
378
|
+
fs.writeFileSync(
|
|
379
|
+
entry,
|
|
380
|
+
"globalThis.values=[require('../packages/shared'),require('root-only'),require('../custom')];"
|
|
381
|
+
)
|
|
382
|
+
fs.writeFileSync(
|
|
383
|
+
forbiddenEntry,
|
|
384
|
+
"globalThis.values=require('../target/build-output');"
|
|
385
|
+
)
|
|
386
|
+
for (const exposeRoot of [true, false]) {
|
|
387
|
+
const server = new Server({
|
|
388
|
+
...defaultConfig,
|
|
389
|
+
watchFolders: [
|
|
390
|
+
...defaultConfig.watchFolders,
|
|
391
|
+
...(exposeRoot ? [workspaceRoot] : []),
|
|
392
|
+
],
|
|
393
|
+
maxWorkers: 1,
|
|
394
|
+
})
|
|
395
|
+
try {
|
|
396
|
+
if (exposeRoot) {
|
|
397
|
+
const bundle = await output.build(server, {
|
|
398
|
+
entryFile: forbiddenEntry,
|
|
399
|
+
platform: 'android',
|
|
400
|
+
dev: false,
|
|
401
|
+
minify: false,
|
|
402
|
+
})
|
|
403
|
+
const observed = { values: '' }
|
|
404
|
+
runInNewContext(bundle.code, observed)
|
|
405
|
+
expect(observed.values).toBe('target')
|
|
406
|
+
} else {
|
|
407
|
+
const bundle = await output.build(server, {
|
|
408
|
+
entryFile: entry,
|
|
409
|
+
platform: 'android',
|
|
410
|
+
dev: false,
|
|
411
|
+
minify: false,
|
|
412
|
+
})
|
|
413
|
+
const observed = { values: [] }
|
|
414
|
+
runInNewContext(bundle.code, observed)
|
|
415
|
+
expect(observed.values).toEqual(['workspace', 'root', 'custom'])
|
|
416
|
+
await expect(
|
|
417
|
+
output.build(server, {
|
|
418
|
+
entryFile: forbiddenEntry,
|
|
419
|
+
platform: 'android',
|
|
420
|
+
dev: false,
|
|
421
|
+
minify: false,
|
|
422
|
+
})
|
|
423
|
+
).rejects.toThrow(/Unable to resolve module/)
|
|
424
|
+
}
|
|
425
|
+
} finally {
|
|
426
|
+
await server.end()
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
180_000
|
|
431
|
+
)
|
|
432
|
+
})
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { searchForWorkspaceRoot, type ResolvedConfig } from 'vite'
|
|
2
2
|
import { spawn } from 'node:child_process'
|
|
3
|
-
import {
|
|
3
|
+
import { readFileSync } from 'node:fs'
|
|
4
|
+
import { dirname, posix, resolve } from 'node:path'
|
|
5
|
+
import workspace from 'resolve-workspace-root'
|
|
6
|
+
import { globSync as globPackagesSync } from 'tinyglobby'
|
|
4
7
|
import micromatch from 'micromatch'
|
|
5
8
|
import { getDefaultConfig } from '@react-native/metro-config'
|
|
6
9
|
|
|
@@ -55,9 +58,41 @@ function enforceWorkspaceVisibility(
|
|
|
55
58
|
const workspaceRoot = searchForWorkspaceRoot(projectRoot)
|
|
56
59
|
if (workspaceRoot === projectRoot) return config
|
|
57
60
|
|
|
61
|
+
let packages: string[] = []
|
|
62
|
+
// match expo/metro-config's getWatchFolders discovery and invalid-manifest handling.
|
|
63
|
+
try {
|
|
64
|
+
packages = (workspace.getWorkspaceGlobs(workspaceRoot) ?? [])
|
|
65
|
+
.flatMap((pattern) =>
|
|
66
|
+
globPackagesSync(posix.join(pattern, 'package.json'), {
|
|
67
|
+
cwd: workspaceRoot,
|
|
68
|
+
absolute: true,
|
|
69
|
+
expandDirectories: false,
|
|
70
|
+
caseSensitiveMatch:
|
|
71
|
+
process.platform !== 'darwin' && process.platform !== 'win32',
|
|
72
|
+
ignore: ['**/@(Carthage|Pods|node_modules)/**'],
|
|
73
|
+
})
|
|
74
|
+
)
|
|
75
|
+
.filter((manifest) => {
|
|
76
|
+
try {
|
|
77
|
+
JSON.parse(readFileSync(manifest, 'utf8'))
|
|
78
|
+
return true
|
|
79
|
+
} catch {
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
.map((manifest) => dirname(manifest))
|
|
84
|
+
} catch {
|
|
85
|
+
packages = []
|
|
86
|
+
}
|
|
87
|
+
|
|
58
88
|
return {
|
|
59
89
|
...config,
|
|
60
|
-
watchFolders: [
|
|
90
|
+
watchFolders: [
|
|
91
|
+
...new Set([
|
|
92
|
+
...(config.watchFolders ?? []),
|
|
93
|
+
...(packages.length ? [resolve(workspaceRoot, 'node_modules'), ...packages] : []),
|
|
94
|
+
]),
|
|
95
|
+
],
|
|
61
96
|
resolver: {
|
|
62
97
|
...config.resolver,
|
|
63
98
|
nodeModulesPaths: [
|
|
@@ -115,7 +150,12 @@ function oneRootFor(projectRoot: string, platform: DesktopPlatform) {
|
|
|
115
150
|
|
|
116
151
|
function getPlatformFromBundleUrl(url: string): 'ios' | 'android' | 'macos' | 'linux' {
|
|
117
152
|
const platform = url.match(/[?&]platform=(ios|android|macos|linux)(?:&|$)/)?.[1]
|
|
118
|
-
if (
|
|
153
|
+
if (
|
|
154
|
+
platform === 'ios' ||
|
|
155
|
+
platform === 'android' ||
|
|
156
|
+
platform === 'macos' ||
|
|
157
|
+
platform === 'linux'
|
|
158
|
+
)
|
|
119
159
|
return platform
|
|
120
160
|
return 'ios'
|
|
121
161
|
}
|
|
@@ -365,11 +405,7 @@ export async function buildMetroConfigInputFromViteConfig(
|
|
|
365
405
|
blockList,
|
|
366
406
|
sourceExts: metroSourceExts,
|
|
367
407
|
platforms: [
|
|
368
|
-
...new Set([
|
|
369
|
-
...(_defaultConfig?.resolver?.platforms ?? []),
|
|
370
|
-
'macos',
|
|
371
|
-
'linux',
|
|
372
|
-
]),
|
|
408
|
+
...new Set([...(_defaultConfig?.resolver?.platforms ?? []), 'macos', 'linux']),
|
|
373
409
|
],
|
|
374
410
|
resolveRequest: (context, moduleName, platform) => {
|
|
375
411
|
const origResolveRequestFn =
|
|
@@ -377,11 +413,7 @@ export async function buildMetroConfigInputFromViteConfig(
|
|
|
377
413
|
|
|
378
414
|
if (excludeModules && excludeModules.length > 0) {
|
|
379
415
|
if (micromatch.isMatch(moduleName, excludeModules)) {
|
|
380
|
-
return origResolveRequestFn(
|
|
381
|
-
context,
|
|
382
|
-
'@vxrn/utils/empty',
|
|
383
|
-
platform
|
|
384
|
-
)
|
|
416
|
+
return origResolveRequestFn(context, '@vxrn/utils/empty', platform)
|
|
385
417
|
}
|
|
386
418
|
}
|
|
387
419
|
|
|
@@ -527,11 +559,7 @@ export async function getMetroConfigFromViteConfig(
|
|
|
527
559
|
blockList,
|
|
528
560
|
sourceExts: metroSourceExts,
|
|
529
561
|
platforms: [
|
|
530
|
-
...new Set([
|
|
531
|
-
...(_defaultConfig?.resolver?.platforms ?? []),
|
|
532
|
-
'macos',
|
|
533
|
-
'linux',
|
|
534
|
-
]),
|
|
562
|
+
...new Set([...(_defaultConfig?.resolver?.platforms ?? []), 'macos', 'linux']),
|
|
535
563
|
],
|
|
536
564
|
resolveRequest: (context, moduleName, platform) => {
|
|
537
565
|
const origResolveRequestFn =
|
|
@@ -540,11 +568,7 @@ export async function getMetroConfigFromViteConfig(
|
|
|
540
568
|
// Handle excludeModules - resolve excluded modules to empty module using glob patterns
|
|
541
569
|
if (excludeModules && excludeModules.length > 0) {
|
|
542
570
|
if (micromatch.isMatch(moduleName, excludeModules)) {
|
|
543
|
-
return origResolveRequestFn(
|
|
544
|
-
context,
|
|
545
|
-
'@vxrn/utils/empty',
|
|
546
|
-
platform
|
|
547
|
-
)
|
|
571
|
+
return origResolveRequestFn(context, '@vxrn/utils/empty', platform)
|
|
548
572
|
}
|
|
549
573
|
}
|
|
550
574
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetroConfigFromViteConfig.d.ts","sourceRoot":"","sources":["../../src/metro-config/getMetroConfigFromViteConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"getMetroConfigFromViteConfig.d.ts","sourceRoot":"","sources":["../../src/metro-config/getMetroConfigFromViteConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,MAAM,CAAA;AAqBlE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA6S/D;;;;;;;GAOG;AACH,wBAAsB,mCAAmC,CACvD,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAAC;IAAE,aAAa,EAAE,GAAG,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,WAAW,CAAA;CAAE,CAAC,CA8IhF;AAED,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,cAAc,EACtB,kBAAkB,EAAE,kBAAkB,GACrC,OAAO,CAAC,mBAAmB,CAAC,CAoK9B"}
|