@tamagui/static 1.135.2 → 1.135.4-1761748186554

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.
Files changed (181) hide show
  1. package/dist/check-dep-versions.mjs +268 -0
  2. package/dist/check-dep-versions.mjs.map +1 -0
  3. package/dist/checkDeps.mjs +33 -0
  4. package/dist/checkDeps.mjs.map +1 -0
  5. package/dist/constants.mjs +50 -0
  6. package/dist/constants.mjs.map +1 -0
  7. package/dist/exports.mjs +42 -0
  8. package/dist/exports.mjs.map +1 -0
  9. package/dist/extractor/accessSafe.mjs +47 -0
  10. package/dist/extractor/accessSafe.mjs.map +1 -0
  11. package/dist/extractor/babelParse.mjs +55 -0
  12. package/dist/extractor/babelParse.mjs.map +1 -0
  13. package/dist/extractor/bundle.mjs +149 -0
  14. package/dist/extractor/bundle.mjs.map +1 -0
  15. package/dist/extractor/bundleConfig.mjs +331 -0
  16. package/dist/extractor/bundleConfig.mjs.map +1 -0
  17. package/dist/extractor/concatClassName.mjs +79 -0
  18. package/dist/extractor/concatClassName.mjs.map +1 -0
  19. package/dist/extractor/createEvaluator.mjs +76 -0
  20. package/dist/extractor/createEvaluator.mjs.map +1 -0
  21. package/dist/extractor/createExtractor.mjs +976 -0
  22. package/dist/extractor/createExtractor.mjs.map +1 -0
  23. package/dist/extractor/createLogger.mjs +46 -0
  24. package/dist/extractor/createLogger.mjs.map +1 -0
  25. package/dist/extractor/errors.mjs +27 -0
  26. package/dist/extractor/errors.mjs.map +1 -0
  27. package/dist/extractor/esbuildAliasPlugin.mjs +45 -0
  28. package/dist/extractor/esbuildAliasPlugin.mjs.map +1 -0
  29. package/dist/extractor/esbuildTsconfigPaths.mjs +85 -0
  30. package/dist/extractor/esbuildTsconfigPaths.mjs.map +1 -0
  31. package/dist/extractor/evaluateAstNode.mjs +84 -0
  32. package/dist/extractor/evaluateAstNode.mjs.map +1 -0
  33. package/dist/extractor/extractHelpers.mjs +121 -0
  34. package/dist/extractor/extractHelpers.mjs.map +1 -0
  35. package/dist/extractor/extractMediaStyle.mjs +129 -0
  36. package/dist/extractor/extractMediaStyle.mjs.map +1 -0
  37. package/dist/extractor/extractToClassNames.mjs +304 -0
  38. package/dist/extractor/extractToClassNames.mjs.map +1 -0
  39. package/dist/extractor/extractToNative.mjs +262 -0
  40. package/dist/extractor/extractToNative.mjs.map +1 -0
  41. package/dist/extractor/findTopmostFunction.mjs +35 -0
  42. package/dist/extractor/findTopmostFunction.mjs.map +1 -0
  43. package/dist/extractor/{generatedUid.native.js → generatedUid.mjs} +26 -23
  44. package/dist/extractor/generatedUid.mjs.map +1 -0
  45. package/dist/extractor/getPrefixLogs.mjs +30 -0
  46. package/dist/extractor/getPrefixLogs.mjs.map +1 -0
  47. package/dist/extractor/getPropValueFromAttributes.mjs +68 -0
  48. package/dist/extractor/getPropValueFromAttributes.mjs.map +1 -0
  49. package/dist/extractor/getSourceModule.mjs +65 -0
  50. package/dist/extractor/getSourceModule.mjs.map +1 -0
  51. package/dist/extractor/getStaticBindingsForScope.mjs +149 -0
  52. package/dist/extractor/getStaticBindingsForScope.mjs.map +1 -0
  53. package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs +36 -0
  54. package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs.map +1 -0
  55. package/dist/extractor/literalToAst.mjs +85 -0
  56. package/dist/extractor/literalToAst.mjs.map +1 -0
  57. package/dist/extractor/loadFile.mjs +12 -0
  58. package/dist/extractor/loadFile.mjs.map +1 -0
  59. package/dist/extractor/loadTamagui.mjs +296 -0
  60. package/dist/extractor/loadTamagui.mjs.map +1 -0
  61. package/dist/extractor/logLines.mjs +36 -0
  62. package/dist/extractor/logLines.mjs.map +1 -0
  63. package/dist/extractor/{normalizeTernaries.native.js → normalizeTernaries.mjs} +45 -31
  64. package/dist/extractor/normalizeTernaries.mjs.map +1 -0
  65. package/dist/extractor/propsToFontFamilyCache.mjs +39 -0
  66. package/dist/extractor/propsToFontFamilyCache.mjs.map +1 -0
  67. package/dist/extractor/regenerateConfig.mjs +145 -0
  68. package/dist/extractor/regenerateConfig.mjs.map +1 -0
  69. package/dist/extractor/removeUnusedHooks.mjs +77 -0
  70. package/dist/extractor/removeUnusedHooks.mjs.map +1 -0
  71. package/dist/extractor/timer.mjs +44 -0
  72. package/dist/extractor/timer.mjs.map +1 -0
  73. package/dist/extractor/{validHTMLAttributes.native.js → validHTMLAttributes.mjs} +17 -16
  74. package/dist/extractor/validHTMLAttributes.mjs.map +1 -0
  75. package/dist/extractor/watchTamaguiConfig.mjs +59 -0
  76. package/dist/extractor/watchTamaguiConfig.mjs.map +1 -0
  77. package/dist/getPragmaOptions.mjs +55 -0
  78. package/dist/getPragmaOptions.mjs.map +1 -0
  79. package/dist/helpers/memoize.mjs +38 -0
  80. package/dist/helpers/memoize.mjs.map +1 -0
  81. package/dist/helpers/requireTamaguiCore.mjs +34 -0
  82. package/dist/helpers/requireTamaguiCore.mjs.map +1 -0
  83. package/dist/index.mjs +41 -0
  84. package/dist/index.mjs.map +1 -0
  85. package/dist/registerRequire.mjs +107 -0
  86. package/dist/registerRequire.mjs.map +1 -0
  87. package/dist/server.mjs +76 -0
  88. package/dist/server.mjs.map +1 -0
  89. package/dist/setup.mjs +2 -0
  90. package/dist/setup.mjs.map +1 -0
  91. package/dist/{types.native.js → types.mjs} +8 -6
  92. package/dist/types.mjs.map +1 -0
  93. package/package.json +19 -21
  94. package/dist/check-dep-versions.native.js +0 -602
  95. package/dist/check-dep-versions.native.js.map +0 -6
  96. package/dist/checkDeps.native.js +0 -34
  97. package/dist/checkDeps.native.js.map +0 -6
  98. package/dist/constants.native.js +0 -45
  99. package/dist/constants.native.js.map +0 -6
  100. package/dist/exports.native.js +0 -52
  101. package/dist/exports.native.js.map +0 -6
  102. package/dist/extractor/accessSafe.native.js +0 -48
  103. package/dist/extractor/accessSafe.native.js.map +0 -6
  104. package/dist/extractor/babelParse.native.js +0 -62
  105. package/dist/extractor/babelParse.native.js.map +0 -6
  106. package/dist/extractor/bundle.native.js +0 -168
  107. package/dist/extractor/bundle.native.js.map +0 -6
  108. package/dist/extractor/bundleConfig.native.js +0 -394
  109. package/dist/extractor/bundleConfig.native.js.map +0 -6
  110. package/dist/extractor/concatClassName.native.js +0 -69
  111. package/dist/extractor/concatClassName.native.js.map +0 -6
  112. package/dist/extractor/createEvaluator.native.js +0 -63
  113. package/dist/extractor/createEvaluator.native.js.map +0 -6
  114. package/dist/extractor/createExtractor.native.js +0 -1229
  115. package/dist/extractor/createExtractor.native.js.map +0 -6
  116. package/dist/extractor/createLogger.native.js +0 -35
  117. package/dist/extractor/createLogger.native.js.map +0 -6
  118. package/dist/extractor/errors.native.js +0 -119
  119. package/dist/extractor/errors.native.js.map +0 -6
  120. package/dist/extractor/esbuildAliasPlugin.native.js +0 -52
  121. package/dist/extractor/esbuildAliasPlugin.native.js.map +0 -6
  122. package/dist/extractor/esbuildTsconfigPaths.native.js +0 -79
  123. package/dist/extractor/esbuildTsconfigPaths.native.js.map +0 -6
  124. package/dist/extractor/evaluateAstNode.native.js +0 -98
  125. package/dist/extractor/evaluateAstNode.native.js.map +0 -6
  126. package/dist/extractor/extractHelpers.native.js +0 -183
  127. package/dist/extractor/extractHelpers.native.js.map +0 -6
  128. package/dist/extractor/extractMediaStyle.native.js +0 -138
  129. package/dist/extractor/extractMediaStyle.native.js.map +0 -6
  130. package/dist/extractor/extractToClassNames.native.js +0 -332
  131. package/dist/extractor/extractToClassNames.native.js.map +0 -6
  132. package/dist/extractor/extractToNative.native.js +0 -276
  133. package/dist/extractor/extractToNative.native.js.map +0 -6
  134. package/dist/extractor/findTopmostFunction.native.js +0 -37
  135. package/dist/extractor/findTopmostFunction.native.js.map +0 -6
  136. package/dist/extractor/generatedUid.native.js.map +0 -6
  137. package/dist/extractor/getPrefixLogs.native.js +0 -30
  138. package/dist/extractor/getPrefixLogs.native.js.map +0 -6
  139. package/dist/extractor/getPropValueFromAttributes.native.js +0 -68
  140. package/dist/extractor/getPropValueFromAttributes.native.js.map +0 -6
  141. package/dist/extractor/getSourceModule.native.js +0 -80
  142. package/dist/extractor/getSourceModule.native.js.map +0 -6
  143. package/dist/extractor/getStaticBindingsForScope.native.js +0 -183
  144. package/dist/extractor/getStaticBindingsForScope.native.js.map +0 -6
  145. package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js +0 -37
  146. package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +0 -6
  147. package/dist/extractor/literalToAst.native.js +0 -106
  148. package/dist/extractor/literalToAst.native.js.map +0 -6
  149. package/dist/extractor/loadFile.native.js +0 -21
  150. package/dist/extractor/loadFile.native.js.map +0 -6
  151. package/dist/extractor/loadTamagui.native.js +0 -314
  152. package/dist/extractor/loadTamagui.native.js.map +0 -6
  153. package/dist/extractor/logLines.native.js +0 -53
  154. package/dist/extractor/logLines.native.js.map +0 -6
  155. package/dist/extractor/normalizeTernaries.native.js.map +0 -6
  156. package/dist/extractor/propsToFontFamilyCache.native.js +0 -40
  157. package/dist/extractor/propsToFontFamilyCache.native.js.map +0 -6
  158. package/dist/extractor/regenerateConfig.native.js +0 -148
  159. package/dist/extractor/regenerateConfig.native.js.map +0 -6
  160. package/dist/extractor/removeUnusedHooks.native.js +0 -111
  161. package/dist/extractor/removeUnusedHooks.native.js.map +0 -6
  162. package/dist/extractor/timer.native.js +0 -44
  163. package/dist/extractor/timer.native.js.map +0 -6
  164. package/dist/extractor/validHTMLAttributes.native.js.map +0 -6
  165. package/dist/extractor/watchTamaguiConfig.native.js +0 -60
  166. package/dist/extractor/watchTamaguiConfig.native.js.map +0 -6
  167. package/dist/getPragmaOptions.native.js +0 -62
  168. package/dist/getPragmaOptions.native.js.map +0 -6
  169. package/dist/helpers/memoize.native.js +0 -40
  170. package/dist/helpers/memoize.native.js.map +0 -6
  171. package/dist/helpers/requireTamaguiCore.native.js +0 -34
  172. package/dist/helpers/requireTamaguiCore.native.js.map +0 -6
  173. package/dist/index.native.js +0 -35
  174. package/dist/index.native.js.map +0 -6
  175. package/dist/registerRequire.native.js +0 -124
  176. package/dist/registerRequire.native.js.map +0 -6
  177. package/dist/server.native.js +0 -70
  178. package/dist/server.native.js.map +0 -6
  179. package/dist/setup.native.js +0 -2
  180. package/dist/setup.native.js.map +0 -6
  181. package/dist/types.native.js.map +0 -6
