@tamagui/static 3.1.2 → 3.1.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.
@@ -37,7 +37,7 @@ const esbuildLoaderConfig = {
37
37
  };
38
38
  const dataExtensions = Object.keys(esbuildLoaderConfig).filter((k) => esbuildLoaderConfig[k] === "file" || esbuildLoaderConfig[k] === "dataurl").map((k) => k.slice(1));
39
39
  const esbuildIgnoreFilesRegex = new RegExp(`.(${dataExtensions.join("|")})$`, "i");
40
- function getESBuildConfig({ entryPoints, resolvePlatformSpecificEntries, dangerouslyIgnoreStaticEvaluationModules = [], define: callerDefine, conditions: callerConditions = [], ...options }, platform, aliases) {
40
+ function getESBuildConfig({ entryPoints, resolvePlatformSpecificEntries, dangerouslyIgnoreStaticEvaluationModules = [], nativePlatform, define: callerDefine, conditions: callerConditions = [], ...options }, platform, aliases) {
41
41
  if (process.env.DEBUG?.startsWith("tamagui")) {
42
42
  console.info(`Building`, entryPoints);
43
43
  }
@@ -136,6 +136,22 @@ function getESBuildConfig({ entryPoints, resolvePlatformSpecificEntries, dangero
136
136
  {
137
137
  name: "external",
138
138
  setup(build) {
139
+ if (platform === "native") {
140
+ build.onResolve({ filter: /^react-native$/ }, () => ({
141
+ path: "react-native",
142
+ namespace: "tamagui-native-evaluation"
143
+ }));
144
+ build.onLoad({
145
+ filter: /.*/,
146
+ namespace: "tamagui-native-evaluation"
147
+ }, () => ({
148
+ contents: `export * from ${JSON.stringify(nodeRequire.resolve("@tamagui/react-native-web-lite"))}
149
+ import { getNativeColorFactories } from ${JSON.stringify(nodeRequire.resolve("@tamagui/react-native-web-lite/nativeColors"))}
150
+ export const { PlatformColor, DynamicColorIOS } = getNativeColorFactories(${JSON.stringify(nativePlatform || process.env.EXPO_OS || "ios")})`,
151
+ loader: "js",
152
+ resolveDir: build.initialOptions.absWorkingDir || process.cwd()
153
+ }));
154
+ }
139
155
  build.onResolve({ filter: /^@tamagui\/(core|web)$/ }, (args) => {
140
156
  if (args.kind === "entry-point") {
141
157
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.js","names":[],"sources":["esm/extractor/bundle.js"],"sourcesContent":["import { randomBytes } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { esbuildAliasPlugin } from \"./esbuildAliasPlugin\";\nimport { resolveWebOrNativeSpecificEntry } from \"./loadTamagui\";\nimport { TsconfigPathsPlugin } from \"./esbuildTsconfigPaths\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst esbuildLoaderConfig = {\n \".js\": \"jsx\",\n \".png\": \"dataurl\",\n \".jpg\": \"dataurl\",\n \".jpeg\": \"dataurl\",\n \".svg\": \"dataurl\",\n \".gif\": \"dataurl\",\n \".webp\": \"dataurl\",\n \".woff2\": \"dataurl\",\n \".woff\": \"dataurl\",\n \".eot\": \"dataurl\",\n \".otf\": \"dataurl\",\n \".ttf\": \"dataurl\",\n \".mp4\": \"file\",\n \".mpeg4\": \"file\",\n \".mov\": \"file\",\n \".avif\": \"file\",\n \".wmv\": \"file\",\n \".webm\": \"file\",\n \".wav\": \"file\",\n \".aac\": \"file\",\n \".ogg\": \"file\",\n \".flac\": \"file\",\n \".node\": \"empty\"\n};\nconst dataExtensions = Object.keys(esbuildLoaderConfig).filter(\n (k) => esbuildLoaderConfig[k] === \"file\" || esbuildLoaderConfig[k] === \"dataurl\"\n).map((k) => k.slice(1));\nconst esbuildIgnoreFilesRegex = new RegExp(`.(${dataExtensions.join(\"|\")})$`, \"i\");\nfunction getESBuildConfig({\n entryPoints,\n resolvePlatformSpecificEntries,\n dangerouslyIgnoreStaticEvaluationModules = [],\n define: callerDefine,\n conditions: callerConditions = [],\n ...options\n}, platform, aliases) {\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building`, entryPoints);\n }\n const resolvedEntryPoints = !resolvePlatformSpecificEntries ? entryPoints : entryPoints.map((entry) => resolveWebOrNativeSpecificEntry(entry, platform));\n const detectedFormat = options.format || detectEntryFormat(resolvedEntryPoints[0]);\n const platformDefines = platform === \"web\" ? {\n \"process.env.TAMAGUI_TARGET\": '\"web\"',\n \"process.env.EXPO_OS\": '\"web\"'\n } : {\n \"process.env.TAMAGUI_TARGET\": '\"native\"'\n // EXPO_OS doesn't have a useful \"native\" value (it's ios/android),\n // so leave it alone here and let the consumer set it if needed.\n };\n const res = {\n bundle: true,\n entryPoints: resolvedEntryPoints,\n format: detectedFormat,\n define: {\n ...platformDefines,\n ...callerDefine\n },\n conditions: [\n \"tamagui-compiler\",\n ...platform === \"native\" ? [\"react-native\"] : [],\n ...callerConditions\n ],\n ...platform === \"native\" ? {\n mainFields: [\"react-native\", \"module\", \"main\"]\n } : {},\n // for ESM: prefer \"module\" field for resolution, add require() shim for bundled CJS deps\n ...detectedFormat === \"esm\" ? {\n ...platform === \"web\" ? { mainFields: [\"module\", \"main\"] } : {},\n banner: {\n js: 'import { createRequire as __cr } from \"module\"; const require = __cr(import.meta.url);'\n }\n } : {},\n target: \"node24\",\n jsx: \"transform\",\n jsxFactory: \"react\",\n allowOverwrite: true,\n keepNames: true,\n resolveExtensions: [\n ...platform === \"web\" ? [\".web.tsx\", \".web.ts\", \".web.jsx\", \".web.js\"] : [\".native.tsx\", \".native.ts\", \".native.jsx\", \".native.js\"],\n \".tsx\",\n \".ts\",\n \".jsx\",\n \".js\"\n ],\n platform: \"node\",\n tsconfigRaw: {\n compilerOptions: {\n jsx: \"react-jsx\"\n }\n },\n loader: esbuildLoaderConfig,\n logLevel: \"warning\",\n plugins: [\n TsconfigPathsPlugin(),\n staticEvaluationIgnorePlugin(dangerouslyIgnoreStaticEvaluationModules),\n // handle ESM-only features that can't be used with CJS output\n {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n },\n {\n name: \"external\",\n setup(build) {\n build.onResolve({ filter: /^@tamagui\\/(core|web)$/ }, (args) => {\n if (args.kind === \"entry-point\") {\n return null;\n }\n return {\n path: platform === \"native\" ? \"@tamagui/core/native\" : args.path,\n external: true\n };\n });\n build.onResolve({ filter: /react-native\\/package.json$/ }, () => {\n return {\n path: \"react-native/package.json\",\n external: true\n };\n });\n build.onResolve({ filter: /^(react-native|react-native\\/.*)$/ }, (args) => {\n return {\n path: args.path.replace(/^react-native/, \"@tamagui/react-native-web-lite\"),\n external: true\n };\n });\n build.onResolve({ filter: /^(framer-motion|motion)/ }, (args) => {\n return {\n path: args.path,\n external: true\n };\n });\n }\n },\n esbuildAliasPlugin({\n ...aliases\n })\n ],\n ...options\n };\n return res;\n}\nfunction detectEntryFormat(entryPoint) {\n if (entryPoint.startsWith(\"/\") || entryPoint.startsWith(\".\")) {\n return detectModuleFormat(entryPoint);\n }\n try {\n const pkgJsonPath = nodeRequire.resolve(entryPoint + \"/package.json\");\n const pkg = JSON.parse(readFileSync(pkgJsonPath, \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n}\nasync function esbundleTamaguiConfig(props, platform, aliases) {\n const config = getESBuildConfig(props, platform, aliases);\n const tmpFile = `${props.outfile}.tmp.${process.pid}-${randomBytes(6).toString(\"hex\")}`;\n const result = await esbuild.build({\n ...config,\n outfile: tmpFile\n }).catch(async (err) => {\n await FS.remove(tmpFile).catch(() => {\n });\n throw err;\n });\n await FS.rename(tmpFile, props.outfile);\n return result;\n}\nexport {\n esbuildIgnoreFilesRegex,\n esbuildLoaderConfig,\n esbundleTamaguiConfig\n};\n//# sourceMappingURL=bundle.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,sBAAsB;CAC1B,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;AACX;AACA,MAAM,iBAAiB,OAAO,KAAK,mBAAmB,CAAC,CAAC,QACrD,MAAM,oBAAoB,OAAO,UAAU,oBAAoB,OAAO,SACzE,CAAC,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC,CAAC;AACvB,MAAM,0BAA0B,IAAI,OAAO,KAAK,eAAe,KAAK,GAAG,EAAE,KAAK,GAAG;AACjF,SAAS,iBAAiB,EACxB,aACA,gCACA,2CAA2C,CAAC,GAC5C,QAAQ,cACR,YAAY,mBAAmB,CAAC,GAChC,GAAG,WACF,UAAU,SAAS;CACpB,IAAI,QAAQ,IAAI,OAAO,WAAW,SAAS,GAAG;EAC5C,QAAQ,KAAK,YAAY,WAA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AW,WAAW,GAAG,KAAK,WAAW,WAAW,GAAG,GAAG;EAC5D,OAAO,mBAAmB,UAAU;CACtC;CACA,IAAI;EACF,MAAM,cAAc,YAAY,QAAQ,aAAa,eAAe;EACpE,MAAM,MAAM,KAAK,MAAM,aAAa,aAAa,OAAO,CAAC;EACzD,OAAO,IAAI,SAAS,WAAW,QAAQ;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AACA,eAAe,sBAAsB,OAAO,UAAU,SAAS;CAC7D,MAAM,SAAS,iBAAiB,OAAO,UAAU,OAAO;CACxD,MAAM,UAAU,GAAG,MAAM,QAAQ,OAAO,QAAQ,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK;CACpF,MAAM,SAAS,MAAM,QAAQ,MAAM;EACjC,GAAG;EACH,SAAS;CACX,CAAC,CAAC,CAAC,MAAM,OAAO,QAAQ;EACtB,MAAM,GAAG,OAAO,OAAO,CAAC,CAAC,YAAY,CACrC,CAAC;EACD,MAAM;CACR,CAAC;CACD,MAAM,GAAG,OAAO,SAAS,MAAM,OAAO;CACtC,OAAO;AACT"}
1
+ {"version":3,"file":"bundle.js","names":[],"sources":["esm/extractor/bundle.js"],"sourcesContent":["import { randomBytes } from \"node:crypto\";\nimport { readFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { esbuildAliasPlugin } from \"./esbuildAliasPlugin\";\nimport { resolveWebOrNativeSpecificEntry } from \"./loadTamagui\";\nimport { TsconfigPathsPlugin } from \"./esbuildTsconfigPaths\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst esbuildLoaderConfig = {\n \".js\": \"jsx\",\n \".png\": \"dataurl\",\n \".jpg\": \"dataurl\",\n \".jpeg\": \"dataurl\",\n \".svg\": \"dataurl\",\n \".gif\": \"dataurl\",\n \".webp\": \"dataurl\",\n \".woff2\": \"dataurl\",\n \".woff\": \"dataurl\",\n \".eot\": \"dataurl\",\n \".otf\": \"dataurl\",\n \".ttf\": \"dataurl\",\n \".mp4\": \"file\",\n \".mpeg4\": \"file\",\n \".mov\": \"file\",\n \".avif\": \"file\",\n \".wmv\": \"file\",\n \".webm\": \"file\",\n \".wav\": \"file\",\n \".aac\": \"file\",\n \".ogg\": \"file\",\n \".flac\": \"file\",\n \".node\": \"empty\"\n};\nconst dataExtensions = Object.keys(esbuildLoaderConfig).filter(\n (k) => esbuildLoaderConfig[k] === \"file\" || esbuildLoaderConfig[k] === \"dataurl\"\n).map((k) => k.slice(1));\nconst esbuildIgnoreFilesRegex = new RegExp(`.(${dataExtensions.join(\"|\")})$`, \"i\");\nfunction getESBuildConfig({\n entryPoints,\n resolvePlatformSpecificEntries,\n dangerouslyIgnoreStaticEvaluationModules = [],\n nativePlatform,\n define: callerDefine,\n conditions: callerConditions = [],\n ...options\n}, platform, aliases) {\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building`, entryPoints);\n }\n const resolvedEntryPoints = !resolvePlatformSpecificEntries ? entryPoints : entryPoints.map((entry) => resolveWebOrNativeSpecificEntry(entry, platform));\n const detectedFormat = options.format || detectEntryFormat(resolvedEntryPoints[0]);\n const platformDefines = platform === \"web\" ? {\n \"process.env.TAMAGUI_TARGET\": '\"web\"',\n \"process.env.EXPO_OS\": '\"web\"'\n } : {\n \"process.env.TAMAGUI_TARGET\": '\"native\"'\n // EXPO_OS doesn't have a useful \"native\" value (it's ios/android),\n // so leave it alone here and let the consumer set it if needed.\n };\n const res = {\n bundle: true,\n entryPoints: resolvedEntryPoints,\n format: detectedFormat,\n define: {\n ...platformDefines,\n ...callerDefine\n },\n conditions: [\n \"tamagui-compiler\",\n ...platform === \"native\" ? [\"react-native\"] : [],\n ...callerConditions\n ],\n ...platform === \"native\" ? {\n mainFields: [\"react-native\", \"module\", \"main\"]\n } : {},\n // for ESM: prefer \"module\" field for resolution, add require() shim for bundled CJS deps\n ...detectedFormat === \"esm\" ? {\n ...platform === \"web\" ? { mainFields: [\"module\", \"main\"] } : {},\n banner: {\n js: 'import { createRequire as __cr } from \"module\"; const require = __cr(import.meta.url);'\n }\n } : {},\n target: \"node24\",\n jsx: \"transform\",\n jsxFactory: \"react\",\n allowOverwrite: true,\n keepNames: true,\n resolveExtensions: [\n ...platform === \"web\" ? [\".web.tsx\", \".web.ts\", \".web.jsx\", \".web.js\"] : [\".native.tsx\", \".native.ts\", \".native.jsx\", \".native.js\"],\n \".tsx\",\n \".ts\",\n \".jsx\",\n \".js\"\n ],\n platform: \"node\",\n tsconfigRaw: {\n compilerOptions: {\n jsx: \"react-jsx\"\n }\n },\n loader: esbuildLoaderConfig,\n logLevel: \"warning\",\n plugins: [\n TsconfigPathsPlugin(),\n staticEvaluationIgnorePlugin(dangerouslyIgnoreStaticEvaluationModules),\n // handle ESM-only features that can't be used with CJS output\n {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n },\n {\n name: \"external\",\n setup(build) {\n if (platform === \"native\") {\n build.onResolve({ filter: /^react-native$/ }, () => ({\n path: \"react-native\",\n namespace: \"tamagui-native-evaluation\"\n }));\n build.onLoad(\n { filter: /.*/, namespace: \"tamagui-native-evaluation\" },\n () => ({\n // resolve from the compiler and bundle only the pure native color helper.\n contents: `export * from ${JSON.stringify(nodeRequire.resolve(\"@tamagui/react-native-web-lite\"))}\nimport { getNativeColorFactories } from ${JSON.stringify(nodeRequire.resolve(\"@tamagui/react-native-web-lite/nativeColors\"))}\nexport const { PlatformColor, DynamicColorIOS } = getNativeColorFactories(${JSON.stringify(nativePlatform || process.env.EXPO_OS || \"ios\")})`,\n loader: \"js\",\n resolveDir: build.initialOptions.absWorkingDir || process.cwd()\n })\n );\n }\n build.onResolve({ filter: /^@tamagui\\/(core|web)$/ }, (args) => {\n if (args.kind === \"entry-point\") {\n return null;\n }\n return {\n path: platform === \"native\" ? \"@tamagui/core/native\" : args.path,\n external: true\n };\n });\n build.onResolve({ filter: /react-native\\/package.json$/ }, () => {\n return {\n path: \"react-native/package.json\",\n external: true\n };\n });\n build.onResolve({ filter: /^(react-native|react-native\\/.*)$/ }, (args) => {\n return {\n path: args.path.replace(/^react-native/, \"@tamagui/react-native-web-lite\"),\n external: true\n };\n });\n build.onResolve({ filter: /^(framer-motion|motion)/ }, (args) => {\n return {\n path: args.path,\n external: true\n };\n });\n }\n },\n esbuildAliasPlugin({\n ...aliases\n })\n ],\n ...options\n };\n return res;\n}\nfunction detectEntryFormat(entryPoint) {\n if (entryPoint.startsWith(\"/\") || entryPoint.startsWith(\".\")) {\n return detectModuleFormat(entryPoint);\n }\n try {\n const pkgJsonPath = nodeRequire.resolve(entryPoint + \"/package.json\");\n const pkg = JSON.parse(readFileSync(pkgJsonPath, \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n}\nasync function esbundleTamaguiConfig(props, platform, aliases) {\n const config = getESBuildConfig(props, platform, aliases);\n const tmpFile = `${props.outfile}.tmp.${process.pid}-${randomBytes(6).toString(\"hex\")}`;\n const result = await esbuild.build({\n ...config,\n outfile: tmpFile\n }).catch(async (err) => {\n await FS.remove(tmpFile).catch(() => {\n });\n throw err;\n });\n await FS.rename(tmpFile, props.outfile);\n return result;\n}\nexport {\n esbuildIgnoreFilesRegex,\n esbuildLoaderConfig,\n esbundleTamaguiConfig\n};\n//# sourceMappingURL=bundle.js.map\n"],"mappings":";;;;;;;;;;;;AAUA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,sBAAsB;CAC1B,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,UAAU;CACV,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;AACX;AACA,MAAM,iBAAiB,OAAO,KAAK,mBAAmB,CAAC,CAAC,QACrD,MAAM,oBAAoB,OAAO,UAAU,oBAAoB,OAAO,SACzE,CAAC,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC,CAAC;AACvB,MAAM,0BAA0B,IAAI,OAAO,KAAK,eAAe,KAAK,GAAG,EAAE,KAAK,GAAG;AACjF,SAAS,iBAAiB,EACxB,aACA,gCACA,2CAA2C,CAAC,GAC5C,gBACA,QAAQ,cACR,YAAY,mBAAmB,CAAC,GAChC,GAAG,WACF,UAAU,SAAS;CACpB,IAAI,QAAQ,IAAI,OAAO,WAAW,SAAS,GAAG;EAC5C,QAAQ,KAAK,YAAY,WAAW;CACtC;CACA,MAAM,sBAAsB,CAAC,iCAAiC,cAAc,YAAY,KAAK,UAAU,gCAAgC,OAAO,QAAQ,CAAC;CACvJ,MAAM,iBAAiB,QAAQ,UAAU,k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AQ,iBAAiB,gCAAgC;OACzE,UAAU;MACZ;KACF,CAAC;KACD,MAAM,UAAU,EAAE,QAAQ,0BAA0B,IAAI,SAAS;MAC/D,OAAO;OACL,MAAM,KAAK;OACX,UAAU;MACZ;KACF,CAAC;IACH;GACF;GACA,mBAAmB,EACjB,GAAG,QACL,CAAC;EACH;EACA,GAAG;CACL;CACA,OAAO;AACT;AACA,SAAS,kBAAkB,YAAY;CACrC,IAAI,WAAW,WAAW,GAAG,KAAK,WAAW,WAAW,GAAG,GAAG;EAC5D,OAAO,mBAAmB,UAAU;CACtC;CACA,IAAI;EACF,MAAM,cAAc,YAAY,QAAQ,aAAa,eAAe;EACpE,MAAM,MAAM,KAAK,MAAM,aAAa,aAAa,OAAO,CAAC;EACzD,OAAO,IAAI,SAAS,WAAW,QAAQ;CACzC,QAAQ;EACN,OAAO;CACT;AACF;AACA,eAAe,sBAAsB,OAAO,UAAU,SAAS;CAC7D,MAAM,SAAS,iBAAiB,OAAO,UAAU,OAAO;CACxD,MAAM,UAAU,GAAG,MAAM,QAAQ,OAAO,QAAQ,IAAI,GAAG,YAAY,CAAC,CAAC,CAAC,SAAS,KAAK;CACpF,MAAM,SAAS,MAAM,QAAQ,MAAM;EACjC,GAAG;EACH,SAAS;CACX,CAAC,CAAC,CAAC,MAAM,OAAO,QAAQ;EACtB,MAAM,GAAG,OAAO,OAAO,CAAC,CAAC,YAAY,CACrC,CAAC;EACD,MAAM;CACR,CAAC;CACD,MAAM,GAAG,OAAO,SAAS,MAAM,OAAO;CACtC,OAAO;AACT"}
@@ -138,6 +138,7 @@ function getBundleKey(props) {
138
138
  components: props.components,
139
139
  config: props.config,
140
140
  platform: props.platform,
141
+ nativePlatform: props.nativePlatform,
141
142
  dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules
142
143
  });
143
144
  }
@@ -233,7 +234,7 @@ async function bundleConfig(props, rebuild = false) {
233
234
  isBundling = true;
234
235
  const rootRequire = createRequire(join(root, "package.json"));
235
236
  const tmpDir = join(root, ".tamagui");
236
- const platformSuffix = (props.platform || "web") === "native" ? ".native" : ".web";
237
+ const platformSuffix = props.platform === "native" ? `.native${props.nativePlatform ? `.${props.nativePlatform}` : ""}` : ".web";
237
238
  const configFormat = configEntry ? detectModuleFormat(configEntry) : "cjs";
238
239
  const configExt = configFormat === "esm" ? ".mjs" : ".cjs";
239
240
  const configOutPath = join(tmpDir, `tamagui.config${platformSuffix}${configExt}`);
@@ -286,6 +287,7 @@ async function bundleConfig(props, rebuild = false) {
286
287
  absWorkingDir: root,
287
288
  metafile: true,
288
289
  dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,
290
+ nativePlatform: props.nativePlatform,
289
291
  ...esbuildExtraOptions
290
292
  }, props.platform || "web") : null, ...baseComponents.map((componentModule, i) => {
291
293
  return esbundleTamaguiConfig({
@@ -298,6 +300,7 @@ async function bundleConfig(props, rebuild = false) {
298
300
  absWorkingDir: root,
299
301
  metafile: true,
300
302
  dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,
303
+ nativePlatform: props.nativePlatform,
301
304
  ...esbuildExtraOptions
302
305
  }, props.platform || "web");
303
306
  })]);
@@ -444,7 +447,10 @@ async function evaluateComponentModule(props, id) {
444
447
  const previousIsServer = process.env.TAMAGUI_IS_SERVER;
445
448
  process.env.IS_STATIC = "is_static";
446
449
  process.env.TAMAGUI_IS_SERVER = "true";
447
- const { unregister } = registerRequire(props.platform || "web", { ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules });
450
+ const { unregister } = registerRequire(props.platform || "web", {
451
+ ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,
452
+ nativePlatform: props.nativePlatform
453
+ });
448
454
  try {
449
455
  try {
450
456
  return nodeRequire(id);
@@ -483,13 +489,17 @@ async function loadComponentsInner(props, forceExports = false) {
483
489
  const componentsModules = props.components || [];
484
490
  const key = JSON.stringify([
485
491
  props.platform,
492
+ props.nativePlatform,
486
493
  componentsModules,
487
494
  props.dangerouslyIgnoreStaticEvaluationModules
488
495
  ]);
489
496
  if (!forceExports && cacheComponents[key]) {
490
497
  return cacheComponents[key];
491
498
  }
492
- const { unregister } = registerRequire(props.platform || "web", { ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules });
499
+ const { unregister } = registerRequire(props.platform || "web", {
500
+ ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,
501
+ nativePlatform: props.nativePlatform
502
+ });
493
503
  try {
494
504
  const results = [];
495
505
  for (const name of componentsModules) {
@@ -588,13 +598,17 @@ function loadComponentsInnerSync(props, forceExports = false) {
588
598
  const componentsModules = props.components || [];
589
599
  const key = JSON.stringify([
590
600
  props.platform,
601
+ props.nativePlatform,
591
602
  componentsModules,
592
603
  props.dangerouslyIgnoreStaticEvaluationModules
593
604
  ]);
594
605
  if (!forceExports && cacheComponents[key]) {
595
606
  return cacheComponents[key];
596
607
  }
597
- const { unregister } = registerRequire(props.platform || "web", { ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules });
608
+ const { unregister } = registerRequire(props.platform || "web", {
609
+ ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,
610
+ nativePlatform: props.nativePlatform
611
+ });
598
612
  try {
599
613
  const info = componentsModules.flatMap((name) => {
600
614
  const extension = extname(name);
@@ -1 +1 @@
1
- {"version":3,"file":"bundleConfig.js","names":[],"sources":["esm/extractor/bundleConfig.js"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, unlinkSync } from \"node:fs\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep\n} from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { readFile } from \"node:fs/promises\";\nimport { registerRequire, setRequireResult } from \"../registerRequire\";\nimport { addLocalExports } from \"./addLocalExports\";\nimport { esbuildLoaderConfig, esbundleTamaguiConfig } from \"./bundle\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst componentDisplayName = /* @__PURE__ */ Symbol.for(\"tamagui.componentDisplayName\");\nconst activeTempFiles = /* @__PURE__ */ new Set();\nfunction getDynamicEvalOutfile(name, format, contents) {\n const ext = format === \"esm\" ? \"mjs\" : \"cjs\";\n const hash = createHash(\"sha1\").update(name).update(\"\\0\").update(format).update(\"\\0\").update(contents).digest(\"hex\").slice(0, 10);\n return join(process.cwd(), \".tamagui\", `dynamic-eval-${hash}-${basename(name)}.${ext}`);\n}\nfunction getEsbuildStdinLoader(filePath) {\n if (filePath.endsWith(\".tsx\")) return \"tsx\";\n if (filePath.endsWith(\".ts\")) return \"ts\";\n if (filePath.endsWith(\".jsx\")) return \"jsx\";\n return \"js\";\n}\nfunction resolvePackageEntry(packageName, format) {\n if (format === \"cjs\") {\n return nodeRequire.resolve(packageName);\n }\n const packageJsonPath = nodeRequire.resolve(`${packageName}/package.json`);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n const packageRoot = dirname(packageJsonPath);\n const exportEntry = packageJson.exports?.[\".\"];\n const esmEntry = exportEntry?.import || exportEntry?.module || exportEntry?.browser || packageJson.module;\n if (typeof esmEntry === \"string\") {\n return join(packageRoot, esmEntry);\n }\n return nodeRequire.resolve(packageName);\n}\nfunction cleanupTempFiles() {\n for (const f of activeTempFiles) {\n try {\n unlinkSync(f);\n } catch {\n }\n }\n activeTempFiles.clear();\n}\nprocess.on(\"exit\", cleanupTempFiles);\nprocess.on(\"SIGINT\", () => {\n cleanupTempFiles();\n process.exit();\n});\nprocess.on(\"SIGTERM\", () => {\n cleanupTempFiles();\n process.exit();\n});\nconst external = [\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"react\",\n \"react-dom\",\n \"react-native-svg\"\n];\nconst esbuildExtraOptions = {\n define: {\n __DEV__: `${process.env.NODE_ENV === \"development\"}`\n }\n};\nconst handleEsmFeaturesPlugin = {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n};\nconst esbuildTransformOptions = {\n target: \"es2022\",\n format: \"cjs\",\n jsx: \"automatic\",\n platform: \"node\",\n ...esbuildExtraOptions\n};\nconst esbuildOptions = {\n ...esbuildTransformOptions\n};\nconst esbuildOptionsWithPlugins = {\n ...esbuildTransformOptions,\n plugins: [handleEsmFeaturesPlugin]\n};\nlet currentBundle = null;\nlet currentBundleKey = \"\";\nlet isBundling = false;\nlet lastBundle = null;\nconst waitForBundle = /* @__PURE__ */ new Set();\nfunction hasBundledConfigChanged() {\n if (lastBundle === currentBundle) {\n return false;\n }\n lastBundle = currentBundle;\n return true;\n}\nlet loadedConfig = null;\nconst getLoadedConfig = () => loadedConfig;\nconst setLoadedConfig = (config) => {\n loadedConfig = config;\n};\nfunction getBundleKey(props) {\n return JSON.stringify({\n root: props.root,\n components: props.components,\n config: props.config,\n platform: props.platform,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n}\nfunction getPackageNameFromPath(modulePath) {\n const normalized = modulePath.split(sep).join(\"/\");\n const nodeModulesIndex = normalized.lastIndexOf(\"/node_modules/\");\n if (nodeModulesIndex === -1) {\n return normalized.startsWith(\".\") || isAbsolute(normalized) ? void 0 : normalized;\n }\n const packagePath = normalized.slice(nodeModulesIndex + \"/node_modules/\".length);\n const parts = packagePath.split(\"/\");\n return parts[0]?.startsWith(\"@\") ? parts.slice(0, 2).join(\"/\") : parts[0];\n}\nfunction findStaticEvaluationError(error) {\n let current = error;\n while (current instanceof Error) {\n if (\"code\" in current && current.code === \"TAMAGUI_STATIC_EVALUATION_ERROR\" && \"moduleName\" in current && \"importer\" in current && \"failedModule\" in current && \"reason\" in current) {\n return current;\n }\n current = current.cause;\n }\n}\nasync function getBundledConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n if (isBundling) {\n await new Promise((res) => {\n waitForBundle.add(res);\n });\n }\n if (!currentBundle || currentBundleKey !== bundleKey || rebuild) {\n return await bundleConfig(props, rebuild);\n }\n return currentBundle;\n}\nglobal.tamaguiLastLoaded ||= 0;\nfunction updateLastLoaded(config, bundleKey) {\n global.tamaguiLastLoaded = Date.now();\n global.tamaguiLastBundledConfig = config;\n global.tamaguiLastBundledConfigKey = bundleKey;\n}\nlet hasBundledOnce = false;\nlet hasLoggedBuild = false;\nconst packageNameByDirectory = /* @__PURE__ */ new Map();\nfunction owningPackageName(file) {\n let directory = dirname(file);\n const walked = [];\n while (true) {\n const known = packageNameByDirectory.get(directory);\n if (known !== void 0) {\n for (const step of walked) packageNameByDirectory.set(step, known);\n return known;\n }\n walked.push(directory);\n const manifest = join(directory, \"package.json\");\n if (existsSync(manifest)) {\n let name = null;\n try {\n name = JSON.parse(readFileSync(manifest, \"utf-8\")).name ?? null;\n } catch {\n name = null;\n }\n for (const step of walked) packageNameByDirectory.set(step, name);\n return name;\n }\n const parent = dirname(directory);\n if (parent === directory) {\n for (const step of walked) packageNameByDirectory.set(step, null);\n return null;\n }\n directory = parent;\n }\n}\nfunction requiredTamaguiPackageFiles() {\n const found = [];\n for (const file of Object.keys(nodeRequire.cache)) {\n if (!file.includes(\".\")) continue;\n const name = owningPackageName(file);\n if (name === \"tamagui\" || name?.startsWith(\"@tamagui/\")) found.push(file);\n }\n return found;\n}\nasync function bundleConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n const root = props.root || process.cwd();\n const configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config, root) : \"\";\n const baseComponents = (props.components || []).filter((x) => x !== \"@tamagui/core\");\n let componentOutPaths = [];\n let componentImports = [];\n if (!rebuild && global.tamaguiLastBundledConfig && global.tamaguiLastBundledConfigKey === bundleKey && Date.now() - global.tamaguiLastLoaded < 3e3) {\n return global.tamaguiLastBundledConfig;\n }\n try {\n isBundling = true;\n const rootRequire = createRequire(join(root, \"package.json\"));\n const tmpDir = join(root, \".tamagui\");\n const platformSuffix = (props.platform || \"web\") === \"native\" ? \".native\" : \".web\";\n const configFormat = configEntry ? detectModuleFormat(configEntry) : \"cjs\";\n const configExt = configFormat === \"esm\" ? \".mjs\" : \".cjs\";\n const configOutPath = join(tmpDir, `tamagui.config${platformSuffix}${configExt}`);\n const componentFormats = baseComponents.map((mod) => {\n try {\n let packageRoot = dirname(rootRequire.resolve(mod));\n while (!existsSync(join(packageRoot, \"package.json\"))) {\n const parent = dirname(packageRoot);\n if (parent === packageRoot) {\n return \"cjs\";\n }\n packageRoot = parent;\n }\n const pkg = JSON.parse(readFileSync(join(packageRoot, \"package.json\"), \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n });\n componentOutPaths = baseComponents.map((componentModule, i) => {\n const ext = componentFormats[i] === \"esm\" ? \".mjs\" : \".cjs\";\n return join(\n tmpDir,\n `${componentModule.split(sep).join(\"-\").replace(/[^a-z0-9]+/gi, \"\")}-components.config${platformSuffix}${ext}`\n );\n });\n let compilerDependencies = currentBundle?.dependencies ?? [];\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building config entry`, configEntry);\n }\n let shouldBuild = rebuild || !props.disableInitialBuild;\n if (shouldBuild && props.config && !rebuild) {\n const allOutFiles = [configOutPath, ...componentOutPaths];\n try {\n const stats = await Promise.all(\n allOutFiles.map((f) => FS.stat(f).catch(() => null))\n );\n const allExistAndRecent = stats.every(\n (s) => s !== null && Date.now() - s.mtimeMs < 3e3\n );\n if (allExistAndRecent) {\n shouldBuild = false;\n }\n } catch {\n }\n }\n if (shouldBuild) {\n try {\n await FS.ensureDir(tmpDir);\n } catch {\n }\n const start = Date.now();\n const buildResults = await Promise.all([\n props.config ? esbundleTamaguiConfig(\n {\n entryPoints: [configEntry],\n external,\n outfile: configOutPath,\n target: \"node24\",\n format: configFormat,\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n ) : null,\n ...baseComponents.map((componentModule, i) => {\n return esbundleTamaguiConfig(\n {\n entryPoints: [componentModule],\n // bare packages must stay bare so esbuild can select their\n // react-native conditional export; local files still use siblings\n resolvePlatformSpecificEntries: props.platform !== \"native\" || componentModule.startsWith(\".\") || isAbsolute(componentModule),\n external,\n outfile: componentOutPaths[i],\n target: \"node24\",\n format: componentFormats[i],\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n );\n })\n ]);\n compilerDependencies = buildResults.flatMap(\n (result) => result?.metafile ? Object.keys(result.metafile.inputs).map((input) => resolve(root, input)) : []\n );\n componentImports = buildResults.slice(1).map((result) => {\n if (!result?.metafile) {\n return [];\n }\n const entryPoint = Object.values(result.metafile.outputs).find(\n (output) => output.entryPoint\n )?.entryPoint;\n if (!entryPoint) {\n return [];\n }\n return [\n ...new Set(\n result.metafile.inputs[entryPoint]?.imports.map((item) => getPackageNameFromPath(item.path)).filter((moduleName) => Boolean(moduleName)) || []\n )\n ];\n });\n if (!hasLoggedBuild && !props[\"_skipBuildLog\"]) {\n hasLoggedBuild = true;\n colorLog(\n Color.FgYellow,\n `\n \\u27A1 [tamagui] built config, components, prompt (${Date.now() - start}ms)`\n );\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n colorLog(\n Color.Dim,\n `\n Config .${sep}${relative(root, configOutPath)}\n Components ${componentOutPaths.map((p) => `.${sep}${relative(root, p)}`).join(\"\\n \")}\n `\n );\n }\n }\n }\n if (hasBundledOnce) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(configOutPath)];\n } catch {\n }\n for (const p of componentOutPaths) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(p)];\n } catch {\n }\n }\n } else {\n hasBundledOnce = true;\n }\n let out;\n if (configFormat === \"esm\") {\n out = await import(`${pathToFileURL(configOutPath).href}?v=${FS.statSync(configOutPath).mtimeMs}`);\n } else {\n out = nodeRequire(configOutPath);\n }\n let config = out.default || out || out.config;\n if (config && config.config && !config.tokens) {\n config = config.config;\n }\n if (!config) {\n throw new Error(`No config: ${config}`);\n }\n loadedConfig = config;\n if (!config.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n config = createTamagui(config);\n } else {\n const { installTamaguiConfig } = requireTamaguiCore(props.platform || \"web\");\n installTamaguiConfig(config);\n }\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, config);\n }\n if (rebuild) {\n delete cacheComponents[componentOutPaths.join(\"\\0\")];\n }\n let components = await loadComponents({\n ...props,\n components: componentOutPaths\n });\n if (!components) {\n throw new Error(`No components found: ${componentOutPaths.join(\", \")}`);\n }\n for (const component of components) {\n component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName;\n if (!component.moduleName) {\n if (process.env.DEBUG?.includes(\"tamagui\") || process.env.IS_TAMAGUI_DEV) {\n console.warn(\n `\\u26A0\\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(\n baseComponents\n )} in ${JSON.stringify(componentOutPaths)}`\n );\n }\n }\n }\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(\"Loaded components\", components);\n }\n const res = {\n components,\n nameToPaths: {},\n tamaguiConfig: config,\n dependencies: compilerDependencies,\n // the generated bundles inline every source they were built from,\n // including the component packages resolved out of node_modules, so their\n // bytes are a complete description of what the compiler host will read\n stampSources: [\n ...configEntry ? [configOutPath] : [],\n ...componentOutPaths,\n // The generated bundles inline the user's config and components, but\n // `external` keeps @tamagui/core and @tamagui/web out of them, and\n // everything reached only through those two is left out with them.\n // Those packages hold the staticConfig and style engine every lowering\n // is computed against, so without their bytes an in-place engine edit at\n // the same version - exactly what `bun run watch` and\n // `bun release --into` produce - would serve plans built by the\n // previous engine.\n ...requiredTamaguiPackageFiles()\n ]\n };\n currentBundle = res;\n currentBundleKey = bundleKey;\n updateLastLoaded(res, bundleKey);\n return res;\n } catch (err) {\n const failure = findStaticEvaluationError(err);\n const componentIndex = failure ? componentOutPaths.findIndex(\n (outputPath) => outputPath === failure.moduleName || outputPath === failure.importer\n ) : -1;\n const configuredComponent = baseComponents[componentIndex];\n if (failure && configuredComponent) {\n const configuredImport = configuredComponent.startsWith(\".\") || isAbsolute(configuredComponent) ? componentImports[componentIndex]?.[0] || configuredComponent : configuredComponent;\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured component \"${configuredComponent}\".\nThe import \"${configuredImport}\" reached module \"${failure.failedModule}\", which failed during Node evaluation.\nReason: ${failure.reason}\nFix the failing module so it can run in Node during the build. If \"${configuredImport}\" is runtime-only and none of its exports create your Tamagui config or components, add \"${configuredImport}\" to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n }\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured Tamagui config \"${configEntry || \"<default config>\"}\".\nReason: ${err instanceof Error ? err.message : String(err)}\nFix the failing import so it can run in Node during the build. If it is runtime-only and none of its exports create your Tamagui config or components, add its exact module name to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n } finally {\n isBundling = false;\n waitForBundle.forEach((cb) => cb());\n waitForBundle.clear();\n }\n}\nasync function writeTamaguiCSS(outputCSS, config) {\n const flush = async () => {\n colorLog(Color.FgYellow, ` \\u27A1 [tamagui] output css: ${outputCSS}`);\n await FS.mkdirp(dirname(outputCSS));\n await FS.writeFile(outputCSS, css);\n };\n const css = config.getCSS();\n if (typeof css !== \"string\") {\n throw new Error(`Invalid CSS: ${typeof css} ${css}`);\n }\n try {\n if (existsSync(outputCSS) && await readFile(outputCSS, \"utf8\") === css) {\n } else {\n await flush();\n }\n } catch (err) {\n console.info(\"Error writing themes\", err);\n }\n}\nasync function loadComponents(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = await loadComponentsInner(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nasync function evaluateComponentModule(props, id) {\n const previousIsStatic = process.env.IS_STATIC;\n const previousIsServer = process.env.TAMAGUI_IS_SERVER;\n process.env.IS_STATIC = \"is_static\";\n process.env.TAMAGUI_IS_SERVER = \"true\";\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n try {\n return nodeRequire(id);\n } catch (error) {\n const code = error?.code;\n if (code !== \"ERR_REQUIRE_ESM\" && code !== \"ERR_REQUIRE_ASYNC_MODULE\") throw error;\n }\n } finally {\n unregister();\n if (previousIsStatic === void 0) delete process.env.IS_STATIC;\n else process.env.IS_STATIC = previousIsStatic;\n if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;\n else process.env.TAMAGUI_IS_SERVER = previousIsServer;\n }\n return import(`${pathToFileURL(id).href}?v=${FS.statSync(id).mtimeMs}`);\n}\nfunction loadComponentsSync(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = loadComponentsInnerSync(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nfunction getCoreComponentsSync(props) {\n const loaded = loadComponentsInnerSync({\n ...props,\n components: [\"@tamagui/core\"]\n });\n if (!loaded[0]) {\n throw new Error(`Core should always load`);\n }\n return [\n {\n ...loaded[0],\n moduleName: \"@tamagui/core\"\n }\n ];\n}\nasync function loadComponentsInner(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const results = [];\n for (const name of componentsModules) {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const format = isLocal ? detectModuleFormat(name) : \"cjs\";\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n const attemptLoad = async ({ forceExports: forceExports2 = false } = {}) => {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, format, writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n await esbuild.build({\n ...esbuildOptionsWithPlugins,\n plugins: [\n ...esbuildOptionsWithPlugins.plugins || [],\n staticEvaluationIgnorePlugin(\n props.dangerouslyIgnoreStaticEvaluationModules\n )\n ],\n format,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n format\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, format);\n }\n let moduleResult;\n if (format === \"esm\") {\n moduleResult = await import(`${pathToFileURL(loadModule).href}?v=${FS.statSync(loadModule).mtimeMs}`);\n } else {\n moduleResult = nodeRequire(loadModule);\n }\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n };\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n let loaded;\n try {\n loaded = await attemptLoad({ forceExports: isDynamic });\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n try {\n loaded = await attemptLoad({ forceExports: false });\n } catch (err2) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err2 instanceof Error ? err2.message : String(err2)}`,\n { cause: err2 }\n );\n }\n } finally {\n dispose();\n }\n if (Array.isArray(loaded)) {\n results.push(...loaded);\n } else if (loaded) {\n results.push(loaded);\n }\n }\n cacheComponents[key] = results;\n return results;\n } finally {\n unregister();\n }\n}\nfunction loadComponentsInnerSync(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const info = componentsModules.flatMap((name) => {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n function attemptLoad({ forceExports: forceExports2 = false } = {}) {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, \"cjs\", writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n esbuild.buildSync({\n ...esbuildOptions,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n \"esm\"\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, nodeRequire.resolve(loadModule));\n }\n const moduleResult = nodeRequire(loadModule);\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n }\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n try {\n const res = attemptLoad({ forceExports: isDynamic });\n return res;\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n } finally {\n dispose();\n }\n try {\n return attemptLoad({ forceExports: false });\n } catch (err) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n } finally {\n dispose();\n }\n });\n cacheComponents[key] = info;\n return info;\n } finally {\n unregister();\n }\n}\nconst esbuildit = (src, target) => {\n return esbuild.transformSync(src, {\n ...esbuildTransformOptions,\n ...target === \"modern\" && {\n target: \"es2022\",\n jsx: \"automatic\",\n loader: \"tsx\",\n platform: \"neutral\",\n format: \"esm\"\n }\n }).code;\n};\nfunction getComponentStaticConfigByName(name, exported) {\n const components = {};\n if (!exported || typeof exported !== \"object\" || Array.isArray(exported)) {\n throw new Error(`Invalid export from package ${name}: ${typeof exported}`);\n }\n for (const key in exported) {\n const found = getTamaguiComponent(key, exported[key]);\n if (found) {\n const { Component, ...sc } = found.staticConfig;\n components[key] = {\n staticConfig: sc,\n ...found.displayName && { displayName: found.displayName }\n };\n }\n }\n return components;\n}\nfunction getTamaguiComponent(name, Component) {\n if (name[0].toUpperCase() !== name[0]) {\n return;\n }\n const staticConfig = Component?.staticConfig;\n if (staticConfig) {\n return {\n staticConfig,\n displayName: Component[componentDisplayName]\n };\n }\n}\nfunction interopDefaultExport(mod) {\n return mod?.default ?? mod;\n}\nconst cacheComponents = {};\nexport {\n bundleConfig,\n esbuildOptions,\n esbuildOptionsWithPlugins,\n evaluateComponentModule,\n getBundledConfig,\n getComponentStaticConfigByName,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponents,\n loadComponentsInner,\n loadComponentsInnerSync,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n};\n//# sourceMappingURL=bundleConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,uBAAuC,uBAAO,IAAI,8BAA8B;AACtF,MAAM,kCAAkC,IAAI,IAAI;AAChD,SAAS,sBAAsB,MAAM,QAAQ,UAAU;CACrD,MAAM,MAAM,WAAW,QAAQ,QAAQ;CACvC,MAAM,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;CAChI,OAAO,KAAK,QAAQ,IAAI,GAAG,YAAY,gBAAgB,KAAK,GAAG,SAAS,IAAI,EAAE,GAAG,KAAK;AACxF;AACA,SAAS,sBAAsB,UAAU;CACvC,IAAI,SAAS,SAAS,MAAM,GAAG,OAAO;CACtC,IAAI,SAAS,SAAS,KAAK,GAAG,OAAO;CACrC,IAAI,SAAS,SAAS,MAAM,GAAG,OAAO;CACtC,OAAO;AACT;AACA,SAAS,oBAAoB,aAAa,QAAQ;CAChD,IAAI,WAAW,OAAO;EACpB,OAAO,YAAY,QAAQ,WAAW;CACxC;CACA,MAAM,kBAAkB,YAAY,QAAQ,GAAG,YAAY,cAAc;CACzE,MAAM,cAAc,KAAK,MAAM,aAAa,iBAAiB,OAAO,CAAC;CACrE,MAAM,cAAc,QAAQ,eAAe;CAC3C,MAAM,cAAc,YAAY,UAAU;CAC1C,MAAM,WAAW,aAAa,UAAU,aAAa,UAAU,aAAa,WAAW,YAAY;CACnG,IAAI,OAAO,aAAa,UAAU;EAChC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AK,QAAQ,WAAW,KAAK,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG,KACpJ,EAAE,OAAO,IAAI,CACf;GACF,UAAU;IACR,QAAQ;GACV;EACF,CAAC;EACD,gBAAgB,OAAO;EACvB,OAAO;CACT,UAAU;EACR,WAAW;CACb;AACF;AACA,MAAM,aAAa,KAAK,WAAW;CACjC,OAAO,QAAQ,cAAc,KAAK;EAChC,GAAG;EACH,GAAG,WAAW,YAAY;GACxB,QAAQ;GACR,KAAK;GACL,QAAQ;GACR,UAAU;GACV,QAAQ;EACV;CACF,CAAC,CAAC,CAAC;AACL;AACA,SAAS,+BAA+B,MAAM,UAAU;CACtD,MAAM,aAAa,CAAC;CACpB,IAAI,CAAC,YAAY,OAAO,aAAa,YAAY,MAAM,QAAQ,QAAQ,GAAG;EACxE,MAAM,IAAI,MAAM,+BAA+B,KAAK,IAAI,OAAO,UAAU;CAC3E;CACA,KAAK,MAAM,OAAO,UAAU;EAC1B,MAAM,QAAQ,oBAAoB,KAAK,SAAS,IAAI;EACpD,IAAI,OAAO;GACT,MAAM,EAAE,WAAW,GAAG,OAAO,MAAM;GACnC,WAAW,OAAO;IAChB,cAAc;IACd,GAAG,MAAM,eAAe,EAAE,aAAa,MAAM,YAAY;GAC3D;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,oBAAoB,MAAM,WAAW;CAC5C,IAAI,KAAK,EAAE,CAAC,YAAY,MAAM,KAAK,IAAI;EACrC;CACF;CACA,MAAM,eAAe,WAAW;CAChC,IAAI,cAAc;EAChB,OAAO;GACL;GACA,aAAa,UAAU;EACzB;CACF;AACF;AACA,SAAS,qBAAqB,KAAK;CACjC,OAAO,KAAK,WAAW;AACzB;AACA,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"bundleConfig.js","names":[],"sources":["esm/extractor/bundleConfig.js"],"sourcesContent":["import { createHash } from \"node:crypto\";\nimport { createRequire } from \"node:module\";\nimport { existsSync, readFileSync, unlinkSync } from \"node:fs\";\nimport {\n basename,\n dirname,\n extname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep\n} from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport FS from \"fs-extra\";\nimport { readFile } from \"node:fs/promises\";\nimport { registerRequire, setRequireResult } from \"../registerRequire\";\nimport { addLocalExports } from \"./addLocalExports\";\nimport { esbuildLoaderConfig, esbundleTamaguiConfig } from \"./bundle\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { detectModuleFormat } from \"./detectModuleFormat\";\nimport { staticEvaluationIgnorePlugin } from \"../staticEvaluationIgnoredModules\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst componentDisplayName = /* @__PURE__ */ Symbol.for(\"tamagui.componentDisplayName\");\nconst activeTempFiles = /* @__PURE__ */ new Set();\nfunction getDynamicEvalOutfile(name, format, contents) {\n const ext = format === \"esm\" ? \"mjs\" : \"cjs\";\n const hash = createHash(\"sha1\").update(name).update(\"\\0\").update(format).update(\"\\0\").update(contents).digest(\"hex\").slice(0, 10);\n return join(process.cwd(), \".tamagui\", `dynamic-eval-${hash}-${basename(name)}.${ext}`);\n}\nfunction getEsbuildStdinLoader(filePath) {\n if (filePath.endsWith(\".tsx\")) return \"tsx\";\n if (filePath.endsWith(\".ts\")) return \"ts\";\n if (filePath.endsWith(\".jsx\")) return \"jsx\";\n return \"js\";\n}\nfunction resolvePackageEntry(packageName, format) {\n if (format === \"cjs\") {\n return nodeRequire.resolve(packageName);\n }\n const packageJsonPath = nodeRequire.resolve(`${packageName}/package.json`);\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n const packageRoot = dirname(packageJsonPath);\n const exportEntry = packageJson.exports?.[\".\"];\n const esmEntry = exportEntry?.import || exportEntry?.module || exportEntry?.browser || packageJson.module;\n if (typeof esmEntry === \"string\") {\n return join(packageRoot, esmEntry);\n }\n return nodeRequire.resolve(packageName);\n}\nfunction cleanupTempFiles() {\n for (const f of activeTempFiles) {\n try {\n unlinkSync(f);\n } catch {\n }\n }\n activeTempFiles.clear();\n}\nprocess.on(\"exit\", cleanupTempFiles);\nprocess.on(\"SIGINT\", () => {\n cleanupTempFiles();\n process.exit();\n});\nprocess.on(\"SIGTERM\", () => {\n cleanupTempFiles();\n process.exit();\n});\nconst external = [\n \"@tamagui/core\",\n \"@tamagui/web\",\n \"react\",\n \"react-dom\",\n \"react-native-svg\"\n];\nconst esbuildExtraOptions = {\n define: {\n __DEV__: `${process.env.NODE_ENV === \"development\"}`\n }\n};\nconst handleEsmFeaturesPlugin = {\n name: \"handle-esm-features\",\n setup(build) {\n const isCjs = build.initialOptions.format === \"cjs\" || !build.initialOptions.format;\n build.onLoad({ filter: /\\.(ts|tsx|js|jsx|mjs)$/ }, (args) => {\n if (!isCjs) {\n return null;\n }\n if (args.path.includes(\"node_modules\") && !args.path.includes(\"@tamagui\")) {\n return null;\n }\n let contents = readFileSync(args.path, \"utf8\");\n let modified = false;\n if (contents.includes(\"import.meta.env\")) {\n contents = contents.replace(/import\\.meta\\.env/g, \"process.env\");\n modified = true;\n }\n if (contents.includes(\"import.meta.url\")) {\n contents = contents.replace(/import\\.meta\\.url/g, '\"\"');\n modified = true;\n }\n if (contents.includes(\"import.meta.main\")) {\n contents = contents.replace(/import\\.meta\\.main/g, \"false\");\n modified = true;\n }\n if (modified) {\n return {\n contents,\n loader: args.path.endsWith(\".tsx\") ? \"tsx\" : args.path.endsWith(\".ts\") ? \"ts\" : args.path.endsWith(\".jsx\") ? \"jsx\" : \"js\"\n };\n }\n return null;\n });\n }\n};\nconst esbuildTransformOptions = {\n target: \"es2022\",\n format: \"cjs\",\n jsx: \"automatic\",\n platform: \"node\",\n ...esbuildExtraOptions\n};\nconst esbuildOptions = {\n ...esbuildTransformOptions\n};\nconst esbuildOptionsWithPlugins = {\n ...esbuildTransformOptions,\n plugins: [handleEsmFeaturesPlugin]\n};\nlet currentBundle = null;\nlet currentBundleKey = \"\";\nlet isBundling = false;\nlet lastBundle = null;\nconst waitForBundle = /* @__PURE__ */ new Set();\nfunction hasBundledConfigChanged() {\n if (lastBundle === currentBundle) {\n return false;\n }\n lastBundle = currentBundle;\n return true;\n}\nlet loadedConfig = null;\nconst getLoadedConfig = () => loadedConfig;\nconst setLoadedConfig = (config) => {\n loadedConfig = config;\n};\nfunction getBundleKey(props) {\n return JSON.stringify({\n root: props.root,\n components: props.components,\n config: props.config,\n platform: props.platform,\n nativePlatform: props.nativePlatform,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n}\nfunction getPackageNameFromPath(modulePath) {\n const normalized = modulePath.split(sep).join(\"/\");\n const nodeModulesIndex = normalized.lastIndexOf(\"/node_modules/\");\n if (nodeModulesIndex === -1) {\n return normalized.startsWith(\".\") || isAbsolute(normalized) ? void 0 : normalized;\n }\n const packagePath = normalized.slice(nodeModulesIndex + \"/node_modules/\".length);\n const parts = packagePath.split(\"/\");\n return parts[0]?.startsWith(\"@\") ? parts.slice(0, 2).join(\"/\") : parts[0];\n}\nfunction findStaticEvaluationError(error) {\n let current = error;\n while (current instanceof Error) {\n if (\"code\" in current && current.code === \"TAMAGUI_STATIC_EVALUATION_ERROR\" && \"moduleName\" in current && \"importer\" in current && \"failedModule\" in current && \"reason\" in current) {\n return current;\n }\n current = current.cause;\n }\n}\nasync function getBundledConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n if (isBundling) {\n await new Promise((res) => {\n waitForBundle.add(res);\n });\n }\n if (!currentBundle || currentBundleKey !== bundleKey || rebuild) {\n return await bundleConfig(props, rebuild);\n }\n return currentBundle;\n}\nglobal.tamaguiLastLoaded ||= 0;\nfunction updateLastLoaded(config, bundleKey) {\n global.tamaguiLastLoaded = Date.now();\n global.tamaguiLastBundledConfig = config;\n global.tamaguiLastBundledConfigKey = bundleKey;\n}\nlet hasBundledOnce = false;\nlet hasLoggedBuild = false;\nconst packageNameByDirectory = /* @__PURE__ */ new Map();\nfunction owningPackageName(file) {\n let directory = dirname(file);\n const walked = [];\n while (true) {\n const known = packageNameByDirectory.get(directory);\n if (known !== void 0) {\n for (const step of walked) packageNameByDirectory.set(step, known);\n return known;\n }\n walked.push(directory);\n const manifest = join(directory, \"package.json\");\n if (existsSync(manifest)) {\n let name = null;\n try {\n name = JSON.parse(readFileSync(manifest, \"utf-8\")).name ?? null;\n } catch {\n name = null;\n }\n for (const step of walked) packageNameByDirectory.set(step, name);\n return name;\n }\n const parent = dirname(directory);\n if (parent === directory) {\n for (const step of walked) packageNameByDirectory.set(step, null);\n return null;\n }\n directory = parent;\n }\n}\nfunction requiredTamaguiPackageFiles() {\n const found = [];\n for (const file of Object.keys(nodeRequire.cache)) {\n if (!file.includes(\".\")) continue;\n const name = owningPackageName(file);\n if (name === \"tamagui\" || name?.startsWith(\"@tamagui/\")) found.push(file);\n }\n return found;\n}\nasync function bundleConfig(props, rebuild = false) {\n const bundleKey = getBundleKey(props);\n const root = props.root || process.cwd();\n const configEntry = props.config ? getTamaguiConfigPathFromOptionsConfig(props.config, root) : \"\";\n const baseComponents = (props.components || []).filter((x) => x !== \"@tamagui/core\");\n let componentOutPaths = [];\n let componentImports = [];\n if (!rebuild && global.tamaguiLastBundledConfig && global.tamaguiLastBundledConfigKey === bundleKey && Date.now() - global.tamaguiLastLoaded < 3e3) {\n return global.tamaguiLastBundledConfig;\n }\n try {\n isBundling = true;\n const rootRequire = createRequire(join(root, \"package.json\"));\n const tmpDir = join(root, \".tamagui\");\n const platformSuffix = props.platform === \"native\" ? `.native${props.nativePlatform ? `.${props.nativePlatform}` : \"\"}` : \".web\";\n const configFormat = configEntry ? detectModuleFormat(configEntry) : \"cjs\";\n const configExt = configFormat === \"esm\" ? \".mjs\" : \".cjs\";\n const configOutPath = join(tmpDir, `tamagui.config${platformSuffix}${configExt}`);\n const componentFormats = baseComponents.map((mod) => {\n try {\n let packageRoot = dirname(rootRequire.resolve(mod));\n while (!existsSync(join(packageRoot, \"package.json\"))) {\n const parent = dirname(packageRoot);\n if (parent === packageRoot) {\n return \"cjs\";\n }\n packageRoot = parent;\n }\n const pkg = JSON.parse(readFileSync(join(packageRoot, \"package.json\"), \"utf-8\"));\n return pkg.type === \"module\" ? \"esm\" : \"cjs\";\n } catch {\n return \"cjs\";\n }\n });\n componentOutPaths = baseComponents.map((componentModule, i) => {\n const ext = componentFormats[i] === \"esm\" ? \".mjs\" : \".cjs\";\n return join(\n tmpDir,\n `${componentModule.split(sep).join(\"-\").replace(/[^a-z0-9]+/gi, \"\")}-components.config${platformSuffix}${ext}`\n );\n });\n let compilerDependencies = currentBundle?.dependencies ?? [];\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Building config entry`, configEntry);\n }\n let shouldBuild = rebuild || !props.disableInitialBuild;\n if (shouldBuild && props.config && !rebuild) {\n const allOutFiles = [configOutPath, ...componentOutPaths];\n try {\n const stats = await Promise.all(\n allOutFiles.map((f) => FS.stat(f).catch(() => null))\n );\n const allExistAndRecent = stats.every(\n (s) => s !== null && Date.now() - s.mtimeMs < 3e3\n );\n if (allExistAndRecent) {\n shouldBuild = false;\n }\n } catch {\n }\n }\n if (shouldBuild) {\n try {\n await FS.ensureDir(tmpDir);\n } catch {\n }\n const start = Date.now();\n const buildResults = await Promise.all([\n props.config ? esbundleTamaguiConfig(\n {\n entryPoints: [configEntry],\n external,\n outfile: configOutPath,\n target: \"node24\",\n format: configFormat,\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n ) : null,\n ...baseComponents.map((componentModule, i) => {\n return esbundleTamaguiConfig(\n {\n entryPoints: [componentModule],\n // bare packages must stay bare so esbuild can select their\n // react-native conditional export; local files still use siblings\n resolvePlatformSpecificEntries: props.platform !== \"native\" || componentModule.startsWith(\".\") || isAbsolute(componentModule),\n external,\n outfile: componentOutPaths[i],\n target: \"node24\",\n format: componentFormats[i],\n absWorkingDir: root,\n metafile: true,\n dangerouslyIgnoreStaticEvaluationModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform,\n ...esbuildExtraOptions\n },\n props.platform || \"web\"\n );\n })\n ]);\n compilerDependencies = buildResults.flatMap(\n (result) => result?.metafile ? Object.keys(result.metafile.inputs).map((input) => resolve(root, input)) : []\n );\n componentImports = buildResults.slice(1).map((result) => {\n if (!result?.metafile) {\n return [];\n }\n const entryPoint = Object.values(result.metafile.outputs).find(\n (output) => output.entryPoint\n )?.entryPoint;\n if (!entryPoint) {\n return [];\n }\n return [\n ...new Set(\n result.metafile.inputs[entryPoint]?.imports.map((item) => getPackageNameFromPath(item.path)).filter((moduleName) => Boolean(moduleName)) || []\n )\n ];\n });\n if (!hasLoggedBuild && !props[\"_skipBuildLog\"]) {\n hasLoggedBuild = true;\n colorLog(\n Color.FgYellow,\n `\n \\u27A1 [tamagui] built config, components, prompt (${Date.now() - start}ms)`\n );\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n colorLog(\n Color.Dim,\n `\n Config .${sep}${relative(root, configOutPath)}\n Components ${componentOutPaths.map((p) => `.${sep}${relative(root, p)}`).join(\"\\n \")}\n `\n );\n }\n }\n }\n if (hasBundledOnce) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(configOutPath)];\n } catch {\n }\n for (const p of componentOutPaths) {\n try {\n delete nodeRequire.cache[nodeRequire.resolve(p)];\n } catch {\n }\n }\n } else {\n hasBundledOnce = true;\n }\n let out;\n if (configFormat === \"esm\") {\n out = await import(`${pathToFileURL(configOutPath).href}?v=${FS.statSync(configOutPath).mtimeMs}`);\n } else {\n out = nodeRequire(configOutPath);\n }\n let config = out.default || out || out.config;\n if (config && config.config && !config.tokens) {\n config = config.config;\n }\n if (!config) {\n throw new Error(`No config: ${config}`);\n }\n loadedConfig = config;\n if (!config.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n config = createTamagui(config);\n } else {\n const { installTamaguiConfig } = requireTamaguiCore(props.platform || \"web\");\n installTamaguiConfig(config);\n }\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, config);\n }\n if (rebuild) {\n delete cacheComponents[componentOutPaths.join(\"\\0\")];\n }\n let components = await loadComponents({\n ...props,\n components: componentOutPaths\n });\n if (!components) {\n throw new Error(`No components found: ${componentOutPaths.join(\", \")}`);\n }\n for (const component of components) {\n component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName;\n if (!component.moduleName) {\n if (process.env.DEBUG?.includes(\"tamagui\") || process.env.IS_TAMAGUI_DEV) {\n console.warn(\n `\\u26A0\\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(\n baseComponents\n )} in ${JSON.stringify(componentOutPaths)}`\n );\n }\n }\n }\n if (process.env.NODE_ENV === \"development\" && process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(\"Loaded components\", components);\n }\n const res = {\n components,\n nameToPaths: {},\n tamaguiConfig: config,\n dependencies: compilerDependencies,\n // the generated bundles inline every source they were built from,\n // including the component packages resolved out of node_modules, so their\n // bytes are a complete description of what the compiler host will read\n stampSources: [\n ...configEntry ? [configOutPath] : [],\n ...componentOutPaths,\n // The generated bundles inline the user's config and components, but\n // `external` keeps @tamagui/core and @tamagui/web out of them, and\n // everything reached only through those two is left out with them.\n // Those packages hold the staticConfig and style engine every lowering\n // is computed against, so without their bytes an in-place engine edit at\n // the same version - exactly what `bun run watch` and\n // `bun release --into` produce - would serve plans built by the\n // previous engine.\n ...requiredTamaguiPackageFiles()\n ]\n };\n currentBundle = res;\n currentBundleKey = bundleKey;\n updateLastLoaded(res, bundleKey);\n return res;\n } catch (err) {\n const failure = findStaticEvaluationError(err);\n const componentIndex = failure ? componentOutPaths.findIndex(\n (outputPath) => outputPath === failure.moduleName || outputPath === failure.importer\n ) : -1;\n const configuredComponent = baseComponents[componentIndex];\n if (failure && configuredComponent) {\n const configuredImport = configuredComponent.startsWith(\".\") || isAbsolute(configuredComponent) ? componentImports[componentIndex]?.[0] || configuredComponent : configuredComponent;\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured component \"${configuredComponent}\".\nThe import \"${configuredImport}\" reached module \"${failure.failedModule}\", which failed during Node evaluation.\nReason: ${failure.reason}\nFix the failing module so it can run in Node during the build. If \"${configuredImport}\" is runtime-only and none of its exports create your Tamagui config or components, add \"${configuredImport}\" to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n }\n throw new Error(\n `[tamagui] Static evaluation could not proceed for configured Tamagui config \"${configEntry || \"<default config>\"}\".\nReason: ${err instanceof Error ? err.message : String(err)}\nFix the failing import so it can run in Node during the build. If it is runtime-only and none of its exports create your Tamagui config or components, add its exact module name to dangerouslyIgnoreStaticEvaluationModules in tamagui.build.ts.`,\n { cause: err }\n );\n } finally {\n isBundling = false;\n waitForBundle.forEach((cb) => cb());\n waitForBundle.clear();\n }\n}\nasync function writeTamaguiCSS(outputCSS, config) {\n const flush = async () => {\n colorLog(Color.FgYellow, ` \\u27A1 [tamagui] output css: ${outputCSS}`);\n await FS.mkdirp(dirname(outputCSS));\n await FS.writeFile(outputCSS, css);\n };\n const css = config.getCSS();\n if (typeof css !== \"string\") {\n throw new Error(`Invalid CSS: ${typeof css} ${css}`);\n }\n try {\n if (existsSync(outputCSS) && await readFile(outputCSS, \"utf8\") === css) {\n } else {\n await flush();\n }\n } catch (err) {\n console.info(\"Error writing themes\", err);\n }\n}\nasync function loadComponents(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = await loadComponentsInner(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nasync function evaluateComponentModule(props, id) {\n const previousIsStatic = process.env.IS_STATIC;\n const previousIsServer = process.env.TAMAGUI_IS_SERVER;\n process.env.IS_STATIC = \"is_static\";\n process.env.TAMAGUI_IS_SERVER = \"true\";\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform\n });\n try {\n try {\n return nodeRequire(id);\n } catch (error) {\n const code = error?.code;\n if (code !== \"ERR_REQUIRE_ESM\" && code !== \"ERR_REQUIRE_ASYNC_MODULE\") throw error;\n }\n } finally {\n unregister();\n if (previousIsStatic === void 0) delete process.env.IS_STATIC;\n else process.env.IS_STATIC = previousIsStatic;\n if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;\n else process.env.TAMAGUI_IS_SERVER = previousIsServer;\n }\n return import(`${pathToFileURL(id).href}?v=${FS.statSync(id).mtimeMs}`);\n}\nfunction loadComponentsSync(props, forceExports = false) {\n const coreComponents = getCoreComponentsSync(props);\n const otherComponents = loadComponentsInnerSync(props, forceExports);\n return [...coreComponents, ...otherComponents];\n}\nfunction getCoreComponentsSync(props) {\n const loaded = loadComponentsInnerSync({\n ...props,\n components: [\"@tamagui/core\"]\n });\n if (!loaded[0]) {\n throw new Error(`Core should always load`);\n }\n return [\n {\n ...loaded[0],\n moduleName: \"@tamagui/core\"\n }\n ];\n}\nasync function loadComponentsInner(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n props.nativePlatform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform\n });\n try {\n const results = [];\n for (const name of componentsModules) {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const format = isLocal ? detectModuleFormat(name) : \"cjs\";\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n const attemptLoad = async ({ forceExports: forceExports2 = false } = {}) => {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, format, writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n await esbuild.build({\n ...esbuildOptionsWithPlugins,\n plugins: [\n ...esbuildOptionsWithPlugins.plugins || [],\n staticEvaluationIgnorePlugin(\n props.dangerouslyIgnoreStaticEvaluationModules\n )\n ],\n format,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n format\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n format\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, format);\n }\n let moduleResult;\n if (format === \"esm\") {\n moduleResult = await import(`${pathToFileURL(loadModule).href}?v=${FS.statSync(loadModule).mtimeMs}`);\n } else {\n moduleResult = nodeRequire(loadModule);\n }\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n };\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n let loaded;\n try {\n loaded = await attemptLoad({ forceExports: isDynamic });\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n try {\n loaded = await attemptLoad({ forceExports: false });\n } catch (err2) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err2 instanceof Error ? err2.message : String(err2)}`,\n { cause: err2 }\n );\n }\n } finally {\n dispose();\n }\n if (Array.isArray(loaded)) {\n results.push(...loaded);\n } else if (loaded) {\n results.push(loaded);\n }\n }\n cacheComponents[key] = results;\n return results;\n } finally {\n unregister();\n }\n}\nfunction loadComponentsInnerSync(props, forceExports = false) {\n const componentsModules = props.components || [];\n const key = JSON.stringify([\n props.platform,\n props.nativePlatform,\n componentsModules,\n props.dangerouslyIgnoreStaticEvaluationModules\n ]);\n if (!forceExports && cacheComponents[key]) {\n return cacheComponents[key];\n }\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform\n });\n try {\n const info = componentsModules.flatMap((name) => {\n const extension = extname(name);\n const isLocal = Boolean(extension);\n const isDynamic = isLocal && forceExports;\n const fileContents = isDynamic ? readFileSync(name, \"utf-8\") : \"\";\n let loadModule = name;\n let writtenContents = fileContents;\n function attemptLoad({ forceExports: forceExports2 = false } = {}) {\n if (isDynamic) {\n writtenContents = forceExports2 ? addLocalExports(esbuildit(fileContents, \"modern\"), name) : fileContents;\n loadModule = getDynamicEvalOutfile(name, \"cjs\", writtenContents);\n FS.ensureDirSync(dirname(loadModule));\n activeTempFiles.add(loadModule);\n esbuild.buildSync({\n ...esbuildOptions,\n outfile: loadModule,\n stdin: {\n contents: writtenContents,\n resolveDir: dirname(name),\n sourcefile: name,\n loader: getEsbuildStdinLoader(name)\n },\n alias: {\n \"react-native\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-lite\": resolvePackageEntry(\n \"@tamagui/react-native-web-lite\",\n \"esm\"\n ),\n \"@tamagui/react-native-web-internals\": resolvePackageEntry(\n \"@tamagui/react-native-web-internals\",\n \"esm\"\n )\n },\n bundle: true,\n packages: \"external\",\n allowOverwrite: true,\n sourcemap: false,\n loader: esbuildLoaderConfig\n });\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`loadModule`, loadModule, nodeRequire.resolve(loadModule));\n }\n const moduleResult = nodeRequire(loadModule);\n if (!forceExports2) {\n setRequireResult(name, moduleResult);\n }\n const nameToInfo = getComponentStaticConfigByName(\n name,\n interopDefaultExport(moduleResult)\n );\n return {\n moduleName: name,\n nameToInfo\n };\n }\n const dispose = () => {\n if (isDynamic) {\n FS.removeSync(loadModule);\n activeTempFiles.delete(loadModule);\n }\n };\n try {\n const res = attemptLoad({ forceExports: isDynamic });\n return res;\n } catch (err) {\n if (!isDynamic) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n }\n writtenContents = fileContents;\n if (process.env.DEBUG?.startsWith(\"tamagui\")) {\n console.info(`Error adding local component exports`, err);\n }\n } finally {\n dispose();\n }\n try {\n return attemptLoad({ forceExports: false });\n } catch (err) {\n throw new Error(\n `[tamagui] Failed to statically evaluate configured component module \"${name}\" at \"${loadModule}\". ${err instanceof Error ? err.message : String(err)}`,\n { cause: err }\n );\n } finally {\n dispose();\n }\n });\n cacheComponents[key] = info;\n return info;\n } finally {\n unregister();\n }\n}\nconst esbuildit = (src, target) => {\n return esbuild.transformSync(src, {\n ...esbuildTransformOptions,\n ...target === \"modern\" && {\n target: \"es2022\",\n jsx: \"automatic\",\n loader: \"tsx\",\n platform: \"neutral\",\n format: \"esm\"\n }\n }).code;\n};\nfunction getComponentStaticConfigByName(name, exported) {\n const components = {};\n if (!exported || typeof exported !== \"object\" || Array.isArray(exported)) {\n throw new Error(`Invalid export from package ${name}: ${typeof exported}`);\n }\n for (const key in exported) {\n const found = getTamaguiComponent(key, exported[key]);\n if (found) {\n const { Component, ...sc } = found.staticConfig;\n components[key] = {\n staticConfig: sc,\n ...found.displayName && { displayName: found.displayName }\n };\n }\n }\n return components;\n}\nfunction getTamaguiComponent(name, Component) {\n if (name[0].toUpperCase() !== name[0]) {\n return;\n }\n const staticConfig = Component?.staticConfig;\n if (staticConfig) {\n return {\n staticConfig,\n displayName: Component[componentDisplayName]\n };\n }\n}\nfunction interopDefaultExport(mod) {\n return mod?.default ?? mod;\n}\nconst cacheComponents = {};\nexport {\n bundleConfig,\n esbuildOptions,\n esbuildOptionsWithPlugins,\n evaluateComponentModule,\n getBundledConfig,\n getComponentStaticConfigByName,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponents,\n loadComponentsInner,\n loadComponentsInnerSync,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n};\n//# sourceMappingURL=bundleConfig.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,uBAAuC,uBAAO,IAAI,8BAA8B;AACtF,MAAM,kCAAkC,IAAI,IAAI;AAChD,SAAS,sBAAsB,MAAM,QAAQ,UAAU;CACrD,MAAM,MAAM,WAAW,QAAQ,QAAQ;CACvC,MAAM,OAAO,WAAW,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,EAAE;CAChI,OAAO,KAAK,QAAQ,IAAI,GAAG,YAAY,gBAAgB,KAAK,GAAG,SAAS,IAAI,EAAE,GAAG,KAAK;AACxF;AACA,SAAS,sBAAsB,UAAU;CACvC,IAAI,SAAS,SAAS,MAAM,GAAG,OAAO;CACtC,IAAI,SAAS,SAAS,KAAK,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AK,SAAS,IAAI;EACpD,IAAI,OAAO;GACT,MAAM,EAAE,WAAW,GAAG,OAAO,MAAM;GACnC,WAAW,OAAO;IAChB,cAAc;IACd,GAAG,MAAM,eAAe,EAAE,aAAa,MAAM,YAAY;GAC3D;EACF;CACF;CACA,OAAO;AACT;AACA,SAAS,oBAAoB,MAAM,WAAW;CAC5C,IAAI,KAAK,EAAE,CAAC,YAAY,MAAM,KAAK,IAAI;EACrC;CACF;CACA,MAAM,eAAe,WAAW;CAChC,IAAI,cAAc;EAChB,OAAO;GACL;GACA,aAAa,UAAU;EACzB;CACF;AACF;AACA,SAAS,qBAAqB,KAAK;CACjC,OAAO,KAAK,WAAW;AACzB;AACA,MAAM,kBAAkB,CAAC"}
@@ -208,7 +208,10 @@ function loadTamaguiSync({ forceExports, cacheKey, ...propsIn }) {
208
208
  const previousDev = globalThis["__DEV__"];
209
209
  process.env.IS_STATIC = "is_static";
210
210
  process.env.TAMAGUI_IS_SERVER = "true";
211
- const { unregister } = registerRequire(props.platform || "web", { ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules });
211
+ const { unregister } = registerRequire(props.platform || "web", {
212
+ ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,
213
+ nativePlatform: props.nativePlatform
214
+ });
212
215
  try {
213
216
  globalThis["__DEV__"] = process.env.NODE_ENV === "development";
214
217
  let tamaguiConfig = null;
@@ -1 +1 @@
1
- {"version":3,"file":"loadTamagui.js","names":[],"sources":["esm/extractor/loadTamagui.js"],"sourcesContent":["import { basename, dirname, extname, join, relative, resolve } from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport fsExtra from \"fs-extra\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { getNameToPaths, registerRequire, setRequireResult } from \"../registerRequire\";\nimport {\n getComponentStaticConfigByName,\n getBundledConfig,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n} from \"./bundleConfig\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport {\n generateTamaguiThemes,\n regenerateConfig,\n regenerateConfigSync\n} from \"./regenerateConfig\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst getFilledOptions = (propsIn) => ({\n // defaults\n platform: process.env.TAMAGUI_TARGET || \"web\",\n config: \"tamagui.config.ts\",\n components: [\"tamagui\"],\n ...propsIn\n});\nlet isLoadingPromise;\nasync function loadTamagui(propsIn, rebuild = false) {\n if (isLoadingPromise) return await isLoadingPromise;\n isLoadingPromise = (async () => {\n const props = getFilledOptions(propsIn);\n const bundleInfo = await getBundledConfig(props, rebuild);\n if (!bundleInfo) {\n throw new Error(\n `[tamagui] The config and component bundle completed without a project result`\n );\n }\n await generateThemesAndLog(props, rebuild);\n const maybeTamaguiConfig = bundleInfo.tamaguiConfig;\n if (maybeTamaguiConfig && !maybeTamaguiConfig.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n bundleInfo.tamaguiConfig = createTamagui(bundleInfo.tamaguiConfig);\n }\n if (!hasBundledConfigChanged()) {\n return bundleInfo;\n }\n await regenerateConfig(props, bundleInfo);\n return bundleInfo;\n })();\n try {\n return await isLoadingPromise;\n } finally {\n isLoadingPromise = null;\n }\n}\nasync function loadTamaguiFromModules(propsIn, evaluated) {\n const props = getFilledOptions(propsIn);\n await generateThemesAndLog(props);\n const configModule = evaluated.config;\n let tamaguiConfig = configModule.default || configModule.config || configModule;\n if (\"config\" in tamaguiConfig && tamaguiConfig.config && !(\"tokens\" in tamaguiConfig)) {\n tamaguiConfig = tamaguiConfig.config;\n }\n if (!tamaguiConfig) {\n throw new Error(`The Vite module runner did not return a valid Tamagui config`);\n }\n const hostCore = requireTamaguiCore(props.platform || \"web\");\n if (!tamaguiConfig.parsed) {\n tamaguiConfig = hostCore.createTamagui(tamaguiConfig);\n } else {\n hostCore.installTamaguiConfig(tamaguiConfig);\n }\n setLoadedConfig(tamaguiConfig);\n const components = evaluated.components.map(({ moduleName, module }) => {\n setRequireResult(moduleName, module);\n return {\n moduleName,\n nameToInfo: getComponentStaticConfigByName(moduleName, module.default ?? module)\n };\n });\n const projectInfo = {\n components,\n nameToPaths: {},\n tamaguiConfig,\n stampSources: evaluated.stampSources\n };\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, projectInfo.tamaguiConfig);\n }\n await regenerateConfig(props, projectInfo);\n return projectInfo;\n}\nlet waiting = false;\nconst generateThemesAndLog = async (options, force = false) => {\n if (waiting) return;\n if (!options.themeBuilder) return;\n try {\n waiting = true;\n await new Promise((res) => setTimeout(res, 30));\n const didGenerate = await generateTamaguiThemes(options, force);\n if (didGenerate) {\n const whitespaceBefore = ` `;\n colorLog(\n Color.FgYellow,\n `${whitespaceBefore}\\u27A1 [tamagui] generated themes: ${relative(\n options.root || process.cwd(),\n options.themeBuilder.output\n )}`\n );\n if (options.outputCSS) {\n const loadedConfig = getLoadedConfig();\n if (loadedConfig) {\n await writeTamaguiCSS(options.outputCSS, loadedConfig);\n }\n }\n }\n } finally {\n waiting = false;\n }\n};\nconst last = {};\nconst lastVersion = {};\nconst buildConfigDependencies = /* @__PURE__ */ new WeakMap();\nfunction getTamaguiBuildConfigDependencies(options) {\n return buildConfigDependencies.get(options) ?? [];\n}\nconst esbuildBuildConfigLoader = async (absolutePath, root) => {\n const result = await esbuild.build({\n entryPoints: [absolutePath],\n absWorkingDir: root,\n bundle: true,\n packages: \"external\",\n platform: \"node\",\n format: \"cjs\",\n target: \"node18\",\n write: false,\n metafile: true\n });\n const code = result.outputFiles[0]?.text;\n if (!code) throw new Error(`No output generated for ${absolutePath}`);\n const module = { exports: {} };\n const projectRequire = createRequire(absolutePath);\n const fn = new Function(\"module\", \"exports\", \"require\", \"process\", code);\n fn(module, module.exports, projectRequire, process);\n return {\n exports: module.exports,\n dependencies: Object.keys(result.metafile.inputs)\n };\n};\nasync function loadTamaguiBuildConfigAsync(tamaguiOptions, loadBuildConfigModule = esbuildBuildConfigLoader) {\n const buildFilePath = tamaguiOptions?.buildFile ?? \"./tamagui.build.ts\";\n const root = tamaguiOptions?.root || process.cwd();\n const absolutePath = resolve(root, buildFilePath);\n if (fsExtra.existsSync(absolutePath)) {\n try {\n const evaluated = await loadBuildConfigModule(absolutePath, root);\n const out = evaluated.exports.default || evaluated.exports;\n if (!out || typeof out !== \"object\") {\n throw new Error(`No default export found in ${buildFilePath}: ${out}`);\n }\n const loadedOptions = {\n ...tamaguiOptions,\n ...out\n };\n const dependencies2 = evaluated.dependencies.map((file) => resolve(root, file));\n buildConfigDependencies.set(loadedOptions, dependencies2);\n tamaguiOptions = loadedOptions;\n } catch (err) {\n console.error(`[tamagui] Error loading ${buildFilePath}:`, err);\n throw err;\n }\n }\n if (!tamaguiOptions) {\n throw new Error(\n `No tamagui build options found either via input props or at tamagui.build.ts`\n );\n }\n const options = {\n config: \"tamagui.config.ts\",\n components: [\"tamagui\", \"@tamagui/core\"],\n ...tamaguiOptions\n };\n const dependencies = buildConfigDependencies.get(tamaguiOptions);\n if (dependencies) buildConfigDependencies.set(options, dependencies);\n return options;\n}\nfunction loadTamaguiBuildConfigSync(tamaguiOptions) {\n const buildFilePath = tamaguiOptions?.buildFile ?? \"./tamagui.build.ts\";\n const root = tamaguiOptions?.root || process.cwd();\n const absolutePath = resolve(root, buildFilePath);\n if (fsExtra.existsSync(absolutePath)) {\n const registered = registerRequire(\"web\", {\n ignoredModules: tamaguiOptions?.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const out = nodeRequire(absolutePath).default;\n if (!out) {\n throw new Error(`No default export found in ${buildFilePath}: ${out}`);\n }\n tamaguiOptions = {\n ...tamaguiOptions,\n ...out\n };\n } finally {\n registered.unregister();\n }\n }\n if (!tamaguiOptions) {\n throw new Error(\n `No tamagui build options found either via input props or at tamagui.build.ts`\n );\n }\n return {\n config: \"tamagui.config.ts\",\n components: [\"tamagui\", \"@tamagui/core\"],\n ...tamaguiOptions\n };\n}\nfunction loadTamaguiSync({\n forceExports,\n cacheKey,\n ...propsIn\n}) {\n const key = JSON.stringify(propsIn);\n if (last[key] && !hasBundledConfigChanged()) {\n if (!lastVersion[key] || lastVersion[key] === cacheKey) {\n return last[key];\n }\n }\n lastVersion[key] = cacheKey || \"\";\n const props = getFilledOptions(propsIn);\n const previousIsStatic = process.env.IS_STATIC;\n const previousIsServer = process.env.TAMAGUI_IS_SERVER;\n const previousDev = globalThis[\"__DEV__\"];\n process.env.IS_STATIC = \"is_static\";\n process.env.TAMAGUI_IS_SERVER = \"true\";\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n globalThis[\"__DEV__\"] = process.env.NODE_ENV === \"development\";\n let tamaguiConfig = null;\n if (propsIn.config) {\n const configPath = getTamaguiConfigPathFromOptionsConfig(\n propsIn.config,\n propsIn.root\n );\n const exp = nodeRequire(configPath);\n if (!exp) {\n throw new Error(`The Tamagui config module did not export a value`);\n }\n tamaguiConfig = exp[\"default\"] || exp[\"config\"] || exp;\n if (!tamaguiConfig || !tamaguiConfig.parsed) {\n const confPath = nodeRequire.resolve(configPath);\n throw new Error(`Can't find valid config in ${confPath}:\n \n Be sure you \"export default\" or \"export const config\" the config.`);\n }\n if (tamaguiConfig) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n createTamagui(tamaguiConfig);\n }\n }\n const components = loadComponentsSync(props, forceExports);\n if (!components) {\n throw new Error(`No components loaded`);\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`components`, components);\n }\n const info = {\n components,\n tamaguiConfig,\n nameToPaths: getNameToPaths()\n };\n if (tamaguiConfig) {\n const { outputCSS } = props;\n if (outputCSS) {\n writeTamaguiCSS(outputCSS, tamaguiConfig);\n }\n regenerateConfigSync(props, info);\n }\n last[key] = {\n ...info,\n cached: true\n };\n return info;\n } finally {\n if (previousIsStatic === void 0) delete process.env.IS_STATIC;\n else process.env.IS_STATIC = previousIsStatic;\n if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;\n else process.env.TAMAGUI_IS_SERVER = previousIsServer;\n globalThis[\"__DEV__\"] = previousDev;\n unregister();\n }\n}\nasync function getOptions({\n root = process.cwd(),\n tsconfigPath = \"tsconfig.json\",\n tamaguiOptions,\n host,\n debug\n} = {}) {\n const dotDir = join(root, \".tamagui\");\n let pkgJson = {};\n try {\n pkgJson = await fsExtra.readJSON(join(root, \"package.json\"));\n } catch (err) {\n }\n return {\n mode: process.env.NODE_ENV === \"production\" ? \"production\" : \"development\",\n root,\n host: host || \"127.0.0.1\",\n pkgJson,\n debug,\n tsconfigPath,\n tamaguiOptions: {\n platform: process.env.TAMAGUI_TARGET || \"web\",\n components: [\"tamagui\"],\n ...tamaguiOptions,\n config: tamaguiOptions?.config ?? await getDefaultTamaguiConfigPath(root, tamaguiOptions?.config)\n },\n paths: {\n root,\n dotDir,\n conf: join(dotDir, \"tamagui.config.json\"),\n types: join(dotDir, \"types.json\")\n }\n };\n}\nfunction resolveWebOrNativeSpecificEntry(entry, platform) {\n const workspaceRoot = resolve();\n const resolved = nodeRequire.resolve(entry, { paths: [workspaceRoot] });\n const ext = extname(resolved);\n const fileName = basename(resolved).replace(ext, \"\");\n const target = platform || process.env.TAMAGUI_TARGET || \"web\";\n const specificExt = target === \"web\" ? \"web\" : \"native\";\n const specificFile = join(dirname(resolved), fileName + \".\" + specificExt + ext);\n if (fsExtra.existsSync(specificFile)) {\n return specificFile;\n }\n return entry;\n}\nconst defaultPaths = [\"tamagui.config.ts\", join(\"src\", \"tamagui.config.ts\")];\nlet hasWarnedOnce = false;\nasync function getDefaultTamaguiConfigPath(root, configPath) {\n const searchPaths = [\n ...new Set(\n [configPath, ...defaultPaths].filter(Boolean).map((p) => join(root, p))\n )\n ];\n for (const path of searchPaths) {\n if (await fsExtra.pathExists(path)) {\n return path;\n }\n }\n if (!hasWarnedOnce) {\n hasWarnedOnce = true;\n console.warn(`Warning: couldn't find tamagui.config.ts in the following paths given configuration \"${configPath}\":\n ${searchPaths.join(`\n `)}\n `);\n }\n}\nasync function esbuildWatchFiles(entry, onChanged) {\n let hasRunOnce = false;\n const context = await esbuild.context({\n bundle: true,\n entryPoints: [entry],\n resolveExtensions: [\".ts\", \".tsx\", \".js\", \".mjs\"],\n logLevel: \"silent\",\n write: false,\n alias: {\n \"react-native-web\": \"@tamagui/react-native-web-lite\",\n \"react-native\": \"@tamagui/react-native-web-lite\"\n },\n plugins: [\n // to log what its watching:\n // {\n // name: 'test',\n // setup({ onResolve }) {\n // onResolve({ filter: /.*/ }, (args) => {\n // console.log('wtf', args.path)\n // })\n // },\n // },\n {\n name: `on-rebuild`,\n setup({ onEnd, onResolve }) {\n let filter = /^[^./]|^\\.[^./]|^\\.\\.[^/]/;\n onResolve({ filter }, (args) => ({ path: args.path, external: true }));\n onEnd(() => {\n if (!hasRunOnce) {\n hasRunOnce = true;\n } else {\n onChanged();\n }\n });\n }\n }\n ]\n });\n void context.watch();\n return () => {\n context.dispose();\n };\n}\nexport {\n esbuildWatchFiles,\n generateThemesAndLog,\n getOptions,\n getTamaguiBuildConfigDependencies,\n loadTamagui,\n loadTamaguiBuildConfigAsync,\n loadTamaguiBuildConfigSync,\n loadTamaguiFromModules,\n loadTamaguiSync,\n resolveWebOrNativeSpecificEntry\n};\n//# sourceMappingURL=loadTamagui.js.map\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,oBAAoB,aAAa;CAErC,UAAU,QAAQ,IAAI,kBAAkB;CACxC,QAAQ;CACR,YAAY,CAAC,SAAS;CACtB,GAAG;AACL;AACA,IAAI;AACJ,eAAe,YAAY,SAAS,UAAU,OAAO;CACnD,IAAI,kBAAkB,OAAO,MAAM;CACnC,oBAAoB,YAAY;EAC9B,MAAM,QAAQ,i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pB,gBAAgB;EAClB;EACA,SAAS,CAUP;GACE,MAAM;GACN,MAAM,EAAE,OAAO,aAAa;IAC1B,IAAI,SAAS;IACb,UAAU,EAAE,OAAO,IAAI,UAAU;KAAE,MAAM,KAAK;KAAM,UAAU;IAAK,EAAE;IACrE,YAAY;KACV,IAAI,CAAC,YAAY;MACf,aAAa;KACf,OAAO;MACL,UAAU;KACZ;IACF,CAAC;GACH;EACF,CACF;CACF,CAAC;CACD,KAAK,QAAQ,MAAM;CACnB,aAAa;EACX,QAAQ,QAAQ;CAClB;AACF"}
1
+ {"version":3,"file":"loadTamagui.js","names":[],"sources":["esm/extractor/loadTamagui.js"],"sourcesContent":["import { basename, dirname, extname, join, relative, resolve } from \"node:path\";\nimport { createRequire } from \"node:module\";\nimport { Color, colorLog } from \"@tamagui/cli-color\";\nimport esbuild from \"esbuild\";\nimport fsExtra from \"fs-extra\";\nimport { requireTamaguiCore } from \"../helpers/requireTamaguiCore\";\nimport { getNameToPaths, registerRequire, setRequireResult } from \"../registerRequire\";\nimport {\n getComponentStaticConfigByName,\n getBundledConfig,\n getLoadedConfig,\n hasBundledConfigChanged,\n loadComponentsSync,\n setLoadedConfig,\n writeTamaguiCSS\n} from \"./bundleConfig\";\nimport { getTamaguiConfigPathFromOptionsConfig } from \"./getTamaguiConfigPathFromOptionsConfig\";\nimport {\n generateTamaguiThemes,\n regenerateConfig,\n regenerateConfigSync\n} from \"./regenerateConfig\";\nconst nodeRequire = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst getFilledOptions = (propsIn) => ({\n // defaults\n platform: process.env.TAMAGUI_TARGET || \"web\",\n config: \"tamagui.config.ts\",\n components: [\"tamagui\"],\n ...propsIn\n});\nlet isLoadingPromise;\nasync function loadTamagui(propsIn, rebuild = false) {\n if (isLoadingPromise) return await isLoadingPromise;\n isLoadingPromise = (async () => {\n const props = getFilledOptions(propsIn);\n const bundleInfo = await getBundledConfig(props, rebuild);\n if (!bundleInfo) {\n throw new Error(\n `[tamagui] The config and component bundle completed without a project result`\n );\n }\n await generateThemesAndLog(props, rebuild);\n const maybeTamaguiConfig = bundleInfo.tamaguiConfig;\n if (maybeTamaguiConfig && !maybeTamaguiConfig.parsed) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n bundleInfo.tamaguiConfig = createTamagui(bundleInfo.tamaguiConfig);\n }\n if (!hasBundledConfigChanged()) {\n return bundleInfo;\n }\n await regenerateConfig(props, bundleInfo);\n return bundleInfo;\n })();\n try {\n return await isLoadingPromise;\n } finally {\n isLoadingPromise = null;\n }\n}\nasync function loadTamaguiFromModules(propsIn, evaluated) {\n const props = getFilledOptions(propsIn);\n await generateThemesAndLog(props);\n const configModule = evaluated.config;\n let tamaguiConfig = configModule.default || configModule.config || configModule;\n if (\"config\" in tamaguiConfig && tamaguiConfig.config && !(\"tokens\" in tamaguiConfig)) {\n tamaguiConfig = tamaguiConfig.config;\n }\n if (!tamaguiConfig) {\n throw new Error(`The Vite module runner did not return a valid Tamagui config`);\n }\n const hostCore = requireTamaguiCore(props.platform || \"web\");\n if (!tamaguiConfig.parsed) {\n tamaguiConfig = hostCore.createTamagui(tamaguiConfig);\n } else {\n hostCore.installTamaguiConfig(tamaguiConfig);\n }\n setLoadedConfig(tamaguiConfig);\n const components = evaluated.components.map(({ moduleName, module }) => {\n setRequireResult(moduleName, module);\n return {\n moduleName,\n nameToInfo: getComponentStaticConfigByName(moduleName, module.default ?? module)\n };\n });\n const projectInfo = {\n components,\n nameToPaths: {},\n tamaguiConfig,\n stampSources: evaluated.stampSources\n };\n if (props.outputCSS) {\n await writeTamaguiCSS(props.outputCSS, projectInfo.tamaguiConfig);\n }\n await regenerateConfig(props, projectInfo);\n return projectInfo;\n}\nlet waiting = false;\nconst generateThemesAndLog = async (options, force = false) => {\n if (waiting) return;\n if (!options.themeBuilder) return;\n try {\n waiting = true;\n await new Promise((res) => setTimeout(res, 30));\n const didGenerate = await generateTamaguiThemes(options, force);\n if (didGenerate) {\n const whitespaceBefore = ` `;\n colorLog(\n Color.FgYellow,\n `${whitespaceBefore}\\u27A1 [tamagui] generated themes: ${relative(\n options.root || process.cwd(),\n options.themeBuilder.output\n )}`\n );\n if (options.outputCSS) {\n const loadedConfig = getLoadedConfig();\n if (loadedConfig) {\n await writeTamaguiCSS(options.outputCSS, loadedConfig);\n }\n }\n }\n } finally {\n waiting = false;\n }\n};\nconst last = {};\nconst lastVersion = {};\nconst buildConfigDependencies = /* @__PURE__ */ new WeakMap();\nfunction getTamaguiBuildConfigDependencies(options) {\n return buildConfigDependencies.get(options) ?? [];\n}\nconst esbuildBuildConfigLoader = async (absolutePath, root) => {\n const result = await esbuild.build({\n entryPoints: [absolutePath],\n absWorkingDir: root,\n bundle: true,\n packages: \"external\",\n platform: \"node\",\n format: \"cjs\",\n target: \"node18\",\n write: false,\n metafile: true\n });\n const code = result.outputFiles[0]?.text;\n if (!code) throw new Error(`No output generated for ${absolutePath}`);\n const module = { exports: {} };\n const projectRequire = createRequire(absolutePath);\n const fn = new Function(\"module\", \"exports\", \"require\", \"process\", code);\n fn(module, module.exports, projectRequire, process);\n return {\n exports: module.exports,\n dependencies: Object.keys(result.metafile.inputs)\n };\n};\nasync function loadTamaguiBuildConfigAsync(tamaguiOptions, loadBuildConfigModule = esbuildBuildConfigLoader) {\n const buildFilePath = tamaguiOptions?.buildFile ?? \"./tamagui.build.ts\";\n const root = tamaguiOptions?.root || process.cwd();\n const absolutePath = resolve(root, buildFilePath);\n if (fsExtra.existsSync(absolutePath)) {\n try {\n const evaluated = await loadBuildConfigModule(absolutePath, root);\n const out = evaluated.exports.default || evaluated.exports;\n if (!out || typeof out !== \"object\") {\n throw new Error(`No default export found in ${buildFilePath}: ${out}`);\n }\n const loadedOptions = {\n ...tamaguiOptions,\n ...out\n };\n const dependencies2 = evaluated.dependencies.map((file) => resolve(root, file));\n buildConfigDependencies.set(loadedOptions, dependencies2);\n tamaguiOptions = loadedOptions;\n } catch (err) {\n console.error(`[tamagui] Error loading ${buildFilePath}:`, err);\n throw err;\n }\n }\n if (!tamaguiOptions) {\n throw new Error(\n `No tamagui build options found either via input props or at tamagui.build.ts`\n );\n }\n const options = {\n config: \"tamagui.config.ts\",\n components: [\"tamagui\", \"@tamagui/core\"],\n ...tamaguiOptions\n };\n const dependencies = buildConfigDependencies.get(tamaguiOptions);\n if (dependencies) buildConfigDependencies.set(options, dependencies);\n return options;\n}\nfunction loadTamaguiBuildConfigSync(tamaguiOptions) {\n const buildFilePath = tamaguiOptions?.buildFile ?? \"./tamagui.build.ts\";\n const root = tamaguiOptions?.root || process.cwd();\n const absolutePath = resolve(root, buildFilePath);\n if (fsExtra.existsSync(absolutePath)) {\n const registered = registerRequire(\"web\", {\n ignoredModules: tamaguiOptions?.dangerouslyIgnoreStaticEvaluationModules\n });\n try {\n const out = nodeRequire(absolutePath).default;\n if (!out) {\n throw new Error(`No default export found in ${buildFilePath}: ${out}`);\n }\n tamaguiOptions = {\n ...tamaguiOptions,\n ...out\n };\n } finally {\n registered.unregister();\n }\n }\n if (!tamaguiOptions) {\n throw new Error(\n `No tamagui build options found either via input props or at tamagui.build.ts`\n );\n }\n return {\n config: \"tamagui.config.ts\",\n components: [\"tamagui\", \"@tamagui/core\"],\n ...tamaguiOptions\n };\n}\nfunction loadTamaguiSync({\n forceExports,\n cacheKey,\n ...propsIn\n}) {\n const key = JSON.stringify(propsIn);\n if (last[key] && !hasBundledConfigChanged()) {\n if (!lastVersion[key] || lastVersion[key] === cacheKey) {\n return last[key];\n }\n }\n lastVersion[key] = cacheKey || \"\";\n const props = getFilledOptions(propsIn);\n const previousIsStatic = process.env.IS_STATIC;\n const previousIsServer = process.env.TAMAGUI_IS_SERVER;\n const previousDev = globalThis[\"__DEV__\"];\n process.env.IS_STATIC = \"is_static\";\n process.env.TAMAGUI_IS_SERVER = \"true\";\n const { unregister } = registerRequire(props.platform || \"web\", {\n ignoredModules: props.dangerouslyIgnoreStaticEvaluationModules,\n nativePlatform: props.nativePlatform\n });\n try {\n globalThis[\"__DEV__\"] = process.env.NODE_ENV === \"development\";\n let tamaguiConfig = null;\n if (propsIn.config) {\n const configPath = getTamaguiConfigPathFromOptionsConfig(\n propsIn.config,\n propsIn.root\n );\n const exp = nodeRequire(configPath);\n if (!exp) {\n throw new Error(`The Tamagui config module did not export a value`);\n }\n tamaguiConfig = exp[\"default\"] || exp[\"config\"] || exp;\n if (!tamaguiConfig || !tamaguiConfig.parsed) {\n const confPath = nodeRequire.resolve(configPath);\n throw new Error(`Can't find valid config in ${confPath}:\n \n Be sure you \"export default\" or \"export const config\" the config.`);\n }\n if (tamaguiConfig) {\n const { createTamagui } = requireTamaguiCore(props.platform || \"web\");\n createTamagui(tamaguiConfig);\n }\n }\n const components = loadComponentsSync(props, forceExports);\n if (!components) {\n throw new Error(`No components loaded`);\n }\n if (process.env.DEBUG === \"tamagui\") {\n console.info(`components`, components);\n }\n const info = {\n components,\n tamaguiConfig,\n nameToPaths: getNameToPaths()\n };\n if (tamaguiConfig) {\n const { outputCSS } = props;\n if (outputCSS) {\n writeTamaguiCSS(outputCSS, tamaguiConfig);\n }\n regenerateConfigSync(props, info);\n }\n last[key] = {\n ...info,\n cached: true\n };\n return info;\n } finally {\n if (previousIsStatic === void 0) delete process.env.IS_STATIC;\n else process.env.IS_STATIC = previousIsStatic;\n if (previousIsServer === void 0) delete process.env.TAMAGUI_IS_SERVER;\n else process.env.TAMAGUI_IS_SERVER = previousIsServer;\n globalThis[\"__DEV__\"] = previousDev;\n unregister();\n }\n}\nasync function getOptions({\n root = process.cwd(),\n tsconfigPath = \"tsconfig.json\",\n tamaguiOptions,\n host,\n debug\n} = {}) {\n const dotDir = join(root, \".tamagui\");\n let pkgJson = {};\n try {\n pkgJson = await fsExtra.readJSON(join(root, \"package.json\"));\n } catch (err) {\n }\n return {\n mode: process.env.NODE_ENV === \"production\" ? \"production\" : \"development\",\n root,\n host: host || \"127.0.0.1\",\n pkgJson,\n debug,\n tsconfigPath,\n tamaguiOptions: {\n platform: process.env.TAMAGUI_TARGET || \"web\",\n components: [\"tamagui\"],\n ...tamaguiOptions,\n config: tamaguiOptions?.config ?? await getDefaultTamaguiConfigPath(root, tamaguiOptions?.config)\n },\n paths: {\n root,\n dotDir,\n conf: join(dotDir, \"tamagui.config.json\"),\n types: join(dotDir, \"types.json\")\n }\n };\n}\nfunction resolveWebOrNativeSpecificEntry(entry, platform) {\n const workspaceRoot = resolve();\n const resolved = nodeRequire.resolve(entry, { paths: [workspaceRoot] });\n const ext = extname(resolved);\n const fileName = basename(resolved).replace(ext, \"\");\n const target = platform || process.env.TAMAGUI_TARGET || \"web\";\n const specificExt = target === \"web\" ? \"web\" : \"native\";\n const specificFile = join(dirname(resolved), fileName + \".\" + specificExt + ext);\n if (fsExtra.existsSync(specificFile)) {\n return specificFile;\n }\n return entry;\n}\nconst defaultPaths = [\"tamagui.config.ts\", join(\"src\", \"tamagui.config.ts\")];\nlet hasWarnedOnce = false;\nasync function getDefaultTamaguiConfigPath(root, configPath) {\n const searchPaths = [\n ...new Set(\n [configPath, ...defaultPaths].filter(Boolean).map((p) => join(root, p))\n )\n ];\n for (const path of searchPaths) {\n if (await fsExtra.pathExists(path)) {\n return path;\n }\n }\n if (!hasWarnedOnce) {\n hasWarnedOnce = true;\n console.warn(`Warning: couldn't find tamagui.config.ts in the following paths given configuration \"${configPath}\":\n ${searchPaths.join(`\n `)}\n `);\n }\n}\nasync function esbuildWatchFiles(entry, onChanged) {\n let hasRunOnce = false;\n const context = await esbuild.context({\n bundle: true,\n entryPoints: [entry],\n resolveExtensions: [\".ts\", \".tsx\", \".js\", \".mjs\"],\n logLevel: \"silent\",\n write: false,\n alias: {\n \"react-native-web\": \"@tamagui/react-native-web-lite\",\n \"react-native\": \"@tamagui/react-native-web-lite\"\n },\n plugins: [\n // to log what its watching:\n // {\n // name: 'test',\n // setup({ onResolve }) {\n // onResolve({ filter: /.*/ }, (args) => {\n // console.log('wtf', args.path)\n // })\n // },\n // },\n {\n name: `on-rebuild`,\n setup({ onEnd, onResolve }) {\n let filter = /^[^./]|^\\.[^./]|^\\.\\.[^/]/;\n onResolve({ filter }, (args) => ({ path: args.path, external: true }));\n onEnd(() => {\n if (!hasRunOnce) {\n hasRunOnce = true;\n } else {\n onChanged();\n }\n });\n }\n }\n ]\n });\n void context.watch();\n return () => {\n context.dispose();\n };\n}\nexport {\n esbuildWatchFiles,\n generateThemesAndLog,\n getOptions,\n getTamaguiBuildConfigDependencies,\n loadTamagui,\n loadTamaguiBuildConfigAsync,\n loadTamaguiBuildConfigSync,\n loadTamaguiFromModules,\n loadTamaguiSync,\n resolveWebOrNativeSpecificEntry\n};\n//# sourceMappingURL=loadTamagui.js.map\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAM,cAAc,cAClB,OAAO,eAAe,WAAW,aAAa,YAAY,GAC5D;AACA,MAAM,oBAAoB,aAAa;CAErC,UAAU,QAAQ,IAAI,kBAAkB;CACxC,QAAQ;CACR,YAAY,CAAC,SAAS;CACtB,GAAG;AACL;AACA,IAAI;AACJ,eAAe,YAAY,SAAS,UAAU,OAAO;CACnD,IAAI,kBAAkB,OAAO,MAAM;CACnC,oBAAoB,YAAY;EAC9B,MAAM,QAAQ,iBAAiB,OAAO;EACtC,MAAM,aAAa,MAAM,iBAAiB,OAAO,OAAO;EACxD,IAAI,CAAC,YAAY;GACf,MAAM,IAAI,MACR,8EACF;EACF;EACA,MAAM,qBAAqB,OAAO,OAAO;EACzC,MAAM,qBAAqB,WAAW;EACtC,IAAI,sBAAsB,CAAC,mBAAmB,QAAQ;GACpD,MAAM,EAAE,kBAAkB,mBAAmB,MAAM,YAAY,KAAK;GACpE,WAAW,gBAAgB,cAAc,WAAW,aAAa;EACnE;EACA,IAAI,CAAC,wBAAwB,GAAG;GAC9B,OAAO;EACT;EACA,MAAM,iBAAiB,OAAO,UAAU;EACxC,OAAO;CACT,EAAC,CAAE;CACH,IAAI;EACF,OAAO,MAAM;CACf,UAAU;EACR,mBAAmB;CACrB;AACF;AACA,eAAe,u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AAI,QAAQ,WAAW,YAAY,GAAG;EACpC,OAAO;CACT;CACA,OAAO;AACT;AACA,MAAM,eAAe,CAAC,qBAAqB,KAAK,OAAO,mBAAmB,CAAC;AAC3E,IAAI,gBAAgB;AACpB,eAAe,4BAA4B,MAAM,YAAY;CAC3D,MAAM,cAAc,CAClB,GAAG,IAAI,IACL,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,MAAM,KAAK,MAAM,CAAC,CAAC,CACxE,CACF;CACA,KAAK,MAAM,QAAQ,aAAa;EAC9B,IAAI,MAAM,QAAQ,WAAW,IAAI,GAAG;GAClC,OAAO;EACT;CACF;CACA,IAAI,CAAC,eAAe;EAClB,gBAAgB;EAChB,QAAQ,KAAK,wFAAwF,WAAW;MAC9G,YAAY,KAAK;GACpB,EAAE;GACF;CACD;AACF;AACA,eAAe,kBAAkB,OAAO,WAAW;CACjD,IAAI,aAAa;CACjB,MAAM,UAAU,MAAM,QAAQ,QAAQ;EACpC,QAAQ;EACR,aAAa,CAAC,KAAK;EACnB,mBAAmB;GAAC;GAAO;GAAQ;GAAO;EAAM;EAChD,UAAU;EACV,OAAO;EACP,OAAO;GACL,oBAAoB;GACpB,gBAAgB;EAClB;EACA,SAAS,CAUP;GACE,MAAM;GACN,MAAM,EAAE,OAAO,aAAa;IAC1B,IAAI,SAAS;IACb,UAAU,EAAE,OAAO,IAAI,UAAU;KAAE,MAAM,KAAK;KAAM,UAAU;IAAK,EAAE;IACrE,YAAY;KACV,IAAI,CAAC,YAAY;MACf,aAAa;KACf,OAAO;MACL,UAAU;KACZ;IACF,CAAC;GACH;EACF,CACF;CACF,CAAC;CACD,KAAK,QAAQ,MAAM;CACnB,aAAa;EACX,QAAQ,QAAQ;CAClB;AACF"}
@@ -4,6 +4,7 @@ import { register } from "esbuild-register/dist/node";
4
4
  import { createRequire } from "node:module";
5
5
  import { esbuildIgnoreFilesRegex } from "./extractor/bundle.mjs";
6
6
  import { requireTamaguiCore } from "./helpers/requireTamaguiCore.mjs";
7
+ import { getNativeColorFactories } from "@tamagui/react-native-web-lite/nativeColors";
7
8
  import { getStaticEvaluationModuleReplacement, isIgnoredStaticEvaluationModule } from "./staticEvaluationIgnoredModules.mjs";
8
9
 
9
10
  const nameToPaths = {};
@@ -32,6 +33,14 @@ const compiled = {};
32
33
  function setRequireResult(name, result) {
33
34
  compiled[name] = result;
34
35
  }
36
+ function requireNativeEvaluationModule(modulePath, nativePlatform) {
37
+ const registration = registerRequire("native", { nativePlatform });
38
+ try {
39
+ return nodeRequire(modulePath);
40
+ } finally {
41
+ registration.unregister();
42
+ }
43
+ }
35
44
  function getStaticExtractionStub(path) {
36
45
  switch (path) {
37
46
  case "expo-constants": return {
@@ -85,7 +94,7 @@ function getStaticExtractionStub(path) {
85
94
  default: return null;
86
95
  }
87
96
  }
88
- function registerRequire(platform, { ignoredModules = [] } = { ignoredModules: [] }) {
97
+ function registerRequire(platform, { ignoredModules = [], nativePlatform } = { ignoredModules: [] }) {
89
98
  if (isRegistered) {
90
99
  return {
91
100
  tamaguiRequire: nodeRequire,
@@ -114,6 +123,7 @@ function registerRequire(platform, { ignoredModules = [] } = { ignoredModules: [
114
123
  }
115
124
  isRegistered = true;
116
125
  Module.prototype.require = tamaguiRequire;
126
+ let nativeModule;
117
127
  function tamaguiRequire(path) {
118
128
  const staticExtractionStub = getStaticExtractionStub(path);
119
129
  if (staticExtractionStub) {
@@ -161,6 +171,12 @@ function registerRequire(platform, { ignoredModules = [] } = { ignoredModules: [
161
171
  if (path === "react-native/package.json") {
162
172
  return og.apply(this, ["react-native-web/package.json"]);
163
173
  }
174
+ if (platform === "native" && path === "react-native") {
175
+ return nativeModule ||= {
176
+ ...og.apply(this, ["@tamagui/react-native-web-lite"]),
177
+ ...getNativeColorFactories(nativePlatform || process.env.EXPO_OS || "ios")
178
+ };
179
+ }
164
180
  if (path === "@tamagui/react-native-web-lite" || path === "react-native" || path.startsWith("react-native/") || path === "react-native-web" || path.startsWith("react-native-web/")) {
165
181
  try {
166
182
  return og.apply("react-native");
@@ -191,5 +207,5 @@ function registerRequire(platform, { ignoredModules = [] } = { ignoredModules: [
191
207
  };
192
208
  }
193
209
 
194
- export { getNameToPaths, registerRequire, setRequireResult };
210
+ export { getNameToPaths, registerRequire, requireNativeEvaluationModule, setRequireResult };
195
211
  //# sourceMappingURL=registerRequire.mjs.map