@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,149 @@
|
|
|
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 bundle_exports = {};
|
|
33
|
+
__export(bundle_exports, {
|
|
34
|
+
esbuildIgnoreFilesRegex: () => esbuildIgnoreFilesRegex,
|
|
35
|
+
esbuildLoaderConfig: () => esbuildLoaderConfig,
|
|
36
|
+
esbundleTamaguiConfig: () => esbundleTamaguiConfig
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(bundle_exports);
|
|
39
|
+
var import_node_path = require("node:path"),
|
|
40
|
+
import_esbuild = __toESM(require("esbuild")),
|
|
41
|
+
FS = __toESM(require("fs-extra")),
|
|
42
|
+
import_esbuildAliasPlugin = require("./esbuildAliasPlugin.mjs"),
|
|
43
|
+
import_loadTamagui = require("./loadTamagui.mjs"),
|
|
44
|
+
import_esbuildTsconfigPaths = require("./esbuildTsconfigPaths.mjs");
|
|
45
|
+
const esbuildLoaderConfig = {
|
|
46
|
+
".js": "jsx",
|
|
47
|
+
".png": "dataurl",
|
|
48
|
+
".jpg": "dataurl",
|
|
49
|
+
".jpeg": "dataurl",
|
|
50
|
+
".svg": "dataurl",
|
|
51
|
+
".gif": "dataurl",
|
|
52
|
+
".webp": "dataurl",
|
|
53
|
+
".woff2": "dataurl",
|
|
54
|
+
".woff": "dataurl",
|
|
55
|
+
".eot": "dataurl",
|
|
56
|
+
".otf": "dataurl",
|
|
57
|
+
".ttf": "dataurl",
|
|
58
|
+
".mp4": "file",
|
|
59
|
+
".mpeg4": "file",
|
|
60
|
+
".mov": "file",
|
|
61
|
+
".avif": "file",
|
|
62
|
+
".wmv": "file",
|
|
63
|
+
".webm": "file",
|
|
64
|
+
".wav": "file",
|
|
65
|
+
".aac": "file",
|
|
66
|
+
".ogg": "file",
|
|
67
|
+
".flac": "file",
|
|
68
|
+
".node": "empty"
|
|
69
|
+
},
|
|
70
|
+
dataExtensions = Object.keys(esbuildLoaderConfig).filter(k => esbuildLoaderConfig[k] === "file" || esbuildLoaderConfig[k] === "dataurl").map(k => k.slice(1)),
|
|
71
|
+
esbuildIgnoreFilesRegex = new RegExp(`.(${dataExtensions.join("|")})$`, "i");
|
|
72
|
+
function getESBuildConfig({
|
|
73
|
+
entryPoints,
|
|
74
|
+
resolvePlatformSpecificEntries,
|
|
75
|
+
...options
|
|
76
|
+
}, platform, aliases) {
|
|
77
|
+
return process.env.DEBUG?.startsWith("tamagui") && console.info("Building", entryPoints), {
|
|
78
|
+
bundle: !0,
|
|
79
|
+
entryPoints: resolvePlatformSpecificEntries ? entryPoints.map(import_loadTamagui.resolveWebOrNativeSpecificEntry) : entryPoints,
|
|
80
|
+
format: "cjs",
|
|
81
|
+
target: "node20",
|
|
82
|
+
jsx: "transform",
|
|
83
|
+
jsxFactory: "react",
|
|
84
|
+
allowOverwrite: !0,
|
|
85
|
+
keepNames: !0,
|
|
86
|
+
resolveExtensions: [".web.tsx", ".web.ts", ".web.jsx", ".web.js", ".tsx", ".ts", ".jsx", ".js"],
|
|
87
|
+
platform: "node",
|
|
88
|
+
tsconfigRaw: {
|
|
89
|
+
compilerOptions: {
|
|
90
|
+
jsx: "react-jsx"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
loader: esbuildLoaderConfig,
|
|
94
|
+
logLevel: "warning",
|
|
95
|
+
plugins: [(0, import_esbuildTsconfigPaths.TsconfigPathsPlugin)(), {
|
|
96
|
+
name: "external",
|
|
97
|
+
setup(build) {
|
|
98
|
+
build.onResolve({
|
|
99
|
+
filter: /@tamagui\/core/
|
|
100
|
+
}, args => ({
|
|
101
|
+
path: platform === "native" ? "@tamagui/core/native" : "@tamagui/core",
|
|
102
|
+
external: !0
|
|
103
|
+
})), build.onResolve({
|
|
104
|
+
filter: /react-native\/package.json$/
|
|
105
|
+
}, args => ({
|
|
106
|
+
path: "react-native/package.json",
|
|
107
|
+
external: !0
|
|
108
|
+
})), build.onResolve({
|
|
109
|
+
filter: /@tamagui\/web/
|
|
110
|
+
}, args => ({
|
|
111
|
+
path: platform === "native" ? "@tamagui/core/native" : "@tamagui/core",
|
|
112
|
+
external: !0
|
|
113
|
+
})), build.onResolve({
|
|
114
|
+
filter: /^(react-native|react-native\/.*)$/
|
|
115
|
+
}, args => ({
|
|
116
|
+
path: "@tamagui/react-native-web-lite",
|
|
117
|
+
external: !0
|
|
118
|
+
})), build.onResolve({
|
|
119
|
+
filter: /react-native-reanimated/
|
|
120
|
+
}, args => ({
|
|
121
|
+
path: "react-native-reanimated",
|
|
122
|
+
external: !0
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
}, (0, import_esbuildAliasPlugin.esbuildAliasPlugin)({
|
|
126
|
+
...aliases
|
|
127
|
+
})],
|
|
128
|
+
...options
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
async function esbundleTamaguiConfig(props, platform, aliases) {
|
|
132
|
+
await asyncLock(props);
|
|
133
|
+
const config = getESBuildConfig(props, platform, aliases);
|
|
134
|
+
return await import_esbuild.default.build(config);
|
|
135
|
+
}
|
|
136
|
+
async function asyncLock(props) {
|
|
137
|
+
const lockFile = (0, import_node_path.join)((0, import_node_path.dirname)(props.outfile), (0, import_node_path.basename)(props.outfile, ".lock")),
|
|
138
|
+
lockStat = await FS.stat(lockFile).catch(() => {});
|
|
139
|
+
if ((lockStat ? (/* @__PURE__ */new Date()).getTime() - new Date(lockStat.mtime).getTime() : Number.POSITIVE_INFINITY) < 500) {
|
|
140
|
+
process.env.DEBUG?.startsWith("tamagui") && console.info("Waiting for existing build", props.entryPoints);
|
|
141
|
+
let tries = 5;
|
|
142
|
+
for (; tries--;) {
|
|
143
|
+
if (await FS.pathExists(props.outfile)) return;
|
|
144
|
+
await new Promise(res => setTimeout(res, 50));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
FS.writeFile(lockFile, "");
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=bundle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bundle_exports","__export","esbuildIgnoreFilesRegex","esbuildLoaderConfig","esbundleTamaguiConfig","module","exports","__toCommonJS","import_node_path","require","import_esbuild","__toESM","FS","import_esbuildAliasPlugin","import_loadTamagui","import_esbuildTsconfigPaths","dataExtensions","Object","keys","filter","k","map","slice","RegExp","join","getESBuildConfig","entryPoints","resolvePlatformSpecificEntries","options","platform","aliases","process","env","DEBUG","startsWith","console","info","bundle","resolveWebOrNativeSpecificEntry","format","target","jsx","jsxFactory","allowOverwrite","keepNames","resolveExtensions","tsconfigRaw","compilerOptions","loader","logLevel","plugins","TsconfigPathsPlugin","name","setup","build","onResolve","args","path","external","esbuildAliasPlugin","props","asyncLock","config","default","lockFile","dirname","outfile","basename","lockStat","stat","catch","Date","getTime","mtime","Number","POSITIVE_INFINITY","tries","pathExists","Promise","res","setTimeout","writeFile"],"sources":["../../src/extractor/bundle.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA,mBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAP,cAAA;AAAA,IAAAQ,gBAAA,GAAwCC,OAAA;EACxCC,cAAA,GAAoBC,OAAA,CAAAF,OAAA;EACpBG,EAAA,GAAoBD,OAAA,CAAAF,OAAA;EAEpBI,yBAAA,GAAmCJ,OAAA;EACnCK,kBAAA,GAAgDL,OAAA;EAChDM,2BAAA,GAAoCN,OAAA;AAE7B,MAAMN,mBAAA,GAAsB;IACjC,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,UAAU;IACV,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,SAAS;EACX;EAEMa,cAAA,GAAiBC,MAAA,CAAOC,IAAA,CAAKf,mBAAmB,EACnDgB,MAAA,CACEC,CAAA,IAAMjB,mBAAA,CAAoBiB,CAAC,MAAM,UAAUjB,mBAAA,CAAoBiB,CAAC,MAAM,SACzE,EACCC,GAAA,CAAKD,CAAA,IAAMA,CAAA,CAAEE,KAAA,CAAM,CAAC,CAAC;EAEXpB,uBAAA,GAA0B,IAAIqB,MAAA,CAAO,KAAMP,cAAA,CAAeQ,IAAA,CAAK,GAAG,CAAC,MAAM,GAAG;AAYzF,SAASC,iBACP;EAAEC,WAAA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I,MAAMhE,EAAA,CAAGiE,UAAA,CAAWjB,KAAA,CAAMM,OAAO,GACnC;MAEF,MAAM,IAAIY,OAAA,CAASC,GAAA,IAAQC,UAAA,CAAWD,GAAA,EAAK,EAAE,CAAC;IAChD;EACF;EACKnE,EAAA,CAAGqE,SAAA,CAAUjB,QAAA,EAAU,EAAE;AAChC","ignoreList":[]}
|
|
@@ -0,0 +1,331 @@
|
|
|
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 bundleConfig_exports = {};
|
|
33
|
+
__export(bundleConfig_exports, {
|
|
34
|
+
bundleConfig: () => bundleConfig,
|
|
35
|
+
esbuildOptions: () => esbuildOptions,
|
|
36
|
+
getBundledConfig: () => getBundledConfig,
|
|
37
|
+
getLoadedConfig: () => getLoadedConfig,
|
|
38
|
+
hasBundledConfigChanged: () => hasBundledConfigChanged,
|
|
39
|
+
loadComponents: () => loadComponents,
|
|
40
|
+
loadComponentsInner: () => loadComponentsInner,
|
|
41
|
+
writeTamaguiCSS: () => writeTamaguiCSS
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(bundleConfig_exports);
|
|
44
|
+
var import_generator = __toESM(require("@babel/generator")),
|
|
45
|
+
import_traverse = __toESM(require("@babel/traverse")),
|
|
46
|
+
t = __toESM(require("@babel/types")),
|
|
47
|
+
import_node_fs = require("node:fs"),
|
|
48
|
+
import_node_path = require("node:path"),
|
|
49
|
+
import_cli_color = require("@tamagui/cli-color"),
|
|
50
|
+
import_esbuild = __toESM(require("esbuild")),
|
|
51
|
+
FS = __toESM(require("fs-extra")),
|
|
52
|
+
import_promises = require("node:fs/promises"),
|
|
53
|
+
import_registerRequire = require("../registerRequire.mjs"),
|
|
54
|
+
import_babelParse = require("./babelParse.mjs"),
|
|
55
|
+
import_bundle = require("./bundle.mjs"),
|
|
56
|
+
import_getTamaguiConfigPathFromOptionsConfig = require("./getTamaguiConfigPathFromOptionsConfig.mjs"),
|
|
57
|
+
import_requireTamaguiCore = require("../helpers/requireTamaguiCore.mjs");
|
|
58
|
+
const external = ["@tamagui/core", "@tamagui/web", "react", "react-dom", "react-native-svg"],
|
|
59
|
+
esbuildExtraOptions = {
|
|
60
|
+
define: {
|
|
61
|
+
__DEV__: `${process.env.NODE_ENV === "development"}`
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
esbuildOptions = {
|
|
65
|
+
target: "es2018",
|
|
66
|
+
format: "cjs",
|
|
67
|
+
jsx: "automatic",
|
|
68
|
+
platform: "node",
|
|
69
|
+
...esbuildExtraOptions
|
|
70
|
+
};
|
|
71
|
+
let currentBundle = null,
|
|
72
|
+
isBundling = !1,
|
|
73
|
+
lastBundle = null;
|
|
74
|
+
const waitForBundle = /* @__PURE__ */new Set();
|
|
75
|
+
function hasBundledConfigChanged() {
|
|
76
|
+
return lastBundle === currentBundle ? !1 : (lastBundle = currentBundle, !0);
|
|
77
|
+
}
|
|
78
|
+
let loadedConfig = null;
|
|
79
|
+
const getLoadedConfig = () => loadedConfig;
|
|
80
|
+
async function getBundledConfig(props, rebuild = !1) {
|
|
81
|
+
if (isBundling) await new Promise(res => {
|
|
82
|
+
waitForBundle.add(res);
|
|
83
|
+
});else if (!currentBundle || rebuild) return await bundleConfig(props);
|
|
84
|
+
return currentBundle;
|
|
85
|
+
}
|
|
86
|
+
global.tamaguiLastLoaded ||= 0;
|
|
87
|
+
function updateLastLoaded(config) {
|
|
88
|
+
global.tamaguiLastLoaded = Date.now(), global.tamaguiLastBundledConfig = config;
|
|
89
|
+
}
|
|
90
|
+
let hasBundledOnce = !1;
|
|
91
|
+
async function bundleConfig(props) {
|
|
92
|
+
if (global.tamaguiLastBundledConfig && Date.now() - global.tamaguiLastLoaded < 3e3) return global.tamaguiLastBundledConfig;
|
|
93
|
+
try {
|
|
94
|
+
isBundling = !0;
|
|
95
|
+
const configEntry = props.config ? (0, import_getTamaguiConfigPathFromOptionsConfig.getTamaguiConfigPathFromOptionsConfig)(props.config) : "",
|
|
96
|
+
tmpDir = (0, import_node_path.join)(process.cwd(), ".tamagui"),
|
|
97
|
+
configOutPath = (0, import_node_path.join)(tmpDir, "tamagui.config.cjs"),
|
|
98
|
+
baseComponents = (props.components || []).filter(x => x !== "@tamagui/core"),
|
|
99
|
+
componentOutPaths = baseComponents.map(componentModule => (0, import_node_path.join)(tmpDir, `${componentModule.split(import_node_path.sep).join("-").replace(/[^a-z0-9]+/gi, "")}-components.config.cjs`));
|
|
100
|
+
if (process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("tamagui") && console.info("Building config entry", configEntry), !props.disableInitialBuild) {
|
|
101
|
+
try {
|
|
102
|
+
await FS.ensureDir(tmpDir);
|
|
103
|
+
} catch {}
|
|
104
|
+
const start = Date.now();
|
|
105
|
+
await Promise.all([props.config ? (0, import_bundle.esbundleTamaguiConfig)({
|
|
106
|
+
entryPoints: [configEntry],
|
|
107
|
+
external,
|
|
108
|
+
outfile: configOutPath,
|
|
109
|
+
target: "node20",
|
|
110
|
+
...esbuildExtraOptions
|
|
111
|
+
}, props.platform || "web") : null, ...baseComponents.map((componentModule, i) => (0, import_bundle.esbundleTamaguiConfig)({
|
|
112
|
+
entryPoints: [componentModule],
|
|
113
|
+
resolvePlatformSpecificEntries: !0,
|
|
114
|
+
external,
|
|
115
|
+
outfile: componentOutPaths[i],
|
|
116
|
+
target: "node20",
|
|
117
|
+
...esbuildExtraOptions
|
|
118
|
+
}, props.platform || "web"))]), (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, `
|
|
119
|
+
\u27A1 [tamagui] built config and components (${Date.now() - start}ms)`), process.env.DEBUG?.startsWith("tamagui") && (0, import_cli_color.colorLog)(import_cli_color.Color.Dim, `
|
|
120
|
+
Config .${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), configOutPath)}
|
|
121
|
+
Components ${[...componentOutPaths.map(p => `.${import_node_path.sep}${(0, import_node_path.relative)(process.cwd(), p)}`)].join(`
|
|
122
|
+
`)}
|
|
123
|
+
`);
|
|
124
|
+
}
|
|
125
|
+
let out;
|
|
126
|
+
const {
|
|
127
|
+
unregister
|
|
128
|
+
} = (0, import_registerRequire.registerRequire)(props.platform || "web");
|
|
129
|
+
try {
|
|
130
|
+
if (hasBundledOnce) for (const key in require.cache) /(core|web)[\/\\]dist/.test(key) || delete require.cache[key];else hasBundledOnce = !0;
|
|
131
|
+
out = require(configOutPath);
|
|
132
|
+
} catch (err) {
|
|
133
|
+
throw err;
|
|
134
|
+
} finally {
|
|
135
|
+
unregister();
|
|
136
|
+
}
|
|
137
|
+
let config = out.default || out || out.config;
|
|
138
|
+
if (config && config.config && !config.tokens && (config = config.config), !config) throw new Error(`No config: ${config}`);
|
|
139
|
+
if (loadedConfig = config, !config.parsed) {
|
|
140
|
+
const {
|
|
141
|
+
createTamagui
|
|
142
|
+
} = (0, import_requireTamaguiCore.requireTamaguiCore)(props.platform || "web");
|
|
143
|
+
config = createTamagui(config);
|
|
144
|
+
}
|
|
145
|
+
props.outputCSS && (await writeTamaguiCSS(props.outputCSS, config));
|
|
146
|
+
let components = loadComponents({
|
|
147
|
+
...props,
|
|
148
|
+
components: componentOutPaths
|
|
149
|
+
});
|
|
150
|
+
if (!components) throw new Error(`No components found: ${componentOutPaths.join(", ")}`);
|
|
151
|
+
for (const component of components) component.moduleName = baseComponents[componentOutPaths.indexOf(component.moduleName)] || component.moduleName, component.moduleName || (process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn(`\u26A0\uFE0F no module name found: ${component.moduleName} ${JSON.stringify(baseComponents)} in ${JSON.stringify(componentOutPaths)}`);
|
|
152
|
+
process.env.NODE_ENV === "development" && process.env.DEBUG?.startsWith("tamagui") && console.info("Loaded components", components);
|
|
153
|
+
const res = {
|
|
154
|
+
components,
|
|
155
|
+
nameToPaths: {},
|
|
156
|
+
tamaguiConfig: config
|
|
157
|
+
};
|
|
158
|
+
return currentBundle = res, updateLastLoaded(res), res;
|
|
159
|
+
} catch (err) {
|
|
160
|
+
console.error(`Error bundling tamagui config: ${err?.message} (run with DEBUG=tamagui to see stack)`), process.env.DEBUG?.includes("tamagui") && console.error(err.stack);
|
|
161
|
+
} finally {
|
|
162
|
+
isBundling = !1, waitForBundle.forEach(cb => cb()), waitForBundle.clear();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
async function writeTamaguiCSS(outputCSS, config) {
|
|
166
|
+
const flush = async () => {
|
|
167
|
+
(0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` \u27A1 [tamagui] output css: ${outputCSS}`), await FS.writeFile(outputCSS, css);
|
|
168
|
+
},
|
|
169
|
+
css = config.getCSS();
|
|
170
|
+
if (typeof css != "string") throw new Error(`Invalid CSS: ${typeof css} ${css}`);
|
|
171
|
+
try {
|
|
172
|
+
(0, import_node_fs.existsSync)(outputCSS) && (await (0, import_promises.readFile)(outputCSS, "utf8")) === css || (await flush());
|
|
173
|
+
} catch (err) {
|
|
174
|
+
console.info("Error writing themes", err);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function loadComponents(props, forceExports = !1) {
|
|
178
|
+
const coreComponents = getCoreComponents(props),
|
|
179
|
+
otherComponents = loadComponentsInner(props, forceExports);
|
|
180
|
+
return [...coreComponents, ...(otherComponents || [])];
|
|
181
|
+
}
|
|
182
|
+
function getCoreComponents(props) {
|
|
183
|
+
const loaded = loadComponentsInner({
|
|
184
|
+
...props,
|
|
185
|
+
components: ["@tamagui/core"]
|
|
186
|
+
});
|
|
187
|
+
if (!loaded) throw new Error("Core should always load");
|
|
188
|
+
return [{
|
|
189
|
+
...loaded[0],
|
|
190
|
+
moduleName: "@tamagui/core"
|
|
191
|
+
}];
|
|
192
|
+
}
|
|
193
|
+
function loadComponentsInner(props, forceExports = !1) {
|
|
194
|
+
const componentsModules = props.components || [],
|
|
195
|
+
key = componentsModules.join("");
|
|
196
|
+
if (!forceExports && cacheComponents[key]) return cacheComponents[key];
|
|
197
|
+
const {
|
|
198
|
+
unregister
|
|
199
|
+
} = (0, import_registerRequire.registerRequire)(props.platform || "web", {
|
|
200
|
+
proxyWormImports: forceExports
|
|
201
|
+
});
|
|
202
|
+
try {
|
|
203
|
+
const info = componentsModules.flatMap(name => {
|
|
204
|
+
const isDynamic = !!(0, import_node_path.extname)(name) && forceExports,
|
|
205
|
+
fileContents = isDynamic ? (0, import_node_fs.readFileSync)(name, "utf-8") : "",
|
|
206
|
+
loadModule = isDynamic ? (0, import_node_path.join)((0, import_node_path.dirname)(name), `.tamagui-dynamic-eval-${(0, import_node_path.basename)(name)}.tsx`) : name;
|
|
207
|
+
let writtenContents = fileContents,
|
|
208
|
+
didBabel = !1;
|
|
209
|
+
function attemptLoad({
|
|
210
|
+
forceExports: forceExports2 = !1
|
|
211
|
+
} = {}) {
|
|
212
|
+
isDynamic && (writtenContents = forceExports2 ? transformAddExports((0, import_babelParse.babelParse)(esbuildit(fileContents, "modern"), name)) : fileContents, FS.writeFileSync(loadModule, writtenContents), import_esbuild.default.buildSync({
|
|
213
|
+
...esbuildOptions,
|
|
214
|
+
entryPoints: [loadModule],
|
|
215
|
+
outfile: loadModule,
|
|
216
|
+
alias: {
|
|
217
|
+
"react-native": require.resolve("@tamagui/react-native-web-lite")
|
|
218
|
+
},
|
|
219
|
+
bundle: !0,
|
|
220
|
+
packages: "external",
|
|
221
|
+
allowOverwrite: !0,
|
|
222
|
+
// logLevel: 'silent',
|
|
223
|
+
sourcemap: !1,
|
|
224
|
+
loader: import_bundle.esbuildLoaderConfig
|
|
225
|
+
})), process.env.DEBUG === "tamagui" && console.info("loadModule", loadModule, require.resolve(loadModule));
|
|
226
|
+
const moduleResult = require(loadModule);
|
|
227
|
+
forceExports2 || (0, import_registerRequire.setRequireResult)(name, moduleResult);
|
|
228
|
+
const nameToInfo = getComponentStaticConfigByName(name, interopDefaultExport(moduleResult));
|
|
229
|
+
return {
|
|
230
|
+
moduleName: name,
|
|
231
|
+
nameToInfo
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const dispose = () => {
|
|
235
|
+
isDynamic && FS.removeSync(loadModule);
|
|
236
|
+
};
|
|
237
|
+
try {
|
|
238
|
+
const res = attemptLoad({
|
|
239
|
+
forceExports: !0
|
|
240
|
+
});
|
|
241
|
+
return didBabel = !0, res;
|
|
242
|
+
} catch (err) {
|
|
243
|
+
console.info("babel err", err, writtenContents), writtenContents = fileContents, process.env.DEBUG?.startsWith("tamagui") && console.info("Error parsing babel likely", err);
|
|
244
|
+
} finally {
|
|
245
|
+
dispose();
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
return attemptLoad({
|
|
249
|
+
forceExports: !1
|
|
250
|
+
});
|
|
251
|
+
} catch (err) {
|
|
252
|
+
return process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.info(`
|
|
253
|
+
|
|
254
|
+
Tamagui attempted but failed to dynamically optimize components in:
|
|
255
|
+
${name}
|
|
256
|
+
`), console.info(err), console.info(`At: ${loadModule}`, `
|
|
257
|
+
didBabel: ${didBabel}`, `
|
|
258
|
+
In:`, writtenContents, `
|
|
259
|
+
isDynamic: `, isDynamic)), [];
|
|
260
|
+
} finally {
|
|
261
|
+
dispose();
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
return cacheComponents[key] = info, info;
|
|
265
|
+
} catch (err) {
|
|
266
|
+
return console.info("Tamagui error bundling components", err.message, err.stack), null;
|
|
267
|
+
} finally {
|
|
268
|
+
unregister();
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const esbuildit = (src, target) => import_esbuild.default.transformSync(src, {
|
|
272
|
+
...esbuildOptions,
|
|
273
|
+
...(target === "modern" && {
|
|
274
|
+
target: "es2022",
|
|
275
|
+
jsx: "automatic",
|
|
276
|
+
loader: "tsx",
|
|
277
|
+
platform: "neutral",
|
|
278
|
+
format: "esm"
|
|
279
|
+
})
|
|
280
|
+
}).code;
|
|
281
|
+
function getComponentStaticConfigByName(name, exported) {
|
|
282
|
+
const components = {};
|
|
283
|
+
try {
|
|
284
|
+
if (!exported || typeof exported != "object" || Array.isArray(exported)) throw new Error(`Invalid export from package ${name}: ${typeof exported}`);
|
|
285
|
+
for (const key in exported) {
|
|
286
|
+
const found = getTamaguiComponent(key, exported[key]);
|
|
287
|
+
if (found) {
|
|
288
|
+
const {
|
|
289
|
+
Component,
|
|
290
|
+
...sc
|
|
291
|
+
} = found.staticConfig;
|
|
292
|
+
components[key] = {
|
|
293
|
+
staticConfig: sc
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
} catch (err) {
|
|
298
|
+
process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && (console.error(`Tamagui failed getting components from ${name} (Disable error by setting environment variable TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD=1)`), console.error(err));
|
|
299
|
+
}
|
|
300
|
+
return components;
|
|
301
|
+
}
|
|
302
|
+
function getTamaguiComponent(name, Component) {
|
|
303
|
+
if (name[0].toUpperCase() !== name[0]) return;
|
|
304
|
+
if (Component?.staticConfig) return Component;
|
|
305
|
+
}
|
|
306
|
+
function interopDefaultExport(mod) {
|
|
307
|
+
return mod?.default ?? mod;
|
|
308
|
+
}
|
|
309
|
+
const cacheComponents = {};
|
|
310
|
+
function transformAddExports(ast) {
|
|
311
|
+
const usedNames = /* @__PURE__ */new Set();
|
|
312
|
+
return (0, import_traverse.default)(ast, {
|
|
313
|
+
ExportNamedDeclaration(nodePath) {
|
|
314
|
+
if (nodePath.node.specifiers) for (const spec of nodePath.node.specifiers) usedNames.add(t.isIdentifier(spec.exported) ? spec.exported.name : spec.exported.value);
|
|
315
|
+
}
|
|
316
|
+
}), (0, import_traverse.default)(ast, {
|
|
317
|
+
VariableDeclaration(nodePath) {
|
|
318
|
+
if (!t.isProgram(nodePath.parent)) return;
|
|
319
|
+
const decs = nodePath.node.declarations;
|
|
320
|
+
if (decs.length > 1) return;
|
|
321
|
+
const [dec] = decs;
|
|
322
|
+
t.isIdentifier(dec.id) && dec.init && (usedNames.has(dec.id.name) || (usedNames.add(dec.id.name), nodePath.replaceWith(t.exportNamedDeclaration(t.variableDeclaration("let", [dec]), [t.exportSpecifier(t.identifier(dec.id.name), t.identifier(dec.id.name))]))));
|
|
323
|
+
}
|
|
324
|
+
}), (0, import_generator.default)(ast, {
|
|
325
|
+
concise: !1,
|
|
326
|
+
filename: "test.tsx",
|
|
327
|
+
retainLines: !1,
|
|
328
|
+
sourceMaps: !1
|
|
329
|
+
}).code;
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=bundleConfig.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bundleConfig_exports","__export","bundleConfig","esbuildOptions","getBundledConfig","getLoadedConfig","hasBundledConfigChanged","loadComponents","loadComponentsInner","writeTamaguiCSS","module","exports","__toCommonJS","import_generator","__toESM","require","import_traverse","t","import_node_fs","import_node_path","import_cli_color","import_esbuild","FS","import_promises","import_registerRequire","import_babelParse","import_bundle","import_getTamaguiConfigPathFromOptionsConfig","import_requireTamaguiCore","external","esbuildExtraOptions","define","__DEV__","process","env","NODE_ENV","target","format","jsx","platform","currentBundle","isBundling","lastBundle","waitForBundle","Set","loadedConfig","props","rebuild","Promise","res","add","global","tamaguiLastLoaded","updateLastLoaded","config","Date","now","tamaguiLastBundledConfig","hasBundledOnce","configEntry","getTamaguiConfigPathFromOptionsConfig","tmpDir","join","cwd","configOutPath","baseComponents","components","filter","x","componentOutPaths","map","componentModule","split","sep","replace","DEBUG","startsWith","console","info","disableInitialBuild","ensureDir","start","all","esbundleTamaguiConfig","entryPoints","outfile","i","resolvePlatformSpecificEntries","colorLog","Color","FgYellow","Dim","relative","p","out","unregister","registerRequire","key","cache","test","err","default","tokens","Error","parsed","createTamagui","requireTamaguiCore","outputCSS","component","moduleName","indexOf","includes","IS_TAMAGUI_DEV","warn","JSON","stringify","nameToPaths","tamaguiConfig","error","message","stack","forEach","cb","clear","flush","writeFile","css","getCSS","existsSync","readFile","forceExports","coreComponents","getCoreComponents","otherComponents","loaded","componentsModules","cacheComponents","proxyWormImports","flatMap","name","isDynamic","extname","fileContents","readFileSync","loadModule","dirname","basename","writtenContents","didBabel","attemptLoad","forceExports2","transformAddExports","babelParse","esbuildit","writeFileSync","buildSync","alias","resolve","bundle","packages","allowOverwrite","sourcemap","loader","esbuildLoaderConfig","moduleResult","setRequireResult","nameToInfo","getComponentStaticConfigByName","interopDefaultExport","dispose","removeSync","TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD","src","transformSync","code","exported","Array","isArray","found","getTamaguiComponent","Component","sc","staticConfig","toUpperCase","mod","ast","usedNames","ExportNamedDeclaration","nodePath","node","specifiers","spec","isIdentifier","value","VariableDeclaration","isProgram","parent","decs","declarations","length","dec","id","init","has","replaceWith","exportNamedDeclaration","variableDeclaration","exportSpecifier","identifier","concise","filename","retainLines","sourceMaps"],"sources":["../../src/extractor/bundleConfig.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,oBAAA;AAAAC,QAAA,CAAAD,oBAAA;EAAAE,YAAA,EAAAA,CAAA,KAAAA,YAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA,gBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA,eAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,mBAAA,EAAAA,CAAA,KAAAA,mBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAZ,oBAAA;AAAA,IAAAa,gBAAA,GAAqBC,OAAA,CAAAC,OAAA;EACrBC,eAAA,GAAqBF,OAAA,CAAAC,OAAA;EACrBE,CAAA,GAAmBH,OAAA,CAAAC,OAAA;EACnBG,cAAA,GAAyCH,OAAA;EACzCI,gBAAA,GAAgEJ,OAAA;EAEhEK,gBAAA,GAAgCL,OAAA;EAMhCM,cAAA,GAAoBP,OAAA,CAAAC,OAAA;EACpBO,EAAA,GAAoBR,OAAA,CAAAC,OAAA;EACpBQ,eAAA,GAAyBR,OAAA;EACzBS,sBAAA,GAAkDT,OAAA;EAElDU,iBAAA,GAA2BV,OAAA;EAC3BW,aAAA,GAA2DX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ACTpL,CAAA,CAAE+K,YAAA,CAAaQ,GAAA,CAAIC,EAAE,KACrBD,GAAA,CAAIE,IAAA,KACLhB,SAAA,CAAUiB,GAAA,CAAIH,GAAA,CAAIC,EAAA,CAAG9D,IAAI,MAC7B+C,SAAA,CAAUxI,GAAA,CAAIsJ,GAAA,CAAIC,EAAA,CAAG9D,IAAI,GACzBiD,QAAA,CAASgB,WAAA,CACP3L,CAAA,CAAE4L,sBAAA,CAAuB5L,CAAA,CAAE6L,mBAAA,CAAoB,OAAO,CAACN,GAAG,CAAC,GAAG,CAC5DvL,CAAA,CAAE8L,eAAA,CAAgB9L,CAAA,CAAE+L,UAAA,CAAWR,GAAA,CAAIC,EAAA,CAAG9D,IAAI,GAAG1H,CAAA,CAAE+L,UAAA,CAAWR,GAAA,CAAIC,EAAA,CAAG9D,IAAI,CAAC,EACvE,CACH;IACF;EACF,CAAC,OAGM9H,gBAAA,CAAAwF,OAAA,EAASoF,GAAA,EAAY;IAC1BwB,OAAA,EAAS;IACTC,QAAA,EAAU;IACVC,WAAA,EAAa;IACbC,UAAA,EAAY;EACd,CAAC,EAAEtC,IAAA;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 concatClassName_exports = {};
|
|
22
|
+
__export(concatClassName_exports, {
|
|
23
|
+
concatClassName: () => concatClassName
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(concatClassName_exports);
|
|
26
|
+
function concatClassName(_cn) {
|
|
27
|
+
const args = arguments,
|
|
28
|
+
usedPrefixes = /* @__PURE__ */new Set();
|
|
29
|
+
let final = "";
|
|
30
|
+
const len = args.length;
|
|
31
|
+
let propObjects = null;
|
|
32
|
+
for (let x = len; x >= 0; x--) {
|
|
33
|
+
const cns = args[x];
|
|
34
|
+
if (!cns) continue;
|
|
35
|
+
if (!Array.isArray(cns) && typeof cns != "string") {
|
|
36
|
+
propObjects = propObjects || [], propObjects.push(cns);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const names = Array.isArray(cns) ? cns : cns.split(" "),
|
|
40
|
+
numNames = names.length;
|
|
41
|
+
for (let i = numNames - 1; i >= 0; i--) {
|
|
42
|
+
const name = names[i];
|
|
43
|
+
if (!name || name === " ") continue;
|
|
44
|
+
if (name[0] !== "_") {
|
|
45
|
+
final = name + " " + final;
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const splitIndex = name.indexOf("-");
|
|
49
|
+
if (splitIndex < 1) {
|
|
50
|
+
final = name + " " + final;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const isMediaQuery = name[splitIndex + 1] === "_",
|
|
54
|
+
styleKey = name.slice(1, name.indexOf("-")),
|
|
55
|
+
mediaKey = isMediaQuery ? name.slice(splitIndex + 2, splitIndex + 7) : null,
|
|
56
|
+
uid = mediaKey ? styleKey + mediaKey : styleKey;
|
|
57
|
+
if (usedPrefixes.has(uid)) continue;
|
|
58
|
+
usedPrefixes.add(uid);
|
|
59
|
+
const propName = styleKey;
|
|
60
|
+
propName && propObjects && propObjects.some(po => {
|
|
61
|
+
if (mediaKey) {
|
|
62
|
+
const propKey = pseudoInvert[mediaKey];
|
|
63
|
+
return po && po[propKey] && propName in po[propKey] && po[propKey] !== null;
|
|
64
|
+
}
|
|
65
|
+
return po && propName in po && po[propName] !== null;
|
|
66
|
+
}) || (final = name + " " + final);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return final.trim();
|
|
70
|
+
}
|
|
71
|
+
const pseudoInvert = {
|
|
72
|
+
hover: "hoverStyle",
|
|
73
|
+
focus: "focusStyle",
|
|
74
|
+
press: "pressStyle",
|
|
75
|
+
focusVisible: "focusVisibleStyle",
|
|
76
|
+
focusWithin: "focusWithinStyle",
|
|
77
|
+
disabled: "disabledStyle"
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=concatClassName.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["concatClassName_exports","__export","concatClassName","module","exports","__toCommonJS","_cn","args","arguments","usedPrefixes","Set","final","len","length","propObjects","x","cns","Array","isArray","push","names","split","numNames","i","name","splitIndex","indexOf","isMediaQuery","styleKey","slice","mediaKey","uid","has","add","propName","some","po","propKey","pseudoInvert","trim","hover","focus","press","focusVisible","focusWithin","disabled"],"sources":["../../src/extractor/concatClassName.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,uBAAA;AAAAC,QAAA,CAAAD,uBAAA;EAAAE,eAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAC,YAAA,CAAAL,uBAAA;AAUO,SAASE,gBAAgBI,GAAA,EAAqD;EACnF,MAAMC,IAAA,GAAOC,SAAA;IACPC,YAAA,GAAe,mBAAIC,GAAA,CAAY;EACrC,IAAIC,KAAA,GAAQ;EAEZ,MAAMC,GAAA,GAAML,IAAA,CAAKM,MAAA;EAC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