tailwind-styled-v4 5.0.12 → 5.0.14

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 (69) hide show
  1. package/README.md +100 -4
  2. package/dist/animate.d.mts +4 -0
  3. package/dist/animate.d.ts +4 -0
  4. package/dist/animate.js +22 -0
  5. package/dist/animate.js.map +1 -1
  6. package/dist/animate.mjs +22 -0
  7. package/dist/animate.mjs.map +1 -1
  8. package/dist/atomic.js +56 -14
  9. package/dist/atomic.js.map +1 -1
  10. package/dist/atomic.mjs +56 -14
  11. package/dist/atomic.mjs.map +1 -1
  12. package/dist/cli.js +156 -14
  13. package/dist/cli.js.map +1 -1
  14. package/dist/cli.mjs +156 -14
  15. package/dist/cli.mjs.map +1 -1
  16. package/dist/compiler.d.mts +1045 -991
  17. package/dist/compiler.d.ts +1045 -991
  18. package/dist/compiler.js +891 -925
  19. package/dist/compiler.js.map +1 -1
  20. package/dist/compiler.mjs +890 -925
  21. package/dist/compiler.mjs.map +1 -1
  22. package/dist/engine.js +1651 -354
  23. package/dist/engine.js.map +1 -1
  24. package/dist/engine.mjs +1650 -353
  25. package/dist/engine.mjs.map +1 -1
  26. package/dist/index.browser.mjs +3 -1
  27. package/dist/index.browser.mjs.map +1 -1
  28. package/dist/index.js +1682 -365
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +1682 -365
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/next.js +1076 -986
  33. package/dist/next.js.map +1 -1
  34. package/dist/next.mjs +1076 -986
  35. package/dist/next.mjs.map +1 -1
  36. package/dist/shared.d.mts +3 -2
  37. package/dist/shared.d.ts +3 -2
  38. package/dist/shared.js +1595 -298
  39. package/dist/shared.js.map +1 -1
  40. package/dist/shared.mjs +1595 -298
  41. package/dist/shared.mjs.map +1 -1
  42. package/dist/svelte.js +42 -24
  43. package/dist/svelte.js.map +1 -1
  44. package/dist/svelte.mjs +42 -24
  45. package/dist/svelte.mjs.map +1 -1
  46. package/dist/turbopackLoader.js +1606 -309
  47. package/dist/turbopackLoader.js.map +1 -1
  48. package/dist/turbopackLoader.mjs +1606 -309
  49. package/dist/turbopackLoader.mjs.map +1 -1
  50. package/dist/tw.js +156 -14
  51. package/dist/tw.js.map +1 -1
  52. package/dist/tw.mjs +156 -14
  53. package/dist/tw.mjs.map +1 -1
  54. package/dist/vite.js +1636 -339
  55. package/dist/vite.js.map +1 -1
  56. package/dist/vite.mjs +1636 -339
  57. package/dist/vite.mjs.map +1 -1
  58. package/dist/vue.js +42 -24
  59. package/dist/vue.js.map +1 -1
  60. package/dist/vue.mjs +42 -24
  61. package/dist/vue.mjs.map +1 -1
  62. package/dist/webpackLoader.js +80 -29
  63. package/dist/webpackLoader.js.map +1 -1
  64. package/dist/webpackLoader.mjs +80 -29
  65. package/dist/webpackLoader.mjs.map +1 -1
  66. package/native/tailwind-styled-native.node +0 -0
  67. package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
  68. package/package.json +3 -2
  69. package/native/index.node +0 -0
package/README.md CHANGED
@@ -372,12 +372,17 @@ Diukur di Node.js 22, Rust 1.75.
372
372
  tailwind-styled-v4/
373
373
  ├── native/ # Rust engine (NAPI-RS)
374
374
  │ ├── src/application/
375
- │ │ └── ast_extract.rs # Extract Tailwind classes dari source files
375
+ │ │ ├── ast_extract.rs # Extract Tailwind classes dari source files
376
+ │ │ ├── variant_resolver.rs # Variant resolution with precedence
377
+ │ │ ├── variant_system.rs # Variant composition system
378
+ │ │ └── theme_resolver_pool.rs # Multi-tier caching
376
379
  │ ├── src/domain/
