@csszyx/core 0.1.1 β†’ 0.1.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.
package/README.md CHANGED
@@ -1,113 +1,83 @@
1
- # <p align="center">🌊 @csszyx/core</p>
1
+ # @csszyx/core
2
2
 
3
- <p align="center">
4
- <img src="https://img.shields.io/badge/WASM-Powered-624de3?style=for-the-badge&logo=webassembly" alt="WASM Powered" />
5
- <img src="https://img.shields.io/badge/Rust-Core-dea584?style=for-the-badge&logo=rust" alt="Rust Core" />
6
- <img src="https://img.shields.io/badge/TypeScript-Ready-3178c6?style=for-the-badge&logo=typescript" alt="TypeScript Ready" />
7
- </p>
3
+ > Rust/WASM core for csszyx -- encoder, checksum, collision detection, and recovery tokens.
8
4
 
9
- ---
5
+ Compiled to WebAssembly, this package provides the performance-critical operations for the csszyx ecosystem. It runs in Node.js, browsers, and edge environments.
10
6
 
11
- ## ✨ The Engine of csszyx
12
-
13
- `@csszyx/core` is a high-performance, precision-engineered Rust core for the **csszyx** ecosystem. Compiled to WebAssembly, it brings near-native performance to Node.js, Browsers, and Edge environments.
14
-
15
- ### πŸ”₯ Why Core?
16
-
17
- - **Blazing Speed**: Offloads performance-critical operations (Hashing, Transformation, Encoding) to optimized Rust.
18
- - **Universal Integrity**: Ensures bit-perfect mangle map consistency between SSR and hydration.
19
- - **Security-First**: Uses SHA-256 and Base62 for tamper-proof tokens and collision-free variable names.
20
- - **Zero Dependencies**: Lightweight WASM binary with no external runtimes required.
21
-
22
- ---
23
-
24
- ## πŸš€ Quick Start
7
+ ## Installation
25
8
 
26
9
  ```bash
27
10
  pnpm add @csszyx/core
28
11
  ```
29
12
 
30
- ### Initialization
13
+ ## Initialization
31
14
 
32
15
  ```typescript
33
- import { init } from '@csszyx/core';
16
+ import { init } from "@csszyx/core";
34
17
 
35
- async function bootstrap() {
36
- await init();
37
- // Core is ready to flow 🌊
38
- }
18
+ await init();
39
19
  ```
40
20
 
41
- ---
21
+ ## Modules
42
22
 
43
- ## πŸ›  Modules
44
-
45
- ### πŸ—ΊοΈ Mangle Map Integrity
23
+ ### Mangle Map Integrity
46
24
 
47
25
  Deterministic SHA-256 checksums to synchronize server-side class names with client-side hydration.
48
26
 
49
27
  ```typescript
50
- import { compute_mangle_checksum, verify_mangle_checksum } from '@csszyx/core';
28
+ import { compute_mangle_checksum, verify_mangle_checksum } from "@csszyx/core";
51
29
 
52
- const mangleMap = { 'p-4': 'z', 'm-2': 'y' };
30
+ const mangleMap = { "p-4": "z", "m-2": "y" };
53
31
  const checksum = compute_mangle_checksum(mangleMap);
54
- // Results in a deterministic 16-char hex hash
32
+ // Returns a deterministic 16-char hex hash
55
33
  ```
56
34
 
57
- ### 🎭 Transformer
35
+ ### Transformer
58
36
 
59
- Universal conversion of object-based Tailwind syntax into optimized class strings.
37
+ Converts object-based Tailwind syntax into class strings.
60
38
 
61
39
  ```typescript
62
- import { transform_sz } from '@csszyx/core';
40
+ import { transform_sz } from "@csszyx/core";
63
41
 
64
- // Supports: Negatives, Opacity, Nesting, Integers
65
42
  transform_sz({
66
- m: -4,
67
- bg: 'blue-500/20',
68
- hover: { scale: 110 }
43
+ m: -4,
44
+ bg: "blue-500/20",
45
+ hover: { scale: 110 },
69
46
  });
70
47
  // "-m-4 bg-blue-500/20 hover:scale-110"
71
48
  ```
72
49
 
