tailwind-styled-v4 5.0.37 → 5.0.39
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/analyzer.js +213 -161
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +121 -83
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.js +131 -87
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +31 -15
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +107 -67
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +47 -14
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +601 -428
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +504 -313
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.js +833 -508
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +298 -30
- package/dist/compiler.mjs.map +1 -1
- package/dist/dashboard.js +72 -41
- package/dist/dashboard.js.map +1 -1
- package/dist/dashboard.mjs +12 -6
- package/dist/dashboard.mjs.map +1 -1
- package/dist/devtools.js +335 -289
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +28 -11
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.js +719 -506
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +520 -318
- package/dist/engine.mjs.map +1 -1
- package/dist/index.d.mts +145 -319
- package/dist/index.d.ts +145 -319
- package/dist/index.js +1337 -7442
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1275 -7386
- package/dist/index.mjs.map +1 -1
- package/dist/next.js +327 -242
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +272 -184
- package/dist/next.mjs.map +1 -1
- package/dist/plugin-api.js +94 -49
- package/dist/plugin-api.js.map +1 -1
- package/dist/plugin-api.mjs +26 -6
- package/dist/plugin-api.mjs.map +1 -1
- package/dist/plugin-registry.js +68 -40
- package/dist/plugin-registry.js.map +1 -1
- package/dist/plugin-registry.mjs +14 -10
- package/dist/plugin-registry.mjs.map +1 -1
- package/dist/plugin.js +102 -53
- package/dist/plugin.js.map +1 -1
- package/dist/plugin.mjs +30 -6
- package/dist/plugin.mjs.map +1 -1
- package/dist/preset.js +48 -15
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +13 -5
- package/dist/preset.mjs.map +1 -1
- package/dist/rspack.js +108 -53
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +50 -18
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.js +63 -24
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +15 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/runtime.js +98 -44
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +31 -8
- package/dist/runtime.mjs.map +1 -1
- package/dist/scanner.js +164 -120
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +70 -40
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +0 -12
- package/dist/shared.d.ts +0 -12
- package/dist/shared.js +481 -299
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +304 -133
- package/dist/shared.mjs.map +1 -1
- package/dist/storybook-addon.js +40 -10
- package/dist/storybook-addon.js.map +1 -1
- package/dist/storybook-addon.mjs +8 -3
- package/dist/storybook-addon.mjs.map +1 -1
- package/dist/svelte.js +95 -64
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +37 -14
- package/dist/svelte.mjs.map +1 -1
- package/dist/syntax.js +69 -37
- package/dist/syntax.js.map +1 -1
- package/dist/syntax.mjs +8 -7
- package/dist/syntax.mjs.map +1 -1
- package/dist/testing.js +56 -18
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +16 -3
- package/dist/testing.mjs.map +1 -1
- package/dist/theme.js +133 -74
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +45 -14
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +156 -115
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +135 -82
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +584 -423
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +498 -311
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +599 -450
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +484 -332
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +102 -70
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +39 -15
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +112 -77
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +52 -18
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/tailwind-styled-native.linux-x64-gnu.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/package.json +3 -1
package/dist/preset.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/domain/preset/src/defaultPreset.ts","../packages/domain/preset/src/presetExtension.ts"],"names":[],"mappings":";;;AAuBA,IAAM,sBAAA,GAAyB;AAAA;AAAA,EAE7B,gCAAA;AAAA,EACA,gCAAA;AAAA,EACA,kCAAA;AAAA,EACA,uCAAA;AAAA;AAAA,EAEA,4BAAA;AAAA,EACA,cAAA;AAAA;AAAA,EAEA;AACF,CAAA;AAMO,IAAM,YAAA,GAAe;AAAA,EAC1B,MAAA,EAAQ;AAAA,IACN,OAAA,EAAS,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC1F,SAAA,EAAW,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;AAAA,IAC5F,MAAA,EAAQ,EAAE,OAAA,EAAS,SAAA,EAAW,OAAO,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,UAAA,EAAY,SAAA,EAAU;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U,MAAA,IAAsC,EAAC;AAErE,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,OAAA,EAAS;AAAA,MACP,GAAK,IAAA,CAAK,OAAA,IAAwB,EAAC;AAAA,MACnC,GAAI,SAAA,CAAU,OAAA,IAAW;AAAC,KAC5B;AAAA,IACA,QAAA,EAAU,SAAA,CAAU,QAAA,IAAY,IAAA,CAAK,QAAA;AAAA,IACrC,KAAA,EAAO;AAAA,MACL,GAAG,SAAA;AAAA,MACH,MAAA,EAAQ;AAAA,QACN,GAAG,UAAA;AAAA,QACH,MAAA,EAAQ;AAAA,UACN,GAAI,UAAA,CAAW,MAAA;AAAA,UACf,GAAI,SAAA,CAAU,MAAA,IAAU;AAAC;AAC3B;AACF,KACF;AAAA,IACA,OAAA,EAAS,CAAC,GAAK,IAAA,CAAK,OAAA,IAAyB,EAAC,EAAI,GAAI,SAAA,CAAU,OAAA,IAAW,EAAG;AAAA,GAChF;AACF;AAMO,SAAS,gBAAgB,OAAA,EAA4D;AAC1F,EAAA,OAAO,QAAQ,MAAA,CAAO,CAAC,GAAA,EAAK,MAAA,KAAW,aAAa,GAAA,EAAK;AAAA,IACvD,OAAA,EAAU,MAAA,CAAO,OAAA,IAAwB,EAAC;AAAA,IAC1C,OAAA,EAAU,MAAA,CAAO,OAAA,IAAyB;AAAC,GAC5C,CAAC,CAAA;AACJ","file":"preset.mjs","sourcesContent":["/**\n * tailwind-styled-v4 — Default Preset\n *\n * Tailwind config built-in yang dipakai ketika developer tidak punya\n * tailwind.config.ts / tailwind.config.js di project mereka.\n *\n * Developer tidak perlu setup apapun:\n * npm install tailwind-styled-v4\n * → langsung bisa tw.div`p-4 bg-blue-500`\n *\n * Preset ini juga menyediakan design tokens yang consistent\n * untuk semua project yang pakai tailwind-styled-v4.\n *\n * Override per-project:\n * // tailwind.config.ts\n * import { defaultPreset } from \"tailwind-styled-v4/preset\"\n * export default { presets: [defaultPreset], theme: { extend: {...} } }\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Content paths — auto-detect berdasarkan project structure\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst STANDARD_CONTENT_PATHS = [\n // Next.js App Router\n \"./src/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./app/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./pages/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./components/**/*.{tsx,ts,jsx,js,mdx}\",\n // Vite / React\n \"./src/**/*.{tsx,ts,jsx,js}\",\n \"./index.html\",\n // Monorepo\n \"../../packages/**/src/**/*.{tsx,ts,jsx,js}\",\n]\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Design tokens — consistent across all tailwind-styled-v4 projects\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const designTokens = {\n colors: {\n primary: { DEFAULT: \"#3b82f6\", hover: \"#2563eb\", active: \"#1d4ed8\", foreground: \"#ffffff\" },\n secondary: { DEFAULT: \"#6366f1\", hover: \"#4f46e5\", active: \"#4338ca\", foreground: \"#ffffff\" },\n accent: { DEFAULT: \"#f59e0b\", hover: \"#d97706\", active: \"#b45309\", foreground: \"#000000\" },\n success: { DEFAULT: \"#10b981\", foreground: \"#ffffff\" },\n warning: { DEFAULT: \"#f59e0b\", foreground: \"#000000\" },\n danger: { DEFAULT: \"#ef4444\", foreground: \"#ffffff\" },\n info: { DEFAULT: \"#3b82f6\", foreground: \"#ffffff\" },\n surface: \"#18181b\",\n border: \"#27272a\",\n muted: \"#71717a\",\n subtle: \"#3f3f46\",\n },\n\n spacing: {\n 1: \"0.25rem\",\n 2: \"0.5rem\",\n 3: \"0.75rem\",\n 4: \"1rem\",\n 5: \"1.25rem\",\n 6: \"1.5rem\",\n 8: \"2rem\",\n 10: \"2.5rem\",\n 12: \"3rem\",\n 16: \"4rem\",\n },\n\n breakpoints: {\n sm: \"40rem\",\n md: \"48rem\",\n lg: \"64rem\",\n xl: \"80rem\",\n \"2xl\": \"96rem\",\n },\n\n fontWeight: {\n normal: \"400\",\n medium: \"500\",\n semibold: \"600\",\n bold: \"700\",\n },\n\n fontFamily: {\n sans: [\"InterVariable\", \"Inter\", \"system-ui\", \"sans-serif\"],\n mono: [\"JetBrains Mono\", \"Fira Code\", \"Consolas\", \"monospace\"],\n },\n\n borderRadius: {\n sm: \"0.25rem\",\n DEFAULT: \"0.5rem\",\n md: \"0.5rem\",\n lg: \"0.75rem\",\n xl: \"1rem\",\n \"2xl\": \"1.5rem\",\n full: \"9999px\",\n },\n\n animation: {\n \"fade-in\": \"fadeIn 0.2s ease-out\",\n \"fade-out\": \"fadeOut 0.2s ease-in\",\n \"slide-up\": \"slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"slide-down\": \"slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"scale-in\": \"scaleIn 0.2s ease-out\",\n },\n\n keyframes: {\n fadeIn: { from: { opacity: \"0\" }, to: { opacity: \"1\" } },\n fadeOut: { from: { opacity: \"1\" }, to: { opacity: \"0\" } },\n slideUp: {\n from: { transform: \"translateY(8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n slideDown: {\n from: { transform: \"translateY(-8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n scaleIn: {\n from: { transform: \"scale(0.95)\", opacity: \"0\" },\n to: { transform: \"scale(1)\", opacity: \"1\" },\n },\n },\n} as const\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Tailwind Config — dipakai sebagai fallback + preset\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultPreset = {\n content: STANDARD_CONTENT_PATHS,\n\n darkMode: \"class\" as const,\n\n theme: {\n extend: {\n colors: designTokens.colors,\n fontFamily: designTokens.fontFamily,\n borderRadius: designTokens.borderRadius,\n animation: designTokens.animation,\n keyframes: designTokens.keyframes,\n },\n },\n\n plugins: [],\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Theme CSS — Tailwind v4 @theme block\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultThemeCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config globals.css — tidak perlu @tailwind base dll\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultGlobalCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n/* tailwind-styled-v4 — zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-surface, #18181b);\n color: var(--color-foreground, #fafafa);\n}\n`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config Tailwind v4 CSS generator\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindCss(contentPaths = STANDARD_CONTENT_PATHS): string {\n return `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n@source ${contentPaths.join(\"\\n@source \")}\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config tailwind.config.ts generator\n// DEPRECATED: Use generateTailwindCss for Tailwind v4 instead\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindConfig(\n safelistPath = \".tailwind-styled-safelist.json\",\n contentPaths = STANDARD_CONTENT_PATHS\n): string {\n return `import type { Config } from \"tailwindcss\"\nimport { defaultPreset } from \"tailwind-styled-v4/preset\"\n\n// Auto-generated safelist dari tailwind-styled-v4 compiler\nconst safelist = (() => {\n try { return require(${JSON.stringify(safelistPath)}) as string[] }\n catch { return [] }\n})()\n\nexport default {\n presets: [defaultPreset],\n content: ${JSON.stringify(contentPaths, null, 2)},\n safelist,\n} satisfies Config\n`\n}\n","/**\n * Preset extension API — jalur ekspansi untuk custom presets.\n * Dari monorepo checklist: \"Siapkan jalur ekspansi preset tanpa memaksa perubahan compiler besar\"\n *\n * Pattern: buat preset custom dengan extend/merge tanpa menyentuh compiler.\n */\nimport { defaultPreset, designTokens } from \"./defaultPreset\"\n\n// Keep preset typing local so preset does not depend on core-only component contracts.\nexport interface PresetComponentConfig {\n readonly base?: string\n readonly variants?: Record<string, Record<string, string>>\n readonly defaultVariants?: Record<string, string>\n readonly compoundVariants?: Array<{ class: string; [key: string]: string }>\n readonly state?: Record<string, Record<string, string>>\n readonly container?: Record<string, string>\n readonly containerName?: string\n}\n\nexport interface PresetExtension {\n /** Token tambahan (akan di-merge dengan defaultPreset tokens) */\n tokens?: Record<string, string>\n /** Component configs default yang bisa di-override */\n components?: Record<string, PresetComponentConfig>\n /** CSS tambahan yang di-inject setelah @theme default */\n additionalCss?: string\n /** Override dark mode strategy */\n darkMode?: \"class\" | \"media\"\n /** Plugin tambahan untuk Tailwind config */\n plugins?: unknown[]\n /** Extend content paths */\n content?: string[]\n}\n\nexport interface PresetOptions {\n /** Nama preset (untuk debugging) */\n name?: string\n /** Override dark mode dari default */\n darkMode?: \"class\" | \"media\"\n /** Custom content paths (merged dengan default) */\n content?: string[]\n}\n\n/** Buat preset custom dari scratch */\nexport function createPreset(\n extension: PresetExtension,\n opts: PresetOptions = {}\n): typeof defaultPreset {\n const { name = \"custom-preset\", darkMode, content = [] } = opts\n\n const mergedTokens = {\n ...designTokens,\n ...extension.tokens,\n }\n\n const base = defaultPreset as Record<string, unknown>\n const baseTheme = (base.theme as Record<string, unknown>) ?? {}\n const baseExtend = (baseTheme.extend as Record<string, unknown>) ?? {}\n\n return {\n ...defaultPreset,\n darkMode: darkMode ?? defaultPreset.darkMode,\n content: [...(defaultPreset.content as string[]), ...content],\n theme: {\n ...baseTheme,\n extend: {\n ...baseExtend,\n colors: {\n ...(baseExtend.colors as Record<string, unknown>),\n ...(extension.tokens\n ? Object.fromEntries(\n Object.entries(extension.tokens).map(([k, v]) => [k, v])\n )\n : {}),\n },\n },\n },\n plugins: [...((defaultPreset.plugins as unknown[]) ?? []), ...(extension.plugins ?? [])],\n } as typeof defaultPreset\n}\n\n/**\n * Extend existing preset dengan tokens/components tambahan.\n * Tidak memerlukan perubahan compiler — semua di Tailwind config layer.\n *\n * @example\n * const myPreset = extendPreset(defaultPreset, {\n * tokens: { \"brand-blue\": \"#1d4ed8\", \"brand-red\": \"#dc2626\" },\n * additionalCss: \".btn { @apply px-4 py-2 rounded; }\",\n * })\n */\nexport function extendPreset(\n base: typeof defaultPreset,\n extension: PresetExtension\n): typeof defaultPreset {\n const baseObj = base as Record<string, unknown>\n const baseTheme = (baseObj.theme as Record<string, unknown>) ?? {}\n const baseExtend = (baseTheme.extend as Record<string, unknown>) ?? {}\n\n return {\n ...base,\n content: [\n ...((base.content as string[]) ?? []),\n ...(extension.content ?? []),\n ],\n darkMode: extension.darkMode ?? base.darkMode,\n theme: {\n ...baseTheme,\n extend: {\n ...baseExtend,\n colors: {\n ...(baseExtend.colors as Record<string, unknown>),\n ...(extension.tokens ?? {}),\n },\n },\n },\n plugins: [...((base.plugins as unknown[]) ?? []), ...(extension.plugins ?? [])],\n } as typeof defaultPreset\n}\n\n/**\n * Merge dua atau lebih presets — tokens, plugins, dan content di-merge.\n * Preset terakhir menang untuk keys yang konflik.\n */\nexport function mergePresets(...presets: Array<typeof defaultPreset>): typeof defaultPreset {\n return presets.reduce((acc, preset) => extendPreset(acc, {\n content: (preset.content as string[]) ?? [],\n plugins: (preset.plugins as unknown[]) ?? [],\n }))\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../packages/domain/preset/src/defaultPreset.ts","../packages/domain/preset/src/presetExtension.ts"],"sourcesContent":["/**\n * tailwind-styled-v4 — Default Preset\n *\n * Tailwind config built-in yang dipakai ketika developer tidak punya\n * tailwind.config.ts / tailwind.config.js di project mereka.\n *\n * Developer tidak perlu setup apapun:\n * npm install tailwind-styled-v4\n * → langsung bisa tw.div`p-4 bg-blue-500`\n *\n * Preset ini juga menyediakan design tokens yang consistent\n * untuk semua project yang pakai tailwind-styled-v4.\n *\n * Override per-project:\n * // tailwind.config.ts\n * import { defaultPreset } from \"tailwind-styled-v4/preset\"\n * export default { presets: [defaultPreset], theme: { extend: {...} } }\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Content paths — auto-detect berdasarkan project structure\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst STANDARD_CONTENT_PATHS = [\n // Next.js App Router\n \"./src/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./app/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./pages/**/*.{tsx,ts,jsx,js,mdx}\",\n \"./components/**/*.{tsx,ts,jsx,js,mdx}\",\n // Vite / React\n \"./src/**/*.{tsx,ts,jsx,js}\",\n \"./index.html\",\n // Monorepo\n \"../../packages/**/src/**/*.{tsx,ts,jsx,js}\",\n]\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Design tokens — consistent across all tailwind-styled-v4 projects\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const designTokens = {\n colors: {\n primary: { DEFAULT: \"#3b82f6\", hover: \"#2563eb\", active: \"#1d4ed8\", foreground: \"#ffffff\" },\n secondary: { DEFAULT: \"#6366f1\", hover: \"#4f46e5\", active: \"#4338ca\", foreground: \"#ffffff\" },\n accent: { DEFAULT: \"#f59e0b\", hover: \"#d97706\", active: \"#b45309\", foreground: \"#000000\" },\n success: { DEFAULT: \"#10b981\", foreground: \"#ffffff\" },\n warning: { DEFAULT: \"#f59e0b\", foreground: \"#000000\" },\n danger: { DEFAULT: \"#ef4444\", foreground: \"#ffffff\" },\n info: { DEFAULT: \"#3b82f6\", foreground: \"#ffffff\" },\n surface: \"#18181b\",\n border: \"#27272a\",\n muted: \"#71717a\",\n subtle: \"#3f3f46\",\n },\n\n spacing: {\n 1: \"0.25rem\",\n 2: \"0.5rem\",\n 3: \"0.75rem\",\n 4: \"1rem\",\n 5: \"1.25rem\",\n 6: \"1.5rem\",\n 8: \"2rem\",\n 10: \"2.5rem\",\n 12: \"3rem\",\n 16: \"4rem\",\n },\n\n breakpoints: {\n sm: \"40rem\",\n md: \"48rem\",\n lg: \"64rem\",\n xl: \"80rem\",\n \"2xl\": \"96rem\",\n },\n\n fontWeight: {\n normal: \"400\",\n medium: \"500\",\n semibold: \"600\",\n bold: \"700\",\n },\n\n fontFamily: {\n sans: [\"InterVariable\", \"Inter\", \"system-ui\", \"sans-serif\"],\n mono: [\"JetBrains Mono\", \"Fira Code\", \"Consolas\", \"monospace\"],\n },\n\n borderRadius: {\n sm: \"0.25rem\",\n DEFAULT: \"0.5rem\",\n md: \"0.5rem\",\n lg: \"0.75rem\",\n xl: \"1rem\",\n \"2xl\": \"1.5rem\",\n full: \"9999px\",\n },\n\n animation: {\n \"fade-in\": \"fadeIn 0.2s ease-out\",\n \"fade-out\": \"fadeOut 0.2s ease-in\",\n \"slide-up\": \"slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"slide-down\": \"slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1)\",\n \"scale-in\": \"scaleIn 0.2s ease-out\",\n },\n\n keyframes: {\n fadeIn: { from: { opacity: \"0\" }, to: { opacity: \"1\" } },\n fadeOut: { from: { opacity: \"1\" }, to: { opacity: \"0\" } },\n slideUp: {\n from: { transform: \"translateY(8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n slideDown: {\n from: { transform: \"translateY(-8px)\", opacity: \"0\" },\n to: { transform: \"translateY(0)\", opacity: \"1\" },\n },\n scaleIn: {\n from: { transform: \"scale(0.95)\", opacity: \"0\" },\n to: { transform: \"scale(1)\", opacity: \"1\" },\n },\n },\n} as const\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Tailwind Config — dipakai sebagai fallback + preset\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultPreset = {\n content: STANDARD_CONTENT_PATHS,\n\n darkMode: \"class\" as const,\n\n theme: {\n extend: {\n colors: designTokens.colors,\n fontFamily: designTokens.fontFamily,\n borderRadius: designTokens.borderRadius,\n animation: designTokens.animation,\n keyframes: designTokens.keyframes,\n },\n },\n\n plugins: [],\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Default Theme CSS — Tailwind v4 @theme block\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultThemeCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config globals.css — tidak perlu @tailwind base dll\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport const defaultGlobalCss = `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n/* tailwind-styled-v4 — zero-config base styles */\n*, *::before, *::after {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n}\n\nbody {\n margin: 0;\n font-family: var(--font-sans, system-ui, sans-serif);\n background: var(--color-surface, #18181b);\n color: var(--color-foreground, #fafafa);\n}\n`\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config Tailwind v4 CSS generator\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindCss(contentPaths = STANDARD_CONTENT_PATHS): string {\n return `@import \"tailwindcss\";\n\n@theme {\n /* colors */\n --color-primary: #3b82f6;\n --color-primary-hover: #2563eb;\n --color-primary-active: #1d4ed8;\n --color-primary-foreground: #ffffff;\n --color-secondary: #6366f1;\n --color-secondary-hover: #4f46e5;\n --color-secondary-active: #4338ca;\n --color-secondary-foreground: #ffffff;\n --color-accent: #f59e0b;\n --color-accent-hover: #d97706;\n --color-accent-active: #b45309;\n --color-accent-foreground: #000000;\n --color-success: #10b981;\n --color-success-foreground: #ffffff;\n --color-warning: #f59e0b;\n --color-warning-foreground: #000000;\n --color-danger: #ef4444;\n --color-danger-foreground: #ffffff;\n --color-info: #3b82f6;\n --color-info-foreground: #ffffff;\n --color-surface: #18181b;\n --color-border: #27272a;\n --color-muted: #71717a;\n --color-subtle: #3f3f46;\n\n /* fonts */\n --font-sans: InterVariable, Inter, system-ui, sans-serif;\n --font-mono: JetBrains Mono, Fira Code, Consolas, monospace;\n\n /* spacing */\n --spacing-1: 0.25rem;\n --spacing-2: 0.5rem;\n --spacing-3: 0.75rem;\n --spacing-4: 1rem;\n --spacing-5: 1.25rem;\n --spacing-6: 1.5rem;\n --spacing-8: 2rem;\n --spacing-10: 2.5rem;\n --spacing-12: 3rem;\n --spacing-16: 4rem;\n\n /* breakpoints */\n --breakpoint-sm: 40rem;\n --breakpoint-md: 48rem;\n --breakpoint-lg: 64rem;\n --breakpoint-xl: 80rem;\n --breakpoint-2xl: 96rem;\n\n /* border radius */\n --radius-sm: 0.25rem;\n --radius-md: 0.5rem;\n --radius-lg: 0.75rem;\n --radius-xl: 1rem;\n --radius-2xl: 1.5rem;\n --radius-full: 9999px;\n\n /* animations */\n --animate-fade-in: fadeIn 0.2s ease-out;\n --animate-fade-out: fadeOut 0.2s ease-in;\n --animate-slide-up: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-slide-down: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);\n --animate-scale-in: scaleIn 0.2s ease-out;\n}\n\n@keyframes fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n@keyframes fadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n@keyframes slideUp {\n from { transform: translateY(8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes slideDown {\n from { transform: translateY(-8px); opacity: 0; }\n to { transform: translateY(0); opacity: 1; }\n}\n@keyframes scaleIn {\n from { transform: scale(0.95); opacity: 0; }\n to { transform: scale(1); opacity: 1; }\n}\n\n@source ${contentPaths.join(\"\\n@source \")}\n`\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Zero-config tailwind.config.ts generator\n// DEPRECATED: Use generateTailwindCss for Tailwind v4 instead\n// Dipakai oleh CLI dan withTailwindStyled saat tidak ada user config\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function generateTailwindConfig(\n safelistPath = \".tailwind-styled-safelist.json\",\n contentPaths = STANDARD_CONTENT_PATHS\n): string {\n return `import type { Config } from \"tailwindcss\"\nimport { defaultPreset } from \"tailwind-styled-v4/preset\"\n\n// Auto-generated safelist dari tailwind-styled-v4 compiler\nconst safelist = (() => {\n try { return require(${JSON.stringify(safelistPath)}) as string[] }\n catch { return [] }\n})()\n\nexport default {\n presets: [defaultPreset],\n content: ${JSON.stringify(contentPaths, null, 2)},\n safelist,\n} satisfies Config\n`\n}\n","/**\n * Preset extension API — jalur ekspansi untuk custom presets.\n * Dari monorepo checklist: \"Siapkan jalur ekspansi preset tanpa memaksa perubahan compiler besar\"\n *\n * Pattern: buat preset custom dengan extend/merge tanpa menyentuh compiler.\n */\nimport { defaultPreset, designTokens } from \"./defaultPreset\"\n\n// Keep preset typing local so preset does not depend on core-only component contracts.\nexport interface PresetComponentConfig {\n readonly base?: string\n readonly variants?: Record<string, Record<string, string>>\n readonly defaultVariants?: Record<string, string>\n readonly compoundVariants?: Array<{ class: string; [key: string]: string }>\n readonly state?: Record<string, Record<string, string>>\n readonly container?: Record<string, string>\n readonly containerName?: string\n}\n\nexport interface PresetExtension {\n /** Token tambahan (akan di-merge dengan defaultPreset tokens) */\n tokens?: Record<string, string>\n /** Component configs default yang bisa di-override */\n components?: Record<string, PresetComponentConfig>\n /** CSS tambahan yang di-inject setelah @theme default */\n additionalCss?: string\n /** Override dark mode strategy */\n darkMode?: \"class\" | \"media\"\n /** Plugin tambahan untuk Tailwind config */\n plugins?: unknown[]\n /** Extend content paths */\n content?: string[]\n}\n\nexport interface PresetOptions {\n /** Nama preset (untuk debugging) */\n name?: string\n /** Override dark mode dari default */\n darkMode?: \"class\" | \"media\"\n /** Custom content paths (merged dengan default) */\n content?: string[]\n}\n\n/** Buat preset custom dari scratch */\nexport function createPreset(\n extension: PresetExtension,\n opts: PresetOptions = {}\n): typeof defaultPreset {\n const { name = \"custom-preset\", darkMode, content = [] } = opts\n\n const mergedTokens = {\n ...designTokens,\n ...extension.tokens,\n }\n\n const base = defaultPreset as Record<string, unknown>\n const baseTheme = (base.theme as Record<string, unknown>) ?? {}\n const baseExtend = (baseTheme.extend as Record<string, unknown>) ?? {}\n\n return {\n ...defaultPreset,\n darkMode: darkMode ?? defaultPreset.darkMode,\n content: [...(defaultPreset.content as string[]), ...content],\n theme: {\n ...baseTheme,\n extend: {\n ...baseExtend,\n colors: {\n ...(baseExtend.colors as Record<string, unknown>),\n ...(extension.tokens\n ? Object.fromEntries(\n Object.entries(extension.tokens).map(([k, v]) => [k, v])\n )\n : {}),\n },\n },\n },\n plugins: [...((defaultPreset.plugins as unknown[]) ?? []), ...(extension.plugins ?? [])],\n } as typeof defaultPreset\n}\n\n/**\n * Extend existing preset dengan tokens/components tambahan.\n * Tidak memerlukan perubahan compiler — semua di Tailwind config layer.\n *\n * @example\n * const myPreset = extendPreset(defaultPreset, {\n * tokens: { \"brand-blue\": \"#1d4ed8\", \"brand-red\": \"#dc2626\" },\n * additionalCss: \".btn { @apply px-4 py-2 rounded; }\",\n * })\n */\nexport function extendPreset(\n base: typeof defaultPreset,\n extension: PresetExtension\n): typeof defaultPreset {\n const baseObj = base as Record<string, unknown>\n const baseTheme = (baseObj.theme as Record<string, unknown>) ?? {}\n const baseExtend = (baseTheme.extend as Record<string, unknown>) ?? {}\n\n return {\n ...base,\n content: [\n ...((base.content as string[]) ?? []),\n ...(extension.content ?? []),\n ],\n darkMode: extension.darkMode ?? base.darkMode,\n theme: {\n ...baseTheme,\n extend: {\n ...baseExtend,\n colors: {\n ...(baseExtend.colors as Record<string, unknown>),\n ...(extension.tokens ?? {}),\n },\n },\n },\n plugins: [...((base.plugins as unknown[]) ?? []), ...(extension.plugins ?? [])],\n } as typeof defaultPreset\n}\n\n/**\n * Merge dua atau lebih presets — tokens, plugins, dan content di-merge.\n * Preset terakhir menang untuk keys yang konflik.\n */\nexport function mergePresets(...presets: Array<typeof defaultPreset>): typeof defaultPreset {\n return presets.reduce((acc, preset) => extendPreset(acc, {\n content: (preset.content as string[]) ?? [],\n plugins: (preset.plugins as unknown[]) ?? [],\n }))\n}\n"],"mappings":";;;AAuBA,IAAM,yBAAyB;AAAA;AAAA,EAE7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA;AAAA,EAEA;AACF;AAMO,IAAM,eAAe;AAAA,EAC1B,QAAQ;AAAA,IACN,SAAS,EAAE,SAAS,WAAW,OAAO,WAAW,QAAQ,WAAW,YAAY,UAAU;AAAA,IAC1F,WAAW,EAAE,SAAS,WAAW,OAAO,WAAW,QAAQ,WAAW,YAAY,UAAU;AAAA,IAC5F,QAAQ,EAAE,SAAS,WAAW,OAAO,WAAW,QAAQ,WAAW,YAAY,UAAU;AAAA,IACzF,SAAS,EAAE,SAAS,WAAW,YAAY,UAAU;AAAA,IACrD,SAAS,EAAE,SAAS,WAAW,YAAY,UAAU;AAAA,IACrD,QAAQ,EAAE,SAAS,WAAW,YAAY,UAAU;AAAA,IACpD,MAAM,EAAE,SAAS,WAAW,YAAY,UAAU;AAAA,IAClD,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,QAAQ;AAAA,EACV;AAAA,EAEA,SAAS;AAAA,IACP,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,EACN;AAAA,EAEA,aAAa;AAAA,IACX,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAA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U,OAAO,WAAyB,CAAC;AAAA,EAC7C,CAAC,CAAC;AACJ;","names":[]}
|
package/dist/rspack.js
CHANGED
|
@@ -1,36 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require('crypto');
|
|
4
|
-
var fs2 = require('fs');
|
|
5
|
-
var path2 = require('path');
|
|
6
|
-
require('url');
|
|
7
|
-
var module$1 = require('module');
|
|
8
|
-
var zod = require('zod');
|
|
9
|
-
|
|
10
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
11
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
|
|
13
|
-
var fs2__default = /*#__PURE__*/_interopDefault(fs2);
|
|
14
|
-
var path2__default = /*#__PURE__*/_interopDefault(path2);
|
|
15
|
-
|
|
1
|
+
const __importMetaUrl = typeof __filename !== "undefined" ? require("node:url").pathToFileURL(__filename).href : "file://unknown";
|
|
16
2
|
/* tailwind-styled-v4 v5.0.4 | MIT | https://github.com/dictionar32/tailwind-styled-v4 */
|
|
3
|
+
"use strict";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
}) : x)(function(x) {
|
|
21
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
22
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
|
-
});
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
10
|
var __esm = (fn, res) => function __init() {
|
|
25
11
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
26
12
|
};
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
30
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
31
|
+
mod
|
|
32
|
+
));
|
|
33
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
34
|
|
|
28
35
|
// packages/domain/shared/src/esmHelpers.ts
|
|
29
36
|
function getNodeModuleRef() {
|
|
30
37
|
if (isBrowser) return null;
|
|
31
38
|
if (nodeModuleRef !== null) return nodeModuleRef;
|
|
32
39
|
try {
|
|
33
|
-
const test = typeof
|
|
40
|
+
const test = typeof require === "function" ? require("module") : null;
|
|
34
41
|
nodeModuleRef = test;
|
|
35
42
|
return test;
|
|
36
43
|
} catch {
|
|
@@ -38,22 +45,44 @@ function getNodeModuleRef() {
|
|
|
38
45
|
return null;
|
|
39
46
|
}
|
|
40
47
|
}
|
|
48
|
+
function getCurrentFileUrl() {
|
|
49
|
+
if (__importMetaUrl) {
|
|
50
|
+
return __importMetaUrl;
|
|
51
|
+
}
|
|
52
|
+
if (typeof __filename !== "undefined") {
|
|
53
|
+
return `file://${__filename.replace(/\\/g, "/")}`;
|
|
54
|
+
}
|
|
55
|
+
return "file://unknown";
|
|
56
|
+
}
|
|
41
57
|
function getNodePath() {
|
|
42
58
|
if (isBrowser) throw new Error("node:path not available in browser");
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
59
|
+
if (!_nodePath) {
|
|
60
|
+
if (typeof require === "function") {
|
|
61
|
+
_nodePath = require("path");
|
|
62
|
+
} else {
|
|
63
|
+
const nodeRequire = getNodeModuleRef();
|
|
64
|
+
if (!nodeRequire) throw new Error("require not available");
|
|
65
|
+
_nodePath = nodeRequire.createRequire(getCurrentFileUrl())("node:path");
|
|
66
|
+
}
|
|
67
|
+
}
|
|
46
68
|
return _nodePath;
|
|
47
69
|
}
|
|
48
70
|
function getNodeUrl() {
|
|
49
71
|
if (isBrowser) throw new Error("node:url not available in browser");
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
if (!_nodeUrl) {
|
|
73
|
+
if (typeof require === "function") {
|
|
74
|
+
_nodeUrl = require("url");
|
|
75
|
+
} else {
|
|
76
|
+
const nodeRequire = getNodeModuleRef();
|
|
77
|
+
if (!nodeRequire) throw new Error("require not available");
|
|
78
|
+
_nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())("node:url");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
53
81
|
return _nodeUrl;
|
|
54
82
|
}
|
|
55
83
|
function getDirname(importMetaUrl) {
|
|
56
84
|
if (isBrowser) return "";
|
|
85
|
+
if (typeof __dirname !== "undefined") return __dirname;
|
|
57
86
|
const nodePath = getNodePath();
|
|
58
87
|
const nodeUrl = getNodeUrl();
|
|
59
88
|
return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl));
|
|
@@ -61,21 +90,30 @@ function getDirname(importMetaUrl) {
|
|
|
61
90
|
var isBrowser, nodeModuleRef, _nodePath, _nodeUrl;
|
|
62
91
|
var init_esmHelpers = __esm({
|
|
63
92
|
"packages/domain/shared/src/esmHelpers.ts"() {
|
|
93
|
+
"use strict";
|
|
64
94
|
isBrowser = typeof window !== "undefined" || typeof document !== "undefined";
|
|
65
95
|
nodeModuleRef = null;
|
|
66
96
|
_nodePath = null;
|
|
67
97
|
_nodeUrl = null;
|
|
68
98
|
}
|
|
69
99
|
});
|
|
100
|
+
|
|
101
|
+
// packages/domain/shared/src/index.ts
|
|
70
102
|
function formatIssuePath(path3) {
|
|
71
103
|
if (!path3 || path3.length === 0) return "(root)";
|
|
72
104
|
return path3.map(
|
|
73
105
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
74
106
|
).join(".");
|
|
75
107
|
}
|
|
76
|
-
var TwError;
|
|
108
|
+
var import_node_crypto, import_node_fs, import_node_path, import_node_url, import_node_module, TwError, _require;
|
|
77
109
|
var init_src = __esm({
|
|
78
110
|
"packages/domain/shared/src/index.ts"() {
|
|
111
|
+
"use strict";
|
|
112
|
+
import_node_crypto = require("crypto");
|
|
113
|
+
import_node_fs = __toESM(require("fs"));
|
|
114
|
+
import_node_path = __toESM(require("path"));
|
|
115
|
+
import_node_url = require("url");
|
|
116
|
+
import_node_module = require("module");
|
|
79
117
|
init_esmHelpers();
|
|
80
118
|
TwError = class _TwError extends Error {
|
|
81
119
|
/** @deprecated Gunakan source */
|
|
@@ -129,14 +167,29 @@ var init_src = __esm({
|
|
|
129
167
|
return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`;
|
|
130
168
|
}
|
|
131
169
|
};
|
|
132
|
-
|
|
170
|
+
_require = (0, import_node_module.createRequire)(
|
|
171
|
+
typeof __filename !== "undefined" ? `file://${__filename}` : __importMetaUrl ?? "file://unknown"
|
|
172
|
+
);
|
|
133
173
|
}
|
|
134
174
|
});
|
|
135
175
|
|
|
176
|
+
// src/umbrella/rspack.ts
|
|
177
|
+
var rspack_exports = {};
|
|
178
|
+
__export(rspack_exports, {
|
|
179
|
+
RspackPluginOptionsSchema: () => RspackPluginOptionsSchema,
|
|
180
|
+
TailwindStyledRspackPlugin: () => TailwindStyledRspackPlugin,
|
|
181
|
+
parseRspackPluginOptions: () => parseRspackPluginOptions,
|
|
182
|
+
tailwindStyledRspackPlugin: () => tailwindStyledRspackPlugin
|
|
183
|
+
});
|
|
184
|
+
module.exports = __toCommonJS(rspack_exports);
|
|
185
|
+
|
|
136
186
|
// packages/presentation/rspack/src/index.ts
|
|
187
|
+
var import_node_fs2 = __toESM(require("fs"), 1);
|
|
188
|
+
var import_node_path2 = __toESM(require("path"), 1);
|
|
137
189
|
init_src();
|
|
138
190
|
|
|
139
191
|
// packages/presentation/rspack/src/schemas.ts
|
|
192
|
+
var import_zod = require("zod");
|
|
140
193
|
init_src();
|
|
141
194
|
var formatIssuePath2 = (path3) => path3.length > 0 ? path3.map(
|
|
142
195
|
(segment) => typeof segment === "symbol" ? segment.description ?? segment.toString() : String(segment)
|
|
@@ -156,24 +209,25 @@ var parseWithSchema = (schema, data, label) => {
|
|
|
156
209
|
parsed.error
|
|
157
210
|
);
|
|
158
211
|
};
|
|
159
|
-
var RspackPluginOptionsSchema =
|
|
160
|
-
include:
|
|
161
|
-
exclude:
|
|
162
|
-
addDataAttr:
|
|
163
|
-
analyze:
|
|
164
|
-
cssEntry:
|
|
212
|
+
var RspackPluginOptionsSchema = import_zod.z.object({
|
|
213
|
+
include: import_zod.z.instanceof(RegExp).optional(),
|
|
214
|
+
exclude: import_zod.z.instanceof(RegExp).optional(),
|
|
215
|
+
addDataAttr: import_zod.z.boolean().optional(),
|
|
216
|
+
analyze: import_zod.z.boolean().optional(),
|
|
217
|
+
cssEntry: import_zod.z.string().optional(),
|
|
165
218
|
/** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */
|
|
166
|
-
safelistPath:
|
|
219
|
+
safelistPath: import_zod.z.string().optional()
|
|
167
220
|
});
|
|
168
221
|
var parseRspackPluginOptions = (options) => parseWithSchema(RspackPluginOptionsSchema, options ?? {}, "rspack plugin options are invalid");
|
|
169
222
|
|
|
170
223
|
// packages/presentation/rspack/src/index.ts
|
|
224
|
+
var import_meta = {};
|
|
171
225
|
function getDirname2() {
|
|
172
226
|
if (typeof __dirname !== "undefined") {
|
|
173
227
|
return __dirname;
|
|
174
228
|
}
|
|
175
|
-
if (typeof
|
|
176
|
-
return getDirname(
|
|
229
|
+
if (typeof import_meta !== "undefined" && __importMetaUrl) {
|
|
230
|
+
return getDirname(__importMetaUrl);
|
|
177
231
|
}
|
|
178
232
|
return process.cwd();
|
|
179
233
|
}
|
|
@@ -181,10 +235,10 @@ function resolveLoaderPath(basename) {
|
|
|
181
235
|
const runtimeDir = getDirname2();
|
|
182
236
|
const preferredExtensions = typeof __dirname !== "undefined" && __dirname.length > 0 ? [".cjs", ".js"] : [".js", ".cjs"];
|
|
183
237
|
for (const ext of preferredExtensions) {
|
|
184
|
-
const candidate =
|
|
185
|
-
if (
|
|
238
|
+
const candidate = import_node_path2.default.resolve(runtimeDir, `${basename}${ext}`);
|
|
239
|
+
if (import_node_fs2.default.existsSync(candidate)) return candidate;
|
|
186
240
|
}
|
|
187
|
-
return
|
|
241
|
+
return import_node_path2.default.resolve(runtimeDir, `${basename}.js`);
|
|
188
242
|
}
|
|
189
243
|
var TailwindStyledRspackPlugin = class {
|
|
190
244
|
opts;
|
|
@@ -199,12 +253,12 @@ var TailwindStyledRspackPlugin = class {
|
|
|
199
253
|
(rule2) => typeof rule2 === "object" && rule2 !== null && rule2._tailwindStyledRspackMarker === true
|
|
200
254
|
);
|
|
201
255
|
if (alreadyRegistered) return;
|
|
202
|
-
const safelistPath = this.opts.safelistPath ??
|
|
203
|
-
const stateStaticPath =
|
|
204
|
-
if (!
|
|
256
|
+
const safelistPath = this.opts.safelistPath ?? import_node_path2.default.join(process.cwd(), "__tw_safelist.css");
|
|
257
|
+
const stateStaticPath = import_node_path2.default.join(import_node_path2.default.dirname(safelistPath), "_tw-state-static.css");
|
|
258
|
+
if (!import_node_fs2.default.existsSync(stateStaticPath)) {
|
|
205
259
|
try {
|
|
206
|
-
|
|
207
|
-
|
|
260
|
+
import_node_fs2.default.mkdirSync(import_node_path2.default.dirname(stateStaticPath), { recursive: true });
|
|
261
|
+
import_node_fs2.default.writeFileSync(
|
|
208
262
|
stateStaticPath,
|
|
209
263
|
`/* _tw-state-static.css \u2014 Auto-generated by tailwind-styled-v4. DO NOT EDIT.
|
|
210
264
|
* Import di CSS entry: @import "./_tw-state-static.css";
|
|
@@ -240,10 +294,11 @@ var TailwindStyledRspackPlugin = class {
|
|
|
240
294
|
function tailwindStyledRspackPlugin(opts = {}) {
|
|
241
295
|
return new TailwindStyledRspackPlugin(opts);
|
|
242
296
|
}
|
|
243
|
-
|
|
244
|
-
exports
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
297
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
298
|
+
0 && (module.exports = {
|
|
299
|
+
RspackPluginOptionsSchema,
|
|
300
|
+
TailwindStyledRspackPlugin,
|
|
301
|
+
parseRspackPluginOptions,
|
|
302
|
+
tailwindStyledRspackPlugin
|
|
303
|
+
});
|
|
249
304
|
//# sourceMappingURL=rspack.js.map
|
package/dist/rspack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"names":["path","createRequire","formatIssuePath","z","getDirname","fs","rule"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,gBAAA,GAAwD;AAC/D,EAAA,IAAI,WAAW,OAAO,IAAA;AACtB,EAAA,IAAI,aAAA,KAAkB,MAAM,OAAO,aAAA;AACnC,EAAA,IAAI;AAEF,IAAA,MAAM,OAAO,OAAO,SAAA,KAAY,UAAA,GAAc,SAAA,CAAQ,QAAa,CAAA,GAAqC,IAAA;AACxG,IAAA,aAAA,GAAgB,IAAA;AAChB,IAAA,OAAO,IAAA;AAAA,EACT,CAAA,CAAA,MAA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B;AAAA;AACF;AACF;AACF,KACF;AAEA,IAAA,QAAA,CAAS,QAAQ,MAAA,GAAS;AAAA,MACxB,GAAI,QAAA,CAAS,OAAA,CAAQ,MAAA,IAAU,EAAC;AAAA,MAChC,KAAA,EAAO,CAAC,IAAA,EAAM,GAAG,QAAQ;AAAA,KAC3B;AAAA,EACF;AACF;AAEO,SAAS,0BAAA,CACd,IAAA,GAA4B,EAAC,EACD;AAC5B,EAAA,OAAO,IAAI,2BAA2B,IAAI,CAAA;AAC5C","file":"rspack.js","sourcesContent":["/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n // Test if require actually works\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n if (!_nodePath) _nodePath = nodeRequire.createRequire(import.meta.url)(\"node:path\") as typeof import(\"node:path\")\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n if (!_nodeUrl) _nodeUrl = nodeRequire.createRequire(import.meta.url)(\"node:url\") as typeof import(\"node:url\")\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n if (!_nodeFs) _nodeFs = nodeRequire.createRequire(import.meta.url)(\"node:fs\") as typeof import(\"node:fs\")\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n if (!_nodeCrypto) _nodeCrypto = nodeRequire.createRequire(import.meta.url)(\"node:crypto\") as typeof import(\"node:crypto\")\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n if (!_nodeOs) _nodeOs = nodeRequire.createRequire(import.meta.url)(\"node:os\") as typeof import(\"node:os\")\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * // Ganti: createRequire(import.meta.url)(\"some-pkg\")\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * // Ganti: const __dirname = ...\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n * Berguna untuk scripts dan tools yang dipanggil dari lokasi berbeda.\n *\n * @example\n * const root = resolveFromRoot(\"packages/domain/shared/src\")\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n \n let dir = getDirname(import.meta.url)\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n * Berguna untuk optional dependencies.\n *\n * @example\n * const oxc = tryRequire(\"oxc-parser\", import.meta.url)\n * if (!oxc) console.warn(\"oxc-parser not installed\")\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n * Menggantikan pola `path.resolve(__dirname, \"../native.node\")`.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(import.meta.url)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\n parseWithSchema(RspackPluginOptionsSchema, options ?? {}, \"rspack plugin options are invalid\")\n"]}
|
|
1
|
+
{"version":3,"sources":["../packages/domain/shared/src/esmHelpers.ts","../packages/domain/shared/src/index.ts","../src/umbrella/rspack.ts","../packages/presentation/rspack/src/index.ts","../packages/presentation/rspack/src/schemas.ts"],"sourcesContent":["/**\n * ESM-safe runtime helpers untuk monorepo.\n *\n * Menggantikan pola fragile seperti:\n * - `createRequire(import.meta.url)` → gunakan `createEsmRequire()`\n * - `__dirname` → gunakan `getDirname(import.meta.url)`\n * - `__filename` → gunakan `getFilename(import.meta.url)`\n *\n * Semua helper ini bekerja di ESM dan CJS.\n *\n * @module @tailwind-styled/shared/esmHelpers\n */\n\nconst isBrowser = typeof window !== \"undefined\" || typeof document !== \"undefined\"\n\n// Safe check for require availability - works in both CJS and ESM\nlet nodeModuleRef: typeof import(\"node:module\") | null = null\nfunction getNodeModuleRef(): typeof import(\"node:module\") | null {\n if (isBrowser) return null\n if (nodeModuleRef !== null) return nodeModuleRef\n try {\n const test = typeof require === 'function' ? (require('node:module') as typeof import(\"node:module\")) : null\n nodeModuleRef = test\n return test\n } catch {\n nodeModuleRef = null\n return null\n }\n}\n\nlet _nodePath: typeof import(\"node:path\") | null = null\nlet _nodeUrl: typeof import(\"node:url\") | null = null\nlet _nodeFs: typeof import(\"node:fs\") | null = null\nlet _nodeCrypto: typeof import(\"node:crypto\") | null = null\nlet _nodeOs: typeof import(\"node:os\") | null = null\n\n/**\n * Get current file URL in a way that works in both ESM and CJS.\n * In ESM: uses import.meta.url\n * In CJS: uses __filename converted to file URL\n */\nfunction getCurrentFileUrl(): string {\n // In CJS builds, import.meta.url is replaced by esbuild with __importMetaUrl\n // which is set via the banner polyfill. In ESM it's the real URL.\n if (import.meta.url) {\n return import.meta.url\n }\n // Fallback: __filename is available in bare CJS (not bundled)\n if (typeof __filename !== \"undefined\") {\n return `file://${__filename.replace(/\\\\/g, \"/\")}`\n }\n return \"file://unknown\"\n}\n\nfunction getNodePath(): typeof import(\"node:path\") {\n if (isBrowser) throw new Error(\"node:path not available in browser\")\n if (!_nodePath) {\n if (typeof require === \"function\") {\n _nodePath = require(\"node:path\") as typeof import(\"node:path\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodePath = nodeRequire.createRequire(getCurrentFileUrl())(\"node:path\") as typeof import(\"node:path\")\n }\n }\n return _nodePath!\n}\nfunction getNodeUrl(): typeof import(\"node:url\") {\n if (isBrowser) throw new Error(\"node:url not available in browser\")\n if (!_nodeUrl) {\n if (typeof require === \"function\") {\n _nodeUrl = require(\"node:url\") as typeof import(\"node:url\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeUrl = nodeRequire.createRequire(getCurrentFileUrl())(\"node:url\") as typeof import(\"node:url\")\n }\n }\n return _nodeUrl!\n}\nfunction getNodeFs(): typeof import(\"node:fs\") {\n if (isBrowser) throw new Error(\"node:fs not available in browser\")\n if (!_nodeFs) {\n if (typeof require === \"function\") {\n _nodeFs = require(\"node:fs\") as typeof import(\"node:fs\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeFs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:fs\") as typeof import(\"node:fs\")\n }\n }\n return _nodeFs!\n}\nfunction getNodeCrypto(): typeof import(\"node:crypto\") {\n if (isBrowser) throw new Error(\"node:crypto not available in browser\")\n if (!_nodeCrypto) {\n if (typeof require === \"function\") {\n _nodeCrypto = require(\"node:crypto\") as typeof import(\"node:crypto\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeCrypto = nodeRequire.createRequire(getCurrentFileUrl())(\"node:crypto\") as typeof import(\"node:crypto\")\n }\n }\n return _nodeCrypto!\n}\nfunction getNodeOs(): typeof import(\"node:os\") {\n if (isBrowser) throw new Error(\"node:os not available in browser\")\n if (!_nodeOs) {\n if (typeof require === \"function\") {\n _nodeOs = require(\"node:os\") as typeof import(\"node:os\")\n } else {\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n _nodeOs = nodeRequire.createRequire(getCurrentFileUrl())(\"node:os\") as typeof import(\"node:os\")\n }\n }\n return _nodeOs!\n}\n\n/**\n * Buat `require()` function yang relative terhadap sebuah ESM module.\n *\n * @example\n * const req = createEsmRequire(import.meta.url)\n * const mod = req(\"some-pkg\")\n */\nexport function createEsmRequire(importMetaUrl: string): NodeRequire {\n if (isBrowser) throw new Error(\"require not available in browser\")\n // CJS: require is already available globally\n if (typeof require === \"function\") return require\n const nodeRequire = getNodeModuleRef()\n if (!nodeRequire) throw new Error(\"require not available\")\n return nodeRequire.createRequire(importMetaUrl)\n}\n\n/**\n * Dapat `__dirname` dari `import.meta.url`.\n *\n * @example\n * const dir = getDirname(import.meta.url)\n */\nexport function getDirname(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __dirname is directly available\n if (typeof __dirname !== \"undefined\") return __dirname\n const nodePath = getNodePath()\n const nodeUrl = getNodeUrl()\n return nodePath.dirname(nodeUrl.fileURLToPath(importMetaUrl))\n}\n\n/**\n * Dapat `__filename` dari `import.meta.url`.\n */\nexport function getFilename(importMetaUrl: string): string {\n if (isBrowser) return \"\"\n // CJS: __filename is directly available\n if (typeof __filename !== \"undefined\") return __filename\n return getNodeUrl().fileURLToPath(importMetaUrl)\n}\n\n/**\n * Resolve path dari root monorepo (bukan CWD).\n */\nexport function resolveFromRoot(...segments: string[]): string {\n if (isBrowser) return segments.join(\"/\")\n\n const nodePath = getNodePath()\n const nodeFs = getNodeFs()\n\n // Use __dirname in CJS, or getDirname with current file URL in ESM\n let dir = typeof __dirname !== \"undefined\"\n ? __dirname\n : getDirname(getCurrentFileUrl())\n\n for (let i = 0; i < 10; i++) {\n const pkgPath = nodePath.join(dir, \"package.json\")\n try {\n const pkg = JSON.parse(nodeFs.readFileSync(pkgPath, \"utf-8\"))\n if (pkg.workspaces) {\n return nodePath.resolve(dir, ...segments)\n }\n } catch { /* intentionally silent */ }\n dir = nodePath.dirname(dir)\n }\n return nodePath.resolve(process.cwd(), ...segments)\n}\n\n/**\n * Require sebuah module dengan fallback ke null jika tidak tersedia.\n */\nexport function tryRequire<T = unknown>(\n moduleName: string,\n importMetaUrl: string\n): T | null {\n if (isBrowser) return null\n try {\n return createEsmRequire(importMetaUrl)(moduleName) as T\n } catch { /* intentionally silent — optional dep */ }\n return null\n}\n\n/**\n * Resolve .node binary path yang cross-platform dan ESM-safe.\n */\nexport function resolveNativeNodePath(\n importMetaUrl: string,\n ...relativeSegments: string[]\n): string {\n if (isBrowser) return relativeSegments.join(\"/\")\n return getNodePath().resolve(getDirname(importMetaUrl), ...relativeSegments)\n}\n","import { createHash } from \"node:crypto\"\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { fileURLToPath } from \"node:url\"\nimport { createRequire } from \"node:module\"\n\n// Native-only: Node.js is always available. No browser fallback.\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Types\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type TokenMap = Record<string, string>\n\nexport type VariantValue = string | number | boolean | undefined\n\nexport type VariantProps = Record<string, VariantValue>\n\nexport type HtmlTagName = keyof HTMLElementTagNameMap\n\nexport type CompoundCondition = Record<string, string | number | boolean>\n\nexport type VariantMatrix = Record<string, Array<string | number | boolean>>\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Logging\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface Logger {\n warn(...args: unknown[]): void\n debug(...args: unknown[]): void\n error(...args: unknown[]): void\n log(...args: unknown[]): void\n}\n\nexport function createLogger(namespace: string): Logger {\n const prefix = `[${namespace}]`\n return {\n warn(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n debug(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n error(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n log(...args: unknown[]) {\n process.stderr.write(`${prefix} ${args.map(a => typeof a === \"string\" ? a : String(a)).join(\" \")}\\n`)\n },\n }\n}\n\nexport function createDebugLogger(namespace: string, label?: string): (msg: string) => void {\n const prefix = label ? `[${namespace}:${label}]` : `[${namespace}]`\n return (msg: string) => {\n if (process.env.DEBUG?.includes(namespace) || process.env.TW_DEBUG) {\n console.debug(prefix, msg)\n }\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error handling\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type ErrorSource = \"rust\" | \"validation\" | \"compile\" | \"io\" | \"config\" | \"unknown\"\n\ntype ZodLikeIssue = {\n path?: readonly PropertyKey[]\n message?: string\n}\n\nfunction formatIssuePath(path?: readonly PropertyKey[]): string {\n if (!path || path.length === 0) return \"(root)\"\n return path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n}\n\nexport class TwError extends Error {\n /** @deprecated Gunakan source */\n public readonly domain: string\n public readonly source: ErrorSource\n public readonly code: string\n public readonly originalCause?: unknown\n\n constructor(domainOrSource: string, code: string, message: string, cause?: unknown) {\n super(message)\n this.name = \"TwError\"\n this.domain = domainOrSource\n this.source = domainOrSource as ErrorSource\n this.code = code\n this.originalCause = cause\n if (Error.captureStackTrace) Error.captureStackTrace(this, TwError)\n }\n\n static fromIo(code: string, message: string): TwError {\n return new TwError(\"io\", code, message)\n }\n\n static fromCompile(code: string, message: string): TwError {\n return new TwError(\"compile\", code, message)\n }\n\n static fromRust(err: { code?: string; message?: string } | Error | unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(\"rust\", \"RUST_ERROR\", err.message, err)\n if (err && typeof err === \"object\") {\n const e = err as { code?: string; message?: string }\n return new TwError(\"rust\", e.code ?? \"RUST_ERROR\", e.message ?? String(err), err)\n }\n return new TwError(\"rust\", \"RUST_ERROR\", String(err), err)\n }\n\n /** Buat TwError dari ZodError — dukung shape Zod v3 (`errors`) dan v4 (`issues`). */\n static fromZod(err: { issues?: ZodLikeIssue[]; errors?: ZodLikeIssue[] }): TwError {\n const first = err.issues?.[0] ?? err.errors?.[0]\n const path = formatIssuePath(first?.path)\n const message = first ? `${path}: ${first.message}` : \"Schema validation failed\"\n return new TwError(\"validation\", \"SCHEMA_VALIDATION_FAILED\", message, err)\n }\n\n static wrap(source: string, code: string, err: unknown): TwError {\n if (err instanceof TwError) return err\n if (err instanceof Error) return new TwError(source, code, err.message, err)\n return new TwError(source, code, String(err), err)\n }\n\n override toString(): string {\n return `TwError [${this.source}:${this.code}] ${this.message}`\n }\n\n toJSON(): { name: string; source: string; code: string; message: string } {\n return { name: this.name, source: this.source, code: this.code, message: this.message }\n }\n\n toCliMessage(): string {\n return `[${this.source.toUpperCase()}:${this.code}] ${this.message}`\n }\n}\n\nexport function wrapUnknownError(domain: string, code: string, error: unknown): TwError {\n return TwError.wrap(domain, code, error)\n}\n\nexport function isTwError(err: unknown): err is TwError {\n return err instanceof TwError\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Native binding resolution\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport interface LoadNativeBindingOptions<T> {\n runtimeDir: string\n candidates: string[]\n isValid: (module: unknown) => module is T\n invalidExportMessage: string\n}\n\nexport interface LoadNativeBindingResult<T> {\n binding: T | null\n loadErrors: Array<{ path: string; message: string }>\n loadedPath?: string\n}\n\nexport function loadNativeBinding<T>(options: LoadNativeBindingOptions<T>): LoadNativeBindingResult<T> {\n const { runtimeDir, candidates, isValid } = options\n const loadErrors: Array<{ path: string; message: string }> = []\n\n for (const candidate of candidates) {\n const candidatePath = path.resolve(runtimeDir, candidate)\n try {\n if (!fs.existsSync(candidatePath) && !fs.existsSync(candidatePath + \".node\")) {\n continue\n }\n const mod = requireNativeModule(candidatePath)\n if (mod && isValid(mod)) {\n return { binding: mod, loadErrors, loadedPath: candidatePath }\n }\n loadErrors.push({ path: candidatePath, message: options.invalidExportMessage })\n } catch (e) {\n loadErrors.push({ path: candidatePath, message: e instanceof Error ? e.message : String(e) })\n }\n }\n\n return { binding: null, loadErrors }\n}\n\nconst _require = createRequire(\n typeof __filename !== \"undefined\"\n ? `file://${__filename}`\n : (import.meta.url ?? \"file://unknown\")\n)\n\nfunction requireNativeModule(p: string): unknown {\n return _require(p)\n}\n\nexport interface ResolveCandidatesOptions {\n runtimeDir?: string\n envVarNames?: string[]\n includeDefaultCandidates?: boolean\n enforceNodeExtensionForEnvPath?: boolean\n /** @deprecated — ignored, kept for backward compat */\n packageName?: string\n}\n\nexport function resolveNativeBindingCandidates(options: ResolveCandidatesOptions): string[] {\n const {\n envVarNames = [\"TW_NATIVE_PATH\", \"TWS_NATIVE_PATH\"],\n includeDefaultCandidates = true,\n enforceNodeExtensionForEnvPath = false,\n } = options\n // Default ke cwd kalau runtimeDir tidak disediakan\n const runtimeDir = options.runtimeDir || process.cwd()\n const candidates: string[] = []\n\n for (const envVar of envVarNames) {\n const envPath = process.env[envVar]\n if (envPath) {\n candidates.push(enforceNodeExtensionForEnvPath && !envPath.endsWith(\".node\") ? envPath + \".node\" : envPath)\n }\n }\n\n if (!includeDefaultCandidates) return candidates\n\n if (fs.existsSync(runtimeDir)) {\n try {\n for (const entry of fs.readdirSync(runtimeDir)) {\n if (entry.endsWith(\".node\")) candidates.push(entry)\n }\n } catch { /* ignore read errors */ }\n }\n\n const BINARY_NAMES = [\"tailwind-styled-native\", \"tailwind_styled_parser\"]\n const napiPlatform = process.platform === \"linux\" && process.arch === \"x64\" ? \"linux-x64-gnu\"\n : process.platform === \"linux\" && process.arch === \"arm64\" ? \"linux-arm64-gnu\"\n : `${process.platform}-${process.arch}`\n\n for (const bin of BINARY_NAMES) {\n candidates.push(path.resolve(runtimeDir, `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, `${bin}.${napiPlatform}.node`))\n // 1 level: dist/ → package-root/native/ (published npm package)\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // cwd fallback (user project root)\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.node`))\n candidates.push(path.resolve(process.cwd(), \"native\", `${bin}.${napiPlatform}.node`))\n // 4 level: dist/ → package/ → domain/ → packages/ → repo-root/ (monorepo dev)\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"..\", \"native\", `${bin}.${napiPlatform}.node`))\n // 3 level fallback\n candidates.push(path.resolve(runtimeDir, \"..\", \"..\", \"..\", \"native\", `${bin}.node`))\n }\n\n return Array.from(new Set(candidates))\n}\n\nexport function resolveRuntimeDir(dir: string | undefined, importMetaUrl: string): string {\n if (dir) return path.resolve(dir)\n try {\n return path.dirname(fileURLToPath(importMetaUrl))\n } catch {\n return process.cwd()\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hashing\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function hashContent(content: string, algorithm: string = \"md5\", length?: number): string {\n const hash = createHash(algorithm).update(content).digest(\"hex\")\n return length ? hash.slice(0, length) : hash\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error formatting\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function formatErrorMessage(error: unknown): string {\n if (error instanceof TwError) return error.toString()\n if (error instanceof Error) return error.message\n return String(error)\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// LRU Cache\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport class LRUCache<K, V> {\n private capacity: number\n private cache: Map<K, V>\n\n constructor(capacity: number) {\n this.capacity = capacity\n this.cache = new Map()\n }\n\n get(key: K): V | undefined {\n if (!this.cache.has(key)) return undefined\n const value = this.cache.get(key)!\n this.cache.delete(key)\n this.cache.set(key, value)\n return value\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key)\n } else if (this.cache.size >= this.capacity) {\n const firstKey = this.cache.keys().next().value\n if (firstKey !== undefined) {\n this.cache.delete(firstKey)\n }\n }\n this.cache.set(key, value)\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key)\n }\n\n has(key: K): boolean {\n return this.cache.has(key)\n }\n\n clear(): void {\n this.cache.clear()\n }\n\n entries(): IterableIterator<[K, V]> {\n return this.cache.entries()\n }\n\n get size(): number {\n return this.cache.size\n }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Trace Utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TraceSnapshot, TraceSummary } from \"./trace\"\nexport {\n getHealthColor,\n getModeColor,\n formatMemory,\n formatDuration,\n calculateHealth,\n getBuildTimeColor,\n getMemoryColor,\n createTraceSnapshot,\n getPipelinePercentages,\n} from \"./trace\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Performance Telemetry\n// ─────────────────────────────────────────────────────────────────────────────\n\n\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Error Codes\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { ErrorCode } from \"./error-codes\"\nexport { ERROR_CODES, getSuggestion, formatErrorCode } from \"./error-codes\"\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Tailwind Compatibility\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport type { TailwindInfo } from \"./compatibility\"\nexport { detectTailwind, assertTailwindV4, getTailwindVersion, isTailwindV4 } from \"./compatibility\"\n\n// ── Native binding schemas (Zod boundary validation)\nexport {\n NativeScanFileSchema, NativeScanResultSchema,\n NativeAnalyzerReportSchema, NativeTransformResultSchema,\n NativeCssCompileResultSchema, NativeWatchResultSchema,\n NativeCacheEntrySchema, NativeCacheReadResultSchema,\n safeParseNative, parseNative,\n} from './native-schemas'\n\n// ── ESM-safe runtime helpers ──────────────────────────────────────────────\nexport {\n createEsmRequire,\n getDirname,\n getFilename,\n resolveFromRoot,\n tryRequire,\n resolveNativeNodePath,\n} from \"./esmHelpers\"\n\n// ── Performance telemetry ────────────────────────────────────────────────────\nexport {\n TelemetryCollector,\n getGlobalTelemetry,\n resetGlobalTelemetry,\n createBuildTimer,\n type BuildTelemetry,\n type TelemetrySummary,\n type BuildPhases,\n} from \"./telemetry\"\n\n// ── Config/JSON schema validation ─────────────────────────────────────────────\nexport {\n ScanCacheSchema,\n ScanCacheClassEntrySchema,\n TailwindConfigSchema,\n RegistryPluginEntrySchema,\n RegistryFileSchema,\n PackageJsonSchema,\n parseJsonWithSchema,\n parseJsonFileWithSchema,\n type ScanCache,\n type ScanCacheClassEntry,\n type TailwindConfig,\n type RegistryPluginEntry,\n type RegistryFile,\n type PackageJson,\n} from \"./configSchemas\"\n\n// ── Worker/bootstrap path resolution ─────────────────────────────────────────\nexport {\n resolveWorkerPath,\n resolveLoaderPath,\n type WorkerPathOptions,\n type WorkerPathResult,\n} from \"./workerResolver\"\n\n// ── Codegen helpers ───────────────────────────────────────────────────────────\nexport {\n generateComponentCode,\n generateStorybookStory,\n generateClassRenameCodemod,\n generateBarrelFile,\n type ComponentCodegenOptions,\n} from \"./codegen\"\n\n// ── Native binary resolution (QA #1) ─────────────────────────────────────────\nexport {\n resolveNativeBinary,\n formatNativeNotFoundError,\n type NativeResolutionResult,\n} from \"./native-resolution\"\n\n// ── Shared observability contract ────────────────────────────────────────────\nexport {\n createObservabilityClient,\n type ClassInspection,\n type ClassProperty,\n type ClassUsageLocation,\n type BuildTrace,\n type BuildPhaseTrace,\n type DashboardMetrics,\n type DashboardSummary,\n type ObservabilityClient,\n} from \"./observability\"\n\nexport {\n TW_STATE_STATIC_FILENAME,\n extractStaticStateCss,\n appendStaticStateCssToSafelist,\n type TwStateConfigEntry,\n type StaticStateCssInput,\n type GeneratedStateRule,\n type StaticStateExtractionResult,\n} from \"./staticStateExtractor\"\nexport { setGlobalLogFile } from \"./logger\"","export * from \"@tailwind-styled/rspack\"\n","/**\n * tailwind-styled-v4 - Rspack Plugin v5 (stable)\n *\n * Usage:\n * import { tailwindStyledRspackPlugin } from \"@tailwind-styled/rspack\"\n *\n * export default defineConfig({\n * plugins: [tailwindStyledRspackPlugin()],\n * })\n *\n * v5:\n * - Simplified API\n * - Mode always zero-runtime\n */\n\nimport fs from \"node:fs\"\nimport path from \"node:path\"\nimport { getDirname as getEsmDirname } from \"@tailwind-styled/shared\"\n\nimport { parseRspackPluginOptions } from \"./schemas\"\n\nfunction getDirname(): string {\n if (typeof __dirname !== \"undefined\") {\n return __dirname\n }\n if (typeof import.meta !== \"undefined\" && import.meta.url) {\n return getEsmDirname(import.meta.url)\n }\n return process.cwd()\n}\n\nfunction resolveLoaderPath(basename: string): string {\n const runtimeDir = getDirname()\n const preferredExtensions =\n typeof __dirname !== \"undefined\" && __dirname.length > 0 ? [\".cjs\", \".js\"] : [\".js\", \".cjs\"]\n\n for (const ext of preferredExtensions) {\n const candidate = path.resolve(runtimeDir, `${basename}${ext}`)\n if (fs.existsSync(candidate)) return candidate\n }\n\n return path.resolve(runtimeDir, `${basename}.js`)\n}\n\ninterface RspackRule {\n _tailwindStyledRspackMarker?: boolean\n test?: RegExp\n exclude?: RegExp\n use?: Array<{\n loader: string\n options: {\n mode: \"zero-runtime\"\n addDataAttr: boolean\n preserveImports: boolean\n safelistPath?: string\n }\n }>\n}\n\ninterface RspackCompiler {\n options: {\n mode?: string\n module?: {\n rules?: RspackRule[]\n }\n }\n}\n\nexport interface RspackPluginOptions {\n /** File patterns to include. Default: /\\.[jt]sx?$/ */\n include?: RegExp\n /** File patterns to exclude. Default: /node_modules/ */\n exclude?: RegExp\n /** Add data-tw debug attributes in dev. Default: true in dev */\n addDataAttr?: boolean\n /** Enable analyzer. Default: false */\n analyze?: boolean\n /**\n * Path ke safelist CSS file.\n * `_tw-state-static.css` ditulis di direktori yang sama.\n * Default: `<cwd>/__tw_safelist.css`\n */\n safelistPath?: string\n}\n\nexport class TailwindStyledRspackPlugin {\n private opts: RspackPluginOptions\n\n constructor(opts: RspackPluginOptions = {}) {\n this.opts = parseRspackPluginOptions(opts)\n }\n\n apply(compiler: RspackCompiler): void {\n const isDev = compiler.options.mode !== \"production\"\n const loaderPath = resolveLoaderPath(\"loader\")\n const existing = compiler.options.module?.rules ?? []\n const alreadyRegistered = existing.some(\n (rule) =>\n typeof rule === \"object\" && rule !== null && rule._tailwindStyledRspackMarker === true\n )\n\n if (alreadyRegistered) return\n\n const safelistPath =\n this.opts.safelistPath ?? path.join(process.cwd(), \"__tw_safelist.css\")\n\n // Tulis placeholder agar @import di CSS entry tidak error saat cold start\n const stateStaticPath = path.join(path.dirname(safelistPath), \"_tw-state-static.css\")\n if (!fs.existsSync(stateStaticPath)) {\n try {\n fs.mkdirSync(path.dirname(stateStaticPath), { recursive: true })\n fs.writeFileSync(\n stateStaticPath,\n `/* _tw-state-static.css — Auto-generated by tailwind-styled-v4. DO NOT EDIT.\\n` +\n ` * Import di CSS entry: @import \"./_tw-state-static.css\";\\n` +\n ` */\\n`,\n \"utf-8\"\n )\n } catch { /* non-fatal */ }\n }\n\n const rule: RspackRule = {\n _tailwindStyledRspackMarker: true,\n test: this.opts.include ?? /\\.[jt]sx?$/,\n exclude: this.opts.exclude ?? /node_modules/,\n use: [\n {\n loader: loaderPath,\n options: {\n mode: \"zero-runtime\",\n addDataAttr: this.opts.addDataAttr ?? isDev,\n preserveImports: true,\n safelistPath,\n },\n },\n ],\n }\n\n compiler.options.module = {\n ...(compiler.options.module ?? {}),\n rules: [rule, ...existing],\n }\n }\n}\n\nexport function tailwindStyledRspackPlugin(\n opts: RspackPluginOptions = {}\n): TailwindStyledRspackPlugin {\n return new TailwindStyledRspackPlugin(opts)\n}\n\nexport default tailwindStyledRspackPlugin\n\nexport {\n parseRspackPluginOptions,\n type RspackPluginOptionsInput,\n RspackPluginOptionsSchema,\n} from \"./schemas\"\n","import { z } from \"zod\"\nimport { TwError } from \"@tailwind-styled/shared\"\n\nconst formatIssuePath = (path: readonly PropertyKey[]): string =>\n path.length > 0\n ? path\n .map((segment) =>\n typeof segment === \"symbol\" ? segment.description ?? segment.toString() : String(segment)\n )\n .join(\".\")\n : \"<root>\"\n\nconst formatIssues = (error: z.ZodError): string =>\n error.issues\n .map((issue) => {\n const p = formatIssuePath(issue.path)\n return `${p}: ${issue.message}`\n })\n .join(\"; \")\n\nconst parseWithSchema = <T>(schema: z.ZodType<T>, data: unknown, label: string): T => {\n const parsed = schema.safeParse(data)\n if (parsed.success) return parsed.data\n const details = formatIssues(parsed.error)\n throw new TwError(\n \"validation\",\n \"SCHEMA_VALIDATION_FAILED\",\n details ? `${label}: ${details}` : label,\n parsed.error\n )\n}\n\nexport const RspackPluginOptionsSchema = z.object({\n include: z.instanceof(RegExp).optional(),\n exclude: z.instanceof(RegExp).optional(),\n addDataAttr: z.boolean().optional(),\n analyze: z.boolean().optional(),\n cssEntry: z.string().optional(),\n /** Path ke safelist CSS file. Default: <cwd>/__tw_safelist.css */\n safelistPath: z.string().optional(),\n})\n\nexport type RspackPluginOptionsInput = z.infer<typeof RspackPluginOptionsSchema>\n\nexport const parseRspackPluginOptions = (options: unknown) =>\n parseWithSchema(RspackPluginOptionsSchema, options ?? {}, \"rspack plugin options are invalid\")\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,SAAS,mBAAwD;AAC/D,MAAI,UAAW,QAAO;AACtB,MAAI,kBAAkB,KAAM,QAAO;AACnC,MAAI;AACF,UAAM,OAAO,OAAO,YAAY,aAAc,QAAQ,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