@tamagui/vite-plugin 2.7.6 → 3.0.0-beta.637.1

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.
@@ -0,0 +1,154 @@
1
+
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all) __defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: () => from[key],
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var zeroRuntime_exports = {};
29
+ __export(zeroRuntime_exports, {
30
+ ZERO_CSS_FILENAME: () => ZERO_CSS_FILENAME,
31
+ ZERO_ISLAND_DIRNAME: () => ZERO_ISLAND_DIRNAME,
32
+ assertZeroGraph: () => assertZeroGraph,
33
+ buildIsland: () => buildIsland,
34
+ createZeroRuntimeController: () => createZeroRuntimeController,
35
+ finalizeZeroCSS: () => finalizeZeroCSS,
36
+ zeroModuleKey: () => zeroModuleKey
37
+ });
38
+ module.exports = __toCommonJS(zeroRuntime_exports);
39
+ var import_static = __toESM(require("@tamagui/static"), 1);
40
+ var import_node_crypto = require("node:crypto");
41
+ var import_node_zlib = require("node:zlib");
42
+ var import_node_fs = require("node:fs");
43
+ var import_node_path = __toESM(require("node:path"), 1);
44
+ const ZERO_CSS_FILENAME = "tamagui-zero.css";
45
+ const ZERO_ISLAND_DIRNAME = "tamagui-islands";
46
+ const normalizePath = (value) => value.replace(/\\/g, "/");
47
+ const zeroModuleKey = (value) => normalizePath(value).replace(/\.(?:js|jsx|ts|tsx|mjs|cjs)$/, "");
48
+ async function createZeroRuntimeController(options, root, base) {
49
+ const resolved = await import_static.default.resolveZeroRuntime(options, root);
50
+ if (resolved.mode === "off") return null;
51
+ import_static.default.assertZeroIntegrationSupport("vite", resolved);
52
+ const cssHref = `${base.endsWith("/") ? base : `${base}/`}${ZERO_CSS_FILENAME}`;
53
+ const artifact = new import_static.default.ZeroCSSArtifact(resolved.cssPath);
54
+ artifact.expectIslands(resolved.islands.map((island) => island.id));
55
+ const configPath = import_node_path.default.isAbsolute(options.config || "") ? options.config : import_node_path.default.resolve(root, options.config || "tamagui.config.ts");
56
+ for (const island of resolved.islands) {
57
+ import_static.default.writeIslandModules({
58
+ island,
59
+ integration: "vite",
60
+ configPath,
61
+ scriptUrl: `${base.endsWith("/") ? base : `${base}/`}${ZERO_ISLAND_DIRNAME}/${island.id}.js`,
62
+ cssHref
63
+ });
64
+ }
65
+ return {
66
+ options,
67
+ resolved,
68
+ artifact,
69
+ cssHref,
70
+ bridges: /* @__PURE__ */ new Map(),
71
+ violations: [],
72
+ transformed: /* @__PURE__ */ new Set(),
73
+ erasedExports: /* @__PURE__ */ new Map(),
74
+ loaderIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.loader), island.id])),
75
+ islandModuleIds: new Map(resolved.islands.map((island) => [zeroModuleKey(island.module), island.id])),
76
+ isEnforcing: resolved.mode === "enforce"
77
+ };
78
+ }
79
+ async function buildIsland(input) {
80
+ const { build } = await import("vite");
81
+ const { createTamaguiPlugins } = await import("./plugin.cjs");
82
+ const islandOutDir = import_node_path.default.join(input.outDir, ZERO_ISLAND_DIRNAME);
83
+ await build({
84
+ configFile: false,
85
+ root: input.root,
86
+ mode: "production",
87
+ logLevel: "warn",
88
+ define: {
89
+ "process.env.TAMAGUI_RUNTIME": JSON.stringify("full"),
90
+ "process.env.TAMAGUI_DID_OUTPUT_CSS": JSON.stringify("1"),
91
+ "process.env.NODE_ENV": JSON.stringify("production")
92
+ },
93
+ esbuild: {
94
+ jsx: "automatic",
95
+ jsxDev: false
96
+ },
97
+ plugins: [createTamaguiPlugins({
98
+ ...input.controller.options,
99
+ outputCSS: null,
100
+ experimental: {
101
+ ...input.controller.options.experimental,
102
+ zeroRuntime: void 0
103
+ },
104
+ zeroIslandBuild: {
105
+ islandId: input.island.id,
106
+ artifact: input.controller.artifact
107
+ }
108
+ }).plugins],
109
+ build: {
110
+ outDir: islandOutDir,
111
+ emptyOutDir: false,
112
+ cssCodeSplit: false,
113
+ minify: input.mode === "production",
114
+ sourcemap: false,
115
+ rollupOptions: {
116
+ input: input.island.entry,
117
+ external: Object.keys(import_static.default.ISLAND_EXTERNAL_GLOBALS),
118
+ output: {
119
+ format: "iife",
120
+ name: `tamaguiIsland_${input.island.id}`,
121
+ entryFileNames: `${input.island.id}.js`,
122
+ globals: import_static.default.ISLAND_EXTERNAL_GLOBALS,
123
+ inlineDynamicImports: true
124
+ }
125
+ }
126
+ }
127
+ });
128
+ const file = import_node_path.default.join(islandOutDir, `${input.island.id}.js`);
129
+ const contents = (0, import_node_fs.readFileSync)(file);
130
+ input.controller.artifact.markIslandComplete(input.island.id);
131
+ return {
132
+ file,
133
+ hash: (0, import_node_crypto.createHash)("sha256").update(contents).digest("hex").slice(0, 16)
134
+ };
135
+ }
136
+ function finalizeZeroCSS(controller, outDir) {
137
+ const written = controller.artifact.write();
138
+ if (!written.complete) {
139
+ throw new Error(`[tamagui zero-runtime] cannot derive TAMAGUI_DID_OUTPUT_CSS: the generated CSS artifact is missing ${written.missing.join(", ")}`);
140
+ }
141
+ const css = controller.artifact.css();
142
+ const target = import_node_path.default.join(outDir, ZERO_CSS_FILENAME);
143
+ (0, import_node_fs.writeFileSync)(target, css);
144
+ return {
145
+ href: controller.cssHref,
146
+ hash: written.hash,
147
+ bytes: Buffer.byteLength(css),
148
+ gzip: (0, import_node_zlib.gzipSync)(Buffer.from(css), { level: 9 }).length
149
+ };
150
+ }
151
+ function assertZeroGraph(receipt) {
152
+ if (receipt.forbidden.length === 0) return;
153
+ throw new Error(import_static.default.formatZeroGraphFailure(receipt));
154
+ }
@@ -0,0 +1,98 @@
1
+ import path from "node:path";
2
+
3
+ const normalizePath = (value) => value.replace(/\\/g, "/");
4
+ function normalizeDiagnostic(diagnostic) {
5
+ const unsupportedComponentSuffix = diagnostic.component && `#${diagnostic.component} does not accept className`;
6
+ const message = unsupportedComponentSuffix && diagnostic.message.endsWith(unsupportedComponentSuffix) ? `${diagnostic.component} does not accept className` : diagnostic.message;
7
+ return {
8
+ code: diagnostic.code,
9
+ message,
10
+ ...diagnostic.component && { component: diagnostic.component }
11
+ };
12
+ }
13
+ function createCompilerStatsReport(root, reports) {
14
+ const totals = {
15
+ modules: 0,
16
+ found: 0,
17
+ lowered: 0,
18
+ flattened: 0,
19
+ partial: 0,
20
+ styled: 0,
21
+ bailed: 0,
22
+ notFlattened: 0,
23
+ flattenRate: 0
24
+ };
25
+ const bailoutCodes = /* @__PURE__ */ new Map();
26
+ const bailoutReasons = /* @__PURE__ */ new Map();
27
+ const modules = [];
28
+ for (const [id, report] of [...reports].sort(([left], [right]) => left.localeCompare(right))) {
29
+ if (report.stats.found === 0) continue;
30
+ const partial = report.stats.lowered - report.stats.flattened;
31
+ const notFlattened = report.stats.found - report.stats.flattened;
32
+ totals.modules++;
33
+ totals.found += report.stats.found;
34
+ totals.lowered += report.stats.lowered;
35
+ totals.flattened += report.stats.flattened;
36
+ totals.partial += partial;
37
+ totals.styled += report.stats.styled;
38
+ totals.bailed += report.stats.bailed;
39
+ totals.notFlattened += notFlattened;
40
+ const diagnostics = report.diagnostics.map(normalizeDiagnostic);
41
+ for (const diagnostic of diagnostics) {
42
+ bailoutCodes.set(diagnostic.code, (bailoutCodes.get(diagnostic.code) ?? 0) + 1);
43
+ const key = JSON.stringify([
44
+ diagnostic.code,
45
+ diagnostic.message,
46
+ diagnostic.component
47
+ ]);
48
+ const reason = bailoutReasons.get(key);
49
+ if (reason) {
50
+ reason.count++;
51
+ } else {
52
+ bailoutReasons.set(key, {
53
+ ...diagnostic,
54
+ count: 1
55
+ });
56
+ }
57
+ }
58
+ modules.push({
59
+ id: normalizePath(path.relative(root, id)),
60
+ stats: {
61
+ ...report.stats,
62
+ partial,
63
+ notFlattened
64
+ },
65
+ diagnostics
66
+ });
67
+ }
68
+ totals.flattenRate = totals.found ? totals.flattened / totals.found : 0;
69
+ return {
70
+ schemaVersion: 1,
71
+ selector: {
72
+ id: "all",
73
+ include: ["**"]
74
+ },
75
+ totals,
76
+ bailoutCodes: Object.fromEntries([...bailoutCodes].sort(([leftCode, leftCount], [rightCode, rightCount]) => rightCount - leftCount || leftCode.localeCompare(rightCode))),
77
+ bailoutReasons: [...bailoutReasons.values()].sort((left, right) => right.count - left.count || left.code.localeCompare(right.code) || left.message.localeCompare(right.message) || (left.component ?? "").localeCompare(right.component ?? "")),
78
+ modules
79
+ };
80
+ }
81
+ function formatCompilerStatsReport(report, verbose) {
82
+ const moduleLines = report.modules.map(({ id, stats, diagnostics }) => {
83
+ const codes = [...new Set(diagnostics.map(({ code }) => code))];
84
+ return ` ${id}: found ${stats.found} lowered ${stats.lowered} flattened ${stats.flattened} bailed ${stats.bailed}` + (codes.length ? ` (${codes.join(", ")})` : "");
85
+ });
86
+ const summary = `
87
+ [tamagui] compiler stats: ${report.totals.modules} modules with candidates
88
+ found ${report.totals.found} \xB7 lowered ${report.totals.lowered} (flattened ${report.totals.flattened}, partial ${report.totals.partial}, styled ${report.totals.styled}) \xB7 bailed ${report.totals.bailed}`;
89
+ const bailouts = Object.entries(report.bailoutCodes).map(([code, count]) => ` bailout ${code}: ${count}`).join("\n");
90
+ return [
91
+ summary,
92
+ bailouts,
93
+ verbose ? moduleLines.join("\n") : ""
94
+ ].filter(Boolean).join("\n");
95
+ }
96
+
97
+ export { createCompilerStatsReport, formatCompilerStatsReport };
98
+ //# sourceMappingURL=compilerStats.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compilerStats.js","names":[],"sources":["esm/compilerStats.js"],"sourcesContent":["import path from \"node:path\";\nconst normalizePath = (value) => value.replace(/\\\\/g, \"/\");\nfunction normalizeDiagnostic(diagnostic) {\n const unsupportedComponentSuffix = diagnostic.component && `#${diagnostic.component} does not accept className`;\n const message = unsupportedComponentSuffix && diagnostic.message.endsWith(unsupportedComponentSuffix) ? `${diagnostic.component} does not accept className` : diagnostic.message;\n return {\n code: diagnostic.code,\n message,\n ...diagnostic.component && { component: diagnostic.component }\n };\n}\nfunction createCompilerStatsReport(root, reports) {\n const totals = {\n modules: 0,\n found: 0,\n lowered: 0,\n flattened: 0,\n partial: 0,\n styled: 0,\n bailed: 0,\n notFlattened: 0,\n flattenRate: 0\n };\n const bailoutCodes = /* @__PURE__ */ new Map();\n const bailoutReasons = /* @__PURE__ */ new Map();\n const modules = [];\n for (const [id, report] of [...reports].sort(\n ([left], [right]) => left.localeCompare(right)\n )) {\n if (report.stats.found === 0) continue;\n const partial = report.stats.lowered - report.stats.flattened;\n const notFlattened = report.stats.found - report.stats.flattened;\n totals.modules++;\n totals.found += report.stats.found;\n totals.lowered += report.stats.lowered;\n totals.flattened += report.stats.flattened;\n totals.partial += partial;\n totals.styled += report.stats.styled;\n totals.bailed += report.stats.bailed;\n totals.notFlattened += notFlattened;\n const diagnostics = report.diagnostics.map(normalizeDiagnostic);\n for (const diagnostic of diagnostics) {\n bailoutCodes.set(diagnostic.code, (bailoutCodes.get(diagnostic.code) ?? 0) + 1);\n const key = JSON.stringify([\n diagnostic.code,\n diagnostic.message,\n diagnostic.component\n ]);\n const reason = bailoutReasons.get(key);\n if (reason) {\n reason.count++;\n } else {\n bailoutReasons.set(key, { ...diagnostic, count: 1 });\n }\n }\n modules.push({\n id: normalizePath(path.relative(root, id)),\n stats: { ...report.stats, partial, notFlattened },\n diagnostics\n });\n }\n totals.flattenRate = totals.found ? totals.flattened / totals.found : 0;\n return {\n schemaVersion: 1,\n selector: { id: \"all\", include: [\"**\"] },\n totals,\n bailoutCodes: Object.fromEntries(\n [...bailoutCodes].sort(\n ([leftCode, leftCount], [rightCode, rightCount]) => rightCount - leftCount || leftCode.localeCompare(rightCode)\n )\n ),\n bailoutReasons: [...bailoutReasons.values()].sort(\n (left, right) => right.count - left.count || left.code.localeCompare(right.code) || left.message.localeCompare(right.message) || (left.component ?? \"\").localeCompare(right.component ?? \"\")\n ),\n modules\n };\n}\nfunction formatCompilerStatsReport(report, verbose) {\n const moduleLines = report.modules.map(({ id, stats, diagnostics }) => {\n const codes = [...new Set(diagnostics.map(({ code }) => code))];\n return ` ${id}: found ${stats.found} lowered ${stats.lowered} flattened ${stats.flattened} bailed ${stats.bailed}` + (codes.length ? ` (${codes.join(\", \")})` : \"\");\n });\n const summary = `\n[tamagui] compiler stats: ${report.totals.modules} modules with candidates\n found ${report.totals.found} \\xB7 lowered ${report.totals.lowered} (flattened ${report.totals.flattened}, partial ${report.totals.partial}, styled ${report.totals.styled}) \\xB7 bailed ${report.totals.bailed}`;\n const bailouts = Object.entries(report.bailoutCodes).map(([code, count]) => ` bailout ${code}: ${count}`).join(\"\\n\");\n return [summary, bailouts, verbose ? moduleLines.join(\"\\n\") : \"\"].filter(Boolean).join(\"\\n\");\n}\nexport {\n createCompilerStatsReport,\n formatCompilerStatsReport\n};\n//# sourceMappingURL=compilerStats.js.map\n"],"mappings":";;;AACA,MAAM,iBAAiB,UAAU,MAAM,QAAQ,OAAO,GAAG;AACzD,SAAS,oBAAoB,YAAY;CACvC,MAAM,6BAA6B,WAAW,aAAa,IAAI,WAAW,UAAU;CACpF,MAAM,UAAU,8BAA8B,WAAW,QAAQ,SA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,IAAI,OAAO,EAAE,KAAK,IAAI;CACpH,OAAO;EAAC;EAAS;EAAU,UAAU,YAAY,KAAK,IAAI,IAAI;CAAE,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AAC7F"}
@@ -1,3 +1,15 @@
1
- const extensions = [".ios.js", ".native.js", ".native.ts", ".native.tsx", ".js", ".jsx", ".json", ".ts", ".tsx", ".mjs"];
1
+ const extensions = [
2
+ ".ios.js",
3
+ ".native.js",
4
+ ".native.ts",
5
+ ".native.tsx",
6
+ ".js",
7
+ ".jsx",
8
+ ".json",
9
+ ".ts",
10
+ ".tsx",
11
+ ".mjs"
12
+ ];
13
+
2
14
  export { extensions };
