@tamagui/static 1.0.1-beta.70 → 1.0.1-beta.73
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/extractor/accessSafe.js +0 -2
- package/dist/cjs/extractor/accessSafe.js.map +1 -1
- package/dist/cjs/extractor/babelParse.js +0 -2
- package/dist/cjs/extractor/babelParse.js.map +1 -1
- package/dist/cjs/extractor/buildClassName.js +0 -2
- package/dist/cjs/extractor/buildClassName.js.map +1 -1
- package/dist/cjs/extractor/createEvaluator.js +2 -5
- package/dist/cjs/extractor/createEvaluator.js.map +1 -1
- package/dist/cjs/extractor/createExtractor.js +10 -21
- package/dist/cjs/extractor/createExtractor.js.map +1 -1
- package/dist/cjs/extractor/ensureImportingConcat.js +0 -2
- package/dist/cjs/extractor/ensureImportingConcat.js.map +1 -1
- package/dist/cjs/extractor/evaluateAstNode.js +0 -2
- package/dist/cjs/extractor/evaluateAstNode.js.map +1 -1
- package/dist/cjs/extractor/extractHelpers.js +11 -16
- package/dist/cjs/extractor/extractHelpers.js.map +1 -1
- package/dist/cjs/extractor/extractMediaStyle.js +2 -7
- package/dist/cjs/extractor/extractMediaStyle.js.map +1 -1
- package/dist/cjs/extractor/extractToClassNames.js +5 -18
- package/dist/cjs/extractor/extractToClassNames.js.map +2 -2
- package/dist/cjs/extractor/findTopmostFunction.js +1 -3
- package/dist/cjs/extractor/findTopmostFunction.js.map +1 -1
- package/dist/cjs/extractor/generatedUid.js +0 -2
- package/dist/cjs/extractor/generatedUid.js.map +1 -1
- package/dist/cjs/extractor/getPrefixLogs.js +0 -2
- package/dist/cjs/extractor/getPrefixLogs.js.map +1 -1
- package/dist/cjs/extractor/getPropValueFromAttributes.js +0 -2
- package/dist/cjs/extractor/getPropValueFromAttributes.js.map +1 -1
- package/dist/cjs/extractor/getSourceModule.js +0 -2
- package/dist/cjs/extractor/getSourceModule.js.map +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.js +1 -5
- package/dist/cjs/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/cjs/extractor/hoistClassNames.js +0 -3
- package/dist/cjs/extractor/hoistClassNames.js.map +1 -1
- package/dist/cjs/extractor/literalToAst.js +0 -4
- package/dist/cjs/extractor/literalToAst.js.map +1 -1
- package/dist/cjs/extractor/loadTamagui.js +0 -2
- package/dist/cjs/extractor/loadTamagui.js.map +1 -1
- package/dist/cjs/extractor/logLines.js +2 -3
- package/dist/cjs/extractor/logLines.js.map +1 -1
- package/dist/cjs/extractor/normalizeTernaries.js +0 -2
- package/dist/cjs/extractor/normalizeTernaries.js.map +1 -1
- package/dist/cjs/extractor/removeUnusedHooks.js +2 -4
- package/dist/cjs/extractor/removeUnusedHooks.js.map +1 -1
- package/dist/cjs/extractor/timer.js +2 -3
- package/dist/cjs/extractor/timer.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/extractor/accessSafe.js +0 -3
- package/dist/esm/extractor/accessSafe.js.map +1 -1
- package/dist/esm/extractor/babelParse.js +0 -3
- package/dist/esm/extractor/babelParse.js.map +1 -1
- package/dist/esm/extractor/buildClassName.js +0 -3
- package/dist/esm/extractor/buildClassName.js.map +1 -1
- package/dist/esm/extractor/createEvaluator.js +2 -6
- package/dist/esm/extractor/createEvaluator.js.map +1 -1
- package/dist/esm/extractor/createExtractor.js +10 -22
- package/dist/esm/extractor/createExtractor.js.map +1 -1
- package/dist/esm/extractor/ensureImportingConcat.js +0 -3
- package/dist/esm/extractor/ensureImportingConcat.js.map +1 -1
- package/dist/esm/extractor/evaluateAstNode.js +0 -3
- package/dist/esm/extractor/evaluateAstNode.js.map +1 -1
- package/dist/esm/extractor/extractHelpers.js +11 -17
- package/dist/esm/extractor/extractHelpers.js.map +1 -1
- package/dist/esm/extractor/extractMediaStyle.js +2 -8
- package/dist/esm/extractor/extractMediaStyle.js.map +1 -1
- package/dist/esm/extractor/extractToClassNames.js +5 -19
- package/dist/esm/extractor/extractToClassNames.js.map +2 -2
- package/dist/esm/extractor/findTopmostFunction.js +1 -4
- package/dist/esm/extractor/findTopmostFunction.js.map +1 -1
- package/dist/esm/extractor/generatedUid.js +0 -3
- package/dist/esm/extractor/generatedUid.js.map +1 -1
- package/dist/esm/extractor/getPrefixLogs.js +0 -3
- package/dist/esm/extractor/getPrefixLogs.js.map +1 -1
- package/dist/esm/extractor/getPropValueFromAttributes.js +0 -3
- package/dist/esm/extractor/getPropValueFromAttributes.js.map +1 -1
- package/dist/esm/extractor/getSourceModule.js +0 -3
- package/dist/esm/extractor/getSourceModule.js.map +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.js +1 -6
- package/dist/esm/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/esm/extractor/hoistClassNames.js +0 -4
- package/dist/esm/extractor/hoistClassNames.js.map +1 -1
- package/dist/esm/extractor/literalToAst.js +0 -5
- package/dist/esm/extractor/literalToAst.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.js +0 -3
- package/dist/esm/extractor/loadTamagui.js.map +1 -1
- package/dist/esm/extractor/logLines.js +2 -4
- package/dist/esm/extractor/logLines.js.map +1 -1
- package/dist/esm/extractor/normalizeTernaries.js +0 -3
- package/dist/esm/extractor/normalizeTernaries.js.map +1 -1
- package/dist/esm/extractor/removeUnusedHooks.js +2 -5
- package/dist/esm/extractor/removeUnusedHooks.js.map +1 -1
- package/dist/esm/extractor/timer.js +2 -4
- package/dist/esm/extractor/timer.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/jsx/extractor/accessSafe.js +0 -3
- package/dist/jsx/extractor/babelParse.js +0 -3
- package/dist/jsx/extractor/buildClassName.js +0 -3
- package/dist/jsx/extractor/createEvaluator.js +2 -6
- package/dist/jsx/extractor/createExtractor.js +10 -22
- package/dist/jsx/extractor/ensureImportingConcat.js +0 -3
- package/dist/jsx/extractor/evaluateAstNode.js +0 -3
- package/dist/jsx/extractor/extractHelpers.js +11 -17
- package/dist/jsx/extractor/extractMediaStyle.js +2 -8
- package/dist/jsx/extractor/extractToClassNames.js +5 -19
- package/dist/jsx/extractor/findTopmostFunction.js +1 -4
- package/dist/jsx/extractor/generatedUid.js +0 -3
- package/dist/jsx/extractor/getPrefixLogs.js +0 -3
- package/dist/jsx/extractor/getPropValueFromAttributes.js +0 -3
- package/dist/jsx/extractor/getSourceModule.js +0 -3
- package/dist/jsx/extractor/getStaticBindingsForScope.js +1 -6
- package/dist/jsx/extractor/hoistClassNames.js +0 -4
- package/dist/jsx/extractor/literalToAst.js +0 -5
- package/dist/jsx/extractor/loadTamagui.js +0 -3
- package/dist/jsx/extractor/logLines.js +2 -4
- package/dist/jsx/extractor/normalizeTernaries.js +0 -3
- package/dist/jsx/extractor/removeUnusedHooks.js +2 -5
- package/dist/jsx/extractor/timer.js +2 -4
- package/dist/jsx/index.js +1 -1
- package/package.json +10 -9
- package/src/extractor/extractToClassNames.ts +0 -19
- package/src/index.ts +1 -1
- package/types/constants.d.ts +0 -0
- package/types/constants.d.ts.map +0 -0
- package/types/extractor/accessSafe.d.ts +0 -0
- package/types/extractor/accessSafe.d.ts.map +0 -0
- package/types/extractor/babelParse.d.ts +0 -0
- package/types/extractor/babelParse.d.ts.map +0 -0
- package/types/extractor/buildClassName.d.ts +0 -0
- package/types/extractor/buildClassName.d.ts.map +0 -0
- package/types/extractor/createEvaluator.d.ts +0 -0
- package/types/extractor/createEvaluator.d.ts.map +0 -0
- package/types/extractor/createExtractor.d.ts +0 -0
- package/types/extractor/createExtractor.d.ts.map +0 -0
- package/types/extractor/ensureImportingConcat.d.ts +0 -0
- package/types/extractor/ensureImportingConcat.d.ts.map +0 -0
- package/types/extractor/evaluateAstNode.d.ts +0 -0
- package/types/extractor/evaluateAstNode.d.ts.map +0 -0
- package/types/extractor/extractHelpers.d.ts +0 -0
- package/types/extractor/extractHelpers.d.ts.map +0 -0
- package/types/extractor/extractMediaStyle.d.ts +0 -0
- package/types/extractor/extractMediaStyle.d.ts.map +0 -0
- package/types/extractor/extractToClassNames.d.ts +1 -6
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/findTopmostFunction.d.ts +0 -0
- package/types/extractor/findTopmostFunction.d.ts.map +0 -0
- package/types/extractor/generatedUid.d.ts +0 -0
- package/types/extractor/generatedUid.d.ts.map +0 -0
- package/types/extractor/getPrefixLogs.d.ts +0 -0
- package/types/extractor/getPrefixLogs.d.ts.map +0 -0
- package/types/extractor/getPropValueFromAttributes.d.ts +0 -0
- package/types/extractor/getPropValueFromAttributes.d.ts.map +0 -0
- package/types/extractor/getSourceModule.d.ts +0 -0
- package/types/extractor/getSourceModule.d.ts.map +0 -0
- package/types/extractor/getStaticBindingsForScope.d.ts +0 -0
- package/types/extractor/getStaticBindingsForScope.d.ts.map +0 -0
- package/types/extractor/hoistClassNames.d.ts +0 -0
- package/types/extractor/hoistClassNames.d.ts.map +0 -0
- package/types/extractor/literalToAst.d.ts +0 -0
- package/types/extractor/literalToAst.d.ts.map +0 -0
- package/types/extractor/loadTamagui.d.ts +0 -0
- package/types/extractor/loadTamagui.d.ts.map +0 -0
- package/types/extractor/logLines.d.ts +0 -0
- package/types/extractor/logLines.d.ts.map +0 -0
- package/types/extractor/normalizeTernaries.d.ts +0 -0
- package/types/extractor/normalizeTernaries.d.ts.map +0 -0
- package/types/extractor/removeUnusedHooks.d.ts +0 -0
- package/types/extractor/removeUnusedHooks.d.ts.map +0 -0
- package/types/extractor/timer.d.ts +0 -0
- package/types/extractor/timer.d.ts.map +0 -0
- package/types/extractor/validHTMLAttributes.d.ts +0 -0
- package/types/extractor/validHTMLAttributes.d.ts.map +0 -0
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +0 -0
- package/types/types.d.ts.map +0 -0
- package/dist/cjs/patchReactNativeWeb.js +0 -107
- package/dist/cjs/patchReactNativeWeb.js.map +0 -7
- package/dist/esm/patchReactNativeWeb.js +0 -82
- package/dist/esm/patchReactNativeWeb.js.map +0 -7
- package/dist/jsx/patchReactNativeWeb.js +0 -81
- package/patches/18/createDOMProps.cjs.js +0 -385
- package/patches/18/createDOMProps.js +0 -379
- package/src/patchReactNativeWeb.ts +0 -116
- package/types/patchReactNativeWeb.d.ts +0 -2
- package/types/patchReactNativeWeb.d.ts.map +0 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
function getPrefixLogs(options) {
|
|
4
2
|
var _a;
|
|
5
3
|
const { TAMAGUI_TARGET } = process.env;
|
|
6
4
|
return (_a = options == null ? void 0 : options.prefixLogs) != null ? _a : ` ${TAMAGUI_TARGET} | `;
|
|
7
5
|
}
|
|
8
|
-
__name(getPrefixLogs, "getPrefixLogs");
|
|
9
6
|
export {
|
|
10
7
|
getPrefixLogs
|
|
11
8
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import generate from "@babel/generator";
|
|
4
2
|
import * as t from "@babel/types";
|
|
5
3
|
import { accessSafe } from "./accessSafe";
|
|
@@ -42,7 +40,6 @@ function getPropValueFromAttributes(propName, attrs) {
|
|
|
42
40
|
}
|
|
43
41
|
return propValue;
|
|
44
42
|
}
|
|
45
|
-
__name(getPropValueFromAttributes, "getPropValueFromAttributes");
|
|
46
43
|
export {
|
|
47
44
|
getPropValueFromAttributes
|
|
48
45
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import * as t from "@babel/types";
|
|
4
2
|
function getSourceModule(itemName, itemBinding) {
|
|
5
3
|
if (!itemBinding.constant) {
|
|
@@ -62,7 +60,6 @@ function getSourceModule(itemName, itemBinding) {
|
|
|
62
60
|
usesImportSyntax
|
|
63
61
|
};
|
|
64
62
|
}
|
|
65
|
-
__name(getSourceModule, "getSourceModule");
|
|
66
63
|
export {
|
|
67
64
|
getSourceModule
|
|
68
65
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import { dirname, extname, resolve } from "path";
|
|
4
2
|
import * as t from "@babel/types";
|
|
5
3
|
import { existsSync } from "fs-extra";
|
|
6
4
|
import { evaluateAstNode } from "./evaluateAstNode";
|
|
7
5
|
import { getSourceModule } from "./getSourceModule";
|
|
8
|
-
const isLocalImport =
|
|
6
|
+
const isLocalImport = (path) => path.startsWith(".") || path.startsWith("/");
|
|
9
7
|
function resolveImportPath(sourcePath, path) {
|
|
10
8
|
const sourceDir = dirname(sourcePath);
|
|
11
9
|
if (isLocalImport(path)) {
|
|
@@ -16,7 +14,6 @@ function resolveImportPath(sourcePath, path) {
|
|
|
16
14
|
}
|
|
17
15
|
return path;
|
|
18
16
|
}
|
|
19
|
-
__name(resolveImportPath, "resolveImportPath");
|
|
20
17
|
function importModule(path) {
|
|
21
18
|
const filenames = [path.replace(".js", ".tsx"), path.replace(".js", ".ts"), path];
|
|
22
19
|
for (const file of filenames) {
|
|
@@ -35,7 +32,6 @@ function importModule(path) {
|
|
|
35
32
|
}
|
|
36
33
|
return null;
|
|
37
34
|
}
|
|
38
|
-
__name(importModule, "importModule");
|
|
39
35
|
function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bindingCache, shouldPrintDebug) {
|
|
40
36
|
const bindings = scope.getAllBindings();
|
|
41
37
|
const ret = {};
|
|
@@ -130,7 +126,6 @@ function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bindingCac
|
|
|
130
126
|
}
|
|
131
127
|
return ret;
|
|
132
128
|
}
|
|
133
|
-
__name(getStaticBindingsForScope, "getStaticBindingsForScope");
|
|
134
129
|
export {
|
|
135
130
|
getStaticBindingsForScope
|
|
136
131
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import * as t from "@babel/types";
|
|
4
2
|
function hoistClassNames(path, existing, expr) {
|
|
5
3
|
const hoist = hoistClassNames.bind(null, path, existing);
|
|
@@ -35,9 +33,7 @@ function hoistClassNames(path, existing, expr) {
|
|
|
35
33
|
parent.unshiftContainer("body", variable);
|
|
36
34
|
return uid;
|
|
37
35
|
}
|
|
38
|
-
__name(replaceStringWithVariable, "replaceStringWithVariable");
|
|
39
36
|
}
|
|
40
|
-
__name(hoistClassNames, "hoistClassNames");
|
|
41
37
|
export {
|
|
42
38
|
hoistClassNames
|
|
43
39
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import * as t from "@babel/types";
|
|
4
2
|
function literalToAst(literal) {
|
|
5
3
|
if (literal === null) {
|
|
@@ -27,7 +25,6 @@ function literalToAst(literal) {
|
|
|
27
25
|
}));
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
|
-
__name(literalToAst, "literalToAst");
|
|
31
28
|
const easyPeasies = ["BooleanLiteral", "StringLiteral", "NumericLiteral"];
|
|
32
29
|
function astToLiteral(node) {
|
|
33
30
|
if (!node) {
|
|
@@ -52,7 +49,6 @@ function astToLiteral(node) {
|
|
|
52
49
|
], []);
|
|
53
50
|
}
|
|
54
51
|
}
|
|
55
|
-
__name(astToLiteral, "astToLiteral");
|
|
56
52
|
function computeProps(props) {
|
|
57
53
|
return props.reduce((acc, prop) => {
|
|
58
54
|
if (prop.type === "SpreadElement") {
|
|
@@ -72,7 +68,6 @@ function computeProps(props) {
|
|
|
72
68
|
return acc;
|
|
73
69
|
}, {});
|
|
74
70
|
}
|
|
75
|
-
__name(computeProps, "computeProps");
|
|
76
71
|
export {
|
|
77
72
|
astToLiteral,
|
|
78
73
|
literalToAst
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import { join } from "path";
|
|
4
2
|
import { createTamagui } from "@tamagui/core-node";
|
|
5
3
|
let loadedTamagui = null;
|
|
@@ -76,7 +74,6 @@ function loadTamagui(props) {
|
|
|
76
74
|
unregister();
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
|
-
__name(loadTamagui, "loadTamagui");
|
|
80
77
|
export {
|
|
81
78
|
loadTamagui
|
|
82
79
|
};
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
const prefix = " ";
|
|
4
|
-
const logLines =
|
|
2
|
+
const logLines = (str, singleLine = false) => {
|
|
5
3
|
if (singleLine) {
|
|
6
4
|
return prefix + str.split(" ").join(`
|
|
7
5
|
${prefix}`);
|
|
@@ -15,7 +13,7 @@ ${prefix}`);
|
|
|
15
13
|
lines[lines.length - 1] += item + " ";
|
|
16
14
|
}
|
|
17
15
|
return lines.map((line, i) => prefix + (i == 0 ? "" : " ") + line.trim()).join("\n");
|
|
18
|
-
}
|
|
16
|
+
};
|
|
19
17
|
export {
|
|
20
18
|
logLines
|
|
21
19
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import generate from "@babel/generator";
|
|
4
2
|
import * as t from "@babel/types";
|
|
5
3
|
import invariant from "invariant";
|
|
@@ -46,7 +44,6 @@ function normalizeTernaries(ternaries) {
|
|
|
46
44
|
});
|
|
47
45
|
return ternaryExpression;
|
|
48
46
|
}
|
|
49
|
-
__name(normalizeTernaries, "normalizeTernaries");
|
|
50
47
|
export {
|
|
51
48
|
normalizeTernaries
|
|
52
49
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
1
|
import * as t from "@babel/types";
|
|
4
2
|
const hooks = {
|
|
5
3
|
useMedia: true,
|
|
@@ -32,10 +30,10 @@ function removeUnusedHooks(compFn, shouldPrintDebug) {
|
|
|
32
30
|
if (!Array.isArray(declarations)) {
|
|
33
31
|
continue;
|
|
34
32
|
}
|
|
35
|
-
const isBindingReferenced =
|
|
33
|
+
const isBindingReferenced = (name) => {
|
|
36
34
|
var _a2;
|
|
37
35
|
return !!((_a2 = statement.scope.getBinding(name)) == null ? void 0 : _a2.referenced);
|
|
38
|
-
}
|
|
36
|
+
};
|
|
39
37
|
for (const declarator of declarations) {
|
|
40
38
|
const id = declarator.get("id");
|
|
41
39
|
const init = declarator.node.init;
|
|
@@ -73,7 +71,6 @@ function removeUnusedHooks(compFn, shouldPrintDebug) {
|
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
}
|
|
76
|
-
__name(removeUnusedHooks, "removeUnusedHooks");
|
|
77
74
|
export {
|
|
78
75
|
removeUnusedHooks
|
|
79
76
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
const timer = /* @__PURE__ */ __name(() => {
|
|
1
|
+
const timer = () => {
|
|
4
2
|
const start = Date.now();
|
|
5
3
|
let last = start;
|
|
6
4
|
return {
|
|
@@ -17,7 +15,7 @@ const timer = /* @__PURE__ */ __name(() => {
|
|
|
17
15
|
}
|
|
18
16
|
}
|
|
19
17
|
};
|
|
20
|
-
}
|
|
18
|
+
};
|
|
21
19
|
export {
|
|
22
20
|
timer
|
|
23
21
|
};
|
package/dist/jsx/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { literalToAst } from "./extractor/literalToAst";
|
|
|
5
5
|
export * from "./constants";
|
|
6
6
|
export * from "./extractor/extractToClassNames";
|
|
7
7
|
export * from "./extractor/extractHelpers";
|
|
8
|
-
export * from "
|
|
8
|
+
export * from "@tamagui/patch-rnw";
|
|
9
9
|
export {
|
|
10
10
|
TamaguiOptions,
|
|
11
11
|
createExtractor,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/static",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.73",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"types": "./types/index.d.ts",
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"@babel/parser": "^7.15.7",
|
|
39
39
|
"@babel/traverse": "^7.15.4",
|
|
40
40
|
"@expo/match-media": "^0.3.0",
|
|
41
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
42
|
-
"@tamagui/core-node": "^1.0.1-beta.
|
|
43
|
-
"@tamagui/fake-react-native": "^1.0.1-beta.
|
|
44
|
-
"@tamagui/helpers": "^1.0.1-beta.
|
|
45
|
-
"@tamagui/proxy-worm": "^1.0.1-beta.
|
|
41
|
+
"@tamagui/build": "^1.0.1-beta.73",
|
|
42
|
+
"@tamagui/core-node": "^1.0.1-beta.73",
|
|
43
|
+
"@tamagui/fake-react-native": "^1.0.1-beta.73",
|
|
44
|
+
"@tamagui/helpers": "^1.0.1-beta.73",
|
|
45
|
+
"@tamagui/proxy-worm": "^1.0.1-beta.73",
|
|
46
46
|
"babel-literal-to-ast": "^2.1.0",
|
|
47
47
|
"esbuild": "^0.14.36",
|
|
48
48
|
"esbuild-register": "^3.3.2",
|
|
@@ -50,13 +50,14 @@
|
|
|
50
50
|
"fs-extra": "^9.1.0",
|
|
51
51
|
"invariant": "^2.2.4",
|
|
52
52
|
"lodash": "^4.17.21",
|
|
53
|
-
"tamagui": "^1.0.1-beta.
|
|
53
|
+
"tamagui": "^1.0.1-beta.73"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/plugin-syntax-typescript": "^7.14.5",
|
|
57
57
|
"@babel/types": "^7.15.6",
|
|
58
58
|
"@dish/babel-preset": "^0.0.6",
|
|
59
|
-
"@tamagui/config-base": "^1.0.1-beta.
|
|
59
|
+
"@tamagui/config-base": "^1.0.1-beta.73",
|
|
60
|
+
"@tamagui/patch-rnw": "^1.0.1-beta.73",
|
|
60
61
|
"@testing-library/jest-dom": "^5.16.4",
|
|
61
62
|
"@testing-library/react": "^13.3.0",
|
|
62
63
|
"@types/jest": "*",
|
|
@@ -74,7 +75,7 @@
|
|
|
74
75
|
"react-dom": "*",
|
|
75
76
|
"react-native-web": "^0.17.5",
|
|
76
77
|
"react-test-renderer": "^18.2.0",
|
|
77
|
-
"style-loader": "^3.3.
|
|
78
|
+
"style-loader": "^3.3.1",
|
|
78
79
|
"typescript": "^4.7.2",
|
|
79
80
|
"webpack": "^5.73.0"
|
|
80
81
|
},
|
|
@@ -20,7 +20,6 @@ import { isSimpleSpread } from './extractHelpers'
|
|
|
20
20
|
import { extractMediaStyle } from './extractMediaStyle'
|
|
21
21
|
import { getPrefixLogs } from './getPrefixLogs'
|
|
22
22
|
import { hoistClassNames } from './hoistClassNames'
|
|
23
|
-
import { literalToAst } from './literalToAst'
|
|
24
23
|
import { logLines } from './logLines'
|
|
25
24
|
import { timer } from './timer'
|
|
26
25
|
|
|
@@ -40,25 +39,17 @@ export type ExtractedResponse = {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
export function extractToClassNames({
|
|
43
|
-
loader,
|
|
44
42
|
extractor,
|
|
45
43
|
source,
|
|
46
44
|
sourcePath,
|
|
47
45
|
options,
|
|
48
46
|
shouldPrintDebug,
|
|
49
|
-
cssLoaderPath,
|
|
50
|
-
threaded,
|
|
51
|
-
cssPath,
|
|
52
47
|
}: {
|
|
53
|
-
loader: LoaderContext<any>
|
|
54
|
-
cssLoaderPath: string
|
|
55
48
|
extractor: Extractor
|
|
56
49
|
source: string | Buffer
|
|
57
50
|
sourcePath: string
|
|
58
51
|
options: TamaguiOptions
|
|
59
52
|
shouldPrintDebug: boolean | 'verbose'
|
|
60
|
-
cssPath: string
|
|
61
|
-
threaded?: boolean
|
|
62
53
|
}): ExtractedResponse | null {
|
|
63
54
|
const tm = timer()
|
|
64
55
|
|
|
@@ -78,7 +69,6 @@ export function extractToClassNames({
|
|
|
78
69
|
let ast: t.File
|
|
79
70
|
|
|
80
71
|
try {
|
|
81
|
-
// @ts-ignore
|
|
82
72
|
ast = babelParse(source)
|
|
83
73
|
} catch (err) {
|
|
84
74
|
console.error('babel parse error:', sourcePath)
|
|
@@ -348,15 +338,6 @@ export function extractToClassNames({
|
|
|
348
338
|
.join('\n')
|
|
349
339
|
.trim()
|
|
350
340
|
|
|
351
|
-
if (styles) {
|
|
352
|
-
const cssQuery = threaded
|
|
353
|
-
? `cssData=${Buffer.from(styles).toString('base64')}`
|
|
354
|
-
: `cssPath=${cssPath}`
|
|
355
|
-
const remReq = loader.remainingRequest
|
|
356
|
-
const importPath = `${cssPath}!=!${cssLoaderPath}?${cssQuery}!${remReq}`
|
|
357
|
-
ast.program.body.unshift(t.importDeclaration([], t.stringLiteral(importPath)))
|
|
358
|
-
}
|
|
359
|
-
|
|
360
341
|
const result = generate(
|
|
361
342
|
ast,
|
|
362
343
|
{
|
package/src/index.ts
CHANGED
package/types/constants.d.ts
CHANGED
|
File without changes
|
package/types/constants.d.ts.map
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as t from '@babel/types';
|
|
3
|
-
import { LoaderContext } from 'webpack';
|
|
4
3
|
import { TamaguiOptions } from '../types';
|
|
5
4
|
import { Extractor } from './createExtractor';
|
|
6
5
|
export declare type ExtractedResponse = {
|
|
@@ -10,15 +9,11 @@ export declare type ExtractedResponse = {
|
|
|
10
9
|
ast: t.File;
|
|
11
10
|
map: any;
|
|
12
11
|
};
|
|
13
|
-
export declare function extractToClassNames({
|
|
14
|
-
loader: LoaderContext<any>;
|
|
15
|
-
cssLoaderPath: string;
|
|
12
|
+
export declare function extractToClassNames({ extractor, source, sourcePath, options, shouldPrintDebug, }: {
|
|
16
13
|
extractor: Extractor;
|
|
17
14
|
source: string | Buffer;
|
|
18
15
|
sourcePath: string;
|
|
19
16
|
options: TamaguiOptions;
|
|
20
17
|
shouldPrintDebug: boolean | 'verbose';
|
|
21
|
-
cssPath: string;
|
|
22
|
-
threaded?: boolean;
|
|
23
18
|
}): ExtractedResponse | null;
|
|
24
19
|
//# sourceMappingURL=extractToClassNames.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"extractToClassNames.d.ts","sourceRoot":"","sources":["../../src/extractor/extractToClassNames.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,CAAC,MAAM,cAAc,CAAA;AAQjC,OAAO,EAAgC,cAAc,EAAW,MAAM,UAAU,CAAA;AAGhF,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAgB7C,oBAAY,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,EAAE,CAAC,CAAC,IAAI,CAAA;IACX,GAAG,EAAE,GAAG,CAAA;CACT,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,SAAS,EACT,MAAM,EACN,UAAU,EACV,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,SAAS,EAAE,SAAS,CAAA;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,cAAc,CAAA;IACvB,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAA;CACtC,GAAG,iBAAiB,GAAG,IAAI,CAuV3B"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export { literalToAst } from './extractor/literalToAst';
|
|
|
4
4
|
export * from './constants';
|
|
5
5
|
export * from './extractor/extractToClassNames';
|
|
6
6
|
export * from './extractor/extractHelpers';
|
|
7
|
-
export * from '
|
|
7
|
+
export * from '@tamagui/patch-rnw';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,cAAc,aAAa,CAAA;AAC3B,cAAc,iCAAiC,CAAA;AAC/C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oBAAoB,CAAA"}
|
package/types/types.d.ts
CHANGED
|
File without changes
|
package/types/types.d.ts.map
CHANGED
|
File without changes
|
|
@@ -1,107 +0,0 @@
|
|
|
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
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], 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(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
21
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
-
var patchReactNativeWeb_exports = {};
|
|
23
|
-
__export(patchReactNativeWeb_exports, {
|
|
24
|
-
patchReactNativeWeb: () => patchReactNativeWeb
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(patchReactNativeWeb_exports);
|
|
27
|
-
var import_path = __toESM(require("path"));
|
|
28
|
-
var fs = __toESM(require("fs-extra"));
|
|
29
|
-
const PATCH_PREFIX = "tamagui-patch-";
|
|
30
|
-
const PATCH_VERSION = `${PATCH_PREFIX}-v5`;
|
|
31
|
-
const PATCH_COMMENT = `// ${PATCH_VERSION}`;
|
|
32
|
-
const PATCH_END_COMMENT = `// tamagui-patch-end`;
|
|
33
|
-
function patchReactNativeWeb(dir = require.resolve("react-native-web")) {
|
|
34
|
-
const rootDir = dir.replace(/[\/\\]dist.*/, "");
|
|
35
|
-
const pkgJSON = fs.readJSONSync(import_path.default.join(rootDir, "package.json"));
|
|
36
|
-
if (pkgJSON.version.split(".")[1] !== "18") {
|
|
37
|
-
console.error(`\u26D4\uFE0F Error! Tamagui as of beta 69 only works with react-native-web version 0.18.x`, pkgJSON.version);
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
const modulePath = import_path.default.join(rootDir, "dist", "tamagui-exports.js");
|
|
41
|
-
const cjsPath = import_path.default.join(rootDir, "dist", "cjs", "tamagui-exports.js");
|
|
42
|
-
const alreadyPatchedImports = fs.existsSync(modulePath) && fs.readFileSync(modulePath, "utf-8") === moduleExports && fs.existsSync(cjsPath) && fs.readFileSync(cjsPath, "utf-8") === cjsExports;
|
|
43
|
-
if (!alreadyPatchedImports) {
|
|
44
|
-
console.log(" | patch " + import_path.default.relative(rootDir, modulePath));
|
|
45
|
-
fs.writeFileSync(modulePath, moduleExports);
|
|
46
|
-
console.log(" | patch " + import_path.default.relative(rootDir, cjsPath));
|
|
47
|
-
fs.writeFileSync(cjsPath, cjsExports);
|
|
48
|
-
}
|
|
49
|
-
const dpFile = import_path.default.join(rootDir, "dist", "modules", "createDOMProps", "index.js");
|
|
50
|
-
const dpPatched = fs.readFileSync(import_path.default.join(__dirname, "..", "..", "patches", "18", "createDOMProps.js"), "utf-8");
|
|
51
|
-
const dpFileCJS = import_path.default.join(rootDir, "dist", "cjs", "modules", "createDOMProps", "index.js");
|
|
52
|
-
const dpCJSPatched = fs.readFileSync(import_path.default.join(__dirname, "..", "..", "patches", "18", "createDOMProps.cjs.js"), "utf-8");
|
|
53
|
-
const alreadyPatchedDOMProps = fs.readFileSync(dpFile, "utf-8") === dpPatched && fs.readFileSync(dpFileCJS, "utf-8") === dpCJSPatched;
|
|
54
|
-
if (!alreadyPatchedDOMProps) {
|
|
55
|
-
console.log(" | patch " + import_path.default.relative(rootDir, dpFile));
|
|
56
|
-
fs.writeFileSync(dpFile, dpPatched);
|
|
57
|
-
console.log(" | patch " + import_path.default.relative(rootDir, dpFileCJS));
|
|
58
|
-
fs.writeFileSync(dpFileCJS, dpCJSPatched);
|
|
59
|
-
}
|
|
60
|
-
const moduleEntry = import_path.default.join(rootDir, "dist", "index.js");
|
|
61
|
-
const moduleEntrySrc = fs.readFileSync(moduleEntry, "utf-8");
|
|
62
|
-
if (!moduleEntrySrc.includes(PATCH_COMMENT)) {
|
|
63
|
-
fs.writeFileSync(moduleEntry, `${removePatch(moduleEntrySrc)}
|
|
64
|
-
|
|
65
|
-
${PATCH_COMMENT}
|
|
66
|
-
import * as TExports from './tamagui-exports'
|
|
67
|
-
export const TamaguiExports = TExports
|
|
68
|
-
${PATCH_END_COMMENT}
|
|
69
|
-
`);
|
|
70
|
-
}
|
|
71
|
-
const cjsEntry = import_path.default.join(rootDir, "dist", "cjs", "index.js");
|
|
72
|
-
const cjsEntrySrc = fs.readFileSync(cjsEntry, "utf-8");
|
|
73
|
-
if (!cjsEntrySrc.includes(PATCH_COMMENT)) {
|
|
74
|
-
fs.writeFileSync(cjsEntry, `${removePatch(cjsEntrySrc)}
|
|
75
|
-
|
|
76
|
-
${PATCH_COMMENT}
|
|
77
|
-
exports.TamaguiExports = require("./tamagui-exports");
|
|
78
|
-
${PATCH_END_COMMENT}
|
|
79
|
-
`);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
__name(patchReactNativeWeb, "patchReactNativeWeb");
|
|
83
|
-
function removePatch(source) {
|
|
84
|
-
return source.replace(/\/\/ tamagui-patch([.\s\S]*)/g, "");
|
|
85
|
-
}
|
|
86
|
-
__name(removePatch, "removePatch");
|
|
87
|
-
const moduleExports = `
|
|
88
|
-
export { default as createDOMProps } from './modules/createDOMProps'
|
|
89
|
-
export { default as TextAncestorContext } from './exports/Text/TextAncestorContext'
|
|
90
|
-
export { default as useElementLayout } from './modules/useElementLayout'
|
|
91
|
-
export { default as useMergeRefs } from './modules/useMergeRefs'
|
|
92
|
-
export { default as usePlatformMethods } from './modules/usePlatformMethods'
|
|
93
|
-
export { default as useResponderEvents } from './modules/useResponderEvents'
|
|
94
|
-
`;
|
|
95
|
-
const cjsExports = `
|
|
96
|
-
exports.createDOMProps = require('./modules/createDOMProps')
|
|
97
|
-
exports.TextAncestorContext = require('./exports/Text/TextAncestorContext')
|
|
98
|
-
exports.useElementLayout = require('./modules/useElementLayout')
|
|
99
|
-
exports.useMergeRefs = require('./modules/useMergeRefs')
|
|
100
|
-
exports.usePlatformMethods = require('./modules/usePlatformMethods')
|
|
101
|
-
exports.useResponderEvents = require('./modules/useResponderEvents')
|
|
102
|
-
`;
|
|
103
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
-
0 && (module.exports = {
|
|
105
|
-
patchReactNativeWeb
|
|
106
|
-
});
|
|
107
|
-
//# sourceMappingURL=patchReactNativeWeb.js.map
|