@tamagui/static 2.0.0-rc.8 → 2.0.0
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.cjs +201 -96
- package/dist/checkDeps.cjs +250 -46
- package/dist/constants.cjs +32 -30
- package/dist/exports.cjs +20 -13
- package/dist/extractor/accessSafe.cjs +25 -23
- package/dist/extractor/babelParse.cjs +30 -28
- package/dist/extractor/buildClassName.cjs +59 -35
- package/dist/extractor/bundle.cjs +187 -101
- package/dist/extractor/bundleConfig.cjs +568 -168
- package/dist/extractor/concatClassName.cjs +73 -32
- package/dist/extractor/createEvaluator.cjs +54 -41
- package/dist/extractor/createExtractor.cjs +1405 -574
- package/dist/extractor/createLogger.cjs +30 -25
- package/dist/extractor/detectModuleFormat.cjs +55 -0
- package/dist/extractor/ensureImportingConcat.cjs +31 -25
- package/dist/extractor/errors.cjs +12 -10
- package/dist/extractor/esbuildAliasPlugin.cjs +28 -16
- package/dist/extractor/esbuildTsconfigPaths.cjs +60 -36
- package/dist/extractor/evaluateAstNode.cjs +104 -59
- package/dist/extractor/extractHelpers.cjs +130 -67
- package/dist/extractor/extractMediaStyle.cjs +110 -69
- package/dist/extractor/extractToClassNames.cjs +337 -229
- package/dist/extractor/extractToNative.cjs +248 -154
- package/dist/extractor/findTopmostFunction.cjs +22 -13
- package/dist/extractor/generatedUid.cjs +39 -28
- package/dist/extractor/getPrefixLogs.cjs +12 -10
- package/dist/extractor/getPropValueFromAttributes.cjs +52 -34
- package/dist/extractor/getSourceModule.cjs +73 -37
- package/dist/extractor/getStaticBindingsForScope.cjs +131 -68
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.cjs +20 -14
- package/dist/extractor/hasTopLevelAwait.cjs +62 -0
- package/dist/extractor/hoistClassNames.cjs +46 -32
- package/dist/extractor/literalToAst.cjs +67 -42
- package/dist/extractor/loadFile.cjs +9 -3
- package/dist/extractor/loadTamagui.cjs +151 -105
- package/dist/extractor/logLines.cjs +27 -19
- package/dist/extractor/normalizeTernaries.cjs +66 -44
- package/dist/extractor/propsToFontFamilyCache.cjs +15 -11
- package/dist/extractor/regenerateConfig.cjs +109 -81
- package/dist/extractor/removeUnusedHooks.cjs +73 -41
- package/dist/extractor/timer.cjs +23 -14
- package/dist/extractor/validHTMLAttributes.cjs +61 -59
- package/dist/extractor/watchTamaguiConfig.cjs +35 -23
- package/dist/getPragmaOptions.cjs +34 -19
- package/dist/helpers/memoize.cjs +24 -16
- package/dist/helpers/requireTamaguiCore.cjs +22 -15
- package/dist/index.cjs +26 -24
- package/dist/registerRequire.cjs +168 -65
- package/dist/server.cjs +35 -28
- package/dist/types.cjs +7 -5
- package/dist/worker.cjs +62 -40
- package/package.json +27 -24
- package/src/checkDeps.ts +305 -68
- package/src/exports.ts +2 -0
- package/src/extractor/babelParse.ts +1 -0
- package/src/extractor/bundle.ts +172 -40
- package/src/extractor/bundleConfig.ts +459 -65
- package/src/extractor/concatClassName.ts +37 -20
- package/src/extractor/createExtractor.ts +300 -30
- package/src/extractor/detectModuleFormat.ts +42 -0
- package/src/extractor/esbuildTsconfigPaths.ts +6 -1
- package/src/extractor/extractToClassNames.ts +15 -9
- package/src/extractor/extractToNative.ts +66 -33
- package/src/extractor/hasTopLevelAwait.ts +28 -0
- package/src/extractor/loadTamagui.ts +5 -4
- package/src/registerRequire.ts +102 -9
- package/types/checkDeps.d.ts.map +1 -1
- package/types/exports.d.ts +2 -0
- package/types/exports.d.ts.map +1 -1
- package/types/extractor/babelParse.d.ts.map +1 -1
- package/types/extractor/bundle.d.ts +83 -1
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/bundleConfig.d.ts +15 -2
- package/types/extractor/bundleConfig.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/detectModuleFormat.d.ts +5 -0
- package/types/extractor/detectModuleFormat.d.ts.map +1 -0
- package/types/extractor/esbuildTsconfigPaths.d.ts +8 -0
- package/types/extractor/esbuildTsconfigPaths.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/extractToNative.d.ts.map +1 -1
- package/types/extractor/hasTopLevelAwait.d.ts +2 -0
- package/types/extractor/hasTopLevelAwait.d.ts.map +1 -0
- package/types/extractor/loadTamagui.d.ts +1 -1
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/registerRequire.d.ts.map +1 -1
- package/dist/check-dep-versions.js +0 -389
- package/dist/check-dep-versions.js.map +0 -6
- package/dist/checkDeps.js +0 -60
- package/dist/checkDeps.js.map +0 -6
- package/dist/constants.js +0 -34
- package/dist/constants.js.map +0 -6
- package/dist/exports.js +0 -34
- package/dist/exports.js.map +0 -6
- package/dist/extractor/accessSafe.js +0 -47
- package/dist/extractor/accessSafe.js.map +0 -6
- package/dist/extractor/babelParse.js +0 -59
- package/dist/extractor/babelParse.js.map +0 -6
- package/dist/extractor/buildClassName.js +0 -72
- package/dist/extractor/buildClassName.js.map +0 -6
- package/dist/extractor/bundle.js +0 -135
- package/dist/extractor/bundle.js.map +0 -6
- package/dist/extractor/bundleConfig.js +0 -352
- package/dist/extractor/bundleConfig.js.map +0 -6
- package/dist/extractor/concatClassName.js +0 -69
- package/dist/extractor/concatClassName.js.map +0 -6
- package/dist/extractor/createEvaluator.js +0 -66
- package/dist/extractor/createEvaluator.js.map +0 -6
- package/dist/extractor/createExtractor.js +0 -1212
- package/dist/extractor/createExtractor.js.map +0 -6
- package/dist/extractor/createLogger.js +0 -32
- package/dist/extractor/createLogger.js.map +0 -6
- package/dist/extractor/ensureImportingConcat.js +0 -50
- package/dist/extractor/ensureImportingConcat.js.map +0 -6
- package/dist/extractor/errors.js +0 -22
- package/dist/extractor/errors.js.map +0 -6
- package/dist/extractor/esbuildAliasPlugin.js +0 -36
- package/dist/extractor/esbuildAliasPlugin.js.map +0 -6
- package/dist/extractor/esbuildTsconfigPaths.js +0 -79
- package/dist/extractor/esbuildTsconfigPaths.js.map +0 -6
- package/dist/extractor/evaluateAstNode.js +0 -99
- package/dist/extractor/evaluateAstNode.js.map +0 -6
- package/dist/extractor/extractHelpers.js +0 -108
- package/dist/extractor/extractHelpers.js.map +0 -6
- package/dist/extractor/extractMediaStyle.js +0 -123
- package/dist/extractor/extractMediaStyle.js.map +0 -6
- package/dist/extractor/extractToClassNames.js +0 -351
- package/dist/extractor/extractToClassNames.js.map +0 -6
- package/dist/extractor/extractToNative.js +0 -286
- package/dist/extractor/extractToNative.js.map +0 -6
- package/dist/extractor/findTopmostFunction.js +0 -32
- package/dist/extractor/findTopmostFunction.js.map +0 -6
- package/dist/extractor/generatedUid.js +0 -42
- package/dist/extractor/generatedUid.js.map +0 -6
- package/dist/extractor/getPrefixLogs.js +0 -24
- package/dist/extractor/getPrefixLogs.js.map +0 -6
- package/dist/extractor/getPropValueFromAttributes.js +0 -65
- package/dist/extractor/getPropValueFromAttributes.js.map +0 -6
- package/dist/extractor/getSourceModule.js +0 -62
- package/dist/extractor/getSourceModule.js.map +0 -6
- package/dist/extractor/getStaticBindingsForScope.js +0 -145
- package/dist/extractor/getStaticBindingsForScope.js.map +0 -6
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.js +0 -32
- package/dist/extractor/getTamaguiConfigPathFromOptionsConfig.js.map +0 -6
- package/dist/extractor/hoistClassNames.js +0 -63
- package/dist/extractor/hoistClassNames.js.map +0 -6
- package/dist/extractor/literalToAst.js +0 -90
- package/dist/extractor/literalToAst.js.map +0 -6
- package/dist/extractor/loadFile.js +0 -14
- package/dist/extractor/loadFile.js.map +0 -6
- package/dist/extractor/loadTamagui.js +0 -306
- package/dist/extractor/loadTamagui.js.map +0 -6
- package/dist/extractor/logLines.js +0 -30
- package/dist/extractor/logLines.js.map +0 -6
- package/dist/extractor/normalizeTernaries.js +0 -61
- package/dist/extractor/normalizeTernaries.js.map +0 -6
- package/dist/extractor/propsToFontFamilyCache.js +0 -33
- package/dist/extractor/propsToFontFamilyCache.js.map +0 -6
- package/dist/extractor/regenerateConfig.js +0 -123
- package/dist/extractor/regenerateConfig.js.map +0 -6
- package/dist/extractor/removeUnusedHooks.js +0 -72
- package/dist/extractor/removeUnusedHooks.js.map +0 -6
- package/dist/extractor/timer.js +0 -38
- package/dist/extractor/timer.js.map +0 -6
- package/dist/extractor/validHTMLAttributes.js +0 -72
- package/dist/extractor/validHTMLAttributes.js.map +0 -6
- package/dist/extractor/watchTamaguiConfig.js +0 -57
- package/dist/extractor/watchTamaguiConfig.js.map +0 -6
- package/dist/getPragmaOptions.js +0 -50
- package/dist/getPragmaOptions.js.map +0 -6
- package/dist/helpers/memoize.js +0 -33
- package/dist/helpers/memoize.js.map +0 -6
- package/dist/helpers/requireTamaguiCore.js +0 -30
- package/dist/helpers/requireTamaguiCore.js.map +0 -6
- package/dist/index.js +0 -30
- package/dist/index.js.map +0 -6
- package/dist/registerRequire.js +0 -100
- package/dist/registerRequire.js.map +0 -6
- package/dist/server.js +0 -58
- package/dist/server.js.map +0 -6
- package/dist/setup.js +0 -1
- package/dist/setup.js.map +0 -6
- package/dist/types.js +0 -14
- package/dist/types.js.map +0 -6
- package/dist/worker.js +0 -72
- package/dist/worker.js.map +0 -6
|
@@ -3,43 +3,53 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var watchTamaguiConfig_exports = {};
|
|
22
24
|
__export(watchTamaguiConfig_exports, {
|
|
23
25
|
watchTamaguiConfig: () => watchTamaguiConfig
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(watchTamaguiConfig_exports);
|
|
26
|
-
var import_loadTamagui = require("./loadTamagui.cjs")
|
|
27
|
-
|
|
28
|
-
let isWatching =
|
|
28
|
+
var import_loadTamagui = require("./loadTamagui.cjs");
|
|
29
|
+
var import_regenerateConfig = require("./regenerateConfig.cjs");
|
|
30
|
+
let isWatching = false;
|
|
29
31
|
async function watchTamaguiConfig(tamaguiOptions) {
|
|
30
|
-
if (process.env.NODE_ENV === "production")
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (process.env.NODE_ENV === "production") {
|
|
33
|
+
return {
|
|
34
|
+
dispose() {}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
if (isWatching) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
isWatching = true;
|
|
35
41
|
const options = await (0, import_loadTamagui.getOptions)({
|
|
36
42
|
tamaguiOptions
|
|
37
43
|
});
|
|
38
|
-
if (!options.tamaguiOptions.config)
|
|
44
|
+
if (!options.tamaguiOptions.config) {
|
|
45
|
+
isWatching = false;
|
|
46
|
+
throw new Error(`No config`);
|
|
47
|
+
}
|
|
39
48
|
const disposeConfigWatcher = await (0, import_loadTamagui.esbuildWatchFiles)(options.tamaguiOptions.config, async () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
await (0, import_loadTamagui.generateThemesAndLog)(options.tamaguiOptions);
|
|
50
|
+
await (0, import_regenerateConfig.regenerateConfig)(options.tamaguiOptions, null, true);
|
|
51
|
+
});
|
|
52
|
+
const themeBuilderInput = options.tamaguiOptions.themeBuilder?.input;
|
|
43
53
|
let disposeThemesWatcher;
|
|
44
54
|
if (themeBuilderInput) {
|
|
45
55
|
let inputPath = themeBuilderInput;
|
|
@@ -52,7 +62,9 @@ async function watchTamaguiConfig(tamaguiOptions) {
|
|
|
52
62
|
}
|
|
53
63
|
return {
|
|
54
64
|
dispose() {
|
|
55
|
-
isWatching =
|
|
65
|
+
isWatching = false;
|
|
66
|
+
disposeConfigWatcher();
|
|
67
|
+
disposeThemesWatcher?.();
|
|
56
68
|
}
|
|
57
69
|
};
|
|
58
70
|
}
|
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var getPragmaOptions_exports = {};
|
|
22
24
|
__export(getPragmaOptions_exports, {
|
|
@@ -27,31 +29,44 @@ function getPragmaOptions({
|
|
|
27
29
|
source,
|
|
28
30
|
path
|
|
29
31
|
}) {
|
|
30
|
-
let shouldPrintDebug =
|
|
31
|
-
|
|
32
|
+
let shouldPrintDebug = false;
|
|
33
|
+
let shouldDisable = false;
|
|
32
34
|
const firstLines = source.slice(0, 800);
|
|
33
35
|
let pragma = "";
|
|
34
|
-
for (const line of firstLines.split(
|
|
35
|
-
`)) {
|
|
36
|
+
for (const line of firstLines.split("\n")) {
|
|
36
37
|
const trimmed = line.trim();
|
|
37
|
-
if (trimmed && !trimmed.startsWith("//") && !trimmed.startsWith("/*"))
|
|
38
|
-
|
|
38
|
+
if (trimmed && !trimmed.startsWith("//") && !trimmed.startsWith("/*")) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
pragma = trimmed.match(/(\/\/|\/\*)\s?!?\s?(tamagui-ignore|debug|debug-verbose)(\n|\s|$).*/)?.[2].trim() || "";
|
|
42
|
+
if (pragma) {
|
|
39
43
|
pragma = pragma.replace("!", "").trim();
|
|
40
44
|
break;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
switch (pragma) {
|
|
44
48
|
case "tamagui-ignore":
|
|
45
|
-
shouldDisable =
|
|
49
|
+
shouldDisable = true;
|
|
46
50
|
break;
|
|
47
51
|
case "debug":
|
|
48
|
-
shouldPrintDebug =
|
|
52
|
+
shouldPrintDebug = true;
|
|
49
53
|
break;
|
|
50
54
|
case "debug-verbose":
|
|
51
55
|
shouldPrintDebug = "verbose";
|
|
52
56
|
break;
|
|
53
57
|
}
|
|
54
|
-
|
|
58
|
+
if (process.env.TAMAGUI_DEBUG_FILE) {
|
|
59
|
+
if (path.includes(process.env.TAMAGUI_DEBUG_FILE)) {
|
|
60
|
+
shouldPrintDebug = "verbose";
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (process.env.DEBUG?.includes("tamagui")) {
|
|
64
|
+
shouldPrintDebug ||= true;
|
|
65
|
+
}
|
|
66
|
+
if (process.env.DEBUG?.includes("tamagui-verbose")) {
|
|
67
|
+
shouldPrintDebug = "verbose";
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
55
70
|
shouldPrintDebug,
|
|
56
71
|
shouldDisable
|
|
57
72
|
};
|
package/dist/helpers/memoize.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var memoize_exports = {};
|
|
22
24
|
__export(memoize_exports, {
|
|
@@ -24,14 +26,20 @@ __export(memoize_exports, {
|
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(memoize_exports);
|
|
26
28
|
function memoize(func, resolver) {
|
|
27
|
-
if (typeof func
|
|
29
|
+
if (typeof func !== "function" || resolver != null && typeof resolver !== "function") {
|
|
30
|
+
throw new TypeError("Expected a function");
|
|
31
|
+
}
|
|
28
32
|
const memoized = function (...args) {
|
|
29
|
-
const key = resolver ? resolver.apply(this, args) : args[0]
|
|
30
|
-
|
|
31
|
-
if (cache.has(key))
|
|
33
|
+
const key = resolver ? resolver.apply(this, args) : args[0];
|
|
34
|
+
const cache = memoized.cache;
|
|
35
|
+
if (cache.has(key)) {
|
|
36
|
+
return cache.get(key);
|
|
37
|
+
}
|
|
32
38
|
const result = func.apply(this, args);
|
|
33
|
-
|
|
39
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
40
|
+
return result;
|
|
34
41
|
};
|
|
35
|
-
|
|
42
|
+
memoized.cache = new (memoize.Cache || Map)();
|
|
43
|
+
return memoized;
|
|
36
44
|
}
|
|
37
45
|
memoize.Cache = Map;
|
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var requireTamaguiCore_exports = {};
|
|
22
24
|
__export(requireTamaguiCore_exports, {
|
|
@@ -24,10 +26,15 @@ __export(requireTamaguiCore_exports, {
|
|
|
24
26
|
});
|
|
25
27
|
module.exports = __toCommonJS(requireTamaguiCore_exports);
|
|
26
28
|
function requireTamaguiCore(platform, ogRequire = require) {
|
|
27
|
-
if (!platform)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
if (!platform) {
|
|
30
|
+
throw new Error(`No platform given to requireTamaguiCore`);
|
|
31
|
+
}
|
|
32
|
+
const og1 = process.env.TAMAGUI_IS_SERVER;
|
|
33
|
+
const og2 = process.env.TAMAGUI_KEEP_THEMES;
|
|
34
|
+
process.env.TAMAGUI_IS_SERVER ||= "1";
|
|
35
|
+
process.env.TAMAGUI_KEEP_THEMES ||= "1";
|
|
31
36
|
const exported = ogRequire(platform === "native" ? "@tamagui/core/native" : "@tamagui/core");
|
|
32
|
-
|
|
37
|
+
process.env.TAMAGUI_IS_SERVER = og1;
|
|
38
|
+
process.env.TAMAGUI_KEEP_THEMES = og2;
|
|
39
|
+
return exported;
|
|
33
40
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -2,34 +2,36 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf
|
|
6
|
-
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
16
|
get: () => from[key],
|
|
16
17
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
+
value: mod,
|
|
30
|
+
enumerable: true
|
|
31
|
+
}) : target, mod));
|
|
32
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
33
|
+
value: true
|
|
34
|
+
}), mod);
|
|
33
35
|
var index_exports = {};
|
|
34
36
|
__export(index_exports, {
|
|
35
37
|
default: () => index_default
|
package/dist/registerRequire.cjs
CHANGED
|
@@ -3,20 +3,22 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
14
|
get: () => from[key],
|
|
14
15
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
16
|
});
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
18
20
|
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value:
|
|
21
|
+
value: true
|
|
20
22
|
}), mod);
|
|
21
23
|
var registerRequire_exports = {};
|
|
22
24
|
__export(registerRequire_exports, {
|
|
@@ -25,82 +27,183 @@ __export(registerRequire_exports, {
|
|
|
25
27
|
setRequireResult: () => setRequireResult
|
|
26
28
|
});
|
|
27
29
|
module.exports = __toCommonJS(registerRequire_exports);
|
|
28
|
-
var import_node = require("esbuild-register/dist/node")
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const nameToPaths = {}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
let isRegistered =
|
|
36
|
-
|
|
30
|
+
var import_node = require("esbuild-register/dist/node");
|
|
31
|
+
var import_bundle = require("./extractor/bundle.cjs");
|
|
32
|
+
var import_requireTamaguiCore = require("./helpers/requireTamaguiCore.cjs");
|
|
33
|
+
const nameToPaths = {};
|
|
34
|
+
const getNameToPaths = () => nameToPaths;
|
|
35
|
+
const Module = require("node:module");
|
|
36
|
+
const proxyWorm = require("@tamagui/proxy-worm");
|
|
37
|
+
let isRegistered = false;
|
|
38
|
+
let og;
|
|
37
39
|
const whitelisted = {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
react: true
|
|
41
|
+
};
|
|
42
|
+
const compiled = {};
|
|
41
43
|
function setRequireResult(name, result) {
|
|
42
44
|
compiled[name] = result;
|
|
43
45
|
}
|
|
46
|
+
function getStaticExtractionStub(path) {
|
|
47
|
+
switch (path) {
|
|
48
|
+
case "expo-constants":
|
|
49
|
+
return {
|
|
50
|
+
__esModule: true,
|
|
51
|
+
default: {
|
|
52
|
+
executionEnvironment: null
|
|
53
|
+
},
|
|
54
|
+
ExecutionEnvironment: {
|
|
55
|
+
Bare: "bare",
|
|
56
|
+
Standalone: "standalone",
|
|
57
|
+
StoreClient: "storeClient"
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
case "expo-updates":
|
|
61
|
+
return {
|
|
62
|
+
__esModule: true,
|
|
63
|
+
default: {
|
|
64
|
+
isEnabled: false,
|
|
65
|
+
isUsingEmbeddedAssets: true
|
|
66
|
+
},
|
|
67
|
+
checkForUpdateAsync: async () => ({
|
|
68
|
+
isAvailable: false
|
|
69
|
+
}),
|
|
70
|
+
fetchUpdateAsync: async () => ({
|
|
71
|
+
isNew: false
|
|
72
|
+
}),
|
|
73
|
+
reloadAsync: async () => {}
|
|
74
|
+
};
|
|
75
|
+
default:
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
44
79
|
function registerRequire(platform, {
|
|
45
80
|
proxyWormImports
|
|
46
81
|
} = {
|
|
47
|
-
proxyWormImports:
|
|
82
|
+
proxyWormImports: false
|
|
48
83
|
}) {
|
|
49
|
-
if (isRegistered)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
84
|
+
if (isRegistered) {
|
|
85
|
+
return {
|
|
86
|
+
tamaguiRequire: require,
|
|
87
|
+
unregister: () => {}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const originalResolveFilename = Module._resolveFilename;
|
|
53
91
|
const {
|
|
54
92
|
unregister
|
|
55
93
|
} = (0, import_node.register)({
|
|
56
|
-
hookIgnoreNodeModules:
|
|
94
|
+
hookIgnoreNodeModules: false,
|
|
95
|
+
// don't transform @tamagui packages - they have pre-built dist files
|
|
96
|
+
hookMatcher: filename => {
|
|
97
|
+
if (filename.includes("@tamagui") || /\/tamagui\/code\/(core|ui|packages)\//.test(filename)) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
57
102
|
});
|
|
58
|
-
|
|
103
|
+
const tsconfigPatchedResolve = Module._resolveFilename;
|
|
104
|
+
Module._resolveFilename = function (request, ...args) {
|
|
105
|
+
if (request.startsWith("@tamagui/")) {
|
|
106
|
+
return originalResolveFilename.call(this, request, ...args);
|
|
107
|
+
}
|
|
108
|
+
return tsconfigPatchedResolve.call(this, request, ...args);
|
|
109
|
+
};
|
|
110
|
+
if (!og) {
|
|
111
|
+
og = Module.prototype.require;
|
|
112
|
+
}
|
|
113
|
+
isRegistered = true;
|
|
114
|
+
Module.prototype.require = tamaguiRequire;
|
|
59
115
|
function tamaguiRequire(path) {
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (path === "
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
116
|
+
const staticExtractionStub = getStaticExtractionStub(path);
|
|
117
|
+
if (staticExtractionStub) {
|
|
118
|
+
return staticExtractionStub;
|
|
119
|
+
}
|
|
120
|
+
if (path === "tamagui" && platform === "native") {
|
|
121
|
+
return og.apply(this, ["tamagui/native"]);
|
|
122
|
+
}
|
|
123
|
+
if (path === "@tamagui/core") {
|
|
124
|
+
return (0, import_requireTamaguiCore.requireTamaguiCore)(platform, path2 => {
|
|
125
|
+
return og.apply(this, [path2]);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (path in knownIgnorableModules || path.startsWith("react-native-reanimated") || import_bundle.esbuildIgnoreFilesRegex.test(path)) {
|
|
129
|
+
return proxyWorm;
|
|
130
|
+
}
|
|
131
|
+
if (path in compiled) {
|
|
132
|
+
return compiled[path];
|
|
133
|
+
}
|
|
134
|
+
if (path === "react-native-svg") {
|
|
135
|
+
return og.apply(this, ["@tamagui/react-native-svg"]);
|
|
136
|
+
}
|
|
137
|
+
if (path === "react-native/package.json") {
|
|
138
|
+
return og.apply(this, ["react-native-web/package.json"]);
|
|
139
|
+
}
|
|
140
|
+
if (path === "@tamagui/react-native-web-lite" || path === "react-native" || path.startsWith("react-native/") || path === "react-native-web" || path.startsWith("react-native-web/")) {
|
|
141
|
+
try {
|
|
142
|
+
return og.apply("react-native");
|
|
143
|
+
} catch {
|
|
144
|
+
return og.apply(this, ["@tamagui/react-native-web-lite"]);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!whitelisted[path]) {
|
|
148
|
+
if (proxyWormImports && !path.includes(".tamagui-dynamic-eval")) {
|
|
149
|
+
const callerFile = this?.filename || this?.id || "";
|
|
150
|
+
const isFromTamaguiPkg = callerFile.includes("@tamagui") || callerFile.includes("node_modules/tamagui/") || /\/tamagui\/code\/(core|ui|packages)\//.test(callerFile);
|
|
151
|
+
const isFromStaticLoader = !callerFile || callerFile === "." || callerFile === "[eval]" || callerFile.endsWith("/[eval]") || callerFile.includes("/code/compiler/static/") || callerFile.includes("/.tamagui/");
|
|
152
|
+
const isRelativeFromWhitelisted = path.startsWith(".") && Object.keys(whitelisted).some(pkg => callerFile.includes(`/node_modules/${pkg}/`));
|
|
153
|
+
if (path === "tamagui" || path.startsWith("@tamagui/") || isRelativeFromWhitelisted || isFromTamaguiPkg || isFromStaticLoader) {
|
|
154
|
+
return og.apply(this, [path]);
|
|
155
|
+
}
|
|
156
|
+
return proxyWorm;
|
|
157
|
+
}
|
|
70
158
|
}
|
|
71
|
-
if (!whitelisted[path] && proxyWormImports && !path.includes(".tamagui-dynamic-eval")) return path === "tamagui" ? og.apply(this, [path]) : proxyWorm;
|
|
72
159
|
try {
|
|
73
|
-
|
|
160
|
+
const out = og.apply(this, arguments);
|
|
161
|
+
return out;
|
|
74
162
|
} catch (err) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
163
|
+
if (!process.env.TAMAGUI_ENABLE_WARN_DYNAMIC_LOAD && path.includes("tamagui-dynamic-eval")) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (allowedIgnores[path] || IGNORES === "true") {} else if (!process.env.TAMAGUI_SHOW_FULL_BUNDLE_ERRORS && !process.env.DEBUG) {
|
|
167
|
+
if (hasWarnedForModules.has(path)) {} else {
|
|
168
|
+
hasWarnedForModules.add(path);
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
console.warn(` [tamagui] skipped "${path}" (set TAMAGUI_IGNORE_BUNDLE_ERRORS="${path}" to silence)`);
|
|
172
|
+
}
|
|
173
|
+
return proxyWorm;
|
|
81
174
|
}
|
|
82
175
|
}
|
|
83
176
|
return {
|
|
84
177
|
tamaguiRequire,
|
|
85
178
|
unregister: () => {
|
|
86
|
-
|
|
179
|
+
if (hasWarnedForModules.size) {
|
|
180
|
+
console.info(` [tamagui] skipped loading ${hasWarnedForModules.size} module, see: https://tamagui.dev/docs/intro/errors#warning-001`);
|
|
181
|
+
hasWarnedForModules.clear();
|
|
182
|
+
}
|
|
183
|
+
unregister();
|
|
184
|
+
isRegistered = false;
|
|
185
|
+
Module.prototype.require = og;
|
|
87
186
|
}
|
|
88
187
|
};
|
|
89
188
|
}
|
|
90
|
-
const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
189
|
+
const IGNORES = process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS;
|
|
190
|
+
const extraIgnores = IGNORES === "true" ? [] : process.env.TAMAGUI_IGNORE_BUNDLE_ERRORS?.split(",");
|
|
191
|
+
const knownIgnorableModules = {
|
|
192
|
+
"@gorhom/bottom-sheet": true,
|
|
193
|
+
"expo-modules": true,
|
|
194
|
+
solito: true,
|
|
195
|
+
"expo-linear-gradient": true,
|
|
196
|
+
"@expo/vector-icons": true,
|
|
197
|
+
"tamagui/linear-gradient": true,
|
|
198
|
+
// animation libraries not needed for static extraction
|
|
199
|
+
"@emotion/is-prop-valid": true,
|
|
200
|
+
"framer-motion": true,
|
|
201
|
+
motion: true,
|
|
202
|
+
...Object.fromEntries(extraIgnores?.map(k => [k, true]) || [])
|
|
203
|
+
};
|
|
204
|
+
const hasWarnedForModules = /* @__PURE__ */new Set();
|
|
205
|
+
const allowedIgnores = {
|
|
206
|
+
"expo-constants": true,
|
|
207
|
+
"./ExpoHaptics": true,
|
|
208
|
+
"./js/MaskedView": true
|
|
209
|
+
};
|