73
- ### πŸ”’ Tiered Encoder
50
+ ### Tiered Encoder
74
51
 
75
- The world's smallest CSS-compliant class name generator.
52
+ CSS-compliant class name generator using reversed tier encoding (z -> y -> x).
76
53
 
77
- | Tier | Range | Format | Example |
78
- | :--- | :--- | :--- | :--- |
79
- | **Tier 1** | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
80
- | **Tier 2** | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
81
- | **Tier 3** | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
54
+ | Tier | Range | Format | Example |
55
+ | :----- | :--------- | :---------------- | :------------ |
56
+ | Tier 1 | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
57
+ | Tier 2 | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
58
+ | Tier 3 | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
82
59
 
83
- ### πŸ›‘οΈ Collision Detector
60
+ ### Collision Detector
84
61
 
85
62
  Dual-hash resolution strategy for unique CSS variable names.
86
63
 
87
64
  ```typescript
88
- import { WasmCollisionDetector } from '@csszyx/core';
65
+ import { WasmCollisionDetector } from "@csszyx/core";
89
66
 
90
67
  const detector = new WasmCollisionDetector();
91
- const varId = detector.add('#ff0000'); // "--v-a1b2c3"
68
+ const varId = detector.add("#ff0000"); // "--v-a1b2c3"
92
69
  ```
93
70
 
94
- ---
95
-
96
- ## ⚑ Performance Matrix
97
-
98
- Benchmarks performed on Apple M2 (WASM Node v20 target)
99
-
100
- | Operation | WASM (Rust) | Pure JS (Legacy) | Improvement |
101
- | :--- | :--- | :--- | :--- |
102
- | **Integrity Check** | < 1ms | ~15ms | **15x faster** |
103
- | **ID Encoding** | ~5ns | ~50ns | **10x faster** |
104
- | **Token Auth** | ~25ns | ~250ns | **10x faster** |
105
- | **Transformer** | Optimized | Variable | Stable 🌊 |
71
+ ## Performance
106
72
 
107
- > **Tech Tip**: WASM excels in consistency. Unlike JS which relies on JIT optimization, WASM provides deterministic, high-speed execution from the very first call.
73
+ Benchmarks on Apple M2 (WASM, Node v20):
108
74
 
109
- ---
75
+ | Operation | WASM (Rust) | Pure JS | Speedup |
76
+ | :-------------- | :---------- | :------ | :------ |
77
+ | Integrity Check | < 1ms | ~15ms | 15x |
78
+ | ID Encoding | ~5ns | ~50ns | 10x |
79
+ | Token Auth | ~25ns | ~250ns | 10x |
110
80
 
111
- ## πŸ“„ License
81
+ ## License
112
82
 
113
- MIT Β© 2026 csszyx Team
83
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "WASM core for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
package/pkg/README.md CHANGED
@@ -1,113 +1,83 @@
1
- # <p align="center">🌊 @csszyx/core</p>
1
+ # @csszyx/core
2
2
 
3
- <p align="center">
4
- <img src="https://img.shields.io/badge/WASM-Powered-624de3?style=for-the-badge&logo=webassembly" alt="WASM Powered" />
5
- <img src="https://img.shields.io/badge/Rust-Core-dea584?style=for-the-badge&logo=rust" alt="Rust Core" />
6
- <img src="https://img.shields.io/badge/TypeScript-Ready-3178c6?style=for-the-badge&logo=typescript" alt="TypeScript Ready" />
7
- </p>
3
+ > Rust/WASM core for csszyx -- encoder, checksum, collision detection, and recovery tokens.
8
4
 
9
- ---
5
+ Compiled to WebAssembly, this package provides the performance-critical operations for the csszyx ecosystem. It runs in Node.js, browsers, and edge environments.
10
6
 
11
- ## ✨ The Engine of csszyx
12
-
13
- `@csszyx/core` is a high-performance, precision-engineered Rust core for the **csszyx** ecosystem. Compiled to WebAssembly, it brings near-native performance to Node.js, Browsers, and Edge environments.
14
-
15
- ### πŸ”₯ Why Core?
16
-
17
- - **Blazing Speed**: Offloads performance-critical operations (Hashing, Transformation, Encoding) to optimized Rust.
18
- - **Universal Integrity**: Ensures bit-perfect mangle map consistency between SSR and hydration.
19
- - **Security-First**: Uses SHA-256 and Base62 for tamper-proof tokens and collision-free variable names.
20
- - **Zero Dependencies**: Lightweight WASM binary with no external runtimes required.
21
-
22
- ---
23
-
24
- ## πŸš€ Quick Start
7
+ ## Installation
25
8
 