377
380
  │ │ ├── variants.rs # Variant resolution (props override defaults)
381
+ │ │ ├── variant_precedence.rs # Precedence calculation
378
382
  │ │ └── transform.rs # Transform object config → JS component
379
383
  │ └── src/infrastructure/
380
- └── cache_store.rs # Persistent cache dengan bracket-aware parser
384
+ ├── napi_bridge_*.rs # Modularized NAPI bridges
385
+ │ └── cache_*.rs # Multi-tier cache backends
381
386
 
382
387
  ├── packages/
383
388
  │ ├── domain/
@@ -385,11 +390,30 @@ tailwind-styled-v4/
385
390
  │ │ ├── compiler/ # Tailwind JS + LightningCSS pipeline
386
391
  │ │ └── scanner/ # File scanner (Rust-backed)
387
392
  │ ├── presentation/
388
- │ │ └── next/ # Next.js plugin (withTailwindStyled)
393
+ │ │ ├── next/ # Next.js plugin (withTailwindStyled)
394
+ │ │ ├── vite/ # Vite plugin
395
+ │ │ └── rspack/ # Rspack plugin
389
396
  │ └── infrastructure/
390
397
  │ └── cli/ # CLI (tw setup, tw audit, dll)
398
+
399
+ ├── config/ # Configuration files (centralized)
400
+ │ ├── biome.json
401
+ │ ├── tsconfig.base.json
402
+ │ ├── turbo.json
403
+ │ └── ...
404
+
405
+ ├── docs/
406
+ │ ├── archive/ # Phase docs, session summaries, reference
407
+ │ ├── phase-4/, phase-5/, phase-6/ # Phase-specific documentation
408
+ │ └── api/ # API reference
391
409
  ```
392
410
 
411
+ **New Structure (Phase 7):**
412
+ - Configuration files centralized in `config/` directory
413
+ - Documentation archived in `docs/archive/` for cleaner root
414
+ - Modularized NAPI bridges (`napi_bridge_*.rs`) for better maintainability
415
+ - Phase-specific docs in dedicated directories
416
+
393
417
  ---
394
418
 
395
419
  ## TypeScript
@@ -434,7 +458,79 @@ Card.xyz // ❌ TypeScript error
434
458
 
435
459
  ---
436
460
 
437
- ## Development
461
+ ## Architecture Updates (Phase 7)
462
+
463
+ ### R1-R6: Parser Consolidation through Resolver Caching ✅ Completed 2026-06-12
464
+
465
+ Recent Phase 7 updates span multiple refactoring rounds:
466
+
467
+ **R1: Parser Consolidation** ✅
468
+ - Single unified production parser (v2-based)
469
+ - ~5% binary size reduction
470
+ - 100% backward compatible, all 545+ tests passing
471
+
472
+ **R2-R3: Infrastructure Modularization** ✅
473
+ - NAPI bridge modularized into specialized modules
474
+ - Comprehensive integration tests covering all layers
475
+ - Cache backend infrastructure refactored
476
+
477
+ **R4: Property Testing Framework** ✅
478
+ - 6 core properties verified across 53 test cases
479
+ - Parser determinism property testing
480
+ - Round-trip parsing validation
481
+ - Cache consistency & eviction properties
482
+
483
+ **R5: Variant Precedence System** ✅
484
+ - Native variant resolution with precedence handling
485
+ - Compound variant support
486
+ - Theme-aware variant composition
487
+
488
+ **R6: Resolver Caching** ✅
489
+ - Multi-tier caching for theme resolver
490
+ - Performance optimization verified
491
+
492
+ For architecture details and improvements roadmap, see:
493
+ - [Phase 7 Architecture Design](.kiro/specs/phase-7-architecture/design.md)
494
+ - [R4 Property Tests Design](.kiro/specs/phase-7-architecture/R4_PROPERTY_TESTS_DESIGN.md)
495
+ - [R5 Variant Precedence Design](.kiro/specs/phase-7-architecture/R5_VARIANT_PRECEDENCE_DESIGN.md)
496
+ - [Full spec directory](.kiro/specs/phase-7-architecture/)
497
+
498
+ ---
499
+
500
+ ## Recent Changes (82 commits, not yet pushed)
501
+
502
+ ### Infrastructure & Organization 🏗️
503
+ - **Config centralization** — moved 6 root config files to `config/` directory
504
+ - **Docs reorganization** — 42 summary/reference files moved to `docs/archive/`
505
+ - **Benchmarking suite** — added comprehensive performance benchmarking (`native/benches/`)
506
+
507
+ ### Rust Engine Enhancements 🦀
508
+ - **Modularized NAPI bridges** — split monolithic bridge into specialized modules:
509
+ - `napi_bridge_cache.rs` — caching layer
510
+ - `napi_bridge_redis.rs` — distributed cache
511
+ - `napi_bridge_theme.rs` — theme resolution
512
+ - `napi_bridge_variants.rs` — variant composition
513
+ - And 5 more specialized modules
514
+ - **Theme resolver pool** — multi-tier caching with adaptive strategies
515
+ - **Variant system improvements** — precedence calculation, compound variant support
516
+
517
+ ### Testing & Validation ✅
518
+ - **Property testing** — 6 core properties across 53 test cases
519
+ - **Integration tests** — comprehensive NAPI module tests (1000+ tests added)
520
+ - **Variant precedence tests** — 493+ test cases for variant resolution
521
+ - **Performance benchmarks** — week8, week9 scale testing suites
522
+
523
+ ### TypeScript/JS Improvements
524
+ - **Native bridge refactor** — simplified async/sync patterns, improved error handling
525
+ - **Cache integration** — unified cache interface across Redis, LRU, and file-based backends
526
+ - **Stream support** — added streaming CSS compilation
527
+
528
+ ### Documentation 📚
529
+ - **Phase 7 specs** — comprehensive design docs in `.kiro/specs/phase-7-architecture/`
530
+ - **NAPI module guide** — `MIGRATION_GUIDE_PHASE_7_3.md`
531
+ - **Architecture docs** — modular bridge patterns and integration guide
532
+
533
+ ---
438
534
 
439
535
  ```bash
