cssints 0.2.0 → 0.3.1

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 (50) hide show
  1. package/README.md +88 -44
  2. package/dist/check.mjs +2 -2
  3. package/dist/{contrast-DhK69Xak.mjs → contrast-B49XCnVX.mjs} +2 -2
  4. package/dist/devtools-link-D2YxsJKZ.mjs +94 -0
  5. package/dist/devtools-link.d.mts +55 -0
  6. package/dist/devtools-link.mjs +2 -0
  7. package/dist/groups/baseline-2015/with-downstream.d.mts +81 -0
  8. package/dist/groups/baseline-2015.d.mts +291 -0
  9. package/dist/groups/baseline-2016/with-downstream.d.mts +86 -0
  10. package/dist/groups/baseline-2016.d.mts +310 -0
  11. package/dist/groups/baseline-2017/with-downstream.d.mts +94 -0
  12. package/dist/groups/baseline-2017.d.mts +365 -0
  13. package/dist/groups/baseline-2018/with-downstream.d.mts +94 -0
  14. package/dist/groups/baseline-2018.d.mts +368 -0
  15. package/dist/groups/baseline-2019/with-downstream.d.mts +97 -0
  16. package/dist/groups/baseline-2019.d.mts +375 -0
  17. package/dist/groups/baseline-2020/with-downstream.d.mts +112 -0
  18. package/dist/groups/baseline-2020.d.mts +480 -0
  19. package/dist/groups/baseline-2021/with-downstream.d.mts +125 -0
  20. package/dist/groups/baseline-2021.d.mts +536 -0
  21. package/dist/groups/baseline-2022/with-downstream.d.mts +126 -0
  22. package/dist/groups/baseline-2022.d.mts +562 -0
  23. package/dist/groups/baseline-2023/with-downstream.d.mts +120 -0
  24. package/dist/groups/baseline-2023.d.mts +606 -0
  25. package/dist/groups/baseline-2024/with-downstream.d.mts +627 -0
  26. package/dist/groups/baseline-2024.d.mts +632 -0
  27. package/dist/groups/baseline-2025/with-downstream.d.mts +628 -0
  28. package/dist/groups/baseline-2025.d.mts +640 -0
  29. package/dist/groups/baseline-2026/with-downstream.d.mts +3 -0
  30. package/dist/groups/baseline-2026.d.mts +3 -0
  31. package/dist/groups/newly-available/with-downstream.d.mts +632 -0
  32. package/dist/groups/widely-available/with-downstream.d.mts +121 -0
  33. package/dist/index.mjs +22 -7
  34. package/dist/instrument-BqIZpbIU.mjs +3956 -0
  35. package/dist/{lowered-D2KusPLp.mjs → lowered-aJVapQT6.mjs} +1 -1
  36. package/dist/plugin-types.d.mts +7 -0
  37. package/dist/plugin.d.mts +2 -2
  38. package/dist/plugin.mjs +8 -1
  39. package/dist/{registry-CTumHB8p.mjs → registry-BUSEO32-.mjs} +7 -1
  40. package/dist/{scope-ZVhUxQH1.d.mts → scope-INuJD4RT.d.mts} +8 -1
  41. package/dist/{sheet-BKsMTa0c.mjs → sheet-BeHdq4xt.mjs} +1 -1
  42. package/dist/surface.d.mts +1 -1
  43. package/dist/{theme-BsP2E4LB.mjs → theme-SlQ73rFL.mjs} +3 -3
  44. package/dist/tui.mjs +4 -4
  45. package/dist/vite.d.mts +3 -1
  46. package/dist/vite.mjs +92 -39
  47. package/docs/API.md +458 -231
  48. package/package.json +6 -2
  49. package/skills/cssints-plugin/SKILL.md +2 -0
  50. package/dist/instrument-gCazujmb.mjs +0 -1624
package/README.md CHANGED
@@ -31,22 +31,27 @@ way, each beside `cssints` (`npm install --save-dev @cssints/fluid`); the list i
31
31
  import cssints, { cssTarget, targets } from "cssints/vite";
32
32
 
33
33
  export default {
34
- plugins: [cssints()],
35
- css: { transformer: "lightningcss", lightningcss: { targets } },
36
- build: { cssMinify: "lightningcss", cssTarget },
34
+ plugins: [cssints()],
35
+ css: { transformer: "lightningcss", lightningcss: { targets } },
36
+ build: { cssMinify: "lightningcss", cssTarget },
37
37
  };
38
38
  ```
39
39
 
40
40
  ```ts
41
41
  // the entry, once
42
42
  import "virtual:cssints.css";
