@tamagui/static 1.14.0 → 1.14.2
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/cjs/constants.js +52 -1
- package/dist/cjs/constants.js.map +2 -2
- package/dist/cjs/extractor/accessSafe.js +52 -1
- package/dist/cjs/extractor/accessSafe.js.map +2 -2
- package/dist/cjs/extractor/babelParse.js +66 -1
- package/dist/cjs/extractor/babelParse.js.map +2 -2
- package/dist/cjs/extractor/buildClassName.js +99 -1
- package/dist/cjs/extractor/buildClassName.js.map +2 -2
- package/dist/cjs/extractor/bundle.js +126 -1
- package/dist/cjs/extractor/bundle.js.map +2 -2
- package/dist/cjs/extractor/createEvaluator.js +86 -1
- package/dist/cjs/extractor/createEvaluator.js.map +2 -2
- package/dist/cjs/extractor/createExtractor.js +1630 -15
- package/dist/cjs/extractor/createExtractor.js.map +2 -2
- package/dist/cjs/extractor/ensureImportingConcat.js +64 -1
- package/dist/cjs/extractor/ensureImportingConcat.js.map +2 -2
- package/dist/cjs/extractor/evaluateAstNode.js +130 -1
- package/dist/cjs/extractor/evaluateAstNode.js.map +2 -2
- package/dist/cjs/extractor/extractHelpers.js +207 -1
- package/dist/cjs/extractor/extractHelpers.js.map +2 -2
- package/dist/cjs/extractor/extractMediaStyle.js +193 -1
- package/dist/cjs/extractor/extractMediaStyle.js.map +2 -2
- package/dist/cjs/extractor/extractToClassNames.js +413 -13
- package/dist/cjs/extractor/extractToClassNames.js.map +2 -2
- package/dist/cjs/extractor/findTopmostFunction.js +43 -1
- package/dist/cjs/extractor/findTopmostFunction.js.map +2 -2
- package/dist/cjs/extractor/generatedUid.js +59 -1
- package/dist/cjs/extractor/generatedUid.js.map +2 -2
- package/dist/cjs/extractor/getPrefixLogs.js +31 -1
- package/dist/cjs/extractor/getPrefixLogs.js.map +2 -2
- package/dist/cjs/extractor/getPropValueFromAttributes.js +89 -1
- package/dist/cjs/extractor/getPropValueFromAttributes.js.map +2 -2
- package/dist/cjs/extractor/getSourceModule.js +103 -1
- package/dist/cjs/extractor/getSourceModule.js.map +2 -2
- package/dist/cjs/extractor/getStaticBindingsForScope.js +225 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.js.map +2 -2
- package/dist/cjs/extractor/hoistClassNames.js +74 -1
- package/dist/cjs/extractor/hoistClassNames.js.map +2 -2
- package/dist/cjs/extractor/literalToAst.js +115 -1
- package/dist/cjs/extractor/literalToAst.js.map +2 -2
- package/dist/cjs/extractor/loadFile.js +20 -2
- package/dist/cjs/extractor/loadFile.js.map +2 -2
- package/dist/cjs/extractor/loadTamagui.js +432 -15
- package/dist/cjs/extractor/loadTamagui.js.map +2 -2
- package/dist/cjs/extractor/logLines.js +43 -3
- package/dist/cjs/extractor/logLines.js.map +2 -2
- package/dist/cjs/extractor/normalizeTernaries.js +85 -1
- package/dist/cjs/extractor/normalizeTernaries.js.map +2 -2
- package/dist/cjs/extractor/removeUnusedHooks.js +109 -1
- package/dist/cjs/extractor/removeUnusedHooks.js.map +2 -2
- package/dist/cjs/extractor/timer.js +52 -1
- package/dist/cjs/extractor/timer.js.map +2 -2
- package/dist/cjs/extractor/validHTMLAttributes.js +126 -1
- package/dist/cjs/extractor/validHTMLAttributes.js.map +2 -2
- package/dist/cjs/getPragmaOptions.js +67 -2
- package/dist/cjs/getPragmaOptions.js.map +2 -2
- package/dist/cjs/helpers/memoize.js +45 -1
- package/dist/cjs/helpers/memoize.js.map +2 -2
- package/dist/cjs/index.js +42 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/require.js +81 -5
- package/dist/cjs/require.js.map +2 -2
- package/dist/cjs/types.js +16 -1
- package/dist/cjs/types.js.map +2 -2
- package/dist/cjs/webpackPlugin.js +34 -1
- package/dist/cjs/webpackPlugin.js.map +2 -2
- package/dist/esm/constants.js +14 -1
- package/dist/esm/constants.js.map +2 -2
- package/dist/esm/constants.mjs +14 -1
- package/dist/esm/constants.mjs.map +2 -2
- package/dist/esm/extractor/accessSafe.js +18 -1
- package/dist/esm/extractor/accessSafe.js.map +2 -2
- package/dist/esm/extractor/accessSafe.mjs +18 -1
- package/dist/esm/extractor/accessSafe.mjs.map +2 -2
- package/dist/esm/extractor/babelParse.js +31 -1
- package/dist/esm/extractor/babelParse.js.map +2 -2
- package/dist/esm/extractor/babelParse.mjs +31 -1
- package/dist/esm/extractor/babelParse.mjs.map +2 -2
- package/dist/esm/extractor/buildClassName.js +64 -1
- package/dist/esm/extractor/buildClassName.js.map +2 -2
- package/dist/esm/extractor/buildClassName.mjs +64 -1
- package/dist/esm/extractor/buildClassName.mjs.map +2 -2
- package/dist/esm/extractor/bundle.js +91 -1
- package/dist/esm/extractor/bundle.js.map +2 -2
- package/dist/esm/extractor/bundle.mjs +91 -1
- package/dist/esm/extractor/bundle.mjs.map +2 -2
- package/dist/esm/extractor/createEvaluator.js +51 -1
- package/dist/esm/extractor/createEvaluator.js.map +2 -2
- package/dist/esm/extractor/createEvaluator.mjs +51 -1
- package/dist/esm/extractor/createEvaluator.mjs.map +2 -2
- package/dist/esm/extractor/createExtractor.js +1613 -15
- package/dist/esm/extractor/createExtractor.js.map +2 -2
- package/dist/esm/extractor/createExtractor.mjs +1613 -15
- package/dist/esm/extractor/createExtractor.mjs.map +2 -2
- package/dist/esm/extractor/ensureImportingConcat.js +30 -1
- package/dist/esm/extractor/ensureImportingConcat.js.map +2 -2
- package/dist/esm/extractor/ensureImportingConcat.mjs +30 -1
- package/dist/esm/extractor/ensureImportingConcat.mjs.map +2 -2
- package/dist/esm/extractor/evaluateAstNode.js +96 -1
- package/dist/esm/extractor/evaluateAstNode.js.map +2 -2
- package/dist/esm/extractor/evaluateAstNode.mjs +96 -1
- package/dist/esm/extractor/evaluateAstNode.mjs.map +2 -2
- package/dist/esm/extractor/extractHelpers.js +161 -1
- package/dist/esm/extractor/extractHelpers.js.map +2 -2
- package/dist/esm/extractor/extractHelpers.mjs +161 -1
- package/dist/esm/extractor/extractHelpers.mjs.map +2 -2
- package/dist/esm/extractor/extractMediaStyle.js +158 -1
- package/dist/esm/extractor/extractMediaStyle.js.map +2 -2
- package/dist/esm/extractor/extractMediaStyle.mjs +158 -1
- package/dist/esm/extractor/extractMediaStyle.mjs.map +2 -2
- package/dist/esm/extractor/extractToClassNames.js +379 -13
- package/dist/esm/extractor/extractToClassNames.js.map +2 -2
- package/dist/esm/extractor/extractToClassNames.mjs +379 -13
- package/dist/esm/extractor/extractToClassNames.mjs.map +2 -2
- package/dist/esm/extractor/findTopmostFunction.js +19 -1
- package/dist/esm/extractor/findTopmostFunction.js.map +2 -2
- package/dist/esm/extractor/findTopmostFunction.mjs +19 -1
- package/dist/esm/extractor/findTopmostFunction.mjs.map +2 -2
- package/dist/esm/extractor/generatedUid.js +25 -1
- package/dist/esm/extractor/generatedUid.js.map +2 -2
- package/dist/esm/extractor/generatedUid.mjs +25 -1
- package/dist/esm/extractor/generatedUid.mjs.map +2 -2
- package/dist/esm/extractor/getPrefixLogs.js +7 -1
- package/dist/esm/extractor/getPrefixLogs.js.map +2 -2
- package/dist/esm/extractor/getPrefixLogs.mjs +7 -1
- package/dist/esm/extractor/getPrefixLogs.mjs.map +2 -2
- package/dist/esm/extractor/getPropValueFromAttributes.js +55 -1
- package/dist/esm/extractor/getPropValueFromAttributes.js.map +2 -2
- package/dist/esm/extractor/getPropValueFromAttributes.mjs +55 -1
- package/dist/esm/extractor/getPropValueFromAttributes.mjs.map +2 -2
- package/dist/esm/extractor/getSourceModule.js +69 -1
- package/dist/esm/extractor/getSourceModule.js.map +2 -2
- package/dist/esm/extractor/getSourceModule.mjs +69 -1
- package/dist/esm/extractor/getSourceModule.mjs.map +2 -2
- package/dist/esm/extractor/getStaticBindingsForScope.js +190 -1
- package/dist/esm/extractor/getStaticBindingsForScope.js.map +2 -2
- package/dist/esm/extractor/getStaticBindingsForScope.mjs +190 -1
- package/dist/esm/extractor/getStaticBindingsForScope.mjs.map +2 -2
- package/dist/esm/extractor/hoistClassNames.js +40 -1
- package/dist/esm/extractor/hoistClassNames.js.map +2 -2
- package/dist/esm/extractor/hoistClassNames.mjs +40 -1
- package/dist/esm/extractor/hoistClassNames.mjs.map +2 -2
- package/dist/esm/extractor/literalToAst.js +80 -1
- package/dist/esm/extractor/literalToAst.js.map +2 -2
- package/dist/esm/extractor/literalToAst.mjs +80 -1
- package/dist/esm/extractor/literalToAst.mjs.map +2 -2
- package/dist/esm/extractor/loadFile.js +19 -2
- package/dist/esm/extractor/loadFile.js.map +2 -2
- package/dist/esm/extractor/loadFile.mjs +19 -2
- package/dist/esm/extractor/loadFile.mjs.map +2 -2
- package/dist/esm/extractor/loadTamagui.js +396 -15
- package/dist/esm/extractor/loadTamagui.js.map +2 -2
- package/dist/esm/extractor/loadTamagui.mjs +396 -15
- package/dist/esm/extractor/loadTamagui.mjs.map +2 -2
- package/dist/esm/extractor/logLines.js +19 -3
- package/dist/esm/extractor/logLines.js.map +2 -2
- package/dist/esm/extractor/logLines.mjs +19 -3
- package/dist/esm/extractor/logLines.mjs.map +2 -2
- package/dist/esm/extractor/normalizeTernaries.js +51 -1
- package/dist/esm/extractor/normalizeTernaries.js.map +2 -2
- package/dist/esm/extractor/normalizeTernaries.mjs +51 -1
- package/dist/esm/extractor/normalizeTernaries.mjs.map +2 -2
- package/dist/esm/extractor/removeUnusedHooks.js +75 -1
- package/dist/esm/extractor/removeUnusedHooks.js.map +2 -2
- package/dist/esm/extractor/removeUnusedHooks.mjs +75 -1
- package/dist/esm/extractor/removeUnusedHooks.mjs.map +2 -2
- package/dist/esm/extractor/timer.js +28 -1
- package/dist/esm/extractor/timer.js.map +2 -2
- package/dist/esm/extractor/timer.mjs +28 -1
- package/dist/esm/extractor/timer.mjs.map +2 -2
- package/dist/esm/extractor/validHTMLAttributes.js +101 -1
- package/dist/esm/extractor/validHTMLAttributes.js.map +2 -2
- package/dist/esm/extractor/validHTMLAttributes.mjs +101 -1
- package/dist/esm/extractor/validHTMLAttributes.mjs.map +2 -2
- package/dist/esm/getPragmaOptions.js +43 -2
- package/dist/esm/getPragmaOptions.js.map +2 -2
- package/dist/esm/getPragmaOptions.mjs +43 -2
- package/dist/esm/getPragmaOptions.mjs.map +2 -2
- package/dist/esm/helpers/memoize.js +21 -1
- package/dist/esm/helpers/memoize.js.map +2 -2
- package/dist/esm/helpers/memoize.mjs +21 -1
- package/dist/esm/helpers/memoize.mjs.map +2 -2
- package/dist/esm/index.js +15 -1
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.mjs +15 -1
- package/dist/esm/index.mjs.map +2 -2
- package/dist/esm/require.js +55 -5
- package/dist/esm/require.js.map +2 -2
- package/dist/esm/require.mjs +55 -5
- package/dist/esm/require.mjs.map +2 -2
- package/dist/esm/webpackPlugin.js +10 -1
- package/dist/esm/webpackPlugin.js.map +2 -2
- package/dist/esm/webpackPlugin.mjs +10 -1
- package/dist/esm/webpackPlugin.mjs.map +2 -2
- package/package.json +14 -14
|
@@ -1,15 +1,381 @@
|
|
|
1
|
-
import*
|
|
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 { getStylesAtomic } from "@tamagui/core-node";
|
|
7
|
+
import { concatClassName } from "@tamagui/helpers";
|
|
8
|
+
import { babelParse } from "./babelParse.js";
|
|
9
|
+
import { buildClassName } from "./buildClassName.js";
|
|
10
|
+
import { ensureImportingConcat } from "./ensureImportingConcat.js";
|
|
11
|
+
import { isSimpleSpread } from "./extractHelpers.js";
|
|
12
|
+
import { extractMediaStyle } from "./extractMediaStyle.js";
|
|
13
|
+
import { getPrefixLogs } from "./getPrefixLogs.js";
|
|
14
|
+
import { hoistClassNames } from "./hoistClassNames.js";
|
|
15
|
+
import { logLines } from "./logLines.js";
|
|
16
|
+
import { timer } from "./timer.js";
|
|
17
|
+
const mergeStyleGroups = {
|
|
18
|
+
shadowOpacity: true,
|
|
19
|
+
shadowRadius: true,
|
|
20
|
+
shadowColor: true,
|
|
21
|
+
shadowOffset: true
|
|
22
|
+
};
|
|
23
|
+
async function extractToClassNames({
|
|
24
|
+
extractor,
|
|
25
|
+
source,
|
|
26
|
+
sourcePath,
|
|
27
|
+
options,
|
|
28
|
+
shouldPrintDebug
|
|
29
|
+
}) {
|
|
30
|
+
const tm = timer();
|
|
31
|
+
if (shouldPrintDebug) {
|
|
32
|
+
console.log(`--- ${sourcePath} ---
|
|
2
33
|
|
|
3
|
-
`)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
34
|
+
`);
|
|
35
|
+
}
|
|
36
|
+
if (typeof source !== "string") {
|
|
37
|
+
throw new Error("`source` must be a string of javascript");
|
|
38
|
+
}
|
|
39
|
+
if (sourcePath && !path.isAbsolute(sourcePath)) {
|
|
40
|
+
throw new Error("`sourcePath` must be an absolute path to a .js file");
|
|
41
|
+
}
|
|
42
|
+
if (!/.[tj]sx?$/i.test(sourcePath || "")) {
|
|
43
|
+
console.log(`${sourcePath == null ? void 0 : sourcePath.slice(0, 100)} - bad filename.`);
|
|
44
|
+
}
|
|
45
|
+
await extractor.loadTamagui(options);
|
|
46
|
+
const shouldLogTiming = options.logTimings ?? true;
|
|
47
|
+
const start = Date.now();
|
|
48
|
+
const mem = shouldLogTiming ? process.memoryUsage() : null;
|
|
49
|
+
let ast;
|
|
50
|
+
try {
|
|
51
|
+
ast = babelParse(source);
|
|
52
|
+
} catch (err) {
|
|
53
|
+
console.error("babel parse error:", sourcePath == null ? void 0 : sourcePath.slice(0, 100));
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
tm.mark(`babel-parse`, shouldPrintDebug === "verbose");
|
|
57
|
+
const cssMap = /* @__PURE__ */ new Map();
|
|
58
|
+
const existingHoists = {};
|
|
59
|
+
let hasFlattened = false;
|
|
60
|
+
const res = await extractor.parse(ast, {
|
|
61
|
+
shouldPrintDebug,
|
|
62
|
+
...options,
|
|
63
|
+
sourcePath,
|
|
64
|
+
target: "html",
|
|
65
|
+
extractStyledDefinitions: true,
|
|
66
|
+
onStyleRule(identifier, rules) {
|
|
67
|
+
const css = rules.join(";");
|
|
68
|
+
if (shouldPrintDebug) {
|
|
69
|
+
console.log(`adding styled() rule: .${identifier} ${css}`);
|
|
70
|
+
}
|
|
71
|
+
cssMap.set(`.${identifier}`, { css, commentTexts: [] });
|
|
72
|
+
},
|
|
73
|
+
getFlattenedNode: ({ tag }) => {
|
|
74
|
+
hasFlattened = true;
|
|
75
|
+
return tag;
|
|
76
|
+
},
|
|
77
|
+
onExtractTag: ({
|
|
78
|
+
parserProps,
|
|
79
|
+
attrs,
|
|
80
|
+
node,
|
|
81
|
+
attemptEval,
|
|
82
|
+
jsxPath,
|
|
83
|
+
originalNodeName,
|
|
84
|
+
filePath,
|
|
85
|
+
lineNumbers,
|
|
86
|
+
programPath,
|
|
87
|
+
isFlattened,
|
|
88
|
+
completeProps,
|
|
89
|
+
staticConfig
|
|
90
|
+
}) => {
|
|
91
|
+
var _a;
|
|
92
|
+
if (staticConfig.acceptsClassName === false) {
|
|
93
|
+
if (shouldPrintDebug) {
|
|
94
|
+
console.log(`bail, acceptsClassName is false`);
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const didFlattenThisTag = hasFlattened;
|
|
99
|
+
hasFlattened = false;
|
|
100
|
+
let finalClassNames = [];
|
|
101
|
+
const finalAttrs = [];
|
|
102
|
+
let finalStyles = [];
|
|
103
|
+
let viewStyles = {};
|
|
104
|
+
for (const attr of attrs) {
|
|
105
|
+
if (attr.type === "style") {
|
|
106
|
+
viewStyles = {
|
|
107
|
+
...viewStyles,
|
|
108
|
+
...attr.value
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const ensureNeededPrevStyle = (style) => {
|
|
113
|
+
const keys = Object.keys(style);
|
|
114
|
+
if (!keys.some((key) => mergeStyleGroups[key])) {
|
|
115
|
+
return style;
|
|
116
|
+
}
|
|
117
|
+
for (const k in mergeStyleGroups) {
|
|
118
|
+
if (k in viewStyles) {
|
|
119
|
+
style[k] = style[k] ?? viewStyles[k];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return style;
|
|
123
|
+
};
|
|
124
|
+
const addStyles = (style) => {
|
|
125
|
+
if (!style)
|
|
126
|
+
return [];
|
|
127
|
+
const styleWithPrev = ensureNeededPrevStyle(style);
|
|
128
|
+
const res2 = getStylesAtomic(styleWithPrev);
|
|
129
|
+
if (res2.length) {
|
|
130
|
+
finalStyles = [...finalStyles, ...res2];
|
|
131
|
+
}
|
|
132
|
+
return res2;
|
|
133
|
+
};
|
|
134
|
+
let lastMediaImportance = 1;
|
|
135
|
+
for (const attr of attrs) {
|
|
136
|
+
switch (attr.type) {
|
|
137
|
+
case "style": {
|
|
138
|
+
if (!isFlattened) {
|
|
139
|
+
const styles2 = getStylesAtomic(attr.value);
|
|
140
|
+
finalStyles = [...finalStyles, ...styles2];
|
|
141
|
+
for (const style of styles2) {
|
|
142
|
+
const prop = style.pseudo ? `${style.property}-${style.pseudo}` : style.property;
|
|
143
|
+
finalAttrs.push(
|
|
144
|
+
t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style.identifier))
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
const styles2 = addStyles(attr.value);
|
|
149
|
+
const newClassNames = concatClassName(
|
|
150
|
+
styles2.map((x) => x.identifier).join(" ")
|
|
151
|
+
);
|
|
152
|
+
const existing = finalClassNames.find(
|
|
153
|
+
(x) => x.type == "StringLiteral"
|
|
154
|
+
);
|
|
155
|
+
if (existing) {
|
|
156
|
+
existing.value = `${existing.value} ${newClassNames}`;
|
|
157
|
+
} else {
|
|
158
|
+
finalClassNames = [...finalClassNames, t.stringLiteral(newClassNames)];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case "attr": {
|
|
164
|
+
const val = attr.value;
|
|
165
|
+
if (t.isJSXSpreadAttribute(val)) {
|
|
166
|
+
if (isSimpleSpread(val)) {
|
|
167
|
+
finalClassNames.push(
|
|
168
|
+
t.logicalExpression(
|
|
169
|
+
"&&",
|
|
170
|
+
val.argument,
|
|
171
|
+
t.memberExpression(val.argument, t.identifier("className"))
|
|
172
|
+
)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
} else if (val.name.name === "className") {
|
|
176
|
+
const value = val.value;
|
|
177
|
+
if (value) {
|
|
178
|
+
try {
|
|
179
|
+
const evaluatedValue = attemptEval(value);
|
|
180
|
+
finalClassNames.push(t.stringLiteral(evaluatedValue));
|
|
181
|
+
} catch (e) {
|
|
182
|
+
finalClassNames.push(value["expression"]);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
finalAttrs.push(val);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
case "ternary": {
|
|
191
|
+
const mediaExtraction = extractMediaStyle(
|
|
192
|
+
parserProps,
|
|
193
|
+
attr.value,
|
|
194
|
+
jsxPath,
|
|
195
|
+
extractor.getTamagui(),
|
|
196
|
+
sourcePath || "",
|
|
197
|
+
lastMediaImportance,
|
|
198
|
+
shouldPrintDebug
|
|
199
|
+
);
|
|
200
|
+
if (shouldPrintDebug) {
|
|
201
|
+
if (mediaExtraction) {
|
|
202
|
+
console.log(
|
|
203
|
+
"ternary (mediaStyles)",
|
|
204
|
+
((_a = mediaExtraction.ternaryWithoutMedia) == null ? void 0 : _a.inlineMediaQuery) ?? "",
|
|
205
|
+
mediaExtraction.mediaStyles.map((x) => x.identifier).join(".")
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (!mediaExtraction) {
|
|
210
|
+
addTernaryStyle(
|
|
211
|
+
attr.value,
|
|
212
|
+
addStyles(attr.value.consequent),
|
|
213
|
+
addStyles(attr.value.alternate)
|
|
214
|
+
);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
lastMediaImportance++;
|
|
218
|
+
if (mediaExtraction.mediaStyles) {
|
|
219
|
+
finalStyles = [...finalStyles, ...mediaExtraction.mediaStyles];
|
|
220
|
+
}
|
|
221
|
+
if (mediaExtraction.ternaryWithoutMedia) {
|
|
222
|
+
addTernaryStyle(
|
|
223
|
+
mediaExtraction.ternaryWithoutMedia,
|
|
224
|
+
mediaExtraction.mediaStyles,
|
|
225
|
+
[]
|
|
226
|
+
);
|
|
227
|
+
} else {
|
|
228
|
+
finalClassNames = [
|
|
229
|
+
...finalClassNames,
|
|
230
|
+
...mediaExtraction.mediaStyles.map((x) => t.stringLiteral(x.identifier))
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function addTernaryStyle(ternary, a, b) {
|
|
238
|
+
const cCN = a.map((x) => x.identifier).join(" ");
|
|
239
|
+
const aCN = b.map((x) => x.identifier).join(" ");
|
|
240
|
+
if (a.length && b.length) {
|
|
241
|
+
finalClassNames.push(
|
|
242
|
+
t.conditionalExpression(
|
|
243
|
+
ternary.test,
|
|
244
|
+
t.stringLiteral(cCN),
|
|
245
|
+
t.stringLiteral(aCN)
|
|
246
|
+
)
|
|
247
|
+
);
|
|
248
|
+
} else {
|
|
249
|
+
finalClassNames.push(
|
|
250
|
+
t.conditionalExpression(
|
|
251
|
+
ternary.test,
|
|
252
|
+
t.stringLiteral(" " + cCN),
|
|
253
|
+
t.stringLiteral(" " + aCN)
|
|
254
|
+
)
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (shouldPrintDebug) {
|
|
259
|
+
console.log(
|
|
260
|
+
" finalClassNames\n",
|
|
261
|
+
logLines(finalClassNames.map((x) => x["value"]).join(" "))
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
node.attributes = finalAttrs;
|
|
265
|
+
if (finalClassNames.length) {
|
|
266
|
+
const extraClassNames = (() => {
|
|
267
|
+
let value = "";
|
|
268
|
+
if (!isFlattened) {
|
|
269
|
+
return value;
|
|
270
|
+
}
|
|
271
|
+
if (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS) {
|
|
272
|
+
value += `is_tamagui_flattened`;
|
|
273
|
+
}
|
|
274
|
+
if (staticConfig.componentName) {
|
|
275
|
+
value += ` is_${staticConfig.componentName}`;
|
|
276
|
+
}
|
|
277
|
+
if (staticConfig.isText) {
|
|
278
|
+
let family = completeProps.fontFamily;
|
|
279
|
+
if (family[0] === "$") {
|
|
280
|
+
family = family.slice(1);
|
|
281
|
+
}
|
|
282
|
+
value += ` font_${family}`;
|
|
283
|
+
}
|
|
284
|
+
return value;
|
|
285
|
+
})();
|
|
286
|
+
const names = buildClassName(finalClassNames, extraClassNames);
|
|
287
|
+
const nameExpr = names ? hoistClassNames(jsxPath, existingHoists, names) : null;
|
|
288
|
+
let expr = nameExpr;
|
|
289
|
+
if (nameExpr && !t.isIdentifier(nameExpr)) {
|
|
290
|
+
if (!didFlattenThisTag) {
|
|
291
|
+
} else {
|
|
292
|
+
ensureImportingConcat(programPath);
|
|
293
|
+
const simpleSpreads = attrs.filter(
|
|
294
|
+
(x) => t.isJSXSpreadAttribute(x.value) && isSimpleSpread(x.value)
|
|
295
|
+
);
|
|
296
|
+
expr = t.callExpression(t.identifier("concatClassName"), [
|
|
297
|
+
expr,
|
|
298
|
+
...simpleSpreads.map((val) => val.value["argument"])
|
|
299
|
+
]);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
node.attributes.push(
|
|
303
|
+
t.jsxAttribute(t.jsxIdentifier("className"), t.jsxExpressionContainer(expr))
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
const comment = util.format(
|
|
307
|
+
"/* %s:%s (%s) */",
|
|
308
|
+
filePath,
|
|
309
|
+
lineNumbers,
|
|
310
|
+
originalNodeName
|
|
311
|
+
);
|
|
312
|
+
for (const { identifier, rules } of finalStyles) {
|
|
313
|
+
const className = `.${identifier}`;
|
|
314
|
+
if (cssMap.has(className)) {
|
|
315
|
+
if (comment) {
|
|
316
|
+
const val = cssMap.get(className);
|
|
317
|
+
val.commentTexts.push(comment);
|
|
318
|
+
cssMap.set(className, val);
|
|
319
|
+
}
|
|
320
|
+
} else if (rules.length) {
|
|
321
|
+
cssMap.set(className, {
|
|
322
|
+
css: rules.join("\n"),
|
|
323
|
+
commentTexts: [comment]
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
if (!res || !res.modified && !res.optimized && !res.flattened && !res.styled) {
|
|
330
|
+
if (shouldPrintDebug) {
|
|
331
|
+
console.log("no res or none modified", res);
|
|
332
|
+
}
|
|
333
|
+
return null;
|
|
334
|
+
}
|
|
335
|
+
const styles = Array.from(cssMap.values()).map((x) => x.css).join("\n").trim();
|
|
336
|
+
const result = generate(
|
|
337
|
+
ast,
|
|
338
|
+
{
|
|
339
|
+
concise: false,
|
|
340
|
+
filename: sourcePath,
|
|
341
|
+
// this makes the debug output terrible, and i think sourcemap works already
|
|
342
|
+
retainLines: false,
|
|
343
|
+
sourceFileName: sourcePath,
|
|
344
|
+
sourceMaps: true
|
|
345
|
+
},
|
|
346
|
+
source
|
|
347
|
+
);
|
|
348
|
+
if (shouldPrintDebug) {
|
|
349
|
+
console.log(
|
|
350
|
+
"\n -------- output code ------- \n\n",
|
|
351
|
+
result.code.split("\n").filter((x) => !x.startsWith("//")).join("\n")
|
|
352
|
+
);
|
|
353
|
+
console.log("\n -------- output style -------- \n\n", styles);
|
|
354
|
+
}
|
|
355
|
+
if (shouldLogTiming) {
|
|
356
|
+
const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0;
|
|
357
|
+
const path2 = basename(sourcePath || "").replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padStart(24);
|
|
358
|
+
const numStyled = `${res.styled}`.padStart(3);
|
|
359
|
+
const numOptimized = `${res.optimized}`.padStart(3);
|
|
360
|
+
const numFound = `${res.found}`.padStart(3);
|
|
361
|
+
const numFlattened = `${res.flattened}`.padStart(3);
|
|
362
|
+
const memory = process.env.DEBUG && memUsed > 10 ? ` ${memUsed}MB` : "";
|
|
363
|
+
const timing = Date.now() - start;
|
|
364
|
+
const timingStr = `${timing}ms`.padStart(6);
|
|
365
|
+
const pre = getPrefixLogs(options);
|
|
366
|
+
const memStr = memory ? `(${memory})` : "";
|
|
367
|
+
console.log(
|
|
368
|
+
`${pre} ${path2} ${numFound} \xB7 ${numOptimized} \xB7 ${numFlattened} \xB7 ${numStyled} ${timingStr} ${memStr}`
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
return {
|
|
372
|
+
ast,
|
|
373
|
+
styles,
|
|
374
|
+
js: result.code,
|
|
375
|
+
map: result.map
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
export {
|
|
379
|
+
extractToClassNames
|
|
380
|
+
};
|
|
15
381
|
//# sourceMappingURL=extractToClassNames.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/extractToClassNames.ts"],
|
|
4
4
|
"sourcesContent": ["import * as path from 'path'\nimport { basename } from 'path'\nimport * as util from 'util'\n\nimport generate from '@babel/generator'\nimport * as t from '@babel/types'\nimport { getStylesAtomic } from '@tamagui/core-node'\nimport { concatClassName } from '@tamagui/helpers'\nimport type { ViewStyle } from 'react-native'\n\nimport type { ClassNameObject, StyleObject, TamaguiOptions, Ternary } from '../types.js'\nimport { babelParse } from './babelParse.js'\nimport { buildClassName } from './buildClassName.js'\nimport { Extractor } from './createExtractor.js'\nimport { ensureImportingConcat } from './ensureImportingConcat.js'\nimport { isSimpleSpread } from './extractHelpers.js'\nimport { extractMediaStyle } from './extractMediaStyle.js'\nimport { getPrefixLogs } from './getPrefixLogs.js'\nimport { hoistClassNames } from './hoistClassNames.js'\nimport { logLines } from './logLines.js'\nimport { timer } from './timer.js'\n\nconst mergeStyleGroups = {\n shadowOpacity: true,\n shadowRadius: true,\n shadowColor: true,\n shadowOffset: true,\n}\n\nexport type ExtractedResponse = {\n js: string | Buffer\n styles: string\n stylesPath?: string\n ast: t.File\n map: any // RawSourceMap from 'source-map'\n}\n\nexport type ExtractToClassNamesProps = {\n extractor: Extractor\n source: string | Buffer\n sourcePath?: string\n options: TamaguiOptions\n shouldPrintDebug: boolean | 'verbose'\n}\n\nexport async function extractToClassNames({\n extractor,\n source,\n sourcePath,\n options,\n shouldPrintDebug,\n}: ExtractToClassNamesProps): Promise<ExtractedResponse | null> {\n const tm = timer()\n\n if (shouldPrintDebug) {\n console.log(`--- ${sourcePath} --- \\n\\n`)\n }\n\n if (typeof source !== 'string') {\n throw new Error('`source` must be a string of javascript')\n }\n if (sourcePath && !path.isAbsolute(sourcePath)) {\n throw new Error('`sourcePath` must be an absolute path to a .js file')\n }\n if (!/.[tj]sx?$/i.test(sourcePath || '')) {\n console.log(`${sourcePath?.slice(0, 100)} - bad filename.`)\n }\n\n // dont include loading in timing of parsing (one time cost)\n await extractor.loadTamagui(options)\n\n const shouldLogTiming = options.logTimings ?? true\n const start = Date.now()\n const mem = shouldLogTiming ? process.memoryUsage() : null\n\n // Using a map for (officially supported) guaranteed insertion order\n let ast: t.File\n\n try {\n ast = babelParse(source)\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('babel parse error:', sourcePath?.slice(0, 100))\n throw err\n }\n\n tm.mark(`babel-parse`, shouldPrintDebug === 'verbose')\n\n const cssMap = new Map<string, { css: string; commentTexts: string[] }>()\n const existingHoists: { [key: string]: t.Identifier } = {}\n\n let hasFlattened = false\n\n const res = await extractor.parse(ast, {\n shouldPrintDebug,\n ...options,\n sourcePath,\n target: 'html',\n extractStyledDefinitions: true,\n onStyleRule(identifier, rules) {\n const css = rules.join(';')\n if (shouldPrintDebug) {\n // eslint-disable-next-line no-console\n console.log(`adding styled() rule: .${identifier} ${css}`)\n }\n cssMap.set(`.${identifier}`, { css, commentTexts: [] })\n },\n getFlattenedNode: ({ tag }) => {\n hasFlattened = true\n return tag\n },\n onExtractTag: ({\n parserProps,\n attrs,\n node,\n attemptEval,\n jsxPath,\n originalNodeName,\n filePath,\n lineNumbers,\n programPath,\n isFlattened,\n completeProps,\n staticConfig,\n }) => {\n // bail out of views that don't accept className (falls back to runtime + style={})\n if (staticConfig.acceptsClassName === false) {\n if (shouldPrintDebug) {\n // eslint-disable-next-line no-console\n console.log(`bail, acceptsClassName is false`)\n }\n return\n }\n\n // reset hasFlattened\n const didFlattenThisTag = hasFlattened\n hasFlattened = false\n\n let finalClassNames: ClassNameObject[] = []\n const finalAttrs: (t.JSXAttribute | t.JSXSpreadAttribute)[] = []\n let finalStyles: StyleObject[] = []\n\n let viewStyles = {}\n for (const attr of attrs) {\n if (attr.type === 'style') {\n viewStyles = {\n ...viewStyles,\n ...attr.value,\n }\n }\n }\n\n const ensureNeededPrevStyle = (style: ViewStyle) => {\n // ensure all group keys are merged\n const keys = Object.keys(style)\n if (!keys.some((key) => mergeStyleGroups[key])) {\n return style\n }\n for (const k in mergeStyleGroups) {\n if (k in viewStyles) {\n style[k] = style[k] ?? viewStyles[k]\n }\n }\n return style\n }\n\n const addStyles = (style: ViewStyle | null): StyleObject[] => {\n if (!style) return []\n const styleWithPrev = ensureNeededPrevStyle(style)\n const res = getStylesAtomic(styleWithPrev)\n if (res.length) {\n finalStyles = [...finalStyles, ...res]\n }\n return res\n }\n\n // 1 to start above any :hover styles\n let lastMediaImportance = 1\n for (const attr of attrs) {\n switch (attr.type) {\n case 'style': {\n if (!isFlattened) {\n const styles = getStylesAtomic(attr.value)\n\n finalStyles = [...finalStyles, ...styles]\n\n for (const style of styles) {\n // leave them as attributes\n const prop = style.pseudo\n ? `${style.property}-${style.pseudo}`\n : style.property\n finalAttrs.push(\n t.jsxAttribute(t.jsxIdentifier(prop), t.stringLiteral(style.identifier))\n )\n }\n } else {\n const styles = addStyles(attr.value)\n const newClassNames = concatClassName(\n styles.map((x) => x.identifier).join(' ')\n )\n const existing = finalClassNames.find(\n (x) => x.type == 'StringLiteral'\n ) as t.StringLiteral | null\n\n if (existing) {\n existing.value = `${existing.value} ${newClassNames}`\n } else {\n finalClassNames = [...finalClassNames, t.stringLiteral(newClassNames)]\n }\n }\n\n break\n }\n case 'attr': {\n const val = attr.value\n if (t.isJSXSpreadAttribute(val)) {\n if (isSimpleSpread(val)) {\n finalClassNames.push(\n t.logicalExpression(\n '&&',\n val.argument,\n t.memberExpression(val.argument, t.identifier('className'))\n )\n )\n }\n } else if (val.name.name === 'className') {\n const value = val.value\n if (value) {\n try {\n const evaluatedValue = attemptEval(value)\n finalClassNames.push(t.stringLiteral(evaluatedValue))\n } catch (e) {\n finalClassNames.push(value['expression'])\n }\n }\n continue\n }\n finalAttrs.push(val)\n break\n }\n case 'ternary': {\n const mediaExtraction = extractMediaStyle(\n parserProps,\n attr.value,\n jsxPath,\n extractor.getTamagui()!,\n sourcePath || '',\n lastMediaImportance,\n shouldPrintDebug\n )\n if (shouldPrintDebug) {\n if (mediaExtraction) {\n // eslint-disable-next-line no-console\n console.log(\n 'ternary (mediaStyles)',\n mediaExtraction.ternaryWithoutMedia?.inlineMediaQuery ?? '',\n mediaExtraction.mediaStyles.map((x) => x.identifier).join('.')\n )\n }\n }\n if (!mediaExtraction) {\n addTernaryStyle(\n attr.value,\n addStyles(attr.value.consequent),\n addStyles(attr.value.alternate)\n )\n continue\n }\n lastMediaImportance++\n if (mediaExtraction.mediaStyles) {\n finalStyles = [...finalStyles, ...mediaExtraction.mediaStyles]\n }\n if (mediaExtraction.ternaryWithoutMedia) {\n addTernaryStyle(\n mediaExtraction.ternaryWithoutMedia,\n mediaExtraction.mediaStyles,\n []\n )\n } else {\n finalClassNames = [\n ...finalClassNames,\n ...mediaExtraction.mediaStyles.map((x) => t.stringLiteral(x.identifier)),\n ]\n }\n break\n }\n }\n }\n\n function addTernaryStyle(ternary: Ternary, a: any, b: any) {\n const cCN = a.map((x) => x.identifier).join(' ')\n const aCN = b.map((x) => x.identifier).join(' ')\n\n if (a.length && b.length) {\n finalClassNames.push(\n t.conditionalExpression(\n ternary.test,\n t.stringLiteral(cCN),\n t.stringLiteral(aCN)\n )\n )\n } else {\n finalClassNames.push(\n t.conditionalExpression(\n ternary.test,\n t.stringLiteral(' ' + cCN),\n t.stringLiteral(' ' + aCN)\n )\n )\n }\n }\n\n if (shouldPrintDebug) {\n // eslint-disable-next-line no-console\n console.log(\n ' finalClassNames\\n',\n logLines(finalClassNames.map((x) => x['value']).join(' '))\n )\n }\n\n node.attributes = finalAttrs\n\n if (finalClassNames.length) {\n const extraClassNames = (() => {\n let value = ''\n if (!isFlattened) {\n return value\n }\n\n // helper to see how many get flattened\n if (process.env.TAMAGUI_DEBUG_OPTIMIZATIONS) {\n value += `is_tamagui_flattened`\n }\n\n // add is_Component className\n if (staticConfig.componentName) {\n value += ` is_${staticConfig.componentName}`\n }\n\n if (staticConfig.isText) {\n let family = completeProps.fontFamily\n if (family[0] === '$') {\n family = family.slice(1)\n }\n value += ` font_${family}`\n }\n\n return value\n })()\n\n // inserts the _cn variable and uses it for className\n const names = buildClassName(finalClassNames, extraClassNames)\n\n const nameExpr = names ? hoistClassNames(jsxPath, existingHoists, names) : null\n let expr = nameExpr\n\n // if has some spreads, use concat helper\n if (nameExpr && !t.isIdentifier(nameExpr)) {\n if (!didFlattenThisTag) {\n // not flat\n } else {\n ensureImportingConcat(programPath)\n const simpleSpreads = attrs.filter(\n (x) => t.isJSXSpreadAttribute(x.value) && isSimpleSpread(x.value)\n )\n expr = t.callExpression(t.identifier('concatClassName'), [\n expr,\n ...simpleSpreads.map((val) => val.value['argument']),\n ])\n }\n }\n\n node.attributes.push(\n t.jsxAttribute(t.jsxIdentifier('className'), t.jsxExpressionContainer(expr))\n )\n }\n\n const comment = util.format(\n '/* %s:%s (%s) */',\n filePath,\n lineNumbers,\n originalNodeName\n )\n\n for (const { identifier, rules } of finalStyles) {\n const className = `.${identifier}`\n if (cssMap.has(className)) {\n if (comment) {\n const val = cssMap.get(className)!\n val.commentTexts.push(comment)\n cssMap.set(className, val)\n }\n } else if (rules.length) {\n cssMap.set(className, {\n css: rules.join('\\n'),\n commentTexts: [comment],\n })\n }\n }\n },\n })\n\n if (!res || (!res.modified && !res.optimized && !res.flattened && !res.styled)) {\n if (shouldPrintDebug) {\n // eslint-disable-next-line no-console\n console.log('no res or none modified', res)\n }\n return null\n }\n\n const styles = Array.from(cssMap.values())\n .map((x) => x.css)\n .join('\\n')\n .trim()\n\n // @ts-ignore\n const result = generate(\n ast as any,\n {\n concise: false,\n filename: sourcePath,\n // this makes the debug output terrible, and i think sourcemap works already\n retainLines: false,\n sourceFileName: sourcePath,\n sourceMaps: true,\n },\n source\n )\n\n if (shouldPrintDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '\\n -------- output code ------- \\n\\n',\n result.code\n .split('\\n')\n .filter((x) => !x.startsWith('//'))\n .join('\\n')\n )\n // eslint-disable-next-line no-console\n console.log('\\n -------- output style -------- \\n\\n', styles)\n }\n\n if (shouldLogTiming) {\n const memUsed = mem\n ? Math.round(((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204) * 10) /\n 10\n : 0\n const path = basename(sourcePath || '')\n .replace(/\\.[jt]sx?$/, '')\n .slice(0, 22)\n .trim()\n .padStart(24)\n\n const numStyled = `${res.styled}`.padStart(3)\n const numOptimized = `${res.optimized}`.padStart(3)\n const numFound = `${res.found}`.padStart(3)\n const numFlattened = `${res.flattened}`.padStart(3)\n const memory = process.env.DEBUG && memUsed > 10 ? ` ${memUsed}MB` : ''\n const timing = Date.now() - start\n const timingStr = `${timing}ms`.padStart(6)\n const pre = getPrefixLogs(options)\n const memStr = memory ? `(${memory})` : ''\n // eslint-disable-next-line no-console\n console.log(\n `${pre} ${path} ${numFound} \u00B7 ${numOptimized} \u00B7 ${numFlattened} \u00B7 ${numStyled} ${timingStr} ${memStr}`\n )\n }\n\n return {\n ast,\n styles,\n js: result.code,\n map: result.map,\n }\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "AAAA,YAAY,UAAU;AACtB,SAAS,gBAAgB;AACzB,YAAY,UAAU;AAEtB,OAAO,cAAc;AACrB,YAAY,OAAO;AACnB,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;AAIhC,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,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,MAAM;AAEjB,MAAI,kBAAkB;AACpB,YAAQ,IAAI,OAAO;AAAA;AAAA,CAAqB;AAAA,EAC1C;AAEA,MAAI,OAAO,WAAW,UAAU;AAC9B,UAAM,IAAI,MAAM,yCAAyC;AAAA,EAC3D;AACA,MAAI,cAAc,CAAC,KAAK,WAAW,UAAU,GAAG;AAC9C,UAAM,IAAI,MAAM,qDAAqD;AAAA,EACvE;AACA,MAAI,CAAC,aAAa,KAAK,cAAc,EAAE,GAAG;AACxC,YAAQ,IAAI,GAAG,yCAAY,MAAM,GAAG,sBAAsB;AAAA,EAC5D;AAGA,QAAM,UAAU,YAAY,OAAO;AAEnC,QAAM,kBAAkB,QAAQ,cAAc;AAC9C,QAAM,QAAQ,KAAK,IAAI;AACvB,QAAM,MAAM,kBAAkB,QA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EACL,SAAS,EAAE;AAEd,UAAM,YAAY,GAAG,IAAI,SAAS,SAAS,CAAC;AAC5C,UAAM,eAAe,GAAG,IAAI,YAAY,SAAS,CAAC;AAClD,UAAM,WAAW,GAAG,IAAI,QAAQ,SAAS,CAAC;AAC1C,UAAM,eAAe,GAAG,IAAI,YAAY,SAAS,CAAC;AAClD,UAAM,SAAS,QAAQ,IAAI,SAAS,UAAU,KAAK,IAAI,cAAc;AACrE,UAAM,SAAS,KAAK,IAAI,IAAI;AAC5B,UAAM,YAAY,GAAG,WAAW,SAAS,CAAC;AAC1C,UAAM,MAAM,cAAc,OAAO;AACjC,UAAM,SAAS,SAAS,IAAI,YAAY;AAExC,YAAQ;AAAA,MACN,GAAG,OAAOA,UAAS,iBAAc,qBAAkB,qBAAkB,cAAc,aAAa;AAAA,IAClG;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,IAAI,OAAO;AAAA,IACX,KAAK,OAAO;AAAA,EACd;AACF;",
|
|
6
|
+
"names": ["res", "styles", "path"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
function
|
|
1
|
+
function findTopmostFunction(jsxPath) {
|
|
2
|
+
const isFunction = (path) => path.isArrowFunctionExpression() || path.isFunctionDeclaration() || path.isFunctionExpression();
|
|
3
|
+
let compFn = jsxPath.findParent(isFunction);
|
|
4
|
+
while (compFn) {
|
|
5
|
+
const parent = compFn.findParent(isFunction);
|
|
6
|
+
if (parent) {
|
|
7
|
+
compFn = parent;
|
|
8
|
+
} else {
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
if (!compFn) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return compFn;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
findTopmostFunction
|
|
19
|
+
};
|
|
2
20
|
//# sourceMappingURL=findTopmostFunction.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/findTopmostFunction.ts"],
|
|
4
4
|
"sourcesContent": ["import { NodePath } from '@babel/traverse'\nimport * as t from '@babel/types'\n\nexport function findTopmostFunction(jsxPath: NodePath<t.JSXElement>) {\n // get topmost fn\n const isFunction = (path: NodePath<any>) =>\n path.isArrowFunctionExpression() || path.isFunctionDeclaration() || path.isFunctionExpression()\n let compFn: NodePath<any> | null = jsxPath.findParent(isFunction)\n while (compFn) {\n const parent = compFn.findParent(isFunction)\n if (parent) {\n compFn = parent\n } else {\n break\n }\n }\n if (!compFn) {\n // console.error(`Couldn't find a topmost function for media query extraction`)\n return null\n }\n return compFn\n}\n"],
|
|
5
|
-
"mappings": "AAGO,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAGO,SAAS,oBAAoB,SAAiC;AAEnE,QAAM,aAAa,CAAC,SAClB,KAAK,0BAA0B,KAAK,KAAK,sBAAsB,KAAK,KAAK,qBAAqB;AAChG,MAAI,SAA+B,QAAQ,WAAW,UAAU;AAChE,SAAO,QAAQ;AACb,UAAM,SAAS,OAAO,WAAW,UAAU;AAC3C,QAAI,QAAQ;AACV,eAAS;AAAA,IACX,OAAO;AACL;AAAA,IACF;AAAA,EACF;AACA,MAAI,CAAC,QAAQ;AAEX,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
function
|
|
1
|
+
function findTopmostFunction(jsxPath) {
|
|
2
|
+
const isFunction = (path) => path.isArrowFunctionExpression() || path.isFunctionDeclaration() || path.isFunctionExpression();
|
|
3
|
+
let compFn = jsxPath.findParent(isFunction);
|
|
4
|
+
while (compFn) {
|
|
5
|
+
const parent = compFn.findParent(isFunction);
|
|
6
|
+
if (parent) {
|
|
7
|
+
compFn = parent;
|
|
8
|
+
} else {
|
|
9
|
+
break;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
if (!compFn) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
return compFn;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
findTopmostFunction
|
|
19
|
+
};
|
|
2
20
|
//# sourceMappingURL=findTopmostFunction.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/findTopmostFunction.ts"],
|
|
4
4
|
"sourcesContent": ["import { NodePath } from '@babel/traverse'\nimport * as t from '@babel/types'\n\nexport function findTopmostFunction(jsxPath: NodePath<t.JSXElement>) {\n // get topmost fn\n const isFunction = (path: NodePath<any>) =>\n path.isArrowFunctionExpression() || path.isFunctionDeclaration() || path.isFunctionExpression()\n let compFn: NodePath<any> | null = jsxPath.findParent(isFunction)\n while (compFn) {\n const parent = compFn.findParent(isFunction)\n if (parent) {\n compFn = parent\n } else {\n break\n }\n }\n if (!compFn) {\n // console.error(`Couldn't find a topmost function for media query extraction`)\n return null\n }\n return compFn\n}\n"],
|
|
5
|
-
"mappings": "AAGO,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAGO,SAAS,oBAAoB,SAAiC;AAEnE,QAAM,aAAa,CAAC,SAClB,KAAK,0BAA0B,KAAK,KAAK,sBAAsB,KAAK,KAAK,qBAAqB;AAChG,MAAI,SAA+B,QAAQ,WAAW,UAAU;AAChE,SAAO,QAAQ;AACb,UAAM,SAAS,OAAO,WAAW,UAAU;AAC3C,QAAI,QAAQ;AACV,eAAS;AAAA,IACX,OAAO;AACL;AAAA,IACF;AAAA,EACF;AACA,MAAI,CAAC,QAAQ;AAEX,WAAO;AAAA,EACT;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import * as t from "@babel/types";
|
|
2
|
+
function generateUid(scope, name) {
|
|
3
|
+
if (!(typeof scope === "object"))
|
|
4
|
+
throw "generateUid expects a scope object as its first parameter";
|
|
5
|
+
if (!(typeof name === "string" && name !== ""))
|
|
6
|
+
throw "generateUid expects a valid name as its second parameter";
|
|
7
|
+
name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
|
|
8
|
+
let uid;
|
|
9
|
+
let i = 0;
|
|
10
|
+
do {
|
|
11
|
+
if (i > 1) {
|
|
12
|
+
uid = name + i;
|
|
13
|
+
} else {
|
|
14
|
+
uid = name;
|
|
15
|
+
}
|
|
16
|
+
i++;
|
|
17
|
+
} while (scope.hasLabel(uid) || scope.hasBinding(uid) || scope.hasGlobal(uid) || scope.hasReference(uid));
|
|
18
|
+
const program = scope.getProgramParent();
|
|
19
|
+
program.references[uid] = true;
|
|
20
|
+
program.uids[uid] = true;
|
|
21
|
+
return uid;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
generateUid
|
|
25
|
+
};
|
|
2
26
|
//# sourceMappingURL=generatedUid.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/generatedUid.ts"],
|
|
4
4
|
"sourcesContent": ["import * as t from '@babel/types'\nimport invariant from 'invariant'\n\n// TODO: open a PR upstream\ndeclare module '@babel/types' {\n export function toIdentifier(input: string): string\n}\n\n// A clone of path.scope.generateUid that doesn't prepend underscores\nexport function generateUid(scope: any, name: string): string {\n if (!(typeof scope === 'object'))\n throw 'generateUid expects a scope object as its first parameter'\n if (!(typeof name === 'string' && name !== ''))\n throw 'generateUid expects a valid name as its second parameter'\n\n name = t\n .toIdentifier(name)\n .replace(/^_+/, '')\n .replace(/[0-9]+$/g, '')\n\n let uid\n let i = 0\n do {\n if (i > 1) {\n uid = name + i\n } else {\n uid = name\n }\n i++\n } while (\n scope.hasLabel(uid) ||\n scope.hasBinding(uid) ||\n scope.hasGlobal(uid) ||\n scope.hasReference(uid)\n )\n\n const program = scope.getProgramParent()\n program.references[uid] = true\n program.uids[uid] = true\n\n return uid\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAAA,YAAY,OAAO;AASZ,SAAS,YAAY,OAAY,MAAsB;AAC5D,MAAI,EAAE,OAAO,UAAU;AACrB,UAAM;AACR,MAAI,EAAE,OAAO,SAAS,YAAY,SAAS;AACzC,UAAM;AAER,SAAO,EACJ,aAAa,IAAI,EACjB,QAAQ,OAAO,EAAE,EACjB,QAAQ,YAAY,EAAE;AAEzB,MAAI;AACJ,MAAI,IAAI;AACR,KAAG;AACD,QAAI,IAAI,GAAG;AACT,YAAM,OAAO;AAAA,IACf,OAAO;AACL,YAAM;AAAA,IACR;AACA;AAAA,EACF,SACE,MAAM,SAAS,GAAG,KAClB,MAAM,WAAW,GAAG,KACpB,MAAM,UAAU,GAAG,KACnB,MAAM,aAAa,GAAG;AAGxB,QAAM,UAAU,MAAM,iBAAiB;AACvC,UAAQ,WAAW,GAAG,IAAI;AAC1B,UAAQ,KAAK,GAAG,IAAI;AAEpB,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|