@tenphi/tasty 0.0.0-snapshot.002b1b3

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.
Files changed (82) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +637 -0
  3. package/dist/async-storage-B7_o6FKt.js +44 -0
  4. package/dist/async-storage-B7_o6FKt.js.map +1 -0
  5. package/dist/collector-LuU1vZ68.d.ts +98 -0
  6. package/dist/collector-MOYY2SOr.js +230 -0
  7. package/dist/collector-MOYY2SOr.js.map +1 -0
  8. package/dist/config-A237aY9H.js +10235 -0
  9. package/dist/config-A237aY9H.js.map +1 -0
  10. package/dist/config-vuCRkBWX.d.ts +884 -0
  11. package/dist/context-CkSg-kDT.js +24 -0
  12. package/dist/context-CkSg-kDT.js.map +1 -0
  13. package/dist/core/index.d.ts +5 -0
  14. package/dist/core/index.js +6 -0
  15. package/dist/core-BkKav78f.js +1592 -0
  16. package/dist/core-BkKav78f.js.map +1 -0
  17. package/dist/css-writer-Cos9tQRM.js +329 -0
  18. package/dist/css-writer-Cos9tQRM.js.map +1 -0
  19. package/dist/format-global-rules-Dbc_1tc3.js +22 -0
  20. package/dist/format-global-rules-Dbc_1tc3.js.map +1 -0
  21. package/dist/format-rules-C2oiTsEO.js +143 -0
  22. package/dist/format-rules-C2oiTsEO.js.map +1 -0
  23. package/dist/hydrate-miFzWIKR.js +45 -0
  24. package/dist/hydrate-miFzWIKR.js.map +1 -0
  25. package/dist/index-CJMXAAO5.d.ts +1602 -0
  26. package/dist/index-dUtwpOux.d.ts +1266 -0
  27. package/dist/index.d.ts +5 -0
  28. package/dist/index.js +732 -0
  29. package/dist/index.js.map +1 -0
  30. package/dist/keyframes-DDtNo_hl.js +587 -0
  31. package/dist/keyframes-DDtNo_hl.js.map +1 -0
  32. package/dist/merge-styles-CtDJMhpJ.d.ts +7 -0
  33. package/dist/merge-styles-D_HbBOlq.js +144 -0
  34. package/dist/merge-styles-D_HbBOlq.js.map +1 -0
  35. package/dist/resolve-recipes-B7-823LL.js +144 -0
  36. package/dist/resolve-recipes-B7-823LL.js.map +1 -0
  37. package/dist/ssr/astro-client.d.ts +1 -0
  38. package/dist/ssr/astro-client.js +19 -0
  39. package/dist/ssr/astro-client.js.map +1 -0
  40. package/dist/ssr/astro-middleware.d.ts +15 -0
  41. package/dist/ssr/astro-middleware.js +19 -0
  42. package/dist/ssr/astro-middleware.js.map +1 -0
  43. package/dist/ssr/astro.d.ts +97 -0
  44. package/dist/ssr/astro.js +149 -0
  45. package/dist/ssr/astro.js.map +1 -0
  46. package/dist/ssr/index.d.ts +44 -0
  47. package/dist/ssr/index.js +10 -0
  48. package/dist/ssr/index.js.map +1 -0
  49. package/dist/ssr/next.d.ts +46 -0
  50. package/dist/ssr/next.js +75 -0
  51. package/dist/ssr/next.js.map +1 -0
  52. package/dist/static/index.d.ts +91 -0
  53. package/dist/static/index.js +50 -0
  54. package/dist/static/index.js.map +1 -0
  55. package/dist/static/inject.d.ts +5 -0
  56. package/dist/static/inject.js +17 -0
  57. package/dist/static/inject.js.map +1 -0
  58. package/dist/zero/babel.d.ts +81 -0
  59. package/dist/zero/babel.js +466 -0
  60. package/dist/zero/babel.js.map +1 -0
  61. package/dist/zero/index.d.ts +67 -0
  62. package/dist/zero/index.js +2 -0
  63. package/dist/zero/next.d.ts +86 -0
  64. package/dist/zero/next.js +143 -0
  65. package/dist/zero/next.js.map +1 -0
  66. package/docs/README.md +31 -0
  67. package/docs/adoption.md +298 -0
  68. package/docs/comparison.md +419 -0
  69. package/docs/configuration.md +394 -0
  70. package/docs/debug.md +320 -0
  71. package/docs/design-system.md +436 -0
  72. package/docs/dsl.md +688 -0
  73. package/docs/getting-started.md +217 -0
  74. package/docs/injector.md +544 -0
  75. package/docs/methodology.md +616 -0
  76. package/docs/pipeline.md +673 -0
  77. package/docs/react-api.md +557 -0
  78. package/docs/ssr.md +442 -0
  79. package/docs/styles.md +596 -0
  80. package/docs/tasty-static.md +532 -0
  81. package/package.json +222 -0
  82. package/tasty.config.ts +15 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro.js","names":[],"sources":["../../src/ssr/astro.ts"],"sourcesContent":["/**\n * Astro integration for Tasty SSR.\n *\n * Provides:\n * - tastyIntegration() — Astro Integration API (recommended)\n * - tastyMiddleware() — manual middleware for advanced composition\n *\n * Import from '@tenphi/tasty/ssr/astro'.\n */\n\nimport { getConfig } from '../config';\nimport { getSSRCollector, runWithCollector } from './async-storage';\nimport { ServerStyleCollector } from './collector';\nimport { registerSSRCollectorGetterGlobal } from './ssr-collector-ref';\n\n// Wire up ALS-based collector discovery so computeStyles() can find\n// the collector set by tastyMiddleware's runWithCollector().\n// Uses globalThis so the getter is visible across Astro's separate\n// module graphs (middleware vs page components).\nregisterSSRCollectorGetterGlobal(getSSRCollector);\n\nexport interface TastyMiddlewareOptions {\n /**\n * Whether to embed the class-list script for client hydration.\n * Set to false to skip class transfer (e.g. for CSP restrictions).\n * Without it, client components may re-inject CSS that already exists\n * in server-rendered `<style>` tags. Default: true.\n */\n transferCache?: boolean;\n}\n\n/**\n * Create an Astro middleware that collects Tasty styles during SSR.\n *\n * All React components rendered during the request will have their\n * computeStyles() calls captured by the collector via AsyncLocalStorage.\n * After rendering, the middleware injects the collected CSS into </head>.\n *\n * @example Manual middleware setup\n * ```ts\n * // src/middleware.ts\n * import { tastyMiddleware } from '@tenphi/tasty/ssr/astro';\n * export const onRequest = tastyMiddleware();\n * ```\n *\n * @example Composing with other middleware\n * ```ts\n * // src/middleware.ts\n * import { sequence } from 'astro:middleware';\n * import { tastyMiddleware } from '@tenphi/tasty/ssr/astro';\n *\n * export const onRequest = sequence(\n * tastyMiddleware(),\n * myOtherMiddleware,\n * );\n * ```\n */\nexport function tastyMiddleware(options?: TastyMiddlewareOptions) {\n return async (\n _context: unknown,\n next: () => Promise<Response>,\n ): Promise<Response> => {\n const transferCache = options?.transferCache ?? true;\n const collector = new ServerStyleCollector();\n\n // Run the entire request — including body stream consumption — inside\n // the ALS context so that components rendering lazily during stream\n // reads can still find the collector via getSSRCollector().\n const rendered = await runWithCollector(collector, async () => {\n const response = await next();\n const body = response.body;\n if (!body) {\n return {\n html: null as string | null,\n status: response.status,\n headers: response.headers,\n };\n }\n\n const reader = body.pipeThrough(new TextDecoderStream()).getReader();\n const parts: string[] = [];\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n parts.push(value);\n }\n return {\n html: parts.join(''),\n status: response.status,\n headers: response.headers,\n };\n });\n\n if (!rendered.html) {\n return new Response(null, {\n status: rendered.status,\n headers: rendered.headers,\n });\n }\n\n let { html } = rendered;\n\n const css = collector.getCSS();\n if (!css) {\n return new Response(html, {\n status: rendered.status,\n headers: rendered.headers,\n });\n }\n\n const nonce = getConfig().nonce;\n const nonceAttr = nonce ? ` nonce=\"${nonce}\"` : '';\n const styleTag = `<style data-tasty-ssr${nonceAttr}>${css}</style>`;\n\n let cacheTag = '';\n if (transferCache) {\n const classNames = collector.getRenderedClassNames();\n if (classNames.length > 0) {\n const classListJSON = classNames.map((n) => `\"${n}\"`).join(',');\n cacheTag = `<script${nonceAttr}>(window.__TASTY__=window.__TASTY__||[]).push(${classListJSON})</script>`;\n }\n }\n\n const injection = styleTag + cacheTag;\n const idx = html.indexOf('</head>');\n if (idx !== -1) {\n html = html.slice(0, idx) + injection + html.slice(idx);\n } else {\n html = injection + html;\n }\n\n const headers = new Headers(rendered.headers);\n headers.delete('content-length');\n\n return new Response(html, {\n status: rendered.status,\n headers,\n });\n };\n}\n\n// ============================================================================\n// Module-level middleware config (set by tastyIntegration, read by\n// astro-middleware.ts via getter property)\n// ============================================================================\n\nlet _middlewareTransferCache = true;\n\n/** @internal */\nexport function setMiddlewareTransferCache(value: boolean): void {\n _middlewareTransferCache = value;\n}\n\n/** @internal */\nexport function getMiddlewareTransferCache(): boolean {\n return _middlewareTransferCache;\n}\n\n// ============================================================================\n// Astro Integration API\n// ============================================================================\n\nexport interface TastyIntegrationOptions {\n /**\n * Enable island hydration support.\n *\n * When `true` (default): injects a client hydration script via\n * `injectScript('before-hydration')` and sets `transferCache: true`\n * on the middleware. Islands skip the style pipeline during hydration.\n *\n * When `false`: no client JS is shipped and `transferCache` is set\n * to `false`. Use this for fully static sites without `client:*`\n * directives.\n */\n islands?: boolean;\n}\n\n/**\n * Astro integration that automatically sets up Tasty SSR.\n *\n * Registers middleware for cross-component CSS deduplication and\n * optionally injects a client hydration script for island support.\n *\n * @example Basic setup (with islands)\n * ```ts\n * // astro.config.mjs\n * import { tastyIntegration } from '@tenphi/tasty/ssr/astro';\n *\n * export default defineConfig({\n * integrations: [tastyIntegration()],\n * });\n * ```\n *\n * @example Static-only (no client JS)\n * ```ts\n * // astro.config.mjs\n * import { tastyIntegration } from '@tenphi/tasty/ssr/astro';\n *\n * export default defineConfig({\n * integrations: [tastyIntegration({ islands: false })],\n * });\n * ```\n */\nexport function tastyIntegration(options?: TastyIntegrationOptions): {\n name: string;\n hooks: Record<string, (...args: never[]) => void>;\n} {\n const { islands = true } = options ?? {};\n\n setMiddlewareTransferCache(islands);\n\n return {\n name: '@tenphi/tasty',\n hooks: {\n 'astro:config:setup': ({\n addMiddleware,\n injectScript,\n }: {\n addMiddleware: (middleware: {\n entrypoint: string | URL;\n order: 'pre' | 'post';\n }) => void;\n injectScript: (\n stage: 'head-inline' | 'before-hydration' | 'page' | 'page-ssr',\n content: string,\n ) => void;\n }) => {\n addMiddleware({\n entrypoint: new URL('./astro-middleware.js', import.meta.url),\n order: 'pre',\n });\n\n if (islands) {\n injectScript(\n 'before-hydration',\n `import \"@tenphi/tasty/ssr/astro-client\";`,\n );\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,iCAAiC,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCjD,SAAgB,gBAAgB,SAAkC;AAChE,QAAO,OACL,UACA,SACsB;EACtB,MAAM,gBAAgB,SAAS,iBAAiB;EAChD,MAAM,YAAY,IAAI,sBAAsB;EAK5C,MAAM,WAAW,MAAM,iBAAiB,WAAW,YAAY;GAC7D,MAAM,WAAW,MAAM,MAAM;GAC7B,MAAM,OAAO,SAAS;AACtB,OAAI,CAAC,KACH,QAAO;IACL,MAAM;IACN,QAAQ,SAAS;IACjB,SAAS,SAAS;IACnB;GAGH,MAAM,SAAS,KAAK,YAAY,IAAI,mBAAmB,CAAC,CAAC,WAAW;GACpE,MAAM,QAAkB,EAAE;AAC1B,YAAS;IACP,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,MAAM;AAC3C,QAAI,KAAM;AACV,UAAM,KAAK,MAAM;;AAEnB,UAAO;IACL,MAAM,MAAM,KAAK,GAAG;IACpB,QAAQ,SAAS;IACjB,SAAS,SAAS;IACnB;IACD;AAEF,MAAI,CAAC,SAAS,KACZ,QAAO,IAAI,SAAS,MAAM;GACxB,QAAQ,SAAS;GACjB,SAAS,SAAS;GACnB,CAAC;EAGJ,IAAI,EAAE,SAAS;EAEf,MAAM,MAAM,UAAU,QAAQ;AAC9B,MAAI,CAAC,IACH,QAAO,IAAI,SAAS,MAAM;GACxB,QAAQ,SAAS;GACjB,SAAS,SAAS;GACnB,CAAC;EAGJ,MAAM,QAAQ,WAAW,CAAC;EAC1B,MAAM,YAAY,QAAQ,WAAW,MAAM,KAAK;EAChD,MAAM,WAAW,wBAAwB,UAAU,GAAG,IAAI;EAE1D,IAAI,WAAW;AACf,MAAI,eAAe;GACjB,MAAM,aAAa,UAAU,uBAAuB;AACpD,OAAI,WAAW,SAAS,EAEtB,YAAW,UAAU,UAAU,gDADT,WAAW,KAAK,MAAM,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAC8B;;EAIjG,MAAM,YAAY,WAAW;EAC7B,MAAM,MAAM,KAAK,QAAQ,UAAU;AACnC,MAAI,QAAQ,GACV,QAAO,KAAK,MAAM,GAAG,IAAI,GAAG,YAAY,KAAK,MAAM,IAAI;MAEvD,QAAO,YAAY;EAGrB,MAAM,UAAU,IAAI,QAAQ,SAAS,QAAQ;AAC7C,UAAQ,OAAO,iBAAiB;AAEhC,SAAO,IAAI,SAAS,MAAM;GACxB,QAAQ,SAAS;GACjB;GACD,CAAC;;;AASN,IAAI,2BAA2B;;AAG/B,SAAgB,2BAA2B,OAAsB;AAC/D,4BAA2B;;;AAI7B,SAAgB,6BAAsC;AACpD,QAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDT,SAAgB,iBAAiB,SAG/B;CACA,MAAM,EAAE,UAAU,SAAS,WAAW,EAAE;AAExC,4BAA2B,QAAQ;AAEnC,QAAO;EACL,MAAM;EACN,OAAO,EACL,uBAAuB,EACrB,eACA,mBAUI;AACJ,iBAAc;IACZ,YAAY,IAAI,IAAI,yBAAyB,OAAO,KAAK,IAAI;IAC7D,OAAO;IACR,CAAC;AAEF,OAAI,QACF,cACE,oBACA,2CACD;KAGN;EACF"}
