@tamagui/static 1.2.9 → 1.2.10

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 (67) hide show
  1. package/dist/esm/constants.mjs +15 -0
  2. package/dist/esm/constants.mjs.map +7 -0
  3. package/dist/esm/extractor/accessSafe.mjs +19 -0
  4. package/dist/esm/extractor/accessSafe.mjs.map +7 -0
  5. package/dist/esm/extractor/babelParse.mjs +32 -0
  6. package/dist/esm/extractor/babelParse.mjs.map +7 -0
  7. package/dist/esm/extractor/buildClassName.mjs +65 -0
  8. package/dist/esm/extractor/buildClassName.mjs.map +7 -0
  9. package/dist/esm/extractor/bundle.mjs +86 -0
  10. package/dist/esm/extractor/bundle.mjs.map +7 -0
  11. package/dist/esm/extractor/createEvaluator.mjs +52 -0
  12. package/dist/esm/extractor/createEvaluator.mjs.map +7 -0
  13. package/dist/esm/extractor/createExtractor.mjs +1610 -0
  14. package/dist/esm/extractor/createExtractor.mjs.map +7 -0
  15. package/dist/esm/extractor/ensureImportingConcat.mjs +31 -0
  16. package/dist/esm/extractor/ensureImportingConcat.mjs.map +7 -0
  17. package/dist/esm/extractor/evaluateAstNode.mjs +97 -0
  18. package/dist/esm/extractor/evaluateAstNode.mjs.map +7 -0
  19. package/dist/esm/extractor/extractHelpers.mjs +162 -0
  20. package/dist/esm/extractor/extractHelpers.mjs.map +7 -0
  21. package/dist/esm/extractor/extractMediaStyle.mjs +159 -0
  22. package/dist/esm/extractor/extractMediaStyle.mjs.map +7 -0
  23. package/dist/esm/extractor/extractToClassNames.mjs +381 -0
  24. package/dist/esm/extractor/extractToClassNames.mjs.map +7 -0
  25. package/dist/esm/extractor/findTopmostFunction.mjs +20 -0
  26. package/dist/esm/extractor/findTopmostFunction.mjs.map +7 -0
  27. package/dist/esm/extractor/generatedUid.mjs +26 -0
  28. package/dist/esm/extractor/generatedUid.mjs.map +7 -0
  29. package/dist/esm/extractor/getPrefixLogs.mjs +8 -0
  30. package/dist/esm/extractor/getPrefixLogs.mjs.map +7 -0
  31. package/dist/esm/extractor/getPropValueFromAttributes.mjs +56 -0
  32. package/dist/esm/extractor/getPropValueFromAttributes.mjs.map +7 -0
  33. package/dist/esm/extractor/getSourceModule.mjs +70 -0
  34. package/dist/esm/extractor/getSourceModule.mjs.map +7 -0
  35. package/dist/esm/extractor/getStaticBindingsForScope.mjs +191 -0
  36. package/dist/esm/extractor/getStaticBindingsForScope.mjs.map +7 -0
  37. package/dist/esm/extractor/hoistClassNames.mjs +41 -0
  38. package/dist/esm/extractor/hoistClassNames.mjs.map +7 -0
  39. package/dist/esm/extractor/literalToAst.mjs +81 -0
  40. package/dist/esm/extractor/literalToAst.mjs.map +7 -0
  41. package/dist/esm/extractor/loadFile.mjs +20 -0
  42. package/dist/esm/extractor/loadFile.mjs.map +7 -0
  43. package/dist/esm/extractor/loadTamagui.mjs +411 -0
  44. package/dist/esm/extractor/loadTamagui.mjs.map +7 -0
  45. package/dist/esm/extractor/logLines.mjs +20 -0
  46. package/dist/esm/extractor/logLines.mjs.map +7 -0
  47. package/dist/esm/extractor/normalizeTernaries.mjs +52 -0
  48. package/dist/esm/extractor/normalizeTernaries.mjs.map +7 -0
  49. package/dist/esm/extractor/removeUnusedHooks.mjs +76 -0
  50. package/dist/esm/extractor/removeUnusedHooks.mjs.map +7 -0
  51. package/dist/esm/extractor/timer.mjs +29 -0
  52. package/dist/esm/extractor/timer.mjs.map +7 -0
  53. package/dist/esm/extractor/validHTMLAttributes.mjs +102 -0
  54. package/dist/esm/extractor/validHTMLAttributes.mjs.map +7 -0
  55. package/dist/esm/getPragmaOptions.mjs +44 -0
  56. package/dist/esm/getPragmaOptions.mjs.map +7 -0
  57. package/dist/esm/helpers/memoize.mjs +22 -0
  58. package/dist/esm/helpers/memoize.mjs.map +7 -0
  59. package/dist/esm/index.mjs +16 -0
  60. package/dist/esm/index.mjs.map +7 -0
  61. package/dist/esm/require.mjs +61 -0
  62. package/dist/esm/require.mjs.map +7 -0
  63. package/dist/esm/types.mjs +1 -0
  64. package/dist/esm/types.mjs.map +7 -0
  65. package/dist/esm/webpackPlugin.mjs +11 -0
  66. package/dist/esm/webpackPlugin.mjs.map +7 -0
  67. package/package.json +14 -14
