vxrn 2.7.2 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,17 @@ import FSExtra from "fs-extra";
3
3
  import path, { dirname, extname, join, sep } from "node:path";
4
4
 
5
5
  const { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);
6
+ function isPrebundleableEntry(file) {
7
+ return !/\.d\.[cm]?ts$/i.test(file) && (!extname(file) || /\.[cm]?[jt]s$/.test(file));
8
+ }
9
+ function getExportsMap(exports) {
10
+ if (typeof exports === "string") return { ".": exports };
11
+ if (!exports || typeof exports !== "object" || Array.isArray(exports)) return {};
12
+ return Object.keys(exports).some((k) => k.startsWith(".")) ? exports : { ".": exports };
13
+ }
14
+ function getExportImport(target) {
15
+ return typeof target === "string" ? target : target?.import;
16
+ }
6
17
  const EXCLUDE_LIST = [
7
18
  "jsc-android",
8
19
  "react-shallow-renderer",
@@ -118,14 +129,13 @@ async function scanDepsToOptimize(packageJsonPath, options = rootOptions) {
118
129
  if (!shouldPreBundle) {
119
130
  return [];
120
131
  }
121
- const depPkgJsonExports = depPkgJson.exports || {};
132
+ const depPkgJsonExports = getExportsMap(depPkgJson.exports);
122
133
  const definedExports = Object.keys(depPkgJsonExports).filter((k) => {
123
- const expData = depPkgJsonExports[k];
124
- const imp = typeof expData === "string" ? expData : expData?.import;
134
+ const imp = getExportImport(depPkgJsonExports[k]);
125
135
  if (typeof imp !== "string") {
126
136
  return false;
127
137
  }
128
- if (!imp.endsWith(".js")) {
138
+ if (!isPrebundleableEntry(imp)) {
129
139
  return false;
130
140
  }
131
141
  if (!k.match(/^(\.\/)?[a-zA-Z0-9-_]+$/)) {
@@ -155,9 +165,13 @@ async function scanDepsToOptimize(packageJsonPath, options = rootOptions) {
155
165
  default: return [];
156
166
  }
157
167
  })();
158
- const mainExport = depPkgJson["main"] || depPkgJson["module"] || definedExports["."];
168
+ const mainExport = [
169
+ depPkgJson["main"],
170
+ depPkgJson["module"],
171
+ getExportImport(depPkgJsonExports["."])
172
+ ].find((entry) => typeof entry === "string" && entry && isPrebundleableEntry(entry));
159
173
  const exports = [...definedExports, ...specialExports].filter((d) => !EXCLUDE_LIST_SET.has(d));
160
- if (mainExport && (!extname(mainExport) || /\.[cm]?[jt]s$/.test(mainExport))) {
174
+ if (mainExport) {
161
175
  if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {
162
176
  exports.unshift(dep);
163
177
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scanDepsToOptimize.js","names":[],"sources":["utils/scanDepsToOptimize.js"],"sourcesContent":["import { createDebugger } from \"@vxrn/debug\";\nimport FSExtra from \"fs-extra\";\nimport path, { dirname, extname, join, sep } from \"node:path\";\nconst { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);\nconst EXCLUDE_LIST = [\n \"jsc-android\",\n \"react-shallow-renderer\",\n \"fsevents\",\n \"@swc/core\",\n \"@swc/core-darwin-arm64\",\n \"@swc/core-darwin-x64\",\n \"@swc/core-linux-arm-gnueabihf\",\n \"@swc/core-linux-arm64-gnu\",\n \"@swc/core-linux-arm64-musl\",\n \"@swc/core-linux-x64-gnu\",\n \"@swc/core-linux-x64-musl\",\n \"@swc/core-win32-arm64-msvc\",\n \"@swc/core-win32-ia32-msvc\",\n \"@swc/core-win32-x64-msvc\",\n \"lightningcss\",\n // this breaks fileToUrlPath in upstreams, like @discordjs/client\n \"url\",\n \"sharp\",\n \"@sentry/react-native\",\n // not used by web anyway\n // Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry\n // /lib/module/Platform/Platform.web.js:132:20\n \"@shopify/react-native-skia\",\n \"@react-native/virtualized-lists\",\n // Unexpected \"typeof\" in `node_modules/@react-native/virtualized-lists/index.js`\n // Native only, we don't expect SSR to use these packages.\n // Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.\n \"@vxrn/vite-native-hmr\",\n \"@vxrn/compiler\",\n \"@vxrn/vite-native-client\",\n // build-time only, and they load native .node addons the ssr dep optimizer\n // cannot parse. apps list vxrn as a dependency because it is their dev\n // server, which is exactly why it must never be pre-bundled for ssr.\n \"vxrn\",\n \"@vxrn/vite-plugin-metro\",\n \"oxc-transform\",\n \"oxc-parser\",\n \"react-native-ios-utilities\",\n \"react-native-ios-modal\",\n \"react-native-ios-context-menu\",\n \"react-native-haptic-feedback\",\n \"react-native-sortables\",\n \"react-native-image-colors\",\n \"react-native-fast-image\",\n \"react-native-fast-squircle\",\n \"react-native-device-info\",\n // CLI/scripts shouldn't be used in SSR runtime\n \"@tamagui/cli\",\n // only used by static/plugin\n \"@tamagui/static\",\n \"@tamagui/config-default\",\n \"@tamagui/vite-plugin\",\n \"@take-out/scripts\",\n \"@take-out/cli\",\n // Should be used on native only\n \"@tamagui/core/native-test\",\n \"@storybook/react\",\n // native-only or not needed in SSR\n \"@nandorojo/galeria\",\n \"react-native-pager-view\",\n \"@react-native/debugger-shell\",\n // expo's debugger is a standalone app, not an SSR runtime dependency.\n \"@expo/cli\",\n \"@expo/log-box\",\n \"@hot-updater/react-native\",\n \"@hot-updater/plugin-core\",\n \"validator\",\n \"zlib\"\n];\nconst EXCLUDE_LIST_SET = new Set(EXCLUDE_LIST);\nconst INCLUDE_LIST = [\n // ReferenceError: exports is not defined - at eval (.../node_modules/inline-style-prefixer/lib/createPrefixer.js:3:23)\n \"inline-style-prefixer\",\n \"react-native-vector-icons\",\n \"jotai\"\n];\nconst INCLUDE_LIST_SET = new Set(INCLUDE_LIST);\nconst rootOptions = {};\nasync function scanDepsToOptimize(packageJsonPath, options = rootOptions) {\n const { parentDepNames = [], proceededDeps = /* @__PURE__ */ new Map(), pkgJsonContent } = options;\n if (options === rootOptions) {\n console.info(`[one] Scanning node_modules to auto-optimize...`);\n }\n const noExternalDeps = /* @__PURE__ */ new Set();\n const currentRoot = path.dirname(packageJsonPath);\n const pkgJson = pkgJsonContent || await readPackageJsonSafe(packageJsonPath);\n const deps = Object.keys(pkgJson.dependencies || {});\n const needsWorklets = (json) => !!(json.dependencies?.[\"react-native-reanimated\"] || json.dependencies?.[\"react-native-worklets\"]);\n let hasReanimated = needsWorklets(pkgJson);\n const prebundleDeps = (await Promise.all(\n deps.map(async (dep) => {\n if (parentDepNames.includes(dep)) {\n return [];\n }\n const cachedResult = proceededDeps.get(dep);\n if (cachedResult) {\n return cachedResult;\n }\n if (EXCLUDE_LIST_SET.has(dep)) {\n return [];\n }\n const localPath = await findDepPkgJsonPath(dep, currentRoot);\n if (!localPath) return [];\n const depPkgJsonPath = await FSExtra.realpath(localPath);\n if (options.filter && !options.filter(depPkgJsonPath)) {\n return [];\n }\n const depPkgJson = await readPackageJsonSafe(depPkgJsonPath);\n if (needsWorklets(depPkgJson)) {\n hasReanimated = true;\n }\n if (depPkgJson.codegenConfig != null) {\n noExternalDeps.add(dep);\n debug?.(`${dep} skipped: declares codegenConfig (native codegen package)`);\n return [];\n }\n const subDeps = await scanDepsToOptimize(depPkgJsonPath, {\n parentDepNames: [...parentDepNames, dep],\n pkgJsonContent: depPkgJson,\n proceededDeps\n });\n for (const dep2 of subDeps.noExternalDeps) noExternalDeps.add(dep2);\n if (subDeps.hasReanimated) {\n hasReanimated = true;\n }\n const shouldPreBundle = subDeps.prebundleDeps.length > 0 || INCLUDE_LIST_SET.has(\n dep\n ) || hasRequiredDep(depPkgJson, \"react\") || // an optional react peer still means the package ships react\n // entrypoints (e.g. better-auth/react). left external, those load a\n // second react copy in SSR and crash hooks with a null dispatcher.\n !!depPkgJson.peerDependencies?.react || hasRequiredDep(depPkgJson, \"react-native\") || hasRequiredDep(depPkgJson, \"expo-modules-core\") || // expo packages publish extensionless ESM imports that Node cannot\n // execute directly. Keep installed Expo modules inside Vite's SSR\n // graph without making Expo a framework dependency.\n dep.startsWith(\"@expo/\") || dep.startsWith(\"expo-\");\n debug?.(`${dep} shouldPreBundle? ${shouldPreBundle}`);\n const depsToPreBundle = await (async () => {\n if (!shouldPreBundle) {\n return [];\n }\n const depPkgJsonExports = depPkgJson.exports || {};\n const definedExports = Object.keys(depPkgJsonExports).filter((k) => {\n const expData = depPkgJsonExports[k];\n const imp = typeof expData === \"string\" ? expData : expData?.import;\n if (typeof imp !== \"string\") {\n return false;\n }\n if (!imp.endsWith(\".js\")) {\n return false;\n }\n if (!k.match(/^(\\.\\/)?[a-zA-Z0-9-_]+$/)) {\n return false;\n }\n return true;\n }).map((k) => k.replace(/^\\.\\/?/, \"\")).map((k) => `${dep}/${k}`);\n const specialExports = (() => {\n switch (dep) {\n case \"react-native-vector-icons\":\n return [\n \"AntDesign\",\n \"Entypo\",\n \"EvilIcons\",\n \"Feather\",\n \"FontAwesome\",\n \"FontAwesome5\",\n \"FontAwesome5Pro\",\n \"Fontisto\",\n \"Foundation\",\n \"Ionicons\",\n \"MaterialCommunityIcons\",\n \"MaterialIcons\",\n \"Octicons\",\n \"SimpleLineIcons\",\n \"Zocial\"\n ].map((n) => `${dep}/${n}`);\n default:\n return [];\n }\n })();\n const mainExport = depPkgJson[\"main\"] || depPkgJson[\"module\"] || definedExports[\".\"];\n const exports = [...definedExports, ...specialExports].filter(\n (d) => !EXCLUDE_LIST_SET.has(d)\n );\n if (mainExport && (!extname(mainExport) || /\\.[cm]?[jt]s$/.test(mainExport))) {\n if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {\n exports.unshift(dep);\n }\n }\n return exports;\n })();\n const result = [...depsToPreBundle, ...subDeps.prebundleDeps];\n debugDetails?.(`final result ${JSON.stringify(result, null, 2)}`);\n proceededDeps.set(dep, result);\n return result;\n })\n )).flat().filter((dep, index, arr) => arr.indexOf(dep) === index);\n const hasNativewind = !!pkgJson.dependencies?.[\"nativewind\"];\n if ((hasNativewind || hasReanimated) && options === rootOptions) {\n if (hasReanimated)\n console.info(\n `[one] Enabled babel plugins: ${[hasReanimated ? \"Reanimated\" : \"\", hasNativewind ? \"Nativewind\" : \"\"].filter(Boolean).join(\", \")}`\n );\n }\n return {\n prebundleDeps,\n noExternalDeps: [...noExternalDeps],\n hasReanimated,\n // only check if set in root, dont want to enable css mode too easily\n hasNativewind\n };\n}\nasync function checkIfExportExists(pathIn) {\n const paths = [\n pathIn,\n ...extname(pathIn) ? [] : [pathIn + \".js\", pathIn + sep + \"index.js\"]\n ];\n for (const path2 of paths) {\n if (await FSExtra.pathExists(path2)) {\n return true;\n }\n }\n return false;\n}\nasync function readPackageJsonSafe(packageJsonPath) {\n try {\n return await FSExtra.readJson(packageJsonPath);\n } catch (e) {\n console.error(\n `[scanDepsToPreBundleForSsr] Error reading package.json from ${packageJsonPath}: ${e}`\n );\n return {};\n }\n}\nasync function findDepPkgJsonPath(dep, dependent) {\n let root = dependent;\n while (root) {\n const possiblePkgJson = path.join(root, \"node_modules\", dep, \"package.json\");\n if (await FSExtra.pathExists(possiblePkgJson)) {\n return possiblePkgJson;\n }\n const nextRoot = path.dirname(root);\n if (nextRoot === root) break;\n root = nextRoot;\n }\n console.error(\n `[findDepPkgJsonPath] Could not find package.json for ${dep}, which is a dependency of ${dependent}`\n );\n return void 0;\n}\nfunction hasRequiredDep(pkgJson, depName) {\n return !!(pkgJson.dependencies?.[depName] || pkgJson.peerDependencies?.[depName] && !pkgJson.peerDependenciesMeta?.[depName]?.optional);\n}\nexport {\n EXCLUDE_LIST,\n EXCLUDE_LIST_SET,\n INCLUDE_LIST,\n INCLUDE_LIST_SET,\n findDepPkgJsonPath,\n scanDepsToOptimize\n};\n//# sourceMappingURL=scanDepsToOptimize.js.map\n"],"mappings":";;;;;AAGA,MAAM,EAAE,OAAO,iBAAiB,eAAe,yBAAyB;AACxE,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAIA;CACA;CAIA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA;CACA;C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B,IAAI,MAAM,QAAQ,WAAW,KAAK,GAAG;GACnC,OAAO;EACT;CACF;CACA,OAAO;AACT;AACA,eAAe,oBAAoB,iBAAiB;CAClD,IAAI;EACF,OAAO,MAAM,QAAQ,SAAS,eAAe;CAC/C,SAAS,GAAG;EACV,QAAQ,MACN,+DAA+D,gBAAgB,IAAI,GACrF;EACA,OAAO,CAAC;CACV;AACF;AACA,eAAe,mBAAmB,KAAK,WAAW;CAChD,IAAI,OAAO;CACX,OAAO,MAAM;EACX,MAAM,kBAAkB,KAAK,KAAK,MAAM,gBAAgB,KAAK,cAAc;EAC3E,IAAI,MAAM,QAAQ,WAAW,eAAe,GAAG;GAC7C,OAAO;EACT;EACA,MAAM,WAAW,KAAK,QAAQ,IAAI;EAClC,IAAI,aAAa,MAAM;EACvB,OAAO;CACT;CACA,QAAQ,MACN,wDAAwD,IAAI,6BAA6B,WAC3F;CACA,OAAO,KAAK;AACd;AACA,SAAS,eAAe,SAAS,SAAS;CACxC,OAAO,CAAC,EAAE,QAAQ,eAAe,YAAY,QAAQ,mBAAmB,YAAY,CAAC,QAAQ,uBAAuB,QAAQ,EAAE;AAChI"}
1
+ {"version":3,"file":"scanDepsToOptimize.js","names":[],"sources":["utils/scanDepsToOptimize.js"],"sourcesContent":["import { createDebugger } from \"@vxrn/debug\";\nimport FSExtra from \"fs-extra\";\nimport path, { dirname, extname, join, sep } from \"node:path\";\nconst { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);\nfunction isPrebundleableEntry(file) {\n return !/\\.d\\.[cm]?ts$/i.test(file) && (!extname(file) || /\\.[cm]?[jt]s$/.test(file));\n}\nfunction getExportsMap(exports) {\n if (typeof exports === \"string\") return { \".\": exports };\n if (!exports || typeof exports !== \"object\" || Array.isArray(exports)) return {};\n return Object.keys(exports).some((k) => k.startsWith(\".\")) ? exports : { \".\": exports };\n}\nfunction getExportImport(target) {\n return typeof target === \"string\" ? target : target?.import;\n}\nconst EXCLUDE_LIST = [\n \"jsc-android\",\n \"react-shallow-renderer\",\n \"fsevents\",\n \"@swc/core\",\n \"@swc/core-darwin-arm64\",\n \"@swc/core-darwin-x64\",\n \"@swc/core-linux-arm-gnueabihf\",\n \"@swc/core-linux-arm64-gnu\",\n \"@swc/core-linux-arm64-musl\",\n \"@swc/core-linux-x64-gnu\",\n \"@swc/core-linux-x64-musl\",\n \"@swc/core-win32-arm64-msvc\",\n \"@swc/core-win32-ia32-msvc\",\n \"@swc/core-win32-x64-msvc\",\n \"lightningcss\",\n // this breaks fileToUrlPath in upstreams, like @discordjs/client\n \"url\",\n \"sharp\",\n \"@sentry/react-native\",\n // not used by web anyway\n // Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry\n // /lib/module/Platform/Platform.web.js:132:20\n \"@shopify/react-native-skia\",\n \"@react-native/virtualized-lists\",\n // Unexpected \"typeof\" in `node_modules/@react-native/virtualized-lists/index.js`\n // Native only, we don't expect SSR to use these packages.\n // Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.\n \"@vxrn/vite-native-hmr\",\n \"@vxrn/compiler\",\n \"@vxrn/vite-native-client\",\n // build-time only, and they load native .node addons the ssr dep optimizer\n // cannot parse. apps list vxrn as a dependency because it is their dev\n // server, which is exactly why it must never be pre-bundled for ssr.\n \"vxrn\",\n \"@vxrn/vite-plugin-metro\",\n \"oxc-transform\",\n \"oxc-parser\",\n \"react-native-ios-utilities\",\n \"react-native-ios-modal\",\n \"react-native-ios-context-menu\",\n \"react-native-haptic-feedback\",\n \"react-native-sortables\",\n \"react-native-image-colors\",\n \"react-native-fast-image\",\n \"react-native-fast-squircle\",\n \"react-native-device-info\",\n // CLI/scripts shouldn't be used in SSR runtime\n \"@tamagui/cli\",\n // only used by static/plugin\n \"@tamagui/static\",\n \"@tamagui/config-default\",\n \"@tamagui/vite-plugin\",\n \"@take-out/scripts\",\n \"@take-out/cli\",\n // Should be used on native only\n \"@tamagui/core/native-test\",\n \"@storybook/react\",\n // native-only or not needed in SSR\n \"@nandorojo/galeria\",\n \"react-native-pager-view\",\n \"@react-native/debugger-shell\",\n // expo's debugger is a standalone app, not an SSR runtime dependency.\n \"@expo/cli\",\n \"@expo/log-box\",\n \"@hot-updater/react-native\",\n \"@hot-updater/plugin-core\",\n \"validator\",\n \"zlib\"\n];\nconst EXCLUDE_LIST_SET = new Set(EXCLUDE_LIST);\nconst INCLUDE_LIST = [\n // ReferenceError: exports is not defined - at eval (.../node_modules/inline-style-prefixer/lib/createPrefixer.js:3:23)\n \"inline-style-prefixer\",\n \"react-native-vector-icons\",\n \"jotai\"\n];\nconst INCLUDE_LIST_SET = new Set(INCLUDE_LIST);\nconst rootOptions = {};\nasync function scanDepsToOptimize(packageJsonPath, options = rootOptions) {\n const { parentDepNames = [], proceededDeps = /* @__PURE__ */ new Map(), pkgJsonContent } = options;\n if (options === rootOptions) {\n console.info(`[one] Scanning node_modules to auto-optimize...`);\n }\n const noExternalDeps = /* @__PURE__ */ new Set();\n const currentRoot = path.dirname(packageJsonPath);\n const pkgJson = pkgJsonContent || await readPackageJsonSafe(packageJsonPath);\n const deps = Object.keys(pkgJson.dependencies || {});\n const needsWorklets = (json) => !!(json.dependencies?.[\"react-native-reanimated\"] || json.dependencies?.[\"react-native-worklets\"]);\n let hasReanimated = needsWorklets(pkgJson);\n const prebundleDeps = (await Promise.all(\n deps.map(async (dep) => {\n if (parentDepNames.includes(dep)) {\n return [];\n }\n const cachedResult = proceededDeps.get(dep);\n if (cachedResult) {\n return cachedResult;\n }\n if (EXCLUDE_LIST_SET.has(dep)) {\n return [];\n }\n const localPath = await findDepPkgJsonPath(dep, currentRoot);\n if (!localPath) return [];\n const depPkgJsonPath = await FSExtra.realpath(localPath);\n if (options.filter && !options.filter(depPkgJsonPath)) {\n return [];\n }\n const depPkgJson = await readPackageJsonSafe(depPkgJsonPath);\n if (needsWorklets(depPkgJson)) {\n hasReanimated = true;\n }\n if (depPkgJson.codegenConfig != null) {\n noExternalDeps.add(dep);\n debug?.(`${dep} skipped: declares codegenConfig (native codegen package)`);\n return [];\n }\n const subDeps = await scanDepsToOptimize(depPkgJsonPath, {\n parentDepNames: [...parentDepNames, dep],\n pkgJsonContent: depPkgJson,\n proceededDeps\n });\n for (const dep2 of subDeps.noExternalDeps) noExternalDeps.add(dep2);\n if (subDeps.hasReanimated) {\n hasReanimated = true;\n }\n const shouldPreBundle = subDeps.prebundleDeps.length > 0 || INCLUDE_LIST_SET.has(\n dep\n ) || hasRequiredDep(depPkgJson, \"react\") || // an optional react peer still means the package ships react\n // entrypoints (e.g. better-auth/react). left external, those load a\n // second react copy in SSR and crash hooks with a null dispatcher.\n !!depPkgJson.peerDependencies?.react || hasRequiredDep(depPkgJson, \"react-native\") || hasRequiredDep(depPkgJson, \"expo-modules-core\") || // expo packages publish extensionless ESM imports that Node cannot\n // execute directly. Keep installed Expo modules inside Vite's SSR\n // graph without making Expo a framework dependency.\n dep.startsWith(\"@expo/\") || dep.startsWith(\"expo-\");\n debug?.(`${dep} shouldPreBundle? ${shouldPreBundle}`);\n const depsToPreBundle = await (async () => {\n if (!shouldPreBundle) {\n return [];\n }\n const depPkgJsonExports = getExportsMap(depPkgJson.exports);\n const definedExports = Object.keys(depPkgJsonExports).filter((k) => {\n const imp = getExportImport(depPkgJsonExports[k]);\n if (typeof imp !== \"string\") {\n return false;\n }\n if (!isPrebundleableEntry(imp)) {\n return false;\n }\n if (!k.match(/^(\\.\\/)?[a-zA-Z0-9-_]+$/)) {\n return false;\n }\n return true;\n }).map((k) => k.replace(/^\\.\\/?/, \"\")).map((k) => `${dep}/${k}`);\n const specialExports = (() => {\n switch (dep) {\n case \"react-native-vector-icons\":\n return [\n \"AntDesign\",\n \"Entypo\",\n \"EvilIcons\",\n \"Feather\",\n \"FontAwesome\",\n \"FontAwesome5\",\n \"FontAwesome5Pro\",\n \"Fontisto\",\n \"Foundation\",\n \"Ionicons\",\n \"MaterialCommunityIcons\",\n \"MaterialIcons\",\n \"Octicons\",\n \"SimpleLineIcons\",\n \"Zocial\"\n ].map((n) => `${dep}/${n}`);\n default:\n return [];\n }\n })();\n const mainExport = [\n depPkgJson[\"main\"],\n depPkgJson[\"module\"],\n getExportImport(depPkgJsonExports[\".\"])\n ].find((entry) => typeof entry === \"string\" && entry && isPrebundleableEntry(entry));\n const exports = [...definedExports, ...specialExports].filter(\n (d) => !EXCLUDE_LIST_SET.has(d)\n );\n if (mainExport) {\n if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {\n exports.unshift(dep);\n }\n }\n return exports;\n })();\n const result = [...depsToPreBundle, ...subDeps.prebundleDeps];\n debugDetails?.(`final result ${JSON.stringify(result, null, 2)}`);\n proceededDeps.set(dep, result);\n return result;\n })\n )).flat().filter((dep, index, arr) => arr.indexOf(dep) === index);\n const hasNativewind = !!pkgJson.dependencies?.[\"nativewind\"];\n if ((hasNativewind || hasReanimated) && options === rootOptions) {\n if (hasReanimated)\n console.info(\n `[one] Enabled babel plugins: ${[hasReanimated ? \"Reanimated\" : \"\", hasNativewind ? \"Nativewind\" : \"\"].filter(Boolean).join(\", \")}`\n );\n }\n return {\n prebundleDeps,\n noExternalDeps: [...noExternalDeps],\n hasReanimated,\n // only check if set in root, dont want to enable css mode too easily\n hasNativewind\n };\n}\nasync function checkIfExportExists(pathIn) {\n const paths = [\n pathIn,\n ...extname(pathIn) ? [] : [pathIn + \".js\", pathIn + sep + \"index.js\"]\n ];\n for (const path2 of paths) {\n if (await FSExtra.pathExists(path2)) {\n return true;\n }\n }\n return false;\n}\nasync function readPackageJsonSafe(packageJsonPath) {\n try {\n return await FSExtra.readJson(packageJsonPath);\n } catch (e) {\n console.error(\n `[scanDepsToPreBundleForSsr] Error reading package.json from ${packageJsonPath}: ${e}`\n );\n return {};\n }\n}\nasync function findDepPkgJsonPath(dep, dependent) {\n let root = dependent;\n while (root) {\n const possiblePkgJson = path.join(root, \"node_modules\", dep, \"package.json\");\n if (await FSExtra.pathExists(possiblePkgJson)) {\n return possiblePkgJson;\n }\n const nextRoot = path.dirname(root);\n if (nextRoot === root) break;\n root = nextRoot;\n }\n console.error(\n `[findDepPkgJsonPath] Could not find package.json for ${dep}, which is a dependency of ${dependent}`\n );\n return void 0;\n}\nfunction hasRequiredDep(pkgJson, depName) {\n return !!(pkgJson.dependencies?.[depName] || pkgJson.peerDependencies?.[depName] && !pkgJson.peerDependenciesMeta?.[depName]?.optional);\n}\nexport {\n EXCLUDE_LIST,\n EXCLUDE_LIST_SET,\n INCLUDE_LIST,\n INCLUDE_LIST_SET,\n findDepPkgJsonPath,\n scanDepsToOptimize\n};\n//# sourceMappingURL=scanDepsToOptimize.js.map\n"],"mappings":";;;;;AAGA,MAAM,EAAE,OAAO,iBAAiB,eAAe,yBAAyB;AACxE,SAAS,qBAAqB,MAAM;CAClC,OAAO,CAAC,iBAAiB,KAAK,IAAI,MAAM,CAAC,QAAQ,IAAI,KAAK,gBAAgB,KAAK,IAAI;AACrF;AACA,SAAS,cAAc,SAAS;CAC9B,IAAI,OAAO,YAAY,UAAU,OAAO,EAAE,KAAK,QAAQ;CACvD,IAAI,CAAC,WAAW,OAAO,YAAY,YAAY,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAC;CAC/E,OAAO,OAAO,KAAK,OAAO,CAAC,CAAC,MAAM,MAAM,EAAE,WAAW,GAAG,CAAC,IAAI,UAAU,EAAE,KAAK,QAAQ;AACxF;AACA,SAAS,gBAAgB,QAAQ;CAC/B,OAAO,OAAO,WAAW,WAAW,SAAS,QAAQ;AACvD;AACA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAIA;CACA;CAIA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;AAC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AAO;AACT;AACA,eAAe,oBAAoB,iBAAiB;CAClD,IAAI;EACF,OAAO,MAAM,QAAQ,SAAS,eAAe;CAC/C,SAAS,GAAG;EACV,QAAQ,MACN,+DAA+D,gBAAgB,IAAI,GACrF;EACA,OAAO,CAAC;CACV;AACF;AACA,eAAe,mBAAmB,KAAK,WAAW;CAChD,IAAI,OAAO;CACX,OAAO,MAAM;EACX,MAAM,kBAAkB,KAAK,KAAK,MAAM,gBAAgB,KAAK,cAAc;EAC3E,IAAI,MAAM,QAAQ,WAAW,eAAe,GAAG;GAC7C,OAAO;EACT;EACA,MAAM,WAAW,KAAK,QAAQ,IAAI;EAClC,IAAI,aAAa,MAAM;EACvB,OAAO;CACT;CACA,QAAQ,MACN,wDAAwD,IAAI,6BAA6B,WAC3F;CACA,OAAO,KAAK;AACd;AACA,SAAS,eAAe,SAAS,SAAS;CACxC,OAAO,CAAC,EAAE,QAAQ,eAAe,YAAY,QAAQ,mBAAmB,YAAY,CAAC,QAAQ,uBAAuB,QAAQ,EAAE;AAChI"}
@@ -3,6 +3,19 @@ import FSExtra from "fs-extra";
3
3
  import path, { dirname, extname, join, sep } from "path";
4
4
 
5
5
  var { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);
6
+ function isPrebundleableEntry(file) {
7
+ return !/\.d\.[cm]?ts$/i.test(file) && (!extname(file) || /\.[cm]?[jt]s$/.test(file));
8
+ }
9
+ function getExportsMap(exports) {
10
+ if (typeof exports === "string") return { ".": exports };
11
+ if (!exports || typeof exports !== "object" || Array.isArray(exports)) return {};
12
+ return Object.keys(exports).some(function(k) {
13
+ return k.startsWith(".");
14
+ }) ? exports : { ".": exports };
15
+ }
16
+ function getExportImport(target) {
17
+ return typeof target === "string" ? target : target === null || target === void 0 ? void 0 : target.import;
18
+ }
6
19
  var EXCLUDE_LIST = [
7
20
  "jsc-android",
8
21
  "react-shallow-renderer",
@@ -145,14 +158,13 @@ async function scanDepsToOptimize(packageJsonPath) {
145
158
  if (!shouldPreBundle) {
146
159
  return [];
147
160
  }
148
- var depPkgJsonExports = depPkgJson.exports || {};
161
+ var depPkgJsonExports = getExportsMap(depPkgJson.exports);
149
162
  var definedExports = Object.keys(depPkgJsonExports).filter(function(k) {
150
- var expData = depPkgJsonExports[k];
151
- var imp = typeof expData === "string" ? expData : expData === null || expData === void 0 ? void 0 : expData.import;
163
+ var imp = getExportImport(depPkgJsonExports[k]);
152
164
  if (typeof imp !== "string") {
153
165
  return false;
154
166
  }
155
- if (!imp.endsWith(".js")) {
167
+ if (!isPrebundleableEntry(imp)) {
156
168
  return false;
157
169
  }
158
170
  if (!k.match(/^(\.\/)?[a-zA-Z0-9-_]+$/)) {
@@ -188,11 +200,17 @@ async function scanDepsToOptimize(packageJsonPath) {
188
200
  default: return [];
189
201
  }
190
202
  })();
191
- var mainExport = depPkgJson["main"] || depPkgJson["module"] || definedExports["."];
203
+ var mainExport = [
204
+ depPkgJson["main"],
205
+ depPkgJson["module"],
206
+ getExportImport(depPkgJsonExports["."])
207
+ ].find(function(entry) {
208
+ return typeof entry === "string" && entry && isPrebundleableEntry(entry);
209
+ });
192
210
  var exports = [...definedExports, ...specialExports].filter(function(d) {
193
211
  return !EXCLUDE_LIST_SET.has(d);
194
212
  });
195
- if (mainExport && (!extname(mainExport) || /\.[cm]?[jt]s$/.test(mainExport))) {
213
+ if (mainExport) {
196
214
  if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {
197
215
  exports.unshift(dep);
198
216
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scanDepsToOptimize.native.js","names":[],"sources":["utils/scanDepsToOptimize.native.js"],"sourcesContent":["import { createDebugger } from \"@vxrn/debug\";\nimport FSExtra from \"fs-extra\";\nimport path, { dirname, extname, join, sep } from \"path\";\nvar { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);\nvar EXCLUDE_LIST = [\n \"jsc-android\",\n \"react-shallow-renderer\",\n \"fsevents\",\n \"@swc/core\",\n \"@swc/core-darwin-arm64\",\n \"@swc/core-darwin-x64\",\n \"@swc/core-linux-arm-gnueabihf\",\n \"@swc/core-linux-arm64-gnu\",\n \"@swc/core-linux-arm64-musl\",\n \"@swc/core-linux-x64-gnu\",\n \"@swc/core-linux-x64-musl\",\n \"@swc/core-win32-arm64-msvc\",\n \"@swc/core-win32-ia32-msvc\",\n \"@swc/core-win32-x64-msvc\",\n \"lightningcss\",\n // this breaks fileToUrlPath in upstreams, like @discordjs/client\n \"url\",\n \"sharp\",\n \"@sentry/react-native\",\n // not used by web anyway\n // Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry\n // /lib/module/Platform/Platform.web.js:132:20\n \"@shopify/react-native-skia\",\n \"@react-native/virtualized-lists\",\n // Unexpected \"typeof\" in `node_modules/@react-native/virtualized-lists/index.js`\n // Native only, we don't expect SSR to use these packages.\n // Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.\n \"@vxrn/vite-native-hmr\",\n \"@vxrn/compiler\",\n \"@vxrn/vite-native-client\",\n // build-time only, and they load native .node addons the ssr dep optimizer\n // cannot parse. apps list vxrn as a dependency because it is their dev\n // server, which is exactly why it must never be pre-bundled for ssr.\n \"vxrn\",\n \"@vxrn/vite-plugin-metro\",\n \"oxc-transform\",\n \"oxc-parser\",\n \"react-native-ios-utilities\",\n \"react-native-ios-modal\",\n \"react-native-ios-context-menu\",\n \"react-native-haptic-feedback\",\n \"react-native-sortables\",\n \"react-native-image-colors\",\n \"react-native-fast-image\",\n \"react-native-fast-squircle\",\n \"react-native-device-info\",\n // CLI/scripts shouldn't be used in SSR runtime\n \"@tamagui/cli\",\n // only used by static/plugin\n \"@tamagui/static\",\n \"@tamagui/config-default\",\n \"@tamagui/vite-plugin\",\n \"@take-out/scripts\",\n \"@take-out/cli\",\n // Should be used on native only\n \"@tamagui/core/native-test\",\n \"@storybook/react\",\n // native-only or not needed in SSR\n \"@nandorojo/galeria\",\n \"react-native-pager-view\",\n \"@react-native/debugger-shell\",\n // expo's debugger is a standalone app, not an SSR runtime dependency.\n \"@expo/cli\",\n \"@expo/log-box\",\n \"@hot-updater/react-native\",\n \"@hot-updater/plugin-core\",\n \"validator\",\n \"zlib\"\n];\nvar EXCLUDE_LIST_SET = new Set(EXCLUDE_LIST);\nvar INCLUDE_LIST = [\n // ReferenceError: exports is not defined - at eval (.../node_modules/inline-style-prefixer/lib/createPrefixer.js:3:23)\n \"inline-style-prefixer\",\n \"react-native-vector-icons\",\n \"jotai\"\n];\nvar INCLUDE_LIST_SET = new Set(INCLUDE_LIST);\nvar rootOptions = {};\nasync function scanDepsToOptimize(packageJsonPath) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (\n /** If the content of the package.json is already read before calling this function, pass it here to avoid reading it again */\n rootOptions\n );\n var _pkgJson_dependencies;\n var { parentDepNames = [], proceededDeps = /* @__PURE__ */ new Map(), pkgJsonContent } = options;\n if (options === rootOptions) {\n console.info(`[one] Scanning node_modules to auto-optimize...`);\n }\n var noExternalDeps = /* @__PURE__ */ new Set();\n var currentRoot = path.dirname(packageJsonPath);\n var pkgJson = pkgJsonContent || await readPackageJsonSafe(packageJsonPath);\n var deps = Object.keys(pkgJson.dependencies || {});\n var needsWorklets = function needsWorklets2(json) {\n var _json_dependencies, _json_dependencies1;\n return !!(((_json_dependencies = json.dependencies) === null || _json_dependencies === void 0 ? void 0 : _json_dependencies[\"react-native-reanimated\"]) || ((_json_dependencies1 = json.dependencies) === null || _json_dependencies1 === void 0 ? void 0 : _json_dependencies1[\"react-native-worklets\"]));\n };\n var hasReanimated = needsWorklets(pkgJson);\n var prebundleDeps = (await Promise.all(deps.map(async function(dep) {\n var _depPkgJson_peerDependencies;\n if (parentDepNames.includes(dep)) {\n return [];\n }\n var cachedResult = proceededDeps.get(dep);\n if (cachedResult) {\n return cachedResult;\n }\n if (EXCLUDE_LIST_SET.has(dep)) {\n return [];\n }\n var localPath = await findDepPkgJsonPath(dep, currentRoot);\n if (!localPath) return [];\n var depPkgJsonPath = await FSExtra.realpath(localPath);\n if (options.filter && !options.filter(depPkgJsonPath)) {\n return [];\n }\n var depPkgJson = await readPackageJsonSafe(depPkgJsonPath);\n if (needsWorklets(depPkgJson)) {\n hasReanimated = true;\n }\n if (depPkgJson.codegenConfig != null) {\n noExternalDeps.add(dep);\n debug === null || debug === void 0 ? void 0 : debug(`${dep} skipped: declares codegenConfig (native codegen package)`);\n return [];\n }\n var subDeps = await scanDepsToOptimize(depPkgJsonPath, {\n parentDepNames: [\n ...parentDepNames,\n dep\n ],\n pkgJsonContent: depPkgJson,\n proceededDeps\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = subDeps.noExternalDeps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _$dep = _step.value;\n noExternalDeps.add(_$dep);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (subDeps.hasReanimated) {\n hasReanimated = true;\n }\n var shouldPreBundle = subDeps.prebundleDeps.length > 0 || /* If this dep is depending on other deps that need pre-bundling, then also pre-bundle this dep */\n INCLUDE_LIST_SET.has(dep) || /* If this dep is in the include list, then pre-bundle it */\n hasRequiredDep(depPkgJson, \"react\") || // an optional react peer still means the package ships react\n // entrypoints (e.g. better-auth/react). left external, those load a\n // second react copy in SSR and crash hooks with a null dispatcher.\n !!((_depPkgJson_peerDependencies = depPkgJson.peerDependencies) === null || _depPkgJson_peerDependencies === void 0 ? void 0 : _depPkgJson_peerDependencies.react) || hasRequiredDep(depPkgJson, \"react-native\") || hasRequiredDep(depPkgJson, \"expo-modules-core\") || // expo packages publish extensionless ESM imports that Node cannot\n // execute directly. Keep installed Expo modules inside Vite's SSR\n // graph without making Expo a framework dependency.\n dep.startsWith(\"@expo/\") || dep.startsWith(\"expo-\");\n debug === null || debug === void 0 ? void 0 : debug(`${dep} shouldPreBundle? ${shouldPreBundle}`);\n var depsToPreBundle = await (async function() {\n if (!shouldPreBundle) {\n return [];\n }\n var depPkgJsonExports = depPkgJson.exports || {};\n var definedExports = Object.keys(depPkgJsonExports).filter(function(k) {\n var expData = depPkgJsonExports[k];\n var imp = typeof expData === \"string\" ? expData : expData === null || expData === void 0 ? void 0 : expData.import;\n if (typeof imp !== \"string\") {\n return false;\n }\n if (!imp.endsWith(\".js\")) {\n return false;\n }\n if (!k.match(/^(\\.\\/)?[a-zA-Z0-9-_]+$/)) {\n return false;\n }\n return true;\n }).map(function(k) {\n return k.replace(/^\\.\\/?/, \"\");\n }).map(function(k) {\n return `${dep}/${k}`;\n });\n var specialExports = (function() {\n switch (dep) {\n case \"react-native-vector-icons\":\n return [\n \"AntDesign\",\n \"Entypo\",\n \"EvilIcons\",\n \"Feather\",\n \"FontAwesome\",\n \"FontAwesome5\",\n \"FontAwesome5Pro\",\n \"Fontisto\",\n \"Foundation\",\n \"Ionicons\",\n \"MaterialCommunityIcons\",\n \"MaterialIcons\",\n \"Octicons\",\n \"SimpleLineIcons\",\n \"Zocial\"\n ].map(function(n) {\n return `${dep}/${n}`;\n });\n default:\n return [];\n }\n })();\n var mainExport = depPkgJson[\"main\"] || depPkgJson[\"module\"] || definedExports[\".\"];\n var exports = [\n ...definedExports,\n ...specialExports\n ].filter(function(d) {\n return !EXCLUDE_LIST_SET.has(d);\n });\n if (mainExport && (!extname(mainExport) || /\\.[cm]?[jt]s$/.test(mainExport))) {\n if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {\n exports.unshift(dep);\n }\n }\n return exports;\n })();\n var result = [\n ...depsToPreBundle,\n ...subDeps.prebundleDeps\n ];\n debugDetails === null || debugDetails === void 0 ? void 0 : debugDetails(`final result ${JSON.stringify(result, null, 2)}`);\n proceededDeps.set(dep, result);\n return result;\n }))).flat().filter(function(dep, index, arr) {\n return arr.indexOf(dep) === index;\n });\n var hasNativewind = !!((_pkgJson_dependencies = pkgJson.dependencies) === null || _pkgJson_dependencies === void 0 ? void 0 : _pkgJson_dependencies[\"nativewind\"]);\n if ((hasNativewind || hasReanimated) && options === rootOptions) {\n if (hasReanimated) console.info(`[one] Enabled babel plugins: ${[\n hasReanimated ? \"Reanimated\" : \"\",\n hasNativewind ? \"Nativewind\" : \"\"\n ].filter(Boolean).join(\", \")}`);\n }\n return {\n prebundleDeps,\n noExternalDeps: [\n ...noExternalDeps\n ],\n hasReanimated,\n // only check if set in root, dont want to enable css mode too easily\n hasNativewind\n };\n}\nasync function checkIfExportExists(pathIn) {\n var paths = [\n pathIn,\n ...extname(pathIn) ? [] : [\n pathIn + \".js\",\n pathIn + sep + \"index.js\"\n ]\n ];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = paths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var path2 = _step.value;\n if (await FSExtra.pathExists(path2)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nasync function readPackageJsonSafe(packageJsonPath) {\n try {\n return await FSExtra.readJson(packageJsonPath);\n } catch (e) {\n console.error(`[scanDepsToPreBundleForSsr] Error reading package.json from ${packageJsonPath}: ${e}`);\n return {};\n }\n}\nasync function findDepPkgJsonPath(dep, dependent) {\n var root = dependent;\n while (root) {\n var possiblePkgJson = path.join(root, \"node_modules\", dep, \"package.json\");\n if (await FSExtra.pathExists(possiblePkgJson)) {\n return possiblePkgJson;\n }\n var nextRoot = path.dirname(root);\n if (nextRoot === root) break;\n root = nextRoot;\n }\n console.error(`[findDepPkgJsonPath] Could not find package.json for ${dep}, which is a dependency of ${dependent}`);\n return void 0;\n}\nfunction hasRequiredDep(pkgJson, depName) {\n var _pkgJson_dependencies, _pkgJson_peerDependencies, _pkgJson_peerDependenciesMeta_depName, _pkgJson_peerDependenciesMeta;\n return !!(((_pkgJson_dependencies = pkgJson.dependencies) === null || _pkgJson_dependencies === void 0 ? void 0 : _pkgJson_dependencies[depName]) || ((_pkgJson_peerDependencies = pkgJson.peerDependencies) === null || _pkgJson_peerDependencies === void 0 ? void 0 : _pkgJson_peerDependencies[depName]) && !((_pkgJson_peerDependenciesMeta = pkgJson.peerDependenciesMeta) === null || _pkgJson_peerDependenciesMeta === void 0 ? void 0 : (_pkgJson_peerDependenciesMeta_depName = _pkgJson_peerDependenciesMeta[depName]) === null || _pkgJson_peerDependenciesMeta_depName === void 0 ? void 0 : _pkgJson_peerDependenciesMeta_depName.optional));\n}\nexport {\n EXCLUDE_LIST,\n EXCLUDE_LIST_SET,\n INCLUDE_LIST,\n INCLUDE_LIST_SET,\n findDepPkgJsonPath,\n scanDepsToOptimize\n};\n//# sourceMappingURL=scanDepsToOptimize.js.map\n"],"mappings":";;;;;AAGA,IAAI,EAAE,OAAO,iBAAiB,eAAe,yBAAyB;AACtE,IAAI,eAAe;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CAIA;CACA;CAIA;CACA;CACA;CAIA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CAEA;CACA;CACA;CACA;CACA;CAEA;CACA;CAEA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,IAAI,mBAAmB,IAAI,IAAI,YAAY;AAC3C,IAAI,eAAe;CAEjB;CACA;CACA;AACF;AACA,IAAI,mBAAmB,IAAI,IAAI,YAAY;AAC3C,IAAI,cAAc,CAAC;AACnB,eAAe,mBAAmB,iBAAiB;CACjD,IAAI,UAAU,UAA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O;AACT;AACA,eAAe,oBAAoB,iBAAiB;CAClD,IAAI;EACF,OAAO,MAAM,QAAQ,SAAS,eAAe;CAC/C,SAAS,GAAG;EACV,QAAQ,MAAM,+DAA+D,gBAAgB,IAAI,GAAG;EACpG,OAAO,CAAC;CACV;AACF;AACA,eAAe,mBAAmB,KAAK,WAAW;CAChD,IAAI,OAAO;CACX,OAAO,MAAM;EACX,IAAI,kBAAkB,KAAK,KAAK,MAAM,gBAAgB,KAAK,cAAc;EACzE,IAAI,MAAM,QAAQ,WAAW,eAAe,GAAG;GAC7C,OAAO;EACT;EACA,IAAI,WAAW,KAAK,QAAQ,IAAI;EAChC,IAAI,aAAa,MAAM;EACvB,OAAO;CACT;CACA,QAAQ,MAAM,wDAAwD,IAAI,6BAA6B,WAAW;CAClH,OAAO,KAAK;AACd;AACA,SAAS,eAAe,SAAS,SAAS;CACxC,IAAI,uBAAuB,2BAA2B,uCAAuC;CAC7F,OAAO,CAAC,IAAI,wBAAwB,QAAQ,kBAAkB,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB,eAAe,4BAA4B,QAAQ,sBAAsB,QAAQ,8BAA8B,KAAK,IAAI,KAAK,IAAI,0BAA0B,aAAa,GAAG,gCAAgC,QAAQ,0BAA0B,QAAQ,kCAAkC,KAAK,IAAI,KAAK,KAAK,wCAAwC,8BAA8B,cAAc,QAAQ,0CAA0C,KAAK,IAAI,KAAK,IAAI,sCAAsC;AAClnB"}
1
+ {"version":3,"file":"scanDepsToOptimize.native.js","names":[],"sources":["utils/scanDepsToOptimize.native.js"],"sourcesContent":["import { createDebugger } from \"@vxrn/debug\";\nimport FSExtra from \"fs-extra\";\nimport path, { dirname, extname, join, sep } from \"path\";\nvar { debug, debugDetails } = createDebugger(`vxrn:scanDepsToOptimize`);\nfunction isPrebundleableEntry(file) {\n return !/\\.d\\.[cm]?ts$/i.test(file) && (!extname(file) || /\\.[cm]?[jt]s$/.test(file));\n}\nfunction getExportsMap(exports) {\n if (typeof exports === \"string\") return {\n \".\": exports\n };\n if (!exports || typeof exports !== \"object\" || Array.isArray(exports)) return {};\n return Object.keys(exports).some(function(k) {\n return k.startsWith(\".\");\n }) ? exports : {\n \".\": exports\n };\n}\nfunction getExportImport(target) {\n return typeof target === \"string\" ? target : target === null || target === void 0 ? void 0 : target.import;\n}\nvar EXCLUDE_LIST = [\n \"jsc-android\",\n \"react-shallow-renderer\",\n \"fsevents\",\n \"@swc/core\",\n \"@swc/core-darwin-arm64\",\n \"@swc/core-darwin-x64\",\n \"@swc/core-linux-arm-gnueabihf\",\n \"@swc/core-linux-arm64-gnu\",\n \"@swc/core-linux-arm64-musl\",\n \"@swc/core-linux-x64-gnu\",\n \"@swc/core-linux-x64-musl\",\n \"@swc/core-win32-arm64-msvc\",\n \"@swc/core-win32-ia32-msvc\",\n \"@swc/core-win32-x64-msvc\",\n \"lightningcss\",\n // this breaks fileToUrlPath in upstreams, like @discordjs/client\n \"url\",\n \"sharp\",\n \"@sentry/react-native\",\n // not used by web anyway\n // Could not read from file: /Users/n8/one/node_modules/react-native-web/dist/cjs/index.js/Libraries/Image/AssetRegistry\n // /lib/module/Platform/Platform.web.js:132:20\n \"@shopify/react-native-skia\",\n \"@react-native/virtualized-lists\",\n // Unexpected \"typeof\" in `node_modules/@react-native/virtualized-lists/index.js`\n // Native only, we don't expect SSR to use these packages.\n // Also, some of these packages might attempt to import from react-native internals, which will break in SSR while react-native is aliased to react-native-web.\n \"@vxrn/vite-native-hmr\",\n \"@vxrn/compiler\",\n \"@vxrn/vite-native-client\",\n // build-time only, and they load native .node addons the ssr dep optimizer\n // cannot parse. apps list vxrn as a dependency because it is their dev\n // server, which is exactly why it must never be pre-bundled for ssr.\n \"vxrn\",\n \"@vxrn/vite-plugin-metro\",\n \"oxc-transform\",\n \"oxc-parser\",\n \"react-native-ios-utilities\",\n \"react-native-ios-modal\",\n \"react-native-ios-context-menu\",\n \"react-native-haptic-feedback\",\n \"react-native-sortables\",\n \"react-native-image-colors\",\n \"react-native-fast-image\",\n \"react-native-fast-squircle\",\n \"react-native-device-info\",\n // CLI/scripts shouldn't be used in SSR runtime\n \"@tamagui/cli\",\n // only used by static/plugin\n \"@tamagui/static\",\n \"@tamagui/config-default\",\n \"@tamagui/vite-plugin\",\n \"@take-out/scripts\",\n \"@take-out/cli\",\n // Should be used on native only\n \"@tamagui/core/native-test\",\n \"@storybook/react\",\n // native-only or not needed in SSR\n \"@nandorojo/galeria\",\n \"react-native-pager-view\",\n \"@react-native/debugger-shell\",\n // expo's debugger is a standalone app, not an SSR runtime dependency.\n \"@expo/cli\",\n \"@expo/log-box\",\n \"@hot-updater/react-native\",\n \"@hot-updater/plugin-core\",\n \"validator\",\n \"zlib\"\n];\nvar EXCLUDE_LIST_SET = new Set(EXCLUDE_LIST);\nvar INCLUDE_LIST = [\n // ReferenceError: exports is not defined - at eval (.../node_modules/inline-style-prefixer/lib/createPrefixer.js:3:23)\n \"inline-style-prefixer\",\n \"react-native-vector-icons\",\n \"jotai\"\n];\nvar INCLUDE_LIST_SET = new Set(INCLUDE_LIST);\nvar rootOptions = {};\nasync function scanDepsToOptimize(packageJsonPath) {\n var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : (\n /** If the content of the package.json is already read before calling this function, pass it here to avoid reading it again */\n rootOptions\n );\n var _pkgJson_dependencies;\n var { parentDepNames = [], proceededDeps = /* @__PURE__ */ new Map(), pkgJsonContent } = options;\n if (options === rootOptions) {\n console.info(`[one] Scanning node_modules to auto-optimize...`);\n }\n var noExternalDeps = /* @__PURE__ */ new Set();\n var currentRoot = path.dirname(packageJsonPath);\n var pkgJson = pkgJsonContent || await readPackageJsonSafe(packageJsonPath);\n var deps = Object.keys(pkgJson.dependencies || {});\n var needsWorklets = function needsWorklets2(json) {\n var _json_dependencies, _json_dependencies1;\n return !!(((_json_dependencies = json.dependencies) === null || _json_dependencies === void 0 ? void 0 : _json_dependencies[\"react-native-reanimated\"]) || ((_json_dependencies1 = json.dependencies) === null || _json_dependencies1 === void 0 ? void 0 : _json_dependencies1[\"react-native-worklets\"]));\n };\n var hasReanimated = needsWorklets(pkgJson);\n var prebundleDeps = (await Promise.all(deps.map(async function(dep) {\n var _depPkgJson_peerDependencies;\n if (parentDepNames.includes(dep)) {\n return [];\n }\n var cachedResult = proceededDeps.get(dep);\n if (cachedResult) {\n return cachedResult;\n }\n if (EXCLUDE_LIST_SET.has(dep)) {\n return [];\n }\n var localPath = await findDepPkgJsonPath(dep, currentRoot);\n if (!localPath) return [];\n var depPkgJsonPath = await FSExtra.realpath(localPath);\n if (options.filter && !options.filter(depPkgJsonPath)) {\n return [];\n }\n var depPkgJson = await readPackageJsonSafe(depPkgJsonPath);\n if (needsWorklets(depPkgJson)) {\n hasReanimated = true;\n }\n if (depPkgJson.codegenConfig != null) {\n noExternalDeps.add(dep);\n debug === null || debug === void 0 ? void 0 : debug(`${dep} skipped: declares codegenConfig (native codegen package)`);\n return [];\n }\n var subDeps = await scanDepsToOptimize(depPkgJsonPath, {\n parentDepNames: [\n ...parentDepNames,\n dep\n ],\n pkgJsonContent: depPkgJson,\n proceededDeps\n });\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = subDeps.noExternalDeps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _$dep = _step.value;\n noExternalDeps.add(_$dep);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n if (subDeps.hasReanimated) {\n hasReanimated = true;\n }\n var shouldPreBundle = subDeps.prebundleDeps.length > 0 || /* If this dep is depending on other deps that need pre-bundling, then also pre-bundle this dep */\n INCLUDE_LIST_SET.has(dep) || /* If this dep is in the include list, then pre-bundle it */\n hasRequiredDep(depPkgJson, \"react\") || // an optional react peer still means the package ships react\n // entrypoints (e.g. better-auth/react). left external, those load a\n // second react copy in SSR and crash hooks with a null dispatcher.\n !!((_depPkgJson_peerDependencies = depPkgJson.peerDependencies) === null || _depPkgJson_peerDependencies === void 0 ? void 0 : _depPkgJson_peerDependencies.react) || hasRequiredDep(depPkgJson, \"react-native\") || hasRequiredDep(depPkgJson, \"expo-modules-core\") || // expo packages publish extensionless ESM imports that Node cannot\n // execute directly. Keep installed Expo modules inside Vite's SSR\n // graph without making Expo a framework dependency.\n dep.startsWith(\"@expo/\") || dep.startsWith(\"expo-\");\n debug === null || debug === void 0 ? void 0 : debug(`${dep} shouldPreBundle? ${shouldPreBundle}`);\n var depsToPreBundle = await (async function() {\n if (!shouldPreBundle) {\n return [];\n }\n var depPkgJsonExports = getExportsMap(depPkgJson.exports);\n var definedExports = Object.keys(depPkgJsonExports).filter(function(k) {\n var imp = getExportImport(depPkgJsonExports[k]);\n if (typeof imp !== \"string\") {\n return false;\n }\n if (!isPrebundleableEntry(imp)) {\n return false;\n }\n if (!k.match(/^(\\.\\/)?[a-zA-Z0-9-_]+$/)) {\n return false;\n }\n return true;\n }).map(function(k) {\n return k.replace(/^\\.\\/?/, \"\");\n }).map(function(k) {\n return `${dep}/${k}`;\n });\n var specialExports = (function() {\n switch (dep) {\n case \"react-native-vector-icons\":\n return [\n \"AntDesign\",\n \"Entypo\",\n \"EvilIcons\",\n \"Feather\",\n \"FontAwesome\",\n \"FontAwesome5\",\n \"FontAwesome5Pro\",\n \"Fontisto\",\n \"Foundation\",\n \"Ionicons\",\n \"MaterialCommunityIcons\",\n \"MaterialIcons\",\n \"Octicons\",\n \"SimpleLineIcons\",\n \"Zocial\"\n ].map(function(n) {\n return `${dep}/${n}`;\n });\n default:\n return [];\n }\n })();\n var mainExport = [\n depPkgJson[\"main\"],\n depPkgJson[\"module\"],\n getExportImport(depPkgJsonExports[\".\"])\n ].find(function(entry) {\n return typeof entry === \"string\" && entry && isPrebundleableEntry(entry);\n });\n var exports = [\n ...definedExports,\n ...specialExports\n ].filter(function(d) {\n return !EXCLUDE_LIST_SET.has(d);\n });\n if (mainExport) {\n if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {\n exports.unshift(dep);\n }\n }\n return exports;\n })();\n var result = [\n ...depsToPreBundle,\n ...subDeps.prebundleDeps\n ];\n debugDetails === null || debugDetails === void 0 ? void 0 : debugDetails(`final result ${JSON.stringify(result, null, 2)}`);\n proceededDeps.set(dep, result);\n return result;\n }))).flat().filter(function(dep, index, arr) {\n return arr.indexOf(dep) === index;\n });\n var hasNativewind = !!((_pkgJson_dependencies = pkgJson.dependencies) === null || _pkgJson_dependencies === void 0 ? void 0 : _pkgJson_dependencies[\"nativewind\"]);\n if ((hasNativewind || hasReanimated) && options === rootOptions) {\n if (hasReanimated) console.info(`[one] Enabled babel plugins: ${[\n hasReanimated ? \"Reanimated\" : \"\",\n hasNativewind ? \"Nativewind\" : \"\"\n ].filter(Boolean).join(\", \")}`);\n }\n return {\n prebundleDeps,\n noExternalDeps: [\n ...noExternalDeps\n ],\n hasReanimated,\n // only check if set in root, dont want to enable css mode too easily\n hasNativewind\n };\n}\nasync function checkIfExportExists(pathIn) {\n var paths = [\n pathIn,\n ...extname(pathIn) ? [] : [\n pathIn + \".js\",\n pathIn + sep + \"index.js\"\n ]\n ];\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = paths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var path2 = _step.value;\n if (await FSExtra.pathExists(path2)) {\n return true;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n return false;\n}\nasync function readPackageJsonSafe(packageJsonPath) {\n try {\n return await FSExtra.readJson(packageJsonPath);\n } catch (e) {\n console.error(`[scanDepsToPreBundleForSsr] Error reading package.json from ${packageJsonPath}: ${e}`);\n return {};\n }\n}\nasync function findDepPkgJsonPath(dep, dependent) {\n var root = dependent;\n while (root) {\n var possiblePkgJson = path.join(root, \"node_modules\", dep, \"package.json\");\n if (await FSExtra.pathExists(possiblePkgJson)) {\n return possiblePkgJson;\n }\n var nextRoot = path.dirname(root);\n if (nextRoot === root) break;\n root = nextRoot;\n }\n console.error(`[findDepPkgJsonPath] Could not find package.json for ${dep}, which is a dependency of ${dependent}`);\n return void 0;\n}\nfunction hasRequiredDep(pkgJson, depName) {\n var _pkgJson_dependencies, _pkgJson_peerDependencies, _pkgJson_peerDependenciesMeta_depName, _pkgJson_peerDependenciesMeta;\n return !!(((_pkgJson_dependencies = pkgJson.dependencies) === null || _pkgJson_dependencies === void 0 ? void 0 : _pkgJson_dependencies[depName]) || ((_pkgJson_peerDependencies = pkgJson.peerDependencies) === null || _pkgJson_peerDependencies === void 0 ? void 0 : _pkgJson_peerDependencies[depName]) && !((_pkgJson_peerDependenciesMeta = pkgJson.peerDependenciesMeta) === null || _pkgJson_peerDependenciesMeta === void 0 ? void 0 : (_pkgJson_peerDependenciesMeta_depName = _pkgJson_peerDependenciesMeta[depName]) === null || _pkgJson_peerDependenciesMeta_depName === void 0 ? void 0 : _pkgJson_peerDependenciesMeta_depName.optional));\n}\nexport {\n EXCLUDE_LIST,\n EXCLUDE_LIST_SET,\n INCLUDE_LIST,\n INCLUDE_LIST_SET,\n findDepPkgJsonPath,\n scanDepsToOptimize\n};\n//# sourceMappingURL=scanDepsToOptimize.js.map\n"],"mappings":";;;;;AAGA,IAAI,EAAE,OAAO,iBAAiB,eAAe,yBAAyB;AACtE,SAAS,qBAAqB,MAAM;CAClC,OAAO,CAAC,iBAAiB,KAAK,IAAI,MAAM,CAAC,QAAQ,IAAI,KAAK,gBAAgB,KAAK,IAAI;AACrF;AACA,SAAS,cAAc,SAAS;CAC9B,IAAI,OAAO,YAAY,UAAU,OAAO,EACtC,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,OAAO;CACT;CACA,QAAQ,MAAM,wDAAwD,IAAI,6BAA6B,WAAW;CAClH,OAAO,KAAK;AACd;AACA,SAAS,eAAe,SAAS,SAAS;CACxC,IAAI,uBAAuB,2BAA2B,uCAAuC;CAC7F,OAAO,CAAC,IAAI,wBAAwB,QAAQ,kBAAkB,QAAQ,0BAA0B,KAAK,IAAI,KAAK,IAAI,sBAAsB,eAAe,4BAA4B,QAAQ,sBAAsB,QAAQ,8BAA8B,KAAK,IAAI,KAAK,IAAI,0BAA0B,aAAa,GAAG,gCAAgC,QAAQ,0BAA0B,QAAQ,kCAAkC,KAAK,IAAI,KAAK,KAAK,wCAAwC,8BAA8B,cAAc,QAAQ,0CAA0C,KAAK,IAAI,KAAK,IAAI,sCAAsC;AAClnB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxrn",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -81,15 +81,15 @@
81
81
  "@react-native-community/cli": "^20.2.0",
82
82
  "@react-native-community/cli-config": "^20.2.0",
83
83
  "@react-native/dev-middleware": "^0.87.1",
84
- "@vxrn/compiler": "2.7.2",
85
- "@vxrn/debug": "2.7.2",
86
- "@vxrn/query-string": "2.7.2",
87
- "@vxrn/resolve": "2.7.2",
88
- "@vxrn/url-parse": "2.7.2",
89
- "@vxrn/utils": "2.7.2",
90
- "@vxrn/vendor": "2.7.2",
91
- "@vxrn/vite-flow": "2.7.2",
92
- "@vxrn/vite-plugin-metro": "2.7.2",
84
+ "@vxrn/compiler": "2.7.4",
85
+ "@vxrn/debug": "2.7.4",
86
+ "@vxrn/query-string": "2.7.4",
87
+ "@vxrn/resolve": "2.7.4",
88
+ "@vxrn/url-parse": "2.7.4",
89
+ "@vxrn/utils": "2.7.4",
90
+ "@vxrn/vendor": "2.7.4",
91
+ "@vxrn/vite-flow": "2.7.4",
92
+ "@vxrn/vite-plugin-metro": "2.7.4",
93
93
  "citty": "^0.1.6",
94
94
  "dotenv": "^17.2.1",
95
95
  "dotenv-expand": "^12.0.2",
@@ -119,7 +119,7 @@
119
119
  "devDependencies": {
120
120
  "@biomejs/biome": "2.3.3",
121
121
  "@jridgewell/gen-mapping": "^0.3.5",
122
- "@tamagui/build": "3.0.10",
122
+ "@tamagui/build": "3.0.13",
123
123
  "@types/find-node-modules": "^2.1.2",
124
124
  "@types/node": "^24.10.0",
125
125
  "@types/ws": "^8.18.1",
@@ -133,7 +133,7 @@
133
133
  "publishConfig": {
134
134
  "access": "public"
135
135
  },
136
- "releaseSourceCommit": "660240b2552fe6d8d3903e927907c43ec5e3ba1e",
136
+ "releaseSourceCommit": "f60870e3a32efb3f3577234b92e5b7de663b12b7",
137
137
  "repository": {
138
138
  "type": "git",
139
139
  "url": "git+https://github.com/onejs/one.git",
@@ -485,6 +485,30 @@ extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autoli
485
485
  expect(noPedometerManifest.content).not.toContain('ACTIVITY_RECOGNITION')
486
486
  })
487
487
 
488
+ it('stamps the brightness write-settings permission from native.app', () => {
489
+ const content =
490
+ '<manifest>\n <uses-permission android:name="android.permission.INTERNET" />\n <activity>\n </activity>\n </application>'
491
+ const brightnessManifest = renderPrebuildFile({
492
+ relativePath: 'app/src/main/AndroidManifest.xml',
493
+ content,
494
+ platform: 'android',
495
+ app: { ...app, brightness: true },
496
+ })
497
+ expect(brightnessManifest.content).toContain(
498
+ '<uses-permission android:name="android.permission.WRITE_SETTINGS" />'
499
+ )
500
+
501
+ for (const brightness of [undefined, false]) {
502
+ const unstamped = renderPrebuildFile({
503
+ relativePath: 'app/src/main/AndroidManifest.xml',
504
+ content,
505
+ platform: 'android',
506
+ app: { ...app, brightness },
507
+ })
508
+ expect(unstamped.content).not.toContain('WRITE_SETTINGS')
509
+ }
510
+ })
511
+
488
512
  it('stamps marketing and build versions from the manifest', () => {
489
513
  const stamped = {
490
514
  ...app,
@@ -2181,6 +2181,24 @@ ${schemes.map((scheme) => `\t\t\t\t<string>${scheme}</string>`).join('\n')}
2181
2181
  `${anchor}\n <uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />`
2182
2182
  )
2183
2183
  }
2184
+ if (
2185
+ platform === 'android' &&
2186
+ relativePath === 'app/src/main/AndroidManifest.xml' &&
2187
+ app.brightness === true
2188
+ ) {
2189
+ const anchor = '<uses-permission android:name="android.permission.INTERNET" />'
2190
+ if (!rendered.includes(anchor)) {
2191
+ throw new Error(
2192
+ '[vxrn] cannot stamp the brightness permission: expected the INTERNET permission in app/src/main/AndroidManifest.xml'
2193
+ )
2194
+ }
2195
+ // a special app access grant: the user turns it on in settings, and
2196
+ // Settings.System.canWrite stays false for an app that never declared it.
2197
+ rendered = rendered.replace(
2198
+ anchor,
2199
+ `${anchor}\n <uses-permission android:name="android.permission.WRITE_SETTINGS" />`
2200
+ )
2201
+ }
2184
2202
  if (
2185
2203
  platform === 'android' &&
2186
2204
  relativePath === 'app/src/main/AndroidManifest.xml' &&
@@ -179,3 +179,145 @@ describe('codegen SSR entrypoints', () => {
179
179
  }
180
180
  })
181
181
  })
182
+
183
+ describe('subpath exports', () => {
184
+ test('prebundles .mjs subpath exports so they share module instances with the root entry', async () => {
185
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'vxrn-subpath-ssr-')))
186
+ writePkg(root, { name: 'fixture', dependencies: { 'zero-like': '1' } })
187
+ writePkg(join(root, 'node_modules', 'react'), { name: 'react', main: './index.js' })
188
+ const dep = join(root, 'node_modules', 'zero-like')
189
+ writePkg(dep, {
190
+ name: 'zero-like',
191
+ version: '1.0.0',
192
+ type: 'module',
193
+ module: './index.mjs',
194
+ exports: {
195
+ '.': { import: './index.mjs' },
196
+ './server': { import: './server.mjs' },
197
+ },
198
+ dependencies: { react: '*' },
199
+ })
200
+ writeFileSync(join(dep, 'tag.mjs'), 'export const tag = Symbol()\n')
201
+ writeFileSync(join(dep, 'index.mjs'), "export { tag } from './tag.mjs'\n")
202
+ writeFileSync(join(dep, 'server.mjs'), "export { tag as serverTag } from './tag.mjs'\n")
203
+ writeFileSync(
204
+ join(root, 'entry.js'),
205
+ "import { tag } from 'zero-like'\nimport { serverTag } from 'zero-like/server'\nexport const same = tag === serverTag\n"
206
+ )
207
+ const config = await getScannedOptimizeDepsConfig({ root, mode: 'development' })
208
+ const server = await createServer({
209
+ configFile: false,
210
+ root,
211
+ ssr: config.ssr,
212
+ server: { middlewareMode: true },
213
+ optimizeDeps: { noDiscovery: true },
214
+ })
215
+ try {
216
+ const result = await server.ssrLoadModule(join(root, 'entry.js'))
217
+ expect(result.same).toBe(true)
218
+ expect(config.ssr.optimizeDeps.include).toEqual(
219
+ expect.arrayContaining(['zero-like', 'zero-like/server'])
220
+ )
221
+ } finally {
222
+ await server.close()
223
+ }
224
+ })
225
+
226
+ test('prebundles the root of a package that only declares exports', async () => {
227
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'vxrn-exports-root-')))
228
+ writePkg(root, { name: 'fixture', dependencies: { 'exports-only': '1' } })
229
+ writePkg(join(root, 'node_modules', 'react'), { name: 'react', main: './index.js' })
230
+ writePkg(join(root, 'node_modules', 'exports-only'), {
231
+ name: 'exports-only',
232
+ exports: { '.': { import: './index.js' } },
233
+ dependencies: { react: '*' },
234
+ })
235
+
236
+ const result = await scanDepsToOptimize(join(root, 'package.json'))
237
+ expect(result.prebundleDeps).toContain('exports-only')
238
+ })
239
+
240
+ test('reads string and array exports as the root only', async () => {
241
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'vxrn-exports-sugar-')))
242
+ writePkg(root, {
243
+ name: 'fixture',
244
+ dependencies: { 'string-exports': '1', 'array-exports': '1' },
245
+ })
246
+ writePkg(join(root, 'node_modules', 'react'), { name: 'react', main: './index.js' })
247
+ writePkg(join(root, 'node_modules', 'string-exports'), {
248
+ name: 'string-exports',
249
+ exports: './index.js',
250
+ dependencies: { react: '*' },
251
+ })
252
+ writePkg(join(root, 'node_modules', 'array-exports'), {
253
+ name: 'array-exports',
254
+ main: './index.js',
255
+ exports: ['./index.js'],
256
+ dependencies: { react: '*' },
257
+ })
258
+
259
+ const result = await scanDepsToOptimize(join(root, 'package.json'))
260
+ const scanned = (dep: string) =>
261
+ result.prebundleDeps.filter((d) => d === dep || d.startsWith(`${dep}/`))
262
+ expect(scanned('string-exports')).toEqual(['string-exports'])
263
+ expect(scanned('array-exports')).toEqual(['array-exports'])
264
+ })
265
+
266
+ test('never prebundles a subpath that exports a type declaration file', async () => {
267
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'vxrn-dts-subpath-')))
268
+ writePkg(root, { name: 'fixture', dependencies: { 'expo-like': '1' } })
269
+ writePkg(join(root, 'node_modules', 'react'), { name: 'react', main: './index.js' })
270
+ // expo-modules-core 57 exports './types' as a bare declaration file
271
+ writePkg(join(root, 'node_modules', 'expo-like'), {
272
+ name: 'expo-like',
273
+ main: './index.js',
274
+ exports: {
275
+ '.': './index.js',
276
+ './types': './types.d.ts',
277
+ './module-types': './types.d.mts',
278
+ './commonjs-types': './types.d.cts',
279
+ './upper-types': './types.D.ts',
280
+ './server': './server.ts',
281
+ },
282
+ dependencies: { react: '*' },
283
+ })
284
+
285
+ const result = await scanDepsToOptimize(join(root, 'package.json'))
286
+ expect(
287
+ result.prebundleDeps.filter((d) => d === 'expo-like' || d.startsWith('expo-like/'))
288
+ ).toEqual(['expo-like', 'expo-like/server'])
289
+ })
290
+
291
+ test('reads an exports object of conditions as the root, not as subpaths', async () => {
292
+ const root = realpathSync(mkdtempSync(join(tmpdir(), 'vxrn-exports-conditions-')))
293
+ writePkg(root, {
294
+ name: 'fixture',
295
+ dependencies: { 'dual-pkg': '1', 'types-default': '1', 'dts-main': '1' },
296
+ })
297
+ writePkg(join(root, 'node_modules', 'react'), { name: 'react', main: './index.js' })
298
+ writePkg(join(root, 'node_modules', 'dual-pkg'), {
299
+ name: 'dual-pkg',
300
+ exports: { types: './index.d.ts', import: './index.js', require: './index.cjs' },
301
+ dependencies: { react: '*' },
302
+ })
303
+ writePkg(join(root, 'node_modules', 'types-default'), {
304
+ name: 'types-default',
305
+ exports: { types: './index.d.ts', default: './index.js' },
306
+ dependencies: { react: '*' },
307
+ })
308
+ // a declaration main must not hide the runtime exports root
309
+ writePkg(join(root, 'node_modules', 'dts-main'), {
310
+ name: 'dts-main',
311
+ main: './index.d.ts',
312
+ exports: { '.': { import: './index.js' } },
313
+ dependencies: { react: '*' },
314
+ })
315
+
316
+ const result = await scanDepsToOptimize(join(root, 'package.json'))
317
+ const scanned = (dep: string) =>
318
+ result.prebundleDeps.filter((d) => d === dep || d.startsWith(`${dep}/`))
319
+ expect(scanned('dual-pkg')).toEqual(['dual-pkg'])
320
+ expect(result.prebundleDeps.filter((d) => d.startsWith('types-default/'))).toEqual([])
321
+ expect(scanned('dts-main')).toEqual(['dts-main'])
322
+ })
323
+ })
@@ -11,6 +11,26 @@ export type ScanDepsResult = {
11
11
  hasNativewind: boolean
12
12
  }