@@ -0,0 +1,44 @@
1
+ import { t as ServerStyleCollector } from "../collector-LuU1vZ68.js";
2
+
3
+ //#region src/ssr/async-storage.d.ts
4
+ /**
5
+ * Run a function with a ServerStyleCollector bound to the current
6
+ * async context. All useStyles() calls within `fn` (and any async
7
+ * continuations) will find this collector via getSSRCollector().
8
+ */
9
+ declare function runWithCollector<T>(collector: ServerStyleCollector, fn: () => T): T;
10
+ /**
11
+ * Retrieve the ServerStyleCollector bound to the current async context.
12
+ * Returns null when called outside of runWithCollector() or on the client.
13
+ */
14
+ declare function getSSRCollector(): ServerStyleCollector | null;
15
+ //#endregion
16
+ //#region src/ssr/hydrate.d.ts
17
+ /**
18
+ * Client-side cache hydration for SSR/RSC.
19
+ *
20
+ * Pre-populates the client injector's rules map with class names
21
+ * rendered on the server. With hash-based naming, the client derives
22
+ * the same class name from the same cache key, so only the class name
23
+ * list needs to cross the wire — no cache keys or counters.
24
+ */
25
+ /**
26
+ * Pre-populate the client-side style registry from the server's class name list.
27
+ *
28
+ * Call this before ReactDOM.hydrateRoot() or ensure it runs before
29
+ * any tasty() component renders on the client.
30
+ *
31
+ * When called without arguments, reads the class list from `window.__TASTY__`
32
+ * (populated by inline scripts emitted during SSR/RSC streaming).
33
+ */
34
+ declare function hydrateTastyClasses(classes?: string[]): void;
35
+ /**
36
+ * @deprecated Use `hydrateTastyClasses()` instead. This alias exists
37
+ * for backwards compatibility and will be removed in a future major version.
38
+ */
39
+ declare function hydrateTastyCache(state?: {
40
+ entries?: Record<string, string>;
41
+ }): void;
42
+ //#endregion
43
+ export { ServerStyleCollector, getSSRCollector, hydrateTastyCache, hydrateTastyClasses, runWithCollector };
44
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import { a as registerSSRCollectorGetterGlobal } from "../format-rules-C2oiTsEO.js";
2
+ import { t as ServerStyleCollector } from "../collector-MOYY2SOr.js";
3
+ import { n as runWithCollector, t as getSSRCollector } from "../async-storage-B7_o6FKt.js";
4
+ import { n as hydrateTastyClasses, t as hydrateTastyCache } from "../hydrate-miFzWIKR.js";
5
+ //#region src/ssr/index.ts
6
+ registerSSRCollectorGetterGlobal(getSSRCollector);
7
+ //#endregion
8
+ export { ServerStyleCollector, getSSRCollector, hydrateTastyCache, hydrateTastyClasses, runWithCollector };
9
+
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/ssr/index.ts"],"sourcesContent":["/**\n * SSR entry point for @tenphi/tasty.\n *\n * Provides the core SSR infrastructure: ServerStyleCollector,\n * AsyncLocalStorage integration, and cache hydration.\n *\n * Import from '@tenphi/tasty/ssr'.\n */\n\n// Core collector\nexport { ServerStyleCollector } from './collector';\n\n// AsyncLocalStorage integration for Astro / generic frameworks\nexport { runWithCollector, getSSRCollector } from './async-storage';\n\n// Client-side cache hydration\nexport { hydrateTastyClasses, hydrateTastyCache } from './hydrate';\n\n// Register the ALS getter so hooks can find the collector\n// without importing 'node:async_hooks' in the browser bundle.\n// Uses globalThis so the getter is visible across separate module graphs.\nimport { getSSRCollector } from './async-storage';\nimport { registerSSRCollectorGetterGlobal } from './ssr-collector-ref';\n\nregisterSSRCollectorGetterGlobal(getSSRCollector);\n"],"mappings":";;;;;AAwBA,iCAAiC,gBAAgB"}
@@ -0,0 +1,46 @@
1
+ import { t as ServerStyleCollector } from "../collector-LuU1vZ68.js";
2
+ import * as _$react from "react";
3
+ import { ReactNode } from "react";
4
+
5
+ //#region src/ssr/next.d.ts
6
+ interface TastyRegistryProps {
7
+ children: ReactNode;
8
+ /**
9
+ * Whether to embed the class-list script for client hydration.
10
+ * Set to false to skip class transfer (e.g. for CSP restrictions).
11
+ * Without it, client components may re-inject CSS that already exists
12
+ * in server-rendered `<style>` tags. Default: true.
13
+ */
14
+ transferCache?: boolean;
15
+ }
16
+ /**
17
+ * Next.js App Router registry for Tasty SSR.
18
+ *
19
+ * Wraps the component tree with a ServerStyleCollector and flushes
20
+ * collected CSS into the HTML stream via useServerInsertedHTML.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * // app/tasty-registry.tsx
25
+ * 'use client';
26
+ * import { TastyRegistry } from '@tenphi/tasty/ssr/next';
27
+ * export default function TastyStyleRegistry({ children }) {
28
+ * return <TastyRegistry>{children}</TastyRegistry>;
29
+ * }
30
+ *
31
+ * // app/layout.tsx
32
+ * import TastyStyleRegistry from './tasty-registry';
33
+ * export default function RootLayout({ children }) {
34
+ * return <html><body>
35
+ * <TastyStyleRegistry>{children}</TastyStyleRegistry>
36
+ * </body></html>;
37
+ * }
38
+ * ```
39
+ */
40
+ declare function TastyRegistry({
41
+ children,
42
+ transferCache
43
+ }: TastyRegistryProps): _$react.FunctionComponentElement<_$react.ProviderProps<ServerStyleCollector | null>>;
44
+ //#endregion
45
+ export { TastyRegistry, TastyRegistryProps };
46
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1,75 @@
1
+ "use client";
2
+ import { n as getConfig } from "../config-A237aY9H.js";
3
+ import { i as registerSSRCollectorGetter } from "../format-rules-C2oiTsEO.js";
4
+ import { t as getTastySSRContext } from "../context-CkSg-kDT.js";
5
+ import { t as ServerStyleCollector } from "../collector-MOYY2SOr.js";
6
+ import { n as hydrateTastyClasses } from "../hydrate-miFzWIKR.js";
7
+ import { Fragment, createElement, useState } from "react";
8
+ import { useServerInsertedHTML } from "next/navigation";
9
+ //#region src/ssr/next.ts
10
+ /**
11
+ * Next.js integration for Tasty SSR.
12
+ *
13
+ * Provides TastyRegistry for App Router (streaming via useServerInsertedHTML)
14
+ * and createTastySSRDocument for Pages Router (non-streaming).
15
+ *
16
+ * Import from '@tenphi/tasty/ssr/next'.
17
+ */
18
+ if (typeof window !== "undefined") hydrateTastyClasses();
19
+ /**
20
+ * Next.js App Router registry for Tasty SSR.
21
+ *
22
+ * Wraps the component tree with a ServerStyleCollector and flushes
23
+ * collected CSS into the HTML stream via useServerInsertedHTML.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * // app/tasty-registry.tsx
28
+ * 'use client';
29
+ * import { TastyRegistry } from '@tenphi/tasty/ssr/next';
30
+ * export default function TastyStyleRegistry({ children }) {
31
+ * return <TastyRegistry>{children}</TastyRegistry>;
32
+ * }
33
+ *
34
+ * // app/layout.tsx
35
+ * import TastyStyleRegistry from './tasty-registry';
36
+ * export default function RootLayout({ children }) {
37
+ * return <html><body>
38
+ * <TastyStyleRegistry>{children}</TastyStyleRegistry>
39
+ * </body></html>;
40
+ * }
41
+ * ```
42
+ */
43
+ function TastyRegistry({ children, transferCache = true }) {
44
+ const isClient = typeof window !== "undefined";
45
+ const [collector] = useState(() => {
46
+ if (isClient) return null;
47
+ const instance = new ServerStyleCollector();
48
+ registerSSRCollectorGetter(() => instance);
49
+ return instance;
50
+ });
51
+ const nonce = getConfig().nonce;
52
+ useServerInsertedHTML(() => {
53
+ if (!collector) return null;
54
+ const css = collector.flushCSS();
55
+ const classNames = collector.getRenderedClassNames();
56
+ if (!css) return null;
57
+ const styleEl = createElement("style", {
58
+ key: "tasty-ssr-styles",
59
+ "data-tasty-ssr": "",
60
+ nonce,
61
+ dangerouslySetInnerHTML: { __html: css }
62
+ });
63
+ if (!transferCache || classNames.length === 0) return styleEl;
64
+ return createElement(Fragment, null, styleEl, createElement("script", {
65
+ key: "tasty-ssr-cache",
66
+ nonce,
67
+ dangerouslySetInnerHTML: { __html: `(window.__TASTY__=window.__TASTY__||[]).push(${classNames.map((n) => `"${n}"`).join(",")})` }
68
+ }));
69
+ });
70
+ return createElement(getTastySSRContext().Provider, { value: collector }, children);
71
+ }
72
+ //#endregion
73
+ export { TastyRegistry };
74
+
75
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","names":[],"sources":["../../src/ssr/next.ts"],"sourcesContent":["/**\n * Next.js integration for Tasty SSR.\n *\n * Provides TastyRegistry for App Router (streaming via useServerInsertedHTML)\n * and createTastySSRDocument for Pages Router (non-streaming).\n *\n * Import from '@tenphi/tasty/ssr/next'.\n */\n\n'use client';\n\n/// <reference path=\"./next-navigation.d.ts\" />\n\nimport { createElement, Fragment, useState, type ReactNode } from 'react';\nimport { useServerInsertedHTML } from 'next/navigation';\n\nimport { getConfig } from '../config';\nimport { ServerStyleCollector } from './collector';\nimport { getTastySSRContext } from './context';\nimport { hydrateTastyClasses } from './hydrate';\nimport { registerSSRCollectorGetter } from './ssr-collector-ref';\n\n// Auto-hydrate on module load (client only).\n// Reads the class name list from `window.__TASTY__` populated by streaming scripts.\nif (typeof window !== 'undefined') {\n hydrateTastyClasses();\n}\n\nexport interface TastyRegistryProps {\n children: ReactNode;\n /**\n * Whether to embed the class-list script for client hydration.\n * Set to false to skip class transfer (e.g. for CSP restrictions).\n * Without it, client components may re-inject CSS that already exists\n * in server-rendered `<style>` tags. Default: true.\n */\n transferCache?: boolean;\n}\n\n/**\n * Next.js App Router registry for Tasty SSR.\n *\n * Wraps the component tree with a ServerStyleCollector and flushes\n * collected CSS into the HTML stream via useServerInsertedHTML.\n *\n * @example\n * ```tsx\n * // app/tasty-registry.tsx\n * 'use client';\n * import { TastyRegistry } from '@tenphi/tasty/ssr/next';\n * export default function TastyStyleRegistry({ children }) {\n * return <TastyRegistry>{children}</TastyRegistry>;\n * }\n *\n * // app/layout.tsx\n * import TastyStyleRegistry from './tasty-registry';\n * export default function RootLayout({ children }) {\n * return <html><body>\n * <TastyStyleRegistry>{children}</TastyStyleRegistry>\n * </body></html>;\n * }\n * ```\n */\nexport function TastyRegistry({\n children,\n transferCache = true,\n}: TastyRegistryProps) {\n const isClient = typeof window !== 'undefined';\n\n const [collector] = useState(() => {\n if (isClient) return null;\n\n const instance = new ServerStyleCollector();\n\n registerSSRCollectorGetter(() => instance);\n\n return instance;\n });\n const nonce = getConfig().nonce;\n\n useServerInsertedHTML(() => {\n if (!collector) return null;\n\n const css = collector.flushCSS();\n const classNames = collector.getRenderedClassNames();\n\n if (!css) return null;\n\n const styleEl = createElement('style', {\n key: 'tasty-ssr-styles',\n 'data-tasty-ssr': '',\n nonce,\n dangerouslySetInnerHTML: { __html: css },\n });\n\n if (!transferCache || classNames.length === 0) return styleEl;\n\n const classListJSON = classNames.map((n) => `\"${n}\"`).join(',');\n\n const scriptEl = createElement('script', {\n key: 'tasty-ssr-cache',\n nonce,\n dangerouslySetInnerHTML: {\n __html: `(window.__TASTY__=window.__TASTY__||[]).push(${classListJSON})`,\n },\n });\n\n return createElement(Fragment, null, styleEl, scriptEl);\n });\n\n return createElement(\n getTastySSRContext().Provider,\n { value: collector },\n children,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,IAAI,OAAO,WAAW,YACpB,sBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;AAsCvB,SAAgB,cAAc,EAC5B,UACA,gBAAgB,QACK;CACrB,MAAM,WAAW,OAAO,WAAW;CAEnC,MAAM,CAAC,aAAa,eAAe;AACjC,MAAI,SAAU,QAAO;EAErB,MAAM,WAAW,IAAI,sBAAsB;AAE3C,mCAAiC,SAAS;AAE1C,SAAO;GACP;CACF,MAAM,QAAQ,WAAW,CAAC;AAE1B,6BAA4B;AAC1B,MAAI,CAAC,UAAW,QAAO;EAEvB,MAAM,MAAM,UAAU,UAAU;EAChC,MAAM,aAAa,UAAU,uBAAuB;AAEpD,MAAI,CAAC,IAAK,QAAO;EAEjB,MAAM,UAAU,cAAc,SAAS;GACrC,KAAK;GACL,kBAAkB;GAClB;GACA,yBAAyB,EAAE,QAAQ,KAAK;GACzC,CAAC;AAEF,MAAI,CAAC,iBAAiB,WAAW,WAAW,EAAG,QAAO;AAYtD,SAAO,cAAc,UAAU,MAAM,SARpB,cAAc,UAAU;GACvC,KAAK;GACL;GACA,yBAAyB,EACvB,QAAQ,gDANU,WAAW,KAAK,MAAM,IAAI,EAAE,GAAG,CAAC,KAAK,IAAI,CAMW,IACvE;GACF,CAAC,CAEqD;GACvD;AAEF,QAAO,cACL,oBAAoB,CAAC,UACrB,EAAE,OAAO,WAAW,EACpB,SACD"}
@@ -0,0 +1,91 @@
1
+ import { b as Styles } from "../index-dUtwpOux.js";
2
+ import { t as mergeStyles } from "../merge-styles-CtDJMhpJ.js";
3
+
4
+ //#region src/static/types.d.ts
5
+ /**
6
+ * Static style definition returned by tastyStatic().
7
+ *
8
+ * Supports both explicit className access and implicit string coercion via toString().
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * const button = tastyStatic({ fill: '#blue' });
13
+ *
14
+ * // Both work in JSX:
15
+ * <div className={button} /> // Uses toString()
16
+ * <div className={button.className} /> // Explicit
17
+ *
18
+ * // Extension:
19
+ * const primary = tastyStatic(button, { fill: '#purple' });
20
+ * ```
21
+ */
22
+ interface StaticStyle {
23
+ /**
24
+ * Generated className(s) for use in JSX.
25
+ * May contain multiple space-separated class names due to chunking.
26
+ */
27
+ className: string;
28
+ /**
29
+ * The original (or merged) styles object.
30
+ * Available for extension via tastyStatic(base, overrides).
31
+ */
32
+ styles: Styles;
33
+ /**
34
+ * Returns className for implicit string coercion.
35
+ * Enables `<div className={button} />` syntax.
36
+ */
37
+ toString(): string;
38
+ }
39
+ /**
40
+ * Create a StaticStyle object.
41
+ * Used internally by the Babel plugin to generate output.
42
+ */
43
+ declare function createStaticStyle(className: string, styles: Styles): StaticStyle;
44
+ /**
45
+ * Type guard to check if a value is a StaticStyle object.
46
+ */
47
+ declare function isStaticStyle(value: unknown): value is StaticStyle;
48
+ //#endregion
49
+ //#region src/static/tastyStatic.d.ts
50
+ /**
51
+ * Generate styles and return a StaticStyle object.
52
+ * The object has `className`, `styles`, and `toString()`.
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * const button = tastyStatic({
57
+ * fill: '#blue',
58
+ * padding: '2x',
59
+ * });
60
+ * // After build: { className: 'ts3f2a1b', styles: {...}, toString() }
61
+ *
62
+ * <div className={button} /> // Works via toString()
63
+ * ```
64
+ */
65
+ declare function tastyStatic(styles: Styles): StaticStyle;
66
+ /**
67
+ * Extend an existing StaticStyle with additional styles.
68
+ * Uses mergeStyles() internally for proper nested selector handling.
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const button = tastyStatic({ fill: '#blue' });
73
+ * const primary = tastyStatic(button, { fill: '#purple' });
74
+ * // After build: { className: 'ts8c4d2e', styles: {...merged...}, toString() }
75
+ * ```
76
+ */
77
+ declare function tastyStatic(base: StaticStyle, styles: Styles): StaticStyle;
78
+ /**
79
+ * Generate styles for a specific CSS selector.
80
+ * The call is completely removed after build transformation.
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * tastyStatic('.heading', { preset: 'h1', color: '#primary' });
85
+ * // After build: (removed)
86
+ * ```
87
+ */
88
+ declare function tastyStatic(selector: string, styles: Styles): void;
89
+ //#endregion
90
+ export { type StaticStyle, type Styles, createStaticStyle, isStaticStyle, mergeStyles, tastyStatic };
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { t as mergeStyles } from "../merge-styles-D_HbBOlq.js";
2
+ //#region src/static/types.ts
3
+ /**
4
+ * Create a StaticStyle object.
5
+ * Used internally by the Babel plugin to generate output.
6
+ */
7
+ function createStaticStyle(className, styles) {
8
+ return {
9
+ className,
10
+ styles,
11
+ toString() {
12
+ return this.className;
13
+ }
14
+ };
15
+ }
16
+ /**
17
+ * Type guard to check if a value is a StaticStyle object.
18
+ */
19
+ function isStaticStyle(value) {
20
+ return typeof value === "object" && value !== null && "className" in value && "styles" in value && "toString" in value && typeof value.className === "string" && typeof value.styles === "object";
21
+ }
22
+ //#endregion
23
+ //#region src/static/tastyStatic.ts
24
+ /**
25
+ * Build-time only function for zero-runtime static site generation.
26
+ *
27
+ * This function is transformed by the Babel plugin:
28
+ * - `tastyStatic(styles)` → StaticStyle object with className
29
+ * - `tastyStatic(base, styles)` → StaticStyle object with merged styles
30
+ * - `tastyStatic(selector, styles)` → removed entirely
31
+ *
32
+ * At runtime (during development/build), this function returns a placeholder.
33
+ * In production, all calls are replaced/removed by the build plugin.
34
+ */
35
+ function tastyStatic(stylesOrBaseOrSelector, styles) {
36
+ if (typeof stylesOrBaseOrSelector === "string") {
37
+ console.warn(`[tasty] tastyStatic('${stylesOrBaseOrSelector}', styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.`);
38
+ return;
39
+ }
40
+ if (isStaticStyle(stylesOrBaseOrSelector)) {
41
+ console.warn("[tasty] tastyStatic(base, styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.");
42
+ return createStaticStyle("__TASTY_STATIC_NOT_TRANSFORMED__", mergeStyles(stylesOrBaseOrSelector.styles, styles || {}));
43
+ }
44
+ console.warn("[tasty] tastyStatic(styles) was called at runtime. This indicates the Babel plugin is not configured. Add @tenphi/tasty/babel-plugin to your Babel config.");
45
+ return createStaticStyle("__TASTY_STATIC_NOT_TRANSFORMED__", stylesOrBaseOrSelector);
46
+ }
47
+ //#endregion
48
+ export { createStaticStyle, isStaticStyle, mergeStyles, tastyStatic };
49
+
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/static/types.ts","../../src/static/tastyStatic.ts"],"sourcesContent":["import type { Styles } from '../styles/types';\n\n/**\n * Static style definition returned by tastyStatic().\n *\n * Supports both explicit className access and implicit string coercion via toString().\n *\n * @example\n * ```typescript\n * const button = tastyStatic({ fill: '#blue' });\n *\n * // Both work in JSX:\n * <div className={button} /> // Uses toString()\n * <div className={button.className} /> // Explicit\n *\n * // Extension:\n * const primary = tastyStatic(button, { fill: '#purple' });\n * ```\n */\nexport interface StaticStyle {\n /**\n * Generated className(s) for use in JSX.\n * May contain multiple space-separated class names due to chunking.\n */\n className: string;\n\n /**\n * The original (or merged) styles object.\n * Available for extension via tastyStatic(base, overrides).\n */\n styles: Styles;\n\n /**\n * Returns className for implicit string coercion.\n * Enables `<div className={button} />` syntax.\n */\n toString(): string;\n}\n\n/**\n * Create a StaticStyle object.\n * Used internally by the Babel plugin to generate output.\n */\nexport function createStaticStyle(\n className: string,\n styles: Styles,\n): StaticStyle {\n return {\n className,\n styles,\n toString() {\n return this.className;\n },\n };\n}\n\n/**\n * Type guard to check if a value is a StaticStyle object.\n */\nexport function isStaticStyle(value: unknown): value is StaticStyle {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'className' in value &&\n 'styles' in value &&\n 'toString' in value &&\n typeof (value as StaticStyle).className === 'string' &&\n typeof (value as StaticStyle).styles === 'object'\n );\n}\n","import type { Styles } from '../styles/types';\nimport { mergeStyles } from '../utils/merge-styles';\n\nimport type { StaticStyle } from './types';\nimport { createStaticStyle, isStaticStyle } from './types';\n\n/**\n * Generate styles and return a StaticStyle object.\n * The object has `className`, `styles`, and `toString()`.\n *\n * @example\n * ```typescript\n * const button = tastyStatic({\n * fill: '#blue',\n * padding: '2x',\n * });\n * // After build: { className: 'ts3f2a1b', styles: {...}, toString() }\n *\n * <div className={button} /> // Works via toString()\n * ```\n */\nexport function tastyStatic(styles: Styles): StaticStyle;\n\n/**\n * Extend an existing StaticStyle with additional styles.\n * Uses mergeStyles() internally for proper nested selector handling.\n *\n * @example\n * ```typescript\n * const button = tastyStatic({ fill: '#blue' });\n * const primary = tastyStatic(button, { fill: '#purple' });\n * // After build: { className: 'ts8c4d2e', styles: {...merged...}, toString() }\n * ```\n */\nexport function tastyStatic(base: StaticStyle, styles: Styles): StaticStyle;\n\n/**\n * Generate styles for a specific CSS selector.\n * The call is completely removed after build transformation.\n *\n * @example\n * ```typescript\n * tastyStatic('.heading', { preset: 'h1', color: '#primary' });\n * // After build: (removed)\n * ```\n */\nexport function tastyStatic(selector: string, styles: Styles): void;\n\n/**\n * Build-time only function for zero-runtime static site generation.\n *\n * This function is transformed by the Babel plugin:\n * - `tastyStatic(styles)` → StaticStyle object with className\n * - `tastyStatic(base, styles)` → StaticStyle object with merged styles\n * - `tastyStatic(selector, styles)` → removed entirely\n *\n * At runtime (during development/build), this function returns a placeholder.\n * In production, all calls are replaced/removed by the build plugin.\n */\nexport function tastyStatic(\n stylesOrBaseOrSelector: Styles | StaticStyle | string,\n styles?: Styles,\n): StaticStyle | void {\n // This code only executes if the Babel plugin hasn't processed the file yet.\n // In a properly configured build, this function is never called at runtime.\n\n if (typeof stylesOrBaseOrSelector === 'string') {\n // Selector mode: tastyStatic(selector, styles)\n // The plugin will remove this call entirely\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `[tasty] tastyStatic('${stylesOrBaseOrSelector}', styles) was called at runtime. ` +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n return; // void\n }\n\n if (isStaticStyle(stylesOrBaseOrSelector)) {\n // Extension mode: tastyStatic(base, styles)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n '[tasty] tastyStatic(base, styles) was called at runtime. ' +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n // Merge styles for dev mode preview (won't have real classNames)\n const mergedStyles = mergeStyles(\n stylesOrBaseOrSelector.styles,\n styles || {},\n );\n return createStaticStyle('__TASTY_STATIC_NOT_TRANSFORMED__', mergedStyles);\n }\n\n // Styles mode: tastyStatic(styles)\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n '[tasty] tastyStatic(styles) was called at runtime. ' +\n 'This indicates the Babel plugin is not configured. ' +\n 'Add @tenphi/tasty/babel-plugin to your Babel config.',\n );\n }\n\n // Return placeholder - styles won't be applied without the plugin\n return createStaticStyle(\n '__TASTY_STATIC_NOT_TRANSFORMED__',\n stylesOrBaseOrSelector,\n );\n}\n"],"mappings":";;;;;;AA2CA,SAAgB,kBACd,WACA,QACa;AACb,QAAO;EACL;EACA;EACA,WAAW;AACT,UAAO,KAAK;;EAEf;;;;;AAMH,SAAgB,cAAc,OAAsC;AAClE,QACE,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,SACf,YAAY,SACZ,cAAc,SACd,OAAQ,MAAsB,cAAc,YAC5C,OAAQ,MAAsB,WAAW;;;;;;;;;;;;;;;ACR7C,SAAgB,YACd,wBACA,QACoB;AAIpB,KAAI,OAAO,2BAA2B,UAAU;AAI5C,UAAQ,KACN,wBAAwB,uBAAuB,2IAGhD;AAEH;;AAGF,KAAI,cAAc,uBAAuB,EAAE;AAGvC,UAAQ,KACN,mKAGD;AAOH,SAAO,kBAAkB,oCAJJ,YACnB,uBAAuB,QACvB,UAAU,EAAE,CACb,CACyE;;AAK1E,SAAQ,KACN,6JAGD;AAIH,QAAO,kBACL,oCACA,uBACD"}
@@ -0,0 +1,5 @@
1
+ //#region src/static/inject.d.ts
2
+ declare function injectCSS(id: string, css: string): void;
3
+ //#endregion
4
+ export { injectCSS };
5
+ //# sourceMappingURL=inject.d.ts.map
@@ -0,0 +1,17 @@
1
+ //#region src/static/inject.ts
2
+ const _ids = /* @__PURE__ */ new Set();
3
+ function injectCSS(id, css) {
4
+ if (_ids.has(id) || typeof document === "undefined") return;
5
+ _ids.add(id);
6
+ let el = document.head.querySelector("style[data-tasty-static]");
7
+ if (!el) {
8
+ el = document.createElement("style");
9
+ el.setAttribute("data-tasty-static", "");
10
+ document.head.appendChild(el);
11
+ }
12
+ el.appendChild(document.createTextNode(css + "\n"));
13
+ }
14
+ //#endregion
15
+ export { injectCSS };
16
+
17
+ //# sourceMappingURL=inject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inject.js","names":[],"sources":["../../src/static/inject.ts"],"sourcesContent":["const _ids = new Set<string>();\n\nexport function injectCSS(id: string, css: string): void {\n if (_ids.has(id) || typeof document === 'undefined') return;\n _ids.add(id);\n let el = document.head.querySelector(\n 'style[data-tasty-static]',\n ) as HTMLStyleElement | null;\n if (!el) {\n el = document.createElement('style');\n el.setAttribute('data-tasty-static', '');\n document.head.appendChild(el);\n }\n el.appendChild(document.createTextNode(css + '\\n'));\n}\n"],"mappings":";AAAA,MAAM,uBAAO,IAAI,KAAa;AAE9B,SAAgB,UAAU,IAAY,KAAmB;AACvD,KAAI,KAAK,IAAI,GAAG,IAAI,OAAO,aAAa,YAAa;AACrD,MAAK,IAAI,GAAG;CACZ,IAAI,KAAK,SAAS,KAAK,cACrB,2BACD;AACD,KAAI,CAAC,IAAI;AACP,OAAK,SAAS,cAAc,QAAQ;AACpC,KAAG,aAAa,qBAAqB,GAAG;AACxC,WAAS,KAAK,YAAY,GAAG;;AAE/B,IAAG,YAAY,SAAS,eAAe,MAAM,KAAK,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { t as TastyConfig } from "../config-vuCRkBWX.js";
2
+ import * as _$_babel_core0 from "@babel/core";
3
+ import { PluginPass } from "@babel/core";
4
+
5
+ //#region src/zero/babel.d.ts
6
+ /**
7
+ * Build-time configuration for zero-runtime mode.
8
+ * Subset of TastyConfig excluding runtime-only DOM options
9
+ * (`nonce`, `maxRulesPerSheet`, `forceTextInjection`, `gc`)
10
+ * and overriding `devMode` default to `false`.
11
+ */
12
+ type TastyZeroConfig = Omit<TastyConfig, 'nonce' | 'maxRulesPerSheet' | 'forceTextInjection' | 'gc' | 'devMode'> & {
13
+ /**
14
+ * Enable development mode features: source comments in generated CSS.
15
+ * @default false
16
+ */
17
+ devMode?: boolean;
18
+ };
19
+ interface TastyZeroBabelOptions {
20
+ /** Output path for generated CSS (default: 'tasty.css') */
21
+ output?: string;
22
+ /**
23
+ * Tasty configuration for build-time processing.
24
+ * Can be a static object or a factory function that returns fresh config.
25
+ * A factory is called on each plugin invocation, enabling hot reload
26
+ * of config values that depend on external files (e.g. theme tokens).
27
+ */
28
+ config?: TastyZeroConfig | (() => TastyZeroConfig);
29
+ /**
30
+ * Absolute path to a TypeScript/JavaScript module that default-exports
31
+ * a `TastyZeroConfig` object. The module is loaded via jiti on each
32
+ * plugin invocation, enabling hot reload when the file changes.
33
+ *
34
+ * This option is JSON-serializable and is the primary way Turbopack
35
+ * passes config to the Babel plugin (since Turbopack loader options
36
+ * must be plain primitives/objects/arrays).
37
+ *
38
+ * When both `config` and `configFile` are set, `config` takes precedence.
39
+ *
40
+ * @example '/absolute/path/to/tasty-zero.config.ts'
41
+ */
42
+ configFile?: string;
43
+ /**
44
+ * Absolute file paths whose content affects the generated CSS.
45
+ * When any of these files change, babel-loader invalidates its cache
46
+ * and re-runs the plugin with fresh config values.
47
+ *
48
+ * Typically includes theme files that define Glaze palettes or token values.
49
+ * Paths must be absolute (resolved by the Next.js wrapper).
50
+ */
51
+ configDeps?: string[];
52
+ /**
53
+ * Automatically replace `@tenphi/tasty/static` imports with an import
54
+ * of the generated CSS file. This eliminates the need for users to
55
+ * manually import the CSS in their app entry point.
56
+ *
57
+ * @default true
58
+ */
59
+ injectImport?: boolean;
60
+ /**
61
+ * Output mode for extracted CSS.
62
+ *
63
+ * - `'file'` (default): CSS is written to a single output file and
64
+ * the `@tenphi/tasty/static` import is rewritten to import that file.
65
+ * - `'inject'`: CSS is embedded inline in the JS output and injected
66
+ * at runtime via a tiny injector from `@tenphi/tasty/static/inject`.
67
+ * No CSS file is written. Each `tastyStatic` call becomes
68
+ * self-contained. Best for reusable components and extensions.
69
+ *
70
+ * When `mode` is `'inject'`, `output` and `injectImport` are ignored.
71
+ *
72
+ * @default 'file'
73
+ */
74
+ mode?: 'file' | 'inject';
75
+ }
76
+ /** Clear the shared CSSWriter cache. Exposed for testing. */
77
+ declare function clearWriterCache(): void;
78
+ declare const _default: (api: object, options: TastyZeroBabelOptions | null | undefined, dirname: string) => _$_babel_core0.PluginObj<PluginPass>;
79
+ //#endregion
80
+ export { TastyZeroBabelOptions, TastyZeroConfig, clearWriterCache, _default as default };
81
+ //# sourceMappingURL=babel.d.ts.map