tailwind-styled-v4 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/CHANGELOG.md +398 -0
  2. package/LICENSE +21 -0
  3. package/README.md +532 -0
  4. package/dist/analyzer.d.mts +114 -0
  5. package/dist/analyzer.d.ts +114 -0
  6. package/dist/analyzer.js +6808 -0
  7. package/dist/analyzer.js.map +1 -0
  8. package/dist/analyzer.mjs +6798 -0
  9. package/dist/analyzer.mjs.map +1 -0
  10. package/dist/{animate.d.cts → animate.d.mts} +3 -30
  11. package/dist/animate.d.ts +3 -30
  12. package/dist/animate.js +7096 -352
  13. package/dist/animate.js.map +1 -1
  14. package/dist/animate.mjs +7482 -0
  15. package/dist/animate.mjs.map +1 -0
  16. package/dist/atomic.d.mts +18 -0
  17. package/dist/atomic.d.ts +18 -0
  18. package/dist/atomic.js +191 -0
  19. package/dist/atomic.js.map +1 -0
  20. package/dist/atomic.mjs +185 -0
  21. package/dist/atomic.mjs.map +1 -0
  22. package/dist/cli.d.mts +1 -0
  23. package/dist/cli.d.ts +1 -0
  24. package/dist/cli.js +45008 -0
  25. package/dist/cli.js.map +1 -0
  26. package/dist/cli.mjs +44980 -0
  27. package/dist/cli.mjs.map +1 -0
  28. package/dist/compiler.d.mts +1009 -0
  29. package/dist/compiler.d.ts +1009 -0
  30. package/dist/compiler.js +4937 -0
  31. package/dist/compiler.js.map +1 -0
  32. package/dist/compiler.mjs +4862 -0
  33. package/dist/compiler.mjs.map +1 -0
  34. package/dist/dashboard.d.mts +272 -0
  35. package/dist/dashboard.d.ts +272 -0
  36. package/dist/dashboard.js +249 -0
  37. package/dist/dashboard.js.map +1 -0
  38. package/dist/dashboard.mjs +239 -0
  39. package/dist/dashboard.mjs.map +1 -0
  40. package/dist/devtools.js +171 -158
  41. package/dist/devtools.js.map +1 -1
  42. package/dist/{devtools.cjs → devtools.mjs} +166 -167
  43. package/dist/devtools.mjs.map +1 -0
  44. package/dist/engine.d.mts +398 -0
  45. package/dist/engine.d.ts +398 -0
  46. package/dist/engine.js +19264 -0
  47. package/dist/engine.js.map +1 -0
  48. package/dist/engine.mjs +19227 -0
  49. package/dist/engine.mjs.map +1 -0
  50. package/dist/{index.d.cts → index.d.mts} +12 -5
  51. package/dist/index.d.ts +12 -5
  52. package/dist/index.js +7178 -27
  53. package/dist/index.js.map +1 -1
  54. package/dist/index.mjs +8408 -0
  55. package/dist/index.mjs.map +1 -0
  56. package/dist/liveTokenEngine-DYN3Zale.d.mts +34 -0
  57. package/dist/liveTokenEngine-DYN3Zale.d.ts +34 -0
  58. package/dist/{next.d.cts → next.d.mts} +2 -1
  59. package/dist/next.d.ts +2 -1
  60. package/dist/next.js +24027 -28
  61. package/dist/next.js.map +1 -1
  62. package/dist/next.mjs +24232 -0
  63. package/dist/next.mjs.map +1 -0
  64. package/dist/plugin.d.mts +90 -0
  65. package/dist/plugin.d.ts +90 -0
  66. package/dist/plugin.js +185 -0
  67. package/dist/plugin.js.map +1 -0
  68. package/dist/plugin.mjs +174 -0
  69. package/dist/plugin.mjs.map +1 -0
  70. package/dist/pluginRegistry.d.mts +83 -0
  71. package/dist/pluginRegistry.d.ts +83 -0
  72. package/dist/pluginRegistry.js +303 -0
  73. package/dist/pluginRegistry.js.map +1 -0
  74. package/dist/pluginRegistry.mjs +298 -0
  75. package/dist/pluginRegistry.mjs.map +1 -0
  76. package/dist/preset.js +9 -4
  77. package/dist/preset.js.map +1 -1
  78. package/dist/{preset.cjs → preset.mjs} +5 -14
  79. package/dist/preset.mjs.map +1 -0
  80. package/dist/rspack.d.mts +33 -0
  81. package/dist/rspack.d.ts +33 -0
  82. package/dist/rspack.js +66 -0
  83. package/dist/rspack.js.map +1 -0
  84. package/dist/rspack.mjs +55 -0
  85. package/dist/rspack.mjs.map +1 -0
  86. package/dist/runtime.d.mts +62 -0
  87. package/dist/runtime.d.ts +62 -0
  88. package/dist/runtime.js +455 -0
  89. package/dist/runtime.js.map +1 -0
  90. package/dist/runtime.mjs +436 -0
  91. package/dist/runtime.mjs.map +1 -0
  92. package/dist/runtimeCss.d.mts +65 -0
  93. package/dist/runtimeCss.d.ts +65 -0
  94. package/dist/{css.cjs → runtimeCss.js} +71 -4
  95. package/dist/runtimeCss.js.map +1 -0
  96. package/dist/{css.js → runtimeCss.mjs} +66 -5
  97. package/dist/runtimeCss.mjs.map +1 -0
  98. package/dist/scanner.d.mts +25 -0
  99. package/dist/scanner.d.ts +25 -0
  100. package/dist/scanner.js +5774 -0
  101. package/dist/scanner.js.map +1 -0
  102. package/dist/scanner.mjs +5760 -0
  103. package/dist/scanner.mjs.map +1 -0
  104. package/dist/shared.d.mts +85 -0
  105. package/dist/shared.d.ts +85 -0
  106. package/dist/shared.js +255 -0
  107. package/dist/shared.js.map +1 -0
  108. package/dist/shared.mjs +233 -0
  109. package/dist/shared.mjs.map +1 -0
  110. package/dist/storybookAddon.d.mts +108 -0
  111. package/dist/storybookAddon.d.ts +108 -0
  112. package/dist/storybookAddon.js +95 -0
  113. package/dist/storybookAddon.js.map +1 -0
  114. package/dist/storybookAddon.mjs +88 -0
  115. package/dist/storybookAddon.mjs.map +1 -0
  116. package/dist/svelte.d.mts +114 -0
  117. package/dist/svelte.d.ts +114 -0
  118. package/dist/svelte.js +67 -0
  119. package/dist/svelte.js.map +1 -0
  120. package/dist/svelte.mjs +59 -0
  121. package/dist/svelte.mjs.map +1 -0
  122. package/dist/testing.d.mts +185 -0
  123. package/dist/testing.d.ts +185 -0
  124. package/dist/testing.js +173 -0
  125. package/dist/testing.js.map +1 -0
  126. package/dist/testing.mjs +158 -0
  127. package/dist/testing.mjs.map +1 -0
  128. package/dist/theme.d.mts +188 -0
  129. package/dist/theme.d.ts +188 -0
  130. package/dist/theme.js +334 -0
  131. package/dist/theme.js.map +1 -0
  132. package/dist/theme.mjs +311 -0
  133. package/dist/theme.mjs.map +1 -0
  134. package/dist/tsconfig.tsbuildinfo +1 -0
  135. package/dist/types-DXr2PmGP.d.mts +31 -0
  136. package/dist/types-DXr2PmGP.d.ts +31 -0
  137. package/dist/vite.js +29611 -17
  138. package/dist/vite.js.map +1 -1
  139. package/dist/vite.mjs +29712 -0
  140. package/dist/vite.mjs.map +1 -0
  141. package/dist/vue.d.mts +89 -0
  142. package/dist/vue.d.ts +89 -0
  143. package/dist/vue.js +104 -0
  144. package/dist/vue.js.map +1 -0
  145. package/dist/vue.mjs +96 -0
  146. package/dist/vue.mjs.map +1 -0
  147. package/package.json +170 -64
  148. package/dist/animate.cjs +0 -771
  149. package/dist/animate.cjs.map +0 -1
  150. package/dist/chunk-VZEJV27B.js +0 -11
  151. package/dist/chunk-VZEJV27B.js.map +0 -1
  152. package/dist/chunk-Y5D3E72P.cjs +0 -13
  153. package/dist/chunk-Y5D3E72P.cjs.map +0 -1
  154. package/dist/css.cjs.map +0 -1
  155. package/dist/css.d.cts +0 -30
  156. package/dist/css.d.ts +0 -30
  157. package/dist/css.js.map +0 -1
  158. package/dist/devtools.cjs.map +0 -1
  159. package/dist/index.cjs +0 -1353
  160. package/dist/index.cjs.map +0 -1
  161. package/dist/next.cjs +0 -248
  162. package/dist/next.cjs.map +0 -1
  163. package/dist/preset.cjs.map +0 -1
  164. package/dist/turbopackLoader.cjs +0 -37
  165. package/dist/turbopackLoader.cjs.map +0 -1
  166. package/dist/turbopackLoader.d.cts +0 -12
  167. package/dist/turbopackLoader.d.ts +0 -12
  168. package/dist/turbopackLoader.js +0 -35
  169. package/dist/turbopackLoader.js.map +0 -1
  170. package/dist/vite.cjs +0 -138
  171. package/dist/vite.cjs.map +0 -1
  172. package/dist/webpackLoader.cjs +0 -51
  173. package/dist/webpackLoader.cjs.map +0 -1
  174. package/dist/webpackLoader.d.cts +0 -17
  175. package/dist/webpackLoader.d.ts +0 -17
  176. package/dist/webpackLoader.js +0 -49
  177. package/dist/webpackLoader.js.map +0 -1
  178. /package/dist/{devtools.d.cts → devtools.d.mts} +0 -0
  179. /package/dist/{preset.d.cts → preset.d.mts} +0 -0
  180. /package/dist/{vite.d.cts → vite.d.mts} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,398 @@