13
13
 
14
+ // match vite's default optimizable entry extensions; JSX/TSX source
15
+ // remains in its module graph while we still discover child dependencies.
16
+ // a .d.ts declaration has no runtime module to bundle.
17
+ function isPrebundleableEntry(file: string) {
18
+ return !/\.d\.[cm]?ts$/i.test(file) && (!extname(file) || /\.[cm]?[jt]s$/.test(file))
19
+ }
20
+
21
+ // a string exports field, or an object of conditions (no key starting with
22
+ // '.'), is sugar for { '.': target }; an array holds fallbacks for the root,
23
+ // never subpaths
24
+ function getExportsMap(exports: unknown): Record<string, any> {
25
+ if (typeof exports === 'string') return { '.': exports }
26
+ if (!exports || typeof exports !== 'object' || Array.isArray(exports)) return {}
27
+ return Object.keys(exports).some((k) => k.startsWith('.')) ? exports : { '.': exports }
28
+ }
29
+
30
+ function getExportImport(target: any): unknown {
31
+ return typeof target === 'string' ? target : target?.import
32
+ }
33
+
14
34
  /** Known packages that will fail to pre-bundle, or no need to pre-bundle. */
15
35
  export const EXCLUDE_LIST = [
16
36
  'jsc-android',
@@ -241,19 +261,18 @@ export async function scanDepsToOptimize(
241
261
  return []
242
262
  }
243
263
 
244
- const depPkgJsonExports = depPkgJson.exports || {}
264
+ const depPkgJsonExports = getExportsMap(depPkgJson.exports)
245
265
  // We take a more conservative approach to exclude potentially problematic exports entries. This might result in some valid exports entries being excluded, but it ensures that problematic ones are not included, thereby preventing issues.
246
266
  const definedExports = Object.keys(depPkgJsonExports)
247
267
  .filter((k) => {
248
- const expData = depPkgJsonExports[k]
249
- const imp = typeof expData === 'string' ? expData : expData?.import
268
+ const imp = getExportImport(depPkgJsonExports[k])
250
269
  if (typeof imp !== 'string') {
251
270
  // Skipping since it will cause error `No known conditions for "..." specifier in "..." package`.
252
271
  // Note that by doing this, nested exports will be skipped as well.
253
272
  return false
254
273
  }
255
- if (!imp.endsWith('.js')) {
256
- // Skipping since non-js exports cannot be pre-bundled.
274
+ if (!isPrebundleableEntry(imp)) {
275
+ // Skipping since only js and ts entries can be pre-bundled.
257
276
  return false
258
277
  }
259
278
 
@@ -263,8 +282,6 @@ export async function scanDepsToOptimize(
263
282
  return false
264
283
  }
265
284
 
266
- // make sure it
267
-
268
285
  return true
269
286
  })
270
287
  .map((k) => k.replace(/^\.\/?/, ''))
@@ -300,15 +317,16 @@ export async function scanDepsToOptimize(
300
317
  }
301
318
  })()
