@tamagui/static 1.0.0-beta.200 → 1.0.0-beta.204

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 (65) hide show
  1. package/dist/cjs/constants.js +8 -0
  2. package/dist/cjs/extractor/accessSafe.js +4 -0
  3. package/dist/cjs/extractor/babelParse.js +5 -0
  4. package/dist/cjs/extractor/babelParse.js.map +2 -2
  5. package/dist/cjs/extractor/buildClassName.js +4 -0
  6. package/dist/cjs/extractor/createEvaluator.js +5 -0
  7. package/dist/cjs/extractor/createExtractor.js +840 -772
  8. package/dist/cjs/extractor/createExtractor.js.map +2 -2
  9. package/dist/cjs/extractor/ensureImportingConcat.js +4 -0
  10. package/dist/cjs/extractor/evaluateAstNode.js +4 -0
  11. package/dist/cjs/extractor/extractHelpers.js +11 -0
  12. package/dist/cjs/extractor/extractMediaStyle.js +7 -2
  13. package/dist/cjs/extractor/extractMediaStyle.js.map +2 -2
  14. package/dist/cjs/extractor/extractToClassNames.js +19 -10
  15. package/dist/cjs/extractor/extractToClassNames.js.map +2 -2
  16. package/dist/cjs/extractor/findTopmostFunction.js +4 -0
  17. package/dist/cjs/extractor/generatedUid.js +4 -0
  18. package/dist/cjs/extractor/getPrefixLogs.js +4 -0
  19. package/dist/cjs/extractor/getPropValueFromAttributes.js +4 -0
  20. package/dist/cjs/extractor/getSourceModule.js +4 -0
  21. package/dist/cjs/extractor/getStaticBindingsForScope.js +4 -0
  22. package/dist/cjs/extractor/hoistClassNames.js +4 -0
  23. package/dist/cjs/extractor/literalToAst.js +5 -0
  24. package/dist/cjs/extractor/loadTamagui.js +67 -47
  25. package/dist/cjs/extractor/loadTamagui.js.map +2 -2
  26. package/dist/cjs/extractor/logLines.js +4 -0
  27. package/dist/cjs/extractor/normalizeTernaries.js +4 -0
  28. package/dist/cjs/extractor/removeUnusedHooks.js +4 -0
  29. package/dist/cjs/extractor/timer.js +46 -0
  30. package/dist/cjs/extractor/timer.js.map +7 -0
  31. package/dist/cjs/extractor/validHTMLAttributes.js +4 -0
  32. package/dist/cjs/index.js +6 -0
  33. package/dist/cjs/patchReactNativeWeb.js +23 -7
  34. package/dist/cjs/patchReactNativeWeb.js.map +2 -2
  35. package/dist/esm/extractor/babelParse.js.map +2 -2
  36. package/dist/esm/extractor/createExtractor.js +850 -785
  37. package/dist/esm/extractor/createExtractor.js.map +2 -2
  38. package/dist/esm/extractor/extractMediaStyle.js +2 -2
  39. package/dist/esm/extractor/extractMediaStyle.js.map +2 -2
  40. package/dist/esm/extractor/extractToClassNames.js +15 -10
  41. package/dist/esm/extractor/extractToClassNames.js.map +2 -2
  42. package/dist/esm/extractor/loadTamagui.js +63 -47
  43. package/dist/esm/extractor/loadTamagui.js.map +2 -2
  44. package/dist/esm/extractor/timer.js +24 -0
  45. package/dist/esm/extractor/timer.js.map +7 -0
  46. package/dist/esm/patchReactNativeWeb.js +19 -7
  47. package/dist/esm/patchReactNativeWeb.js.map +2 -2
  48. package/dist/jsx/extractor/createExtractor.js +850 -785
  49. package/dist/jsx/extractor/extractMediaStyle.js +2 -2
  50. package/dist/jsx/extractor/extractToClassNames.js +15 -10
  51. package/dist/jsx/extractor/loadTamagui.js +63 -47
  52. package/dist/jsx/extractor/timer.js +23 -0
  53. package/dist/jsx/patchReactNativeWeb.js +19 -7
  54. package/package.json +23 -23
  55. package/types/extractor/babelParse.d.ts.map +1 -1
  56. package/types/extractor/createExtractor.d.ts +2 -0
  57. package/types/extractor/createExtractor.d.ts.map +1 -1
  58. package/types/extractor/extractMediaStyle.d.ts +1 -1
  59. package/types/extractor/extractMediaStyle.d.ts.map +1 -1
  60. package/types/extractor/extractToClassNames.d.ts +2 -1
  61. package/types/extractor/extractToClassNames.d.ts.map +1 -1
  62. package/types/extractor/loadTamagui.d.ts.map +1 -1
  63. package/types/extractor/timer.d.ts +5 -0
  64. package/types/extractor/timer.d.ts.map +1 -0
  65. package/types/patchReactNativeWeb.d.ts.map +1 -1
@@ -59,6 +59,7 @@ var import_getPrefixLogs = require("./getPrefixLogs");
59
59
  var import_hoistClassNames = require("./hoistClassNames");
60
60
  var import_literalToAst = require("./literalToAst");
61
61
  var import_logLines = require("./logLines");