26
9
  ```bash
27
10
  pnpm add @csszyx/core
28
11
  ```
29
12
 
30
- ### Initialization
13
+ ## Initialization
31
14
 
32
15
  ```typescript
33
- import { init } from '@csszyx/core';
16
+ import { init } from "@csszyx/core";
34
17
 
35
- async function bootstrap() {
36
- await init();
37
- // Core is ready to flow 🌊
38
- }
18
+ await init();
39
19
  ```
40
20
 
41
- ---
21
+ ## Modules
42
22
 
43
- ## πŸ›  Modules
44
-
45
- ### πŸ—ΊοΈ Mangle Map Integrity
23
+ ### Mangle Map Integrity
46
24
 
47
25
  Deterministic SHA-256 checksums to synchronize server-side class names with client-side hydration.
48
26
 
49
27
  ```typescript
50
- import { compute_mangle_checksum, verify_mangle_checksum } from '@csszyx/core';
28
+ import { compute_mangle_checksum, verify_mangle_checksum } from "@csszyx/core";
51
29
 
52
- const mangleMap = { 'p-4': 'z', 'm-2': 'y' };
30
+ const mangleMap = { "p-4": "z", "m-2": "y" };
53
31
  const checksum = compute_mangle_checksum(mangleMap);
54
- // Results in a deterministic 16-char hex hash
32
+ // Returns a deterministic 16-char hex hash
55
33
  ```
56
34
 
57
- ### 🎭 Transformer
35
+ ### Transformer
58
36
 
59
- Universal conversion of object-based Tailwind syntax into optimized class strings.
37
+ Converts object-based Tailwind syntax into class strings.
60
38
 
61
39
  ```typescript
62
- import { transform_sz } from '@csszyx/core';
40
+ import { transform_sz } from "@csszyx/core";
63
41
 
64
- // Supports: Negatives, Opacity, Nesting, Integers
65
42
  transform_sz({
66
- m: -4,
67
- bg: 'blue-500/20',
68
- hover: { scale: 110 }
43
+ m: -4,
44
+ bg: "blue-500/20",
45
+ hover: { scale: 110 },
69
46
  });
70
47
  // "-m-4 bg-blue-500/20 hover:scale-110"
71
48
  ```
72
49
 
73
- ### πŸ”’ Tiered Encoder
50
+ ### Tiered Encoder
74
51
 
75
- The world's smallest CSS-compliant class name generator.
52
+ CSS-compliant class name generator using reversed tier encoding (z -> y -> x).
76
53
 
77
- | Tier | Range | Format | Example |
78
- | :--- | :--- | :--- | :--- |
79
- | **Tier 1** | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
80
- | **Tier 2** | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
81
- | **Tier 3** | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
54
+ | Tier | Range | Format | Example |
55
+ | :----- | :--------- | :---------------- | :------------ |
56
+ | Tier 1 | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
57
+ | Tier 2 | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
58
+ | Tier 3 | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
82
59
 
83
- ### πŸ›‘οΈ Collision Detector
60
+ ### Collision Detector
84
61
 
85
62
  Dual-hash resolution strategy for unique CSS variable names.
86
63
 
87
64
  ```typescript
88
- import { WasmCollisionDetector } from '@csszyx/core';
65
+ import { WasmCollisionDetector } from "@csszyx/core";
89
66
 
90
67
  const detector = new WasmCollisionDetector();
91
- const varId = detector.add('#ff0000'); // "--v-a1b2c3"
68
+ const varId = detector.add("#ff0000"); // "--v-a1b2c3"
92
69
  ```
93
70
 
