@tamagui/static 1.135.3 → 1.135.4-1761748186554
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/check-dep-versions.mjs +268 -0
- package/dist/check-dep-versions.mjs.map +1 -0
- package/dist/checkDeps.mjs +33 -0
- package/dist/checkDeps.mjs.map +1 -0
- package/dist/constants.mjs +50 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/exports.mjs +42 -0
- package/dist/exports.mjs.map +1 -0
- package/dist/extractor/accessSafe.mjs +47 -0
- package/dist/extractor/accessSafe.mjs.map +1 -0
- package/dist/extractor/babelParse.mjs +55 -0
- package/dist/extractor/babelParse.mjs.map +1 -0
- package/dist/extractor/bundle.mjs +149 -0
- package/dist/extractor/bundle.mjs.map +1 -0
- package/dist/extractor/bundleConfig.mjs +331 -0
- package/dist/extractor/bundleConfig.mjs.map +1 -0
- package/dist/extractor/concatClassName.mjs +79 -0
- package/dist/extractor/concatClassName.mjs.map +1 -0
- package/dist/extractor/createEvaluator.mjs +76 -0
- package/dist/extractor/createEvaluator.mjs.map +1 -0
- package/dist/extractor/createExtractor.mjs +976 -0
- package/dist/extractor/createExtractor.mjs.map +1 -0
- package/dist/extractor/createLogger.mjs +46 -0
- package/dist/extractor/createLogger.mjs.map +1 -0
- package/dist/extractor/errors.mjs +27 -0
- package/dist/extractor/errors.mjs.map +1 -0
- package/dist/extractor/esbuildAliasPlugin.mjs +45 -0
- package/dist/extractor/esbuildAliasPlugin.mjs.map +1 -0
- package/dist/extractor/esbuildTsconfigPaths.mjs +85 -0
- package/dist/extractor/esbuildTsconfigPaths.mjs.map +1 -0
- package/dist/extractor/evaluateAstNode.mjs +84 -0
- package/dist/extractor/evaluateAstNode.mjs.map +1 -0
- package/dist/extractor/extractHelpers.mjs +121 -0
- package/dist/extractor/extractHelpers.mjs.map +1 -0
- package/dist/extractor/extractMediaStyle.mjs +129 -0
- package/dist/extractor/extractMediaStyle.mjs.map +1 -0
- package/dist/extractor/extractToClassNames.mjs +304 -0
- package/dist/extractor/extractToClassNames.mjs.map +1 -0
- package/dist/extractor/extractToNative.mjs +262 -0
- package/dist/extractor/extractToNative.mjs.map +1 -0
- package/dist/extractor/findTopmostFunction.mjs +35 -0
- package/dist/extractor/findTopmostFunction.mjs.map +1 -0
- package/dist/extractor/{generatedUid.native.js → generatedUid.mjs} +26 -23
- package/dist/extractor/generatedUid.mjs.map +1 -0
- package/dist/extractor/getPrefixLogs.mjs +30 -0
- package/dist/extractor/getPrefixLogs.mjs.map +1 -0
- package/dist/extractor/getPropValueFromAttributes.mjs +68 -0
- package/dist/extractor/getPropValueFromAttributes.mjs.map +1 -0
- package/dist/extractor/getSourceModule.mjs +65 -0
- package/dist/extractor/getSourceModule.mjs.map +1 -0
- package/dist/extractor/getStaticBindingsForScope.mjs +149 -0
- package/dist/extractor/getStaticBindingsForScope.mjs.map +1 -0
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs +36 -0
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.mjs.map +1 -0
- package/dist/extractor/literalToAst.mjs +85 -0
- package/dist/extractor/literalToAst.mjs.map +1 -0
- package/dist/extractor/loadFile.mjs +12 -0
- package/dist/extractor/loadFile.mjs.map +1 -0
- package/dist/extractor/loadTamagui.mjs +296 -0
- package/dist/extractor/loadTamagui.mjs.map +1 -0
- package/dist/extractor/logLines.mjs +36 -0
- package/dist/extractor/logLines.mjs.map +1 -0
- package/dist/extractor/{normalizeTernaries.native.js → normalizeTernaries.mjs} +45 -31
- package/dist/extractor/normalizeTernaries.mjs.map +1 -0
- package/dist/extractor/propsToFontFamilyCache.mjs +39 -0
- package/dist/extractor/propsToFontFamilyCache.mjs.map +1 -0
- package/dist/extractor/regenerateConfig.mjs +145 -0
- package/dist/extractor/regenerateConfig.mjs.map +1 -0
- package/dist/extractor/removeUnusedHooks.mjs +77 -0
- package/dist/extractor/removeUnusedHooks.mjs.map +1 -0
- package/dist/extractor/timer.mjs +44 -0
- package/dist/extractor/timer.mjs.map +1 -0
- package/dist/extractor/{validHTMLAttributes.native.js → validHTMLAttributes.mjs} +17 -16
- package/dist/extractor/validHTMLAttributes.mjs.map +1 -0
- package/dist/extractor/watchTamaguiConfig.mjs +59 -0
- package/dist/extractor/watchTamaguiConfig.mjs.map +1 -0
- package/dist/getPragmaOptions.mjs +55 -0
- package/dist/getPragmaOptions.mjs.map +1 -0
- package/dist/helpers/memoize.mjs +38 -0
- package/dist/helpers/memoize.mjs.map +1 -0
- package/dist/helpers/requireTamaguiCore.mjs +34 -0
- package/dist/helpers/requireTamaguiCore.mjs.map +1 -0
- package/dist/index.mjs +41 -0
- package/dist/index.mjs.map +1 -0
- package/dist/registerRequire.mjs +107 -0
- package/dist/registerRequire.mjs.map +1 -0
- package/dist/server.mjs +76 -0
- package/dist/server.mjs.map +1 -0
- package/dist/setup.mjs +2 -0
- package/dist/setup.mjs.map +1 -0
- package/dist/{types.native.js → types.mjs} +8 -6
- package/dist/types.mjs.map +1 -0
- package/package.json +19 -21
- package/dist/check-dep-versions.native.js +0 -602
- package/dist/check-dep-versions.native.js.map +0 -6
- package/dist/checkDeps.native.js +0 -34
- package/dist/checkDeps.native.js.map +0 -6
- package/dist/constants.native.js +0 -45
- package/dist/constants.native.js.map +0 -6
- package/dist/exports.native.js +0 -52
- package/dist/exports.native.js.map +0 -6
- package/dist/extractor/accessSafe.native.js +0 -48
- package/dist/extractor/accessSafe.native.js.map +0 -6
- package/dist/extractor/babelParse.native.js +0 -62
- package/dist/extractor/babelParse.native.js.map +0 -6
- package/dist/extractor/bundle.native.js +0 -168
- package/dist/extractor/bundle.native.js.map +0 -6
- package/dist/extractor/bundleConfig.native.js +0 -394
- package/dist/extractor/bundleConfig.native.js.map +0 -6
- package/dist/extractor/concatClassName.native.js +0 -69
- package/dist/extractor/concatClassName.native.js.map +0 -6
- package/dist/extractor/createEvaluator.native.js +0 -63
- package/dist/extractor/createEvaluator.native.js.map +0 -6
- package/dist/extractor/createExtractor.native.js +0 -1229
- package/dist/extractor/createExtractor.native.js.map +0 -6
- package/dist/extractor/createLogger.native.js +0 -35
- package/dist/extractor/createLogger.native.js.map +0 -6
- package/dist/extractor/errors.native.js +0 -119
- package/dist/extractor/errors.native.js.map +0 -6
- package/dist/extractor/esbuildAliasPlugin.native.js +0 -52
- package/dist/extractor/esbuildAliasPlugin.native.js.map +0 -6
- package/dist/extractor/esbuildTsconfigPaths.native.js +0 -79
- package/dist/extractor/esbuildTsconfigPaths.native.js.map +0 -6
- package/dist/extractor/evaluateAstNode.native.js +0 -98
- package/dist/extractor/evaluateAstNode.native.js.map +0 -6
- package/dist/extractor/extractHelpers.native.js +0 -183
- package/dist/extractor/extractHelpers.native.js.map +0 -6
- package/dist/extractor/extractMediaStyle.native.js +0 -138
- package/dist/extractor/extractMediaStyle.native.js.map +0 -6
- package/dist/extractor/extractToClassNames.native.js +0 -332
- package/dist/extractor/extractToClassNames.native.js.map +0 -6
- package/dist/extractor/extractToNative.native.js +0 -276
- package/dist/extractor/extractToNative.native.js.map +0 -6
- package/dist/extractor/findTopmostFunction.native.js +0 -37
- package/dist/extractor/findTopmostFunction.native.js.map +0 -6
- package/dist/extractor/generatedUid.native.js.map +0 -6
- package/dist/extractor/getPrefixLogs.native.js +0 -30
- package/dist/extractor/getPrefixLogs.native.js.map +0 -6
- package/dist/extractor/getPropValueFromAttributes.native.js +0 -68
- package/dist/extractor/getPropValueFromAttributes.native.js.map +0 -6
- package/dist/extractor/getSourceModule.native.js +0 -80
- package/dist/extractor/getSourceModule.native.js.map +0 -6
- package/dist/extractor/getStaticBindingsForScope.native.js +0 -183
- package/dist/extractor/getStaticBindingsForScope.native.js.map +0 -6
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js +0 -37
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +0 -6
- package/dist/extractor/literalToAst.native.js +0 -106
- package/dist/extractor/literalToAst.native.js.map +0 -6
- package/dist/extractor/loadFile.native.js +0 -21
- package/dist/extractor/loadFile.native.js.map +0 -6
- package/dist/extractor/loadTamagui.native.js +0 -314
- package/dist/extractor/loadTamagui.native.js.map +0 -6
- package/dist/extractor/logLines.native.js +0 -53
- package/dist/extractor/logLines.native.js.map +0 -6
- package/dist/extractor/normalizeTernaries.native.js.map +0 -6
- package/dist/extractor/propsToFontFamilyCache.native.js +0 -40
- package/dist/extractor/propsToFontFamilyCache.native.js.map +0 -6
- package/dist/extractor/regenerateConfig.native.js +0 -148
- package/dist/extractor/regenerateConfig.native.js.map +0 -6
- package/dist/extractor/removeUnusedHooks.native.js +0 -111
- package/dist/extractor/removeUnusedHooks.native.js.map +0 -6
- package/dist/extractor/timer.native.js +0 -44
- package/dist/extractor/timer.native.js.map +0 -6
- package/dist/extractor/validHTMLAttributes.native.js.map +0 -6
- package/dist/extractor/watchTamaguiConfig.native.js +0 -60
- package/dist/extractor/watchTamaguiConfig.native.js.map +0 -6
- package/dist/getPragmaOptions.native.js +0 -62
- package/dist/getPragmaOptions.native.js.map +0 -6
- package/dist/helpers/memoize.native.js +0 -40
- package/dist/helpers/memoize.native.js.map +0 -6
- package/dist/helpers/requireTamaguiCore.native.js +0 -34
- package/dist/helpers/requireTamaguiCore.native.js.map +0 -6
- package/dist/index.native.js +0 -35
- package/dist/index.native.js.map +0 -6
- package/dist/registerRequire.native.js +0 -124
- package/dist/registerRequire.native.js.map +0 -6
- package/dist/server.native.js +0 -70
- package/dist/server.native.js.map +0 -6
- package/dist/setup.native.js +0 -2
- package/dist/setup.native.js.map +0 -6
- package/dist/types.native.js.map +0 -6
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var logLines_exports = {};
|
|
22
|
+
__export(logLines_exports, {
|
|
23
|
+
logLines: () => logLines
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(logLines_exports);
|
|
26
|
+
const prefix = " ",
|
|
27
|
+
logLines = (str, singleLine = !1) => {
|
|
28
|
+
if (singleLine) return prefix + str.split(" ").join(`
|
|
29
|
+
${prefix}`);
|
|
30
|
+
const lines = [""],
|
|
31
|
+
items = str.split(" ");
|
|
32
|
+
for (const item of items) item.length + lines[lines.length - 1].length > 85 && lines.push(""), lines[lines.length - 1] += item + " ";
|
|
33
|
+
return lines.map((line, i) => prefix + (i == 0 ? "" : " ") + line.trim()).join(`
|
|
34
|
+
`);
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=logLines.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["logLines_exports","__export","logLines","module","exports","__toCommonJS","prefix","str","singleLine","split","join","lines","items","item","length","push","map","line","i","trim"],"sources":["../../src/extractor/logLines.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA;AAAAC,QAAA,CAAAD,gBAAA;EAAAE,QAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,gBAAA;AAAA,MAAMM,MAAA,GAAS;EAEFJ,QAAA,GAAWA,CAACK,GAAA,EAAaC,UAAA,GAAa,OAAU;IAC3D,IAAIA,UAAA,EACF,OAAOF,MAAA,GAASC,GAAA,CAAIE,KAAA,CAAM,GAAG,EAAEC,IAAA,CAAK;AAAA,EAAKJ,MAAM,EAAE;IAEnD,MAAMK,KAAA,GAAkB,CAAC,EAAE;MACrBC,KAAA,GAAQL,GAAA,CAAIE,KAAA,CAAM,GAAG;IAC3B,WAAWI,IAAA,IAAQD,KAAA,EACbC,IAAA,CAAKC,MAAA,GAASH,KAAA,CAAMA,KAAA,CAAMG,MAAA,GAAS,CAAC,EAAEA,MAAA,GAAS,MACjDH,KAAA,CAAMI,IAAA,CAAK,EAAE,GAEfJ,KAAA,CAAMA,KAAA,CAAMG,MAAA,GAAS,CAAC,KAAKD,IAAA,GAAO;IAEpC,OAAOF,KAAA,CAAMK,GAAA,CAAI,CAACC,IAAA,EAAMC,CAAA,KAAMZ,MAAA,IAAUY,CAAA,IAAK,IAAI,KAAK,OAAOD,IAAA,CAAKE,IAAA,CAAK,CAAC,EAAET,IAAA,CAAK;AAAA,CAAI;EACrF","ignoreList":[]}
|
|
@@ -1,41 +1,60 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf,
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
16
20
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
22
|
// file that has been converted to a CommonJS file using a Babel-
|
|
19
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
24
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
24
32
|
var normalizeTernaries_exports = {};
|
|
25
33
|
__export(normalizeTernaries_exports, {
|
|
26
34
|
normalizeTernaries: () => normalizeTernaries
|
|
27
35
|
});
|
|
28
36
|
module.exports = __toCommonJS(normalizeTernaries_exports);
|
|
29
|
-
var import_generator = __toESM(require("@babel/generator")),
|
|
37
|
+
var import_generator = __toESM(require("@babel/generator")),
|
|
38
|
+
t = __toESM(require("@babel/types")),
|
|
39
|
+
import_web = require("@tamagui/web"),
|
|
40
|
+
import_invariant = __toESM(require("invariant")),
|
|
41
|
+
import_propsToFontFamilyCache = require("./propsToFontFamilyCache.mjs");
|
|
30
42
|
function normalizeTernaries(ternaries) {
|
|
31
|
-
if ((0, import_invariant.default)(Array.isArray(ternaries), "extractStaticTernaries expects param 1 to be an array of ternaries"), ternaries.length === 0)
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
|
|
43
|
+
if ((0, import_invariant.default)(Array.isArray(ternaries), "extractStaticTernaries expects param 1 to be an array of ternaries"), ternaries.length === 0) return [];
|
|
44
|
+
const ternariesByKey = {};
|
|
45
|
+
for (let idx = -1, len = ternaries.length; ++idx < len;) {
|
|
46
|
+
const {
|
|
47
|
+
test,
|
|
48
|
+
consequent,
|
|
49
|
+
alternate,
|
|
50
|
+
remove,
|
|
51
|
+
...rest
|
|
52
|
+
} = ternaries[idx];
|
|
53
|
+
let ternaryTest = test;
|
|
35
54
|
t.isExpressionStatement(test) && (ternaryTest = test.expression);
|
|
36
|
-
|
|
55
|
+
let shouldSwap = !1;
|
|
37
56
|
t.isUnaryExpression(test) && test.operator === "!" ? (ternaryTest = test.argument, shouldSwap = !0) : t.isBinaryExpression(test) && (test.operator === "!==" || test.operator === "!=") && (ternaryTest = t.binaryExpression(test.operator.replace("!", "="), test.left, test.right), shouldSwap = !0);
|
|
38
|
-
|
|
57
|
+
const key = (0, import_generator.default)(ternaryTest).code;
|
|
39
58
|
ternariesByKey[key] || (ternariesByKey[key] = {
|
|
40
59
|
...rest,
|
|
41
60
|
alternate: {},
|
|
@@ -43,18 +62,13 @@ function normalizeTernaries(ternaries) {
|
|
|
43
62
|
test: ternaryTest,
|
|
44
63
|
remove
|
|
45
64
|
});
|
|
46
|
-
|
|
65
|
+
const altStyle = (shouldSwap ? consequent : alternate) ?? {},
|
|
66
|
+
consStyle = (shouldSwap ? alternate : consequent) ?? {},
|
|
67
|
+
nextAlt = ternariesByKey[key].alternate;
|
|
47
68
|
ternariesByKey[key].alternate = (0, import_web.mergeProps)(altStyle, nextAlt), (0, import_propsToFontFamilyCache.forwardFontFamilyName)(altStyle, ternariesByKey[key].alternate);
|
|
48
|
-
|
|
69
|
+
const nextCons = ternariesByKey[key].consequent;
|
|
49
70
|
ternariesByKey[key].consequent = (0, import_web.mergeProps)(consStyle, nextCons), (0, import_propsToFontFamilyCache.forwardFontFamilyName)(consStyle, ternariesByKey[key].consequent);
|
|
50
71
|
}
|
|
51
|
-
|
|
52
|
-
return ternariesByKey[key2];
|
|
53
|
-
});
|
|
54
|
-
return ternaryExpression;
|
|
72
|
+
return Object.keys(ternariesByKey).map(key => ternariesByKey[key]);
|
|
55
73
|
}
|
|
56
|
-
|
|
57
|
-
0 && (module.exports = {
|
|
58
|
-
normalizeTernaries
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=normalizeTernaries.js.map
|
|
74
|
+
//# sourceMappingURL=normalizeTernaries.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["normalizeTernaries_exports","__export","normalizeTernaries","module","exports","__toCommonJS","import_generator","__toESM","require","t","import_web","import_invariant","import_propsToFontFamilyCache","ternaries","default","Array","isArray","length","ternariesByKey","idx","len","test","consequent","alternate","remove","rest","ternaryTest","isExpressionStatement","expression","shouldSwap","isUnaryExpression","operator","argument","isBinaryExpression","binaryExpression","replace","left","right","key","code","altStyle","consStyle","nextAlt","mergeProps","forwardFontFamilyName","nextCons","Object","keys","map"],"sources":["../../src/extractor/normalizeTernaries.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,0BAAA;AAAAC,QAAA,CAAAD,0BAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,0BAAA;AAAA,IAAAM,gBAAA,GAAqBC,OAAA,CAAAC,OAAA;EACrBC,CAAA,GAAmBF,OAAA,CAAAC,OAAA;EACnBE,UAAA,GAA2BF,OAAA;EAC3BG,gBAAA,GAAsBJ,OAAA,CAAAC,OAAA;EAEtBI,6BAAA,GAAsCJ,OAAA;AAE/B,SAASN,mB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A,IAAYX,UAAA,GAAaP,UAAA,GAAaC,SAAA,KAAc,CAAC;MACrDkB,SAAA,IAAaZ,UAAA,GAAaN,SAAA,GAAYD,UAAA,KAAe,CAAC;MAEtDoB,OAAA,GAAUxB,cAAA,CAAeoB,GAAG,EAAEf,SAAA;IACpCL,cAAA,CAAeoB,GAAG,EAAEf,SAAA,OAAYb,UAAA,CAAAiC,UAAA,EAAWH,QAAA,EAAUE,OAAO,OAC5D9B,6BAAA,CAAAgC,qBAAA,EAAsBJ,QAAA,EAAUtB,cAAA,CAAeoB,GAAG,EAAEf,SAAS;IAE7D,MAAMsB,QAAA,GAAW3B,cAAA,CAAeoB,GAAG,EAAEhB,UAAA;IACrCJ,cAAA,CAAeoB,GAAG,EAAEhB,UAAA,OAAaZ,UAAA,CAAAiC,UAAA,EAAWF,SAAA,EAAWI,QAAQ,OAC/DjC,6BAAA,CAAAgC,qBAAA,EAAsBH,SAAA,EAAWvB,cAAA,CAAeoB,GAAG,EAAEhB,UAAU;EACjE;EAMA,OAJ0BwB,MAAA,CAAOC,IAAA,CAAK7B,cAAc,EAAE8B,GAAA,CAAKV,GAAA,IAClDpB,cAAA,CAAeoB,GAAG,CAC1B;AAGH","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var propsToFontFamilyCache_exports = {};
|
|
22
|
+
__export(propsToFontFamilyCache_exports, {
|
|
23
|
+
forwardFontFamilyName: () => forwardFontFamilyName,
|
|
24
|
+
getFontFamilyNameFromProps: () => getFontFamilyNameFromProps,
|
|
25
|
+
setPropsToFontFamily: () => setPropsToFontFamily
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(propsToFontFamilyCache_exports);
|
|
28
|
+
const cache = /* @__PURE__ */new WeakMap();
|
|
29
|
+
function setPropsToFontFamily(props, ff) {
|
|
30
|
+
cache.set(props, ff.replace("$", "").trim());
|
|
31
|
+
}
|
|
32
|
+
function getFontFamilyNameFromProps(props) {
|
|
33
|
+
return cache.get(props);
|
|
34
|
+
}
|
|
35
|
+
function forwardFontFamilyName(prev, next, fallback) {
|
|
36
|
+
const ff = getFontFamilyNameFromProps(prev) || fallback;
|
|
37
|
+
ff && setPropsToFontFamily(next, ff);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=propsToFontFamilyCache.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["propsToFontFamilyCache_exports","__export","forwardFontFamilyName","getFontFamilyNameFromProps","setPropsToFontFamily","module","exports","__toCommonJS","cache","WeakMap","props","ff","set","replace","trim","get","prev","next","fallback"],"sources":["../../src/extractor/propsToFontFamilyCache.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,8BAAA;AAAAC,QAAA,CAAAD,8BAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,0BAAA,EAAAA,CAAA,KAAAA,0BAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,8BAAA;AAEA,MAAMQ,KAAA,GAAQ,mBAAIC,OAAA,CAAqB;AAEhC,SAASL,qBAAqBM,KAAA,EAAYC,EAAA,EAAY;EAC3DH,KAAA,CAAMI,GAAA,CAAIF,KAAA,EAAOC,EAAA,CAAGE,OAAA,CAAQ,KAAK,EAAE,EAAEC,IAAA,CAAK,CAAC;AAC7C;AAEO,SAASX,2BAA2BO,KAAA,EAAY;EACrD,OAAOF,KAAA,CAAMO,GAAA,CAAIL,KAAK;AACxB;AAEO,SAASR,sBAAsBc,IAAA,EAAWC,IAAA,EAAWC,QAAA,EAAmB;EAC7E,MAAMP,EAAA,GAAKR,0BAAA,CAA2Ba,IAAI,KAAKE,QAAA;EAC3CP,EAAA,IACFP,oBAAA,CAAqBa,IAAA,EAAMN,EAAE;AAEjC","ignoreList":[]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var regenerateConfig_exports = {};
|
|
33
|
+
__export(regenerateConfig_exports, {
|
|
34
|
+
generateTamaguiThemes: () => generateTamaguiThemes,
|
|
35
|
+
regenerateConfig: () => regenerateConfig,
|
|
36
|
+
regenerateConfigSync: () => regenerateConfigSync
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(regenerateConfig_exports);
|
|
39
|
+
var import_node_path = require("node:path"),
|
|
40
|
+
import_generate_themes = require("@tamagui/generate-themes"),
|
|
41
|
+
FS = __toESM(require("fs-extra")),
|
|
42
|
+
import_requireTamaguiCore = require("../helpers/requireTamaguiCore.mjs"),
|
|
43
|
+
import_bundleConfig = require("./bundleConfig.mjs");
|
|
44
|
+
const tamaguiDir = (0, import_node_path.join)(process.cwd(), ".tamagui"),
|
|
45
|
+
confFile = (0, import_node_path.join)(tamaguiDir, "tamagui.config.json");
|
|
46
|
+
async function regenerateConfig(tamaguiOptions, configIn, rebuild = !1) {
|
|
47
|
+
try {
|
|
48
|
+
const config = configIn ?? (await (0, import_bundleConfig.getBundledConfig)(tamaguiOptions, rebuild));
|
|
49
|
+
if (!config) return;
|
|
50
|
+
const out = transformConfig(config, tamaguiOptions.platform || "web");
|
|
51
|
+
await FS.ensureDir((0, import_node_path.dirname)(confFile)), await FS.writeJSON(confFile, out, {
|
|
52
|
+
spaces: 2
|
|
53
|
+
});
|
|
54
|
+
} catch (err) {
|
|
55
|
+
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("regenerateConfig error", err);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function regenerateConfigSync(_tamaguiOptions, config) {
|
|
59
|
+
try {
|
|
60
|
+
FS.ensureDirSync((0, import_node_path.dirname)(confFile)), FS.writeJSONSync(confFile, transformConfig(config, _tamaguiOptions.platform || "web"), {
|
|
61
|
+
spaces: 2
|
|
62
|
+
});
|
|
63
|
+
} catch (err) {
|
|
64
|
+
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("regenerateConfig error", err);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function generateTamaguiThemes(tamaguiOptions, force = !1) {
|
|
68
|
+
if (!tamaguiOptions.themeBuilder) return;
|
|
69
|
+
const {
|
|
70
|
+
input,
|
|
71
|
+
output
|
|
72
|
+
} = tamaguiOptions.themeBuilder,
|
|
73
|
+
inPath = resolveRelativePath(input),
|
|
74
|
+
outPath = resolveRelativePath(output),
|
|
75
|
+
generatedOutput = await (0, import_generate_themes.generateThemes)(inPath),
|
|
76
|
+
hasChanged = force || (await (async () => {
|
|
77
|
+
try {
|
|
78
|
+
if (!generatedOutput) return !1;
|
|
79
|
+
const next = generatedOutput.generated,
|
|
80
|
+
current = await FS.readFile(outPath, "utf-8");
|
|
81
|
+
return next !== current;
|
|
82
|
+
} catch {}
|
|
83
|
+
return !0;
|
|
84
|
+
})());
|
|
85
|
+
return hasChanged && (await (0, import_generate_themes.writeGeneratedThemes)(tamaguiDir, outPath, generatedOutput)), hasChanged;
|
|
86
|
+
}
|
|
87
|
+
const resolveRelativePath = inputPath => inputPath.startsWith(".") ? (0, import_node_path.join)(process.cwd(), inputPath) : require.resolve(inputPath);
|
|
88
|
+
function cloneDeepSafe(x, excludeKeys = {}) {
|
|
89
|
+
return x && (Array.isArray(x) ? x.map(_ => cloneDeepSafe(_)) : typeof x == "function" ? "Function" : typeof x != "object" ? x : "$$typeof" in x ? "Component" : Object.fromEntries(Object.entries(x).flatMap(([k, v]) => excludeKeys[k] ? [] : [[k, cloneDeepSafe(v)]])));
|
|
90
|
+
}
|
|
91
|
+
function transformConfig(config, platform) {
|
|
92
|
+
if (!config) return null;
|
|
93
|
+
const {
|
|
94
|
+
getVariableValue
|
|
95
|
+
} = (0, import_requireTamaguiCore.requireTamaguiCore)(platform),
|
|
96
|
+
next = cloneDeepSafe(config, {
|
|
97
|
+
validStyles: !0
|
|
98
|
+
}),
|
|
99
|
+
{
|
|
100
|
+
components,
|
|
101
|
+
nameToPaths,
|
|
102
|
+
tamaguiConfig
|
|
103
|
+
} = next,
|
|
104
|
+
{
|
|
105
|
+
themes,
|
|
106
|
+
tokens
|
|
107
|
+
} = tamaguiConfig;
|
|
108
|
+
for (const key in themes) {
|
|
109
|
+
const theme = themes[key];
|
|
110
|
+
theme.id = key;
|
|
111
|
+
for (const tkey in theme) theme[tkey] = getVariableValue(theme[tkey]);
|
|
112
|
+
}
|
|
113
|
+
for (const key in tokens) {
|
|
114
|
+
const token = {
|
|
115
|
+
...tokens[key]
|
|
116
|
+
};
|
|
117
|
+
for (const tkey in token) token[tkey] = getVariableValue(token[tkey]);
|
|
118
|
+
}
|
|
119
|
+
for (const component of components) for (const _ in component.nameToInfo) {
|
|
120
|
+
const compDefinition = {
|
|
121
|
+
...component.nameToInfo[_]
|
|
122
|
+
};
|
|
123
|
+
component.nameToInfo[_] = compDefinition;
|
|
124
|
+
const {
|
|
125
|
+
parentStaticConfig,
|
|
126
|
+
...rest
|
|
127
|
+
} = compDefinition.staticConfig;
|
|
128
|
+
compDefinition.staticConfig = rest;
|
|
129
|
+
}
|
|
130
|
+
next.nameToPaths = {};
|
|
131
|
+
for (const key in nameToPaths) next.nameToPaths[key] = [...nameToPaths[key]];
|
|
132
|
+
const {
|
|
133
|
+
fontsParsed,
|
|
134
|
+
getCSS,
|
|
135
|
+
tokensParsed,
|
|
136
|
+
themeConfig,
|
|
137
|
+
...cleanedConfig
|
|
138
|
+
} = next.tamaguiConfig;
|
|
139
|
+
return {
|
|
140
|
+
components,
|
|
141
|
+
nameToPaths,
|
|
142
|
+
tamaguiConfig: cleanedConfig
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=regenerateConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["regenerateConfig_exports","__export","generateTamaguiThemes","regenerateConfig","regenerateConfigSync","module","exports","__toCommonJS","import_node_path","require","import_generate_themes","FS","__toESM","import_requireTamaguiCore","import_bundleConfig","tamaguiDir","join","process","cwd","confFile","tamaguiOptions","configIn","rebuild","config","getBundledConfig","out","transformConfig","platform","ensureDir","dirname","writeJSON","spaces","err","env","DEBUG","includes","IS_TAMAGUI_DEV","console","warn","_tamaguiOptions","ensureDirSync","writeJSONSync","force","themeBuilder","input","output","inPath","resolveRelativePath","outPath","generatedOutput","generateThemes","hasChanged","next","generated","current","readFile","writeGeneratedThemes","inputPath","startsWith","resolve","cloneDeepSafe","x","excludeKeys","Array","isArray","map","_","Object","fromEntries","entries","flatMap","k","v","getVariableValue","requireTamaguiCore","validStyles","components","nameToPaths","tamaguiConfig","themes","tokens","key","theme","id","tkey","token","component","nameToInfo","compDefinition","parentStaticConfig","rest","staticConfig","fontsParsed","getCSS","tokensParsed","themeConfig","cleanedConfig"],"sources":["../../src/extractor/regenerateConfig.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,wBAAA;AAAAC,QAAA,CAAAD,wBAAA;EAAAE,qBAAA,EAAAA,CAAA,KAAAA,qBAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC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,gBAAA,CAAiBY,KAAA,CAAMD,IAAI,CAAC;EAE9C;EAGA,WAAWE,SAAA,IAAaV,UAAA,EACtB,WAAWV,CAAA,IAAKoB,SAAA,CAAUC,UAAA,EAAY;IAEpC,MAAMC,cAAA,GAAiB;MAAE,GAAGF,SAAA,CAAUC,UAAA,CAAWrB,CAAC;IAAE;IACpDoB,SAAA,CAAUC,UAAA,CAAWrB,CAAC,IAAIsB,cAAA;IAE1B,MAAM;MAAEC,kBAAA;MAAoB,GAAGC;IAAK,IAAIF,cAAA,CAAeG,YAAA;IACvDH,cAAA,CAAeG,YAAA,GAAeD,IAAA;EAChC;EAIFtC,IAAA,CAAKyB,WAAA,GAAc,CAAC;EACpB,WAAWI,GAAA,IAAOJ,WAAA,EAChBzB,IAAA,CAAKyB,WAAA,CAAYI,GAAG,IAAI,CAAC,GAAGJ,WAAA,CAAYI,GAAG,CAAC;EAI9C,MAAM;IAAEW,WAAA;IAAaC,MAAA;IAAQC,YAAA;IAAcC,WAAA;IAAa,GAAGC;EAAc,IACvE5C,IAAA,CAAK0B,aAAA;EAEP,OAAO;IACLF,UAAA;IACAC,WAAA;IACAC,aAAA,EAAekB;EACjB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var removeUnusedHooks_exports = {};
|
|
33
|
+
__export(removeUnusedHooks_exports, {
|
|
34
|
+
removeUnusedHooks: () => removeUnusedHooks
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(removeUnusedHooks_exports);
|
|
37
|
+
var t = __toESM(require("@babel/types"));
|
|
38
|
+
const hooks = {
|
|
39
|
+
useMedia: !0,
|
|
40
|
+
useTheme: !0
|
|
41
|
+
};
|
|
42
|
+
function removeUnusedHooks(compFn, shouldPrintDebug) {
|
|
43
|
+
compFn.scope.crawl();
|
|
44
|
+
let bodyStatements = compFn?.get("body");
|
|
45
|
+
if (!bodyStatements) {
|
|
46
|
+
console.info("no body statemnts?", compFn);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (Array.isArray(bodyStatements) || (bodyStatements.isFunctionExpression() ? bodyStatements = bodyStatements.scope.path.get("body") : bodyStatements = bodyStatements.get("body")), !bodyStatements || !Array.isArray(bodyStatements)) return;
|
|
50
|
+
const statements = bodyStatements;
|
|
51
|
+
for (const statement of statements) {
|
|
52
|
+
if (!statement.isVariableDeclaration()) continue;
|
|
53
|
+
const declarations = statement.get("declarations");
|
|
54
|
+
if (!Array.isArray(declarations)) continue;
|
|
55
|
+
const isBindingReferenced = name => !!statement.scope.getBinding(name)?.referenced;
|
|
56
|
+
for (const declarator of declarations) {
|
|
57
|
+
const id = declarator.get("id"),
|
|
58
|
+
init = declarator.node.init;
|
|
59
|
+
if (Array.isArray(id) || Array.isArray(init)) continue;
|
|
60
|
+
(() => {
|
|
61
|
+
if (!(init && t.isCallExpression(init) && t.isIdentifier(init.callee) && hooks[init.callee.name])) return !1;
|
|
62
|
+
if (t.isIdentifier(id.node)) {
|
|
63
|
+
const name = id.node.name;
|
|
64
|
+
return !isBindingReferenced(name);
|
|
65
|
+
}
|
|
66
|
+
return t.isObjectPattern(id.node) ? id.get("properties").every(prop => {
|
|
67
|
+
if (!prop.isObjectProperty()) return !1;
|
|
68
|
+
const value = prop.get("value");
|
|
69
|
+
if (Array.isArray(value) || !value.isIdentifier()) return !1;
|
|
70
|
+
const name = value.node.name;
|
|
71
|
+
return !isBindingReferenced(name);
|
|
72
|
+
}) : !1;
|
|
73
|
+
})() && (declarator.remove(), shouldPrintDebug && console.info(` [\u{1FA9D}] removed ${id.node.name ?? ""}`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=removeUnusedHooks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["removeUnusedHooks_exports","__export","removeUnusedHooks","module","exports","__toCommonJS","t","__toESM","require","hooks","useMedia","useTheme","compFn","shouldPrintDebug","scope","crawl","bodyStatements","get","console","info","Array","isArray","isFunctionExpression","path","statements","statement","isVariableDeclaration","declarations","isBindingReferenced","name","getBinding","referenced","declarator","id","init","node","isCallExpression","isIdentifier","callee","isObjectPattern","every","prop","isObjectProperty","value","remove"],"sources":["../../src/extractor/removeUnusedHooks.ts"],"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List":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var timer_exports = {};
|
|
22
|
+
__export(timer_exports, {
|
|
23
|
+
timer: () => timer
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(timer_exports);
|
|
26
|
+
const timer = () => {
|
|
27
|
+
const start = Date.now();
|
|
28
|
+
let last = start;
|
|
29
|
+
return {
|
|
30
|
+
mark: (name, print = !1) => {
|
|
31
|
+
if (print) {
|
|
32
|
+
const took = Date.now() - last;
|
|
33
|
+
last = Date.now(), console.info(`Time ${name}: ${took}ms`), took > 10 && console.info(" long timer");
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
done: (print = !1) => {
|
|
37
|
+
if (print) {
|
|
38
|
+
const total = Date.now() - start;
|
|
39
|
+
console.info(`Total time: ${total}ms`), total > 50 && console.info(" long timer");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=timer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["timer_exports","__export","timer","module","exports","__toCommonJS","start","Date","now","last","mark","name","print","took","console","info","done","total"],"sources":["../../src/extractor/timer.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA;AAAAC,QAAA,CAAAD,aAAA;EAAAE,KAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,aAAA;AAAO,MAAME,KAAA,GAAQA,CAAA,KAAM;EACzB,MAAMI,KAAA,GAAQC,IAAA,CAAKC,GAAA,CAAI;EACvB,IAAIC,IAAA,GAAOH,KAAA;EACX,OAAO;IACLI,IAAA,EAAMA,CAACC,IAAA,EAAcC,KAAA,GAAQ,OAAU;MACrC,IAAIA,KAAA,EAAO;QACT,MAAMC,IAAA,GAAON,IAAA,CAAKC,GAAA,CAAI,IAAIC,IAAA;QAC1BA,IAAA,GAAOF,IAAA,CAAKC,GAAA,CAAI,GAChBM,OAAA,CAAQC,IAAA,CAAK,QAAQJ,IAAI,KAAKE,IAAI,IAAI,GAClCA,IAAA,GAAO,MACTC,OAAA,CAAQC,IAAA,CAAK,cAAc;MAE/B;IACF;IACAC,IAAA,EAAMA,CAACJ,KAAA,GAAQ,OAAU;MACvB,IAAIA,KAAA,EAAO;QACT,MAAMK,KAAA,GAAQV,IAAA,CAAKC,GAAA,CAAI,IAAIF,KAAA;QAC3BQ,OAAA,CAAQC,IAAA,CAAK,eAAeE,KAAK,IAAI,GACjCA,KAAA,GAAQ,MACVH,OAAA,CAAQC,IAAA,CAAK,cAAc;MAE/B;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
16
21
|
var validHTMLAttributes_exports = {};
|
|
17
22
|
__export(validHTMLAttributes_exports, {
|
|
18
23
|
validHTMLAttributes: () => validHTMLAttributes
|
|
19
24
|
});
|
|
20
25
|
module.exports = __toCommonJS(validHTMLAttributes_exports);
|
|
21
|
-
|
|
26
|
+
const validHTMLAttributes = {
|
|
22
27
|
autocomplete: !0,
|
|
23
28
|
border: !0,
|
|
24
29
|
contenteditable: !0,
|
|
@@ -66,8 +71,4 @@ var validHTMLAttributes = {
|
|
|
66
71
|
"aria-selected": !0,
|
|
67
72
|
"aria-sort": !0
|
|
68
73
|
};
|
|
69
|
-
|
|
70
|
-
0 && (module.exports = {
|
|
71
|
-
validHTMLAttributes
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=validHTMLAttributes.js.map
|
|
74
|
+
//# sourceMappingURL=validHTMLAttributes.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["validHTMLAttributes_exports","__export","validHTMLAttributes","module","exports","__toCommonJS","autocomplete","border","contenteditable","crossorigin","dir","draggable","enctype","formenctype","formmethod","formtarget","inputmode","kind","link","method","preload","referrerpolicy","rel","rev","role","sandbox","shape","spellcheck","target","translate","type","wrap"],"sources":["../../src/extractor/validHTMLAttributes.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,2BAAA;AAAAC,QAAA,CAAAD,2BAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,2BAAA;AAAO,MAAME,mBAAA,GAAsB;EACjCI,YAAA,EAAc;EACdC,MAAA,EAAQ;EACRC,eAAA,EAAiB;EACjBC,WAAA,EAAa;EACbC,GAAA,EAAK;EACLC,SAAA,EAAW;EACXC,OAAA,EAAS;EACTC,WAAA,EAAa;EACbC,UAAA,EAAY;EACZC,UAAA,EAAY;EACZC,SAAA,EAAW;EACXC,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,MAAA,EAAQ;EACRC,OAAA,EAAS;EACTC,cAAA,EAAgB;EAChBC,GAAA,EAAK;EACLC,GAAA,EAAK;EACLC,IAAA,EAAM;EACNC,OAAA,EAAS;EACTC,KAAA,EAAO;EACPC,UAAA,EAAY;EACZC,MAAA,EAAQ;EACRC,SAAA,EAAW;EACXC,IAAA,EAAM;EACNC,IAAA,EAAM;EACN,qBAAqB;EACrB,aAAa;EACb,gBAAgB;EAChB,gBAAgB;EAChB,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,eAAe;EACf,gBAAgB;EAChB,eAAe;EACf,cAAc;EACd,kBAAkB;EAClB,wBAAwB;EACxB,oBAAoB;EACpB,gBAAgB;EAChB,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;EACjB,aAAa;AACf","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var watchTamaguiConfig_exports = {};
|
|
22
|
+
__export(watchTamaguiConfig_exports, {
|
|
23
|
+
watchTamaguiConfig: () => watchTamaguiConfig
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(watchTamaguiConfig_exports);
|
|
26
|
+
var import_loadTamagui = require("./loadTamagui.mjs"),
|
|
27
|
+
import_regenerateConfig = require("./regenerateConfig.mjs");
|
|
28
|
+
let isWatching = !1;
|
|
29
|
+
async function watchTamaguiConfig(tamaguiOptions) {
|
|
30
|
+
if (process.env.NODE_ENV === "production") return {
|
|
31
|
+
dispose() {}
|
|
32
|
+
};
|
|
33
|
+
if (isWatching) return;
|
|
34
|
+
isWatching = !0;
|
|
35
|
+
const options = await (0, import_loadTamagui.getOptions)({
|
|
36
|
+
tamaguiOptions
|
|
37
|
+
});
|
|
38
|
+
if (!options.tamaguiOptions.config) throw isWatching = !1, new Error("No config");
|
|
39
|
+
const disposeConfigWatcher = await (0, import_loadTamagui.esbuildWatchFiles)(options.tamaguiOptions.config, async () => {
|
|
40
|
+
await (0, import_loadTamagui.generateThemesAndLog)(options.tamaguiOptions), await (0, import_regenerateConfig.regenerateConfig)(options.tamaguiOptions, null, !0);
|
|
41
|
+
}),
|
|
42
|
+
themeBuilderInput = options.tamaguiOptions.themeBuilder?.input;
|
|
43
|
+
let disposeThemesWatcher;
|
|
44
|
+
if (themeBuilderInput) {
|
|
45
|
+
let inputPath = themeBuilderInput;
|
|
46
|
+
try {
|
|
47
|
+
inputPath = require.resolve(themeBuilderInput);
|
|
48
|
+
} catch {}
|
|
49
|
+
disposeThemesWatcher = await (0, import_loadTamagui.esbuildWatchFiles)(inputPath, async () => {
|
|
50
|
+
await (0, import_loadTamagui.generateThemesAndLog)(options.tamaguiOptions);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
dispose() {
|
|
55
|
+
isWatching = !1, disposeConfigWatcher(), disposeThemesWatcher?.();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=watchTamaguiConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["watchTamaguiConfig_exports","__export","watchTamaguiConfig","module","exports","__toCommonJS","import_loadTamagui","require","import_regenerateConfig","isWatching","tamaguiOptions","process","env","NODE_ENV","dispose","options","getOptions","config","Error","disposeConfigWatcher","esbuildWatchFiles","generateThemesAndLog","regenerateConfig","themeBuilderInput","themeBuilder","input","disposeThemesWatcher","inputPath","resolve"],"sources":["../../src/extractor/watchTamaguiConfig.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,0BAAA;AAAAC,QAAA,CAAAD,0BAAA;EAAAE,kBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,0BAAA;AACA,IAAAM,kBAAA,GAAoEC,OAAA;EACpEC,uBA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