440
536
  git clone https://github.com/Dictionar32/tailwind-styled-v4.git
@@ -8,6 +8,10 @@ interface AnimationRegistry {
8
8
  reset(): void;
9
9
  /** Check apakah className sudah terdaftar di registry */
10
10
  has(className: string): boolean;
11
+ /** Expand animation to include browser-specific prefixes using native Rust optimization */
12
+ expandAnimation(css: string): Promise<string>;
13
+ /** Transform animation for better compatibility */
14
+ transformAnimationForCompatibility(css: string): Promise<string>;
11
15
  }
12
16
  declare function createAnimationRegistry(options?: AnimationRegistryOptions): AnimationRegistry;
13
17
 
package/dist/animate.d.ts CHANGED
@@ -8,6 +8,10 @@ interface AnimationRegistry {
8
8
  reset(): void;
9
9
  /** Check apakah className sudah terdaftar di registry */
10
10
  has(className: string): boolean;
11
+ /** Expand animation to include browser-specific prefixes using native Rust optimization */
12
+ expandAnimation(css: string): Promise<string>;
13
+ /** Transform animation for better compatibility */
14
+ transformAnimationForCompatibility(css: string): Promise<string>;
11
15
  }
12
16
  declare function createAnimationRegistry(options?: AnimationRegistryOptions): AnimationRegistry;
13
17
 
package/dist/animate.js CHANGED
@@ -831,6 +831,28 @@ function createAnimationRegistry(options = {}) {
831
831
  },
832
832
  has(className) {
833
833
  return classNames.has(className);
834
+ },
835
+ async expandAnimation(css) {
836
+ const binding = await getAnimateBinding();
837
+ if (binding.expandAnimationNapi) {
838
+ try {
839
+ return binding.expandAnimationNapi(css) || css;
840
+ } catch {
841
+ return css;
842
+ }
843
+ }
844
+ return css;
845
+ },
846
+ async transformAnimationForCompatibility(css) {
847
+ const binding = await getAnimateBinding();
848
+ if (binding.transformAnimation) {
849
+ try {
850
+ return binding.transformAnimation(css) || css;
851
+ } catch {
852
+ return css;
853
+ }
854
+ }
855
+ return css;
834
856
  }
835
857
  };
836
858
  }