94
- ---
95
-
96
- ## ⚑ Performance Matrix
97
-
98
- Benchmarks performed on Apple M2 (WASM Node v20 target)
99
-
100
- | Operation | WASM (Rust) | Pure JS (Legacy) | Improvement |
101
- | :--- | :--- | :--- | :--- |
102
- | **Integrity Check** | < 1ms | ~15ms | **15x faster** |
103
- | **ID Encoding** | ~5ns | ~50ns | **10x faster** |
104
- | **Token Auth** | ~25ns | ~250ns | **10x faster** |
105
- | **Transformer** | Optimized | Variable | Stable 🌊 |
71
+ ## Performance
106
72
 
107
- > **Tech Tip**: WASM excels in consistency. Unlike JS which relies on JIT optimization, WASM provides deterministic, high-speed execution from the very first call.
73
+ Benchmarks on Apple M2 (WASM, Node v20):
108
74
 
109
- ---
75
+ | Operation | WASM (Rust) | Pure JS | Speedup |
76
+ | :-------------- | :---------- | :------ | :------ |
77
+ | Integrity Check | < 1ms | ~15ms | 15x |
78
+ | ID Encoding | ~5ns | ~50ns | 10x |
79
+ | Token Auth | ~25ns | ~250ns | 10x |
110
80
 
111
- ## πŸ“„ License
81
+ ## License
112
82
 
113
- MIT Β© 2026 csszyx Team
83
+ MIT
Binary file
@@ -1,113 +1,83 @@
1
- # <p align="center">🌊 @csszyx/core</p>
1
+ # @csszyx/core
2
2
 
3
- <p align="center">
4
- <img src="https://img.shields.io/badge/WASM-Powered-624de3?style=for-the-badge&logo=webassembly" alt="WASM Powered" />
5
- <img src="https://img.shields.io/badge/Rust-Core-dea584?style=for-the-badge&logo=rust" alt="Rust Core" />
6
- <img src="https://img.shields.io/badge/TypeScript-Ready-3178c6?style=for-the-badge&logo=typescript" alt="TypeScript Ready" />
7
- </p>
3
+ > Rust/WASM core for csszyx -- encoder, checksum, collision detection, and recovery tokens.
8
4
 
9
- ---
5
+ Compiled to WebAssembly, this package provides the performance-critical operations for the csszyx ecosystem. It runs in Node.js, browsers, and edge environments.
10
6
 
11
- ## ✨ The Engine of csszyx
12
-
13
- `@csszyx/core` is a high-performance, precision-engineered Rust core for the **csszyx** ecosystem. Compiled to WebAssembly, it brings near-native performance to Node.js, Browsers, and Edge environments.
14
-
15
- ### πŸ”₯ Why Core?
16
-
17
- - **Blazing Speed**: Offloads performance-critical operations (Hashing, Transformation, Encoding) to optimized Rust.
18
- - **Universal Integrity**: Ensures bit-perfect mangle map consistency between SSR and hydration.
19
- - **Security-First**: Uses SHA-256 and Base62 for tamper-proof tokens and collision-free variable names.
20
- - **Zero Dependencies**: Lightweight WASM binary with no external runtimes required.
21
-
22
- ---
23
-
24
- ## πŸš€ Quick Start
7
+ ## Installation
25
8
 
26
9
  ```bash
27
10
  pnpm add @csszyx/core
28
11
  ```
29
12
 
30
- ### Initialization
13
+ ## Initialization
31
14
 
32
15
  ```typescript
33
- import { init } from '@csszyx/core';
16
+ import { init } from "@csszyx/core";
34
17
 
35
- async function bootstrap() {
36
- await init();
37
- // Core is ready to flow 🌊
38
- }
18
+ await init();
39
19
  ```
40
20
 
41
- ---
21
+ ## Modules
42
22
 
43
- ## πŸ›  Modules
44
-
45
- ### πŸ—ΊοΈ Mangle Map Integrity
23
+ ### Mangle Map Integrity
46
24
 
47
25
  Deterministic SHA-256 checksums to synchronize server-side class names with client-side hydration.
48
26
 
