@tamagui/static 1.88.21 → 1.88.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/esm/constants.native.js +4 -37
- package/dist/esm/constants.native.js.map +2 -2
- package/dist/esm/extractor/accessSafe.native.js +3 -32
- package/dist/esm/extractor/accessSafe.native.js.map +1 -1
- package/dist/esm/extractor/babelParse.native.js +3 -33
- package/dist/esm/extractor/babelParse.native.js.map +1 -1
- package/dist/esm/extractor/buildClassName.native.js +3 -33
- package/dist/esm/extractor/buildClassName.native.js.map +1 -1
- package/dist/esm/extractor/bundle.native.js +14 -39
- package/dist/esm/extractor/bundle.native.js.map +2 -2
- package/dist/esm/extractor/bundleConfig.native.js +36 -59
- package/dist/esm/extractor/bundleConfig.native.js.map +2 -2
- package/dist/esm/extractor/createEvaluator.native.js +12 -37
- package/dist/esm/extractor/createEvaluator.native.js.map +2 -2
- package/dist/esm/extractor/createExtractor.native.js +86 -87
- package/dist/esm/extractor/createExtractor.native.js.map +2 -2
- package/dist/esm/extractor/ensureImportingConcat.native.js +3 -32
- package/dist/esm/extractor/ensureImportingConcat.native.js.map +1 -1
- package/dist/esm/extractor/esbuildAliasPlugin.native.js +2 -23
- package/dist/esm/extractor/esbuildAliasPlugin.native.js.map +1 -1
- package/dist/esm/extractor/evaluateAstNode.native.js +3 -32
- package/dist/esm/extractor/evaluateAstNode.native.js.map +1 -1
- package/dist/esm/extractor/extractHelpers.native.js +11 -49
- package/dist/esm/extractor/extractHelpers.native.js.map +2 -2
- package/dist/esm/extractor/extractMediaStyle.native.js +10 -37
- package/dist/esm/extractor/extractMediaStyle.native.js.map +1 -1
- package/dist/esm/extractor/extractToClassNames.native.js +30 -43
- package/dist/esm/extractor/extractToClassNames.native.js.map +2 -2
- package/dist/esm/extractor/findTopmostFunction.native.js +2 -23
- package/dist/esm/extractor/findTopmostFunction.native.js.map +1 -1
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js +18 -45
- package/dist/esm/extractor/generateTamaguiStudioConfig.native.js.map +2 -2
- package/dist/esm/extractor/generatedUid.native.js +3 -32
- package/dist/esm/extractor/generatedUid.native.js.map +1 -1
- package/dist/esm/extractor/getPrefixLogs.native.js +2 -23
- package/dist/esm/extractor/getPrefixLogs.native.js.map +1 -1
- package/dist/esm/extractor/getPropValueFromAttributes.native.js +7 -34
- package/dist/esm/extractor/getPropValueFromAttributes.native.js.map +2 -2
- package/dist/esm/extractor/getSourceModule.native.js +3 -32
- package/dist/esm/extractor/getSourceModule.native.js.map +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.native.js +13 -39
- package/dist/esm/extractor/getStaticBindingsForScope.native.js.map +1 -1
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js +4 -25
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +1 -1
- package/dist/esm/extractor/hoistClassNames.native.js +3 -32
- package/dist/esm/extractor/hoistClassNames.native.js.map +1 -1
- package/dist/esm/extractor/literalToAst.native.js +3 -33
- package/dist/esm/extractor/literalToAst.native.js.map +1 -1
- package/dist/esm/extractor/loadFile.native.js +0 -1
- package/dist/esm/extractor/loadFile.native.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.native.js +60 -73
- package/dist/esm/extractor/loadTamagui.native.js.map +2 -2
- package/dist/esm/extractor/logLines.native.js +2 -23
- package/dist/esm/extractor/logLines.native.js.map +1 -1
- package/dist/esm/extractor/normalizeTernaries.native.js +7 -34
- package/dist/esm/extractor/normalizeTernaries.native.js.map +2 -2
- package/dist/esm/extractor/propsToFontFamilyCache.native.js +2 -25
- package/dist/esm/extractor/propsToFontFamilyCache.native.js.map +1 -1
- package/dist/esm/extractor/removeUnusedHooks.native.js +3 -32
- package/dist/esm/extractor/removeUnusedHooks.native.js.map +1 -1
- package/dist/esm/extractor/timer.native.js +2 -23
- package/dist/esm/extractor/timer.native.js.map +1 -1
- package/dist/esm/extractor/validHTMLAttributes.native.js +2 -23
- package/dist/esm/extractor/validHTMLAttributes.native.js.map +1 -1
- package/dist/esm/getPragmaOptions.native.js +2 -23
- package/dist/esm/getPragmaOptions.native.js.map +1 -1
- package/dist/esm/helpers/memoize.native.js +2 -23
- package/dist/esm/helpers/memoize.native.js.map +1 -1
- package/dist/esm/helpers/requireTamaguiCore.native.js +2 -23
- package/dist/esm/helpers/requireTamaguiCore.native.js.map +1 -1
- package/dist/esm/index.native.js +3 -22
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/minifyCSS.native.js +6 -34
- package/dist/esm/minifyCSS.native.js.map +2 -2
- package/dist/esm/registerRequire.native.js +6 -28
- package/dist/esm/registerRequire.native.js.map +1 -1
- package/dist/esm/server.native.js +5 -34
- package/dist/esm/server.native.js.map +2 -2
- package/dist/esm/setup.native.js +0 -1
- package/dist/esm/setup.native.js.map +1 -1
- package/dist/esm/static.native.js +12 -39
- package/dist/esm/static.native.js.map +1 -1
- package/dist/esm/types.native.js +0 -14
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/webpackPlugin.native.js +2 -23
- package/dist/esm/webpackPlugin.native.js.map +1 -1
- package/package.json +14 -14
@@ -1,32 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
};
|
16
|
-
|
17
|
-
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var extractToClassNames_exports = {};
|
25
|
-
__export(extractToClassNames_exports, {
|
26
|
-
extractToClassNames: () => extractToClassNames
|
27
|
-
});
|
28
|
-
module.exports = __toCommonJS(extractToClassNames_exports);
|
29
|
-
var path = __toESM(require("path")), import_path = require("path"), util = __toESM(require("util")), import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_helpers = require("@tamagui/helpers"), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_babelParse = require("./babelParse"), import_buildClassName = require("./buildClassName"), import_ensureImportingConcat = require("./ensureImportingConcat"), import_extractHelpers = require("./extractHelpers"), import_extractMediaStyle = require("./extractMediaStyle"), import_getPrefixLogs = require("./getPrefixLogs"), import_hoistClassNames = require("./hoistClassNames"), import_logLines = require("./logLines"), import_propsToFontFamilyCache = require("./propsToFontFamilyCache"), import_timer = require("./timer");
|
1
|
+
import * as path from "path";
|
2
|
+
import { basename } from "path";
|
3
|
+
import * as util from "util";
|
4
|
+
import generate from "@babel/generator";
|
5
|
+
import * as t from "@babel/types";
|
6
|
+
import { concatClassName } from "@tamagui/helpers";
|
7
|
+
import { requireTamaguiCore } from "../helpers/requireTamaguiCore";
|
8
|
+
import { babelParse } from "./babelParse";
|
9
|
+
import { buildClassName } from "./buildClassName";
|
10
|
+
import { ensureImportingConcat } from "./ensureImportingConcat";
|
11
|
+
import { isSimpleSpread } from "./extractHelpers";
|
12
|
+
import { extractMediaStyle } from "./extractMediaStyle";
|
13
|
+
import { getPrefixLogs } from "./getPrefixLogs";
|
14
|
+
import { hoistClassNames } from "./hoistClassNames";
|
15
|
+
import { logLines } from "./logLines";
|
16
|
+
import { getFontFamilyClassNameFromProps } from "./propsToFontFamilyCache";
|
17
|
+
import { timer } from "./timer";
|
30
18
|
const mergeStyleGroups = {
|
31
19
|
shadowOpacity: !0,
|
32
20
|
shadowRadius: !0,
|
@@ -40,7 +28,7 @@ async function extractToClassNames({
|
|
40
28
|
options,
|
41
29
|
shouldPrintDebug
|
42
30
|
}) {
|
43
|
-
const tm =
|
31
|
+
const tm = timer(), { getStylesAtomic } = requireTamaguiCore("web");
|
44
32
|
if (sourcePath != null && sourcePath.includes("node_modules"))
|
45
33
|
return null;
|
46
34
|
if (shouldPrintDebug && console.warn(`--- ${sourcePath} ---
|
@@ -55,7 +43,7 @@ async function extractToClassNames({
|
|
55
43
|
const shouldLogTiming = options.logTimings ?? !0, start = Date.now(), mem = process.env.TAMAGUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
|
56
44
|
let ast;
|
57
45
|
try {
|
58
|
-
ast =
|
46
|
+
ast = babelParse(source, sourcePath);
|
59
47
|
} catch (err) {
|
60
48
|
throw console.error("babel parse error:", sourcePath == null ? void 0 : sourcePath.slice(0, 100)), err;
|
61
49
|
}
|
@@ -119,7 +107,7 @@ async function extractToClassNames({
|
|
119
107
|
switch (attr.type) {
|
120
108
|
case "style": {
|
121
109
|
if (isFlattened) {
|
122
|
-
const styles2 = addStyles(attr.value), newFontFamily =
|
110
|
+
const styles2 = addStyles(attr.value), newFontFamily = getFontFamilyClassNameFromProps(attr.value) || "", newClassNames = concatClassName(
|
123
111
|
styles2.map((x) => x.identifier).join(" ") + newFontFamily
|
124
112
|
), existing = finalClassNames.find(
|
125
113
|
(x) => x.type == "StringLiteral"
|
@@ -144,7 +132,7 @@ async function extractToClassNames({
|
|
144
132
|
case "attr": {
|
145
133
|
const val = attr.value;
|
146
134
|
if (t.isJSXSpreadAttribute(val))
|
147
|
-
|
135
|
+
isSimpleSpread(val) && finalClassNames.push(
|
148
136
|
t.logicalExpression(
|
149
137
|
"&&",
|
150
138
|
val.argument,
|
@@ -166,7 +154,7 @@ async function extractToClassNames({
|
|
166
154
|
break;
|
167
155
|
}
|
168
156
|
case "ternary": {
|
169
|
-
const mediaExtraction =
|
157
|
+
const mediaExtraction = extractMediaStyle(
|
170
158
|
parserProps,
|
171
159
|
attr.value,
|
172
160
|
jsxPath,
|
@@ -217,16 +205,16 @@ async function extractToClassNames({
|
|
217
205
|
if (shouldPrintDebug && console.info(
|
218
206
|
` finalClassNames
|
219
207
|
`,
|
220
|
-
|
208
|
+
logLines(finalClassNames.map((x) => x.value).join(" "))
|
221
209
|
), node.attributes = finalAttrs, finalClassNames.length) {
|
222
210
|
const extraClassNames = (() => {
|
223
211
|
let value = "";
|
224
212
|
return isFlattened && (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS && (value += "is_tamagui_flattened"), staticConfig.componentName && (value += ` is_${staticConfig.componentName}`)), value;
|
225
|
-
})(), names =
|
213
|
+
})(), names = buildClassName(finalClassNames, extraClassNames), nameExpr = names ? hoistClassNames(jsxPath, existingHoists, names) : null;
|
226
214
|
let expr = nameExpr;
|
227
215
|
if (nameExpr && !t.isIdentifier(nameExpr) && didFlattenThisTag) {
|
228
|
-
|
229
|
-
const simpleSpreads = attrs.filter((x) => x.type === "attr" && t.isJSXSpreadAttribute(x.value) &&
|
216
|
+
ensureImportingConcat(programPath);
|
217
|
+
const simpleSpreads = attrs.filter((x) => x.type === "attr" && t.isJSXSpreadAttribute(x.value) && isSimpleSpread(x.value));
|
230
218
|
expr = t.callExpression(t.identifier("concatClassName"), [
|
231
219
|
expr,
|
232
220
|
...simpleSpreads.map((val) => val.value.argument)
|
@@ -261,7 +249,7 @@ async function extractToClassNames({
|
|
261
249
|
if (!res || !res.modified && !res.optimized && !res.flattened && !res.styled)
|
262
250
|
return shouldPrintDebug && console.info("no res or none modified", res), null;
|
263
251
|
const styles = Array.from(cssMap.values()).map((x) => x.css).join(`
|
264
|
-
`).trim(), result = (
|
252
|
+
`).trim(), result = generate(
|
265
253
|
ast,
|
266
254
|
{
|
267
255
|
concise: !1,
|
@@ -285,7 +273,7 @@ async function extractToClassNames({
|
|
285
273
|
-------- output style --------
|
286
274
|
|
287
275
|
`, styles)), shouldLogTiming) {
|
288
|
-
const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0, path2 =
|
276
|
+
const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0, path2 = basename(sourcePath || "").replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padStart(24), numOptimized = `${res.optimized + res.styled}`.padStart(3), numFound = `${res.found + res.styled}`.padStart(3), numFlattened = `${res.flattened}`.padStart(3), memory = memUsed ? ` ${memUsed}MB` : "", timingStr = `${Date.now() - start}ms`.padStart(6), pre = getPrefixLogs(options), memStr = memory ? `(${memory})` : "";
|
289
277
|
console.info(
|
290
278
|
`${pre} ${path2} \xB7 ${numFound} found \xB7 ${numOptimized} opt \xB7 ${numFlattened} flat ${timingStr} ${memStr}`
|
291
279
|
);
|
@@ -297,8 +285,7 @@ async function extractToClassNames({
|
|
297
285
|
map: result.map
|
298
286
|
};
|
299
287
|
}
|
300
|
-
|
301
|
-
0 && (module.exports = {
|
288
|
+
export {
|
302
289
|
extractToClassNames
|
303
|
-
}
|
290
|
+
};
|
304
291
|
//# sourceMappingURL=extractToClassNames.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/extractToClassNames.ts"],
|
4
|
-
"mappings": "
|
5
|
-
"names": ["res", "styles", "
|
4
|
+
"mappings": "AAAA,YAAY,UAAU;AACtB,SAAS,gBAAgB;AACzB,YAAY,UAAU;AAEtB,OAAO,cAAc;AACrB,YAAY,OAAO;AACnB,SAAS,uBAAuB;AAGhC,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAC3B,SAAS,sBAAsB;AAE/B,SAAS,6BAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,yBAAyB;AAClC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,gBAAgB;AACzB,SAAS,uCAAuC;AAChD,SAAS,aAAa;AAEtB,MAAM,mBAAmB;AAAA,EACvB,eAAe;AAAA,EACf,cAAc;AAAA,EACd,aAAa;AAAA,EACb,cAAc;AAChB;AAkBA,eAAsB,oBAAoB;AAAA,EACxC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgE;AAC9D,QAAM,KAAK,M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I,MAAM,GAAG,SAAS,CAAC,GACjD,eAAe,GAAG,IAAI,SAAS,GAAG,SAAS,CAAC,GAC5C,SAAS,UAAU,IAAI,OAAO,OAAO,IAErC,YAAY,GADH,KAAK,IAAI,IAAI,KACD,KAAK,SAAS,CAAC,GACpC,MAAM,cAAc,OAAO,GAC3B,SAAS,SAAS,IAAI,MAAM,MAAM;AACxC,YAAQ;AAAA,MACN,GAAG,GAAG,IAAIA,KAAI,YAAS,QAAQ,kBAAe,YAAY,gBAAa,YAAY,UAAU,SAAS,IAAI,MAAM;AAAA,IAClH;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,OAAO;AAAA,IACX,KAAK,OAAO;AAAA,EACd;AACF;",
|
5
|
+
"names": ["res", "styles", "path"]
|
6
6
|
}
|
@@ -1,23 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
11
|
-
for (let key of __getOwnPropNames(from))
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
-
return to;
|
14
|
-
};
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
16
|
-
var findTopmostFunction_exports = {};
|
17
|
-
__export(findTopmostFunction_exports, {
|
18
|
-
findTopmostFunction: () => findTopmostFunction
|
19
|
-
});
|
20
|
-
module.exports = __toCommonJS(findTopmostFunction_exports);
|
21
1
|
function findTopmostFunction(jsxPath) {
|
22
2
|
const isFunction = (path) => path.isArrowFunctionExpression() || path.isFunctionDeclaration() || path.isFunctionExpression();
|
23
3
|
let compFn = jsxPath.findParent(isFunction);
|
@@ -30,8 +10,7 @@ function findTopmostFunction(jsxPath) {
|
|
30
10
|
}
|
31
11
|
return compFn || null;
|
32
12
|
}
|
33
|
-
|
34
|
-
0 && (module.exports = {
|
13
|
+
export {
|
35
14
|
findTopmostFunction
|
36
|
-
}
|
15
|
+
};
|
37
16
|
//# sourceMappingURL=findTopmostFunction.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/findTopmostFunction.ts"],
|
4
|
-
"mappings": "
|
4
|
+
"mappings": "AAGO,SAAS,oBAAoB,SAAiC;AAEnE,QAAM,aAAa,CAAC,SAClB,KAAK,0BAA0B,KAC/B,KAAK,sBAAsB,KAC3B,KAAK,qBAAqB;AAC5B,MAAI,SAA+B,QAAQ,WAAW,UAAU;AAChE,SAAO,UAAQ;AACb,UAAM,SAAS,OAAO,WAAW,UAAU;AAC3C,QAAI;AACF,eAAS;AAAA;AAET;AAAA,EAEJ;AACA,SAAK,UAEI;AAGX;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -1,43 +1,17 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
-
return to;
|
15
|
-
};
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var generateTamaguiStudioConfig_exports = {};
|
25
|
-
__export(generateTamaguiStudioConfig_exports, {
|
26
|
-
generateTamaguiStudioConfig: () => generateTamaguiStudioConfig,
|
27
|
-
generateTamaguiStudioConfigSync: () => generateTamaguiStudioConfigSync,
|
28
|
-
generateTamaguiThemes: () => generateTamaguiThemes
|
29
|
-
});
|
30
|
-
module.exports = __toCommonJS(generateTamaguiStudioConfig_exports);
|
31
|
-
var import_path = require("path"), import_generate_themes = require("@tamagui/generate-themes"), import_fs_extra = __toESM(require("fs-extra")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_bundleConfig = require("./bundleConfig");
|
32
|
-
const tamaguiDir = (0, import_path.join)(process.cwd(), ".tamagui"), confFile = (0, import_path.join)(tamaguiDir, "tamagui.config.json");
|
1
|
+
import { dirname, join } from "path";
|
2
|
+
import { generateThemes, writeGeneratedThemes } from "@tamagui/generate-themes";
|
3
|
+
import fs, { readFile } from "fs-extra";
|
4
|
+
import { requireTamaguiCore } from "../helpers/requireTamaguiCore";
|
5
|
+
import { getBundledConfig } from "./bundleConfig";
|
6
|
+
const tamaguiDir = join(process.cwd(), ".tamagui"), confFile = join(tamaguiDir, "tamagui.config.json");
|
33
7
|
async function generateTamaguiStudioConfig(tamaguiOptions, configIn, rebuild = !1) {
|
34
8
|
var _a;
|
35
9
|
try {
|
36
|
-
const config = configIn ?? await
|
10
|
+
const config = configIn ?? await getBundledConfig(tamaguiOptions, rebuild);
|
37
11
|
if (!config)
|
38
12
|
return;
|
39
13
|
const out = transformConfig(config, tamaguiOptions.platform);
|
40
|
-
await
|
14
|
+
await fs.ensureDir(dirname(confFile)), await fs.writeJSON(confFile, out, {
|
41
15
|
spaces: 2
|
42
16
|
});
|
43
17
|
} catch (err) {
|
@@ -47,7 +21,7 @@ async function generateTamaguiStudioConfig(tamaguiOptions, configIn, rebuild = !
|
|
47
21
|
function generateTamaguiStudioConfigSync(_tamaguiOptions, config) {
|
48
22
|
var _a;
|
49
23
|
try {
|
50
|
-
|
24
|
+
fs.ensureDirSync(dirname(confFile)), fs.writeJSONSync(confFile, transformConfig(config, _tamaguiOptions.platform), {
|
51
25
|
spaces: 2
|
52
26
|
});
|
53
27
|
} catch (err) {
|
@@ -57,23 +31,23 @@ function generateTamaguiStudioConfigSync(_tamaguiOptions, config) {
|
|
57
31
|
async function generateTamaguiThemes(tamaguiOptions, force = !1) {
|
58
32
|
if (!tamaguiOptions.themeBuilder)
|
59
33
|
return;
|
60
|
-
const { input, output } = tamaguiOptions.themeBuilder, inPath = resolveRelativePath(input), outPath = resolveRelativePath(output), generatedOutput = await
|
34
|
+
const { input, output } = tamaguiOptions.themeBuilder, inPath = resolveRelativePath(input), outPath = resolveRelativePath(output), generatedOutput = await generateThemes(inPath), hasChanged = force || await (async () => {
|
61
35
|
try {
|
62
|
-
if (!await
|
63
|
-
|
36
|
+
if (!await fs.pathExists(
|
37
|
+
join(tamaguiDir, "theme-builder.json")
|
64
38
|
))
|
65
39
|
return !0;
|
66
40
|
if (!generatedOutput)
|
67
41
|
return !1;
|
68
|
-
const next = generatedOutput.generated, current = await
|
42
|
+
const next = generatedOutput.generated, current = await readFile(outPath, "utf-8");
|
69
43
|
return next !== current;
|
70
44
|
} catch {
|
71
45
|
}
|
72
46
|
return !0;
|
73
47
|
})();
|
74
|
-
return hasChanged && await
|
48
|
+
return hasChanged && await writeGeneratedThemes(tamaguiDir, outPath, generatedOutput), hasChanged;
|
75
49
|
}
|
76
|
-
const resolveRelativePath = (inputPath) => inputPath.startsWith(".") ?
|
50
|
+
const resolveRelativePath = (inputPath) => inputPath.startsWith(".") ? join(process.cwd(), inputPath) : require.resolve(inputPath);
|
77
51
|
function cloneDeepSafe(x, excludeKeys = {}) {
|
78
52
|
return x && (Array.isArray(x) ? x.map((_) => cloneDeepSafe(_)) : typeof x == "function" ? "Function" : typeof x != "object" ? x : "$$typeof" in x ? "Component" : Object.fromEntries(
|
79
53
|
Object.entries(x).flatMap(([k, v]) => excludeKeys[k] ? [] : [[k, cloneDeepSafe(v)]])
|
@@ -82,7 +56,7 @@ function cloneDeepSafe(x, excludeKeys = {}) {
|
|
82
56
|
function transformConfig(config, platform) {
|
83
57
|
if (!config)
|
84
58
|
return null;
|
85
|
-
const { getVariableValue } =
|
59
|
+
const { getVariableValue } = requireTamaguiCore(platform), next = cloneDeepSafe(config, {
|
86
60
|
validStyles: !0
|
87
61
|
}), { components, nameToPaths, tamaguiConfig } = next, { themes, tokens } = tamaguiConfig;
|
88
62
|
for (const key in themes) {
|
@@ -113,10 +87,9 @@ function transformConfig(config, platform) {
|
|
113
87
|
tamaguiConfig: cleanedConfig
|
114
88
|
};
|
115
89
|
}
|
116
|
-
|
117
|
-
0 && (module.exports = {
|
90
|
+
export {
|
118
91
|
generateTamaguiStudioConfig,
|
119
92
|
generateTamaguiStudioConfigSync,
|
120
93
|
generateTamaguiThemes
|
121
|
-
}
|
94
|
+
};
|
122
95
|
//# sourceMappingURL=generateTamaguiStudioConfig.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/generateTamaguiStudioConfig.ts"],
|
4
|
-
"mappings": "
|
5
|
-
"names": [
|
4
|
+
"mappings": "AAAA,SAAS,SAAS,YAAY;AAE9B,SAAS,gBAAgB,4BAA4B;AAErD,OAAO,MAAM,gBAAgB;AAE7B,SAAS,0BAA0B;AAGnC,SAAS,wBAAwB;AA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9C;AAGA,aAAW,aAAa;AACtB,eAAW,KAAK,UAAU,YAAY;AAEpC,YAAM,iBAAiB,EAAE,GAAG,UAAU,WAAW,CAAC,EAAE;AACpD,gBAAU,WAAW,CAAC,IAAI;AAE1B,YAAM,EAAE,oBAAoB,GAAG,KAAK,IAAI,eAAe;AACvD,qBAAe,eAAe;AAAA,IAChC;AAIF,OAAK,cAAc,CAAC;AACpB,aAAW,OAAO;AAChB,SAAK,YAAY,GAAG,IAAI,CAAC,GAAG,YAAY,GAAG,CAAC;AAI9C,QAAM,EAAE,aAAa,QAAQ,cAAc,aAAa,GAAG,cAAc,IACvE,KAAK;AAEP,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,eAAe;AAAA,EACjB;AACF;",
|
5
|
+
"names": []
|
6
6
|
}
|
@@ -1,32 +1,4 @@
|
|
1
|
-
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
-
return to;
|
15
|
-
};
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var generatedUid_exports = {};
|
25
|
-
__export(generatedUid_exports, {
|
26
|
-
generateUid: () => generateUid
|
27
|
-
});
|
28
|
-
module.exports = __toCommonJS(generatedUid_exports);
|
29
|
-
var t = __toESM(require("@babel/types"));
|
1
|
+
import * as t from "@babel/types";
|
30
2
|
function generateUid(scope, name) {
|
31
3
|
if (typeof scope != "object")
|
32
4
|
throw "generateUid expects a scope object as its first parameter";
|
@@ -40,8 +12,7 @@ function generateUid(scope, name) {
|
|
40
12
|
const program = scope.getProgramParent();
|
41
13
|
return program.references[uid] = !0, program.uids[uid] = !0, uid;
|
42
14
|
}
|
43
|
-
|
44
|
-
0 && (module.exports = {
|
15
|
+
export {
|
45
16
|
generateUid
|
46
|
-
}
|
17
|
+
};
|
47
18
|
//# sourceMappingURL=generatedUid.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/generatedUid.ts"],
|
4
|
-
"mappings": "
|
4
|
+
"mappings": "AAAA,YAAY,OAAO;AASZ,SAAS,YAAY,OAAY,MAAsB;AAC5D,MAAM,OAAO,SAAU;AACrB,UAAM;AACR,MAAI,EAAE,OAAO,QAAS,YAAY,SAAS;AACzC,UAAM;AAER,SAAO,EACJ,aAAa,IAAI,EACjB,QAAQ,OAAO,EAAE,EACjB,QAAQ,YAAY,EAAE;AAEzB,MAAI,KACA,IAAI;AACR;AACE,IAAI,IAAI,IACN,MAAM,OAAO,IAEb,MAAM,MAER;AAAA,SAEA,MAAM,SAAS,GAAG,KAClB,MAAM,WAAW,GAAG,KACpB,MAAM,UAAU,GAAG,KACnB,MAAM,aAAa,GAAG;AAGxB,QAAM,UAAU,MAAM,iBAAiB;AACvC,iBAAQ,WAAW,GAAG,IAAI,IAC1B,QAAQ,KAAK,GAAG,IAAI,IAEb;AACT;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -1,28 +1,7 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
-
var __export = (target, all) => {
|
7
|
-
for (var name in all)
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
11
|
-
for (let key of __getOwnPropNames(from))
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
13
|
-
return to;
|
14
|
-
};
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
16
|
-
var getPrefixLogs_exports = {};
|
17
|
-
__export(getPrefixLogs_exports, {
|
18
|
-
getPrefixLogs: () => getPrefixLogs
|
19
|
-
});
|
20
|
-
module.exports = __toCommonJS(getPrefixLogs_exports);
|
21
1
|
function getPrefixLogs(options) {
|
22
2
|
return (options == null ? void 0 : options.prefixLogs) ?? ` ${(options == null ? void 0 : options.platform) || "web"} | `;
|
23
3
|
}
|
24
|
-
|
25
|
-
0 && (module.exports = {
|
4
|
+
export {
|
26
5
|
getPrefixLogs
|
27
|
-
}
|
6
|
+
};
|
28
7
|
//# sourceMappingURL=getPrefixLogs.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/getPrefixLogs.ts"],
|
4
|
-
"mappings": "
|
4
|
+
"mappings": "AAEO,SAAS,cAAc,SAA0B;AACtD,UAAO,mCAAS,eAAc,KAAI,mCAAS,aAAY,KAAK;AAC9D;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -1,32 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
-
return to;
|
15
|
-
};
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var getPropValueFromAttributes_exports = {};
|
25
|
-
__export(getPropValueFromAttributes_exports, {
|
26
|
-
getPropValueFromAttributes: () => getPropValueFromAttributes
|
27
|
-
});
|
28
|
-
module.exports = __toCommonJS(getPropValueFromAttributes_exports);
|
29
|
-
var import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_accessSafe = require("./accessSafe");
|
1
|
+
import generate from "@babel/generator";
|
2
|
+
import * as t from "@babel/types";
|
3
|
+
import { accessSafe } from "./accessSafe";
|
30
4
|
function getPropValueFromAttributes(propName, attrs) {
|
31
5
|
let propIndex = -1, jsxAttr = null;
|
32
6
|
for (let idx = -1, len = attrs.length; ++idx < len; ) {
|
@@ -52,19 +26,18 @@ function getPropValueFromAttributes(propName, attrs) {
|
|
52
26
|
return !1;
|
53
27
|
throw new Error(
|
54
28
|
`unsupported spread of type "${attr.argument.type}": ${// @ts-ignore
|
55
|
-
(
|
29
|
+
generate(attr).code}`
|
56
30
|
);
|
57
31
|
}
|
58
32
|
return !1;
|
59
33
|
}
|
60
34
|
).map((attr) => attr.argument);
|
61
35
|
return applicableSpreads.length > 0 && (propValue = applicableSpreads.reduce(
|
62
|
-
(acc, val) => t.logicalExpression("||",
|
36
|
+
(acc, val) => t.logicalExpression("||", accessSafe(val, propName), acc),
|
63
37
|
propValue
|
64
38
|
)), propValue;
|
65
39
|
}
|
66
|
-
|
67
|
-
0 && (module.exports = {
|
40
|
+
export {
|
68
41
|
getPropValueFromAttributes
|
69
|
-
}
|
42
|
+
};
|
70
43
|
//# sourceMappingURL=getPropValueFromAttributes.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/getPropValueFromAttributes.ts"],
|
4
|
-
"mappings": "
|
5
|
-
"names": [
|
4
|
+
"mappings": "AAAA,OAAO,cAAc;AACrB,YAAY,OAAO;AAEnB,SAAS,kBAAkB;AAkBpB,SAAS,2BACd,UACA,OACqB;AACrB,MAAI,YAAY,IACZ,UAAiC;AACrC,WAAS,MAAM,IAAI,MAAM,MAAM,QAAQ,EAAE,MAAM,OAAO;AACpD,UAAM,OAAO,MAAM,GAAG;AACtB,QAAI,EAAE,eAAe,IAAI,KAAK,KAAK,QAAQ,KAAK,KAAK,SAAS,UAAU;AACtE,kBAAY,KACZ,UAAU;AACV;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,WAAW,QAAQ,SAAS;AAC/B,WAAO;AAGT,MAAI,YAMe,QAAQ;AAO3B,MALI,EAAE,yBAAyB,SAAS,MACtC,YAAY,UAAU,aAIpB,EAAE,qBAAqB,SAAS;AAClC,mBAAQ,MAAM,gCAAgC,GACvC;AAIT,QAAM,oBAAoB,MACvB;AAAA;AAAA;AAAA,IAGC,CAAC,MAAM,QAAsC;AAC3C,UAAI,EAAE,qBAAqB,IAAI,GAAG;AAChC,YAAI,EAAE,aAAa,KAAK,QAAQ,KAAK,EAAE,mBAAmB,KAAK,QAAQ;AACrE,iBAAO,MAAM;AAEf,YAAI,EAAE,oBAAoB,KAAK,QAAQ;AACrC,iBAAO;AAET,cAAM,IAAI;AAAA,UACR,+BAA+B,KAAK,SAAS,IAAI;AAAA,UAE/C,SAAS,IAAW,EAAE,IACxB;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF,EACC,IAAI,CAAC,SAAS,KAAK,QAAQ;AAK9B,SAAI,kBAAkB,SAAS,MAC7B,YAAY,kBAAkB;AAAA,IAC5B,CAAC,KAAK,QAAQ,EAAE,kBAAkB,MAAM,WAAW,KAAK,QAAQ,GAAG,GAAG;AAAA,IACtE;AAAA,EACF,IAGK;AACT;",
|
5
|
+
"names": []
|
6
6
|
}
|
@@ -1,32 +1,4 @@
|
|
1
|
-
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all)
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
10
|
-
}, __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from == "object" || typeof from == "function")
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
14
|
-
return to;
|
15
|
-
};
|
16
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
17
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
18
|
-
// file that has been converted to a CommonJS file using a Babel-
|
19
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
20
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
21
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
22
|
-
mod
|
23
|
-
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
24
|
-
var getSourceModule_exports = {};
|
25
|
-
__export(getSourceModule_exports, {
|
26
|
-
getSourceModule: () => getSourceModule
|
27
|
-
});
|
28
|
-
module.exports = __toCommonJS(getSourceModule_exports);
|
29
|
-
var t = __toESM(require("@babel/types"));
|
1
|
+
import * as t from "@babel/types";
|
30
2
|
function getSourceModule(itemName, itemBinding) {
|
31
3
|
if (!itemBinding.constant)
|
32
4
|
return null;
|
@@ -64,8 +36,7 @@ function getSourceModule(itemName, itemBinding) {
|
|
64
36
|
usesImportSyntax
|
65
37
|
};
|
66
38
|
}
|
67
|
-
|
68
|
-
0 && (module.exports = {
|
39
|
+
export {
|
69
40
|
getSourceModule
|
70
|
-
}
|
41
|
+
};
|
71
42
|
//# sourceMappingURL=getSourceModule.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/extractor/getSourceModule.ts"],
|
4
|
-
"mappings": "
|
4
|
+
"mappings": "AAAA,YAAY,OAAO;AAUZ,SAAS,gBACd,UACA,aAIqB;AAErB,MAAI,CAAC,YAAY;AACf,WA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