62
+ var import_timer = require("./timer");
62
63
  const mergeStyleGroups = {
63
64
  shadowOpacity: true,
64
65
  shadowRadius: true,
@@ -72,9 +73,11 @@ function extractToClassNames({
72
73
  sourcePath,
73
74
  options,
74
75
  shouldPrintDebug,
76
+ cssLoaderPath,
75
77
  threaded,
76
78
  cssPath
77
79
  }) {
80
+ const tm = (0, import_timer.timer)();
78
81
  if (typeof source !== "string") {
79
82
  throw new Error("`source` must be a string of javascript");
80
83
  }
@@ -89,6 +92,7 @@ function extractToClassNames({
89
92
  console.error("babel parse error:", sourcePath);
90
93
  throw err;
91
94
  }
95
+ tm.mark(`babel-parse`, shouldPrintDebug === "verbose");
92
96
  const cssMap = /* @__PURE__ */ new Map();
93
97
  const existingHoists = {};
94
98
  let hasFlattened = false;
@@ -148,9 +152,6 @@ function extractToClassNames({
148
152
  switch (attr.type) {
149
153
  case "style":
150
154
  if (!isFlattened) {
151
- if (!attr.name) {
152
- throw new Error(`No name`);
153
- }
154
155
  const { hoverStyle, pressStyle, focusStyle } = attr.value;
155
156
  const pseudos = [
156
157
  ["hoverStyle", hoverStyle],
@@ -226,9 +227,6 @@ function extractToClassNames({
226
227
  break;
227
228
  }
228
229
  }
229
- if (shouldPrintDebug) {
230
- console.log(" finalClassNames\n", (0, import_logLines.logLines)(finalClassNames.map((x) => x["value"]).join(" ")));
231
- }
232
230
  function addTernaryStyle(ternary, a, b) {
233
231
  const cCN = a.map((x) => x.identifier).join(" ");
234
232
  const aCN = b.map((x) => x.identifier).join(" ");
@@ -239,9 +237,15 @@ function extractToClassNames({
239
237
  }
240
238
  }
241
239
  __name(addTernaryStyle, "addTernaryStyle");
240
+ if (shouldPrintDebug) {
241
+ console.log(" finalClassNames\n", (0, import_logLines.logLines)(finalClassNames.map((x) => x["value"]).join(" ")));
242
+ }
242
243
  node.attributes = finalAttrs;
243
244
  if (finalClassNames.length) {
244
- const names = (0, import_buildClassName.buildClassName)(finalClassNames);
245
+ let names = (0, import_buildClassName.buildClassName)(finalClassNames);
246
+ if (t.isStringLiteral(names)) {
247
+ names.value = (0, import_helpers.concatClassName)(names.value);
248
+ }
245
249
  const nameExpr = names ? (0, import_hoistClassNames.hoistClassNames)(jsxPath, existingHoists, names) : null;
246
250
  let expr = nameExpr;
247
251
  if (nameExpr && !t.isIdentifier(nameExpr)) {
@@ -288,7 +292,7 @@ function extractToClassNames({
288
292
  if (styles) {
289
293
  const cssQuery = threaded ? `cssData=${Buffer.from(styles).toString("base64")}` : `cssPath=${cssPath}`;
290
294
  const remReq = loader.remainingRequest;
291
- const importPath = `${cssPath}!=!tamagui-loader?${cssQuery}!${remReq}`;
295
+ const importPath = `${cssPath}!=!${cssLoaderPath}?${cssQuery}!${remReq}`;
292
296
  ast.program.body.unshift(t.importDeclaration([], t.stringLiteral(importPath)));
293
297
  }
294
298
  const result = (0, import_generator.default)(ast, {
@@ -304,13 +308,14 @@ function extractToClassNames({
304
308
  }
305
309
  if (shouldLogTiming) {
306
310
  const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0;
307
- const timing = `${Date.now() - start}`.padStart(3);
308
311
  const path2 = (0, import_path.basename)(sourcePath).replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padStart(24);
309
312
  const numOptimized = `${res.optimized}`.padStart(3);
310
313
  const numFound = `${res.found}`.padStart(3);
311
314
  const numFlattened = `${res.flattened}`.padStart(3);
312
315
  const memory = process.env.DEBUG && memUsed > 10 ? ` ${memUsed}MB` : "";
313
- const timingStr = `${timing}ms`.padStart(6);
316
+ const timing = Date.now() - start;
317
+ const timingWarning = timing > 50 ? "\u26A0\uFE0F" : timing > 150 ? "\u2622\uFE0F" : "";
318
+ const timingStr = `${timing}ms${timingWarning}`.padStart(6);
314
319
  console.log(`${(0, import_getPrefixLogs.getPrefixLogs)(options)} ${path2} ${numFound} \xB7 ${numOptimized} \xB7 ${numFlattened} ${timingStr} ${memory ? `(${memory})` : ""}`);
315
320
  }
316
321
  return {
@@ -321,4 +326,8 @@ function extractToClassNames({
321
326
  };
322
327
  }
323
328
  __name(extractToClassNames, "extractToClassNames");
329
+ // Annotate the CommonJS export names for ESM import in node:
330
+ 0 && (module.exports = {
331
+ extractToClassNames
332
+ });
324
333
  //# sourceMappingURL=extractToClassNames.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/extractor/extractToClassNames.ts"],
4
- "sourcesContent": ["import * as path from 'path'\nimport { basename } from 'path'\nimport * as util from 'util'\n\nimport generate from '@babel/generator'\nimport * as t from '@babel/types'\nimport { getStylesAtomic } from '@tamagui/core-node'\nimport { concatClassName } from '@tamagui/helpers'\nimport invariant from 'invariant'\nimport { ViewStyle } from 'react-native'\nimport { LoaderContext } from 'webpack'\n\nimport { CONCAT_CLASSNAME_IMPORT } from '../constants'\nimport { ClassNameObject, StyleObject, TamaguiOptions, Ternary } from '../types'\nimport { babelParse } from './babelParse'\nimport { buildClassName } from './buildClassName'\nimport { Extractor } from './createExtractor'\nimport { ensureImportingConcat } from './ensureImportingConcat'\nimport { isSimpleSpread } from './extractHelpers'\nimport { extractMediaStyle } from './extractMediaStyle'\nimport { getPrefixLogs } from './getPrefixLogs'\nimport { hoistClassNames } from './hoistClassNames'\nimport { literalToAst } from './literalToAst'\nimport { logLines } from './logLines'\n\nconst mergeStyleGroups = {\n shadowOpacity: true,\n shadowRadius: true,\n shadowColor: true,\n shadowOffset: true,\n}\n\nexport type ExtractedResponse = {\n js: string | Buffer\n styles: string\n stylesPath?: string\n ast: t.File\n map: any // RawSourceMap from 'source-map'\n}\n\nexport function extractToClassNames({\n loader,\n extractor,\n source,\n sourcePath,\n options,\n shouldPrintDebug,\n threaded,\n cssPath,\n}: {\n loader: LoaderContext<any>\n extractor: Extractor\n source: string | Buffer\n sourcePath: string\n options: TamaguiOptions\n shouldPrintDebug: boolean | 'verbose'\n cssPath: string\n threaded?: boolean\n}): ExtractedResponse | null {\n if (typeof source !== 'string') {\n throw new Error('`source` must be a string of javascript')\n }\n invariant(\n typeof sourcePath === 'string' && path.isAbsolute(sourcePath),\n '`sourcePath` must be an absolute path to a .js file'\n )\n\n const shouldLogTiming = options.logTimings ?? true\n const start = Date.now()\n const mem = shouldLogTiming ? process.memoryUsage() : null\n\n // Using a map for (officially supported) guaranteed insertion order\n let ast: t.File\n\n try {\n // @ts-ignore\n ast = babelParse(source)\n } catch (err) {\n console.error('babel parse error:', sourcePath)\n throw err\n }\n\n const cssMap = new Map<string, { css: string; commentTexts: string[] }>()\n const existingHoists: { [key: string]: t.Identifier } = {}\n\n let hasFlattened = false\n\n const res = extractor.parse(ast, {\n sourcePath,\n shouldPrintDebug,\n ...options,\n getFlattenedNode: ({ tag }) => {\n hasFlattened = true\n return tag\n },\n onExtractTag: ({\n attrs,\n node,\n attemptEval,\n jsxPath,\n originalNodeName,\n filePath,\n lineNumbers,\n programPath,\n isFlattened,\n }) => {\n let finalClassNames: ClassNameObject[] = []\n let finalAttrs: (t.JSXAttribute | t.JSXSpreadAttribute)[] = []\n let finalStyles: StyleObject[] = []\n\n const viewStyles = {}\n for (const attr of attrs) {\n if (attr.type === 'style') {\n Object.assign(viewStyles, attr.value)\n }\n }\n\n const ensureNeededPrevStyle = (style: ViewStyle) => {\n // ensure all group keys are merged\n const keys = Object.keys(style)\n if (!keys.some((key) => mergeStyleGroups[key])) {\n return style\n }\n for (const k in mergeStyleGroups) {\n if (k in viewStyles) {\n style[k] = style[k] ?? viewStyles[k]\n }\n }\n return style\n }\n\n const addStyles = (style: ViewStyle | null): StyleObject[] => {\n if (!style) return []\n const styleWithPrev = ensureNeededPrevStyle(style)\n const res = getStylesAtomic(styleWithPrev)\n if (res.length) {\n finalStyles = [...finalStyles, ...res]\n }\n return res\n }\n\n // 1 to start above any :hover styles\n let lastMediaImportance = 1\n for (const attr of attrs) {\n switch (attr.type) {\n case 'style':\n if (!isFlattened) {\n if (!attr.name) {\n throw new Error(`No name`)\n }\n\n // only ever one at a time i believe so we can be lazy with this access\n const { hoverStyle, pressStyle, focusStyle } = attr.value\n const pseudos = [\n ['hoverStyle', hoverStyle],\n ['pressStyle', pressStyle],\n ['focusStyle', focusStyle],\n ] as const\n\n const styles = getStylesAtomic(attr.value, {\n splitTransforms: true,\n })\n\n finalStyles = [...finalStyles, ...styles]\n\n for (const [key, value] of pseudos) {\n if (value && Object.keys(value).length) {\n finalAttrs.push(\n t.jsxAttribute(\n t.jsxIdentifier(key),\n t.jsxExpressionContainer(literalToAst(value))\n )\n )\n }\n }\n\n for (const style of styles) {\n // leave them as attributes\n finalAttrs.push(\n t.jsxAttribute(t.jsxIdentifier(style.property), t.stringLiteral(style.identifier))\n )\n }\n } else {\n const styles = addStyles(attr.value)\n const newClassNames = concatClassName(styles.map((x) => x.identifier).join(' '))\n // prettier-ignore\n const existing = finalClassNames.find((x) => x.type == 'StringLiteral') as t.StringLiteral | null\n if (existing) {\n existing.value = `${existing.value} ${newClassNames}`\n } else {\n finalClassNames = [...finalClassNames, t.stringLiteral(newClassNames)]\n }\n }\n\n break\n case 'attr':\n const val = attr.value\n if (t.isJSXSpreadAttribute(val)) {\n if (isSimpleSpread(val)) {\n finalClassNames.push(\n t.logicalExpression(\n '&&',\n val.argument,\n t.memberExpression(val.argument, t.identifier('className'))\n )\n )\n }\n } else if (val.name.name === 'className') {\n const value = val.value\n if (value) {\n try {\n const evaluatedValue = attemptEval(value)\n finalClassNames.push(t.stringLiteral(evaluatedValue))\n } catch (e) {\n finalClassNames.push(value['expression'])\n }\n }\n continue\n }\n finalAttrs.push(val)\n break\n case 'ternary':\n const mediaExtraction = extractMediaStyle(\n attr.value,\n jsxPath,\n extractor.getTamagui(),\n sourcePath,\n lastMediaImportance,\n shouldPrintDebug\n )\n if (shouldPrintDebug) {\n if (mediaExtraction) {\n // prettier-ignore\n console.log('ternary (mediaStyles)', mediaExtraction.ternaryWithoutMedia?.inlineMediaQuery ?? '', mediaExtraction.mediaStyles.map((x) => x.identifier).join('.'))\n }\n }\n if (!mediaExtraction) {\n addTernaryStyle(\n attr.value,\n addStyles(attr.value.consequent),\n addStyles(attr.value.alternate)\n )\n continue\n }\n lastMediaImportance++\n if (mediaExtraction.mediaStyles) {\n finalStyles = [...finalStyles, ...mediaExtraction.mediaStyles]\n }\n if (mediaExtraction.ternaryWithoutMedia) {\n addTernaryStyle(mediaExtraction.ternaryWithoutMedia, mediaExtraction.mediaStyles, [])\n } else {\n finalClassNames = [\n ...finalClassNames,\n ...mediaExtraction.mediaStyles.map((x) => t.stringLiteral(x.identifier)),\n ]\n }\n break\n }\n }\n\n if (shouldPrintDebug) {\n // prettier-ignore\n console.log(' finalClassNames\\n', logLines(finalClassNames.map(x => x['value']).join(' ')))\n }\n\n function addTernaryStyle(ternary: Ternary, a: any, b: any) {\n const cCN = a.map((x) => x.identifier).join(' ')\n const aCN = b.map((x) => x.identifier).join(' ')\n if (a.length && b.length) {\n finalClassNames.push(\n t.conditionalExpression(ternary.test, t.stringLiteral(cCN), t.stringLiteral(aCN))\n )\n } else {\n finalClassNames.push(\n t.conditionalExpression(\n ternary.test,\n t.stringLiteral(' ' + cCN),\n t.stringLiteral(' ' + aCN)\n )\n )\n }\n }\n\n node.attributes = finalAttrs\n\n if (finalClassNames.length) {\n // inserts the _cn variable and uses it for className\n const names = buildClassName(finalClassNames)\n const nameExpr = names ? hoistClassNames(jsxPath, existingHoists, names) : null\n let expr = nameExpr\n\n // if has some spreads, use concat helper\n if (nameExpr && !t.isIdentifier(nameExpr)) {\n if (!hasFlattened) {\n // not flat\n } else {\n ensureImportingConcat(programPath)\n const simpleSpreads = attrs.filter(\n (x) => t.isJSXSpreadAttribute(x.value) && isSimpleSpread(x.value)\n )\n expr = t.callExpression(t.identifier(CONCAT_CLASSNAME_IMPORT), [\n expr,\n ...simpleSpreads.map((val) => val.value['argument']),\n ])\n }\n }\n\n node.attributes.push(\n t.jsxAttribute(t.jsxIdentifier('className'), t.jsxExpressionContainer(expr))\n )\n }\n\n const comment = util.format('/* %s:%s (%s) */', filePath, lineNumbers, originalNodeName)\n\n for (const { className, rules, identifier, value } of finalStyles) {\n // console.log('backvalue', identifier, value)\n // ast.program.body.unshift(\n // t.expressionStatement(\n // t.callExpression(\n // t.memberExpression(\n // t.callExpression(t.identifier('require'), [t.stringLiteral('@tamagui/core')]),\n // t.identifier('setIdentifierValue')\n // ),\n // [t.stringLiteral(identifier), t.stringLiteral(value)]\n // )\n // )\n // )\n\n if (cssMap.has(className)) {\n if (comment) {\n const val = cssMap.get(className)!\n val.commentTexts.push(comment)\n cssMap.set(className, val)\n }\n } else if (rules.length) {\n if (rules.length > 1) {\n console.log(' rules error', { rules })\n throw new Error(`Shouldn't have more than one rule`)\n }\n cssMap.set(className, {\n css: rules[0],\n commentTexts: [comment],\n })\n }\n }\n },\n })\n\n if (!res || (!res.modified && !res.optimized && !res.flattened)) {\n if (shouldPrintDebug) {\n console.log('no res or none modified', res)\n }\n return null\n }\n\n const styles = Array.from(cssMap.values())\n .map((x) => x.css)\n .join('\\n')\n .trim()\n\n if (styles) {\n const cssQuery = threaded\n ? `cssData=${Buffer.from(styles).toString('base64')}`\n : `cssPath=${cssPath}`\n const remReq = loader.remainingRequest\n const importPath = `${cssPath}!=!tamagui-loader?${cssQuery}!${remReq}`\n ast.program.body.unshift(t.importDeclaration([], t.stringLiteral(importPath)))\n }\n\n const result = generate(\n ast,\n {\n concise: false,\n filename: sourcePath,\n retainLines: false,\n sourceFileName: sourcePath,\n sourceMaps: true,\n },\n source\n )\n\n if (shouldPrintDebug) {\n console.log(\n '\\n -------- output code ------- \\n\\n',\n result.code\n .split('\\n')\n .filter((x) => !x.startsWith('//'))\n .join('\\n')\n )\n console.log('\\n -------- output style -------- \\n\\n', styles)\n }\n\n if (shouldLogTiming) {\n const memUsed = mem\n ? Math.round(((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204) * 10) / 10\n : 0\n const timing = `${Date.now() - start}`.padStart(3)\n const path = basename(sourcePath)\n .replace(/\\.[jt]sx?$/, '')\n .slice(0, 22)\n .trim()\n .padStart(24)\n const numOptimized = `${res.optimized}`.padStart(3)\n const numFound = `${res.found}`.padStart(3)\n const numFlattened = `${res.flattened}`.padStart(3)\n const memory = process.env.DEBUG && memUsed > 10 ? ` ${memUsed}MB` : ''\n const timingStr = `${timing}ms`.padStart(6)\n console.log(\n `${getPrefixLogs(\n options\n )} ${path} ${numFound} \u00B7 ${numOptimized} \u00B7 ${numFlattened} ${timingStr} ${\n memory ? `(${memory})` : ''\n }`\n )\n }\n\n return {\n ast,\n styles,\n js: result.code,\n map: result.map,\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,kBAAyB;AACzB,WAAsB;AAEtB,uBAAqB;AACrB,QAAmB;AACnB,uBAAgC;AAChC,qBAAgC;AAChC,uBAAsB;AAItB,uBAAwC;AAExC,wBAA2B;AAC3B,4BAA+B;AAE/B,mCAAsC;AACtC,4BAA+B;AAC/B,+BAAkC;AAClC,2BAA8B;AAC9B,6BAAgC;AAChC,0BAA6B;AAC7B,sBAAyB;AAEzB,MAAM,mBAAmB;AAAA,EACvB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAChB;AAUO,6BAA6B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GAU2B;AAC3B,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AACA,gCACE,OAAO,eAAe,YAAY,KAAK,WAAW,UAAU,GAC5D,qDACF;AAEA,QAAM,kBAAkB,QAAQ,cAAc;AAC9C,QAAM,QAAQ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EAAE,cAAc,UAAU,CAAC,CAAC;AAAA,EAC/E;AAEA,QAAM,SAAS,8BACb,KACA;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,YAAY;AAAA,EACd,GACA,MACF;AAEA,MAAI,kBAAkB;AACpB,YAAQ,IACN,wCACA,OAAO,KACJ,MAAM,IAAI,EACV,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,IAAI,CAAC,EACjC,KAAK,IAAI,CACd;AACA,YAAQ,IAAI,0CAA0C,MAAM;AAAA,EAC9D;AAEA,MAAI,iBAAiB;AACnB,UAAM,UAAU,MACZ,KAAK,MAAQ,SAAQ,YAAY,EAAE,WAAW,IAAI,YAAY,OAAO,OAAQ,EAAE,IAAI,KACnF;AACJ,UAAM,SAAS,GAAG,KAAK,IAAI,IAAI,QAAQ,SAAS,CAAC;AACjD,UAAM,QAAO,0BAAS,UAAU,EAC7B,QAAQ,cAAc,EAAE,EACxB,MAAM,GAAG,EAAE,EACX,KAAK,EACL,SAAS,EAAE;AACd,UAAM,eAAe,GAAG,IAAI,YAAY,SAAS,CAAC;AAClD,UAAM,WAAW,GAAG,IAAI,QAAQ,SAAS,CAAC;AAC1C,UAAM,eAAe,GAAG,IAAI,YAAY,SAAS,CAAC;AAClD,UAAM,SAAS,QAAQ,IAAI,SAAS,UAAU,KAAK,IAAI,cAAc;AACrE,UAAM,YAAY,GAAG,WAAW,SAAS,CAAC;AAC1C,YAAQ,IACN,GAAG,wCACD,OACF,KAAK,UAAS,mBAAgB,uBAAoB,iBAAiB,aACjE,SAAS,IAAI,YAAY,IAE7B;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,OAAO;AAAA,IACX,KAAK,OAAO;AAAA,EACd;AACF;AA9XgB;",
4
+ "sourcesContent": ["import * as path from 'path'\nimport { basename } from 'path'\nimport * as util from 'util'\n\nimport generate from '@babel/generator'\nimport * as t from '@babel/types'\nimport { getStylesAtomic } from '@tamagui/core-node'\nimport { concatClassName } from '@tamagui/helpers'\nimport invariant from 'invariant'\nimport { ViewStyle } from 'react-native'\nimport { LoaderContext } from 'webpack'\n\nimport { CONCAT_CLASSNAME_IMPORT } from '../constants'\nimport { ClassNameObject, StyleObject, TamaguiOptions, Ternary } from '../types'\nimport { babelParse } from './babelParse'\nimport { buildClassName } from './buildClassName'\nimport { Extractor } from './createExtractor'\nimport { ensureImportingConcat } from './ensureImportingConcat'\nimport { isSimpleSpread } from './extractHelpers'\nimport { extractMediaStyle } from './extractMediaStyle'\nimport { getPrefixLogs } from './getPrefixLogs'\nimport { hoistClassNames } from './hoistClassNames'\nimport { literalToAst } from './literalToAst'\nimport { logLines } from './logLines'\nimport { timer } from './timer'\n\nconst mergeStyleGroups = {\n shadowOpacity: true,\n shadowRadius: true,\n shadowColor: true,\n shadowOffset: true,\n}\n\nexport type ExtractedResponse = {\n js: string | Buffer\n styles: string\n stylesPath?: string\n ast: t.File\n map: any // RawSourceMap from 'source-map'\n}\n\nexport function extractToClassNames({\n loader,\n extractor,\n source,\n sourcePath,\n options,\n shouldPrintDebug,\n cssLoaderPath,\n threaded,\n cssPath,\n}: {\n loader: LoaderContext<any>\n cssLoaderPath: string\n extractor: Extractor\n source: string | Buffer\n sourcePath: string\n options: TamaguiOptions\n shouldPrintDebug: boolean | 'verbose'\n cssPath: string\n threaded?: boolean\n}): ExtractedResponse | null {\n const tm = timer()\n\n if (typeof source !== 'string') {\n throw new Error('`source` must be a string of javascript')\n }\n invariant(\n typeof sourcePath === 'string' && path.isAbsolute(sourcePath),\n '`sourcePath` must be an absolute path to a .js file'\n )\n\n const shouldLogTiming = options.logTimings ?? true\n const start = Date.now()\n const mem = shouldLogTiming ? process.memoryUsage() : null\n\n // Using a map for (officially supported) guaranteed insertion order\n let ast: t.File\n\n try {\n // @ts-ignore\n ast = babelParse(source)\n } catch (err) {\n console.error('babel parse error:', sourcePath)\n throw err\n }\n\n tm.mark(`babel-parse`, shouldPrintDebug === 'verbose')\n\n const cssMap = new Map<string, { css: string; commentTexts: string[] }>()\n const existingHoists: { [key: string]: t.Identifier } = {}\n\n let hasFlattened = false\n\n const res = extractor.parse(ast, {\n sourcePath,\n shouldPrintDebug,\n ...options,\n getFlattenedNode: ({ tag }) => {\n hasFlattened = true\n return tag\n },\n onExtractTag: ({\n attrs,\n node,\n attemptEval,\n jsxPath,\n originalNodeName,\n filePath,\n lineNumbers,\n programPath,\n isFlattened,\n }) => {\n let finalClassNames: ClassNameObject[] = []\n let finalAttrs: (t.JSXAttribute | t.JSXSpreadAttribute)[] = []\n let finalStyles: StyleObject[] = []\n\n const viewStyles = {}\n for (const attr of attrs) {\n if (attr.type === 'style') {\n Object.assign(viewStyles, attr.value)\n }\n }\n\n const ensureNeededPrevStyle = (style: ViewStyle) => {\n // ensure all group keys are merged\n const keys = Object.keys(style)\n if (!keys.some((key) => mergeStyleGroups[key])) {\n return style\n }\n for (const k in mergeStyleGroups) {\n if (k in viewStyles) {\n style[k] = style[k] ?? viewStyles[k]\n }\n }\n return style\n }\n\n const addStyles = (style: ViewStyle | null): StyleObject[] => {\n if (!style) return []\n const styleWithPrev = ensureNeededPrevStyle(style)\n const res = getStylesAtomic(styleWithPrev)\n if (res.length) {\n finalStyles = [...finalStyles, ...res]\n }\n return res\n }\n\n // 1 to start above any :hover styles\n let lastMediaImportance = 1\n for (const attr of attrs) {\n switch (attr.type) {\n case 'style':\n if (!isFlattened) {\n // only ever one at a time i believe so we can be lazy with this access\n const { hoverStyle, pressStyle, focusStyle } = attr.value\n const pseudos = [\n ['hoverStyle', hoverStyle],\n ['pressStyle', pressStyle],\n ['focusStyle', focusStyle],\n ] as const\n\n const styles = getStylesAtomic(attr.value, {\n splitTransforms: true,\n })\n finalStyles = [...finalStyles, ...styles]\n\n for (const [key, value] of pseudos) {\n if (value && Object.keys(value).length) {\n finalAttrs.push(\n t.jsxAttribute(\n t.jsxIdentifier(key),\n t.jsxExpressionContainer(literalToAst(value))\n )\n )\n }\n }\n\n for (const style of styles) {\n // leave them as attributes\n finalAttrs.push(\n t.jsxAttribute(t.jsxIdentifier(style.property), t.stringLiteral(style.identifier))\n )\n }\n\n // for (const key in attr.value) {\n // if (pseudos.some((x) => x[0] === key)) {\n // // we handled pseudos above...\n // continue\n // }\n // // leave them as attributes\n // finalAttrs.push(\n // t.jsxAttribute(t.jsxIdentifier(key), t.stringLiteral(attr.value[key]))\n // )\n // }\n } else {\n const styles = addStyles(attr.value)\n const newClassNames = concatClassName(styles.map((x) => x.identifier).join(' '))\n const existing = finalClassNames.find(\n (x) => x.type == 'StringLiteral'\n ) as t.StringLiteral | null\n\n // const newClassNames = concatClassName(Object.values(attr.value))\n // const existing = finalClassNames.find(\n // (x) => x.type == 'StringLiteral'\n // ) as t.StringLiteral | null\n\n if (existing) {\n existing.value = `${existing.value} ${newClassNames}`\n } else {\n finalClassNames = [...finalClassNames, t.stringLiteral(newClassNames)]\n }\n }\n\n break\n case 'attr':\n const val = attr.value\n if (t.isJSXSpreadAttribute(val)) {\n if (isSimpleSpread(val)) {\n finalClassNames.push(\n t.logicalExpression(\n '&&',\n val.argument,\n t.memberExpression(val.argument, t.identifier('className'))\n )\n )\n }\n } else if (val.name.name === 'className') {\n const value = val.value\n if (value) {\n try {\n const evaluatedValue = attemptEval(value)\n finalClassNames.push(t.stringLiteral(evaluatedValue))\n } catch (e) {\n finalClassNames.push(value['expression'])\n }\n }\n continue\n }\n finalAttrs.push(val)\n break\n case 'ternary':\n const mediaExtraction = extractMediaStyle(\n attr.value,\n jsxPath,\n extractor.getTamagui(),\n sourcePath,\n lastMediaImportance,\n shouldPrintDebug\n )\n if (shouldPrintDebug) {\n if (mediaExtraction) {\n // prettier-ignore\n console.log('ternary (mediaStyles)', mediaExtraction.ternaryWithoutMedia?.inlineMediaQuery ?? '', mediaExtraction.mediaStyles.map((x) => x.identifier).join('.'))\n }\n }\n if (!mediaExtraction) {\n addTernaryStyle(\n attr.value,\n addStyles(attr.value.consequent),\n addStyles(attr.value.alternate)\n )\n continue\n }\n lastMediaImportance++\n if (mediaExtraction.mediaStyles) {\n finalStyles = [...finalStyles, ...mediaExtraction.mediaStyles]\n }\n if (mediaExtraction.ternaryWithoutMedia) {\n addTernaryStyle(mediaExtraction.ternaryWithoutMedia, mediaExtraction.mediaStyles, [])\n } else {\n finalClassNames = [\n ...finalClassNames,\n ...mediaExtraction.mediaStyles.map((x) => t.stringLiteral(x.identifier)),\n ]\n }\n break\n }\n }\n\n function addTernaryStyle(ternary: Ternary, a: any, b: any) {\n const cCN = a.map((x) => x.identifier).join(' ')\n const aCN = b.map((x) => x.identifier).join(' ')\n if (a.length && b.length) {\n finalClassNames.push(\n t.conditionalExpression(ternary.test, t.stringLiteral(cCN), t.stringLiteral(aCN))\n )\n } else {\n finalClassNames.push(\n t.conditionalExpression(\n ternary.test,\n t.stringLiteral(' ' + cCN),\n t.stringLiteral(' ' + aCN)\n )\n )\n }\n }\n\n if (shouldPrintDebug) {\n // prettier-ignore\n console.log(' finalClassNames\\n', logLines(finalClassNames.map(x => x['value']).join(' ')))\n }\n\n node.attributes = finalAttrs\n\n if (finalClassNames.length) {\n // inserts the _cn variable and uses it for className\n let names = buildClassName(finalClassNames)\n if (t.isStringLiteral(names)) {\n names.value = concatClassName(names.value)\n }\n const nameExpr = names ? hoistClassNames(jsxPath, existingHoists, names) : null\n let expr = nameExpr\n\n // if has some spreads, use concat helper\n if (nameExpr && !t.isIdentifier(nameExpr)) {\n if (!hasFlattened) {\n // not flat\n } else {\n ensureImportingConcat(programPath)\n const simpleSpreads = attrs.filter(\n (x) => t.isJSXSpreadAttribute(x.value) && isSimpleSpread(x.value)\n )\n expr = t.callExpression(t.identifier(CONCAT_CLASSNAME_IMPORT), [\n expr,\n ...simpleSpreads.map((val) => val.value['argument']),\n ])\n }\n }\n\n node.attributes.push(\n t.jsxAttribute(t.jsxIdentifier('className'), t.jsxExpressionContainer(expr))\n )\n }\n\n const comment = util.format('/* %s:%s (%s) */', filePath, lineNumbers, originalNodeName)\n\n for (const { className, rules, identifier, value } of finalStyles) {\n // console.log('backvalue', identifier, value)\n // ast.program.body.unshift(\n // t.expressionStatement(\n // t.callExpression(\n // t.memberExpression(\n // t.callExpression(t.identifier('require'), [t.stringLiteral('@tamagui/core')]),\n // t.identifier('setIdentifierValue')\n // ),\n // [t.stringLiteral(identifier), t.stringLiteral(value)]\n // )\n // )\n // )\n\n if (cssMap.has(className)) {\n if (comment) {\n const val = cssMap.get(className)!\n val.commentTexts.push(comment)\n cssMap.set(className, val)\n }\n } else if (rules.length) {\n if (rules.length > 1) {\n console.log(' rules error', { rules })\n throw new Error(`Shouldn't have more than one rule`)\n }\n cssMap.set(className, {\n css: rules[0],\n commentTexts: [comment],\n })\n }\n }\n },\n })\n\n if (!res || (!res.modified && !res.optimized && !res.flattened)) {\n if (shouldPrintDebug) {\n console.log('no res or none modified', res)\n }\n return null\n }\n\n const styles = Array.from(cssMap.values())\n .map((x) => x.css)\n .join('\\n')\n .trim()\n\n if (styles) {\n const cssQuery = threaded\n ? `cssData=${Buffer.from(styles).toString('base64')}`\n : `cssPath=${cssPath}`\n const remReq = loader.remainingRequest\n const importPath = `${cssPath}!=!${cssLoaderPath}?${cssQuery}!${remReq}`\n ast.program.body.unshift(t.importDeclaration([], t.stringLiteral(importPath)))\n }\n\n const result = generate(\n ast,\n {\n concise: false,\n filename: sourcePath,\n // this makes the debug output terrible, and i think sourcemap works already\n retainLines: false,\n sourceFileName: sourcePath,\n sourceMaps: true,\n },\n source\n )\n\n if (shouldPrintDebug) {\n console.log(\n '\\n -------- output code ------- \\n\\n',\n result.code\n .split('\\n')\n .filter((x) => !x.startsWith('//'))\n .join('\\n')\n )\n console.log('\\n -------- output style -------- \\n\\n', styles)\n }\n\n if (shouldLogTiming) {\n const memUsed = mem\n ? Math.round(((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204) * 10) / 10\n : 0\n const path = basename(sourcePath)\n .replace(/\\.[jt]sx?$/, '')\n .slice(0, 22)\n .trim()\n .padStart(24)\n const numOptimized = `${res.optimized}`.padStart(3)\n const numFound = `${res.found}`.padStart(3)\n const numFlattened = `${res.flattened}`.padStart(3)\n const memory = process.env.DEBUG && memUsed > 10 ? ` ${memUsed}MB` : ''\n const timing = Date.now() - start\n const timingWarning = timing > 50 ? '\u26A0\uFE0F' : timing > 150 ? '\u2622\uFE0F' : ''\n const timingStr = `${timing}ms${timingWarning}`.padStart(6)\n console.log(\n `${getPrefixLogs(\n options\n )} ${path} ${numFound} \u00B7 ${numOptimized} \u00B7 ${numFlattened} ${timingStr} ${\n memory ? `(${memory})` : ''\n }`\n )\n }\n\n return {\n ast,\n styles,\n js: result.code,\n map: result.map,\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAAsB;AACtB,kBAAyB;AACzB,WAAsB;AAEtB,uBAAqB;AACrB,QAAmB;AACnB,uBAAgC;AAChC,qBAAgC;AAChC,uBAAsB;AAItB,uBAAwC;AAExC,wBAA2B;AAC3B,4BAA+B;AAE/B,mCAAsC;AACtC,4BAA+B;AAC/B,+BAAkC;AAClC,2BAA8B;AAC9B,6BAAgC;AAChC,0BAA6B;AAC7B,sBAAyB;AACzB,mBAAsB;AAEtB,MAAM,mBAAmB;AAAA,EACvB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAChB;AAUO,6BAA6B;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,GAW2B;AAC3B,QAAM,KAAK,wBAAM;AAEjB,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AACA,gCACE,OAAO,eAAe,YAAY,KAAK,WAAW,UAAU,GAC5D,qDACF;AAEA,QAAM,kBAAkB,Q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AA,IACX,KAAK,OAAO;AAAA,EACd;AACF;AAtZgB;",
6
6
  "names": []
7
7
  }
@@ -38,4 +38,8 @@ function findTopmostFunction(jsxPath) {
38
38
  return compFn;
39
39
  }
40
40
  __name(findTopmostFunction, "findTopmostFunction");
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ findTopmostFunction
44
+ });
41
45
  //# sourceMappingURL=findTopmostFunction.js.map
@@ -46,4 +46,8 @@ function generateUid(scope, name) {
46
46
  return uid;
47
47
  }
48
48
  __name(generateUid, "generateUid");
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ generateUid
52
+ });
49
53
  //# sourceMappingURL=generatedUid.js.map
@@ -26,4 +26,8 @@ function getPrefixLogs(options) {
26
26
  return (options == null ? void 0 : options.prefixLogs) ?? ` ${TAMAGUI_TARGET} | `;
27
27
  }
28
28
  __name(getPrefixLogs, "getPrefixLogs");
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ getPrefixLogs
32
+ });
29
33
  //# sourceMappingURL=getPrefixLogs.js.map
@@ -67,4 +67,8 @@ function getPropValueFromAttributes(propName, attrs) {
67
67
  return propValue;
68
68
  }
69
69
  __name(getPropValueFromAttributes, "getPropValueFromAttributes");
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ getPropValueFromAttributes
73
+ });
70
74
  //# sourceMappingURL=getPropValueFromAttributes.js.map
@@ -87,4 +87,8 @@ function getSourceModule(itemName, itemBinding) {
87
87
  };
88
88
  }
89
89
  __name(getSourceModule, "getSourceModule");
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ getSourceModule
93
+ });
90
94
  //# sourceMappingURL=getSourceModule.js.map
@@ -146,4 +146,8 @@ function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bindingCac
146
146
  return ret;
147
147
  }
148
148
  __name(getStaticBindingsForScope, "getStaticBindingsForScope");
149
+ // Annotate the CommonJS export names for ESM import in node:
150
+ 0 && (module.exports = {
151
+ getStaticBindingsForScope
152
+ });
149
153
  //# sourceMappingURL=getStaticBindingsForScope.js.map
@@ -62,4 +62,8 @@ function hoistClassNames(path, existing, expr) {
62
62
  __name(replaceStringWithVariable, "replaceStringWithVariable");
63
63
  }
64
64
  __name(hoistClassNames, "hoistClassNames");
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ hoistClassNames
68
+ });
65
69
  //# sourceMappingURL=hoistClassNames.js.map
@@ -111,4 +111,9 @@ function computeProps(props) {
111
111
  }, {});
112
112
  }
113
113
  __name(computeProps, "computeProps");
114
+ // Annotate the CommonJS export names for ESM import in node:
115
+ 0 && (module.exports = {
116
+ astToLiteral,
117
+ literalToAst
118
+ });
114
119
  //# sourceMappingURL=literalToAst.js.map
@@ -28,56 +28,76 @@ function loadTamagui(props) {
28
28
  if (loadedTamagui) {
29
29
  return loadedTamagui;
30
30
  }
31
- process.env.IS_STATIC = "is_static";
32
- const proxyWorm = require("@tamagui/proxy-worm");
33
- const rnw = require("react-native-web");
34
- const Mod = require("module");
35
- const og = Mod.prototype.require;
36
- Mod.prototype.require = function(path) {
37
- if (path.endsWith(".css")) {
38
- return {};
39
- }
40
- if (path === "@gorhom/bottom-sheet" || path.startsWith("react-native-reanimated")) {
41
- return proxyWorm;
42
- }
43
- if (path.startsWith("react-native") && !path.startsWith("react-native-web/dist/cjs/exports")) {
44
- return rnw;
45
- }
46
- try {
47
- return og.apply(this, arguments);
48
- } catch (err) {
49
- console.error("Tamagui error loading file:\n");
50
- console.log(" ", path, "\n");
51
- console.log(err.message);
52
- console.log(err.stack);
53
- process.exit(1);
54
- }
55
- };
56
31
  const configPath = (0, import_path.join)(process.cwd(), props.config);
57
- const tamaguiConfigExport = require(configPath);
58
- const tamaguiConfig = tamaguiConfigExport["default"] || tamaguiConfigExport;
59
- if (!tamaguiConfig || !tamaguiConfig.parsed) {
60
- try {
61
- const confPath = require.resolve(configPath);
62
- console.log(`Received:`, tamaguiConfigExport);
63
- throw new Error(`Can't find valid config in ${confPath}`);
64
- } catch (err) {
65
- throw err;
32
+ const { unregister } = require("esbuild-register/dist/node").register({
33
+ target: "es2019",
34
+ format: "cjs"
35
+ });
36
+ try {
37
+ process.env.IS_STATIC = "is_static";
38
+ const proxyWorm = require("@tamagui/proxy-worm");
39
+ const rnw = require("react-native-web");
40
+ const Mod = require("module");
41
+ const og = Mod.prototype.require;
42
+ Mod.prototype.require = function(path) {
43
+ if (path.endsWith(".css")) {
44
+ return {};
45
+ }
46
+ if (path === "@gorhom/bottom-sheet" || path.startsWith("react-native-reanimated")) {
47
+ return proxyWorm;
48
+ }
49
+ if (path.startsWith("react-native") && !path.startsWith("react-native-web/dist/cjs/exports")) {
50
+ return rnw;
51
+ }
52
+ try {
53
+ return og.apply(this, arguments);
54
+ } catch (err) {
55
+ console.error("Tamagui error loading file:\n");
56
+ console.log(" ", path, "\n");
57
+ console.log(err.message);
58
+ console.log(err.stack);
59
+ process.exit(1);
60
+ }
61
+ };
62
+ const exp = require(configPath);
63
+ const tamaguiConfig = exp["default"] || exp;
64
+ if (!tamaguiConfig || !tamaguiConfig.parsed) {
65
+ try {
66
+ const confPath = require.resolve(configPath);
67
+ console.log(`Received:`, tamaguiConfig);
68
+ throw new Error(`Can't find valid config in ${confPath}`);
69
+ } catch (err) {
70
+ throw err;
71
+ }
66
72
  }
73
+ const components = {};
74
+ for (const moduleName of props.components) {
75
+ const exported = require(moduleName);
76
+ for (const Name in exported) {
77
+ const val = exported[Name];
78
+ const staticConfig = val == null ? void 0 : val.staticConfig;
79
+ if (staticConfig) {
80
+ Object.assign(components, { [Name]: { staticConfig } });
81
+ }
82
+ }
83
+ }
84
+ process.env.IS_STATIC = void 0;
85
+ Mod.prototype.require = og;
86
+ (0, import_core_node.createTamagui)(tamaguiConfig);
87
+ loadedTamagui = {
88
+ components,
89
+ tamaguiConfig
90
+ };
91
+ return loadedTamagui;
92
+ } catch (err) {
93
+ throw err;
94
+ } finally {
95
+ unregister();
67
96
  }
68
- const components = {};
69
- for (const module2 of props.components) {
70
- const exported = require(module2);
71
- Object.assign(components, exported);
72
- }
73
- process.env.IS_STATIC = void 0;
74
- Mod.prototype.require = og;
75
- (0, import_core_node.createTamagui)(tamaguiConfig);
76
- loadedTamagui = {
77
- components,
78
- tamaguiConfig
79
- };
80
- return loadedTamagui;
81
97
  }
82
98
  __name(loadTamagui, "loadTamagui");
99
+ // Annotate the CommonJS export names for ESM import in node:
100
+ 0 && (module.exports = {
101
+ loadTamagui
102
+ });
83
103
  //# sourceMappingURL=loadTamagui.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/extractor/loadTamagui.ts"],
4
- "sourcesContent": ["import { join } from 'path'\n\nimport type { TamaguiComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, TamaguiComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const proxyWorm = require('@tamagui/proxy-worm')\n const rnw = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (path.endsWith('.css')) {\n return {}\n }\n if (path === '@gorhom/bottom-sheet' || path.startsWith('react-native-reanimated')) {\n return proxyWorm\n }\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return rnw\n }\n try {\n return og.apply(this, arguments)\n } catch (err: any) {\n console.error('Tamagui error loading file:\\n')\n console.log(' ', path, '\\n')\n console.log(err.message)\n console.log(err.stack)\n // avoid infinite loops\n process.exit(1)\n }\n }\n\n // import config\n const configPath = join(process.cwd(), props.config)\n const tamaguiConfigExport = require(configPath)\n const tamaguiConfig = (tamaguiConfigExport['default'] ||\n tamaguiConfigExport) as TamaguiInternalConfig\n\n if (!tamaguiConfig || !tamaguiConfig.parsed) {\n try {\n const confPath = require.resolve(configPath)\n console.log(`Received:`, tamaguiConfigExport)\n throw new Error(`Can't find valid config in ${confPath}`)\n } catch (err) {\n throw err\n }\n }\n\n // import components\n const components = {}\n for (const module of props.components) {\n const exported = require(module)\n Object.assign(components, exported)\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n return loadedTamagui\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB;AAGrB,uBAA8B;AAE9B,IAAI,gBAAqB;AAElB,qBAAqB,OAG1B;AACA,MAAI,eAAe;AACjB,WAAO;AAAA,EACT;AAIA,UAAQ,IAAI,YAAY;AACxB,QAAM,YAAY,QAAQ,qBAAqB;AAC/C,QAAM,MAAM,QAAQ,kBAAkB;AACtC,QAAM,MAAM,QAAQ,QAAQ;AAC5B,QAAM,KAAK,IAAI,UAAU;AACzB,MAAI,UAAU,UAAU,SAAU,MAAc;AAC9C,QAAI,KAAK,SAAS,MAAM,GAAG;AACzB,aAAO,CAAC;AAAA,IACV;AACA,QAAI,SAAS,0BAA0B,KAAK,WAAW,yBAAyB,GAAG;AACjF,aAAO;AAAA,IACT;AACA,QACE,KAAK,WAAW,cAAc,KAE9B,CAAC,KAAK,WAAW,mCAAmC,GACpD;AACA,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,GAAG,MAAM,MAAM,SAAS;AAAA,IACjC,SAAS,KAAP;AACA,cAAQ,MAAM,+BAA+B;AAC7C,cAAQ,IAAI,OAAO,MAAM,IAAI;AAC7B,cAAQ,IAAI,IAAI,OAAO;AACvB,cAAQ,IAAI,IAAI,KAAK;AAErB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF;AAGA,QAAM,aAAa,sBAAK,QAAQ,IAAI,GAAG,MAAM,MAAM;AACnD,QAAM,sBAAsB,QAAQ,UAAU;AAC9C,QAAM,gBAAiB,oBAAoB,cACzC;AAEF,MAAI,CAAC,iBAAiB,CAAC,cAAc,QAAQ;AAC3C,QAAI;AACF,YAAM,WAA2B,AAAhB,QAAQ,QAAQ;AACjC,cAAQ,IAAI,aAAa,mBAAmB;AAC5C,YAAM,IAAI,MAAM,8BAA8B,UAAU;AAAA,IAC1D,SAAS,KAAP;AACA,YAAM;AAAA,IACR;AAAA,EACF;AAGA,QAAM,aAAa,CAAC;AACpB,aAAW,WAAU,MAAM,YAAY;AACrC,UAAM,WAAW,QAAQ,OAAM;AAC/B,WAAO,OAAO,YAAY,QAAQ;AAAA,EACpC;AAGA,UAAQ,IAAI,YAAY;AACxB,MAAI,UAAU,UAAU;AAGxB,sCAAc,aAAa;AAE3B,kBAAgB;AAAA,IACd;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AACT;AA7EgB;",
4
+ "sourcesContent": ["import { join } from 'path'\n\nimport type { TamaguiComponent, TamaguiInternalConfig } from '@tamagui/core'\nimport { createTamagui } from '@tamagui/core-node'\n\nlet loadedTamagui: any = null\n\nexport function loadTamagui(props: { components: string[]; config: string }): {\n components: Record<string, TamaguiComponent>\n tamaguiConfig: TamaguiInternalConfig\n} {\n if (loadedTamagui) {\n return loadedTamagui\n }\n\n const configPath = join(process.cwd(), props.config)\n\n // threaded caching avoiding 1s loading of large configs every save\n // const cachePath = join(cacheDir, 'tamagui-conf-cached.json')\n // const confStat = statSync(configPath)\n\n // // TODO may want to disable, its pretty optimistic at caching...\n // try {\n // const confCache = readFileSync(cachePath, 'utf-8')\n // const confParsed = JSON.parse(confCache)\n // if (confParsed && confParsed.mtime === confStat.mtime) {\n // return confParsed.value\n // }\n // } catch {\n // // ok, no cache\n // }\n\n const { unregister } = require('esbuild-register/dist/node').register({\n target: 'es2019',\n format: 'cjs',\n })\n\n try {\n // lets shim require and avoid importing react-native + react-native-web\n // we just need to read the config around them\n process.env.IS_STATIC = 'is_static'\n const proxyWorm = require('@tamagui/proxy-worm')\n const rnw = require('react-native-web')\n const Mod = require('module')\n const og = Mod.prototype.require\n Mod.prototype.require = function (path: string) {\n if (path.endsWith('.css')) {\n return {}\n }\n if (path === '@gorhom/bottom-sheet' || path.startsWith('react-native-reanimated')) {\n return proxyWorm\n }\n if (\n path.startsWith('react-native') &&\n // allow our rnw.tsx imports through\n !path.startsWith('react-native-web/dist/cjs/exports')\n ) {\n return rnw\n }\n try {\n return og.apply(this, arguments)\n } catch (err: any) {\n console.error('Tamagui error loading file:\\n')\n console.log(' ', path, '\\n')\n console.log(err.message)\n console.log(err.stack)\n // avoid infinite loops\n process.exit(1)\n }\n }\n\n // import config\n const exp = require(configPath)\n const tamaguiConfig = (exp['default'] || exp) as TamaguiInternalConfig\n\n if (!tamaguiConfig || !tamaguiConfig.parsed) {\n try {\n const confPath = require.resolve(configPath)\n console.log(`Received:`, tamaguiConfig)\n throw new Error(`Can't find valid config in ${confPath}`)\n } catch (err) {\n throw err\n }\n }\n\n // import components\n const components = {}\n for (const moduleName of props.components) {\n const exported = require(moduleName)\n for (const Name in exported) {\n const val = exported[Name]\n const staticConfig = val?.staticConfig\n if (staticConfig) {\n Object.assign(components, { [Name]: { staticConfig } })\n }\n }\n }\n\n // undo shims\n process.env.IS_STATIC = undefined\n Mod.prototype.require = og\n\n // set up core-node\n createTamagui(tamaguiConfig as any)\n\n loadedTamagui = {\n components,\n tamaguiConfig,\n }\n\n // save cache\n // try {\n // writeFileSync(\n // cachePath,\n // JSON.stringify({\n // value: loadedTamagui,\n // mtime: confStat.mtime,\n // })\n // )\n // } catch (err: any) {\n // console.log(`Error: tamagui config not stringifiable, caching disabled \"${err.message}\"`)\n // }\n\n return loadedTamagui\n } catch (err) {\n throw err\n } finally {\n unregister()\n }\n}\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ACtC,cAAM,IAAI,MAAM,8BAA8B,UAAU;AAAA,MAC1D,SAAS,KAAP;AACA,cAAM;AAAA,MACR;AAAA,IACF;AAGA,UAAM,aAAa,CAAC;AACpB,eAAW,cAAc,MAAM,YAAY;AACzC,YAAM,WAAW,QAAQ,UAAU;AACnC,iBAAW,QAAQ,UAAU;AAC3B,cAAM,MAAM,SAAS;AACrB,cAAM,eAAe,2BAAK;AAC1B,YAAI,cAAc;AAChB,iBAAO,OAAO,YAAY,GAAG,OAAO,EAAE,aAAa,EAAE,CAAC;AAAA,QACxD;AAAA,MACF;AAAA,IACF;AAGA,YAAQ,IAAI,YAAY;AACxB,QAAI,UAAU,UAAU;AAGxB,wCAAc,aAAoB;AAElC,oBAAgB;AAAA,MACd;AAAA,MACA;AAAA,IACF;AAeA,WAAO;AAAA,EACT,SAAS,KAAP;AACA,UAAM;AAAA,EACR,UAAE;AACA,eAAW;AAAA,EACb;AACF;AA1HgB;",
6
6
  "names": []
7
7
  }
@@ -37,4 +37,8 @@ ${prefix}`);
37
37
  }
38
38
  return lines.map((line, i) => prefix + (i == 0 ? "" : " ") + line.trim()).join("\n");
39
39
  }, "logLines");
40
+ // Annotate the CommonJS export names for ESM import in node:
41
+ 0 && (module.exports = {
42
+ logLines
43
+ });
40
44
  //# sourceMappingURL=logLines.js.map
@@ -98,4 +98,8 @@ function normalizeTernaries(ternaries) {
98
98
  return ternaryExpression;
99
99
  }
100
100
  __name(normalizeTernaries, "normalizeTernaries");
101
+ // Annotate the CommonJS export names for ESM import in node:
102
+ 0 && (module.exports = {
103
+ normalizeTernaries
104
+ });
101
105
  //# sourceMappingURL=normalizeTernaries.js.map
@@ -97,4 +97,8 @@ function removeUnusedHooks(compFn, shouldPrintDebug) {
97
97
  }
98
98
  }
99
99
  __name(removeUnusedHooks, "removeUnusedHooks");
100
+ // Annotate the CommonJS export names for ESM import in node:
101
+ 0 && (module.exports = {
102
+ removeUnusedHooks
103
+ });
100
104
  //# sourceMappingURL=removeUnusedHooks.js.map
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var timer_exports = {};
20
+ __export(timer_exports, {
21
+ timer: () => timer
22
+ });
23
+ module.exports = __toCommonJS(timer_exports);
24
+ const timer = /* @__PURE__ */ __name(() => {
25
+ const start = Date.now();
26
+ let last = start;
27
+ return {
28
+ mark: (name, print = false) => {
29
+ if (print) {
30
+ const took = Date.now() - last;
31
+ last = Date.now();
32
+ console.log(`Time ${name}: ${took}ms`);
33
+ }
34
+ },
35
+ done: (print = false) => {
36
+ if (print) {
37
+ console.log(`Total time: ${Date.now() - start}ms`);
38
+ }
39
+ }
40
+ };
41
+ }, "timer");
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ timer
45
+ });
46
+ //# sourceMappingURL=timer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/extractor/timer.ts"],
4
+ "sourcesContent": ["export const timer = () => {\n const start = Date.now()\n let last = start\n return {\n mark: (name: string, print = false) => {\n if (print) {\n const took = Date.now() - last\n last = Date.now()\n console.log(`Time ${name}: ${took}ms`)\n }\n },\n done: (print = false) => {\n if (print) {\n console.log(`Total time: ${Date.now() - start}ms`)\n }\n },\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,QAAQ,6BAAM;AACzB,QAAM,QAAQ,KAAK,IAAI;AACvB,MAAI,OAAO;AACX,SAAO;AAAA,IACL,MAAM,CAAC,MAAc,QAAQ,UAAU;AACrC,UAAI,OAAO;AACT,cAAM,OAAO,KAAK,IAAI,IAAI;AAC1B,eAAO,KAAK,IAAI;AAChB,gBAAQ,IAAI,QAAQ,SAAS,QAAQ;AAAA,MACvC;AAAA,IACF;AAAA,IACA,MAAM,CAAC,QAAQ,UAAU;AACvB,UAAI,OAAO;AACT,gBAAQ,IAAI,eAAe,KAAK,IAAI,IAAI,SAAS;AAAA,MACnD;AAAA,IACF;AAAA,EACF;AACF,GAjBqB;",
6
+ "names": []
7
+ }
@@ -68,4 +68,8 @@ const validHTMLAttributes = {
68
68
  "aria-selected": true,
69
69
  "aria-sort": true
70
70
  };
71
+ // Annotate the CommonJS export names for ESM import in node:
72
+ 0 && (module.exports = {
73
+ validHTMLAttributes
74
+ });
71
75
  //# sourceMappingURL=validHTMLAttributes.js.map
package/dist/cjs/index.js CHANGED
@@ -31,4 +31,10 @@ __reExport(src_exports, require("./extractor/extractToClassNames"), module.expor
31
31
  __reExport(src_exports, require("./extractor/extractHelpers"), module.exports);
32
32
  __reExport(src_exports, require("./patchReactNativeWeb"), module.exports);
33
33
  process.env.TAMAGUI_COMPILE_PROCESS = "1";
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ TamaguiOptions,
37
+ createExtractor,
38
+ literalToAst
39
+ });
34
40
  //# sourceMappingURL=index.js.map
@@ -39,6 +39,8 @@ function patchReactNativeWeb() {
39
39
  }
40
40
  const patches = [
41
41
  {
42
+ id: "dom-props",
43
+ filePath: ["modules", "createDOMProps", "index.js"],
42
44
  replacee: ` if (dataSet != null) {`,
43
45
  replacer: `
44
46
  if (props.dataSet && props.dataSet.className) {
@@ -46,15 +48,25 @@ function patchReactNativeWeb() {
46
48
  classList = className
47
49
  dataSet = dataSetRest
48
50
  }
51
+ if (props.dataSet && props.dataSet.id) {
52
+ domProps['id'] = props.dataSet.id
53
+ }
49
54
  if (dataSet != null) {`
55
+ },
56
+ {
57
+ id: "forward-props",
58
+ filePath: ["modules", "forwardedProps", "index.js"],
59
+ replacee: `dataSet: true,`,
60
+ replacer: `id: true, dataSet: true,`
50
61
  }
51
62
  ];
52
- const dataSetPath = ["modules", "createDOMProps", "index.js"];
53
- const dataSetModulePath = import_path.default.join(rootDir, "dist", ...dataSetPath);
54
- const dataSetCjsPath = import_path.default.join(rootDir, "dist", "cjs", ...dataSetPath);
55
- for (const file of [dataSetModulePath, dataSetCjsPath]) {
56
- const contents = fs.readFileSync(file, "utf-8");
57
- for (const { replacee, replacer } of patches) {
63
+ for (const { filePath, replacee, replacer } of patches) {
64
+ const files = [
65
+ import_path.default.join(rootDir, "dist", ...filePath),
66
+ import_path.default.join(rootDir, "dist", "cjs", ...filePath)
67
+ ];
68
+ for (const file of files) {
69
+ const contents = fs.readFileSync(file, "utf-8");
58
70
  if (contents.includes(replacer)) {
59
71
  continue;
60
72
  }
@@ -66,7 +78,7 @@ function patchReactNativeWeb() {
66
78
  continue;
67
79
  }
68
80
  console.log(" | patch " + import_path.default.relative(rootDir, file));
69
- fs.writeFileSync(file, contents.replaceAll(replacee, replacer));
81
+ fs.writeFileSync(file, contents.replace(replacee, replacer));
70
82
  }
71
83
  }
72
84
  const moduleEntry = import_path.default.join(rootDir, "dist", "index.js");
@@ -148,4 +160,8 @@ exports.useResponderEvents = require('./modules/useResponderEvents')
148
160
  const fwdProps = require('./modules/forwardedProps')
149
161
  exports.forwardedProps = ${forwardedPropsObj}
150
162
  `;
163
+ // Annotate the CommonJS export names for ESM import in node:
164
+ 0 && (module.exports = {
165
+ patchReactNativeWeb
166
+ });
151
167
  //# sourceMappingURL=patchReactNativeWeb.js.map