@mildastudio/milda 0.1.0 → 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 +51 -19
- package/dist/index.cjs +7849 -0
- package/dist/index.d.cts +1485 -0
- package/dist/index.d.mts +1259 -498
- package/dist/index.mjs +7732 -3007
- package/package.json +17 -10
- package/dist/index.d.ts +0 -724
- package/dist/index.js +0 -3094
package/README.md
CHANGED
|
@@ -1,28 +1,51 @@
|
|
|
1
|
-
# milda
|
|
1
|
+
# @mildastudio/milda
|
|
2
2
|
|
|
3
|
-
The **Milda language**
|
|
3
|
+
The **Milda language** - a platform-neutral design language for describing design
|
|
4
4
|
systems and their components, and the canonical AST that tools exchange.
|
|
5
5
|
|
|
6
|
-
Milda separates
|
|
7
|
-
styling intent) from
|
|
8
|
-
once can be generated into React, CSS, Figma variables, and
|
|
6
|
+
Milda separates _what a component is_ (its contract, anatomy, behavior, and
|
|
7
|
+
styling intent) from _how any one platform realizes it_. A description written
|
|
8
|
+
once can be generated into React, CSS, Figma variables, and - by design - other
|
|
9
9
|
targets, without the description itself leaking platform assumptions.
|
|
10
10
|
|
|
11
|
+
> This repository is the public, open-source mirror of the `packages/milda`
|
|
12
|
+
> package from the Milda monorepo, which stays the single source of truth. See
|
|
13
|
+
> [milda.dev](https://milda.dev) for the product and the full DSL documentation.
|
|
14
|
+
|
|
15
|
+
Try the language in the browser, with live preview of the tokens and components a file
|
|
16
|
+
describes, at [play.milda.dev](https://play.milda.dev).
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @mildastudio/milda
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { preludeV0, validate, resolveToken } from '@mildastudio/milda'
|
|
26
|
+
```
|
|
27
|
+
|
|
11
28
|
## What's in here
|
|
12
29
|
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
30
|
+
- **Spec** (`spec/`) - the normative language: [`PRELUDE.md`](spec/PRELUDE.md)
|
|
31
|
+
(source of truth), [`GRAMMAR.ebnf`](spec/GRAMMAR.ebnf), [`ast.schema.json`](spec/ast.schema.json),
|
|
32
|
+
[`ROADMAP.md`](spec/ROADMAP.md), the language design [`proposals/`](spec/proposals/),
|
|
33
|
+
and `examples/` (validate them with `node spec/validate.js`).
|
|
34
|
+
- **AST** (`types/ast.ts`) - the canonical interchange artifact. The spec in
|
|
35
|
+
[`spec/PRELUDE.md`](spec/PRELUDE.md) is the normative source of truth; this package
|
|
36
|
+
is one implementation of it.
|
|
37
|
+
- **Tokens** (`types/tokens.ts`) - layered, context-aware token values
|
|
38
|
+
(color, dimension, shadow, typography, ...) with alias chains and an explicit
|
|
18
39
|
`escape` leaf for values a target can't express natively.
|
|
19
|
-
- **Facets, layout, states, capabilities** (`types/facets.ts`)
|
|
40
|
+
- **Facets, layout, states, capabilities** (`types/facets.ts`) - the
|
|
20
41
|
platform-neutral styling and layout vocabulary.
|
|
21
|
-
- **Prelude** (`prelude/preludeV0.ts`)
|
|
22
|
-
data: behavior
|
|
23
|
-
- **
|
|
24
|
-
|
|
25
|
-
|
|
42
|
+
- **Prelude** (`prelude/preludeV0.ts`) - the standard library expressed as
|
|
43
|
+
data: behavior _atoms_, _archetypes_, facets, states, and capabilities.
|
|
44
|
+
- **Parser and printer** (`dsl/*`) - the `.milda` reader (`parseMildaDocument`), the closed
|
|
45
|
+
vocabularies every tool imports (`dsl/vocabulary.ts`), and the surface version.
|
|
46
|
+
- **Engine** (`engine/*`) - pure, side-effect-free semantics over the AST: `resolveToken`,
|
|
47
|
+
`validate`, and `conformance` (which reports where a description has holes for a given
|
|
48
|
+
target).
|
|
26
49
|
|
|
27
50
|
## Design invariants
|
|
28
51
|
|
|
@@ -32,13 +55,22 @@ targets, without the description itself leaking platform assumptions.
|
|
|
32
55
|
in the language.
|
|
33
56
|
- **Honest escape hatches.** Where a value or capability can't be expressed
|
|
34
57
|
cleanly, the model carries an explicit `escape` leaf rather than silently
|
|
35
|
-
approximating
|
|
58
|
+
approximating - so `conformance` can tell you exactly what won't survive a
|
|
36
59
|
given target.
|
|
37
60
|
|
|
61
|
+
## Where it fits
|
|
62
|
+
|
|
63
|
+
`@mildastudio/milda` is the language layer. The generators and pipeline that
|
|
64
|
+
consume it live in the [milda-engine](https://github.com/mildastudio/milda-engine)
|
|
65
|
+
repo (`@mildastudio/core`, `@mildastudio/contract`, `@mildastudio/generate`,
|
|
66
|
+
`@mildastudio/release`), which depends on this package.
|
|
67
|
+
|
|
38
68
|
## Status
|
|
39
69
|
|
|
40
|
-
`0.x`
|
|
41
|
-
|
|
70
|
+
`0.x` - the language and AST are still evolving; treat the shape as unstable until `1.0`. The
|
|
71
|
+
surface syntax is versioned separately (`milda 0.7` in a file's header) and every change to it is
|
|
72
|
+
recorded in [`spec/FORMAT.md`](spec/FORMAT.md) §6. The documentation, including a tour and a
|
|
73
|
+
keyword-by-keyword reference held to this parser by tests, is at [milda.dev](https://milda.dev).
|
|
42
74
|
|
|
43
75
|
## License
|
|
44
76
|
|