@@ -1,394 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var bundleConfig_exports = {};
25
- __export(bundleConfig_exports, {
26
- bundleConfig: () => bundleConfig,
27
- esbuildOptions: () => esbuildOptions,
28
- getBundledConfig: () => getBundledConfig,
29
- getLoadedConfig: () => getLoadedConfig,
30
- hasBundledConfigChanged: () => hasBundledConfigChanged,
31
- loadComponents: () => loadComponents,
32
- loadComponentsInner: () => loadComponentsInner,
33
- writeTamaguiCSS: () => writeTamaguiCSS
34
- });
35
- module.exports = __toCommonJS(bundleConfig_exports);
36
- var import_generator = __toESM(require("@babel/generator")), import_traverse = __toESM(require("@babel/traverse")), t = __toESM(require("@babel/types")), import_node_fs = require("node:fs"), import_node_path = require("node:path"), import_cli_color = require("@tamagui/cli-color"), import_esbuild = __toESM(require("esbuild")), FS = __toESM(require("fs-extra")), import_promises = require("node:fs/promises"), import_registerRequire = require("../registerRequire"), import_babelParse = require("./babelParse"), import_bundle = require("./bundle"), import_getTamaguiConfigPathFromOptionsConfig = require("./getTamaguiConfigPathFromOptionsConfig"), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), _global, external = [
37
- "@tamagui/core",
38
- "@tamagui/web",
39
- "react",
40
- "react-dom",
41
- "react-native-svg"
42
- ], esbuildExtraOptions = {
43
- define: {
44
- __DEV__: `${process.env.NODE_ENV === "development"}`
45
- }
46
- }, esbuildOptions = {
47
- target: "es2018",
48
- format: "cjs",
49
- jsx: "automatic",
50
- platform: "node",
51
- ...esbuildExtraOptions
52
- }, currentBundle = null, isBundling = !1, lastBundle = null, waitForBundle = /* @__PURE__ */ new Set();
53
- function hasBundledConfigChanged() {
54
- return lastBundle === currentBundle ? !1 : (lastBundle = currentBundle, !0);
55
- }
56
- var loadedConfig = null, getLoadedConfig = function() {
57
- return loadedConfig;
58
- };
59
- async function getBundledConfig(props) {
60
- var rebuild = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
61
- if (isBundling)
62
- await new Promise(function(res) {
63
- waitForBundle.add(res);
64
- });
65
- else if (!currentBundle || rebuild)
66
- return await bundleConfig(props);
67
- return currentBundle;
68
- }
69
- (_global = global).tamaguiLastLoaded || (_global.tamaguiLastLoaded = 0);
70
- function updateLastLoaded(config) {
71
- global.tamaguiLastLoaded = Date.now(), global.tamaguiLastBundledConfig = config;
72
- }
73
- var hasBundledOnce = !1;
74
- async function bundleConfig(props) {
75
- if (global.tamaguiLastBundledConfig && Date.now() - global.tamaguiLastLoaded < 3e3)
76
- return global.tamaguiLastBundledConfig;
77
- try {
78
- var _process_env_DEBUG, _process_env_DEBUG1;
79
- isBundling = !0;
80
- var configEntry = props.config ? (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(props.config) : "", tmpDir = (0, import_node_path.join)(process.cwd(), ".tamagui"), configOutPath = (0, import_node_path.join)(tmpDir, "tamagui.config.cjs"), baseComponents = (props.components || []).filter(function(x) {
81
- return x !== "@tamagui/core";
82
- }), componentOutPaths = baseComponents.map(function(componentModule) {
83
- return (0, import_node_path.join)(tmpDir, `${componentModule.split(import_node_path.sep).join("-").replace(/[^a-z0-9]+/gi, "")}-components.config.cjs`);
84
- });
85
- if (process.env.NODE_ENV === "development" && (!((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui")) && console.info("Building config entry", configEntry), !props.disableInitialBuild) {
86
- var _process_env_DEBUG2;
87
- try {
88
- await FS.ensureDir(tmpDir);
89
- } catch {
90
- }
91
- var start = Date.now();
92
- await Promise.all([
93
- props.config ? (0, import_bundle.esbundleTamaguiConfig)({
94
- entryPoints: [
95
- configEntry
96
- ],
97
- external,
98
- outfile: configOutPath,
99
- target: "node20",
100
- ...esbuildExtraOptions
101
- }, props.platform || "web") : null,
102
- ...baseComponents.map(function(componentModule, i) {
103
- return (0, import_bundle.esbundleTamaguiConfig)({
104
- entryPoints: [
105
- componentModule
106
- ],
107
- resolvePlatformSpecificEntries: !0,
108
- external,
109
- outfile: componentOutPaths[i],
110
- target: "node20",
111
- ...esbuildExtraOptions
112
- }, props.platform || "web");
113
- })
114
- ]), (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, `
115
- \u27A1 [tamagui] built config and components (${Date.now() - start}ms)`), !((_process_env_DEBUG2 = process.env.DEBUG) === null || _process_env_DEBUG2 === void 0) && _process_env_DEBUG2.startsWith("tamagui") && (0, import_cli_color.colorLog)(import_cli_color.Color.Dim, `
116
- Config .${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), configOutPath)}
117
- Components ${[
118
- ...componentOutPaths.map(function(p) {
119
- return `.${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), p)}`;
120
- })
121
- ].join(`
122
- `)}
123
- `);
124
- }
125
- var out, { unregister } = (0, import_registerRequire.registerRequire)(props.platform || "web");
126
- try {
127
- if (hasBundledOnce)
128
- for (var key in require.cache)
129
- /(core|web)[\/\\]dist/.test(key) || delete require.cache[key];
130
- else
131
- hasBundledOnce = !0;
132
- out = require(configOutPath);
133
- } catch (err) {
134
- throw err;
135
- } finally {
136
- unregister();
137
- }
138
- var config = out.default || out || out.config;
139
- if (config && config.config && !config.tokens && (config = config.config), !config)
140
- throw new Error(`No config: ${config}`);
141
- if (loadedConfig = config, !config.parsed) {
142
- var { createTamagui } = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform || "web");
143
- config = createTamagui(config);
144
- }
145
- props.outputCSS && await writeTamaguiCSS(props.outputCSS, config);
146
- var components = loadComponents({
147
- ...props,
148
- components: componentOutPaths
149
- });
150
- if (!components)
151
- throw new Error(`No components found: ${componentOutPaths.join(", ")}`);
152
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
153
- try {
154
- for (var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
155
- var component = _step.value;
156
- if (component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, !component.moduleName) {
157
- var _process_env_DEBUG3;
158
- (!((_process_env_DEBUG3 = process.env.DEBUG) === null || _process_env_DEBUG3 === void 0) && _process_env_DEBUG3.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn(`\u26A0\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(baseComponents)} in ${JSON.stringify(componentOutPaths)}`);
159
- }
160
- }
161
- } catch (err) {
162
- _didIteratorError = !0, _iteratorError = err;
163
- } finally {
164
- try {
165
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
166
- } finally {
167
- if (_didIteratorError)
168
- throw _iteratorError;
169
- }
170
- }
171
- process.env.NODE_ENV === "development" && (!((_process_env_DEBUG1 = process.env.DEBUG) === null || _process_env_DEBUG1 === void 0) && _process_env_DEBUG1.startsWith("tamagui")) && console.info("Loaded components", components);
172
- var res = {
173
- components,
174
- nameToPaths: {},
175
- tamaguiConfig: config
176
- };
177
- return currentBundle = res, updateLastLoaded(res), res;
178
- } catch (err) {
179
- var _process_env_DEBUG4;
180
- console.error(`Error bundling tamagui config: ${err == null ? void 0 : err.message} (run with DEBUG=tamagui to see stack)`), !((_process_env_DEBUG4 = process.env.DEBUG) === null || _process_env_DEBUG4 === void 0) && _process_env_DEBUG4.includes("tamagui") && console.error(err.stack);
181
- } finally {
182
- isBundling = !1, waitForBundle.forEach(function(cb) {
183
- return cb();
184
- }), waitForBundle.clear();
185
- }
186
- }
187
- async function writeTamaguiCSS(outputCSS, config) {
188
- var flush = async function() {
189
- (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [tamagui] output css: ${outputCSS}`), await FS.writeFile(outputCSS, css);
190
- }, css = config.getCSS();
191
- if (typeof css != "string")
192
- throw new Error(`Invalid CSS: ${typeof css} ${css}`);
193
- try {
194
- (0, import_node_fs.existsSync)(outputCSS) && await (0, import_promises.readFile)(outputCSS, "utf8") === css || await flush();
195
- } catch (err) {
196
- console.info("Error writing themes", err);
197
- }
198
- }
199
- function loadComponents(props) {
200
- var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, coreComponents = getCoreComponents(props), otherComponents = loadComponentsInner(props, forceExports);
201
- return [
202
- ...coreComponents,
203
- ...otherComponents || []
204
- ];
205
- }
206
- function getCoreComponents(props) {
207
- var loaded = loadComponentsInner({
208
- ...props,
209
- components: [
210
- "@tamagui/core"
211
- ]
212
- });
213
- if (!loaded)
214
- throw new Error("Core should always load");
215
- return [
216
- {
217
- ...loaded[0],
218
- moduleName: "@tamagui/core"
219
- }
220
- ];
221
- }
222
- function loadComponentsInner(props) {
223
- var forceExports = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, componentsModules = props.components || [], key = componentsModules.join("");
224
- if (!forceExports && cacheComponents[key])
225
- return cacheComponents[key];
226
- var { unregister } = (0, import_registerRequire.registerRequire)(props.platform || "web", {
227
- proxyWormImports: forceExports
228
- });
229
- try {
230
- var info = componentsModules.flatMap(function(name) {
231
- var extension = (0, import_node_path.extname)(name), isLocal = !!extension, isDynamic = isLocal && forceExports, fileContents = isDynamic ? (0, import_node_fs.readFileSync)(name, "utf-8") : "", loadModule = isDynamic ? (0, import_node_path.join)((0, import_node_path.dirname)(name), `.tamagui-dynamic-eval-${(0, import_node_path.basename)(name)}.tsx`) : name, writtenContents = fileContents, didBabel = !1;
232
- function attemptLoad() {
233
- var { forceExports: forceExports2 = !1 } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
234
- isDynamic && (writtenContents = forceExports2 ? transformAddExports((0, import_babelParse.babelParse)(esbuildit(fileContents, "modern"), name)) : fileContents, FS.writeFileSync(loadModule, writtenContents), import_esbuild.default.buildSync({
235
- ...esbuildOptions,
236
- entryPoints: [
237
- loadModule
238
- ],
239
- outfile: loadModule,
240
- alias: {
241
- "react-native": require.resolve("@tamagui/react-native-web-lite")
242
- },
243
- bundle: !0,
244
- packages: "external",
245
- allowOverwrite: !0,
246
- // logLevel: 'silent',
247
- sourcemap: !1,
248
- loader: import_bundle.esbuildLoaderConfig
249
- })), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
250
- var moduleResult = require(loadModule);
251
- forceExports2 || (0, import_registerRequire.setRequireResult)(name, moduleResult);
252
- var nameToInfo = getComponentStaticConfigByName(name, interopDefaultExport(moduleResult));
253
- return {
254
- moduleName: name,
255
- nameToInfo
256
- };
257
- }
258
- var dispose = function() {
259
- isDynamic && FS.removeSync(loadModule);
260
- };
261
- try {
262
- var res = attemptLoad({
263
- forceExports: !0
264
- });
265
- return didBabel = !0, res;
266
- } catch (err) {
267
- var _process_env_DEBUG;
268
- console.info("babel err", err, writtenContents), writtenContents = fileContents, !((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.info("Error parsing babel likely", err);
269
- } finally {
270
- dispose();
271
- }
272
- try {
273
- return attemptLoad({
274
- forceExports: !1
275
- });
276
- } catch (err) {
277
- return process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.info(`
278
-
279
- Tamagui attempted but failed to dynamically optimize components in:
280
- ${name}
281
- `), console.info(err), console.info(`At: ${loadModule}`, `
282
- didBabel: ${didBabel}`, `
283
- In:`, writtenContents, `
284
- isDynamic: `, isDynamic)), [];
285
- } finally {
286
- dispose();
287
- }
288
- });
289
- return cacheComponents[key] = info, info;
290
- } catch (err) {
291
- return console.info("Tamagui error bundling components", err.message, err.stack), null;
292
- } finally {
293
- unregister();
294
- }
295
- }
296
- var esbuildit = function(src, target) {
297
- return import_esbuild.default.transformSync(src, {
298
- ...esbuildOptions,
299
- ...target === "modern" && {
300
- target: "es2022",
301
- jsx: "automatic",
302
- loader: "tsx",
303
- platform: "neutral",
304
- format: "esm"
305
- }
306
- }).code;
307
- };
308
- function getComponentStaticConfigByName(name, exported) {
309
- var components = {};
310
- try {
311
- if (!exported || typeof exported != "object" || Array.isArray(exported))
312
- throw new Error(`Invalid export from package ${name}: ${typeof exported}`);
313
- for (var key in exported) {
314
- var found = getTamaguiComponent(key, exported[key]);
315
- if (found) {
316
- var { Component, ...sc } = found.staticConfig;
317
- components[key] = {
318
- staticConfig: sc
319
- };
320
- }
321
- }
322
- } catch (err) {
323
- process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error(`Tamagui failed getting components from ${name} (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)`), console.error(err));
324
- }
325
- return components;
326
- }
327
- function getTamaguiComponent(name, Component) {
328
- if (name[0].toUpperCase() === name[0]) {
329
- var staticConfig = Component == null ? void 0 : Component.staticConfig;
330
- if (staticConfig)
331
- return Component;
332
- }
333
- }
334
- function interopDefaultExport(mod) {
335
- var _mod_default;
336
- return (_mod_default = mod == null ? void 0 : mod.default) !== null && _mod_default !== void 0 ? _mod_default : mod;
337
- }
338
- var cacheComponents = {};
339
- function transformAddExports(ast) {
340
- var usedNames = /* @__PURE__ */ new Set();
341
- return (0, import_traverse.default)(ast, {
342
- ExportNamedDeclaration(nodePath) {
343
- if (nodePath.node.specifiers) {
344
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
345
- try {
346
- for (var _iterator = nodePath.node.specifiers[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
347
- var spec = _step.value;
348
- usedNames.add(t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value);
349
- }
350
- } catch (err) {
351
- _didIteratorError = !0, _iteratorError = err;
352
- } finally {
353
- try {
354
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
355
- } finally {
356
- if (_didIteratorError)
357
- throw _iteratorError;
358
- }
359
- }
360
- }
361
- }
362
- }), (0, import_traverse.default)(ast, {
363
- VariableDeclaration(nodePath) {
364
- if (t.isProgram(nodePath.parent)) {
365
- var decs = nodePath.node.declarations;
366
- if (!(decs.length > 1)) {
367
- var [dec] = decs;
368
- t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(t.exportNamedDeclaration(t.variableDeclaration("let", [
369
- dec
370
- ]), [
371
- t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))
372
- ]))));
373
- }
374
- }
375
- }
376
- }), (0, import_generator.default)(ast, {
377
- concise: !1,
378
- filename: "test.tsx",
379
- retainLines: !1,
380
- sourceMaps: !1
381
- }).code;
382
- }
383
- // Annotate the CommonJS export names for ESM import in node:
384
- 0 && (module.exports = {
385
- bundleConfig,
386
- esbuildOptions,
387
- getBundledConfig,
388
- getLoadedConfig,
389
- hasBundledConfigChanged,
390
- loadComponents,
391
- loadComponentsInner,
392
- writeTamaguiCSS
393
- });
394
- //# sourceMappingURL=bundleConfig.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extractor/bundleConfig.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,uBAAqB,sCACrB,kBAAqB,qCACrB,IAAmB,kCACnB,iBAAyC,oBACzC,mBAAgE,sBAEhE,mBAAgC,+BAChC,iBAAoB,6BACpB,KAAoB,8BACpB,kBAAyB,6BACzB,yBAAkD,+BAClD,oBAA2B,yBAC3B,gBAA2D,qBAC3D,+CAAsD,oDACtD,4BAAmC,0CAf/B,SAgBA,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GACI,sBAAsB;AAAA,EACtB,QAAQ;AAAA,IACJ,SAAS,GAAG,QAAQ,IAAI,aAAa,aAAa;AAAA,EACtD;AACJ,GACW,iBAAiB;AAAA,EACxB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,UAAU;AAAA,EACV,GAAG;AACP,GAEI,gBAAgB,MAChB,aAAa,IACb,aAAa,MACb,gBAAgB,oBAAI,IAAI;AACrB,SAAS,0BAA0B;AACtC,SAAI,eAAe,gBACR,MAEX,aAAa,eACN;AACX;AACA,IAAI,eAAe,MACR,kBAAkB,WAAW;AACpC,SAAO;AACX;AACA,eAAsB,iBAAiB,OAAO;AAC1C,MAAI,UAAU,UAAU,SAAS,KAAK,UAAU,CAAC,MAAM,SAAS,UAAU,CAAC,IAAI;AAC/E,MAAI;AACA,UAAM,IAAI,QAAQ,SAAS,KAAK;AAC5B,o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CAAC;AAAA,UAC1E,CAAC,CAAC;AAAA;AAAA;AAAA,IACN;AAAA,EACJ,CAAC,OAEM,iBAAAC,SAAS,KAAK;AAAA,IACjB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,YAAY;AAAA,EAChB,CAAC,EAAE;AACP;",
5
- "names": ["forceExports", "esbuild", "traverse", "generate"]
6
- }
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: !0 });
9
- }, __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from == "object" || typeof from == "function")
11
- for (let key of __getOwnPropNames(from))
12
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
- return to;
14
- };
15
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
16
- var concatClassName_exports = {};
17
- __export(concatClassName_exports, {
18
- concatClassName: () => concatClassName
19
- });
20
- module.exports = __toCommonJS(concatClassName_exports);
21
- function concatClassName(_cn) {
22
- for (var args = arguments, usedPrefixes = /* @__PURE__ */ new Set(), final = "", len = args.length, propObjects = null, x = len; x >= 0; x--) {
23
- var _loop = function(i2) {
24
- var name = names[i2];
25
- if (!name || name === " ") return "continue";
26
- if (name[0] !== "_")
27
- return final = name + " " + final, "continue";
28
- var splitIndex = name.indexOf("-");
29
- if (splitIndex < 1)
30
- return final = name + " " + final, "continue";
31
- var nextChar = name[splitIndex + 1], isMediaQuery = nextChar === "_", styleKey = name.slice(1, name.indexOf("-")), mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null, uid = mediaKey ? styleKey + mediaKey : styleKey;
32
- if (usedPrefixes.has(uid))
33
- return "continue";
34
- usedPrefixes.add(uid);
35
- var propName = styleKey;
36
- if (propName && propObjects && propObjects.some(function(po) {
37
- if (mediaKey) {
38
- var propKey = pseudoInvert[mediaKey];
39
- return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
40
- }
41
- var res = po && propName in po && po[propName] !== null;
42
- return res;
43
- }))
44
- return "continue";
45
- final = name + " " + final;
46
- }, cns = args[x];
47
- if (cns) {
48
- if (!Array.isArray(cns) && typeof cns != "string") {
49
- propObjects = propObjects || [], propObjects.push(cns);
50
- continue;
51
- }
52
- for (var names = Array.isArray(cns) ? cns : cns.split(" "), numNames = names.length, i = numNames - 1; i >= 0; i--) _loop(i);
53
- }
54
- }
55
- return final.trim();
56
- }
57
- var pseudoInvert = {
58
- hover: "hoverStyle",
59
- focus: "focusStyle",
60
- press: "pressStyle",
61
- focusVisible: "focusVisibleStyle",
62
- focusWithin: "focusWithinStyle",
63
- disabled: "disabledStyle"
64
- };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
67
- concatClassName
68
- });
69
- //# sourceMappingURL=concatClassName.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extractor/concatClassName.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMW,SAAS,gBAAgB,KAAK;AAMrC,WALI,OAAO,WACP,eAAe,oBAAI,IAAI,GACvB,QAAQ,IACR,MAAM,KAAK,QACX,cAAc,MACV,IAAI,KAAK,KAAK,GAAG,KAAI;AACzB,QAAI,QAAQ,SAASA,IAAG;AACpB,UAAI,OAAO,MAAMA,EAAC;AAClB,UAAI,CAAC,QAAQ,SAAS,IAAK,QAAO;AAClC,UAAI,KAAK,CAAC,MAAM;AAEZ,uBAAQ,OAAO,MAAM,OACd;AAEX,UAAI,aAAa,KAAK,QAAQ,GAAG;AACjC,UAAI,aAAa;AACb,uBAAQ,OAAO,MAAM,OAEd;AAEX,UAAI,WAAW,KAAK,aAAa,CAAC,GAG9B,eAAe,aAAa,KAK5B,WAAW,KAAK,MAAM,GAAG,KAAK,QAAQ,GAAG,CAAC,GAE1C,WAAW,eAAe,KAAK,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,MACvE,MAAM,WAAW,WAAW,WAAW;AAE3C,UAAI,aAAa,IAAI,GAAG;AAEpB,eAAO;AAEX,mBAAa,IAAI,GAAG;AAEpB,UAAI,WAAW;AACf,UAAI,YAAY,eACR,YAAY,KAAK,SAAS,IAAI;AAC9B,YAAI,UAAU;AACV,cAAI,UAAU,aAAa,QAAQ;AACnC,iBAAO,MAAM,GAAG,OAAO,KAAK,YAAY,GAAG,OAAO,KAAK,GAAG,OAAO,MAAM;AAAA,QAC3E;AACA,YAAI,MAAM,MAAM,YAAY,MAAM,GAAG,QAAQ,MAAM;AACnD,eAAO;AAAA,MACX,CAAC;AAEG,eAAO;AAGf,cAAQ,OAAO,MAAM;AAAA,IACzB,GACI,MAAM,KAAK,CAAC;AAChB,QAAK,KACL;AAAA,UAAI,CAAC,MAAM,QAAQ,GAAG,KAAK,OAAO,OAAQ,UAAU;AAEhD,sBAAc,eAAe,CAAC,GAC9B,YAAY,KAAK,GAAG;AACpB;AAAA,MACJ;AAGA,eAFI,QAAQ,MAAM,QAAQ,GAAG,IAAI,MAAM,IAAI,MAAM,GAAG,GAChD,WAAW,MAAM,QACb,IAAI,WAAW,GAAG,KAAK,GAAG,IAAI,OAAM,CAAC;AAAA;AAAA,EACjD;AACA,SAAO,MAAM,KAAK;AACtB;AACA,IAAI,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,cAAc;AAAA,EACd,aAAa;AAAA,EACb,UAAU;AACd;",
5
- "names": ["i"]
6
- }
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: !0 });
10
- }, __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from == "object" || typeof from == "function")
12
- for (let key of __getOwnPropNames(from))
13
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- return to;
15
- };
16
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
- // If the importer is in node compatibility mode or this is not an ESM
18
- // file that has been converted to a CommonJS file using a Babel-
19
- // compatible transform (i.e. "__esModule" has not been set), then set
20
- // "default" to the CommonJS "module.exports" for node compatibility.
21
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
22
- mod
23
- )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
24
- var createEvaluator_exports = {};
25
- __export(createEvaluator_exports, {
26
- createEvaluator: () => createEvaluator,
27
- createSafeEvaluator: () => createSafeEvaluator
28
- });
29
- module.exports = __toCommonJS(createEvaluator_exports);
30
- var import_node_vm = __toESM(require("node:vm")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_esbuild = __toESM(require("esbuild")), import_constants = require("../constants"), import_evaluateAstNode = require("./evaluateAstNode");
31
- function createEvaluator(param) {
32
- var { props, staticNamespace, sourcePath, traversePath, shouldPrintDebug } = param, evalFn = function(n) {
33
- if (t.isIdentifier(n) && typeof staticNamespace[n.name] < "u")
34
- return staticNamespace[n.name];
35
- var evalContext = import_node_vm.default.createContext(staticNamespace), codeWithTypescriptAnnotations = `(${(0, import_generator.default)(n).code})`, code = import_esbuild.default.transformSync(codeWithTypescriptAnnotations, {
36
- loader: "tsx"
37
- }).code.replace(/;\n$/, "");
38
- shouldPrintDebug && console.info("evaluating", code);
39
- var result1 = import_node_vm.default.runInContext(code, evalContext), result2 = import_node_vm.default.runInContext(code, evalContext), isDeterministic = Object.is(result1, result2) || typeof result1 == "object" && typeof result2 == "object" && JSON.stringify(result1) === JSON.stringify(result2);
40
- if (!isDeterministic)
41
- throw shouldPrintDebug && console.info("Bailing on non-deterministic expression:", code, `
42
- First result:`, result1, "Second result:", result2), new Error("Non-deterministic value, bailing");
43
- return result1;
44
- };
45
- return function(n) {
46
- return (0, import_evaluateAstNode.evaluateAstNode)(n, evalFn);
47
- };
48
- }
49
- function createSafeEvaluator(attemptEval) {
50
- return function(n) {
51
- try {
52
- return attemptEval(n);
53
- } catch {
54
- return import_constants.FAILED_EVAL;
55
- }
56
- };
57
- }
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {
60
- createEvaluator,
61
- createSafeEvaluator
62
- });
63
- //# sourceMappingURL=createEvaluator.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/extractor/createEvaluator.ts"],
4
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAe,6BACf,mBAAqB,sCACrB,IAAmB,kCACnB,iBAAoB,6BACpB,mBAA4B,yBAC5B,yBAAgC;AACzB,SAAS,gBAAgB,OAAO;AACnC,MAAI,EAAE,OAAO,iBAAiB,YAAY,cAAc,iBAAiB,IAAI,OAEzE,SAAS,SAAS,GAAG;AAErB,QAAI,EAAE,aAAa,CAAC,KAAK,OAAO,gBAAgB,EAAE,IAAI,IAAM;AACxD,aAAO,gBAAgB,EAAE,IAAI;AAEjC,QAAI,cAAc,eAAAA,QAAG,cAAc,eAAe,GAE9C,gCAAgC,QAAI,iBAAAC,SAAS,CAAC,EAAE,IAAI,KACpD,OAAO,eAAAC,QAAQ,cAAc,+BAA+B;AAAA,MAC5D,QAAQ;AAAA,IACZ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