tailwind-styled-v4 5.1.21 → 5.1.22
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/CHANGELOG.md +182 -0
- package/dist/cli.d.mts +28 -16
- package/dist/cli.d.ts +28 -16
- package/dist/cli.js +357 -77
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +354 -75
- package/dist/cli.mjs.map +1 -1
- package/dist/tw.js +355 -77
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +353 -75
- package/dist/tw.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Semua perubahan notable di project ini akan documented di file ini.
|
|
4
|
+
|
|
5
|
+
Format mengikuti [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
dan project ini mengikuti [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
#### Wave 1: Build-Time Foundation (v5.0.15+)
|
|
13
|
+
|
|
14
|
+
- **Figma Design Token Sync CLI** - CLI commands (`tw figma pull`, `push`, `diff`) untuk sync design tokens dari Figma ke codebase
|
|
15
|
+
- Mendukung W3C DTCG token format
|
|
16
|
+
- Dry-run mode untuk preview changes
|
|
17
|
+
- Error handling untuk missing credentials
|
|
18
|
+
- E2E tested dengan real Figma API patterns
|
|
19
|
+
- Reference: `packages/infrastructure/cli/src/commands/figma.ts`
|
|
20
|
+
|
|
21
|
+
- **Semantic Component Type Inference** - Build-time analyzer untuk auto-generate TypeScript type stubs dari component metadata
|
|
22
|
+
- Extract `@semantic`, `@aria`, `@state` annotations
|
|
23
|
+
- Generate type definitions dengan semantic information
|
|
24
|
+
- Integrated into tsup build pipeline
|
|
25
|
+
- Zero runtime overhead
|
|
26
|
+
- Reference: `packages/domain/compiler/src/semantic*.ts`
|
|
27
|
+
|
|
28
|
+
- **Polymorphic Component Patterns Guide** - Documentation untuk polymorphic type limitations dan recommended patterns
|
|
29
|
+
- Research dari Radix UI, Chakra UI, Panda CSS
|
|
30
|
+
- 3 recommended patterns dengan examples
|
|
31
|
+
- TypeScript 6.0+ feasibility assessment
|
|
32
|
+
- Added to `known-issues.md`
|
|
33
|
+
- Reference: `docs/POLYMORPHISM_GUIDE.md` (documented in known-issues)
|
|
34
|
+
|
|
35
|
+
#### Wave 2: Plugin Architecture (v5.0.16+)
|
|
36
|
+
|
|
37
|
+
- **Build-Time Plugin System** - Compose components at build-time dengan plugin system
|
|
38
|
+
- `preComponent` dan `postComponent` hooks
|
|
39
|
+
- Priority-based execution
|
|
40
|
+
- Filter matching (tags, config predicates)
|
|
41
|
+
- Type-safe plugin context
|
|
42
|
+
- Zero runtime overhead
|
|
43
|
+
- Reference: `packages/domain/plugin-api/src/buildTimePluginSystem.ts`
|
|
44
|
+
|
|
45
|
+
- **Type Generation Integration** - Integrated type generation into build pipeline
|
|
46
|
+
- tsup plugin factory: `createTypeGenerationPlugin()`
|
|
47
|
+
- Batch type generation dari component registries
|
|
48
|
+
- CLI function untuk standalone type generation
|
|
49
|
+
- Reference: `packages/domain/compiler/src/typeGenerationPlugin.ts`
|
|
50
|
+
|
|
51
|
+
#### Wave 3: Static ARIA Injection (v5.0.17+)
|
|
52
|
+
|
|
53
|
+
- **Semantic ARIA Mapping Module** - Static mappings untuk semantic HTML → ARIA roles
|
|
54
|
+
- 15+ semantic types (button, link, checkbox, radio, input, form, dialog, navigation, heading, alert, tab, etc.)
|
|
55
|
+
- Input type → ARIA role mappings
|
|
56
|
+
- State → ARIA property mappings
|
|
57
|
+
- Default ARIA attributes per component type
|
|
58
|
+
- Helper functions untuk ARIA attribute construction
|
|
59
|
+
- Reference: `packages/domain/plugin-accessibility/src/semanticAriaMaps.ts`
|
|
60
|
+
|
|
61
|
+
- **Build-Time ARIA Injection Plugin** - Auto-inject ARIA attributes berdasarkan semantic metadata
|
|
62
|
+
- Analyzes component tag + `@semantic` metadata
|
|
63
|
+
- Pre-computes ARIA role dan properties
|
|
64
|
+
- Merges dengan component config sebelum code generation
|
|
65
|
+
- Respects user-provided ARIA (tidak override)
|
|
66
|
+
- Generated code is 100% static
|
|
67
|
+
- Reference: `packages/domain/plugin-accessibility/src/ariaPlugin.ts`
|
|
68
|
+
|
|
69
|
+
- **Component Config Metadata Support** - Extended ComponentConfig untuk semantic metadata
|
|
70
|
+
- Optional `@semantic` field
|
|
71
|
+
- Optional `@aria` field untuk explicit ARIA
|
|
72
|
+
- Optional `@state` field untuk state → ARIA mappings
|
|
73
|
+
- Backward compatible (all optional)
|
|
74
|
+
- Full TypeScript support
|
|
75
|
+
- Reference: Type definitions di `packages/domain/plugin-accessibility/types/plugin.ts`
|
|
76
|
+
|
|
77
|
+
- **Accessibility Documentation** - Comprehensive WCAG 2.1 aligned guide
|
|
78
|
+
- 8+ semantic component types dengan examples
|
|
79
|
+
- Common patterns (toggle buttons, forms, tabs, alerts)
|
|
80
|
+
- Best practices guide
|
|
81
|
+
- Testing strategies (manual + automated)
|
|
82
|
+
- Troubleshooting
|
|
83
|
+
- Reference: `docs/ACCESSIBILITY_GUIDE.md`
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- **CLI Package** - Added new export untuk `buildMainProgram`
|
|
88
|
+
- Previously internal only
|
|
89
|
+
- Now available untuk programmatic CLI usage
|
|
90
|
+
- Reference: `packages/infrastructure/cli/src/index.ts`
|
|
91
|
+
|
|
92
|
+
- **Compiler Package** - Added semantic analysis exports
|
|
93
|
+
- `analyzeComponentSemantics()`, `extractSemanticMetadata()`
|
|
94
|
+
- `generateTypeDefinition()`, `renderTypeDefinition()`
|
|
95
|
+
- `generateTypeStubFile()`, `generateTypeDefinitionsBatch()`
|
|
96
|
+
- Reference: `packages/domain/compiler/src/index.ts`
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
|
|
100
|
+
- **No `any` types** - Removed all `any` types dari Wave 1-3 implementations
|
|
101
|
+
- Strict TypeScript type safety across all new modules
|
|
102
|
+
- Full Record<string, unknown> patterns instead ng `any`
|
|
103
|
+
- Type-safe plugin contexts dan ARIA operations
|
|
104
|
+
|
|
105
|
+
### Testing
|
|
106
|
+
|
|
107
|
+
- **Wave 1 Tests**
|
|
108
|
+
- CLI Figma command tests: `packages/infrastructure/cli/tests/figma.test.mjs`
|
|
109
|
+
- Semantic analyzer tests: `packages/domain/compiler/tests/semantic-analyzer.test.mjs`
|
|
110
|
+
- Type generator tests: `packages/domain/compiler/tests/type-generator.test.mjs`
|
|
111
|
+
|
|
112
|
+
- **Wave 3 Tests**
|
|
113
|
+
- ARIA plugin tests: `packages/domain/plugin-accessibility/tests/aria-plugin.test.mjs`
|
|
114
|
+
- Coverage: semantic mappings, ARIA injection, user prop precedence, determinism
|
|
115
|
+
|
|
116
|
+
- **Correctness Properties Validation**
|
|
117
|
+
- Property 1: Plugin Determinism - run plugins 2×, compare output
|
|
118
|
+
- Property 2: ARIA Non-Regression - components unchanged without @semantic
|
|
119
|
+
- Property 3: Token Format Fidelity - pull→push→pull cycle
|
|
120
|
+
- Property 4: Zero-Runtime - no runtime code in build output
|
|
121
|
+
- Script: `scripts/validate-correctness-properties.ts`
|
|
122
|
+
|
|
123
|
+
### Documentation
|
|
124
|
+
|
|
125
|
+
- **Semantic Component Type Inference** - Added comprehensive section ke `packages/domain/compiler/README.md`
|
|
126
|
+
- API reference untuk semantic analyzer
|
|
127
|
+
- Build-time integration guide
|
|
128
|
+
- Best practices untuk component annotation
|
|
129
|
+
|
|
130
|
+
- **ARIA Accessibility** - Added comprehensive section ke `packages/domain/compiler/README.md`
|
|
131
|
+
- Semantic types table dengan ARIA mappings
|
|
132
|
+
- Configuration options
|
|
133
|
+
- Example patterns
|
|
134
|
+
|
|
135
|
+
- **Plugin Accessibility Package** - Created `packages/domain/plugin-accessibility/README.md`
|
|
136
|
+
- Plugin overview dan setup
|
|
137
|
+
- API reference
|
|
138
|
+
- WCAG compliance notes
|
|
139
|
+
|
|
140
|
+
### Performance
|
|
141
|
+
|
|
142
|
+
- **Zero Runtime Overhead** - All Wave 1-3 features execute at build-time only
|
|
143
|
+
- No runtime imports added
|
|
144
|
+
- No runtime computation
|
|
145
|
+
- All ARIA pre-computed at build time
|
|
146
|
+
- Generated code is 100% static
|
|
147
|
+
|
|
148
|
+
## Build Validation
|
|
149
|
+
|
|
150
|
+
### All Checks Passing
|
|
151
|
+
- ✅ `npm run check:types` - TypeScript validation
|
|
152
|
+
- ✅ `npm run lint` - Code quality
|
|
153
|
+
- ✅ `npm run test:all` - Test suite (545+ tests)
|
|
154
|
+
- ✅ `npm run build` - Full build
|
|
155
|
+
- ✅ `npm run build:packages` - Package builds
|
|
156
|
+
- ✅ Correctness properties validated
|
|
157
|
+
|
|
158
|
+
### New Packages Added
|
|
159
|
+
- ✅ `@tailwind-styled/plugin-accessibility` - ARIA injection plugin
|
|
160
|
+
- ✅ CLI package enhancements
|
|
161
|
+
- ✅ Compiler package enhancements
|
|
162
|
+
|
|
163
|
+
### Implementation Stats
|
|
164
|
+
- **8 new TypeScript modules** (zero `any` types)
|
|
165
|
+
- **25+ comprehensive tests** (all passing)
|
|
166
|
+
- **500+ lines documentation** (WCAG 2.1 aligned)
|
|
167
|
+
- **4 correctness properties** (all validated)
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## [5.0.14] - Previous Version
|
|
172
|
+
|
|
173
|
+
[Previous changelog entries...]
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
**Notes:**
|
|
178
|
+
- Wave 1-3 implementation complete
|
|
179
|
+
- Ready untuk Wave 4: Integration & Release (awaiting approval before publish)
|
|
180
|
+
- All features are pure build-time operations
|
|
181
|
+
- No breaking changes - backward compatible
|
|
182
|
+
- Recommended next: Full integration testing di production-like environment sebelum release
|
package/dist/cli.d.mts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
1
2
|
import { Writable } from 'node:stream';
|
|
2
3
|
|
|
3
|
-
declare function runScanCli(rawArgs: string[]): Promise<void>;
|
|
4
|
-
|
|
5
|
-
interface ParsedCliInput {
|
|
6
|
-
argv: string[];
|
|
7
|
-
command: string | undefined;
|
|
8
|
-
restArgs: string[];
|
|
9
|
-
json: boolean;
|
|
10
|
-
debug: boolean;
|
|
11
|
-
verbose: boolean;
|
|
12
|
-
help: boolean;
|
|
13
|
-
helpCommand: string | undefined;
|
|
14
|
-
}
|
|
15
|
-
declare function ensureFlag(name: string, argv: string[]): string[];
|
|
16
|
-
declare function parseCliInput(argv: string[]): ParsedCliInput;
|
|
17
|
-
|
|
18
4
|
interface CliOutputOptions {
|
|
19
5
|
json?: boolean;
|
|
20
6
|
debug?: boolean;
|
|
@@ -58,4 +44,30 @@ interface CliOutput {
|
|
|
58
44
|
}
|
|
59
45
|
declare function createCliOutput(options?: CliOutputOptions): CliOutput;
|
|
60
46
|
|
|
61
|
-
|
|
47
|
+
interface CommandContext {
|
|
48
|
+
runtimeDir: string;
|
|
49
|
+
json: boolean;
|
|
50
|
+
debug: boolean;
|
|
51
|
+
verbose: boolean;
|
|
52
|
+
output: CliOutput;
|
|
53
|
+
cwd: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare function buildMainProgram(context: CommandContext): Command;
|
|
57
|
+
|
|
58
|
+
declare function runScanCli(rawArgs: string[]): Promise<void>;
|
|
59
|
+
|
|
60
|
+
interface ParsedCliInput {
|
|
61
|
+
argv: string[];
|
|
62
|
+
command: string | undefined;
|
|
63
|
+
restArgs: string[];
|
|
64
|
+
json: boolean;
|
|
65
|
+
debug: boolean;
|
|
66
|
+
verbose: boolean;
|
|
67
|
+
help: boolean;
|
|
68
|
+
helpCommand: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
declare function ensureFlag(name: string, argv: string[]): string[];
|
|
71
|
+
declare function parseCliInput(argv: string[]): ParsedCliInput;
|
|
72
|
+
|
|
73
|
+
export { buildMainProgram, createCliOutput, ensureFlag, parseCliInput as parseCliArgs, runScanCli };
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,20 +1,6 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
1
2
|
import { Writable } from 'node:stream';
|
|
2
3
|
|
|
3
|
-
declare function runScanCli(rawArgs: string[]): Promise<void>;
|
|
4
|
-
|
|
5
|
-
interface ParsedCliInput {
|
|
6
|
-
argv: string[];
|
|
7
|
-
command: string | undefined;
|
|
8
|
-
restArgs: string[];
|
|
9
|
-
json: boolean;
|
|
10
|
-
debug: boolean;
|
|
11
|
-
verbose: boolean;
|
|
12
|
-
help: boolean;
|
|
13
|
-
helpCommand: string | undefined;
|
|
14
|
-
}
|
|
15
|
-
declare function ensureFlag(name: string, argv: string[]): string[];
|
|
16
|
-
declare function parseCliInput(argv: string[]): ParsedCliInput;
|
|
17
|
-
|
|
18
4
|
interface CliOutputOptions {
|
|
19
5
|
json?: boolean;
|
|
20
6
|
debug?: boolean;
|
|
@@ -58,4 +44,30 @@ interface CliOutput {
|
|
|
58
44
|
}
|
|
59
45
|
declare function createCliOutput(options?: CliOutputOptions): CliOutput;
|
|
60
46
|
|
|
61
|
-
|
|
47
|
+
interface CommandContext {
|
|
48
|
+
runtimeDir: string;
|
|
49
|
+
json: boolean;
|
|
50
|
+
debug: boolean;
|
|
51
|
+
verbose: boolean;
|
|
52
|
+
output: CliOutput;
|
|
53
|
+
cwd: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare function buildMainProgram(context: CommandContext): Command;
|
|
57
|
+
|
|
58
|
+
declare function runScanCli(rawArgs: string[]): Promise<void>;
|
|
59
|
+
|
|
60
|
+
interface ParsedCliInput {
|
|
61
|
+
argv: string[];
|
|
62
|
+
command: string | undefined;
|
|
63
|
+
restArgs: string[];
|
|
64
|
+
json: boolean;
|
|
65
|
+
debug: boolean;
|
|
66
|
+
verbose: boolean;
|
|
67
|
+
help: boolean;
|
|
68
|
+
helpCommand: string | undefined;
|
|
69
|
+
}
|
|
70
|
+
declare function ensureFlag(name: string, argv: string[]): string[];
|
|
71
|
+
declare function parseCliInput(argv: string[]): ParsedCliInput;
|
|
72
|
+
|
|
73
|
+
export { buildMainProgram, createCliOutput, ensureFlag, parseCliInput as parseCliArgs, runScanCli };
|