@tamagui/static 1.89.26 → 1.89.27-1708113113238
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/constants.native.js +4 -4
- package/dist/cjs/constants.native.js.map +3 -3
- package/dist/cjs/extractor/accessSafe.native.js +1 -5
- package/dist/cjs/extractor/accessSafe.native.js.map +3 -3
- package/dist/cjs/extractor/babelParse.native.js +5 -8
- package/dist/cjs/extractor/babelParse.native.js.map +3 -3
- package/dist/cjs/extractor/buildClassName.native.js +31 -42
- package/dist/cjs/extractor/buildClassName.native.js.map +3 -3
- package/dist/cjs/extractor/bundle.js +6 -4
- package/dist/cjs/extractor/bundle.js.map +1 -1
- package/dist/cjs/extractor/bundle.native.js +321 -56
- package/dist/cjs/extractor/bundle.native.js.map +3 -3
- package/dist/cjs/extractor/bundleConfig.native.js +499 -187
- package/dist/cjs/extractor/bundleConfig.native.js.map +3 -3
- package/dist/cjs/extractor/createEvaluator.native.js +9 -11
- package/dist/cjs/extractor/createEvaluator.native.js.map +3 -3
- package/dist/cjs/extractor/createExtractor.native.js +1240 -906
- package/dist/cjs/extractor/createExtractor.native.js.map +3 -3
- package/dist/cjs/extractor/ensureImportingConcat.native.js +11 -17
- package/dist/cjs/extractor/ensureImportingConcat.native.js.map +3 -3
- package/dist/cjs/extractor/esbuildAliasPlugin.native.js +22 -11
- package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +3 -3
- package/dist/cjs/extractor/evaluateAstNode.native.js +15 -21
- package/dist/cjs/extractor/evaluateAstNode.native.js.map +3 -3
- package/dist/cjs/extractor/extractHelpers.native.js +146 -38
- package/dist/cjs/extractor/extractHelpers.native.js.map +3 -3
- package/dist/cjs/extractor/extractMediaStyle.native.js +127 -54
- package/dist/cjs/extractor/extractMediaStyle.native.js.map +3 -3
- package/dist/cjs/extractor/extractToClassNames.native.js +449 -252
- package/dist/cjs/extractor/extractToClassNames.native.js.map +3 -3
- package/dist/cjs/extractor/findTopmostFunction.native.js +4 -4
- package/dist/cjs/extractor/findTopmostFunction.native.js.map +3 -3
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +415 -54
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
- package/dist/cjs/extractor/generatedUid.native.js +2 -2
- package/dist/cjs/extractor/generatedUid.native.js.map +3 -3
- package/dist/cjs/extractor/getPrefixLogs.native.js +2 -1
- package/dist/cjs/extractor/getPrefixLogs.native.js.map +3 -3
- package/dist/cjs/extractor/getPropValueFromAttributes.native.js +16 -19
- package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +3 -3
- package/dist/cjs/extractor/getSourceModule.native.js +20 -7
- package/dist/cjs/extractor/getSourceModule.native.js.map +3 -3
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js +336 -94
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +3 -3
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
- package/dist/cjs/extractor/hoistClassNames.native.js +8 -10
- package/dist/cjs/extractor/hoistClassNames.native.js.map +3 -3
- package/dist/cjs/extractor/literalToAst.native.js +89 -19
- package/dist/cjs/extractor/literalToAst.native.js.map +3 -3
- package/dist/cjs/extractor/loadFile.native.js +16 -8
- package/dist/cjs/extractor/loadFile.native.js.map +3 -3
- package/dist/cjs/extractor/loadTamagui.js +3 -3
- package/dist/cjs/extractor/loadTamagui.js.map +1 -1
- package/dist/cjs/extractor/loadTamagui.native.js +667 -192
- package/dist/cjs/extractor/loadTamagui.native.js.map +3 -3
- package/dist/cjs/extractor/logLines.native.js +24 -6
- package/dist/cjs/extractor/logLines.native.js.map +3 -3
- package/dist/cjs/extractor/normalizeTernaries.native.js +71 -20
- package/dist/cjs/extractor/normalizeTernaries.native.js.map +3 -3
- package/dist/cjs/extractor/propsToFontFamilyCache.native.js +3 -3
- package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +3 -3
- package/dist/cjs/extractor/removeUnusedHooks.native.js +69 -36
- package/dist/cjs/extractor/removeUnusedHooks.native.js.map +3 -3
- package/dist/cjs/extractor/timer.native.js +10 -9
- package/dist/cjs/extractor/timer.native.js.map +3 -3
- package/dist/cjs/extractor/validHTMLAttributes.native.js +1 -1
- package/dist/cjs/extractor/validHTMLAttributes.native.js.map +3 -3
- package/dist/cjs/getPragmaOptions.native.js +4 -9
- package/dist/cjs/getPragmaOptions.native.js.map +3 -3
- package/dist/cjs/helpers/memoize.native.js +5 -3
- package/dist/cjs/helpers/memoize.native.js.map +3 -3
- package/dist/cjs/helpers/requireTamaguiCore.native.js +2 -1
- package/dist/cjs/helpers/requireTamaguiCore.native.js.map +3 -3
- package/dist/cjs/index.native.js.map +2 -2
- package/dist/cjs/minifyCSS.native.js.map +3 -3
- package/dist/cjs/registerRequire.native.js +56 -28
- package/dist/cjs/registerRequire.native.js.map +3 -3
- package/dist/cjs/server.native.js +175 -21
- package/dist/cjs/server.native.js.map +3 -3
- package/dist/cjs/setup.native.js.map +3 -3
- package/dist/cjs/static.native.js.map +2 -2
- package/dist/cjs/types.native.js.map +2 -2
- package/dist/cjs/webpackPlugin.native.js +26 -5
- package/dist/cjs/webpackPlugin.native.js.map +3 -3
- package/dist/esm/constants.native.js +4 -3
- package/dist/esm/constants.native.js.map +3 -3
- package/dist/esm/extractor/accessSafe.native.js +1 -5
- package/dist/esm/extractor/accessSafe.native.js.map +3 -3
- package/dist/esm/extractor/babelParse.native.js +5 -7
- package/dist/esm/extractor/babelParse.native.js.map +3 -3
- package/dist/esm/extractor/buildClassName.native.js +31 -41
- package/dist/esm/extractor/buildClassName.native.js.map +3 -3
- package/dist/esm/extractor/bundle.js +6 -4
- package/dist/esm/extractor/bundle.js.map +1 -1
- package/dist/esm/extractor/bundle.mjs +7 -5
- package/dist/esm/extractor/bundle.native.js +321 -56
- package/dist/esm/extractor/bundle.native.js.map +3 -3
- package/dist/esm/extractor/bundleConfig.native.js +499 -187
- package/dist/esm/extractor/bundleConfig.native.js.map +3 -3
- package/dist/esm/extractor/createEvaluator.native.js +9 -11
- package/dist/esm/extractor/createEvaluator.native.js.map +3 -3
- package/dist/esm/extractor/createExtractor.native.js +1241 -916
- package/dist/esm/extractor/createExtractor.native.js.map +3 -3
- package/dist/esm/extractor/ensureImportingConcat.native.js +11 -16
- package/dist/esm/extractor/ensureImportingConcat.native.js.map +3 -3
- package/dist/esm/extractor/esbuildAliasPlugin.native.js +22 -11
- package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +3 -3
- package/dist/esm/extractor/evaluateAstNode.native.js +15 -21
- package/dist/esm/extractor/evaluateAstNode.native.js.map +3 -3
- package/dist/esm/extractor/extractHelpers.native.js +146 -38
- package/dist/esm/extractor/extractHelpers.native.js.map +3 -3
- package/dist/esm/extractor/extractMediaStyle.native.js +127 -54
- package/dist/esm/extractor/extractMediaStyle.native.js.map +3 -3
- package/dist/esm/extractor/extractToClassNames.native.js +449 -252
- package/dist/esm/extractor/extractToClassNames.native.js.map +3 -3
- package/dist/esm/extractor/findTopmostFunction.native.js +4 -4
- package/dist/esm/extractor/findTopmostFunction.native.js.map +3 -3
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +415 -54
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +3 -3
- package/dist/esm/extractor/generatedUid.native.js +2 -2
- package/dist/esm/extractor/generatedUid.native.js.map +3 -3
- package/dist/esm/extractor/getPrefixLogs.native.js +2 -1
- package/dist/esm/extractor/getPrefixLogs.native.js.map +3 -3
- package/dist/esm/extractor/getPropValueFromAttributes.native.js +16 -19
- package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +3 -3
- package/dist/esm/extractor/getSourceModule.native.js +20 -7
- package/dist/esm/extractor/getSourceModule.native.js.map +3 -3
- package/dist/esm/extractor/getStaticBindingsForScope.native.js +336 -94
- package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +3 -3
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +3 -3
- package/dist/esm/extractor/hoistClassNames.native.js +8 -10
- package/dist/esm/extractor/hoistClassNames.native.js.map +3 -3
- package/dist/esm/extractor/literalToAst.native.js +89 -19
- package/dist/esm/extractor/literalToAst.native.js.map +3 -3
- package/dist/esm/extractor/loadFile.native.js +16 -8
- package/dist/esm/extractor/loadFile.native.js.map +3 -3
- package/dist/esm/extractor/loadTamagui.js +1 -2
- package/dist/esm/extractor/loadTamagui.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.mjs +5 -3
- package/dist/esm/extractor/loadTamagui.native.js +668 -203
- package/dist/esm/extractor/loadTamagui.native.js.map +3 -3
- package/dist/esm/extractor/logLines.native.js +24 -6
- package/dist/esm/extractor/logLines.native.js.map +3 -3
- package/dist/esm/extractor/normalizeTernaries.native.js +71 -20
- package/dist/esm/extractor/normalizeTernaries.native.js.map +3 -3
- package/dist/esm/extractor/propsToFontFamilyCache.native.js +3 -3
- package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +3 -3
- package/dist/esm/extractor/removeUnusedHooks.native.js +69 -35
- package/dist/esm/extractor/removeUnusedHooks.native.js.map +3 -3
- package/dist/esm/extractor/timer.native.js +10 -9
- package/dist/esm/extractor/timer.native.js.map +3 -3
- package/dist/esm/extractor/validHTMLAttributes.native.js +1 -1
- package/dist/esm/extractor/validHTMLAttributes.native.js.map +3 -3
- package/dist/esm/getPragmaOptions.native.js +4 -9
- package/dist/esm/getPragmaOptions.native.js.map +3 -3
- package/dist/esm/helpers/memoize.native.js +5 -3
- package/dist/esm/helpers/memoize.native.js.map +3 -3
- package/dist/esm/helpers/requireTamaguiCore.native.js +2 -1
- package/dist/esm/helpers/requireTamaguiCore.native.js.map +3 -3
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/minifyCSS.native.js.map +3 -3
- package/dist/esm/registerRequire.native.js +56 -28
- package/dist/esm/registerRequire.native.js.map +3 -3
- package/dist/esm/server.native.js +175 -21
- package/dist/esm/server.native.js.map +3 -3
- package/dist/esm/setup.native.js.map +3 -3
- package/dist/esm/static.native.js.map +3 -3
- package/dist/esm/webpackPlugin.native.js +26 -5
- package/dist/esm/webpackPlugin.native.js.map +3 -3
- package/package.json +14 -15
- package/src/extractor/bundle.ts +5 -2
- package/src/extractor/loadTamagui.ts +3 -2
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/tamagui.tsconfig.json +0 -5
@@ -3,16 +3,154 @@ import { dirname, extname, join, resolve } from "path";
|
|
3
3
|
import * as t from "@babel/types";
|
4
4
|
import { evaluateAstNode } from "./evaluateAstNode";
|
5
5
|
import { getSourceModule } from "./getSourceModule";
|
6
|
-
|
6
|
+
function asyncGeneratorStep(gen, resolve2, reject, _next, _throw, key, arg) {
|
7
|
+
try {
|
8
|
+
var info = gen[key](arg), value = info.value;
|
9
|
+
} catch (error) {
|
10
|
+
reject(error);
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
info.done ? resolve2(value) : Promise.resolve(value).then(_next, _throw);
|
14
|
+
}
|
15
|
+
function _async_to_generator(fn) {
|
16
|
+
return function() {
|
17
|
+
var self = this, args = arguments;
|
18
|
+
return new Promise(function(resolve2, reject) {
|
19
|
+
var gen = fn.apply(self, args);
|
20
|
+
function _next(value) {
|
21
|
+
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "next", value);
|
22
|
+
}
|
23
|
+
function _throw(err) {
|
24
|
+
asyncGeneratorStep(gen, resolve2, reject, _next, _throw, "throw", err);
|
25
|
+
}
|
26
|
+
_next(void 0);
|
27
|
+
});
|
28
|
+
};
|
29
|
+
}
|
30
|
+
function _type_of(obj) {
|
31
|
+
"@swc/helpers - typeof";
|
32
|
+
return obj && typeof Symbol < "u" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
33
|
+
}
|
34
|
+
function _ts_generator(thisArg, body) {
|
35
|
+
var f, y, t2, g, _ = {
|
36
|
+
label: 0,
|
37
|
+
sent: function() {
|
38
|
+
if (t2[0] & 1)
|
39
|
+
throw t2[1];
|
40
|
+
return t2[1];
|
41
|
+
},
|
42
|
+
trys: [],
|
43
|
+
ops: []
|
44
|
+
};
|
45
|
+
return g = {
|
46
|
+
next: verb(0),
|
47
|
+
throw: verb(1),
|
48
|
+
return: verb(2)
|
49
|
+
}, typeof Symbol == "function" && (g[Symbol.iterator] = function() {
|
50
|
+
return this;
|
51
|
+
}), g;
|
52
|
+
function verb(n) {
|
53
|
+
return function(v) {
|
54
|
+
return step([
|
55
|
+
n,
|
56
|
+
v
|
57
|
+
]);
|
58
|
+
};
|
59
|
+
}
|
60
|
+
function step(op) {
|
61
|
+
if (f)
|
62
|
+
throw new TypeError("Generator is already executing.");
|
63
|
+
for (; _; )
|
64
|
+
try {
|
65
|
+
if (f = 1, y && (t2 = op[0] & 2 ? y.return : op[0] ? y.throw || ((t2 = y.return) && t2.call(y), 0) : y.next) && !(t2 = t2.call(y, op[1])).done)
|
66
|
+
return t2;
|
67
|
+
switch (y = 0, t2 && (op = [
|
68
|
+
op[0] & 2,
|
69
|
+
t2.value
|
70
|
+
]), op[0]) {
|
71
|
+
case 0:
|
72
|
+
case 1:
|
73
|
+
t2 = op;
|
74
|
+
break;
|
75
|
+
case 4:
|
76
|
+
return _.label++, {
|
77
|
+
value: op[1],
|
78
|
+
done: !1
|
79
|
+
};
|
80
|
+
case 5:
|
81
|
+
_.label++, y = op[1], op = [
|
82
|
+
0
|
83
|
+
];
|
84
|
+
continue;
|
85
|
+
case 7:
|
86
|
+
op = _.ops.pop(), _.trys.pop();
|
87
|
+
continue;
|
88
|
+
default:
|
89
|
+
if (t2 = _.trys, !(t2 = t2.length > 0 && t2[t2.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
90
|
+
_ = 0;
|
91
|
+
continue;
|
92
|
+
}
|
93
|
+
if (op[0] === 3 && (!t2 || op[1] > t2[0] && op[1] < t2[3])) {
|
94
|
+
_.label = op[1];
|
95
|
+
break;
|
96
|
+
}
|
97
|
+
if (op[0] === 6 && _.label < t2[1]) {
|
98
|
+
_.label = t2[1], t2 = op;
|
99
|
+
break;
|
100
|
+
}
|
101
|
+
if (t2 && _.label < t2[2]) {
|
102
|
+
_.label = t2[2], _.ops.push(op);
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
t2[2] && _.ops.pop(), _.trys.pop();
|
106
|
+
continue;
|
107
|
+
}
|
108
|
+
op = body.call(thisArg, _);
|
109
|
+
} catch (e) {
|
110
|
+
op = [
|
111
|
+
6,
|
112
|
+
e
|
113
|
+
], y = 0;
|
114
|
+
} finally {
|
115
|
+
f = t2 = 0;
|
116
|
+
}
|
117
|
+
if (op[0] & 5)
|
118
|
+
throw op[1];
|
119
|
+
return {
|
120
|
+
value: op[0] ? op[1] : void 0,
|
121
|
+
done: !0
|
122
|
+
};
|
123
|
+
}
|
124
|
+
}
|
125
|
+
function _ts_values(o) {
|
126
|
+
var s = typeof Symbol == "function" && Symbol.iterator, m = s && o[s], i = 0;
|
127
|
+
if (m)
|
128
|
+
return m.call(o);
|
129
|
+
if (o && typeof o.length == "number")
|
130
|
+
return {
|
131
|
+
next: function() {
|
132
|
+
return o && i >= o.length && (o = void 0), {
|
133
|
+
value: o && o[i++],
|
134
|
+
done: !o
|
135
|
+
};
|
136
|
+
}
|
137
|
+
};
|
138
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
139
|
+
}
|
140
|
+
var isLocalImport = function(path) {
|
141
|
+
return path.startsWith(".") || path.startsWith("/");
|
142
|
+
};
|
7
143
|
function resolveImportPath(sourcePath, path) {
|
8
|
-
|
144
|
+
var sourceDir = dirname(sourcePath);
|
9
145
|
return isLocalImport(path) ? (extname(path) === "" && (path += ".js"), resolve(sourceDir, path)) : path;
|
10
146
|
}
|
11
|
-
|
12
|
-
let exited = !1, child = null;
|
147
|
+
var cache = /* @__PURE__ */ new Map(), pending = /* @__PURE__ */ new Map(), loadCmd = "".concat(join(__dirname, "loadFile.js")), exited = !1, child = null;
|
13
148
|
function forkChild() {
|
14
149
|
child = fork(loadCmd, [], {
|
15
|
-
execArgv: [
|
150
|
+
execArgv: [
|
151
|
+
"-r",
|
152
|
+
"esbuild-register"
|
153
|
+
],
|
16
154
|
detached: !1,
|
17
155
|
stdio: "ignore"
|
18
156
|
});
|
@@ -26,100 +164,204 @@ process.once("beforeExit", cleanupBeforeExit);
|
|
26
164
|
function importModule(path) {
|
27
165
|
if (child || forkChild(), pending.has(path))
|
28
166
|
return pending.get(path);
|
29
|
-
|
30
|
-
if (
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
167
|
+
var promise = new Promise(function(res, rej) {
|
168
|
+
if (child) {
|
169
|
+
if (cache.size > 2e3 && cache.clear(), cache.has(path))
|
170
|
+
return cache.get(path);
|
171
|
+
var listener = function(msg) {
|
172
|
+
if (child && msg && typeof msg == "string") {
|
173
|
+
if (msg[0] === "-") {
|
174
|
+
rej(new Error(msg.slice(1)));
|
175
|
+
return;
|
176
|
+
}
|
177
|
+
child.removeListener("message", listener);
|
178
|
+
var val = JSON.parse(msg);
|
179
|
+
cache.set(path, val), res(val);
|
180
|
+
}
|
181
|
+
};
|
182
|
+
child.once("message", listener), child.send("".concat(path.replace(".js", "")));
|
183
|
+
}
|
46
184
|
});
|
47
185
|
return pending.set(path, promise), promise;
|
48
186
|
}
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
187
|
+
function getStaticBindingsForScope(scope) {
|
188
|
+
return _getStaticBindingsForScope.apply(this, arguments);
|
189
|
+
}
|
190
|
+
function _getStaticBindingsForScope() {
|
191
|
+
return _getStaticBindingsForScope = _async_to_generator(function(scope) {
|
192
|
+
var _loop, whitelist, sourcePath, bindingCache, shouldPrintDebug, bindings, ret, program, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _loop1, _iterator, _step, err, k, _ret, _arguments = arguments;
|
193
|
+
return _ts_generator(this, function(_state) {
|
194
|
+
switch (_state.label) {
|
195
|
+
case 0:
|
196
|
+
_loop = function(k3) {
|
197
|
+
var binding = bindings[k3], sourceModule = getSourceModule(k3, binding);
|
198
|
+
if (sourceModule) {
|
199
|
+
if (!sourceModule.sourceModule)
|
200
|
+
return "continue";
|
201
|
+
var moduleName = resolveImportPath(sourcePath, sourceModule.sourceModule), isOnWhitelist = whitelist.some(function(test) {
|
202
|
+
return moduleName.endsWith(test);
|
203
|
+
});
|
204
|
+
if (isOnWhitelist) {
|
205
|
+
var src = importModule(moduleName);
|
206
|
+
if (!src)
|
207
|
+
return console.info(" | \u26A0\uFE0F Missing file ".concat(moduleName, " via ").concat(sourcePath, " import ").concat(sourceModule.sourceModule, "?")), {
|
208
|
+
v: {}
|
209
|
+
};
|
210
|
+
sourceModule.destructured ? sourceModule.imported && (ret[k3] = src[sourceModule.imported]) : ret[k3] = src;
|
211
|
+
}
|
212
|
+
return "continue";
|
213
|
+
}
|
214
|
+
var parent = binding.path.parent;
|
215
|
+
if (!t.isVariableDeclaration(parent) || parent.kind !== "const")
|
216
|
+
return "continue";
|
217
|
+
var dec = parent.declarations.find(function(d) {
|
218
|
+
return t.isIdentifier(d.id) && d.id.name === k3;
|
219
|
+
});
|
220
|
+
if (!dec || !dec.init)
|
221
|
+
return "continue";
|
222
|
+
if (typeof dec.id.start != "number" || typeof dec.id.end != "number")
|
223
|
+
return console.error("dec.id.start/end is not a number"), "continue";
|
224
|
+
if (!t.isIdentifier(dec.id))
|
225
|
+
return console.error("dec is not an identifier"), "continue";
|
226
|
+
var cacheKey = "".concat(dec.id.name, "_").concat(dec.id.start, "-").concat(dec.id.end);
|
227
|
+
if (Object.hasOwnProperty.call(bindingCache, cacheKey) || Object.hasOwnProperty.call(bindingCache, cacheKey))
|
228
|
+
return ret[k3] = bindingCache[cacheKey], "continue";
|
229
|
+
try {
|
230
|
+
return ret[k3] = evaluateAstNode(dec.init, void 0, shouldPrintDebug), bindingCache[cacheKey] = ret[k3], "continue";
|
231
|
+
} catch {
|
232
|
+
}
|
233
|
+
}, whitelist = _arguments.length > 1 && _arguments[1] !== void 0 ? _arguments[1] : [], sourcePath = _arguments.length > 2 ? _arguments[2] : void 0, bindingCache = _arguments.length > 3 ? _arguments[3] : void 0, shouldPrintDebug = _arguments.length > 4 ? _arguments[4] : void 0, bindings = scope.getAllBindings(), ret = {}, program = scope.getProgramParent().block, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0, _state.label = 1;
|
234
|
+
case 1:
|
235
|
+
_state.trys.push([
|
236
|
+
1,
|
237
|
+
6,
|
238
|
+
7,
|
239
|
+
8
|
240
|
+
]), _loop1 = function() {
|
241
|
+
var node, importPath, moduleName, isOnWhitelist, src, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step1, specifier, val, err1, _process_env_DEBUG;
|
242
|
+
return _ts_generator(this, function(_state2) {
|
243
|
+
switch (_state2.label) {
|
244
|
+
case 0:
|
245
|
+
if (node = _step.value, !t.isImportDeclaration(node))
|
246
|
+
return [
|
247
|
+
3,
|
248
|
+
4
|
249
|
+
];
|
250
|
+
if (importPath = node.source.value, !node.specifiers.length)
|
251
|
+
return [
|
252
|
+
2,
|
253
|
+
"continue"
|
254
|
+
];
|
255
|
+
if (!isLocalImport(importPath))
|
256
|
+
return [
|
257
|
+
2,
|
258
|
+
"continue"
|
259
|
+
];
|
260
|
+
if (moduleName = resolveImportPath(sourcePath, importPath), isOnWhitelist = whitelist.some(function(test) {
|
261
|
+
return moduleName.endsWith(test);
|
262
|
+
}), !isOnWhitelist)
|
263
|
+
return [
|
264
|
+
2,
|
265
|
+
"continue"
|
266
|
+
];
|
267
|
+
_state2.label = 1;
|
268
|
+
case 1:
|
269
|
+
return _state2.trys.push([
|
270
|
+
1,
|
271
|
+
3,
|
272
|
+
,
|
273
|
+
4
|
274
|
+
]), [
|
275
|
+
4,
|
276
|
+
importModule(moduleName)
|
277
|
+
];
|
278
|
+
case 2:
|
279
|
+
if (src = _state2.sent(), !src)
|
280
|
+
return [
|
281
|
+
2,
|
282
|
+
"continue"
|
283
|
+
];
|
284
|
+
_iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
|
285
|
+
try {
|
286
|
+
for (_iterator2 = node.specifiers[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0)
|
287
|
+
specifier = _step1.value, t.isImportSpecifier(specifier) && t.isIdentifier(specifier.imported) && typeof src[specifier.imported.name] < "u" && (val = src[specifier.local.name], ret[specifier.local.name] = val);
|
288
|
+
} catch (err2) {
|
289
|
+
_didIteratorError2 = !0, _iteratorError2 = err2;
|
290
|
+
} finally {
|
291
|
+
try {
|
292
|
+
!_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
|
293
|
+
} finally {
|
294
|
+
if (_didIteratorError2)
|
295
|
+
throw _iteratorError2;
|
296
|
+
}
|
297
|
+
}
|
298
|
+
return [
|
299
|
+
3,
|
300
|
+
4
|
301
|
+
];
|
302
|
+
case 3:
|
303
|
+
return err1 = _state2.sent(), shouldPrintDebug ? console.warn(" | Skipping partial evaluation of constant file: ".concat(moduleName, " (DEBUG=tamagui for more)")) : !((_process_env_DEBUG = process.env.DEBUG) === null || _process_env_DEBUG === void 0) && _process_env_DEBUG.startsWith("tamagui") && console.info("Error in partial evaluation", err1.message, err1.stack), [
|
304
|
+
3,
|
305
|
+
4
|
306
|
+
];
|
307
|
+
case 4:
|
308
|
+
return [
|
309
|
+
2
|
310
|
+
];
|
311
|
+
}
|
312
|
+
});
|
313
|
+
}, _iterator = program.body[Symbol.iterator](), _state.label = 2;
|
314
|
+
case 2:
|
315
|
+
return (_iteratorNormalCompletion = (_step = _iterator.next()).done) ? [
|
316
|
+
3,
|
317
|
+
5
|
318
|
+
] : [
|
319
|
+
5,
|
320
|
+
_ts_values(_loop1())
|
321
|
+
];
|
322
|
+
case 3:
|
323
|
+
_state.sent(), _state.label = 4;
|
324
|
+
case 4:
|
325
|
+
return _iteratorNormalCompletion = !0, [
|
326
|
+
3,
|
327
|
+
2
|
328
|
+
];
|
329
|
+
case 5:
|
330
|
+
return [
|
331
|
+
3,
|
332
|
+
8
|
333
|
+
];
|
334
|
+
case 6:
|
335
|
+
return err = _state.sent(), _didIteratorError = !0, _iteratorError = err, [
|
336
|
+
3,
|
337
|
+
8
|
338
|
+
];
|
339
|
+
case 7:
|
340
|
+
try {
|
341
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
342
|
+
} finally {
|
343
|
+
if (_didIteratorError)
|
344
|
+
throw _iteratorError;
|
68
345
|
}
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
if (!src)
|
86
|
-
return console.info(
|
87
|
-
` | \u26A0\uFE0F Missing file ${moduleName} via ${sourcePath} import ${sourceModule.sourceModule}?`
|
88
|
-
), {};
|
89
|
-
sourceModule.destructured ? sourceModule.imported && (ret[k] = src[sourceModule.imported]) : ret[k] = src;
|
346
|
+
return [
|
347
|
+
7
|
348
|
+
];
|
349
|
+
case 8:
|
350
|
+
if (!bindingCache)
|
351
|
+
throw new Error("BindingCache is a required param");
|
352
|
+
for (var k2 in bindings)
|
353
|
+
if (_ret = _loop(k2), _type_of(_ret) === "object")
|
354
|
+
return [
|
355
|
+
2,
|
356
|
+
_ret.v
|
357
|
+
];
|
358
|
+
return [
|
359
|
+
2,
|
360
|
+
ret
|
361
|
+
];
|
90
362
|
}
|
91
|
-
|
92
|
-
|
93
|
-
const { parent } = binding.path;
|
94
|
-
if (!t.isVariableDeclaration(parent) || parent.kind !== "const")
|
95
|
-
continue;
|
96
|
-
const dec = parent.declarations.find((d) => t.isIdentifier(d.id) && d.id.name === k);
|
97
|
-
if (!dec || !dec.init)
|
98
|
-
continue;
|
99
|
-
if (typeof dec.id.start != "number" || typeof dec.id.end != "number") {
|
100
|
-
console.error("dec.id.start/end is not a number");
|
101
|
-
continue;
|
102
|
-
}
|
103
|
-
if (!t.isIdentifier(dec.id)) {
|
104
|
-
console.error("dec is not an identifier");
|
105
|
-
continue;
|
106
|
-
}
|
107
|
-
const cacheKey = `${dec.id.name}_${dec.id.start}-${dec.id.end}`;
|
108
|
-
if (Object.hasOwnProperty.call(bindingCache, cacheKey)) {
|
109
|
-
ret[k] = bindingCache[cacheKey];
|
110
|
-
continue;
|
111
|
-
}
|
112
|
-
if (Object.hasOwnProperty.call(bindingCache, cacheKey)) {
|
113
|
-
ret[k] = bindingCache[cacheKey];
|
114
|
-
continue;
|
115
|
-
}
|
116
|
-
try {
|
117
|
-
ret[k] = evaluateAstNode(dec.init, void 0, shouldPrintDebug), bindingCache[cacheKey] = ret[k];
|
118
|
-
continue;
|
119
|
-
} catch {
|
120
|
-
}
|
121
|
-
}
|
122
|
-
return ret;
|
363
|
+
});
|
364
|
+
}), _getStaticBindingsForScope.apply(this, arguments);
|
123
365
|
}
|
124
366
|
export {
|
125
367
|
cleanupBeforeExit,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../../../src/extractor/getStaticBindingsForScope.ts"],
|
4
|
-
"mappings": "AACA,
|
5
|
-
"names": []
|
3
|
+
"sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/getStaticBindingsForScope.ts"],
|
4
|
+
"mappings": "AACA,SAASA,YAAY;AACrB,SAASC,SAASC,SAASC,MAAMC,eAAe;AAGhD,YAAYC,OAAO;AAEnB,SAASC,uBAAuB;AAChC,SAASC,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M5B,IAAI,IAAIpC;;AAJ7B,oBAAAoD,qBAAA,IAAAC,kBAAAG;;;uBAAAL,8BAAAG,WAAA,UAAA,QAAAA,WAAA,OAAA;;0BAAAF;8BAAAC;;;;;;;;AAQEG,gCAAAA,QAAAA,KAAAA,GACH9C,mBACFa,QAAQ0C,KACL,uDAAiE,OAAXhD,YAAW,2BAAA,CAAA,IAE3DjC,wBAAAA,QAAQkF,IAAIC,WAAK,QAAjBnF,uBAAAA,WAAAA,mBAAmBpB,WAAW,SAAA,KACvC2D,QAAQC,KAAM,+BAA8BgC,KAAIY,SAASZ,KAAIa,KAAK;;;;;;;;;;UAI1E,GA/BK,YAAcxD,QAAQyD,KAAI,OAAA,QAAA,EAAA;;kBAA1B,6BAAA,QAAA,UAAA,KAAA,GAAA,QAAA;;;;;;;;;;AAAA,6CAAA;;;;;;;;;;sCAAA,oBAAA,IAAA,iBAAA;;;;;;aAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;gBAAA;oBAAA;;;;;;AAiCL,cAAI,CAAC7D;AACH,kBAAM,IAAIZ,MAAM,kCAAA;AAGlB,mBAAWiB,MAAKH;;;;;;AAmFhB,iBAAA;;YAAOC;;;;EACT,CAAA,GA5IsBN,2BAAAA,MAAAA,MAAAA,SAAAA;;",
|
5
|
+
"names": ["fork", "dirname", "extname", "join", "resolve", "t", "evaluateAstNode", "getSourceModule", "isLocalImport", "path", "startsWith", "resolveImportPath", "sourcePath", "sourceDir", "cache", "Map", "pending", "loadCmd", "__dirname", "exited", "child", "forkChild", "execArgv", "detached", "stdio", "cleanupBeforeExit", "removeAllListeners", "unref", "disconnect", "kill", "process", "once", "importModule", "has", "get", "promise", "Promise", "res", "rej", "size", "clear", "listener", "msg", "Error", "slice", "removeListener", "val", "JSON", "parse", "set", "send", "replace", "getStaticBindingsForScope", "scope", "whitelist", "bindingCache", "shouldPrintDebug", "bindings", "ret", "program", "k", "binding", "sourceModule", "moduleName", "isOnWhitelist", "some", "test", "endsWith", "src", "console", "info", "destructured", "imported", "parent", "isVariableDeclaration", "kind", "dec", "declarations", "find", "d", "isIdentifier", "id", "name", "init", "start", "end", "error", "cacheKey", "Object", "hasOwnProperty", "call", "undefined", "getAllBindings", "getProgramParent", "block", "node", "importPath", "_iteratorNormalCompletion", "_didIteratorError", "_iteratorError", "_iterator", "specifier", "err", "isImportDeclaration", "source", "value", "specifiers", "length", "_state", "isImportSpecifier", "local", "warn", "env", "DEBUG", "message", "stack", "body"]
|
6
6
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../../../src/extractor/getTamaguiConfigPathFromOptionsConfig.ts"],
|
4
|
-
"mappings": "AAAA,
|
5
|
-
"names": []
|
3
|
+
"sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/getTamaguiConfigPathFromOptionsConfig.ts"],
|
4
|
+
"mappings": "AAAA,SAASA,YAAYC,YAAY;AAI1B,SAASC,sCACdC,QAA6C;AAE7C,SAAIH,WAAWG,MAAAA,IACNA,SAGFF,KAAKG,QAAQC,IAAG,GAAIF,MAAAA;AAC7B;",
|
5
|
+
"names": ["isAbsolute", "join", "getTamaguiConfigPathFromOptionsConfig", "config", "process", "cwd"]
|
6
6
|
}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import * as t from "@babel/types";
|
2
2
|
function hoistClassNames(path, existing, expr) {
|
3
|
-
|
3
|
+
var hoist = hoistClassNames.bind(null, path, existing);
|
4
4
|
if (t.isStringLiteral(expr)) {
|
5
5
|
if (expr.value.trim() === "")
|
6
6
|
return expr;
|
7
7
|
if (existing[expr.value])
|
8
8
|
return existing[expr.value];
|
9
|
-
|
9
|
+
var identifier = replaceStringWithVariable(expr);
|
10
10
|
return existing[expr.value] = identifier, identifier;
|
11
11
|
}
|
12
12
|
if (t.isBinaryExpression(expr))
|
@@ -14,19 +14,17 @@ function hoistClassNames(path, existing, expr) {
|
|
14
14
|
if (t.isLogicalExpression(expr))
|
15
15
|
return t.logicalExpression(expr.operator, hoist(expr.left), hoist(expr.right));
|
16
16
|
if (t.isConditionalExpression(expr))
|
17
|
-
return t.conditionalExpression(
|
18
|
-
expr.test,
|
19
|
-
hoist(expr.consequent),
|
20
|
-
hoist(expr.alternate)
|
21
|
-
);
|
17
|
+
return t.conditionalExpression(expr.test, hoist(expr.consequent), hoist(expr.alternate));
|
22
18
|
return expr;
|
23
19
|
function replaceStringWithVariable(str) {
|
24
|
-
|
20
|
+
var uid = path.scope.generateUidIdentifier("cn"), parent = path.findParent(function(path2) {
|
21
|
+
return path2.isProgram();
|
22
|
+
});
|
25
23
|
if (!parent)
|
26
24
|
throw new Error("no program?");
|
27
|
-
|
25
|
+
var variable = t.variableDeclaration("const", [
|
28
26
|
// adding a space for extra safety
|
29
|
-
t.variableDeclarator(uid, t.stringLiteral(
|
27
|
+
t.variableDeclarator(uid, t.stringLiteral(" ".concat(str.value)))
|
30
28
|
]);
|
31
29
|
return parent.unshiftContainer("body", variable), uid;
|
32
30
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"sources": ["../../../src/extractor/hoistClassNames.ts"],
|
4
|
-
"mappings": "AACA,
|
5
|
-
"names": ["path"]
|
3
|
+
"sources": ["../../../src/extractor/Users/n8/tamagui/packages/static/src/extractor/hoistClassNames.ts"],
|
4
|
+
"mappings": "AACA,YAAYA,OAAO;AAEZ,SAASC,gBACdC,MACAC,UACAC,MAAkB;AAElB,MAAMC,QAAQJ,gBAAgBK,KAAK,MAAMJ,MAAMC,QAAAA;AAC/C,MAAIH,EAAEO,gBAAgBH,IAAAA,GAAO;AAC3B,QAAIA,KAAKI,MAAMC,KAAI,MAAO;AACxB,aAAOL;AAET,QAAID,SAASC,KAAKI,KAAK;AACrB,aAAOL,SAASC,KAAKI,KAAK;AAE5B,QAAME,aAAaC,0BAA0BP,IAAAA;AAC7CD,oBAASC,KAAKI,KAAK,IAAIE,YAChBA;EACT;AACA,MAAIV,EAAEY,mBAAmBR,IAAAA;AACvB,WAAOJ,EAAEa,iBAAiBT,KAAKU,UAAUT,MAAMD,KAAKW,IAAI,GAAGV,MAAMD,KAAKY,KAAK,CAAA;AAE7E,MAAIhB,EAAEiB,oBAAoBb,IAAAA;AACxB,WAAOJ,EAAEkB,kBAAkBd,KAAKU,UAAUT,MAAMD,KAAKW,IAAI,GAAGV,MAAMD,KAAKY,KAAK,CAAA;AAE9E,MAAIhB,EAAEmB,wBAAwBf,IAAAA;AAC5B,WAAOJ,EAAEoB,sBACPhB,KAAKiB,MACLhB,MAAMD,KAAKkB,UAAU,GACrBjB,MAAMD,KAAKmB,SAAS,CAAA;AAGxB,SAAOnB;AAEP,WAASO,0BAA0Ba,KAAoB;AAErD,QAAMC,MAAMvB,KAAKwB,MAAMC,sBAAsB,IAAA,GACvCC,SAAS1B,KAAK2B,WAAW,SAAC3B,OAAAA;aAASA,MAAK4B,UAAS;;AACvD,QAAI,CAACF;AAAQ,YAAM,IAAIG,MAAO,aAAA;AAC9B,QAAMC,WAAWhC,EAAEiC,oBAAoB,SAAS;;MAE9CjC,EAAEkC,mBAAmBT,KAAKzB,EAAEmC,cAAe,IAAa,OAAVX,IAAIhB,KAAK,CAAA,CAAA;KACxD;AAEDoB,kBAAOQ,iBAAiB,QAAQJ,QAAAA,GACzBP;EACT;AACF;",
|
5
|
+
"names": ["t", "hoistClassNames", "path", "existing", "expr", "hoist", "bind", "isStringLiteral", "value", "trim", "identifier", "replaceStringWithVariable", "isBinaryExpression", "binaryExpression", "operator", "left", "right", "isLogicalExpression", "logicalExpression", "isConditionalExpression", "conditionalExpression", "test", "consequent", "alternate", "str", "uid", "scope", "generateUidIdentifier", "parent", "findParent", "isProgram", "Error", "variable", "variableDeclaration", "variableDeclarator", "stringLiteral", "unshiftContainer"]
|
6
6
|
}
|