1
+ # Changelog
2
+
3
+ ## v4.5.0 — Sprint 6–10 Platform Overhaul (2026-03-21)
4
+
5
+ ### Sprint 6 — Error Handling & Logging
6
+
7
+ #### Rust (`native/src/lib.rs`)
8
+ - `cache_read` return type diubah dari `CacheReadResult` → `napi::Result<CacheReadResult>` — error file tidak bisa dibaca sekarang dipropagasi ke JS dengan pesan deskriptif
9
+ - `scan_workspace` sudah return `napi::Result` — error directory tidak ditemukan langsung dilempar ke JS
10
+
11
+ #### Scanner (`packages/scanner/src/index.ts`)
12
+ - Hapus `debugScanner()` dan `isDebugEnabled()` yang tersebar — ganti dengan `createLogger("scanner")` dari `@tailwind-styled/shared`
13
+ - Cache HIT/MISS/write-fail sekarang semua melalui `log.debug()` — terkontrol via `TWS_LOG_LEVEL`
14
+
15
+ #### Engine (`packages/engine/src/index.ts`)
16
+ - Plugin `onError` hook dipanggil sebelum error dipropagasi — plugin tidak bisa crash engine
17
+ - `watch()` emit event `{ type: "error" }` saat watcher atau transform gagal
18
+
19
+ #### Shared Logger (`packages/shared/src/logger.ts`)
20
+ - Sudah support `TWS_LOG_LEVEL=debug|info|warn|error|silent`
21
+ - `TWS_DEBUG_SCANNER=1` sebagai shorthand untuk debug scanner
22
+
23
+ ---
24
+
25
+ ### Sprint 7 — Platform Adapters
26
+
27
+ #### Next.js (`packages/next/tsup.config.ts`)
28
+ - Hapus `@tailwind-styled/compiler` dan `@tailwind-styled/plugin` dari `external`
29
+ - Tambah `noExternal` agar compiler di-bundle inline ke adapter
30
+ - `esbuildOptions` skip `*.node` native binaries Tailwind v4
31
+
32
+ #### Vite (`packages/vite/tsup.config.ts`, `src/plugin.ts`)
33
+ - Hapus `@tailwind-styled/compiler`, `engine`, `scanner` dari `external`
34
+ - Tambah `noExternal` untuk semua internal packages
35
+ - `preserveImports: true` di `loaderOptions` transform hook
36
+
37
+ #### Rspack (`packages/rspack/tsup.config.ts` — file baru, `src/loader.ts`)
38
+ - Buat `tsup.config.ts` dari scratch
39
+ - `noExternal: ["@tailwind-styled/compiler"]`
40
+ - `preserveImports: true` di `runLoaderTransform` call
41
+
42
+ #### Semua Loaders
43
+ - `turbopackLoader.ts`, `webpackLoader.ts`, `plugin.ts`, `loader.ts` — semua set `preserveImports: true`
44
+ - `cv`, `cx`, `cn` dijamin tidak distrip oleh compiler
45
+
46
+ ---
47
+
48
+ ### Sprint 8 — Developer Tooling
49
+
50
+ #### CLI (`packages/cli/src/analyze.ts`, `src/stats.ts`)
51
+ - Suppress `console.log("Analyzing...")` saat `--json` aktif — output JSON sekarang clean parseable
52
+ - `tw analyze --json` dan `tw stats --json` bisa di-pipe ke tools lain
53
+
54
+ #### DevTools (`packages/devtools/src/index.tsx`)
55
+ - Hapus tombol "Run Rust Workspace Scan" — tidak bisa jalan di browser environment
56
+ - Hapus `getRustAnalyzer()`, `runRustScan`, `rustReport`, `rustScanning`
57
+ - Ganti dengan panel **Engine Metrics** yang fetch dari `http://localhost:3000/metrics` (dashboard)
58
+ - Fallback message: "Rust analyzer hanya tersedia via CLI atau dashboard — `tw analyze . | tw dashboard`"
59
+ - DOM Scan tetap ada dan berfungsi
60
+
61
+ #### VSCode Extension (`packages/vscode/src/extension.ts`, `scripts/postbuild.cjs`)
62
+ - `startLspServer` cek `dist/lsp.mjs` sebagai kandidat pertama (bundled bersama extension)
63
+ - Tambah `packages/vscode/scripts/postbuild.cjs` — copy `scripts/v48/lsp.mjs` ke `dist/lsp.mjs` setiap build
64
+ - `package.json` tambah `"postbuild": "node scripts/postbuild.cjs"`
65
+
66
+ ---
67
+
68
+ ### Sprint 9 — Studio Desktop (Electron)
69
+
70
+ #### Main Process (`packages/studio-desktop/src/main.js`)
71
+ - `STUDIO_SCRIPT` sekarang di-resolve via `resolveStudioScript()` — cek `process.resourcesPath` (packaged), `__dirname/../..` (dev), dan `cwd` (fallback)
72
+ - Engine IPC handlers baru: `engine-scan`, `engine-build`, `engine-watch-start`, `engine-watch-stop`, `engine-reset`
73
+ - `createEngine` dari `@tailwind-styled/engine` di-lazy-load per project
74
+ - Engine di-reset otomatis saat `change-project` dipanggil
75
+ - Engine events di-forward ke renderer via `mainWindow.webContents.send("engine-event")`
76
+
77
+ #### Preload (`packages/studio-desktop/src/preload.js`)
78
+ - Ekspos `engineScan`, `engineBuild`, `engineWatchStart`, `engineWatchStop`, `onEngineEvent` ke renderer via `contextBridge`
79
+
80
+ #### Package (`packages/studio-desktop/package.json`)
81
+ - Tambah `@tailwind-styled/shared` ke dependencies
82
+ - Script `dev` update dengan fallback message jika Electron belum terinstall
83
+
84
+ ---
85
+
86
+ ### Sprint 10 — Testing & Documentation
87
+
88
+ #### Testing Package (`packages/testing/src/index.ts`)
89
+ - Tambah `EngineMetricsSnapshot` interface
90
+ - Tambah `expectEngineMetrics(metrics, expectations)` — assert minFiles, maxBuildTimeMs, minUniqueClasses, cacheHitRateMin
91
+ - Tambah `toHaveEngineMetrics(expectations)` — Jest/Vitest custom matcher
92
+ - Tambah `tailwindMatchersWithMetrics` — combined export semua matchers
93
+
94
+ #### Test Suites Baru
95
+ - `packages/testing/test/sprint9-platform.test.mjs` — 23 tests: next/vite/rspack adapter configs, preserveImports, studio-desktop engine IPC
96
+ - `packages/testing/test/sprint10-integration.test.mjs` — 28 tests: Sprint 6–8 error handling, logging, engine propagation, DevTools safety, VSCode LSP, metrics matchers
97
+
98
+ #### Test Results
99
+ - Total: **84/86 tests pass**
100
+ - 2 failing tests: pre-existing `twMerge/cn` extraction (unrelated to engine changes)
101
+
102
+ ---
103
+
104
+ ## v4.2.0 — Sprint 1 & 2 Complete (2026-03-15)
105
+
106
+ ### New Packages
107
+
108
+ - **`@tailwind-styled/vue`** — Vue 3 adapter: `tw()`, `cv()`, `extend()`, `TailwindStyledPlugin`. Full variant/compound variant support with `twMerge` conflict resolution.
109
+ - **`@tailwind-styled/svelte`** — Svelte 4/5 adapter: `cv()`, `tw()`, `use:styled` action, `createVariants()` (Svelte 5 runes compatible).
110
+
111
+ ### New Features
112
+
113
+ #### Parser & Compiler (v4.6)
114
+ - `tw parse <file>` — Full AST traversal with 3-tier strategy: `oxc-parser` (Rust) → `@babel/parser` → regex fallback. Extracts classes from JSX `className`, template literals, `twMerge()`, `cn()`, `clsx()` calls.
115
+ - Real tree shaking (`tw shake <css>`) — CSS selector analysis against source scan. Removes unused rules based on actual class usage, not sentinel strings. Supports `@layer`, `@media` preservation.
116
+
117
+ #### Compiler Optimization (v4.7/v4.9)
118
+ - `tw optimize <file>` — Constant folding (`true ? A : B → A`), class deduplication, `twMerge` literal pre-computation.
119
+
120
+ #### Parallel & Ecosystem (v4.8)
121
+ - `scripts/v48/lint-parallel.mjs` — Multi-threaded linting via `worker_threads`
122
+ - LSP server (`tw lsp`) — hover, completion (Tailwind class autocomplete), diagnostics via `vscode-languageserver`
123
+
124
+ #### Dashboard & Metrics
125
+ - `@tailwind-styled/dashboard` — Live metrics server with file-watch IPC. Reads `.tw-cache/metrics.json` written by engine. Real-time HTML UI with build history chart.
126
+ - `packages/engine/src/metricsWriter.ts` — Connects engine build results → `.tw-cache/metrics.json` → dashboard.
127
+
128
+ #### Plugin Registry
129
+ - `@tailwind-styled/plugin-registry` — `tw-plugin search/install/list` CLI. Registry now includes 4 official + 2 community plugins with docs and install commands.
130
+
131
+ #### Testing & Storybook
132
+ - `@tailwind-styled/testing` — `expectClasses()`, `expectNoClasses()`, `expandVariantMatrix()`, `testAllVariants()`, `expectClassesEqual()`, Jest/Vitest custom matchers (`tailwindMatchers`).
133
+ - `@tailwind-styled/storybook-addon` — `generateArgTypes()`, `withTailwindStyled()` decorator, `getVariantClass()`, `createVariantStoryArgs()`.
134
+
135
+ #### AI & Studio (v4.5)
136
+ - `tw ai "describe"` — Anthropic API integration for component generation. Fallback to smart static templates (card/nav/button detection) when `ANTHROPIC_API_KEY` not set.
137
+ - `tw studio` — Web-based component studio: scans project for `tw()`/`cv()` components, HTML UI with search + AI generator endpoint.
138
+ - `tw sync <init|pull|push|diff>` — W3C DTCG design token sync. Push to CSS variables (`--color-primary: #3b82f6`) or Tailwind `@theme {}` block.
139
+
140
+ #### Distributed Build (v5.0 preview)
141
+ - `tw cluster <init|build|status>` — Real `worker_threads` pool. Distributes file scan across CPU cores. Reports throughput (files/sec).
142
+
143
+ ### Tests Added (Sprint 2)
144
+ - `packages/scanner/test/parse-v46.test.mjs` — 20 unit tests for parse pipeline
145
+ - `packages/compiler/test/shake-v47.test.mjs` — 10 unit tests for tree shaking
146
+ - `packages/vue/test/vue-adapter.test.mjs` — 9 unit tests for Vue cv()
147
+ - `packages/svelte/test/svelte-adapter.test.mjs` — 12 unit tests for Svelte cv()/tw()
148
+ - `packages/testing/test/testing-utils.test.mjs` — 18 unit tests for testing utilities
149
+ - `examples/integration-test/sprint2.integration.test.mjs` — 9 integration tests (parse→shake pipeline, dashboard HTTP, real-world component patterns)
150
+
151
+ ### Benchmark
152
+ - `scripts/benchmark/sprint2-bench.mjs` — Measures parse (files/sec), shake (% CSS reduction), cluster (throughput) with memory snapshot. Output: `docs/benchmark/sprint2-results.json`.
153
+
154
+ ### Documentation
155
+ - `docs/known-limitations/tw-parse.md` — Fallback modes, `.vue`/`.svelte` support gap, dynamic class limitations
156
+ - `docs/known-limitations/tw-transform.md` — JSX runtime requirements, hoist behavior, source map availability
157
+ - `docs/known-limitations/tw-lint.md` — Worker config, exit codes, missing `--format json`
158
+
159
+ ### CI & Quality
160
+ - Smoke tests expanded to cover Sprint 1+2 features (Oxide pipeline, plugin registry, sync, AI, cluster)
161
+ - All packages bumped to `4.2.0`
162
+
163
+ ---
164
+
165
+ ## v2.1.0-alpha.1 — Tailwind v4 Upgrade Path
166
+
167
+ ### Added
168
+ - New workspace packages: `@tailwind-styled/scanner` and `@tailwind-styled/engine`.
169
+ - Core Tailwind v4 helpers: parser, CSS-first theme reader, merge layer, styled resolver.
170
+ - CLI phase upgrades: `init`, `scan`, `migrate`, and interactive `migrate --wizard`.
171
+ - Vite plugin build-end integration with scanner reports and optional engine build call.
172
+ - Native parser scaffold (`native/`) plus benchmark script (`benchmarks/native-parser-bench.mjs`).
173
+ - Release workflow/docs scaffold: `.github/workflows/publish-alpha.yml`, `RELEASE.md`, `ANNOUNCEMENT.md`.
174
+
175
+ ### Notes
176
+ - Native parser remains optional and uses fallback strategy until binding is shipped in CI artifacts.
177
+
178
+ ---
179
+
180
+ ## v2.0.0 — Major Upgrade (Compiler-Driven)
181
+
182
+ ### Breaking Changes
183
+ - **Removed `styled-components` dependency** — peer dep dihapus.
184
+ - **`styledFactory`, `shouldForwardProp`, `blockProp`, `allowProp`** — dihapus.
185
+ - **`propEngine`, `responsiveEngine`** — dipindahkan ke compiler.
186
+ - **`ThemeContext`** — dihapus.
187
+
188
+ ### New Features
189
+ - **Zero-runtime output** — `tw.div\`...\`` dikompilasi ke pure `React.forwardRef`.
190
+ - **Compiler-driven variants** — Variant config dikompilasi ke static lookup table.
191
+ - **RSC-aware** — Auto detect server vs client components.
192
+ - **`withTailwindStyled()` plugin** — Next.js plugin dengan Turbopack + Webpack support.
193
+ - **`tailwindStyledPlugin()` Vite plugin** — Same compiler pipeline untuk Vite 5+.
194
+
195
+ ---
196
+
197
+ ## v4.3–v4.5 Upgrade (2026-03-16)
198
+
199
+ ### v4.3 — Command Densification
200
+ - `tw studio` — sekarang spawn `scripts/v45/studio.mjs` langsung (sebelumnya: `console.log` placeholder)
201
+ - `tw dashboard` — direct spawn `packages/dashboard/src/server.mjs` tanpa butuh build (sebelumnya: `npm run dev`)
202
+ - `tw storybook` — tanpa `--variants` → launch Storybook dev server via `npx storybook dev`; dengan `--variants` → enumerate JSON (CI mode)
203
+
204
+ ### v4.4 — DX & Quality
205
+ - `tw preflight [--fix] [--json]` — command baru: 8 checks (Node version, package.json, tailwind-styled, bundler, tailwind-merge, Tailwind config, deprecated patterns, TypeScript), auto-fix sederhana
206
+ - `tw audit` — real checks: deprecated class scanner, a11y (img alt, onClick keyboard, div onClick, focus state), npm audit security, class count estimate; `--scope=deprecated|a11y|security|performance` dan `--json`
207
+ - `tw deploy` — baca package.json, tulis `.tw-cache/deploy-manifest.json`, `--dry-run` support
208
+ - `tw share` — baca manifest yang ada, generate payload dengan installCommand dan importExample
209
+
210
+ ### v4.5 — Platform Mode
211
+ - `tw sync figma <pull|push|diff>` — CLI sekarang route subcommand `figma` ke `scripts/v45/figma-sync.mjs`
212
+ - `tw ai` — multi-provider: `--provider=anthropic|openai|ollama`, `--model=name`, auto-fallback ke Anthropic → static template
213
+ - `@tailwind-styled/shared` — package baru: `LRUCache` (TTL support), `createLogger`, `hashContent`/`hashFile`, `debounce`/`throttle`, `parseVersion`/`satisfiesMinVersion`
214
+ - `packages/compiler` — migrasi `hashFileContent` ke `@tailwind-styled/shared`
215
+
216
+ ### Tests
217
+ - `packages/testing/test/v43-v45.test.mjs` — 28 tests covering shared package, audit, AI provider, preflight
218
+
219
+ ### v4.2.0 patch (2026-03-16)
220
+
221
+ - `scripts/v49/critical-css.mjs` — upgraded: real CSS rule parsing, `--inline`, `--out=file`, id/tag/class extraction, savedPercent metric
222
+ - `scripts/v48/lint-parallel.mjs` — `--format=sarif` (SARIF 2.1 untuk GitHub Code Scanning), `--fix` auto-deduplicate duplicate classes
223
+ - `scripts/v46/parse.mjs` — bugfix: regex fallback sekarang mengekstrak kelas dari `twMerge()`, `cn()`, `cx()`, `clsx()` calls
224
+ - `packages/vscode/package.json` — tambah keybindings (Ctrl+Shift+T/N/S), `configuration` settings, `menus` context
225
+ - `packages/shared/tsconfig.json` — tsconfig untuk build
226
+ - `.github/workflows/benchmark.yml` — sprint2-bench, plugin-registry SLO, toolchain benchmark
227
+ - `scripts/validate/dependency-matrix-check.mjs` — validasi packages baru v4.2
228
+ - `packages/cli/src/index.ts` — fix preflight handler (hapus `--input-type=module` orphan)
229
+ - `docs/known-limitations/` — update status aktual untuk tw-lint, tw-split-optimize, tw-v50
230
+
231
+ ---
232
+
233
+ ## v4.3–v6.0 Sprint 6 (2026-03-16)
234
+
235
+ ### New Features
236
+
237
+ #### Registry (`tw registry`)
238
+ - `scripts/v45/registry.mjs` — Lightweight local/team HTTP registry server
239
+ - `tw deploy --registry=http://localhost:4040` — Real HTTP publish ke registry
240
+ - `tw registry serve|list|info` — Manage registry dari CLI
241
+ - Token auth via `TW_REGISTRY_TOKEN` env var
242
+
243
+ #### Remote build (`tw cluster-server`)
244
+ - `scripts/v50/cluster-server.mjs` — Remote build worker HTTP server
245
+ - `tw cluster build src/ --remote=http://host:7070 --token=secret` — Dispatch ke remote workers
246
+ - `tw cluster-server [--port=7070] [--workers=N] [--token=secret]`
247
+
248
+ #### Remote token sync
249
+ - `tw sync pull --from=https://cdn.example.com/tokens.json` — HTTP/HTTPS URL pull
250
+ - `tw sync push --to-url=https://api.example.com/tokens` — HTTP push ke endpoint
251
+ - Figma subcommand sekarang tersedia: `tw sync figma pull|push|diff`
252
+
253
+ #### Next.js route CSS injection
254
+ - `packages/next/src/routeCssMiddleware.ts` — `getRouteCssLinks(route)`, `injectRouteCssIntoHtml()`
255
+ - `withTailwindStyled` sekarang write `css-manifest.json` ke `.next/static/css/tw/`
256
+ - Konsumsi di layout: `import { getRouteCssLinks } from 'tailwind-styled-v4/next/route-css'`
257
+
258
+ #### Vite plugin route CSS
259
+ - `routeCss: true` option di `tailwindStyledPlugin()` — run split-routes + shake per route
260
+ - `routeCssDir` — konfigurasi output dir
261
+ - `deadStyleElimination: true` — shake setiap route CSS chunk
262
+
263
+ #### Studio Desktop
264
+ - `packages/studio-desktop/src/loading-error.html` — loading fallback dengan auto-retry + error state
265
+ - `packages/studio-desktop/src/updater.js` — electron-updater integration (GitHub Releases)
266
+ - Auto-update check 10 detik setelah startup, manual via Tools menu
267
+
268
+ ---
269
+
270
+ ## Sprint 7 (2026-03-16)
271
+
272
+ ### Tarball Registry (npm-compatible)
273
+ - `scripts/v45/registry-tarball.mjs` — `tw registry publish` buat + upload tarball, `tw install <pkg>` download + install, `tw registry versions <pkg>` list versions
274
+ - `scripts/v45/registry.mjs` — upgrade: PUT `/packages/:name` endpoint, GET `/packages/:name/versions`, GET `/packages/:name/-/:tarball.tgz`, tarball storage di `tarballs/`, version history di `.versions.json`
275
+ - `tw install` shorthand command di CLI
276
+
277
+ ### RSC Auto-inject
278
+ - `packages/compiler/src/rscAnalyzer.ts` — export `detectRSCBoundary()` dan `autoInjectClientBoundary()` sebagai public API Sprint 7
279
+ - `packages/next/src/webpackLoader.ts` — import rscAnalyzer, auto-inject `"use client"` berdasarkan `analyzeFile()` analysis
280
+ - `packages/next/src/turbopackLoader.ts` — import rscAnalyzer (Sprint 7 alignment)
281
+
282
+ ### Figma Multi-mode
283
+ - `scripts/v45/figma-multi.mjs` — pull dari multiple Figma files (`--file=key1,key2`), mode selection (`--mode=dark`), diff antar mode (`diff --from=light --to=dark`), `modes` command untuk list available modes
284
+ - `tw sync figma` CLI otomatis route ke `figma-multi.mjs` jika ada `--file=`, `--mode=`, atau `modes` command
285
+
286
+ ### Dynamic Route CSS (Sprint 7)
287
+ - `packages/next/src/routeCssMiddleware.ts` — `getDynamicRouteCssPaths()`, `getDynamicRouteCssLinks()`, `resolveDynamicRoute()`, `invalidateDynamicRouteCache()`
288
+ - Support `[id]`, `[...slug]` dynamic segments dengan cache per kombinasi params
289
+ - Fallback otomatis ke parent route jika tidak ada CSS spesifik
290
+
291
+ ### Oxc Minify Full Pipeline
292
+ - `scripts/v47/minify.mjs` — 3-tier: oxc-minify (mangle+dead-code+compress) → esbuild (transform) → regex fallback
293
+ - Opsi: `--mangle`, `--dead-code`, `--comments=false`, `--target=`, `--json`, `--write`, `--out=`
294
+ - Report: mode, original/minified bytes, reduction%, durationMs
295
+
296
+ ### Tests
297
+ - `packages/testing/test/sprint7.test.mjs` — 30 tests, semua pass
298
+
299
+ ---
300
+
301
+ ## Sprint 8 (2026-03-16)
302
+
303
+ ### adopt — Monorepo Detection
304
+ - Auto-detect: npm workspaces, pnpm (`pnpm-workspace.yaml`), Nx (`nx.json`), Turborepo (`turbo.json`)
305
+ - `--all` flag: jalankan analisis di semua workspace packages sekaligus
306
+ - `--project=<dir>` tetap override monorepo detection
307
+ - Informational log saat monorepo terdeteksi
308
+
309
+ ### tw lint — Custom Rules
310
+ - `--rules=path/to/rules.json` — load custom rules dari file JSON
311
+ - `.tw-lint.json` di CWD auto-loaded tanpa flag
312
+ - `--rule="pattern:message"` — inline custom rule (repeatable)
313
+ - Rule format: `{ id, pattern, message, severity: "error"|"warning" }`
314
+ - Output report: `customRulesLoaded` field
315
+
316
+ ### tw lint — `--no-exit-0` & `--severity`
317
+ - `--no-exit-0` — exit 0 meski ada issues (CI-safe mode, e.g. untuk warning-only runs)
318
+ - `--severity=error|warning` — set minimum severity yang memicu exit code 1
319
+ - Output report: `noExit0` dan `severity` fields
320
+
321
+ ---
322
+
323
+ ## Sprint 9 (2026-03-16)
324
+
325
+ ### Studio Desktop — Tray Icon
326
+ - `packages/studio-desktop/src/icons/tray.png` + `tray@2x.png` — gradient blue-to-teal PNG icon
327
+ - `createTray()` fully implemented: `new Tray(iconPath)`, tooltip, context menu
328
+ - Context menu: Open Studio, Open in Browser, separator, project name, Quit
329
+ - `tray.on("click")` — toggle window visibility
330
+ - `tray.on("double-click")` — focus window
331
+
332
+ ### Plugin Marketplace
333
+ - `scripts/v45/marketplace.mjs` — publish, search, featured, info, unpublish
334
+ - Auto-inference of category (animation/layout/theme/ui/typography/utilities)
335
+ - Offline fallback: publish to local `tw registry`, search in `.tw-registry/`
336
+ - `tw plugin marketplace` + `tw plugin publish` commands di CLI
337
+
338
+ ### tw parse — .vue .svelte .mdx
339
+ - Hybrid strategy: `.vue/.svelte/.mdx/.html` → regex-direct (skip Babel, faster)
340
+ - `extractFromVue()` — extract `<script>` + `class=` from template
341
+ - `extractFromSvelte()` — extract `<script>` + `class=` / `class:directive`
342
+ - `extractFromMdx()` — extract JSX blocks + imports
343
+ - `.js/.jsx/.ts/.tsx` tetap Oxc-first → Babel → regex
344
+
345
+ ### tw transform — .mdx
346
+ - `.mdx` pre-processing: strip markdown prose, keep JSX/imports for transform
347
+ - mode: `mdx-extracted`
348
+
349
+ ---
350
+
351
+ ## Sprint 10 (2026-03-16)
352
+
353
+ ### tw lint — Tailwind config custom rules validation
354
+ - `loadTailwindConfigClasses()` — static analysis dari `tailwind.config.js/ts/mjs/cjs`
355
+ - Ekstrak: `addUtilities()`, `addComponents()`, `extend:` theme keys
356
+ - Config classes suppress false-positive deprecated warnings
357
+ - `knownConfigClasses` diteruskan ke worker threads via `workerData`
358
+
359
+ ### Registry — npm packument protocol
360
+ - `GET /:name` endpoint — returns npm packument format: `dist-tags`, `versions`, `dist.tarball`
361
+ - Compatible dengan `npm install --registry=http://localhost:4040`
362
+ - `tw registry help` command added
363
+
364
+ ### VS Code — LSP client
365
+ - `startLspServer()` / `stopLspServer()` — manage `lsp.mjs` process lifecycle
366
+ - Reads `tailwindStyled.lsp.enable` setting (default: true)
367
+ - Auto-restart on settings change via `onDidChangeConfiguration`
368
+ - Clean shutdown di `deactivate()`
369
+
370
+ ### tw sync — S3:// protocol
371
+ - `tw sync pull --from=s3://bucket/key` — resolve via `AWS_ENDPOINT_URL` → HTTP
372
+ - Native `@aws-sdk/client-s3` fallback jika available
373
+ - Helpful error message jika tidak ada credentials
374
+
375
+ ### tw parse — Native Rust tier 0
376
+ - Mencoba `native/index.mjs` (.node binding) sebagai Tier 0 sebelum Oxc
377
+ - Graceful fallback: native → Oxc → Babel → regex
378
+ - `mode: 'native-rust'` jika compiled binding tersedia
379
+
380
+ ---
381
+
382
+ ## Sprint 10+ (2026-03-16)
383
+
384
+ ### Manifest dev mode serving
385
+ - `withTailwindStyled({ devManifest: true })` — default aktif di dev mode
386
+ - Next.js rewrites: `/__tw/css-manifest.json` → `.next/static/css/tw/css-manifest.json`
387
+ - `/__tw/:path*.css` → route CSS chunks di `.next/static/css/tw/`
388
+ - `routeCssMiddleware` — tambah `public/__tw/` sebagai path candidate
389
+
390
+ ### Plugin registry checksum & auto-update
391
+ - `PluginRegistry.verifyIntegrity(name)` — sha256 hash comparison
392
+ - `PluginRegistry.checkForUpdate(name)` — semver diff vs installed version
393
+ - `PluginRegistry.checkAllUpdates()` — batch update check semua plugins
394
+ - CLI: `tw plugin update-check` + `tw plugin verify <name>` (+ `--json`)
395
+
396
+ ### CSS generation heading fix (tw-v50.md)
397
+ - Heading diupdate: "Output hanya classCount — full CSS generation Sprint 10+" → "CSS Generation — cluster output Sprint 10+"
398
+ - Workaround diperjelas: `tw cluster build src/ && tw split src/ artifacts/route-css`
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Dictionar32
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.