@@ -0,0 +1,29 @@
1
+ const timer = () => {
2
+ const start = Date.now();
3
+ let last = start;
4
+ return {
5
+ mark: (name, print = false) => {
6
+ if (print) {
7
+ const took = Date.now() - last;
8
+ last = Date.now();
9
+ console.log(`Time ${name}: ${took}ms`);
10
+ if (took > 10) {
11
+ console.log(" long timer");
12
+ }
13
+ }
14
+ },
15
+ done: (print = false) => {
16
+ if (print) {
17
+ const total = Date.now() - start;
18
+ console.log(`Total time: ${total}ms`);
19
+ if (total > 50) {
20
+ console.log(" long timer");
21
+ }
22
+ }
23
+ }
24
+ };
25
+ };
26
+ export {
27
+ timer
28
+ };
29
+ //# sourceMappingURL=timer.mjs.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 // eslint-disable-next-line no-console\n console.log(`Time ${name}: ${took}ms`)\n if (took > 10) {\n // eslint-disable-next-line no-console\n console.log(' long timer')\n }\n }\n },\n done: (print = false) => {\n if (print) {\n const total = Date.now() - start\n // eslint-disable-next-line no-console\n console.log(`Total time: ${total}ms`)\n if (total > 50) {\n // eslint-disable-next-line no-console\n console.log(' long timer')\n }\n }\n },\n }\n}\n"],
5
+ "mappings": "AAAO,MAAM,QAAQ,MAAM;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;AAEhB,gBAAQ,IAAI,QAAQ,SAAS,QAAQ;AACrC,YAAI,OAAO,IAAI;AAEb,kBAAQ,IAAI,cAAc;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAAA,IACA,MAAM,CAAC,QAAQ,UAAU;AACvB,UAAI,OAAO;AACT,cAAM,QAAQ,KAAK,IAAI,IAAI;AAE3B,gBAAQ,IAAI,eAAe,SAAS;AACpC,YAAI,QAAQ,IAAI;AAEd,kBAAQ,IAAI,cAAc;AAAA,QAC5B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,102 @@
1
+ const validHTMLAttributes = {
2
+ autocomplete: true,
3
+ border: true,
4
+ contenteditable: true,
5
+ crossorigin: true,
6
+ dir: true,
7
+ draggable: true,
8
+ enctype: true,
9
+ formenctype: true,
10
+ formmethod: true,
11
+ formtarget: true,
12
+ inputmode: true,
13
+ kind: true,
14
+ link: true,
15
+ method: true,
16
+ preload: true,
17
+ referrerpolicy: true,
18
+ rel: true,
19
+ rev: true,
20
+ role: true,
21
+ sandbox: true,
22
+ shape: true,
23
+ spellcheck: true,
24
+ target: true,
25
+ translate: true,
26
+ type: true,
27
+ wrap: true,
28
+ "aria-autocomplete": true,
29
+ "aria-busy": true,
30
+ "aria-checked": true,
31
+ "aria-current": true,
32
+ "aria-disabled": true,
33
+ "aria-expanded": true,
34
+ "aria-haspopup": true,
35
+ "aria-hidden": true,
36
+ "aria-invalid": true,
37
+ "aria-polite": true,
38
+ "aria-modal": true,
39
+ "aria-multiline": true,
40
+ "aria-multiselectable": true,
41
+ "aria-orientation": true,
42
+ "aria-pressed": true,
43
+ "aria-readonly": true,
44
+ "aria-relevant": true,
45
+ "aria-required": true,
46
+ "aria-selected": true,
47
+ "aria-sort": true
48
+ };
49
+ const validAccessibilityAttributes = {
50
+ accessibilityRole: true,
51
+ accessibilityActiveDescendant: true,
52
+ accessibilityAtomic: true,
53
+ accessibilityAutoComplete: true,
54
+ accessibilityBusy: true,
55
+ accessibilityChecked: true,
56
+ accessibilityColumnCount: true,
57
+ accessibilityColumnIndex: true,
58
+ accessibilityColumnSpan: true,
59
+ accessibilityControls: true,
60
+ accessibilityCurrent: true,
61
+ accessibilityDescribedBy: true,
62
+ accessibilityDetails: true,
63
+ disabled: true,
64
+ accessibilityErrorMessage: true,
65
+ accessibilityExpanded: true,
66
+ accessibilityFlowTo: true,
67
+ accessibilityHasPopup: true,
68
+ accessibilityHidden: true,
69
+ accessibilityInvalid: true,
70
+ accessibilityKeyShortcuts: true,
71
+ accessibilityLabel: true,
72
+ accessibilityLabelledBy: true,
73
+ accessibilityLevel: true,
74
+ accessibilityLiveRegion: true,
75
+ accessibilityModal: true,
76
+ accessibilityMultiline: true,
77
+ accessibilityMultiSelectable: true,
78
+ accessibilityOrientation: true,
79
+ accessibilityOwns: true,
80
+ accessibilityPlaceholder: true,
81
+ accessibilityPosInSet: true,
82
+ accessibilityPressed: true,
83
+ accessibilityReadOnly: true,
84
+ accessibilityRequired: true,
85
+ accessibilityRoleDescription: true,
86
+ accessibilityRowCount: true,
87
+ accessibilityRowIndex: true,
88
+ accessibilityRowSpan: true,
89
+ accessibilitySelected: true,
90
+ accessibilitySetSize: true,
91
+ accessibilitySort: true,
92
+ accessibilityValueMax: true,
93
+ accessibilityValueMin: true,
94
+ accessibilityValueNow: true,
95
+ accessibilityValueText: true,
96
+ nativeID: true
97
+ };
98
+ export {
99
+ validAccessibilityAttributes,
100
+ validHTMLAttributes
101
+ };
102
+ //# sourceMappingURL=validHTMLAttributes.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/extractor/validHTMLAttributes.ts"],
4
+ "sourcesContent": ["export const validHTMLAttributes = {\n autocomplete: true,\n border: true,\n contenteditable: true,\n crossorigin: true,\n dir: true,\n draggable: true,\n enctype: true,\n formenctype: true,\n formmethod: true,\n formtarget: true,\n inputmode: true,\n kind: true,\n link: true,\n method: true,\n preload: true,\n referrerpolicy: true,\n rel: true,\n rev: true,\n role: true,\n sandbox: true,\n shape: true,\n spellcheck: true,\n target: true,\n translate: true,\n type: true,\n wrap: true,\n 'aria-autocomplete': true,\n 'aria-busy': true,\n 'aria-checked': true,\n 'aria-current': true,\n 'aria-disabled': true,\n 'aria-expanded': true,\n 'aria-haspopup': true,\n 'aria-hidden': true,\n 'aria-invalid': true,\n 'aria-polite': true,\n 'aria-modal': true,\n 'aria-multiline': true,\n 'aria-multiselectable': true,\n 'aria-orientation': true,\n 'aria-pressed': true,\n 'aria-readonly': true,\n 'aria-relevant': true,\n 'aria-required': true,\n 'aria-selected': true,\n 'aria-sort': true,\n}\n\n// for moving off react-native-web eventually (unused atm)\nexport const validAccessibilityAttributes = {\n accessibilityRole: true,\n accessibilityActiveDescendant: true,\n accessibilityAtomic: true,\n accessibilityAutoComplete: true,\n accessibilityBusy: true,\n accessibilityChecked: true,\n accessibilityColumnCount: true,\n accessibilityColumnIndex: true,\n accessibilityColumnSpan: true,\n accessibilityControls: true,\n accessibilityCurrent: true,\n accessibilityDescribedBy: true,\n accessibilityDetails: true,\n disabled: true,\n accessibilityErrorMessage: true,\n accessibilityExpanded: true,\n accessibilityFlowTo: true,\n accessibilityHasPopup: true,\n accessibilityHidden: true,\n accessibilityInvalid: true,\n accessibilityKeyShortcuts: true,\n accessibilityLabel: true,\n accessibilityLabelledBy: true,\n accessibilityLevel: true,\n accessibilityLiveRegion: true,\n accessibilityModal: true,\n accessibilityMultiline: true,\n accessibilityMultiSelectable: true,\n accessibilityOrientation: true,\n accessibilityOwns: true,\n accessibilityPlaceholder: true,\n accessibilityPosInSet: true,\n accessibilityPressed: true,\n accessibilityReadOnly: true,\n accessibilityRequired: true,\n accessibilityRoleDescription: true,\n accessibilityRowCount: true,\n accessibilityRowIndex: true,\n accessibilityRowSpan: true,\n accessibilitySelected: true,\n accessibilitySetSize: true,\n accessibilitySort: true,\n accessibilityValueMax: true,\n accessibilityValueMin: true,\n accessibilityValueNow: true,\n accessibilityValueText: true,\n nativeID: true,\n}\n"],
5
+ "mappings": "AAAO,MAAM,sBAAsB;AAAA,EACjC,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,KAAK;AAAA,EACL,WAAW;AAAA,EACX,SAAS;AAAA,EACT,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,KAAK;AAAA,EACL,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,MAAM;AAAA,EACN,MAAM;AAAA,EACN,qBAAqB;AAAA,EACrB,aAAa;AAAA,EACb,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,aAAa;AACf;AAGO,MAAM,+BAA+B;AAAA,EAC1C,mBAAmB;AAAA,EACnB,+BAA+B;AAAA,EAC/B,qBAAqB;AAAA,EACrB,2BAA2B;AAAA,EAC3B,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,sBAAsB;AAAA,EACtB,UAAU;AAAA,EACV,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAC3B,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,oBAAoB;AAAA,EACpB,wBAAwB;AAAA,EACxB,8BAA8B;AAAA,EAC9B,0BAA0B;AAAA,EAC1B,mBAAmB;AAAA,EACnB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,8BAA8B;AAAA,EAC9B,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,UAAU;AACZ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,44 @@
1
+ function getPragmaOptions({
2
+ source,
3
+ path,
4
+ disableCommentCheck
5
+ }) {
6
+ var _a, _b;
7
+ if (!disableCommentCheck && !source.startsWith("//") && !source.startsWith("/*")) {
8
+ return {
9
+ shouldPrintDebug: false,
10
+ shouldDisable: false
11
+ };
12
+ }
13
+ let shouldPrintDebug = false;
14
+ let shouldDisable = false;
15
+ const firstLine = source.slice(0, 800).split("\n")[0];
16
+ if (firstLine.includes("tamagui-ignore")) {
17
+ shouldDisable = true;
18
+ }
19
+ if (firstLine.includes("debug")) {
20
+ shouldPrintDebug = true;
21
+ }
22
+ if (firstLine.includes("debug-verbose")) {
23
+ shouldPrintDebug = "verbose";
24
+ }
25
+ if (process.env.TAMAGUI_DEBUG_FILE) {
26
+ if (path.includes(process.env.TAMAGUI_DEBUG_FILE)) {
27
+ shouldPrintDebug = "verbose";
28
+ }
29
+ }
30
+ if ((_a = process.env.DEBUG) == null ? void 0 : _a.includes("tamagui")) {
31
+ shouldPrintDebug = true;
32
+ }
33
+ if ((_b = process.env.DEBUG) == null ? void 0 : _b.includes("tamagui-verbose")) {
34
+ shouldPrintDebug = "verbose";
35
+ }
36
+ return {
37
+ shouldPrintDebug,
38
+ shouldDisable
39
+ };
40
+ }
41
+ export {
42
+ getPragmaOptions
43
+ };
44
+ //# sourceMappingURL=getPragmaOptions.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/getPragmaOptions.ts"],
4
+ "sourcesContent": ["export function getPragmaOptions({\n source,\n path,\n disableCommentCheck,\n}: {\n source: string\n path: string\n disableCommentCheck?: boolean\n}) {\n if (!disableCommentCheck && !source.startsWith('//') && !source.startsWith('/*')) {\n return {\n shouldPrintDebug: false,\n shouldDisable: false,\n }\n }\n\n let shouldPrintDebug: boolean | 'verbose' = false\n let shouldDisable = false\n\n // try and avoid too much parsing but sometimes esbuild adds helpers above..\n const firstLine = source.slice(0, 800).split('\\n')[0]\n\n if (firstLine.includes('tamagui-ignore')) {\n shouldDisable = true\n }\n\n if (firstLine.includes('debug')) {\n shouldPrintDebug = true\n }\n\n if (firstLine.includes('debug-verbose')) {\n shouldPrintDebug = 'verbose'\n }\n\n if (process.env.TAMAGUI_DEBUG_FILE) {\n if (path.includes(process.env.TAMAGUI_DEBUG_FILE)) {\n shouldPrintDebug = 'verbose'\n }\n }\n\n if (process.env.DEBUG?.includes('tamagui')) {\n shouldPrintDebug = true\n }\n\n if (process.env.DEBUG?.includes('tamagui-verbose')) {\n shouldPrintDebug = 'verbose'\n }\n\n return {\n shouldPrintDebug,\n shouldDisable,\n }\n}\n"],
5
+ "mappings": "AAAO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACF,GAIG;AARH;AASE,MAAI,CAAC,uBAAuB,CAAC,OAAO,WAAW,IAAI,KAAK,CAAC,OAAO,WAAW,IAAI,GAAG;AAChF,WAAO;AAAA,MACL,kBAAkB;AAAA,MAClB,eAAe;AAAA,IACjB;AAAA,EACF;AAEA,MAAI,mBAAwC;AAC5C,MAAI,gBAAgB;AAGpB,QAAM,YAAY,OAAO,MAAM,GAAG,GAAG,EAAE,MAAM,IAAI,EAAE,CAAC;AAEpD,MAAI,UAAU,SAAS,gBAAgB,GAAG;AACxC,oBAAgB;AAAA,EAClB;AAEA,MAAI,UAAU,SAAS,OAAO,GAAG;AAC/B,uBAAmB;AAAA,EACrB;AAEA,MAAI,UAAU,SAAS,eAAe,GAAG;AACvC,uBAAmB;AAAA,EACrB;AAEA,MAAI,QAAQ,IAAI,oBAAoB;AAClC,QAAI,KAAK,SAAS,QAAQ,IAAI,kBAAkB,GAAG;AACjD,yBAAmB;AAAA,IACrB;AAAA,EACF;AAEA,OAAI,aAAQ,IAAI,UAAZ,mBAAmB,SAAS,YAAY;AAC1C,uBAAmB;AAAA,EACrB;AAEA,OAAI,aAAQ,IAAI,UAAZ,mBAAmB,SAAS,oBAAoB;AAClD,uBAAmB;AAAA,EACrB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,22 @@
1
+ function memoize(func, resolver) {
2
+ if (typeof func !== "function" || resolver != null && typeof resolver !== "function") {
3
+ throw new TypeError("Expected a function");
4
+ }
5
+ const memoized = function(...args) {
6
+ const key = resolver ? resolver.apply(this, args) : args[0];
7
+ const cache = memoized.cache;
8
+ if (cache.has(key)) {
9
+ return cache.get(key);
10
+ }
11
+ const result = func.apply(this, args);
12
+ memoized.cache = cache.set(key, result) || cache;
13
+ return result;
14
+ };
15
+ memoized.cache = new (memoize.Cache || Map)();
16
+ return memoized;
17
+ }
18
+ memoize.Cache = Map;
19
+ export {
20
+ memoize
21
+ };
22
+ //# sourceMappingURL=memoize.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/helpers/memoize.ts"],
4
+ "sourcesContent": ["// @ts-nocheck\nexport function memoize(func?: Function, resolver?: any) {\n if (typeof func !== 'function' || (resolver != null && typeof resolver !== 'function')) {\n throw new TypeError('Expected a function')\n }\n const memoized = function (...args) {\n const key = resolver ? resolver.apply(this, args) : args[0]\n const cache = memoized.cache\n\n if (cache.has(key)) {\n return cache.get(key)\n }\n const result = func.apply(this, args)\n memoized.cache = cache.set(key, result) || cache\n return result\n }\n memoized.cache = new (memoize.Cache || Map)()\n return memoized\n}\n\nmemoize.Cache = Map\n"],
5
+ "mappings": "AACO,SAAS,QAAQ,MAAiB,UAAgB;AACvD,MAAI,OAAO,SAAS,cAAe,YAAY,QAAQ,OAAO,aAAa,YAAa;AACtF,UAAM,IAAI,UAAU,qBAAqB;AAAA,EAC3C;AACA,QAAM,WAAW,YAAa,MAAM;AAClC,UAAM,MAAM,WAAW,SAAS,MAAM,MAAM,IAAI,IAAI,KAAK,CAAC;AAC1D,UAAM,QAAQ,SAAS;AAEvB,QAAI,MAAM,IAAI,GAAG,GAAG;AAClB,aAAO,MAAM,IAAI,GAAG;AAAA,IACtB;AACA,UAAM,SAAS,KAAK,MAAM,MAAM,IAAI;AACpC,aAAS,QAAQ,MAAM,IAAI,KAAK,MAAM,KAAK;AAC3C,WAAO;AAAA,EACT;AACA,WAAS,QAAQ,KAAK,QAAQ,SAAS,KAAK;AAC5C,SAAO;AACT;AAEA,QAAQ,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,16 @@
1
+ process.env.TAMAGUI_COMPILE_PROCESS = "1";
2
+ import { TamaguiOptions } from "./types.js";
3
+ import { createExtractor } from "./extractor/createExtractor.js";
4
+ import { literalToAst } from "./extractor/literalToAst.js";
5
+ export * from "./constants.js";
6
+ export * from "./extractor/extractToClassNames.js";
7
+ export * from "./extractor/extractHelpers.js";
8
+ export * from "./extractor/loadTamagui.js";
9
+ export * from "./require.js";
10
+ export * from "./getPragmaOptions.js";
11
+ export {
12
+ TamaguiOptions,
13
+ createExtractor,
14
+ literalToAst
15
+ };
16
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["process.env.TAMAGUI_COMPILE_PROCESS = '1'\n\nexport { TamaguiOptions } from './types.js'\nexport { createExtractor } from './extractor/createExtractor.js'\nexport { literalToAst } from './extractor/literalToAst.js'\nexport * from './constants.js'\nexport * from './extractor/extractToClassNames.js'\nexport * from './extractor/extractHelpers.js'\nexport * from './extractor/loadTamagui.js'\nexport * from './require.js'\nexport * from './getPragmaOptions.js'\n"],
5
+ "mappings": "AAAA,QAAQ,IAAI,0BAA0B;AAEtC,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1,61 @@
1
+ import { relative, sep } from "path";
2
+ const nameToPaths = {};
3
+ const Module = require("module");
4
+ const og = Module.prototype.require;
5
+ globalThis["ogRequire"] = og;
6
+ const getNameToPaths = () => nameToPaths;
7
+ function registerRequire() {
8
+ if (Module.prototype.require !== globalThis["ogRequire"]) {
9
+ console.warn("didnt unregister before re-registering");
10
+ process.exit(1);
11
+ }
12
+ const proxyWorm = require("@tamagui/proxy-worm");
13
+ const rnw = require("react-native-web");
14
+ const core = require("@tamagui/core-node");
15
+ Module.prototype.require = function(path) {
16
+ var _a;
17
+ if (/\.(gif|jpe?g|png|svg|ttf|otf|woff2?|bmp|webp)$/.test(path)) {
18
+ return {};
19
+ }
20
+ if (path === "@gorhom/bottom-sheet" || path.startsWith("react-native-reanimated") || path === "expo-linear-gradient" || path === "@expo/vector-icons") {
21
+ return proxyWorm;
22
+ }
23
+ if (path.startsWith("react-native") && // allow our rnw.tsx imports through
24
+ !path.startsWith("react-native-web/dist/cjs/exports".replace(/\//g, sep))) {
25
+ return rnw;
26
+ }
27
+ if (path === "@tamagui/core") {
28
+ return core;
29
+ }
30
+ try {
31
+ const out = og.apply(this, arguments);
32
+ return out;
33
+ } catch (err) {
34
+ if ((_a = process.env.DEBUG) == null ? void 0 : _a.startsWith("tamagui")) {
35
+ console.error(
36
+ `Tamagui failed loading the pre-built tamagui.config.ts
37
+
38
+ ${err.message}
39
+ ${err.stack}
40
+
41
+ You can see if it loads in the node repl:
42
+
43
+ require("./${relative(process.cwd(), path)}").default
44
+
45
+ `
46
+ );
47
+ }
48
+ return proxyWorm;
49
+ }
50
+ };
51
+ return Module.prototype.require;
52
+ }
53
+ function unregisterRequire() {
54
+ Module.prototype.require = og;
55
+ }
56
+ export {
57
+ getNameToPaths,
58
+ registerRequire,
59
+ unregisterRequire
60
+ };
61
+ //# sourceMappingURL=require.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/require.ts"],
4
+ "sourcesContent": ["import { relative, sep } from 'path'\n\nimport { SHOULD_DEBUG } from './constants.js'\n\nconst nameToPaths = {}\nconst Module = require('module')\nconst og = Module.prototype.require\nglobalThis['ogRequire'] = og\n\nexport const getNameToPaths = () => nameToPaths\n\nexport function registerRequire() {\n if (Module.prototype.require !== globalThis['ogRequire']) {\n // eslint-disable-next-line no-console\n console.warn('didnt unregister before re-registering')\n process.exit(1)\n }\n\n const proxyWorm = require('@tamagui/proxy-worm')\n // TODO can swap with react-native-web-lite\n const rnw = require('react-native-web')\n const core = require('@tamagui/core-node')\n\n Module.prototype.require = function (path: string) {\n if (/\\.(gif|jpe?g|png|svg|ttf|otf|woff2?|bmp|webp)$/.test(path)) {\n return {}\n }\n if (\n path === '@gorhom/bottom-sheet' ||\n path.startsWith('react-native-reanimated') ||\n path === 'expo-linear-gradient' ||\n path === '@expo/vector-icons'\n ) {\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'.replace(/\\//g, sep))\n ) {\n return rnw\n }\n if (path === '@tamagui/core') {\n return core\n }\n try {\n const out = og.apply(this, arguments)\n // only for studio disable for now\n // if (!nameToPaths[path]) {\n // if (out && typeof out === 'object') {\n // for (const key in out) {\n // try {\n // const conf = out[key]?.staticConfig as StaticConfig\n // if (conf) {\n // if (conf.componentName) {\n // nameToPaths[conf.componentName] ??= new Set()\n // const fullName = path.startsWith('.')\n // ? join(`${this.path.replace(/dist(\\/cjs)?/, 'src')}`, path)\n // : path\n // nameToPaths[conf.componentName].add(fullName)\n // } else {\n // // console.log('no name component', path)\n // }\n // }\n // } catch {\n // // ok\n // }\n // }\n // }\n // }\n return out\n } catch (err: any) {\n /**\n * Allow errors to happen, we're just reading config and components but sometimes external modules cause problems\n * We can't fix every problem, so just swap them out with proxyWorm which is a sort of generic object that can be read.\n */\n\n if (process.env.DEBUG?.startsWith('tamagui')) {\n // eslint-disable-next-line no-console\n console.error(\n `Tamagui failed loading the pre-built tamagui.config.ts\n \n ${err.message}\n ${err.stack}\n \n You can see if it loads in the node repl:\n \n require(\"./${relative(process.cwd(), path)}\").default\n \n `\n )\n }\n\n return proxyWorm\n }\n }\n\n return Module.prototype.require\n}\n\nexport function unregisterRequire() {\n Module.prototype.require = og\n}\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,WAAW;AAI9B,MAAM,cAAc,CAAC;AACrB,MAAM,SAAS,QAAQ,QAAQ;AAC/B,MAAM,KAAK,OAAO,UAAU;AAC5B,WAAW,WAAW,IAAI;AAEnB,MAAM,iBAAiB,MAAM;AAE7B,SAAS,kBAAkB;AAChC,MAAI,OAAO,UAAU,YAAY,WAAW,WAAW,GAAG;AAExD,YAAQ,KAAK,wCAAwC;AACrD,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,QAAM,YAAY,QAAQ,qBAAqB;AAE/C,QAAM,MAAM,QAAQ,kBAAkB;AACtC,QAAM,OAAO,QAAQ,oBAAoB;AAEzC,SAAO,UAAU,UAAU,SAAU,MAAc;AAvBrD;AAwBI,QAAI,iDAAiD,KAAK,IAAI,GAAG;AAC/D,aAAO,CAAC;AAAA,IACV;AACA,QACE,SAAS,0BACT,KAAK,WAAW,yBAAyB,KACzC,SAAS,0BACT,SAAS,sBACT;AACA,aAAO;AAAA,IACT;AACA,QACE,KAAK,WAAW,cAAc;AAAA,IAE9B,CAAC,KAAK,WAAW,oCAAoC,QAAQ,OAAO,GAAG,CAAC,GACxE;AACA,aAAO;AAAA,IACT;AACA,QAAI,SAAS,iBAAiB;AAC5B,aAAO;AAAA,IACT;AACA,QAAI;AACF,YAAM,MAAM,GAAG,MAAM,MAAM,SAAS;AAwBpC,aAAO;AAAA,IACT,SAAS,KAAP;AAMA,WAAI,aAAQ,IAAI,UAAZ,mBAAmB,WAAW,YAAY;AAE5C,gBAAQ;AAAA,UACN;AAAA;AAAA,IAEN,IAAI;AAAA,IACJ,IAAI;AAAA;AAAA;AAAA;AAAA,iBAIS,SAAS,QAAQ,IAAI,GAAG,IAAI;AAAA;AAAA;AAAA,QAGrC;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,OAAO,UAAU;AAC1B;AAEO,SAAS,oBAAoB;AAClC,SAAO,UAAU,UAAU;AAC7B;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ const pluginName = "TamaguiWebpackPlugin";
2
+ class TamaguiWebpackPlugin {
3
+ apply(compiler) {
4
+ compiler.hooks.run.tap(pluginName, (compilation) => {
5
+ });
6
+ }
7
+ }
8
+ export {
9
+ TamaguiWebpackPlugin
10
+ };
11
+ //# sourceMappingURL=webpackPlugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/webpackPlugin.ts"],
4
+ "sourcesContent": ["const pluginName = 'TamaguiWebpackPlugin'\n\nexport class TamaguiWebpackPlugin {\n apply(compiler) {\n compiler.hooks.run.tap(pluginName, (compilation) => {\n // console.log('The webpack build process is starting!');\n })\n }\n}\n"],
5
+ "mappings": "AAAA,MAAM,aAAa;AAEZ,MAAM,qBAAqB;AAAA,EAChC,MAAM,UAAU;AACd,aAAS,MAAM,IAAI,IAAI,YAAY,CAAC,gBAAgB;AAAA,IAEpD,CAAC;AAAA,EACH;AACF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/static",
3
- "version": "1.2.9",
3
+ "version": "1.2.10",
4
4
  "source": "src/index.ts",
5
5
  "types": "./types/index.d.ts",
6
6
  "main": "dist/cjs/index.js",
@@ -35,16 +35,16 @@
35
35
  "@babel/runtime": "^7.19.4",
36
36
  "@babel/traverse": "^7.19.6",
37
37
  "@expo/match-media": "^0.3.0",
38
- "@tamagui/build": "^1.2.9",
39
- "@tamagui/cli-color": "^1.2.9",
40
- "@tamagui/config-default-node": "^1.2.9",
41
- "@tamagui/core-node": "^1.2.9",
42
- "@tamagui/fake-react-native": "^1.2.9",
43
- "@tamagui/helpers": "^1.2.9",
44
- "@tamagui/helpers-node": "^1.2.9",
45
- "@tamagui/proxy-worm": "^1.2.9",
46
- "@tamagui/shorthands": "^1.2.9",
47
- "@tamagui/types": "^1.2.9",
38
+ "@tamagui/build": "^1.2.10",
39
+ "@tamagui/cli-color": "^1.2.10",
40
+ "@tamagui/config-default-node": "^1.2.10",
41
+ "@tamagui/core-node": "^1.2.10",
42
+ "@tamagui/fake-react-native": "^1.2.10",
43
+ "@tamagui/helpers": "^1.2.10",
44
+ "@tamagui/helpers-node": "^1.2.10",
45
+ "@tamagui/proxy-worm": "^1.2.10",
46
+ "@tamagui/shorthands": "^1.2.10",
47
+ "@tamagui/types": "^1.2.10",
48
48
  "babel-literal-to-ast": "^2.1.0",
49
49
  "esbuild": "^0.17.5",
50
50
  "esbuild-register": "^3.4.2",
@@ -53,14 +53,14 @@
53
53
  "fs-extra": "^11.1.0",
54
54
  "invariant": "^2.2.4",
55
55
  "lodash": "^4.17.21",
56
- "react-native-web-internals": "^1.2.9",
57
- "react-native-web-lite": "^1.2.9"
56
+ "react-native-web-internals": "^1.2.10",
57
+ "react-native-web-lite": "^1.2.10"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@babel/plugin-syntax-typescript": "^7.18.6",
61
61
  "@babel/types": "^7.19.4",
62
62
  "@dish/babel-preset": "^0.0.6",
63
- "@tamagui/test-design-system": "^1.2.9",
63
+ "@tamagui/test-design-system": "^1.2.10",
64
64
  "@testing-library/react": "^13.4.0",
65
65
  "@types/babel__generator": "^7.6.4",
66
66
  "@types/babel__traverse": "^7.18.2",