302
319
 
303
- const mainExport =
304
- depPkgJson['main'] || depPkgJson['module'] || definedExports['.']
320
+ const mainExport = [
321
+ depPkgJson['main'],
322
+ depPkgJson['module'],
323
+ getExportImport(depPkgJsonExports['.']),
324
+ ].find((entry) => typeof entry === 'string' && entry && isPrebundleableEntry(entry))
305
325
 
306
326
  const exports = [...definedExports, ...specialExports].filter(
307
327
  (d) => !EXCLUDE_LIST_SET.has(d)
308
328
  )
309
- // match vite's default optimizable entry extensions; JSX/TSX source
310
- // remains in its module graph while we still discover child dependencies.
311
- if (mainExport && (!extname(mainExport) || /\.[cm]?[jt]s$/.test(mainExport))) {
329
+ if (mainExport) {
312
330
  if (await checkIfExportExists(join(dirname(depPkgJsonPath), mainExport))) {
313
331
  exports.unshift(dep)
314
332
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prebuildWithoutExpo.d.ts","sourceRoot":"","sources":["../../src/exports/prebuildWithoutExpo.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,EACjB,KAAK,iBAAiB,EAEvB,MAAM,+BAA+B,CAAA;AAsEtC,YAAY,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAE3F,eAAO,MAAM,mBAAmB,0BAAoB,CAAA;AAkFpD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA6DhE;AA+MD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,MAAM,CA8CrI;AAg8BD,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAyfD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAA;IAC3B,GAAG,EAAE,iBAAiB,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,oBAAoB,CA66BvB;AAED,eAAO,MAAM,mBAAmB,SACxB,MAAM,YACF,KAAK,GAAG,SAAS,OACtB,iBAAiB,WACd,MAAM,kBAqEf,CAAA;AAgCD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,QA6EvD;AAID,wBAAsB,qBAAqB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,iBAsDzF;AAyFD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