cssints 0.3.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.
- package/dist/vite.mjs +6 -5
- package/docs/API.md +5 -1
- package/package.json +2 -2
package/dist/vite.mjs
CHANGED
|
@@ -32,6 +32,7 @@ var DomEvaluator = class extends ESModulesEvaluator {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const evalLock = Semaphore.makeUnsafe(1);
|
|
35
|
+
const LIMIT = Effect.runSync(Config.Int("CSSINTS_EVAL_TIMEOUT").pipe(Config.withDefault(3e4)));
|
|
35
36
|
const LIB = fileURLToPath(new URL("./index.ts", import.meta.url));
|
|
36
37
|
const clearApp = ({ idToModuleMap, urlToIdModuleMap, fileToModulesMap }) => {
|
|
37
38
|
const lib = /* @__PURE__ */ new Set();
|
|
@@ -91,11 +92,11 @@ const evaluateModule = Effect.fnUntraced(function* (runner, id, targets) {
|
|
|
91
92
|
try: () => runner.import(id).then((m) => m.__cssints_hoisted?.()),
|
|
92
93
|
catch: failureOf(id, registry)
|
|
93
94
|
}).pipe(Effect.withSpan("cssints.runner.import", { attributes: { file: id } }), Effect.timeoutOrElse({
|
|
94
|
-
duration:
|
|
95
|
-
orElse: () => Effect.fail(new EvalError({
|
|
95
|
+
duration: LIMIT,
|
|
96
|
+
orElse: () => Effect.promise(() => runner.close()).pipe(Effect.andThen(Effect.fail(new EvalError({
|
|
96
97
|
file: id,
|
|
97
|
-
message: `cssints: evaluating ${id} took more than
|
|
98
|
-
}))
|
|
98
|
+
message: `cssints: evaluating ${id} took more than ${LIMIT / 1e3} seconds`
|
|
99
|
+
}))))
|
|
99
100
|
}));
|
|
100
101
|
yield* verifyChecks((c) => c.gen === registry.gen);
|
|
101
102
|
return registry.sites.get(id) ?? /* @__PURE__ */ new Map();
|
|
@@ -813,7 +814,7 @@ function cssints({ inner = false, exclude, devtools = false, opencode = false }
|
|
|
813
814
|
const parsed = yield* instrument(code, id, true, !!devtools && !build);
|
|
814
815
|
if (!parsed) return void 0;
|
|
815
816
|
const env = server.environments.ssr;
|
|
816
|
-
runner
|
|
817
|
+
if (!runner || runner.isClosed()) runner = createServerModuleRunner(env, {
|
|
817
818
|
hmr: false,
|
|
818
819
|
sourcemapInterceptor: "prepareStackTrace",
|
|
819
820
|
evaluator: new DomEvaluator()
|
package/docs/API.md
CHANGED
|
@@ -1248,6 +1248,10 @@ The process must end the exporter or Node stays alive: `vite build` and `server.
|
|
|
1248
1248
|
|
|
1249
1249
|
`packages/cssints/test/trace.mjs` (in `bun run test`) checks the spans, the file attribute and the error's trace id against an in-process collector. `node packages/cssints/test/trace-live.mjs` builds apps/csssky and runs its HMR test traced, then reads both traces back through Jaeger's API (`GET /api/traces?service=cssints`) and prints span counts and the slowest hooks; it skips when no backend answers. Effect's DevTools (the VS Code extension, `effect/devtools`) is not wired: it needs the editor's extension listening, so neither a script nor an agent can read it.
|
|
1250
1250
|
|
|
1251
|
+
### Debugging: the limit of an evaluation (`CSSINTS_EVAL_TIMEOUT`, cssints-joex)
|
|
1252
|
+
|
|
1253
|
+
A module is evaluated with all it imports in at most 30 seconds, else the build fails with `cssints: evaluating <file> took more than 30 seconds`. The engine cannot stop the code, so it closes the Module Runner: the evaluation ends at the next module it would load, and the next evaluation starts on a new runner. `CSSINTS_EVAL_TIMEOUT=<milliseconds>` changes the limit (read once, when the plugin loads); it is for tests that run on a busy machine, and the default is the one for your code.
|
|
1254
|
+
|
|
1251
1255
|
### Checks for tools: `cssints/check` (2026-10-09, cssints-p3d2)
|
|
1252
1256
|
|
|
1253
1257
|
The engine's own checks, as functions, for a tool that answers as a build would (`@cssints/mcp`). Node only (culori, LightningCSS): nothing here reaches a browser, and user code has no reason to import it. Each returns an Effect.
|
|
@@ -1399,7 +1403,7 @@ color("color-mix(in oklab, red, blue)"); // error: color: "color-mix()" is not i
|
|
|
1399
1403
|
```
|
|
1400
1404
|
|
|
1401
1405
|
- **Baseline groups** (web-features 3.42, the status of each BCD key): `widely-available` is Baseline high, `newly-available` is high and low, `limited-availability` is everything (it is `cssints` itself, under its Baseline name) and `not-discouraged` is everything web-features does not mark `discouraged` (`clip`, the `page-break-*` aliases, `ime-mode`, `word-break: break-word`, `text-decoration-line: blink`, device media features). A feature web-features does not know is limited availability.
|
|
1402
|
-
- **Downstream groups** (cssints-n12x, 2026-10-11): `widely-available/with-downstream` and `newly-available/with-downstream` are the Baseline group also checked against Opera, Opera Mobile, Samsung Internet, Android WebView, UC and QQ, as `browserslist-config-baseline/with-downstream` is. A feature is in one when the Baseline group has it and every one of those browsers has it, by BCD, at the minimum version that [baseline-browser-mapping](https://
|
|
1406
|
+
- **Downstream groups** (cssints-n12x, 2026-10-11): `widely-available/with-downstream` and `newly-available/with-downstream` are the Baseline group also checked against Opera, Opera Mobile, Samsung Internet, Android WebView, UC and QQ, as `browserslist-config-baseline/with-downstream` is. A feature is in one when the Baseline group has it and every one of those browsers has it, by BCD, at the minimum version that [baseline-browser-mapping](https://npmx.dev/package/baseline-browser-mapping) 2.11.28 gives for the target (the rule of the support warnings: no prefix, no flag; UC and QQ are Blink, checked as Chrome at the Blink version of that build). `widely-available/with-downstream` has 520 of the 521 members (not `maskImage`: Opera has `-webkit-mask-image` only) and refuses `inline-size: fit-content` (Samsung Internet), `shape-outside: xywh()` and `prefers-contrast`; `newly-available/with-downstream` has 533 of 567 (UC and QQ are on Blink 123 and 121).
|
|
1403
1407
|
- **Baseline years:** `baseline-2015` to `baseline-2026` (the first year web-features has to the current one) and `baseline-YYYY/with-downstream`, as `browserslist-config-baseline/YYYY` has them. `baseline-YYYY` is **cumulative**: what was Baseline (newly available, `baseline_low_date`) by the end of YYYY, so `baseline-2022` refuses `color-mix()` (2023) and `baseline-2023` refuses `light-dark()` (2024). 220 members in `baseline-2015`, 387 in `baseline-2020`, 537 in `baseline-2024`. `baseline-2026` is `newly-available` today.
|
|
1404
1408
|
- **Spec groups** are named by the W3C shortname that @webref/css uses: `cssints/css-grid-2`, `cssints/css-color-4`, `cssints/mediaqueries-4`, `cssints/selectors-4`, … (92 of them). A group holds what the spec defines, and **a level includes the levels of its series before it**: `css-color-5` has what Color 3, 4 and 5 define, `css-color-4` has Color 3 and 4. A level is a delta (Color 5 over Color 4) or a rewrite (Media Queries 4 over 3), and "I write for Color 5" means both. What only a later level defines is refused: `css-color-4` has no `colorMix` and refuses `color-mix()`, `mediaqueries-4` refuses `prefers-color-scheme`. A group has the properties, functions, pseudo-class wrappers and conditions its spec defines, so `display` is in `css-display-4` and `gridTemplateColumns` in `css-grid-2`: import from several groups in one file.
|
|
1405
1409
|
- **What is a member:** the properties (and their short names), the functions, the pseudo-class wrappers, `media`, `container`, `supports`, `keyframes` and `positionTry`. Everything else (`cn`, `cv`, `firstThatWorks`, `token`, `createTokens`, `createGlobalTheme`, `check`, `style`, `global`, `layers`, `attr`, `within`, `group`, the Typed OM values) is in every group. A group has no `css` object: write `import * as css from "cssints/widely-available"`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cssints",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "CSS in TypeScript: typed css.* calls compiled to atomic CSS at build time (a Vite plugin)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@cssints/css-grammar": "^0.3.
|
|
67
|
+
"@cssints/css-grammar": "^0.3.1",
|
|
68
68
|
"culori": "^4.0.2",
|
|
69
69
|
"effect": "4.0.0",
|
|
70
70
|
"happy-dom": "^20.14.5",
|