@powerlines/plugin-tamagui 0.1.280 → 0.1.282

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/index.cjs CHANGED
@@ -7,8 +7,7 @@ let __tamagui_static_worker = require("@tamagui/static-worker");
7
7
  __tamagui_static_worker = require_rolldown_runtime.__toESM(__tamagui_static_worker);
8
8
  let defu = require("defu");
9
9
  defu = require_rolldown_runtime.__toESM(defu);
10
- let powerlines_plugin_utils_get_config_path = require("powerlines/plugin-utils/get-config-path");
11
- let powerlines_plugin_utils_paths = require("powerlines/plugin-utils/paths");
10
+ let powerlines_plugin_utils = require("powerlines/plugin-utils");
12
11
  let vite = require("vite");
13
12
 
14
13
  //#region src/index.ts
@@ -30,10 +29,10 @@ const plugin = (options = {}) => {
30
29
  return {
31
30
  name: "tamagui",
32
31
  async config() {
33
- const configPath = (0, powerlines_plugin_utils_get_config_path.getConfigPath)(this, "tamagui");
32
+ const configPath = (0, powerlines_plugin_utils.getConfigPath)(this, "tamagui");
34
33
  const tamaguiOptions = await (0, __tamagui_static_worker.loadTamaguiBuildConfig)((0, defu.default)({
35
34
  ...options,
36
- components: [(0, __stryke_path_join.joinPaths)("{projectRoot}", "src/components")]
35
+ components: [(0, __stryke_path_join.joinPaths)("{root}", "src/components")]
37
36
  }, {
38
37
  config: configPath,
39
38
  disableExtraction: false,
@@ -124,11 +123,11 @@ const plugin = (options = {}) => {
124
123
  },
125
124
  configResolved() {
126
125
  if (!this.config.tamagui.components || this.config.tamagui.components.length === 0) throw new Error(`Tamagui Plugin: No components paths defined in Tamagui configuration. Please ensure that the 'components' option is set correctly.`);
127
- this.config.tamagui.components = this.config.tamagui.components.map((path) => (0, powerlines_plugin_utils_paths.replacePathTokens)(this, path)).filter(Boolean);
128
- if (this.config.build.variant === "vite") {
129
- this.config.build.optimizeDeps ??= {};
130
- this.config.build.optimizeDeps.include ??= [];
131
- this.config.build.optimizeDeps.include.push("@tamagui/core/inject-styles");
126
+ this.config.tamagui.components = this.config.tamagui.components.map((path) => (0, powerlines_plugin_utils.replacePathTokens)(this, path)).filter(Boolean);
127
+ if (this.config.vite) {
128
+ this.config.vite.optimizeDeps ??= {};
129
+ this.config.vite.optimizeDeps.include ??= [];
130
+ this.config.vite.optimizeDeps.include.push("@tamagui/core/inject-styles");
132
131
  }
133
132
  },
134
133
  async resolveId(id) {
@@ -137,7 +136,7 @@ const plugin = (options = {}) => {
137
136
  const [validId, query] = id.split("?");
138
137
  if (!validId?.endsWith(".tamagui.css")) return;
139
138
  let absoluteId = id;
140
- if (!id.startsWith(this.config.projectRoot)) absoluteId = (0, __stryke_path_join.joinPaths)(this.config.projectRoot, validId);
139
+ if (!id.startsWith(this.config.root)) absoluteId = (0, __stryke_path_join.joinPaths)(this.config.root, validId);
141
140
  if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
142
141
  return null;
143
142
  },
@@ -189,7 +188,7 @@ const plugin = (options = {}) => {
189
188
  if (!extracted) return;
190
189
  const rootRelativeId = `${validId}.tamagui.css`;
191
190
  let absoluteId = rootRelativeId;
192
- if (!absoluteId.startsWith(this.config.projectRoot)) absoluteId = (0, __stryke_path_join.joinPaths)(this.config.projectRoot, rootRelativeId);
191
+ if (!absoluteId.startsWith(this.config.root)) absoluteId = (0, __stryke_path_join.joinPaths)(this.config.root, rootRelativeId);
193
192
  let source = extracted.js;
194
193
  if (extracted.styles) {
195
194
  this.addWatchFile(rootRelativeId);
package/dist/index.d.cts CHANGED
@@ -1,9 +1,13 @@
1
1
  import { TamaguiPluginContext, TamaguiPluginOptions, TamaguiPluginResolvedConfig, TamaguiPluginUserConfig, __ΩTamaguiPluginContext, __ΩTamaguiPluginOptions, __ΩTamaguiPluginResolvedConfig, __ΩTamaguiPluginUserConfig } from "./types/plugin.cjs";
2
2
  import "./types/index.cjs";
3
- import { Plugin } from "powerlines/types/plugin";
3
+ import { Plugin } from "powerlines";
4
4
 
5
5
  //#region src/index.d.ts
6
-
6
+ declare module "powerlines" {
7
+ interface UserConfig {
8
+ tamagui?: TamaguiPluginOptions;
9
+ }
10
+ }
7
11
  /**
8
12
  * Tamagui plugin for Powerlines.
9
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAkCwB,OAAA,CAAA,EAIV,oBAJU;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
package/dist/index.d.mts CHANGED
@@ -1,9 +1,13 @@
1
1
  import { TamaguiPluginContext, TamaguiPluginOptions, TamaguiPluginResolvedConfig, TamaguiPluginUserConfig, __ΩTamaguiPluginContext, __ΩTamaguiPluginOptions, __ΩTamaguiPluginResolvedConfig, __ΩTamaguiPluginUserConfig } from "./types/plugin.mjs";
2
2
  import "./types/index.mjs";
3
- import { Plugin } from "powerlines/types/plugin";
3
+ import { Plugin } from "powerlines";
4
4
 
5
5
  //#region src/index.d.ts
6
-
6
+ declare module "powerlines" {
7
+ interface UserConfig {
8
+ tamagui?: TamaguiPluginOptions;
9
+ }
10
+ }
7
11
  /**
8
12
  * Tamagui plugin for Powerlines.
9
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;AA+CA;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;IAkCwB,OAAA,CAAA,EAIV,oBAJU;EAAA;;;;AAcxB;;;;AAIU,cAJG,MAIH,EAAA,CAAA,iBAHS,oBAGT,GAHgC,oBAGhC,CAAA,CAAA,OAAA,CAAA,EADC,oBACD,EAAA,GAAP,MAAO,CAAA,QAAA,CAAA"}
package/dist/index.mjs CHANGED
@@ -4,8 +4,7 @@ import { joinPaths } from "@stryke/path/join";
4
4
  import * as Static from "@tamagui/static-worker";
5
5
  import { getPragmaOptions, loadTamaguiBuildConfig } from "@tamagui/static-worker";
6
6
  import defu from "defu";
7
- import { getConfigPath } from "powerlines/plugin-utils/get-config-path";
8
- import { replacePathTokens } from "powerlines/plugin-utils/paths";
7
+ import { getConfigPath, replacePathTokens } from "powerlines/plugin-utils";
9
8
  import { transformWithEsbuild } from "vite";
10
9
 
11
10
  //#region src/index.ts
@@ -30,7 +29,7 @@ const plugin = (options = {}) => {
30
29
  const configPath = getConfigPath(this, "tamagui");
31
30
  const tamaguiOptions = await loadTamaguiBuildConfig(defu({
32
31
  ...options,
33
- components: [joinPaths("{projectRoot}", "src/components")]
32
+ components: [joinPaths("{root}", "src/components")]
34
33
  }, {
35
34
  config: configPath,
36
35
  disableExtraction: false,
@@ -122,10 +121,10 @@ const plugin = (options = {}) => {
122
121
  configResolved() {
123
122
  if (!this.config.tamagui.components || this.config.tamagui.components.length === 0) throw new Error(`Tamagui Plugin: No components paths defined in Tamagui configuration. Please ensure that the 'components' option is set correctly.`);
124
123
  this.config.tamagui.components = this.config.tamagui.components.map((path) => replacePathTokens(this, path)).filter(Boolean);
125
- if (this.config.build.variant === "vite") {
126
- this.config.build.optimizeDeps ??= {};
127
- this.config.build.optimizeDeps.include ??= [];
128
- this.config.build.optimizeDeps.include.push("@tamagui/core/inject-styles");
124
+ if (this.config.vite) {
125
+ this.config.vite.optimizeDeps ??= {};
126
+ this.config.vite.optimizeDeps.include ??= [];
127
+ this.config.vite.optimizeDeps.include.push("@tamagui/core/inject-styles");
129
128
  }
130
129
  },
131
130
  async resolveId(id) {
@@ -134,7 +133,7 @@ const plugin = (options = {}) => {
134
133
  const [validId, query] = id.split("?");
135
134
  if (!validId?.endsWith(".tamagui.css")) return;
136
135
  let absoluteId = id;
137
- if (!id.startsWith(this.config.projectRoot)) absoluteId = joinPaths(this.config.projectRoot, validId);
136
+ if (!id.startsWith(this.config.root)) absoluteId = joinPaths(this.config.root, validId);
138
137
  if (cssMap.has(absoluteId)) return absoluteId + (query ? `?${query}` : "");
139
138
  return null;
140
139
  },
@@ -186,7 +185,7 @@ const plugin = (options = {}) => {
186
185
  if (!extracted) return;
187
186
  const rootRelativeId = `${validId}.tamagui.css`;
188
187
  let absoluteId = rootRelativeId;
189
- if (!absoluteId.startsWith(this.config.projectRoot)) absoluteId = joinPaths(this.config.projectRoot, rootRelativeId);
188
+ if (!absoluteId.startsWith(this.config.root)) absoluteId = joinPaths(this.config.root, rootRelativeId);
190
189
  let source = extracted.js;
191
190
  if (extracted.styles) {
192
191
  this.addWatchFile(rootRelativeId);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["server: ViteDevServer | null","alias: BuildResolvedConfig[\"alias\"]","extracted: ExtractedResponse | null"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { murmurhash } from \"@stryke/hash/neutral\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { ExtractedResponse, TamaguiOptions } from \"@tamagui/static-worker\";\nimport * as Static from \"@tamagui/static-worker\";\nimport {\n getPragmaOptions,\n loadTamaguiBuildConfig\n} from \"@tamagui/static-worker\";\nimport defu from \"defu\";\nimport { getConfigPath } from \"powerlines/plugin-utils/get-config-path\";\nimport { replacePathTokens } from \"powerlines/plugin-utils/paths\";\nimport {\n BuildResolvedConfig,\n ViteResolvedBuildConfig\n} from \"powerlines/types/build\";\nimport { EnvironmentConfig } from \"powerlines/types/config\";\nimport { Plugin } from \"powerlines/types/plugin\";\nimport { transformWithEsbuild, ViteDevServer } from \"vite\";\nimport { TamaguiPluginContext, TamaguiPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\n/**\n * Tamagui plugin for Powerlines.\n *\n * @param options - The Tamagui plugin user configuration options.\n * @returns A Powerlines plugin that integrates Tamagui into an existing Powerlines project.\n */\nexport const plugin = <\n TContext extends TamaguiPluginContext = TamaguiPluginContext\n>(\n options: TamaguiPluginOptions = {}\n): Plugin<TContext> => {\n let memoryCache = {} as Record<string, { code: string; map?: any }>;\n let cacheSize = 0;\n\n const clearCompilerCache = () => {\n memoryCache = {};\n cacheSize = 0;\n };\n\n const cssMap = new Map<string, string>();\n let server: ViteDevServer | null = null;\n\n return {\n name: \"tamagui\",\n async config() {\n const configPath = getConfigPath(this, \"tamagui\");\n\n const tamaguiOptions = await loadTamaguiBuildConfig(\n defu(\n {\n ...options,\n components: [joinPaths(\"{projectRoot}\", \"src/components\")]\n },\n {\n config: configPath,\n disableExtraction: false,\n platform: \"web\" as const,\n logTimings:\n this.config.logLevel === \"debug\" ||\n this.config.logLevel === \"trace\",\n prefixLogs: \"Powerlines\"\n } as Partial<TamaguiOptions>\n )\n );\n\n const alias: BuildResolvedConfig[\"alias\"] = [];\n if (tamaguiOptions.platform !== \"native\") {\n alias.push({\n find: \"react-native/Libraries/Renderer/shims/ReactFabric\",\n replacement:\n (await resolvePackage(\"@tamagui/proxy-worm\")) ||\n \"@tamagui/proxy-worm\"\n });\n\n alias.push({\n find: \"react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry\",\n replacement:\n (await resolvePackage(\"@tamagui/proxy-worm\")) ||\n \"@tamagui/proxy-worm\"\n });\n alias.push({\n find: \"react-native-svg\",\n replacement:\n (await resolvePackage(\"react-native-svg\")) || \"react-native-svg\"\n });\n\n if (tamaguiOptions?.useReactNativeWebLite) {\n alias.push({\n find: \"react-native\",\n replacement:\n (await resolvePackage(\"react-native-web-lite\")) ||\n \"react-native-web-lite\"\n });\n\n const reactNativeWebLite =\n (await resolvePackage(\n tamaguiOptions?.useReactNativeWebLite === \"without-animated\"\n ? \"@tamagui/react-native-web-lite/without-animated\"\n : \"@tamagui/react-native-web-lite\"\n )) || tamaguiOptions?.useReactNativeWebLite === \"without-animated\"\n ? \"@tamagui/react-native-web-lite/without-animated\"\n : \"@tamagui/react-native-web-lite\";\n alias.push({\n find: /^react-native$/,\n replacement: reactNativeWebLite\n });\n\n alias.push({\n find: /^react-native\\/(.+)$/,\n replacement: `${reactNativeWebLite}/$1`\n });\n alias.push({\n find: /^react-native-web$/,\n replacement: reactNativeWebLite\n });\n alias.push({\n find: /^react-native-web\\/(.+)$/,\n replacement: `${reactNativeWebLite}/$1`\n });\n\n alias.push({\n find: /react-native.*\\/dist\\/exports\\/StyleSheet\\/compiler\\/createReactDOMStyle/,\n replacement:\n (await resolvePackage(\n \"@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle\"\n )) ||\n \"@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle\"\n });\n }\n }\n\n return {\n tamagui: tamaguiOptions,\n build: {\n platform: \"browser\",\n extensions: [\n `.web.mjs`,\n `.web.js`,\n `.web.jsx`,\n `.web.ts`,\n `.web.tsx`,\n \".mjs\",\n \".js\",\n \".mts\",\n \".ts\",\n \".jsx\",\n \".tsx\",\n \".json\"\n ],\n define: {\n _frameTimestamp: undefined,\n _WORKLET: false,\n __DEV__: `${this.config.mode === \"development\"}`,\n \"process.env.NODE_ENV\": JSON.stringify(\n process.env.NODE_ENV || this.config.mode\n ),\n \"process.env.ENABLE_RSC\": JSON.stringify(\n process.env.ENABLE_RSC || \"\"\n ),\n \"process.env.ENABLE_STEPS\": JSON.stringify(\n process.env.ENABLE_STEPS || \"\"\n ),\n \"process.env.IS_STATIC\": JSON.stringify(false),\n ...(this.config.mode === \"production\" && {\n \"process.env.TAMAGUI_OPTIMIZE_THEMES\": JSON.stringify(true)\n })\n },\n alias\n }\n };\n },\n configEnvironment(name: string, environment: EnvironmentConfig) {\n if (environment.consumer === \"client\" || name === \"client\") {\n return {\n build: {\n define: {\n \"process.env.TAMAGUI_IS_CLIENT\": JSON.stringify(true),\n \"process.env.TAMAGUI_ENVIRONMENT\": '\"client\"'\n }\n }\n };\n }\n\n return null;\n },\n configResolved() {\n if (\n !this.config.tamagui.components ||\n this.config.tamagui.components.length === 0\n ) {\n throw new Error(\n `Tamagui Plugin: No components paths defined in Tamagui configuration. Please ensure that the 'components' option is set correctly.`\n );\n }\n\n this.config.tamagui.components = this.config.tamagui.components\n .map(path => replacePathTokens(this, path))\n .filter(Boolean);\n\n if (this.config.build.variant === \"vite\") {\n (this.config.build as ViteResolvedBuildConfig).optimizeDeps ??= {};\n (this.config.build as ViteResolvedBuildConfig).optimizeDeps!.include ??=\n [];\n (\n this.config.build as ViteResolvedBuildConfig\n ).optimizeDeps!.include!.push(\"@tamagui/core/inject-styles\");\n }\n },\n async resolveId(id: string) {\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" || this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n const [validId, query] = id.split(\"?\");\n if (!validId?.endsWith(\".tamagui.css\")) {\n return;\n }\n\n // Absolute paths seem to occur often in monorepos, where files are\n // imported from outside the config root.\n let absoluteId = id;\n if (!id.startsWith(this.config.projectRoot)) {\n absoluteId = joinPaths(this.config.projectRoot, validId);\n }\n\n // There should always be an entry in the `cssMap` here.\n // The only valid scenario for a missing one is if someone had written\n // a file in their app using the .tamagui.js/.tamagui.css extension\n if (cssMap.has(absoluteId)) {\n // Keep the original query string for HMR.\n return absoluteId + (query ? `?${query}` : \"\");\n }\n\n return null;\n },\n async load(id) {\n if (this.config?.tamagui?.disableExtraction) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" || this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n return;\n }\n\n const [validId] = id.split(\"?\");\n\n return validId ? cssMap.get(validId) : null;\n },\n transform: {\n order: \"pre\",\n async handler(code, id) {\n if (id.includes(\"expo-linear-gradient\")) {\n return transformWithEsbuild(code, id, {\n loader: \"jsx\",\n jsx: \"automatic\"\n });\n }\n\n if (this.config?.tamagui?.disableExtraction) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" ||\n this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n return;\n }\n\n const [validId] = id.split(\"?\");\n if (!validId?.endsWith(\".tsx\")) {\n return;\n }\n\n const firstCommentIndex = code.indexOf(\"// \");\n const { shouldDisable, shouldPrintDebug } = await getPragmaOptions({\n source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : \"\",\n path: validId\n });\n\n if (shouldPrintDebug) {\n this.trace(\n `Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}\\n\\nOriginal source:\\n${code}\\n\\n`\n );\n }\n\n if (shouldDisable) {\n return;\n }\n\n const cacheKey = murmurhash({\n cacheEnv:\n this.environment.name === \"client\" ||\n this.environment.name === \"ssr\"\n ? // same cache key for ssr and web since they are the same\n \"web\"\n : this.environment.name,\n code,\n id\n });\n\n const cached = memoryCache[cacheKey];\n if (cached) {\n return cached;\n }\n\n let extracted: ExtractedResponse | null;\n try {\n extracted = await Static.extractToClassNames({\n source: code,\n sourcePath: validId,\n options: this.config.tamagui,\n shouldPrintDebug\n });\n } catch (err) {\n // Log the error but don't fail the build - just skip optimization\n this.error(err instanceof Error ? err.message : String(err));\n return;\n }\n\n if (!extracted) {\n return;\n }\n\n const rootRelativeId = `${validId}.tamagui.css`;\n\n let absoluteId = rootRelativeId;\n if (!absoluteId.startsWith(this.config.projectRoot)) {\n absoluteId = joinPaths(this.config.projectRoot, rootRelativeId);\n }\n\n let source = extracted.js;\n if (extracted.styles) {\n this.addWatchFile(rootRelativeId);\n\n if (server && cssMap.has(absoluteId)) {\n if (server) {\n const { moduleGraph } = server;\n const modules = moduleGraph.getModulesByFile(rootRelativeId);\n\n if (modules) {\n for (const module of modules) {\n moduleGraph.invalidateModule(module);\n\n // Vite uses this timestamp to add `?t=` query string automatically for HMR.\n module.lastHMRTimestamp =\n module.lastInvalidationTimestamp || Date.now();\n }\n }\n }\n }\n\n source = `${source.toString()}\\nimport \"${rootRelativeId}\";`;\n cssMap.set(absoluteId, extracted.styles);\n }\n\n const result = {\n code: source.toString(),\n map: extracted.map\n };\n\n cacheSize += result.code.length;\n // ~50Mb cache for recently compiler files\n if (cacheSize > 26214400) {\n clearCompilerCache();\n }\n\n memoryCache[cacheKey] = result;\n\n return result;\n }\n },\n async finalize() {\n // Only destroy the pool at the very end of the entire build\n await Static?.destroyPool();\n },\n vite: {\n configureServer(_server) {\n server = _server;\n }\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;;AA+CA,MAAa,UAGX,UAAgC,EAAE,KACb;CACrB,IAAI,cAAc,E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AO;;GAEV;EACD,MAAM,WAAW;AAEf,SAAM,QAAQ,aAAa;;EAE7B,MAAM,EACJ,gBAAgB,SAAS;AACvB,YAAS;KAEZ;EACF;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["server: ViteDevServer | null","alias: ResolveConfig[\"alias\"]","extracted: ExtractedResponse | null"],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { VitePluginResolvedConfig } from \"@powerlines/plugin-vite/types/plugin\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { murmurhash } from \"@stryke/hash/neutral\";\nimport { joinPaths } from \"@stryke/path/join\";\nimport type { ExtractedResponse, TamaguiOptions } from \"@tamagui/static-worker\";\nimport * as Static from \"@tamagui/static-worker\";\nimport {\n getPragmaOptions,\n loadTamaguiBuildConfig\n} from \"@tamagui/static-worker\";\nimport defu from \"defu\";\nimport { EnvironmentConfig, Plugin, ResolveConfig } from \"powerlines\";\nimport { getConfigPath, replacePathTokens } from \"powerlines/plugin-utils\";\nimport { transformWithEsbuild, ViteDevServer } from \"vite\";\nimport { TamaguiPluginContext, TamaguiPluginOptions } from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n export interface UserConfig {\n tamagui?: TamaguiPluginOptions;\n }\n}\n\n/**\n * Tamagui plugin for Powerlines.\n *\n * @param options - The Tamagui plugin user configuration options.\n * @returns A Powerlines plugin that integrates Tamagui into an existing Powerlines project.\n */\nexport const plugin = <\n TContext extends TamaguiPluginContext = TamaguiPluginContext\n>(\n options: TamaguiPluginOptions = {}\n): Plugin<TContext> => {\n let memoryCache = {} as Record<string, { code: string; map?: any }>;\n let cacheSize = 0;\n\n const clearCompilerCache = () => {\n memoryCache = {};\n cacheSize = 0;\n };\n\n const cssMap = new Map<string, string>();\n let server: ViteDevServer | null = null;\n\n return {\n name: \"tamagui\",\n async config() {\n const configPath = getConfigPath(this, \"tamagui\");\n\n const tamaguiOptions = await loadTamaguiBuildConfig(\n defu(\n {\n ...options,\n components: [joinPaths(\"{root}\", \"src/components\")]\n },\n {\n config: configPath,\n disableExtraction: false,\n platform: \"web\" as const,\n logTimings:\n this.config.logLevel === \"debug\" ||\n this.config.logLevel === \"trace\",\n prefixLogs: \"Powerlines\"\n } as Partial<TamaguiOptions>\n )\n );\n\n const alias: ResolveConfig[\"alias\"] = [];\n if (tamaguiOptions.platform !== \"native\") {\n alias.push({\n find: \"react-native/Libraries/Renderer/shims/ReactFabric\",\n replacement:\n (await resolvePackage(\"@tamagui/proxy-worm\")) ||\n \"@tamagui/proxy-worm\"\n });\n\n alias.push({\n find: \"react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry\",\n replacement:\n (await resolvePackage(\"@tamagui/proxy-worm\")) ||\n \"@tamagui/proxy-worm\"\n });\n alias.push({\n find: \"react-native-svg\",\n replacement:\n (await resolvePackage(\"react-native-svg\")) || \"react-native-svg\"\n });\n\n if (tamaguiOptions?.useReactNativeWebLite) {\n alias.push({\n find: \"react-native\",\n replacement:\n (await resolvePackage(\"react-native-web-lite\")) ||\n \"react-native-web-lite\"\n });\n\n const reactNativeWebLite =\n (await resolvePackage(\n tamaguiOptions?.useReactNativeWebLite === \"without-animated\"\n ? \"@tamagui/react-native-web-lite/without-animated\"\n : \"@tamagui/react-native-web-lite\"\n )) || tamaguiOptions?.useReactNativeWebLite === \"without-animated\"\n ? \"@tamagui/react-native-web-lite/without-animated\"\n : \"@tamagui/react-native-web-lite\";\n alias.push({\n find: /^react-native$/,\n replacement: reactNativeWebLite\n });\n\n alias.push({\n find: /^react-native\\/(.+)$/,\n replacement: `${reactNativeWebLite}/$1`\n });\n alias.push({\n find: /^react-native-web$/,\n replacement: reactNativeWebLite\n });\n alias.push({\n find: /^react-native-web\\/(.+)$/,\n replacement: `${reactNativeWebLite}/$1`\n });\n\n alias.push({\n find: /react-native.*\\/dist\\/exports\\/StyleSheet\\/compiler\\/createReactDOMStyle/,\n replacement:\n (await resolvePackage(\n \"@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle\"\n )) ||\n \"@tamagui/react-native-web-lite/dist/exports/StyleSheet/compiler/createReactDOMStyle\"\n });\n }\n }\n\n return {\n tamagui: tamaguiOptions,\n build: {\n platform: \"browser\",\n extensions: [\n `.web.mjs`,\n `.web.js`,\n `.web.jsx`,\n `.web.ts`,\n `.web.tsx`,\n \".mjs\",\n \".js\",\n \".mts\",\n \".ts\",\n \".jsx\",\n \".tsx\",\n \".json\"\n ],\n define: {\n _frameTimestamp: undefined,\n _WORKLET: false,\n __DEV__: `${this.config.mode === \"development\"}`,\n \"process.env.NODE_ENV\": JSON.stringify(\n process.env.NODE_ENV || this.config.mode\n ),\n \"process.env.ENABLE_RSC\": JSON.stringify(\n process.env.ENABLE_RSC || \"\"\n ),\n \"process.env.ENABLE_STEPS\": JSON.stringify(\n process.env.ENABLE_STEPS || \"\"\n ),\n \"process.env.IS_STATIC\": JSON.stringify(false),\n ...(this.config.mode === \"production\" && {\n \"process.env.TAMAGUI_OPTIMIZE_THEMES\": JSON.stringify(true)\n })\n },\n alias\n }\n };\n },\n configEnvironment(name: string, environment: EnvironmentConfig) {\n if (environment.consumer === \"client\" || name === \"client\") {\n return {\n build: {\n define: {\n \"process.env.TAMAGUI_IS_CLIENT\": JSON.stringify(true),\n \"process.env.TAMAGUI_ENVIRONMENT\": '\"client\"'\n }\n }\n };\n }\n\n return null;\n },\n configResolved() {\n if (\n !this.config.tamagui.components ||\n this.config.tamagui.components.length === 0\n ) {\n throw new Error(\n `Tamagui Plugin: No components paths defined in Tamagui configuration. Please ensure that the 'components' option is set correctly.`\n );\n }\n\n this.config.tamagui.components = this.config.tamagui.components\n .map(path => replacePathTokens(this, path))\n .filter(Boolean);\n\n if ((this.config as VitePluginResolvedConfig).vite) {\n (this.config as VitePluginResolvedConfig).vite.optimizeDeps ??= {};\n (this.config as VitePluginResolvedConfig).vite.optimizeDeps!.include ??=\n [];\n (\n this.config as VitePluginResolvedConfig\n ).vite.optimizeDeps!.include!.push(\"@tamagui/core/inject-styles\");\n }\n },\n async resolveId(id: string) {\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" || this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n const [validId, query] = id.split(\"?\");\n if (!validId?.endsWith(\".tamagui.css\")) {\n return;\n }\n\n // Absolute paths seem to occur often in monorepos, where files are\n // imported from outside the config root.\n let absoluteId = id;\n if (!id.startsWith(this.config.root)) {\n absoluteId = joinPaths(this.config.root, validId);\n }\n\n // There should always be an entry in the `cssMap` here.\n // The only valid scenario for a missing one is if someone had written\n // a file in their app using the .tamagui.js/.tamagui.css extension\n if (cssMap.has(absoluteId)) {\n // Keep the original query string for HMR.\n return absoluteId + (query ? `?${query}` : \"\");\n }\n\n return null;\n },\n async load(id) {\n if (this.config?.tamagui?.disableExtraction) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" || this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n return;\n }\n\n const [validId] = id.split(\"?\");\n\n return validId ? cssMap.get(validId) : null;\n },\n transform: {\n order: \"pre\",\n async handler(code, id) {\n if (id.includes(\"expo-linear-gradient\")) {\n return transformWithEsbuild(code, id, {\n loader: \"jsx\",\n jsx: \"automatic\"\n });\n }\n\n if (this.config?.tamagui?.disableExtraction) {\n // only optimize on client - server should produce identical styles anyway!\n return;\n }\n\n if (\n this.environment?.name &&\n (this.environment.name === \"ios\" ||\n this.environment.name === \"android\")\n ) {\n return;\n }\n\n if (\n this.config?.tamagui?.disableServerOptimization &&\n this.environment?.name &&\n this.environment.name !== \"client\"\n ) {\n return;\n }\n\n const [validId] = id.split(\"?\");\n if (!validId?.endsWith(\".tsx\")) {\n return;\n }\n\n const firstCommentIndex = code.indexOf(\"// \");\n const { shouldDisable, shouldPrintDebug } = await getPragmaOptions({\n source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : \"\",\n path: validId\n });\n\n if (shouldPrintDebug) {\n this.trace(\n `Current file: ${id} in environment: ${this.environment?.name}, shouldDisable: ${shouldDisable}\\n\\nOriginal source:\\n${code}\\n\\n`\n );\n }\n\n if (shouldDisable) {\n return;\n }\n\n const cacheKey = murmurhash({\n cacheEnv:\n this.environment.name === \"client\" ||\n this.environment.name === \"ssr\"\n ? // same cache key for ssr and web since they are the same\n \"web\"\n : this.environment.name,\n code,\n id\n });\n\n const cached = memoryCache[cacheKey];\n if (cached) {\n return cached;\n }\n\n let extracted: ExtractedResponse | null;\n try {\n extracted = await Static.extractToClassNames({\n source: code,\n sourcePath: validId,\n options: this.config.tamagui,\n shouldPrintDebug\n });\n } catch (err) {\n // Log the error but don't fail the build - just skip optimization\n this.error(err instanceof Error ? err.message : String(err));\n return;\n }\n\n if (!extracted) {\n return;\n }\n\n const rootRelativeId = `${validId}.tamagui.css`;\n\n let absoluteId = rootRelativeId;\n if (!absoluteId.startsWith(this.config.root)) {\n absoluteId = joinPaths(this.config.root, rootRelativeId);\n }\n\n let source = extracted.js;\n if (extracted.styles) {\n this.addWatchFile(rootRelativeId);\n\n if (server && cssMap.has(absoluteId)) {\n if (server) {\n const { moduleGraph } = server;\n const modules = moduleGraph.getModulesByFile(rootRelativeId);\n\n if (modules) {\n for (const module of modules) {\n moduleGraph.invalidateModule(module);\n\n // Vite uses this timestamp to add `?t=` query string automatically for HMR.\n module.lastHMRTimestamp =\n module.lastInvalidationTimestamp || Date.now();\n }\n }\n }\n }\n\n source = `${source.toString()}\\nimport \"${rootRelativeId}\";`;\n cssMap.set(absoluteId, extracted.styles);\n }\n\n const result = {\n code: source.toString(),\n map: extracted.map\n };\n\n cacheSize += result.code.length;\n // ~50Mb cache for recently compiler files\n if (cacheSize > 26214400) {\n clearCompilerCache();\n }\n\n memoryCache[cacheKey] = result;\n\n return result;\n }\n },\n async finalize() {\n // Only destroy the pool at the very end of the entire build\n await Static?.destroyPool();\n },\n vite: {\n configureServer(_server) {\n server = _server;\n }\n }\n } as Plugin<TContext>;\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;;AAgDA,MAAa,UAGX,UAAgC,EAAE,KACb;CACrB,IAAI,cAAc,EAAE;CACpB,IAAI,YAAY;CAEhB,MAAM,2BAA2B;AAC/B,gBAAc,EAAE;AAChB,cAAY;;CAGd,MAAM,yBAAS,IAAI,KAAqB;CACxC,IAAIA,SAA+B;AAEnC,QAAO;EACL,MAAM;EACN,MAAM,SAAS;GACb,MAAM,aAAa,cAAc,MAAM,UAAU;GAEjD,MAAM,iBAAiB,MAAM,uBAC3B,KACE;IACE,GAAG;IACH,YAAY,CAAC,UAAU,UAAU,iBAAiB,CAAC;IACpD,EACD;IACE,QAAQ;IACR,mBAAmB;IACnB,UAAU;IACV,YACE,KAAK,OAAO,aAAa,WACzB,KAAK,OAAO,aAAa;IAC3B,YAAY;IACb,CACF,CACF;GAED,MAAMC,QAAgC,EAAE;AACxC,OAAI,eAAe,aAAa,UAAU;AACxC,UAAM,KAAK;KACT,MAAM;KACN,aACG,MAAM,eAAe,sBAAsB,IAC5C;KACH,CAAC;AAEF,UAAM,KAAK;KACT,MAAM;KACN,aACG,MAAM,eAAe,sBAAsB,IAC5C;KACH,CAAC;AACF,UAAM,KAAK;KACT,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;IAG1D,IAAI,SAAS,UAAU;AACvB,QAAI,UAAU,QAAQ;AACpB,UAAK,aAAa,eAAe;AAEjC,SAAI,UAAU,OAAO,IAAI,WAAW,EAClC;UAAI,QAAQ;OACV,MAAM,EAAE,gBAAgB;OACxB,MAAM,UAAU,YAAY,iBAAiB,eAAe;AAE5D,WAAI,QACF,MAAK,MAAM,UAAU,SAAS;AAC5B,oBAAY,iBAAiB,OAAO;AAGpC,eAAO,mBACL,OAAO,6BAA6B,KAAK,KAAK;;;;AAMxD,cAAS,GAAG,OAAO,UAAU,CAAC,YAAY,eAAe;AACzD,YAAO,IAAI,YAAY,UAAU,OAAO;;IAG1C,MAAM,SAAS;KACb,MAAM,OAAO,UAAU;KACvB,KAAK,UAAU;KAChB;AAED,iBAAa,OAAO,KAAK;AAEzB,QAAI,YAAY,SACd,qBAAoB;AAGtB,gBAAY,YAAY;AAExB,WAAO;;GAEV;EACD,MAAM,WAAW;AAEf,SAAM,QAAQ,aAAa;;EAE7B,MAAM,EACJ,gBAAgB,SAAS;AACvB,YAAS;KAEZ;EACF;;AAGH,kBAAe"}
@@ -1,7 +1,5 @@
1
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
1
2
  import { TamaguiOptions } from "@tamagui/types";
2
- import { UserConfig } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { ResolvedConfig } from "powerlines/types/resolved";
5
3
 
6
4
  //#region src/types/plugin.d.ts
7
5
  type TamaguiPluginOptions = Partial<TamaguiOptions> & {
@@ -17,7 +15,7 @@ type TamaguiPluginOptions = Partial<TamaguiOptions> & {
17
15
  * @remarks
18
16
  * These paths can include glob patterns to match multiple files or directories and placeholder tokens (the `replacePathTokens` function will be applied to allow for dynamic path resolution).
19
17
  *
20
- * @defaultValue ["\{sourceRoot\}/components"]
18
+ * @defaultValue ["\{root\}/src/components"]
21
19
  */
22
20
  components?: string[];
23
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,QAAQ;;AAA3C;AAmBA;AAIA;;EAC0C,QAAA,CAAA,EAAA,KAAA,GAAA,QAAA;EAAL;;;;AAGrC;;;;EAGI,UAAA,CAAA,EAAA,MAAA,EAAA;CAAa;UAXA,uBAAA,SAAgC;WACtC;;UAGM,2BAAA,SAAoC;WAC1C,iBAAiB,SAAS,KAAK;;KAG9B,6CAER,8BAA8B,+BAC9B,cAAc"}
1
+ {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,oBAAA,GAAuB,QAAQ;;AAA3C;AAmBA;AAIA;;EAC0C,QAAA,CAAA,EAAA,KAAA,GAAA,QAAA;EAAL;;;;AAGrC;;;;EAGI,UAAA,CAAA,EAAA,MAAA,EAAA;CAAa;UAXA,uBAAA,SAAgC;WACtC;;UAGM,2BAAA,SAAoC;WAC1C,iBAAiB,SAAS,KAAK;;KAG9B,6CACc,8BACtB,+BACA,cAAc"}
@@ -1,7 +1,5 @@
1
+ import { PluginContext, ResolvedConfig, UserConfig } from "powerlines";
1
2
  import { TamaguiOptions } from "@tamagui/types";
2
- import { UserConfig } from "powerlines/types/config";
3
- import { PluginContext } from "powerlines/types/context";
4
- import { ResolvedConfig } from "powerlines/types/resolved";
5
3
 
6
4
  //#region src/types/plugin.d.ts
7
5
  type TamaguiPluginOptions = Partial<TamaguiOptions> & {
@@ -17,7 +15,7 @@ type TamaguiPluginOptions = Partial<TamaguiOptions> & {
17
15
  * @remarks
18
16
  * These paths can include glob patterns to match multiple files or directories and placeholder tokens (the `replacePathTokens` function will be applied to allow for dynamic path resolution).
19
17
  *
20
- * @defaultValue ["\{sourceRoot\}/components"]
18
+ * @defaultValue ["\{root\}/src/components"]
21
19
  */
22
20
  components?: string[];
23
21
  };
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAuBY,oBAAA,GAAuB,QAAQ;;AAA3C;AAmBA;AAIA;;EAC0C,QAAA,CAAA,EAAA,KAAA,GAAA,QAAA;EAAL;;;;AAGrC;;;;EAGI,UAAA,CAAA,EAAA,MAAA,EAAA;CAAa;UAXA,uBAAA,SAAgC;WACtC;;UAGM,2BAAA,SAAoC;WAC1C,iBAAiB,SAAS,KAAK;;KAG9B,6CAER,8BAA8B,+BAC9B,cAAc"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,oBAAA,GAAuB,QAAQ;;AAA3C;AAmBA;AAIA;;EAC0C,QAAA,CAAA,EAAA,KAAA,GAAA,QAAA;EAAL;;;;AAGrC;;;;EAGI,UAAA,CAAA,EAAA,MAAA,EAAA;CAAa;UAXA,uBAAA,SAAgC;WACtC;;UAGM,2BAAA,SAAoC;WAC1C,iBAAiB,SAAS,KAAK;;KAG9B,6CACc,8BACtB,+BACA,cAAc"}
package/package.json CHANGED
@@ -1,18 +1,24 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-tamagui",
3
- "version": "0.1.280",
4
- "type": "module",
3
+ "version": "0.1.282",
4
+ "private": false,
5
5
  "description": "A package containing the Tamagui plugin for Powerlines.",
6
+ "keywords": ["tamagui", "powerlines", "storm-software", "powerlines-plugin"],
7
+ "homepage": "https://stormsoftware.com",
8
+ "bugs": {
9
+ "url": "https://stormsoftware.com/support",
10
+ "email": "support@stormsoftware.com"
11
+ },
6
12
  "repository": {
7
13
  "type": "github",
8
14
  "url": "https://github.com/storm-software/powerlines.git",
9
15
  "directory": "packages/plugin-tamagui"
10
16
  },
11
- "homepage": "https://stormsoftware.com",
12
- "bugs": {
13
- "url": "https://stormsoftware.com/support",
14
- "email": "support@stormsoftware.com"
17
+ "funding": {
18
+ "type": "github",
19
+ "url": "https://github.com/sponsors/storm-software"
15
20
  },
21
+ "license": "Apache-2.0",
16
22
  "author": {
17
23
  "name": "Storm Software",
18
24
  "email": "contact@stormsoftware.com",
@@ -32,14 +38,7 @@
32
38
  "url": "https://stormsoftware.com"
33
39
  }
34
40
  ],
35
- "funding": {
36
- "type": "github",
37
- "url": "https://github.com/sponsors/storm-software"
38
- },
39
- "license": "Apache-2.0",
40
- "private": false,
41
- "main": "./dist/index.cjs",
42
- "module": "./dist/index.mjs",
41
+ "type": "module",
43
42
  "exports": {
44
43
  ".": {
45
44
  "require": {
@@ -55,7 +54,7 @@
55
54
  "default": "./dist/index.mjs"
56
55
  }
57
56
  },
58
- "./package.json": "./package.json",
57
+ "./*": "./*",
59
58
  "./types": {
60
59
  "require": {
61
60
  "types": "./dist/types/index.d.cts",
@@ -85,25 +84,27 @@
85
84
  }
86
85
  }
87
86
  },
87
+ "main": "./dist/index.cjs",
88
+ "module": "./dist/index.mjs",
89
+ "types": "./dist/index.d.cts",
88
90
  "typings": "dist/index.d.mts",
89
91
  "files": ["dist/**/*"],
90
- "keywords": ["tamagui", "powerlines", "storm-software", "powerlines-plugin"],
91
92
  "dependencies": {
93
+ "@powerlines/plugin-vite": "^0.14.294",
92
94
  "@stryke/fs": "^0.33.43",
93
95
  "@stryke/hash": "^0.12.49",
94
96
  "@stryke/path": "^0.26.6",
95
97
  "@tamagui/static-worker": "^1.144.4",
96
98
  "defu": "^6.1.4",
97
- "powerlines": "^0.38.57",
99
+ "powerlines": "^0.39.1",
98
100
  "typescript": "^5.9.3",
99
101
  "vite": "8.0.0-beta.2"
100
102
  },
101
103
  "devDependencies": {
102
- "@powerlines/plugin-plugin": "^0.12.241",
104
+ "@powerlines/plugin-plugin": "^0.12.243",
103
105
  "@tamagui/types": "^1.144.4",
104
- "@types/node": "^25.3.1"
106
+ "@types/node": "^25.3.3"
105
107
  },
106
108
  "publishConfig": { "access": "public" },
107
- "types": "./dist/index.d.cts",
108
- "gitHead": "eb3dbd19bd153aa5a988bce09a1cf05d985cb04b"
109
+ "gitHead": "30a096fed42d3462dbc028b16145250c373f3d99"
109
110
  }