3
15
  //# sourceMappingURL=extensions.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["extensions"],"sources":["../../src/extensions.ts"],"sourcesContent":[null],"mappings":"AAAO,MAAMA,UAAA,GAAa,CACxB,WACA,cACA,cACA,eACA,OACA,QACA,SACA,OACA,QACA,OACF","ignoreList":[]}
1
+ {"version":3,"file":"extensions.js","names":[],"sources":["esm/extensions.js"],"sourcesContent":["const extensions = [\n \".ios.js\",\n \".native.js\",\n \".native.ts\",\n \".native.tsx\",\n \".js\",\n \".jsx\",\n \".json\",\n \".ts\",\n \".tsx\",\n \".mjs\"\n];\nexport {\n extensions\n};\n//# sourceMappingURL=extensions.js.map\n"],"mappings":";AAAA,MAAM,aAAa;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
package/dist/esm/index.js CHANGED
@@ -1,2 +1 @@
1
- export * from "./plugin.mjs";
2
- //# sourceMappingURL=index.js.map
1
+ export * from "./plugin.mjs"
@@ -1,2 +1 @@
1
- export * from "./plugin.mjs";
2
- //# sourceMappingURL=index.mjs.map
1
+ export * from "./plugin.mjs"
@@ -0,0 +1,3 @@
1
+ import { createTamaguiPlugins } from "./plugin.mjs";
2
+
3
+ export { createTamaguiPlugins };
@@ -1,61 +1,180 @@
1
- import * as StaticWorker from "@tamagui/static-worker";
2
- const LOAD_STATE_KEY = "__tamagui_load_state__";
3
- function getLoadState() {
4
- if (!globalThis[LOAD_STATE_KEY]) {
5
- ;
6
- globalThis[LOAD_STATE_KEY] = {
7
- loadPromise: null,
8
- loadedOptions: null,
9
- fullConfigLoaded: false,
10
- fullConfigLoadPromise: null
11
- };
12
- }
13
- return globalThis[LOAD_STATE_KEY];
1
+ import Static from "@tamagui/static";
2
+ import { createRequire } from "node:module";
3
+ import path from "node:path";
4
+
5
+ const TAMAGUI_EVALUATION_ENVIRONMENT = "tamagui";
6
+ const requireFromLoader = createRequire(typeof __filename === "string" ? __filename : import.meta.url);
7
+ const vitePluginVersions = [`@tamagui/vite-plugin@${requireFromLoader("@tamagui/vite-plugin/package.json").version}`];
8
+ function createViteTamaguiLoader(optionsIn = {}) {
9
+ let environment = null;
10
+ let ownsEnvironment = false;
11
+ let loadPromise = null;
12
+ let loadedOptions = null;
13
+ let projectPromise = null;
14
+ const evaluationDependencies = /* @__PURE__ */ new Set();
15
+ const stampSources = /* @__PURE__ */ new Set();
16
+ let generation = 0;
17
+ const normalizeDependency = (id) => id.split("?")[0];
18
+ const captureEvaluationDependencies = (modules) => {
19
+ stampSources.clear();
20
+ for (const { id } of modules) {
21
+ const dependency = normalizeDependency(id);
22
+ if (path.isAbsolute(dependency)) {
23
+ evaluationDependencies.add(dependency);
24
+ stampSources.add(dependency);
25
+ }
26
+ }
27
+ if (environment) {
28
+ for (const module of environment.runner.evaluatedModules.urlToIdModuleMap.values()) {
29
+ const dependency = normalizeDependency(module.file);
30
+ if (!path.isAbsolute(dependency)) continue;
31
+ stampSources.add(dependency);
32
+ if (!dependency.includes("/node_modules/")) {
33
+ evaluationDependencies.add(dependency);
34
+ }
35
+ }
36
+ }
37
+ };
38
+ const loadTamaguiBuildConfig = async () => {
39
+ if (loadedOptions) return loadedOptions;
40
+ if (loadPromise) return loadPromise;
41
+ loadPromise = Static.loadTamaguiBuildConfigAsync({
42
+ ...optionsIn,
43
+ platform: "web"
44
+ }).then((options) => {
45
+ loadedOptions = options;
46
+ return options;
47
+ });
48
+ return loadPromise;
49
+ };
50
+ const resolveAndImport = async (moduleName, root, kind) => {
51
+ if (!environment) {
52
+ throw new Error(`The Tamagui Vite evaluation environment is not ready. Config and component evaluation requires Vite's ModuleRunner.`);
53
+ }
54
+ const source = path.isAbsolute(moduleName) ? moduleName : kind === "config" || moduleName.startsWith(".") ? path.resolve(root, moduleName) : moduleName;
55
+ let environmentResolution = await environment.pluginContainer.resolveId(source);
56
+ if (!environmentResolution && kind === "config" && source !== moduleName) {
57
+ environmentResolution = await environment.pluginContainer.resolveId(moduleName);
58
+ }
59
+ const resolvedId = environmentResolution?.id;
60
+ if (!resolvedId) {
61
+ throw new Error(`Unable to resolve ${moduleName} in the Tamagui Vite environment (plugins: ${environment.plugins.map((plugin) => plugin.name).join(", ")})`);
62
+ }
63
+ return {
64
+ moduleName,
65
+ id: resolvedId,
66
+ module: await environment.runner.import(resolvedId)
67
+ };
68
+ };
69
+ const evaluateProjectModules = async (options) => {
70
+ if (!environment) {
71
+ throw new Error(`Cannot evaluate Tamagui without the ${TAMAGUI_EVALUATION_ENVIRONMENT} Vite environment`);
72
+ }
73
+ const root = environment.config.root;
74
+ const config = await resolveAndImport(options.config || "tamagui.config.ts", root, "config");
75
+ const components = await Promise.all((options.components || []).map((name) => resolveAndImport(name, root, "component")));
76
+ captureEvaluationDependencies([config, ...components]);
77
+ return {
78
+ config,
79
+ components
80
+ };
81
+ };
82
+ const loadProject = async (options) => {
83
+ if (projectPromise) return projectPromise;
84
+ projectPromise = (async () => {
85
+ if (!environment) {
86
+ throw new Error(`Cannot load Tamagui without the ${TAMAGUI_EVALUATION_ENVIRONMENT} Vite environment`);
87
+ }
88
+ let evaluated = null;
89
+ return Static.loadCompilerProject({
90
+ root: environment.config.root,
91
+ target: "web",
92
+ options,
93
+ generation: `vite:${generation}`,
94
+ hostVersions: vitePluginVersions,
95
+ async load(normalizedOptions) {
96
+ evaluated = await evaluateProjectModules(normalizedOptions);
97
+ return Static.loadTamaguiFromModules(normalizedOptions, {
98
+ config: evaluated.config.module,
99
+ components: evaluated.components.map(({ moduleName, module }) => ({
100
+ moduleName,
101
+ module
102
+ })),
103
+ stampSources: [...stampSources]
104
+ });
105
+ },
106
+ async resolveComponents(moduleNames) {
107
+ if (!evaluated) {
108
+ throw new Error("The Tamagui compiler project modules were not evaluated");
109
+ }
110
+ const byName = new Map(evaluated.components.map(({ moduleName, id }) => [moduleName, id]));
111
+ return moduleNames.map((moduleName) => {
112
+ const id = byName.get(moduleName);
113
+ if (!id) throw new Error(`Unable to resolve compiler component ${moduleName}`);
114
+ return {
115
+ moduleName,
116
+ id
117
+ };
118
+ });
119
+ }
120
+ });
121
+ })();
122
+ return projectPromise;
123
+ };
124
+ return {
125
+ getEnvironment: () => environment,
126
+ getGeneration: () => generation,
127
+ getLoadPromise: () => loadPromise,
128
+ getTamaguiOptions: () => loadedOptions,
129
+ async getTamaguiConfig() {
130
+ const options = await loadTamaguiBuildConfig();
131
+ if (options.disable) return null;
132
+ return (await loadProject(options)).projectInfo.tamaguiConfig;
133
+ },
134
+ async getCompilerProject() {
135
+ const options = await loadTamaguiBuildConfig();
136
+ return loadProject(options);
137
+ },
138
+ getEvaluationDependencies: () => [...evaluationDependencies],
139
+ isEvaluationDependency: (id) => evaluationDependencies.has(normalizeDependency(id)),
140
+ evaluateProjectModules,
141
+ loadTamaguiBuildConfig,
142
+ setEnvironment(next, options) {
143
+ if (environment === next) return;
144
+ environment = next;
145
+ ownsEnvironment = options?.owned === true;
146
+ generation++;
147
+ projectPromise = null;
148
+ },
149
+ invalidate(file) {
150
+ if (file && environment) {
151
+ environment.runner.clearCache();
152
+ }
153
+ generation++;
154
+ projectPromise = null;
155
+ },
156
+ async ensureFullConfigLoaded() {
157
+ const options = await loadTamaguiBuildConfig();
158
+ if (!options.disable) {
159
+ await loadProject(options);
160
+ }
161
+ return [...evaluationDependencies];
162
+ },
163
+ async cleanup() {
164
+ try {
165
+ if (ownsEnvironment && environment) {
166
+ await environment.close();
167
+ }
168
+ } finally {
169
+ environment = null;
170
+ ownsEnvironment = false;
171
+ loadPromise = null;
172
+ loadedOptions = null;
173
+ projectPromise = null;
174
+ }
175
+ }
176
+ };
14
177
  }
15
- function getTamaguiOptions() {
16
- return getLoadState().loadedOptions;
17
- }
18
- function getLoadPromise() {
19
- return getLoadState().loadPromise;
20
- }
21
- async function loadTamaguiBuildConfig(optionsIn) {
22
- const state = getLoadState();
23
- if (state.loadedOptions) return state.loadedOptions;
24
- if (state.loadPromise) return state.loadPromise;
25
- state.loadPromise = (async () => {
26
- const options = await StaticWorker.loadTamaguiBuildConfig({
27
- ...optionsIn,
28
- platform: "web"
29
- });
30
- state.loadedOptions = options;
31
- return options;
32
- })();
33
- return state.loadPromise;
34
- }
35
- async function ensureFullConfigLoaded() {
36
- const state = getLoadState();
37
- if (state.fullConfigLoaded) return;
38
- if (state.fullConfigLoadPromise) return state.fullConfigLoadPromise;
39
- state.fullConfigLoadPromise = (async () => {
40
- const options = await loadTamaguiBuildConfig();
41
- if (!options.disableWatchTamaguiConfig && !options.disable) {
42
- await StaticWorker.loadTamagui({
43
- components: ["tamagui"],
44
- platform: "web",
45
- ...options
46
- });
47
- }
48
- state.fullConfigLoaded = true;
49
- })();
50
- return state.fullConfigLoadPromise;
51
- }
52
- async function cleanup() {
53
- await StaticWorker.destroyPool();
54
- const state = getLoadState();
55
- state.loadPromise = null;
56
- state.loadedOptions = null;
57
- state.fullConfigLoaded = false;
58
- state.fullConfigLoadPromise = null;
59
- }
60
- export { cleanup, ensureFullConfigLoaded, getLoadPromise, getTamaguiOptions, loadTamaguiBuildConfig };
178
+
179
+ export { TAMAGUI_EVALUATION_ENVIRONMENT, createViteTamaguiLoader };
61
180
  //# sourceMappingURL=loadTamagui.mjs.map
@@ -1 +1 @@
1
- {"version":3,"names":["StaticWorker","LOAD_STATE_KEY","getLoadState","globalThis","loadPromise","loadedOptions","fullConfigLoaded","fullConfigLoadPromise","getTamaguiOptions","getLoadPromise","loadTamaguiBuildConfig","optionsIn","state","options","platform","ensureFullConfigLoaded","disableWatchTamaguiConfig","disable","loadTamagui","components","cleanup","destroyPool"],"sources":["../../src/loadTamagui.ts"],"sourcesContent":[null],"mappings":"AAAA,YAAYA,YAAA,MAAkB;AAI9B,MAAMC,cAAA,GAAiB;AASvB,SAASC,aAAA,EAA0B;EACjC,IAAI,CAAEC,UAAA,CAAmBF,cAAc,GAAG;IACxC;IAAEE,UAAA,CAAmBF,cAAc,IAAI;MACrCG,WAAA,EAAa;MACbC,aAAA,EAAe;MACfC,gBAAA,EAAkB;MAClBC,qBAAA,EAAuB;IACzB;EACF;EACA,OAAQJ,UAAA,CAAmBF,cAAc;AAC3C;AAEO,SAASO,kBAAA,EAA2C;EACzD,OAAON,YAAA,CAAa,EAAEG,aAAA;AACxB;AAEO,SAASI,eAAA,EAAiD;EAC/D,OAAOP,YAAA,CAAa,EAAEE,WAAA;AACxB;AAMA,eAAsBM,uBACpBC,SAAA,EACyB;EACzB,MAAMC,KAAA,GAAQV,YAAA,CAAa;EAC3B,IAAIU,KAAA,CAAMP,aAAA,EAAe,OAAOO,KAAA,CAAMP,aAAA;EACtC,IAAIO,KAAA,CAAMR,WAAA,EAAa,OAAOQ,KAAA,CAAMR,WAAA;EAEpCQ,KAAA,CAAMR,WAAA,IAAe,YAAY;IAC/B,MAAMS,OAAA,GAAU,MAAMb,YAAA,CAAaU,sBAAA,CAAuB;MACxD,GAAGC,SAAA;MACHG,QAAA,EAAU;IACZ,CAAC;IAEDF,KAAA,CAAMP,aAAA,GAAgBQ,OAAA;IACtB,OAAOA,OAAA;EACT,GAAG;EAEH,OAAOD,KAAA,CAAMR,WAAA;AACf;AAMA,eAAsBW,uBAAA,EAAwC;EAC5D,MAAMH,KAAA,GAAQV,YAAA,CAAa;EAE3B,IAAIU,KAAA,CAAMN,gBAAA,EAAkB;EAC5B,IAAIM,KAAA,CAAML,qBAAA,EAAuB,OAAOK,KAAA,CAAML,qBAAA;EAI9CK,KAAA,CAAML,qBAAA,IAAyB,YAAY;IACzC,MAAMM,OAAA,GAAU,MAAMH,sBAAA,CAAuB;IAG7C,IAAI,CAACG,OAAA,CAAQG,yBAAA,IAA6B,CAACH,OAAA,CAAQI,OAAA,EAAS;MAC1D,MAAMjB,YAAA,CAAakB,WAAA,CAAY;QAC7BC,UAAA,EAAY,CAAC,SAAS;QACtBL,QAAA,EAAU;QACV,GAAGD;MACL,CAAC;IACH;IACAD,KAAA,CAAMN,gBAAA,GAAmB;EAC3B,GAAG;EAEH,OAAOM,KAAA,CAAML,qBAAA;AACf;AAEA,eAAsBa,QAAA,EAAU;EAC9B,MAAMpB,YAAA,CAAaqB,WAAA,CAAY;EAC/B,MAAMT,KAAA,GAAQV,YAAA,CAAa;EAC3BU,KAAA,CAAMR,WAAA,GAAc;EACpBQ,KAAA,CAAMP,aAAA,GAAgB;EACtBO,KAAA,CAAMN,gBAAA,GAAmB;EACzBM,KAAA,CAAML,qBAAA,GAAwB;AAChC","ignoreList":[]}
1
+ {"version":3,"file":"loadTamagui.js","names":[],"sources":["esm/loadTamagui.js"],"sourcesContent":["import Static from \"@tamagui/static\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nconst TAMAGUI_EVALUATION_ENVIRONMENT = \"tamagui\";\nconst requireFromLoader = createRequire(\n typeof __filename === \"string\" ? __filename : import.meta.url\n);\nconst vitePluginVersions = [\n `@tamagui/vite-plugin@${requireFromLoader(\"@tamagui/vite-plugin/package.json\").version}`\n];\nfunction createViteTamaguiLoader(optionsIn = {}) {\n let environment = null;\n let ownsEnvironment = false;\n let loadPromise = null;\n let loadedOptions = null;\n let projectPromise = null;\n const evaluationDependencies = /* @__PURE__ */ new Set();\n const stampSources = /* @__PURE__ */ new Set();\n let generation = 0;\n const normalizeDependency = (id) => id.split(\"?\")[0];\n const captureEvaluationDependencies = (modules) => {\n stampSources.clear();\n for (const { id } of modules) {\n const dependency = normalizeDependency(id);\n if (path.isAbsolute(dependency)) {\n evaluationDependencies.add(dependency);\n stampSources.add(dependency);\n }\n }\n if (environment) {\n for (const module of environment.runner.evaluatedModules.urlToIdModuleMap.values()) {\n const dependency = normalizeDependency(module.file);\n if (!path.isAbsolute(dependency)) continue;\n stampSources.add(dependency);\n if (!dependency.includes(\"/node_modules/\")) {\n evaluationDependencies.add(dependency);\n }\n }\n }\n };\n const loadTamaguiBuildConfig = async () => {\n if (loadedOptions) return loadedOptions;\n if (loadPromise) return loadPromise;\n loadPromise = Static.loadTamaguiBuildConfigAsync({\n ...optionsIn,\n platform: \"web\"\n }).then((options) => {\n loadedOptions = options;\n return options;\n });\n return loadPromise;\n };\n const resolveAndImport = async (moduleName, root, kind) => {\n if (!environment) {\n throw new Error(\n `The Tamagui Vite evaluation environment is not ready. Config and component evaluation requires Vite's ModuleRunner.`\n );\n }\n const source = path.isAbsolute(moduleName) ? moduleName : kind === \"config\" || moduleName.startsWith(\".\") ? path.resolve(root, moduleName) : moduleName;\n let environmentResolution = await environment.pluginContainer.resolveId(source);\n if (!environmentResolution && kind === \"config\" && source !== moduleName) {\n environmentResolution = await environment.pluginContainer.resolveId(moduleName);\n }\n const resolvedId = environmentResolution?.id;\n if (!resolvedId) {\n throw new Error(\n `Unable to resolve ${moduleName} in the Tamagui Vite environment (plugins: ${environment.plugins.map((plugin) => plugin.name).join(\", \")})`\n );\n }\n return {\n moduleName,\n id: resolvedId,\n module: await environment.runner.import(resolvedId)\n };\n };\n const evaluateProjectModules = async (options) => {\n if (!environment) {\n throw new Error(\n `Cannot evaluate Tamagui without the ${TAMAGUI_EVALUATION_ENVIRONMENT} Vite environment`\n );\n }\n const root = environment.config.root;\n const config = await resolveAndImport(\n options.config || \"tamagui.config.ts\",\n root,\n \"config\"\n );\n const components = await Promise.all(\n (options.components || []).map((name) => resolveAndImport(name, root, \"component\"))\n );\n captureEvaluationDependencies([config, ...components]);\n return { config, components };\n };\n const loadProject = async (options) => {\n if (projectPromise) return projectPromise;\n projectPromise = (async () => {\n if (!environment) {\n throw new Error(\n `Cannot load Tamagui without the ${TAMAGUI_EVALUATION_ENVIRONMENT} Vite environment`\n );\n }\n let evaluated = null;\n return Static.loadCompilerProject({\n root: environment.config.root,\n target: \"web\",\n options,\n generation: `vite:${generation}`,\n hostVersions: vitePluginVersions,\n async load(normalizedOptions) {\n evaluated = await evaluateProjectModules(normalizedOptions);\n return Static.loadTamaguiFromModules(normalizedOptions, {\n config: evaluated.config.module,\n components: evaluated.components.map(({ moduleName, module }) => ({\n moduleName,\n module\n })),\n stampSources: [...stampSources]\n });\n },\n async resolveComponents(moduleNames) {\n if (!evaluated) {\n throw new Error(\"The Tamagui compiler project modules were not evaluated\");\n }\n const byName = new Map(\n evaluated.components.map(({ moduleName, id }) => [moduleName, id])\n );\n return moduleNames.map((moduleName) => {\n const id = byName.get(moduleName);\n if (!id) throw new Error(`Unable to resolve compiler component ${moduleName}`);\n return { moduleName, id };\n });\n }\n });\n })();\n return projectPromise;\n };\n return {\n getEnvironment: () => environment,\n getGeneration: () => generation,\n getLoadPromise: () => loadPromise,\n getTamaguiOptions: () => loadedOptions,\n async getTamaguiConfig() {\n const options = await loadTamaguiBuildConfig();\n if (options.disable) return null;\n return (await loadProject(options)).projectInfo.tamaguiConfig;\n },\n async getCompilerProject() {\n const options = await loadTamaguiBuildConfig();\n return loadProject(options);\n },\n getEvaluationDependencies: () => [...evaluationDependencies],\n isEvaluationDependency: (id) => evaluationDependencies.has(normalizeDependency(id)),\n evaluateProjectModules,\n loadTamaguiBuildConfig,\n setEnvironment(next, options) {\n if (environment === next) return;\n environment = next;\n ownsEnvironment = options?.owned === true;\n generation++;\n projectPromise = null;\n },\n invalidate(file) {\n if (file && environment) {\n environment.runner.clearCache();\n }\n generation++;\n projectPromise = null;\n },\n async ensureFullConfigLoaded() {\n const options = await loadTamaguiBuildConfig();\n if (!options.disable) {\n await loadProject(options);\n }\n return [...evaluationDependencies];\n },\n async cleanup() {\n try {\n if (ownsEnvironment && environment) {\n await environment.close();\n }\n } finally {\n environment = null;\n ownsEnvironment = false;\n loadPromise = null;\n loadedOptions = null;\n projectPromise = null;\n }\n }\n };\n}\nexport {\n TAMAGUI_EVALUATION_ENVIRONMENT,\n createViteTamaguiLoader\n};\n//# sourceMappingURL=loadTamagui.js.map\n"],"mappings":";;;;;AAGA,MAAM,iCAAiC;AACvC,MAAM,oBAAoB,cACxB,OAAO,eAAe,WAAW,aAAa,OAAO,KAAK,GAC5D;AACA,MAAM,qBAAqB,CACzB,wBAAwB,kBAAkB,mCAAmC,EAAE,SACjF;AACA,SAAS,wBAAwB,YAAY,CAAC,GAAG;CAC/C,IAAI,cAAc;CAClB,IAAI,kBAAkB;CACtB,IAAI,cAAc;CAClB,IAAI,gBAAgB;CACpB,IAAI,iBAAiB;CACrB,MAAM,yCAAyC,IAAI,IAAI;CACvD,MAAM,+BAA+B,IAAI,IAAI;CAC7C,IAAI,aAAa;CACjB,MAAM,uBAAuB,OAAO,GAAG,MAAM,GAAG,EAAE;CAClD,MAAM,iCAAiC,YAAY;EACjD,aAAa,MAAM;EACnB,KAAK,MAAM,EAAE,QAAQ,SAAS;GAC5B,MAAM,aAAa,oBAAoB,EAAE;GACzC,IAAI,KAAK,WAAW,UAAU,GAAG;IAC/B,uBAAuB,IAAI,UAAU;IACrC,aAAa,IAAI,UAAU;GAC7B;EACF;EACA,IAAI,aAAa;GACf,KAAK,MAAM,UAAU,YAAY,OAAO,iBAAiB,iBAAiB,OAAO,GAAG;IAClF,MAAM,aAAa,oBAAoB,OAAO,IAAI;IAClD,IAAI,CAAC,KAAK,WAAW,UAAU,GAAG;IAClC,aAAa,IAAI,UAAU;IAC3B,IAAI,CAAC,WAAW,SAAS,gBAAgB,GAAG;KAC1C,uBAAuB,IAAI,UAAU;IACvC;GACF;EACF;CACF;CACA,MAAM,yBAAyB,YAAY;EACzC,IAAI,eAAe,OAAO;EAC1B,IAAI,aAAa,OAAO;EACxB,cAAc,OAAO,4BAA4B;GAC/C,GAAG;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