49
27
  ```typescript
50
- import { compute_mangle_checksum, verify_mangle_checksum } from '@csszyx/core';
28
+ import { compute_mangle_checksum, verify_mangle_checksum } from "@csszyx/core";
51
29
 
52
- const mangleMap = { 'p-4': 'z', 'm-2': 'y' };
30
+ const mangleMap = { "p-4": "z", "m-2": "y" };
53
31
  const checksum = compute_mangle_checksum(mangleMap);
54
- // Results in a deterministic 16-char hex hash
32
+ // Returns a deterministic 16-char hex hash
55
33
  ```
56
34
 
57
- ### 🎭 Transformer
35
+ ### Transformer
58
36
 
59
- Universal conversion of object-based Tailwind syntax into optimized class strings.
37
+ Converts object-based Tailwind syntax into class strings.
60
38
 
61
39
  ```typescript
62
- import { transform_sz } from '@csszyx/core';
40
+ import { transform_sz } from "@csszyx/core";
63
41
 
64
- // Supports: Negatives, Opacity, Nesting, Integers
65
42
  transform_sz({
66
- m: -4,
67
- bg: 'blue-500/20',
68
- hover: { scale: 110 }
43
+ m: -4,
44
+ bg: "blue-500/20",
45
+ hover: { scale: 110 },
69
46
  });
70
47
  // "-m-4 bg-blue-500/20 hover:scale-110"
71
48
  ```
72
49
 
73
- ### πŸ”’ Tiered Encoder
50
+ ### Tiered Encoder
74
51
 
75
- The world's smallest CSS-compliant class name generator.
52
+ CSS-compliant class name generator using reversed tier encoding (z -> y -> x).
76
53
 
77
- | Tier | Range | Format | Example |
78
- | :--- | :--- | :--- | :--- |
79
- | **Tier 1** | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
80
- | **Tier 2** | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
81
- | **Tier 3** | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
54
+ | Tier | Range | Format | Example |
55
+ | :----- | :--------- | :---------------- | :------------ |
56
+ | Tier 1 | 0 - 51 | \[z-aZ-A\] | `z`, `y`, `x` |
57
+ | Tier 2 | 52 - 571 | \[z-aZ-A\]\[9-0\] | `z9`, `y8` |
58
+ | Tier 3 | 572 - 3275 | \[z-aZ-A\]{2} | `zz`, `zy` |
82
59
 
83
- ### πŸ›‘οΈ Collision Detector
60
+ ### Collision Detector
84
61
 
85
62
  Dual-hash resolution strategy for unique CSS variable names.
86
63
 
87
64
  ```typescript
88
- import { WasmCollisionDetector } from '@csszyx/core';
65
+ import { WasmCollisionDetector } from "@csszyx/core";
89
66
 
90
67
  const detector = new WasmCollisionDetector();
91
- const varId = detector.add('#ff0000'); // "--v-a1b2c3"
68
+ const varId = detector.add("#ff0000"); // "--v-a1b2c3"
92
69
  ```
93
70
 
94
- ---
95
-
96
- ## ⚑ Performance Matrix
97
-
98
- Benchmarks performed on Apple M2 (WASM Node v20 target)
99
-
100
- | Operation | WASM (Rust) | Pure JS (Legacy) | Improvement |
101
- | :--- | :--- | :--- | :--- |
102
- | **Integrity Check** | < 1ms | ~15ms | **15x faster** |
103
- | **ID Encoding** | ~5ns | ~50ns | **10x faster** |
104
- | **Token Auth** | ~25ns | ~250ns | **10x faster** |
105
- | **Transformer** | Optimized | Variable | Stable 🌊 |
71
+ ## Performance
106
72
 
107
- > **Tech Tip**: WASM excels in consistency. Unlike JS which relies on JIT optimization, WASM provides deterministic, high-speed execution from the very first call.
73
+ Benchmarks on Apple M2 (WASM, Node v20):
108
74
 
109
- ---
75
+ | Operation | WASM (Rust) | Pure JS | Speedup |
76
+ | :-------------- | :---------- | :------ | :------ |
77
+ | Integrity Check | < 1ms | ~15ms | 15x |
78
+ | ID Encoding | ~5ns | ~50ns | 10x |
79
+ | Token Auth | ~25ns | ~250ns | 10x |
110
80
 
111
- ## πŸ“„ License
81
+ ## License
112
82
 
113
- MIT Β© 2026 csszyx Team
83
+ MIT
Binary file