@tamagui/static 1.115.1 → 1.115.3
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.js +389 -0
- package/dist/checkDeps.js +26 -0
- package/dist/{constants.cjs → constants.js} +14 -29
- package/dist/exports.js +33 -0
- package/dist/extractor/accessSafe.js +47 -0
- package/dist/extractor/babelParse.js +59 -0
- package/dist/extractor/buildClassName.js +72 -0
- package/dist/extractor/bundle.js +133 -0
- package/dist/extractor/bundleConfig.js +350 -0
- package/dist/extractor/{createEvaluator.cjs → createEvaluator.js} +21 -37
- package/dist/extractor/createExtractor.js +1217 -0
- package/dist/extractor/createLogger.js +32 -0
- package/dist/extractor/ensureImportingConcat.js +50 -0
- package/dist/extractor/esbuildAliasPlugin.js +36 -0
- package/dist/extractor/evaluateAstNode.js +99 -0
- package/dist/extractor/extractHelpers.js +109 -0
- package/dist/extractor/extractMediaStyle.js +123 -0
- package/dist/extractor/extractToClassNames.js +291 -0
- package/dist/extractor/extractToNative.js +319 -0
- package/dist/extractor/findTopmostFunction.js +32 -0
- package/dist/extractor/generatedUid.js +42 -0
- package/dist/extractor/getPrefixLogs.js +23 -0
- package/dist/extractor/getPropValueFromAttributes.js +65 -0
- package/dist/extractor/getSourceModule.js +66 -0
- package/dist/extractor/{getStaticBindingsForScope.cjs → getStaticBindingsForScope.js} +61 -66
- package/dist/extractor/{getTamaguiConfigPathFromOptionsConfig.cjs → getTamaguiConfigPathFromOptionsConfig.js} +11 -16
- package/dist/extractor/{hoistClassNames.cjs → hoistClassNames.js} +32 -31
- package/dist/extractor/{literalToAst.cjs → literalToAst.js} +44 -38
- package/dist/extractor/{loadFile.cjs → loadFile.js} +6 -3
- package/dist/extractor/{loadTamagui.cjs → loadTamagui.js} +78 -99
- package/dist/extractor/logLines.js +30 -0
- package/dist/extractor/{normalizeTernaries.cjs → normalizeTernaries.js} +29 -38
- package/dist/extractor/{propsToFontFamilyCache.cjs → propsToFontFamilyCache.js} +14 -18
- package/dist/extractor/regenerateConfig.js +111 -0
- package/dist/extractor/{removeUnusedHooks.cjs → removeUnusedHooks.js} +27 -31
- package/dist/extractor/{timer.cjs → timer.js} +11 -16
- package/dist/extractor/{validHTMLAttributes.cjs → validHTMLAttributes.js} +11 -16
- package/dist/extractor/{watchTamaguiConfig.cjs → watchTamaguiConfig.js} +29 -30
- package/dist/{getPragmaOptions.cjs → getPragmaOptions.js} +17 -22
- package/dist/helpers/memoize.js +33 -0
- package/dist/helpers/requireTamaguiCore.js +30 -0
- package/dist/index.js +30 -0
- package/dist/registerRequire.js +96 -0
- package/dist/{server.cjs → server.js} +21 -38
- package/dist/setup.js +1 -0
- package/dist/types.js +14 -0
- package/package.json +16 -16
- package/dist/check-dep-versions.cjs +0 -267
- package/dist/checkDeps.cjs +0 -32
- package/dist/exports.cjs +0 -40
- package/dist/extractor/accessSafe.cjs +0 -46
- package/dist/extractor/babelParse.cjs +0 -54
- package/dist/extractor/buildClassName.cjs +0 -62
- package/dist/extractor/bundle.cjs +0 -146
- package/dist/extractor/bundleConfig.cjs +0 -322
- package/dist/extractor/createExtractor.cjs +0 -1008
- package/dist/extractor/createLogger.cjs +0 -45
- package/dist/extractor/ensureImportingConcat.cjs +0 -48
- package/dist/extractor/esbuildAliasPlugin.cjs +0 -44
- package/dist/extractor/evaluateAstNode.cjs +0 -83
- package/dist/extractor/extractHelpers.cjs +0 -120
- package/dist/extractor/extractMediaStyle.cjs +0 -129
- package/dist/extractor/extractToClassNames.cjs +0 -254
- package/dist/extractor/extractToNative.cjs +0 -274
- package/dist/extractor/findTopmostFunction.cjs +0 -34
- package/dist/extractor/generatedUid.cjs +0 -47
- package/dist/extractor/getPrefixLogs.cjs +0 -28
- package/dist/extractor/getPropValueFromAttributes.cjs +0 -67
- package/dist/extractor/getSourceModule.cjs +0 -68
- package/dist/extractor/logLines.cjs +0 -35
- package/dist/extractor/regenerateConfig.cjs +0 -144
- package/dist/helpers/memoize.cjs +0 -37
- package/dist/helpers/requireTamaguiCore.cjs +0 -33
- package/dist/index.cjs +0 -40
- package/dist/registerRequire.cjs +0 -102
- package/dist/setup.cjs +0 -0
- package/dist/types.cjs +0 -16
- /package/dist/{check-dep-versions.cjs.map → check-dep-versions.js.map} +0 -0
- /package/dist/{checkDeps.cjs.map → checkDeps.js.map} +0 -0
- /package/dist/{constants.cjs.map → constants.js.map} +0 -0
- /package/dist/{exports.cjs.map → exports.js.map} +0 -0
- /package/dist/extractor/{accessSafe.cjs.map → accessSafe.js.map} +0 -0
- /package/dist/extractor/{babelParse.cjs.map → babelParse.js.map} +0 -0
- /package/dist/extractor/{buildClassName.cjs.map → buildClassName.js.map} +0 -0
- /package/dist/extractor/{bundle.cjs.map → bundle.js.map} +0 -0
- /package/dist/extractor/{bundleConfig.cjs.map → bundleConfig.js.map} +0 -0
- /package/dist/extractor/{createEvaluator.cjs.map → createEvaluator.js.map} +0 -0
- /package/dist/extractor/{createExtractor.cjs.map → createExtractor.js.map} +0 -0
- /package/dist/extractor/{createLogger.cjs.map → createLogger.js.map} +0 -0
- /package/dist/extractor/{ensureImportingConcat.cjs.map → ensureImportingConcat.js.map} +0 -0
- /package/dist/extractor/{esbuildAliasPlugin.cjs.map → esbuildAliasPlugin.js.map} +0 -0
- /package/dist/extractor/{evaluateAstNode.cjs.map → evaluateAstNode.js.map} +0 -0
- /package/dist/extractor/{extractHelpers.cjs.map → extractHelpers.js.map} +0 -0
- /package/dist/extractor/{extractMediaStyle.cjs.map → extractMediaStyle.js.map} +0 -0
- /package/dist/extractor/{extractToClassNames.cjs.map → extractToClassNames.js.map} +0 -0
- /package/dist/extractor/{extractToNative.cjs.map → extractToNative.js.map} +0 -0
- /package/dist/extractor/{findTopmostFunction.cjs.map → findTopmostFunction.js.map} +0 -0
- /package/dist/extractor/{generatedUid.cjs.map → generatedUid.js.map} +0 -0
- /package/dist/extractor/{getPrefixLogs.cjs.map → getPrefixLogs.js.map} +0 -0
- /package/dist/extractor/{getPropValueFromAttributes.cjs.map → getPropValueFromAttributes.js.map} +0 -0
- /package/dist/extractor/{getSourceModule.cjs.map → getSourceModule.js.map} +0 -0
- /package/dist/extractor/{getStaticBindingsForScope.cjs.map → getStaticBindingsForScope.js.map} +0 -0
- /package/dist/extractor/{getTamaguiConfigPathFromOptionsConfig.cjs.map → getTamaguiConfigPathFromOptionsConfig.js.map} +0 -0
- /package/dist/extractor/{hoistClassNames.cjs.map → hoistClassNames.js.map} +0 -0
- /package/dist/extractor/{literalToAst.cjs.map → literalToAst.js.map} +0 -0
- /package/dist/extractor/{loadFile.cjs.map → loadFile.js.map} +0 -0
- /package/dist/extractor/{loadTamagui.cjs.map → loadTamagui.js.map} +0 -0
- /package/dist/extractor/{logLines.cjs.map → logLines.js.map} +0 -0
- /package/dist/extractor/{normalizeTernaries.cjs.map → normalizeTernaries.js.map} +0 -0
- /package/dist/extractor/{propsToFontFamilyCache.cjs.map → propsToFontFamilyCache.js.map} +0 -0
- /package/dist/extractor/{regenerateConfig.cjs.map → regenerateConfig.js.map} +0 -0
- /package/dist/extractor/{removeUnusedHooks.cjs.map → removeUnusedHooks.js.map} +0 -0
- /package/dist/extractor/{timer.cjs.map → timer.js.map} +0 -0
- /package/dist/extractor/{validHTMLAttributes.cjs.map → validHTMLAttributes.js.map} +0 -0
- /package/dist/extractor/{watchTamaguiConfig.cjs.map → watchTamaguiConfig.js.map} +0 -0
- /package/dist/{getPragmaOptions.cjs.map → getPragmaOptions.js.map} +0 -0
- /package/dist/helpers/{memoize.cjs.map → memoize.js.map} +0 -0
- /package/dist/helpers/{requireTamaguiCore.cjs.map → requireTamaguiCore.js.map} +0 -0
- /package/dist/{index.cjs.map → index.js.map} +0 -0
- /package/dist/{registerRequire.cjs.map → registerRequire.js.map} +0 -0
- /package/dist/{server.cjs.map → server.js.map} +0 -0
- /package/dist/{setup.cjs.map → setup.js.map} +0 -0
- /package/dist/{types.cjs.map → types.js.map} +0 -0
@@ -1,67 +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
|
-
__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 getPropValueFromAttributes_exports = {};
|
33
|
-
__export(getPropValueFromAttributes_exports, {
|
34
|
-
getPropValueFromAttributes: () => getPropValueFromAttributes
|
35
|
-
});
|
36
|
-
module.exports = __toCommonJS(getPropValueFromAttributes_exports);
|
37
|
-
var import_generator = __toESM(require("@babel/generator")),
|
38
|
-
t = __toESM(require("@babel/types")),
|
39
|
-
import_accessSafe = require("./accessSafe.cjs");
|
40
|
-
function getPropValueFromAttributes(propName, attrs) {
|
41
|
-
let propIndex = -1,
|
42
|
-
jsxAttr = null;
|
43
|
-
for (let idx = -1, len = attrs.length; ++idx < len;) {
|
44
|
-
const attr = attrs[idx];
|
45
|
-
if (t.isJSXAttribute(attr) && attr.name && attr.name.name === propName) {
|
46
|
-
propIndex = idx, jsxAttr = attr;
|
47
|
-
break;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
if (!jsxAttr || jsxAttr.value == null) return null;
|
51
|
-
let propValue = jsxAttr.value;
|
52
|
-
if (t.isJSXExpressionContainer(propValue) && (propValue = propValue.expression), t.isJSXEmptyExpression(propValue)) return console.error("encountered JSXEmptyExpression"), null;
|
53
|
-
const applicableSpreads = attrs.filter(
|
54
|
-
// 1. idx is greater than propValue prop index
|
55
|
-
// 2. attr is a spread operator
|
56
|
-
(attr, idx) => {
|
57
|
-
if (t.isJSXSpreadAttribute(attr)) {
|
58
|
-
if (t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument)) return idx > propIndex;
|
59
|
-
if (t.isLogicalExpression(attr.argument)) return !1;
|
60
|
-
throw new Error(`unsupported spread of type "${attr.argument.type}": ${
|
61
|
-
// @ts-ignore
|
62
|
-
(0, import_generator.default)(attr).code}`);
|
63
|
-
}
|
64
|
-
return !1;
|
65
|
-
}).map(attr => attr.argument);
|
66
|
-
return applicableSpreads.length > 0 && (propValue = applicableSpreads.reduce((acc, val) => t.logicalExpression("||", (0, import_accessSafe.accessSafe)(val, propName), acc), propValue)), propValue;
|
67
|
-
}
|
@@ -1,68 +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
|
-
__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 getSourceModule_exports = {};
|
33
|
-
__export(getSourceModule_exports, {
|
34
|
-
getSourceModule: () => getSourceModule
|
35
|
-
});
|
36
|
-
module.exports = __toCommonJS(getSourceModule_exports);
|
37
|
-
var t = __toESM(require("@babel/types"));
|
38
|
-
function getSourceModule(itemName, itemBinding) {
|
39
|
-
if (!itemBinding.constant) return null;
|
40
|
-
let sourceModule,
|
41
|
-
imported,
|
42
|
-
local,
|
43
|
-
destructured,
|
44
|
-
usesImportSyntax = !1;
|
45
|
-
const itemNode = itemBinding.path.node;
|
46
|
-
if (
|
47
|
-
// import x from 'y';
|
48
|
-
t.isImportDefaultSpecifier(itemNode) ||
|
49
|
-
// import {x} from 'y';
|
50
|
-
t.isImportSpecifier(itemNode)) t.isImportDeclaration(itemBinding.path.parent) && (sourceModule = itemBinding.path.parent.source.value, local = itemNode.local.name, usesImportSyntax = !0, t.isImportSpecifier(itemNode) ? (imported = itemNode.imported.name, destructured = !0) : (imported = itemNode.local.name, destructured = !1));else if (t.isVariableDeclarator(itemNode) && itemNode.init != null && t.isCallExpression(itemNode.init) && t.isIdentifier(itemNode.init.callee) && itemNode.init.callee.name === "require" && itemNode.init.arguments.length === 1) {
|
51
|
-
const firstArg = itemNode.init.arguments[0];
|
52
|
-
if (!t.isStringLiteral(firstArg)) return null;
|
53
|
-
if (sourceModule = firstArg.value, t.isIdentifier(itemNode.id)) local = itemNode.id.name, imported = itemNode.id.name, destructured = !1;else if (t.isObjectPattern(itemNode.id)) {
|
54
|
-
for (const objProp of itemNode.id.properties) if (t.isObjectProperty(objProp) && t.isIdentifier(objProp.value) && objProp.value.name === itemName) {
|
55
|
-
local = objProp.value.name, imported = objProp.key.name, destructured = !0;
|
56
|
-
break;
|
57
|
-
}
|
58
|
-
if (!local || !imported) return console.error("could not find prop with value `%s`", itemName), null;
|
59
|
-
} else return console.error("Unhandled id type: %s", itemNode.id.type), null;
|
60
|
-
} else return null;
|
61
|
-
return {
|
62
|
-
destructured,
|
63
|
-
imported,
|
64
|
-
local,
|
65
|
-
sourceModule,
|
66
|
-
usesImportSyntax
|
67
|
-
};
|
68
|
-
}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __export = (target, all) => {
|
6
|
-
for (var name in all) __defProp(target, name, {
|
7
|
-
get: all[name],
|
8
|
-
enumerable: !0
|
9
|
-
});
|
10
|
-
},
|
11
|
-
__copyProps = (to, from, except, desc) => {
|
12
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
13
|
-
get: () => from[key],
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
15
|
-
});
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
19
|
-
value: !0
|
20
|
-
}), mod);
|
21
|
-
var logLines_exports = {};
|
22
|
-
__export(logLines_exports, {
|
23
|
-
logLines: () => logLines
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(logLines_exports);
|
26
|
-
const prefix = " ",
|
27
|
-
logLines = (str, singleLine = !1) => {
|
28
|
-
if (singleLine) return prefix + str.split(" ").join(`
|
29
|
-
${prefix}`);
|
30
|
-
const lines = [""],
|
31
|
-
items = str.split(" ");
|
32
|
-
for (const item of items) item.length + lines[lines.length - 1].length > 85 && lines.push(""), lines[lines.length - 1] += item + " ";
|
33
|
-
return lines.map((line, i) => prefix + (i == 0 ? "" : " ") + line.trim()).join(`
|
34
|
-
`);
|
35
|
-
};
|
@@ -1,144 +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
|
-
__hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __export = (target, all) => {
|
8
|
-
for (var name in all) __defProp(target, name, {
|
9
|
-
get: all[name],
|
10
|
-
enumerable: !0
|
11
|
-
});
|
12
|
-
},
|
13
|
-
__copyProps = (to, from, except, desc) => {
|
14
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
15
|
-
get: () => from[key],
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
17
|
-
});
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
26
|
-
value: mod,
|
27
|
-
enumerable: !0
|
28
|
-
}) : target, mod)),
|
29
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
30
|
-
value: !0
|
31
|
-
}), mod);
|
32
|
-
var regenerateConfig_exports = {};
|
33
|
-
__export(regenerateConfig_exports, {
|
34
|
-
generateTamaguiThemes: () => generateTamaguiThemes,
|
35
|
-
regenerateConfig: () => regenerateConfig,
|
36
|
-
regenerateConfigSync: () => regenerateConfigSync
|
37
|
-
});
|
38
|
-
module.exports = __toCommonJS(regenerateConfig_exports);
|
39
|
-
var import_node_path = require("node:path"),
|
40
|
-
import_generate_themes = require("@tamagui/generate-themes"),
|
41
|
-
FS = __toESM(require("fs-extra")),
|
42
|
-
import_requireTamaguiCore = require("../helpers/requireTamaguiCore.cjs"),
|
43
|
-
import_bundleConfig = require("./bundleConfig.cjs");
|
44
|
-
const tamaguiDir = (0, import_node_path.join)(process.cwd(), ".tamagui"),
|
45
|
-
confFile = (0, import_node_path.join)(tamaguiDir, "tamagui.config.json");
|
46
|
-
async function regenerateConfig(tamaguiOptions, configIn, rebuild = !1) {
|
47
|
-
try {
|
48
|
-
const config = configIn ?? (await (0, import_bundleConfig.getBundledConfig)(tamaguiOptions, rebuild));
|
49
|
-
if (!config) return;
|
50
|
-
const out = transformConfig(config, tamaguiOptions.platform || "web");
|
51
|
-
await FS.ensureDir((0, import_node_path.dirname)(confFile)), await FS.writeJSON(confFile, out, {
|
52
|
-
spaces: 2
|
53
|
-
});
|
54
|
-
} catch (err) {
|
55
|
-
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("regenerateConfig error", err);
|
56
|
-
}
|
57
|
-
}
|
58
|
-
function regenerateConfigSync(_tamaguiOptions, config) {
|
59
|
-
try {
|
60
|
-
FS.ensureDirSync((0, import_node_path.dirname)(confFile)), FS.writeJSONSync(confFile, transformConfig(config, _tamaguiOptions.platform || "web"), {
|
61
|
-
spaces: 2
|
62
|
-
});
|
63
|
-
} catch (err) {
|
64
|
-
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("regenerateConfig error", err);
|
65
|
-
}
|
66
|
-
}
|
67
|
-
async function generateTamaguiThemes(tamaguiOptions, force = !1) {
|
68
|
-
if (!tamaguiOptions.themeBuilder) return;
|
69
|
-
const {
|
70
|
-
input,
|
71
|
-
output
|
72
|
-
} = tamaguiOptions.themeBuilder,
|
73
|
-
inPath = resolveRelativePath(input),
|
74
|
-
outPath = resolveRelativePath(output),
|
75
|
-
generatedOutput = await (0, import_generate_themes.generateThemes)(inPath),
|
76
|
-
hasChanged = force || (await (async () => {
|
77
|
-
try {
|
78
|
-
if (!generatedOutput) return !1;
|
79
|
-
const next = generatedOutput.generated,
|
80
|
-
current = await FS.readFile(outPath, "utf-8");
|
81
|
-
return next !== current;
|
82
|
-
} catch {}
|
83
|
-
return !0;
|
84
|
-
})());
|
85
|
-
return hasChanged && (await (0, import_generate_themes.writeGeneratedThemes)(tamaguiDir, outPath, generatedOutput)), hasChanged;
|
86
|
-
}
|
87
|
-
const resolveRelativePath = inputPath => inputPath.startsWith(".") ? (0, import_node_path.join)(process.cwd(), inputPath) : require.resolve(inputPath);
|
88
|
-
function cloneDeepSafe(x, excludeKeys = {}) {
|
89
|
-
return x && (Array.isArray(x) ? x.map(_ => cloneDeepSafe(_)) : typeof x == "function" ? "Function" : typeof x != "object" ? x : "$$typeof" in x ? "Component" : Object.fromEntries(Object.entries(x).flatMap(([k, v]) => excludeKeys[k] ? [] : [[k, cloneDeepSafe(v)]])));
|
90
|
-
}
|
91
|
-
function transformConfig(config, platform) {
|
92
|
-
if (!config) return null;
|
93
|
-
const {
|
94
|
-
getVariableValue
|
95
|
-
} = (0, import_requireTamaguiCore.requireTamaguiCore)(platform),
|
96
|
-
next = cloneDeepSafe(config, {
|
97
|
-
validStyles: !0
|
98
|
-
}),
|
99
|
-
{
|
100
|
-
components,
|
101
|
-
nameToPaths,
|
102
|
-
tamaguiConfig
|
103
|
-
} = next,
|
104
|
-
{
|
105
|
-
themes,
|
106
|
-
tokens
|
107
|
-
} = tamaguiConfig;
|
108
|
-
for (const key in themes) {
|
109
|
-
const theme = themes[key];
|
110
|
-
theme.id = key;
|
111
|
-
for (const tkey in theme) theme[tkey] = getVariableValue(theme[tkey]);
|
112
|
-
}
|
113
|
-
for (const key in tokens) {
|
114
|
-
const token = {
|
115
|
-
...tokens[key]
|
116
|
-
};
|
117
|
-
for (const tkey in token) token[tkey] = getVariableValue(token[tkey]);
|
118
|
-
}
|
119
|
-
for (const component of components) for (const _ in component.nameToInfo) {
|
120
|
-
const compDefinition = {
|
121
|
-
...component.nameToInfo[_]
|
122
|
-
};
|
123
|
-
component.nameToInfo[_] = compDefinition;
|
124
|
-
const {
|
125
|
-
parentStaticConfig,
|
126
|
-
...rest
|
127
|
-
} = compDefinition.staticConfig;
|
128
|
-
compDefinition.staticConfig = rest;
|
129
|
-
}
|
130
|
-
next.nameToPaths = {};
|
131
|
-
for (const key in nameToPaths) next.nameToPaths[key] = [...nameToPaths[key]];
|
132
|
-
const {
|
133
|
-
fontsParsed,
|
134
|
-
getCSS,
|
135
|
-
tokensParsed,
|
136
|
-
themeConfig,
|
137
|
-
...cleanedConfig
|
138
|
-
} = next.tamaguiConfig;
|
139
|
-
return {
|
140
|
-
components,
|
141
|
-
nameToPaths,
|
142
|
-
tamaguiConfig: cleanedConfig
|
143
|
-
};
|
144
|
-
}
|
package/dist/helpers/memoize.cjs
DELETED
@@ -1,37 +0,0 @@
|
|
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 memoize_exports = {};
|
22
|
-
__export(memoize_exports, {
|
23
|
-
memoize: () => memoize
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(memoize_exports);
|
26
|
-
function memoize(func, resolver) {
|
27
|
-
if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError("Expected a function");
|
28
|
-
const memoized = function (...args) {
|
29
|
-
const key = resolver ? resolver.apply(this, args) : args[0],
|
30
|
-
cache = memoized.cache;
|
31
|
-
if (cache.has(key)) return cache.get(key);
|
32
|
-
const result = func.apply(this, args);
|
33
|
-
return memoized.cache = cache.set(key, result) || cache, result;
|
34
|
-
};
|
35
|
-
return memoized.cache = new (memoize.Cache || Map)(), memoized;
|
36
|
-
}
|
37
|
-
memoize.Cache = Map;
|
@@ -1,33 +0,0 @@
|
|
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 requireTamaguiCore_exports = {};
|
22
|
-
__export(requireTamaguiCore_exports, {
|
23
|
-
requireTamaguiCore: () => requireTamaguiCore
|
24
|
-
});
|
25
|
-
module.exports = __toCommonJS(requireTamaguiCore_exports);
|
26
|
-
function requireTamaguiCore(platform, ogRequire = require) {
|
27
|
-
if (!platform) throw new Error("No platform given to requireTamaguiCore");
|
28
|
-
const og1 = process.env.TAMAGUI_IS_SERVER,
|
29
|
-
og2 = process.env.TAMAGUI_KEEP_THEMES;
|
30
|
-
process.env.TAMAGUI_IS_SERVER ||= "1", process.env.TAMAGUI_KEEP_THEMES ||= "1";
|
31
|
-
const exported = ogRequire(platform === "native" ? "@tamagui/core/native" : "@tamagui/core");
|
32
|
-
return process.env.TAMAGUI_IS_SERVER = og1, process.env.TAMAGUI_KEEP_THEMES = og2, exported;
|
33
|
-
}
|
package/dist/index.cjs
DELETED
@@ -1,40 +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
|
-
__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
|
-
__reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")),
|
21
|
-
__toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
27
|
-
value: mod,
|
28
|
-
enumerable: !0
|
29
|
-
}) : target, mod)),
|
30
|
-
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
31
|
-
value: !0
|
32
|
-
}), mod);
|
33
|
-
var src_exports = {};
|
34
|
-
__export(src_exports, {
|
35
|
-
default: () => src_default
|
36
|
-
});
|
37
|
-
module.exports = __toCommonJS(src_exports);
|
38
|
-
var Static1 = __toESM(require("./exports.cjs"));
|
39
|
-
__reExport(src_exports, require("./exports.cjs"), module.exports);
|
40
|
-
var src_default = Static1;
|
package/dist/registerRequire.cjs
DELETED
@@ -1,102 +0,0 @@
|
|
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 registerRequire_exports = {};
|
22
|
-
__export(registerRequire_exports, {
|
23
|
-
getNameToPaths: () => getNameToPaths,
|
24
|
-
registerRequire: () => registerRequire,
|
25
|
-
setRequireResult: () => setRequireResult
|
26
|
-
});
|
27
|
-
module.exports = __toCommonJS(registerRequire_exports);
|
28
|
-
var import_node = require("esbuild-register/dist/node"),
|
29
|
-
import_requireTamaguiCore = require("./helpers/requireTamaguiCore.cjs"),
|
30
|
-
import_bundle = require("./extractor/bundle.cjs");
|
31
|
-
const nameToPaths = {},
|
32
|
-
getNameToPaths = () => nameToPaths,
|
33
|
-
Module = require("node:module"),
|
34
|
-
packageJson = require("react-native-web/package.json"),
|
35
|
-
proxyWorm = require("@tamagui/proxy-worm"),
|
36
|
-
rnw = require("react-native-web");
|
37
|
-
let isRegistered = !1,
|
38
|
-
og;
|
39
|
-
const whitelisted = {
|
40
|
-
react: !0
|
41
|
-
},
|
42
|
-
compiled = {};
|
43
|
-
function setRequireResult(name, result) {
|
44
|
-
compiled[name] = result;
|
45
|
-
}
|
46
|
-
function registerRequire(platform, {
|
47
|
-
proxyWormImports
|
48
|
-
} = {
|
49
|
-
proxyWormImports: !1
|
50
|
-
}) {
|
51
|
-
if (isRegistered) return {
|
52
|
-
tamaguiRequire: require,
|
53
|
-
unregister: () => {}
|
54
|
-
};
|
55
|
-
const {
|
56
|
-
unregister
|
57
|
-
} = (0, import_node.register)({
|
58
|
-
hookIgnoreNodeModules: !1
|
59
|
-
});
|
60
|
-
og || (og = Module.prototype.require), isRegistered = !0, Module.prototype.require = tamaguiRequire;
|
61
|
-
function tamaguiRequire(path) {
|
62
|
-
if (path === "tamagui" && platform === "native") return og.apply(this, ["tamagui/native"]);
|
63
|
-
if (path === "@tamagui/core" || path === "@tamagui/web") return (0, import_requireTamaguiCore.requireTamaguiCore)(platform, path2 => og.apply(this, [path2]));
|
64
|
-
if (path in compiled) return compiled[path];
|
65
|
-
if (import_bundle.esbuildIgnoreFilesRegex.test(path)) return {};
|
66
|
-
if (path === "react-native-svg") return og.apply(this, ["@tamagui/react-native-svg"]);
|
67
|
-
if (path === "@gorhom/bottom-sheet" || path.startsWith("react-native-reanimated") || path === "expo-linear-gradient" || path === "@expo/vector-icons" || path === "tamagui/linear-gradient") return proxyWorm;
|
68
|
-
if (path === "react-native/package.json") return packageJson;
|
69
|
-
if (path === "@tamagui/react-native-web-lite" || path.startsWith("react-native")) return rnw;
|
70
|
-
if (path in knownIgnorableModules) return proxyWorm;
|
71
|
-
if (!whitelisted[path] && proxyWormImports && !path.includes(".tamagui-dynamic-eval")) return path === "tamagui" ? og.apply(this, [path]) : proxyWorm;
|
72
|
-
try {
|
73
|
-
return og.apply(this, arguments);
|
74
|
-
} catch (err) {
|
75
|
-
return !process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && path.includes("tamagui-dynamic-eval") ? void 0 : (allowedIgnores[path] || IGNORES === "true" || (!process.env.TAMAGUI_SHOW_FULL_BUNDLE_ERRORS && !process.env.DEBUG ? hasWarnedForModules.has(path) || (hasWarnedForModules.add(path), console.info(` tamagui: skipping ${path} tamagui.dev/docs/intro/errors#warning-001`)) : console.error(`Tamagui failed loading "${path}"
|
76
|
-
|
77
|
-
${err.message}
|
78
|
-
${err.stack}
|
79
|
-
|
80
|
-
`)), proxyWorm);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
return {
|
84
|
-
tamaguiRequire,
|
85
|
-
unregister: () => {
|
86
|
-
unregister(), isRegistered = !1, Module.prototype.require = og;
|
87
|
-
}
|
88
|
-
};
|
89
|
-
}
|
90
|
-
const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS,
|
91
|
-
extraIgnores = IGNORES === "true" ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(","),
|
92
|
-
knownIgnorableModules = {
|
93
|
-
"expo-modules": !0,
|
94
|
-
solito: !0,
|
95
|
-
...Object.fromEntries(extraIgnores?.map(k => [k, !0]) || [])
|
96
|
-
},
|
97
|
-
hasWarnedForModules = /* @__PURE__ */new Set(),
|
98
|
-
allowedIgnores = {
|
99
|
-
"expo-constants": !0,
|
100
|
-
"./ExpoHaptics": !0,
|
101
|
-
"./js/MaskedView": !0
|
102
|
-
};
|
package/dist/setup.cjs
DELETED
File without changes
|
package/dist/types.cjs
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
var __defProp = Object.defineProperty;
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
5
|
-
var __copyProps = (to, from, except, desc) => {
|
6
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
7
|
-
get: () => from[key],
|
8
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
9
|
-
});
|
10
|
-
return to;
|
11
|
-
};
|
12
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
13
|
-
value: !0
|
14
|
-
}), mod);
|
15
|
-
var types_exports = {};
|
16
|
-
module.exports = __toCommonJS(types_exports);
|
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/dist/extractor/{getPropValueFromAttributes.cjs.map → getPropValueFromAttributes.js.map}
RENAMED
File without changes
|
File without changes
|
/package/dist/extractor/{getStaticBindingsForScope.cjs.map → getStaticBindingsForScope.js.map}
RENAMED
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
|