43
+ import { reset } from "@cssints/reset" with { type: "cssints" };
44
+
45
+ reset();
43
46
  ```
44
47
 
48
+ `reset()` is the recommended start: [`@cssints/reset`](packages/reset/README.md) is a small modern reset in a layer below every style, so any style of yours beats it. A project without the call has none, as in any app.
49
+
45
50
  `targets` and `cssTarget` come from the browserslist query of the support warnings: the `BROWSERSLIST` variable, else the standard config (`"browserslist"` in `package.json` or `.browserslistrc`, with the `BROWSERSLIST_ENV`, `NODE_ENV` or `production` section), else `defaults`. The exports are computed when `vite.config.ts` is imported, before Vite's root is known, so they look the config up from `process.cwd()` and upward; the support warnings look it up from Vite's `root` (2026-10-09, cssints-p3d2). They are the same when Vite runs from the app's directory; with `vite <dir>` from elsewhere, give `targets` and `cssTarget` the app's config yourself. Vite's CSS minify reads `cssTarget`, not `targets`: without it the minifier merges the declarations of a `firstThatWorks` into the last one. Add `"types": ["vite/client"]` to `tsconfig.json` for the `virtual:` import.
46
51
 
47
52
  ### Frameworks
48
53
 
49
- Any framework that builds JSX through a Vite plugin works; the engine evaluates your modules itself, so it does not care what the plugin makes of JSX, nor in which order the plugins are listed. `apps/sky` is the Solid 2 app (`solid-js` and `@solidjs/web` 2.0.0-rc.13, `@solidjs/vite-plugin` 3.0.0-next.47):
54
+ Any framework that builds JSX through a Vite plugin works; the engine evaluates your modules itself, so it does not care what the plugin makes of JSX, nor in which order the plugins are listed. `apps/csssky` is the Solid 2 app (`solid-js` and `@solidjs/web` 2.0.0-rc.13, `@solidjs/vite-plugin` 3.0.0-next.47):
50
55
 
51
56
  ```ts skip
52
57
  // vite.config.ts
@@ -54,50 +59,89 @@ import solid from "@solidjs/vite-plugin";
54
59
  import cssints, { cssTarget, targets } from "cssints/vite";
55
60
 
56
61
  export default {
57
- plugins: [cssints(), solid()],
58
- css: { transformer: "lightningcss", lightningcss: { targets } },
59
- build: { cssMinify: "lightningcss", cssTarget },
62
+ plugins: [cssints(), solid()],
63
+ css: { transformer: "lightningcss", lightningcss: { targets } },
64
+ build: { cssMinify: "lightningcss", cssTarget },
60
65
  };
61
66
  ```
62
67
 
63
68
  `tsconfig.json` is Solid's: `"jsx": "preserve"`, `"jsxImportSource": "@solidjs/web"`, `"types": ["vite/client"]`. Solid's `class` takes a string, an object or an array, so `cn` is not needed for the join: `class={[card, on() && p(4)]}` and `class={badge({ tone: tone() })}` work as in React. A site's arguments are still build-time values, so a signal goes in the condition or in a `cv` variant, not in `p(n())`. Under `vite dev` an edit of a component replaces it and resets its state below it (Solid's refresh); an edit of a style changes the class strings and the sheet with no reload.
64
69
 
65
70
  ```tsx
66
- import { bg, color, cn, cv, flex, hover, media, p, style, token } from "cssints" with { type: "cssints" };
71
+ import { reset } from "@cssints/reset" with { type: "cssints" };
72
+ import {
73
+ bg,
74
+ color,
75
+ cn,
76
+ cv,
77
+ flex,
78
+ hover,
79
+ media,
80
+ p,
81
+ style,
82
+ token,
83
+ } from "cssints" with { type: "cssints" };
84
+
85
+ reset();
67
86
 
68
87
  const md = media("(width >= 40rem)");
69
88
  const accent = token.color("#2563eb", "accent");
70
89
 
71
90
  const button = cv({
72
- base: cn(p(2), color("white"), bg(accent), hover(bg("#1d4ed8"))),
73
- variants: { wide: { true: md(p(4)) } },
91
+ base: cn(p(2), color("white"), bg(accent), hover(bg("#1d4ed8"))),
92
+ variants: { wide: { true: md(p(4)) } },
74
93
  });
75
94
 
76
95
  export const Row = ({ wide, on }: { wide?: boolean; on?: boolean }) => (
77
- <div className={cn(flex().alignItems("center").gap(2), on && p(1))} style={style(token.set(accent, "#dc2626"))}>
78
- <button className={button({ wide })}>Save</button>
79
- </div>
96
+ <div
97
+ className={cn(flex().alignItems("center").gap(2), on && p(1))}
98
+ style={style(token.set(accent, "#dc2626"))}
99
+ >
100
+ <button className={button({ wide })}>Save</button>
101
+ </div>
80
102
  );
81
103
  ```
82
104
 
83
- `with { type: "cssints" }` marks what runs at build time. The plugin replaces each call with a class string, so the browser gets `__cx([], "_1s47490 _1ob5z5m _g2iyum", on && "_lqk467")` and `button` is a call of the runtime with `{ base: "_1t8gqy5 ...", ... }`, so it never sees `flex()`. `virtual:cssints.css` is one sheet with every rule once, sorted by layer, then condition, then shorthand before longhand, then class name:
105
+ `with { type: "cssints" }` marks what runs at build time. The plugin replaces each call with a class string, so the browser gets `__cx([], "_1s47490 _1ob5z5m _g2iyum", on && "_lqk467")` and `button` is a call of the runtime with `{ base: "_1t8gqy5 ...", ... }`, so it never sees `flex()`. `virtual:cssints.css` is one sheet with every rule once, sorted by layer, then condition, then shorthand before longhand, then class name (the `@layer reset { ... }` block of `reset()` comes first and is left out here):
84
106
 
85
107
  ```css
86
108
  @layer _.k, _.a, _.b, _.c, _.d, _.e;
