dispersa 0.1.3 → 0.2.0
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 +21 -5
- package/dist/builders.cjs +1835 -66
- package/dist/builders.cjs.map +1 -1
- package/dist/builders.d.cts +151 -2
- package/dist/builders.d.ts +151 -2
- package/dist/builders.js +1834 -68
- package/dist/builders.js.map +1 -1
- package/dist/cli/cli.d.ts +11 -0
- package/dist/cli/cli.js +201 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/config.d.ts +8 -0
- package/dist/cli/config.js +8 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +203 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/filters.cjs +8 -7
- package/dist/filters.cjs.map +1 -1
- package/dist/filters.js +8 -7
- package/dist/filters.js.map +1 -1
- package/dist/{index-CPB9Ea9U.d.ts → index-BP52gB00.d.ts} +179 -56
- package/dist/{index-DKf9WMQG.d.cts → index-CePv_bgv.d.cts} +179 -56
- package/dist/index.cjs +2029 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2028 -243
- package/dist/index.js.map +1 -1
- package/dist/preprocessors.cjs.map +1 -1
- package/dist/preprocessors.js.map +1 -1
- package/dist/renderers.cjs.map +1 -1
- package/dist/renderers.d.cts +2 -2
- package/dist/renderers.d.ts +2 -2
- package/dist/renderers.js.map +1 -1
- package/dist/transforms.cjs +5 -5
- package/dist/transforms.cjs.map +1 -1
- package/dist/transforms.js +5 -5
- package/dist/transforms.js.map +1 -1
- package/package.json +18 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Dispersa
|
|
2
2
|
|
|
3
|
-
A TypeScript build system for processing [DTCG 2025.10](https://www.designtokens.org/) design tokens. Dispersa loads resolver documents, resolves references and modifiers, applies filters and transforms, then renders output to CSS, JSON,
|
|
3
|
+
A TypeScript build system for processing [DTCG 2025.10](https://www.designtokens.org/) design tokens. Dispersa loads resolver documents, resolves references and modifiers, applies filters and transforms, then renders output to CSS, JSON, JS/TS or custom modules.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -17,7 +17,17 @@ A TypeScript build system for processing [DTCG 2025.10](https://www.designtokens
|
|
|
17
17
|
|
|
18
18
|
**Composite types:** `shadow`, `typography`, `border`, `strokeStyle`, `transition`, `gradient`
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Getting started
|
|
21
|
+
|
|
22
|
+
### New project
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm create dispersa
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The scaffold prompts for a project directory, lets you pick a template (programmatic or CLI-based), and optionally installs dependencies.
|
|
29
|
+
|
|
30
|
+
### Add to an existing project
|
|
21
31
|
|
|
22
32
|
```bash
|
|
23
33
|
pnpm add dispersa
|
|
@@ -161,6 +171,12 @@ Renders JavaScript/TypeScript modules.
|
|
|
161
171
|
| `transforms` | `Transform[]` | -- | Per-output transforms |
|
|
162
172
|
| `filters` | `Filter[]` | -- | Per-output filters |
|
|
163
173
|
|
|
174
|
+
### Experimental: native platform outputs
|
|
175
|
+
|
|
176
|
+
Dispersa also ships `ios()` and `android()` builders for Swift/SwiftUI and Kotlin/Jetpack Compose. These are **experimental** -- APIs and generated code may change.
|
|
177
|
+
|
|
178
|
+
See the [multi-platform example](./examples/multi-platform/) for a complete setup.
|
|
179
|
+
|
|
164
180
|
## Output presets
|
|
165
181
|
|
|
166
182
|
Presets control how modifier permutations are packaged into files.
|
|
@@ -658,10 +674,10 @@ All hooks support both sync and async functions.
|
|
|
658
674
|
|
|
659
675
|
## CLI
|
|
660
676
|
|
|
661
|
-
Dispersa
|
|
677
|
+
Dispersa includes a CLI for a config-first workflow.
|
|
662
678
|
|
|
663
679
|
```bash
|
|
664
|
-
pnpm add dispersa
|
|
680
|
+
pnpm add dispersa
|
|
665
681
|
```
|
|
666
682
|
|
|
667
683
|
```bash
|
|
@@ -673,7 +689,7 @@ The CLI auto-discovers config files named `dispersa.config.(ts|js|mts|mjs|cts|cj
|
|
|
673
689
|
|
|
674
690
|
```typescript
|
|
675
691
|
// dispersa.config.ts
|
|
676
|
-
import { defineConfig } from 'dispersa
|
|
692
|
+
import { defineConfig } from 'dispersa/config'
|
|
677
693
|
import { css, json } from 'dispersa'
|
|
678
694
|
import { colorToHex, nameKebabCase } from 'dispersa/transforms'
|
|
679
695
|
|