87
- @property --accent{syntax:"<color>";inherits:true;initial-value:#2563eb}
109
+ @property --accent {
110
+ syntax: "<color>";
111
+ inherits: true;
112
+ initial-value: #2563eb;
113
+ }
88
114
  @layer _.a {
89
- ._1t8gqy5{padding:0.5rem}
90
- ._lqk467{padding:0.25rem}
91
- ._g2iyum{gap:0.5rem}
92
- ._17xzvrh{background-color:var(--accent)}
93
- ._1binn6n{color:white}
94
- ._1ob5z5m{align-items:center}
95
- ._1s47490{display:flex}
115
+ ._1t8gqy5 {
116
+ padding: 0.5rem;
117
+ }
118
+ ._lqk467 {
119
+ padding: 0.25rem;
120
+ }
121
+ ._g2iyum {
122
+ gap: 0.5rem;
123
+ }
124
+ ._17xzvrh {
125
+ background-color: var(--accent);
126
+ }
127
+ ._1binn6n {
128
+ color: white;
129
+ }
130
+ ._1ob5z5m {
131
+ align-items: center;
132
+ }
133
+ ._1s47490 {
134
+ display: flex;
135
+ }
96
136
  }
97
137
  @layer _.b {
98
- ._1tsjws2:hover{background-color:#1d4ed8}
138
+ ._1tsjws2:hover {
139
+ background-color: #1d4ed8;
140
+ }
99
141
  @media (width >= 40rem) {
100
- ._tdcza3{padding:1rem}
142
+ ._tdcza3 {
143
+ padding: 1rem;
144
+ }
101
145
  }
102
146
  }
103
147
  ```
@@ -131,15 +175,15 @@ and Cursor. The skills use it when it is configured and work without it.
131
175
 
132
176
  ## Layout
133
177
 
134
- | Path | What |
135
- |---|---|
136
- | `packages/cssints` | Vite plugin (`cssints/vite`) on the Vite Module Runner, and the `cssints` library |
137
- | `packages/css-grammar` | Type-level recognizer and its runtime twin over mdn-data grammars, Typed OM values, browser support and prose rules |
138
- | `packages/icons` | `@cssints/icons`: icons from iconify JSON collections or SVG folders, a mask style with no runtime |
139
- | `packages/mise-en-mode` | `@cssints/mise-en-mode`: looks as themes in the layers app < author < viewer, on `data-mode` scopes, checked against the tokens and by `check.contrast` |
140
- | `apps/demo` | React demo of every 0.1 feature |
141
- | `apps/docs` | The documentation site: this file and `docs/API.md` as pages, with search and type hovers (`cd apps/docs && bun run dev`) |
142
- | `docs/research`, `docs/archive` | Comparisons with other libraries; outdated plans |
178
+ | Path | What |
179
+ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
180
+ | `packages/cssints` | Vite plugin (`cssints/vite`) on the Vite Module Runner, and the `cssints` library |
181
+ | `packages/css-grammar` | Type-level recognizer and its runtime twin over mdn-data grammars, Typed OM values, browser support and prose rules |
182
+ | `packages/icons` | `@cssints/icons`: icons from iconify JSON collections or SVG folders, a mask style with no runtime |
183
+ | `packages/mise-en-mode` | `@cssints/mise-en-mode`: looks as themes in the layers app < author < viewer, on `data-mode` scopes, checked against the tokens and by `check.contrast` |
184
+ | `apps/demo` | React demo of every 0.1 feature |
185
+ | `apps/docs` | The documentation site: this file and `docs/API.md` as pages, with search and type hovers (`cd apps/docs && bun run dev`) |
186
+ | `docs/research`, `docs/archive` | Comparisons with other libraries; outdated plans |
143
187
 
144
188
  ## Development
145
189
 
@@ -161,16 +205,16 @@ cssints is MIT. It stands on other people's work; this is what we took, from who
161
205
 
162
206
  ### Data and code that ships
163
207
 
164
- | Where | What | From | License |
165
- |---|---|---|---|
166
- | [@cssints/tokens](packages/tokens/README.md) | the Open Props, Radix Colors, Flexoki and Reasonable Colors sets | [Open Props](https://github.com/argyleink/open-props) (Adam Argyle), [Radix Colors](https://github.com/radix-ui/colors), [Flexoki](https://github.com/kepano/flexoki) (Steph Ango), [Reasonable Colors](https://github.com/matthewhowell/reasonable-colors) (Matthew Howell) | MIT, notices in its README |
167
- | [@cssints/css-grammar](packages/css-grammar/THIRD_PARTY_NOTICES.md) | the CSS syntax strings (`src/mdn.ts`, `keywords.ts`, `functions.ts`), also in the types of `cssints` | [mdn-data](https://github.com/mdn/data); the numeric ranges it omits from [@webref/css](https://github.com/w3c/webref) | CC0-1.0; MIT (W3C) |
168
- | @cssints/css-grammar | browser support warnings, read from the package (not copied) | [@mdn/browser-compat-data](https://github.com/mdn/browser-compat-data) | CC0-1.0 |
169
- | [@cssints/fonts](packages/fonts/README.md) | the latin character weights and the metrics of Arial, Times New Roman and Courier New | [Capsize](https://github.com/seek-oss/capsize) (SEEK) | MIT, notice in its README |
170
- | [@cssints/icons](packages/icons/README.md) | nothing: the collections are your dependency | [Iconify](https://iconify.design) `@iconify-json/*` | each collection's own |
171
- | `tools/ai-automation/vendor` | lint rules, not published | [dmmulroy/anti-slop](https://github.com/dmmulroy/anti-slop) (Dillon Mulroy) | MIT, `LICENSE` and `UPSTREAM.md` |
172
- | [apps/sky](apps/sky/NOTICE.md) | layout and token values; Inter; Phosphor icons | Mu and `@bsky.app/alf` (Bluesky Social PBC), [Inter](https://github.com/rsms/inter), [Phosphor](https://phosphoricons.com) | MIT; OFL-1.1; MIT |
173
- | apps/demo | Material Design Icons (`@iconify-json/mdi`) | Pictogrammers | Apache-2.0 |
208
+ | Where | What | From | License |
209
+ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
210
+ | [@cssints/tokens](packages/tokens/README.md) | the Open Props, Radix Colors, Flexoki and Reasonable Colors sets | [Open Props](https://github.com/argyleink/open-props) (Adam Argyle), [Radix Colors](https://github.com/radix-ui/colors), [Flexoki](https://github.com/kepano/flexoki) (Steph Ango), [Reasonable Colors](https://github.com/matthewhowell/reasonable-colors) (Matthew Howell) | MIT, notices in its README |
211
+ | [@cssints/css-grammar](packages/css-grammar/THIRD_PARTY_NOTICES.md) | the CSS syntax strings (`src/mdn.ts`, `keywords.ts`, `functions.ts`), also in the types of `cssints` | [mdn-data](https://github.com/mdn/data); the numeric ranges it omits from [@webref/css](https://github.com/w3c/webref) | CC0-1.0; MIT (W3C) |
212
+ | @cssints/css-grammar | browser support warnings, read from the package (not copied) | [@mdn/browser-compat-data](https://github.com/mdn/browser-compat-data) | CC0-1.0 |
213
+ | [@cssints/fonts](packages/fonts/README.md) | the latin character weights and the metrics of Arial, Times New Roman and Courier New | [Capsize](https://github.com/seek-oss/capsize) (SEEK) | MIT, notice in its README |
214
+ | [@cssints/icons](packages/icons/README.md) | nothing: the collections are your dependency | [Iconify](https://iconify.design) `@iconify-json/*` | each collection's own |
215
+ | `tools/ai-automation/vendor` | lint rules, not published | [dmmulroy/anti-slop](https://github.com/dmmulroy/anti-slop) (Dillon Mulroy) | MIT, `LICENSE` and `UPSTREAM.md` |
216
+ | [apps/csssky](apps/csssky/NOTICE.md) | layout and token values; Inter; Phosphor icons | Mu and `@bsky.app/alf` (Bluesky Social PBC), [Inter](https://github.com/rsms/inter), [Phosphor](https://phosphoricons.com) | MIT; OFL-1.1; MIT |
217
+ | apps/demo | Material Design Icons (`@iconify-json/mdi`) | Pictogrammers | Apache-2.0 |
174
218
 
175
219
  ### Ideas and designs
176
220
 
@@ -178,7 +222,7 @@ No code is copied from these; each package README says which part follows which.
178
222
 
179
223
  - **Plugin packages.** [Every Layout](https://every-layout.dev) and [smolcss](https://smolcss.dev) (layout), [nytimes/text-balancer](https://github.com/nytimes/text-balancer) and [react-wrap-balancer](https://github.com/shuding/react-wrap-balancer) (balance), [fluid-tailwind](https://github.com/barvian/fluid-tailwind) (fluid), [postcss-easing-gradients](https://github.com/larsenwork/postcss-easing-gradients) (gradient), [tailwindcss-motion](https://github.com/romboHQ/tailwindcss-motion) and [tailwindcss-animate](https://github.com/jamiebuilds/tailwindcss-animate) (motion), [the supersonic plugin](https://github.com/the-illarionov/the-supersonic-plugin-for-scroll-based-animation) and [lax.js](https://github.com/alexfoxy/lax.js) (reveal), [sync-skeleton](https://github.com/crutchcorn/sync-skeleton) (skeleton), [bramus/sticky-observer](https://github.com/bramus/sticky-observer) (stuck), [unpic-placeholder](https://github.com/ascorbic/unpic-placeholder) and [ThumbHash](https://github.com/evanw/thumbhash) (placeholder), [nutelch](https://github.com/meodai/nutelch) and [Leonardo](https://github.com/adobe/leonardo) (ramp), the resets of Josh Comeau, Jake Lazaroff, Vale and Andy Bell (reset), [Mise en Mode](https://standard.mode.place) and its Mode Contract (mise-en-mode), [brendonovich/vite-plugin-opencode](https://github.com/Brendonovich/vite-plugin-opencode) (the prompt box of devtools).
180
224
  - **The engine.** The comparisons in [docs/research](docs/research) record what we took from [StyleX](https://stylexjs.com), [vanilla-extract](https://vanilla-extract.style), [Tailwind CSS](https://tailwindcss.com), [Tokenami](https://tokenami.com), [SugarCube](https://sugarcube.sh) and the [React Spectrum](https://react-spectrum.adobe.com) style macros; the first spark was [Haz's post](https://bsky.app/profile/haz.dev/post/3mebm2mx6jk27) on a CSS framework in TypeScript. Tokens follow the [Design Tokens Community Group](https://www.designtokens.org) format.
181
- - **apps/sky** follows the look of Mu and the hue slider of Witchsky.
225
+ - **apps/csssky** follows the look of Mu and the hue slider of Witchsky.
182
226
 
183
227
  ### Built on
184
228
 
package/dist/check.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { s as ContrastError } from "./registry-CTumHB8p.mjs";
2
- import { t as fallbackOf } from "./lowered-D2KusPLp.mjs";
1
+ import { s as ContrastError } from "./registry-BUSEO32-.mjs";
2
+ import { t as fallbackOf } from "./lowered-aJVapQT6.mjs";
3
3
  import { i as shown, r as ratio, t as luminance } from "./color-BYIxVLlS.mjs";
4
4
  import { Effect } from "effect";
5
5
  //#region src/check.ts
@@ -1,5 +1,5 @@
1
- import { a as registry, d as MacroError, o as warn } from "./registry-CTumHB8p.mjs";
2
- import { l as layerStatements } from "./sheet-BKsMTa0c.mjs";
1
+ import { a as registry, d as MacroError, o as warn } from "./registry-BUSEO32-.mjs";
2
+ import { l as layerStatements } from "./sheet-BeHdq4xt.mjs";
3
3
  import { Effect } from "effect";
4
4
  //#region src/contrast.ts
5
5
  const VAR = /var\((--[^\s,)]+)\)/g;
@@ -0,0 +1,94 @@
1
+ import { join, relative, sep } from "node:path";
2
+ import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
3
+ //#region src/devtools-link.ts
4
+ /**
5
+ * The repository of an app is the workspace of its sessions: the nearest folder up with a `.git` (a file in a worktree).
6
+ * @param {string} from a folder
7
+ * @returns {string} the repository, or `from` when there is none
8
+ */
9
+ const gitRoot = (from) => from.split(sep).map((_, i, parts) => parts.slice(0, parts.length - i).join(sep) || sep).find((dir) => existsSync(join(dir, ".git"))) ?? from;
10
+ const dir = (git) => join(git, "node_modules/.cache/cssints-devtools");
11
+ /**
12
+ * @param {string} git the repository
13
+ * @param {string} root the Vite root of a dev server
14
+ * @returns {string} its id
15
+ */
16
+ const serverId = (git, root) => relative(git, root).split(sep).join("-") || "root";
17
+ const read = (file) => {
18
+ try {
19
+ return JSON.parse(readFileSync(file, "utf8"));
20
+ } catch {
21
+ return {};
22
+ }
23
+ };
24
+ const alive = (pid) => {
25
+ try {
26
+ process.kill(pid, 0);
27
+ return true;
28
+ } catch (e) {
29
+ return e.code === "EPERM";
30
+ }
31
+ };
32
+ /**
33
+ * A dev server announces itself.
34
+ * @param {string} git the repository
35
+ * @param {string} root the Vite root
36
+ * @param {string} url where it listens
37
+ * @returns {() => void} the call that removes the announcement
38
+ */
39
+ const register = (git, root, url) => {
40
+ const file = join(dir(git), `${serverId(git, root)}.json`);
41
+ mkdirSync(dir(git), { recursive: true });
42
+ writeFileSync(file, JSON.stringify({
43
+ root,
44
+ pid: process.pid,
45
+ url
46
+ }));
47
+ return () => rmSync(file, { force: true });
48
+ };
49
+ /**
50
+ * The dev servers that run now. A file whose process is gone (a crash left it) is removed.
51
+ * ponytail: a reused pid keeps a stale file alive; the dev server rewrites it on its next start.
52
+ * @param {string} git the repository
53
+ * @returns {DevServer[]} the live ones, by id
54
+ */
55
+ const servers = (git) => {
56
+ if (!existsSync(dir(git))) return [];
57
+ return readdirSync(dir(git)).filter((f) => f.endsWith(".json") && !f.endsWith(".session.json")).flatMap((f) => {
58
+ const { root, pid, url } = read(join(dir(git), f));
59
+ if (typeof root !== "string" || typeof pid !== "number" || typeof url !== "string") return [];
60
+ if (alive(pid)) return [{
61
+ id: f.slice(0, -5),
62
+ root,
63
+ pid,
64
+ url
65
+ }];
66
+ rmSync(join(dir(git), f), { force: true });
67
+ return [];
68
+ }).sort((a, b) => a.id.localeCompare(b.id));
69
+ };
70
+ /**
71
+ * @param {string} git the repository
72
+ * @param {string} id a dev server's id
73
+ * @returns {string | undefined} the session its prompts go to, if one is attached
74
+ */
75
+ const sessionOf = (git, id) => {
76
+ const { sessionID } = read(join(dir(git), `${id}.session.json`));
77
+ return typeof sessionID === "string" ? sessionID : void 0;
78
+ };
79
+ /**
80
+ * Attach a session to a dev server, or detach it.
81
+ * @param {string} git the repository
82
+ * @param {string} id a dev server's id
83
+ * @param {string} [sessionID] the session; none detaches
84
+ * @returns {void}
85
+ */
86
+ const attach = (git, id, sessionID) => {
87
+ const file = join(dir(git), `${id}.session.json`);
88
+ if (sessionID) {
89
+ mkdirSync(dir(git), { recursive: true });
90
+ writeFileSync(file, JSON.stringify({ sessionID }));
91
+ } else rmSync(file, { force: true });
92
+ };
93
+ //#endregion
94
+ export { servers as a, serverId as i, gitRoot as n, sessionOf as o, register as r, attach as t };
@@ -0,0 +1,55 @@
1
+ //#region src/devtools-link.d.ts
2
+ /** A running dev server, as it announced itself. */
3
+ export interface DevServer {
4
+ id: string;
5
+ root: string;
6
+ pid: number;
7
+ url: string;
8
+ }
9
+ /**
10
+ * The repository of an app is the workspace of its sessions: the nearest folder up with a `.git` (a file in a worktree).
11
+ * @param {string} from a folder
12
+ * @returns {string} the repository, or `from` when there is none
13
+ */
14
+ export declare const gitRoot: (from: string) => string;
15
+ /**
16
+ * @param {string} git the repository
17
+ * @param {string} root the Vite root of a dev server
18
+ * @returns {string} its id
19
+ */
20
+ export declare const serverId: (git: string, root: string) => string;
21
+ /**
22
+ * A dev server announces itself.
23
+ * @param {string} git the repository
24
+ * @param {string} root the Vite root
25
+ * @param {string} url where it listens
26
+ * @returns {() => void} the call that removes the announcement
27
+ */
28
+ export declare const register: (git: string, root: string, url: string) => () => void;
29
+ /**
30
+ * The dev servers that run now. A file whose process is gone (a crash left it) is removed.
31
+ * ponytail: a reused pid keeps a stale file alive; the dev server rewrites it on its next start.
32
+ * @param {string} git the repository
33
+ * @returns {DevServer[]} the live ones, by id
34
+ */
35
+ export declare const servers: (git: string) => {
36
+ id: string;
37
+ root: string;
38
+ pid: number;
39
+ url: string;
40
+ }[];
41
+ /**
42
+ * @param {string} git the repository
43
+ * @param {string} id a dev server's id
44
+ * @returns {string | undefined} the session its prompts go to, if one is attached
45
+ */
46
+ export declare const sessionOf: (git: string, id: string) => string | undefined;
47
+ /**
48
+ * Attach a session to a dev server, or detach it.
49
+ * @param {string} git the repository
50
+ * @param {string} id a dev server's id
51
+ * @param {string} [sessionID] the session; none detaches
52
+ * @returns {void}
53
+ */
54
+ export declare const attach: (git: string, id: string, sessionID?: string) => void;
55
+ //#endregion
@@ -0,0 +1,2 @@
1
+ import { a as servers, i as serverId, n as gitRoot, o as sessionOf, r as register, t as attach } from "./devtools-link-D2YxsJKZ.mjs";
2
+ export { attach, gitRoot, register, serverId, servers, sessionOf };
@@ -0,0 +1,81 @@
1
+ import { A as Wrap, C as Keyframes, D as QueryWrap, F as cv, H as style, I as firstThatWorks, J as FlexMethods, K as within, L as global, M as cn, O as StateWrap, R as group, S as CvValue, T as PositionTry, W as token, _ as CSSStyleValue, a as DtcgUnit, am as Fallback, b as CvConfig, c as Tokens, d as createTokens, f as layers, g as CSSImageValue, h as CSSColorValue, i as DtcgShadow, j as attr, k as Steps, l as check, m as CSS, n as DtcgColor, o as DtcgValue, om as Part, p as AttrOp, q as ClassValue, r as DtcgCubicBezier, s as Overrides, sm as Style, t as CheckOverrides, u as createGlobalTheme, v as CSSUnitValue, x as CvProps, z as keyframes } from "../../theme-types-Bqv0Ggz_.mjs";
2
+ import { a as GProp, r as GLayout, t as GCondition } from "../../group-types-9ttphdku.mjs";
3
+ import "../../group-common-9zpBxfUF.mjs";
4
+ import { active, alignContent, alignItems, alignSelf, animation, animationDelay, animationDirection, animationDuration, animationFillMode, animationIterationCount, animationName, animationPlayState, animationTimingFunction, attrFn, backgroundAttachment, backgroundClip, backgroundColor, backgroundImage, backgroundOrigin, backgroundPosition, backgroundRepeat, backgroundSize, bg, border, borderBottom, borderBottomColor, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStyle, borderBottomWidth, borderCollapse, borderColor, borderImage, borderImageOutset, borderImageSlice, borderImageSource, borderImageWidth, borderLeft, borderLeftColor, borderLeftStyle, borderLeftWidth, borderRadius, borderRight, borderRightColor, borderRightStyle, borderRightWidth, borderSpacing, borderStyle, borderTop, borderTopColor, borderTopLeftRadius, borderTopRightRadius, borderTopStyle, borderTopWidth, borderWidth, bottom, boxShadow, boxSizing, calc, captionSide, checked, clear, color, colorFn, columnGap, content, counter, counterIncrement, counterReset, counters, cubicBezier, direction, disabled, display, empty, emptyCells, enabled, firstChild, firstOfType, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, float, floodColor, floodOpacity, focus, font, fontFamily, fontSize, fontStyle, fontWeight, height, hover, hsl, hsla, image, inRange, indeterminate, invalid, justifyContent, lastChild, lastOfType, left, letterSpacing, lightingColor, lineHeight, linearGradient, link, listStyle, listStyleImage, listStylePosition, listStyleType, m, margin, marginBottom, marginLeft, marginRight, marginTop, matrix, matrix3d, maxHeight, maxWidth, mb, minHeight, minWidth, ml, mr, mt, onlyChild, onlyOfType, opacity, optional, order, outOfRange, outlineColor, outlineStyle, outlineWidth, overflow, overflowX, overflowY, p, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, pb, perspective, perspectiveFn, perspectiveOrigin, pl, pointerEvents, position, pr, pt, quotes, radialGradient, repeatingLinearGradient, repeatingRadialGradient, required, rgb, rgba, right, root, rotate3d, rotateFn, rotateX, rotateY, rotateZ, scale3d, scaleFn, scaleX, scaleY, scaleZ, skew, skewX, skewY, steps, supports, tableLayout, target, textAlign, textIndent, textOverflow, textShadow, textTransform, top, transform, transformOrigin, transformStyle, transition, transitionDelay, transitionDuration, transitionProperty, transitionTimingFunction, translate3d, translateFn, translateX, translateY, translateZ, unicodeBidi, url, valid, verticalAlign, visibility, visited, width, wordBreak, wordSpacing, zIndex } from "../baseline-2015.mjs";
5
+ import { properties } from "@cssints/css-grammar/mdn";
6
+ //#region src/groups/baseline-2015/with-downstream.d.ts
7
+ type B = {
8
+ id: "baseline-2015/with-downstream";
9
+ kw: {
10
+ "align-items": "anchor-center";
11
+ "align-self": "anchor-center" | "auto" | "normal" | "stretch";
12
+ "animation-duration": "auto";
13
+ "background": "border-area" | "text" | "x-end" | "x-start" | "y-end" | "y-start";
14
+ "background-attachment": "fixed" | "local";
15
+ "background-clip": "border-area" | "text";
16
+ "background-image": "element(" | "image-set(";
17
+ "background-position": "bottom" | "center" | "left" | "right" | "top";
18
+ "background-repeat": "round" | "space";
19
+ "border-collapse": "collapse" | "separate";
20
+ "bottom": "anchor(" | "anchor-size(";
21
+ "caption-side": "bottom" | "top";
22
+ "clear": "inline-end" | "inline-start";
23
+ "content": "image-set(";
24
+ "counter-reset": "reversed(";
25
+ "display": "contents" | "flow-root" | "grid" | "grid-lanes" | "inline-grid" | "inline-grid-lanes" | "math" | "ruby" | "ruby-base" | "ruby-base-container" | "ruby-text" | "ruby-text-container";
26
+ "flex": "anchor-size(" | "content" | "fit-content" | "fit-content(" | "max-content" | "min-content";
27
+ "flex-basis": "anchor-size(" | "content" | "fit-content" | "fit-content(" | "max-content" | "min-content";
28
+ "flex-direction": "column-reverse" | "row-reverse";
29
+ "flex-flow": "balance";
30
+ "flex-wrap": "balance";
31
+ "float": "inline-end" | "inline-start";
32
+ "font": "math" | "system-ui" | "ui-monospace" | "ui-rounded" | "ui-sans-serif" | "ui-serif" | "xxx-large";
33
+ "font-family": "math" | "system-ui" | "ui-monospace" | "ui-rounded" | "ui-sans-serif" | "ui-serif";
34
+ "font-size": "math" | "xxx-large";
35
+ "font-variant": "all-petite-caps" | "all-small-caps" | "diagonal-fractions" | "full-width" | "historical-forms" | "jis04" | "jis78" | "jis83" | "jis90" | "lining-nums" | "none" | "oldstyle-nums" | "ordinal" | "petite-caps" | "proportional-nums" | "proportional-width" | "ruby" | "simplified" | "slashed-zero" | "small-caps" | "stacked-fractions" | "tabular-nums" | "titling-caps" | "traditional" | "unicase";
36
+ "height": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
37
+ "justify-content": "left" | "normal" | "right";
38
+ "left": "anchor(" | "anchor-size(";
39
+ "list-style": "string" | "symbols(";
40
+ "list-style-type": "symbols(";
41
+ "margin": "anchor-size(";
42
+ "margin-bottom": "anchor-size(";
43
+ "margin-left": "anchor-size(";
44
+ "margin-right": "anchor-size(";
45
+ "margin-top": "anchor-size(";
46
+ "max-height": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
47
+ "max-width": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
48
+ "min-height": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
49
+ "min-width": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
50
+ "overflow": "clip";
51
+ "overflow-x": "clip";
52
+ "overflow-y": "clip";
53
+ "position": "sticky";
54
+ "quotes": "auto";
55
+ "right": "anchor(" | "anchor-size(";
56
+ "text-align": "center" | "end" | "left" | "match-parent" | "right" | "start";
57
+ "text-decoration": "auto" | "currentColor" | "dashed" | "dotted" | "double" | "from-font" | "grammar-error" | "percentage" | "solid" | "spelling-error" | "transparent" | "wavy";
58
+ "text-indent": "each-line" | "hanging";
59
+ "text-transform": "full-size-kana" | "full-width" | "math-auto";
60
+ "top": "anchor(" | "anchor-size(";
61
+ "unicode-bidi": "isolate" | "isolate-override" | "plaintext";
62
+ "white-space": "break-spaces" | "collapse" | "preserve" | "preserve-breaks" | "preserve-spaces" | "wrap";
63
+ "width": "anchor-size(" | "fit-content" | "fit-content(" | "max-content" | "min-content";
64
+ "word-break": "auto-phrase" | "break-word";
65
+ };
66
+ fn: "abs" | "acos" | "anchor" | "anchor-size" | "asin" | "atan" | "atan2" | "blur" | "brightness" | "calc-size" | "circle" | "clamp" | "color-mix" | "conic-gradient" | "contrast" | "contrast-color" | "cos" | "cross-fade" | "drop-shadow" | "dynamic-range-limit-mix" | "element" | "ellipse" | "env" | "exp" | "fit-content" | "grayscale" | "hue-rotate" | "hwb" | "hypot" | "image-set" | "inset" | "invert" | "lab" | "layer" | "lch" | "leader" | "light-dark" | "linear" | "log" | "max" | "min" | "minmax" | "mod" | "oklab" | "oklch" | "opacity" | "paint" | "palette-mix" | "path" | "polygon" | "pow" | "ray" | "rect" | "rem" | "repeating-conic-gradient" | "round" | "saturate" | "scroll" | "sepia" | "sign" | "sin" | "sqrt" | "src" | "superellipse" | "symbols" | "tan" | "target-counter" | "target-counters" | "target-text" | "var" | "view" | "xywh";
67
+ unit: "Q" | "cap" | "cqb" | "cqh" | "cqi" | "cqmax" | "cqmin" | "cqw" | "dpcm" | "dpi" | "dppx" | "dvb" | "dvh" | "dvi" | "dvmax" | "dvmin" | "dvw" | "fr" | "ic" | "lh" | "lvb" | "lvh" | "lvi" | "lvmax" | "lvmin" | "lvw" | "q" | "rcap" | "rch" | "rex" | "ric" | "rlh" | "svb" | "svh" | "svi" | "svmax" | "svmin" | "svw" | "vb" | "vi" | "vmax" | "x";
68
+ media: "any-hover" | "any-pointer" | "calc" | "color-gamut" | "color-index" | "device-aspect-ratio" | "device-height" | "device-posture" | "device-width" | "display-mode" | "dynamic-range" | "forced-colors" | "horizontal-viewport-segments" | "hover" | "inverted-colors" | "monochrome" | "overflow-block" | "overflow-inline" | "pointer" | "prefers-color-scheme" | "prefers-contrast" | "prefers-reduced-data" | "prefers-reduced-motion" | "prefers-reduced-transparency" | "resolution" | "scan" | "scripting" | "update" | "vertical-viewport-segments" | "video-dynamic-range";
69
+ container: "anchored(" | "scroll-state(" | "style(";
70
+ supports: "font-format(" | "font-tech(" | "selector(";
71
+ };
72
+ type P<K extends keyof typeof properties> = GProp<B, K>;
73
+ export declare const background: P<"background">;
74
+ export declare const flexFlow: P<"flex-flow">;
75
+ export declare const fontVariant: P<"font-variant">;
76
+ export declare const textDecoration: P<"text-decoration">;
77
+ export declare const whiteSpace: P<"white-space">;
78
+ export declare const media: GCondition<B, "media", QueryWrap>;
79
+ export declare const flex: GLayout<B, "flex", Pick<FlexMethods, "direction" | "wrap" | "flow" | "alignItems" | "alignContent" | "justifyContent" | "columnGap">>;
80
+ //#endregion
81
+ export { type AttrOp, type CSS, type CSSColorValue, type CSSImageValue, type CSSStyleValue, type CSSUnitValue, CheckOverrides, type ClassValue, type CvConfig, type CvProps, type CvValue, DtcgColor, DtcgCubicBezier, DtcgShadow, DtcgUnit, DtcgValue, type Fallback, type Keyframes, Overrides, type Part, type PositionTry, type QueryWrap, type StateWrap, type Steps, type Style, Tokens, type Wrap, active, alignContent, alignItems, alignSelf, animation, animationDelay, animationDirection, animationDuration, animationFillMode, animationIterationCount, animationName, animationPlayState, animationTimingFunction, attr, attrFn, backgroundAttachment, backgroundClip, backgroundColor, backgroundImage, backgroundOrigin, backgroundPosition, backgroundRepeat, backgroundSize, bg, border, borderBottom, borderBottomColor, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStyle, borderBottomWidth, borderCollapse, borderColor, borderImage, borderImageOutset, borderImageSlice, borderImageSource, borderImageWidth, borderLeft, borderLeftColor, borderLeftStyle, borderLeftWidth, borderRadius, borderRight, borderRightColor, borderRightStyle, borderRightWidth, borderSpacing, borderStyle, borderTop, borderTopColor, borderTopLeftRadius, borderTopRightRadius, borderTopStyle, borderTopWidth, borderWidth, bottom, boxShadow, boxSizing, calc, captionSide, check, checked, clear, cn, color, colorFn, columnGap, content, counter, counterIncrement, counterReset, counters, createGlobalTheme, createTokens, cubicBezier, cv, direction, disabled, display, empty, emptyCells, enabled, firstChild, firstOfType, firstThatWorks, flexBasis, flexDirection, flexGrow, flexShrink, flexWrap, float, floodColor, floodOpacity, focus, font, fontFamily, fontSize, fontStyle, fontWeight, global, group, height, hover, hsl, hsla, image, inRange, indeterminate, invalid, justifyContent, keyframes, lastChild, lastOfType, layers, left, letterSpacing, lightingColor, lineHeight, linearGradient, link, listStyle, listStyleImage, listStylePosition, listStyleType, m, margin, marginBottom, marginLeft, marginRight, marginTop, matrix, matrix3d, maxHeight, maxWidth, mb, minHeight, minWidth, ml, mr, mt, onlyChild, onlyOfType, opacity, optional, order, outOfRange, outlineColor, outlineStyle, outlineWidth, overflow, overflowX, overflowY, p, padding, paddingBottom, paddingLeft, paddingRight, paddingTop, pb, perspective, perspectiveFn, perspectiveOrigin, pl, pointerEvents, position, pr, pt, quotes, radialGradient, repeatingLinearGradient, repeatingRadialGradient, required, rgb, rgba, right, root, rotate3d, rotateFn, rotateX, rotateY, rotateZ, scale3d, scaleFn, scaleX, scaleY, scaleZ, skew, skewX, skewY, steps, style, supports, tableLayout, target, textAlign, textIndent, textOverflow, textShadow, textTransform, token, top, transform, transformOrigin, transformStyle, transition, transitionDelay, transitionDuration, transitionProperty, transitionTimingFunction, translate3d, translateFn, translateX, translateY, translateZ, unicodeBidi, url, valid, verticalAlign, visibility, visited, width, within, wordBreak, wordSpacing, zIndex };