@kirana-style/rolldown 0.2.4 → 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/CHANGELOG.md +54 -0
- package/package.json +4 -3
- package/src/index.d.ts +3 -1
- package/src/index.js +36 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.1](https://github.com/kirana-style/kirana/compare/v0.3.0...v0.3.1) (2026-10-22)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* exclusive states, and ark ui and react aria vocabularies ([#87](https://github.com/kirana-style/kirana/issues/87)) ([0cfe565](https://github.com/kirana-style/kirana/commit/0cfe565cc736743f88d815d77e6e31cf71097dfd))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug fixes
|
|
12
|
+
|
|
13
|
+
* publish to npm without dist-tag, and three small fixes ([#86](https://github.com/kirana-style/kirana/issues/86)) ([947066c](https://github.com/kirana-style/kirana/commit/947066c201c4c51db6413a1733eb3166aec7b7df))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* resync the public specification ([#88](https://github.com/kirana-style/kirana/issues/88)) ([9ff3a88](https://github.com/kirana-style/kirana/commit/9ff3a883bbff82793ca0fef1f15b8dc184a5d965))
|
|
19
|
+
* take the benchmarks of kirana 0.3.0 from kirana-lab ([#83](https://github.com/kirana-style/kirana/issues/83)) ([a783d4f](https://github.com/kirana-style/kirana/commit/a783d4f9c282ed7bd9c1b7d7af6c492b150e38d2))
|
|
20
|
+
* the 0.3.0 post, two compare rows, what the benchmarks include ([#85](https://github.com/kirana-style/kirana/issues/85)) ([022b50f](https://github.com/kirana-style/kirana/commit/022b50f25b6d00616cb70b7d1cba234abe8b2ac3))
|
|
21
|
+
|
|
22
|
+
## [0.3.0](https://github.com/kirana-style/kirana/compare/v0.2.4...v0.3.0) (2026-10-21)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ⚠ BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* declare a variable token only where something uses it ([#62](https://github.com/kirana-style/kirana/issues/62))
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* component states as condition keys, and values checked by grammar ([#82](https://github.com/kirana-style/kirana/issues/82)) ([2c034e7](https://github.com/kirana-style/kirana/commit/2c034e7b3c1e51f35a120c5af02934e3f3fa5b4e))
|
|
32
|
+
* declare a variable token only where something uses it ([#62](https://github.com/kirana-style/kirana/issues/62)) ([811fbdd](https://github.com/kirana-style/kirana/commit/811fbdd5d1276738306eb1e22cca6b5b3a77c92a))
|
|
33
|
+
* remix 3, with sx in compiled jsx ([#80](https://github.com/kirana-style/kirana/issues/80)) ([b6e9d12](https://github.com/kirana-style/kirana/commit/b6e9d1284d23e89e70ca7b82ef5eab2ca2378a74))
|
|
34
|
+
* **site:** a partners page, the theme in the footer, a new quick start ([#70](https://github.com/kirana-style/kirana/issues/70)) ([9f5552c](https://github.com/kirana-style/kirana/commit/9f5552c91801350ffe641f7482b1807096fed409))
|
|
35
|
+
* **site:** quick start pills, full chart comparisons, updated skills ([#72](https://github.com/kirana-style/kirana/issues/72)) ([abc2363](https://github.com/kirana-style/kirana/commit/abc23638a3e47a2daf8b3af89705bb67544dc879))
|
|
36
|
+
* **site:** what ci runs on, and a lighter quick start ([#79](https://github.com/kirana-style/kirana/issues/79)) ([5ef3c51](https://github.com/kirana-style/kirana/commit/5ef3c515b880c40fc4735954105b07ed7f4b3439))
|
|
37
|
+
* solidstart, vike, waku, vitepress, docusaurus and storybook ([#78](https://github.com/kirana-style/kirana/issues/78)) ([de928d2](https://github.com/kirana-style/kirana/commit/de928d2bb9438e5a02b529ed5aacc69456b32401))
|
|
38
|
+
* **ui:** charts on tanstack charts, with the benchmark and scale-curve charts ([#69](https://github.com/kirana-style/kirana/issues/69)) ([e33de7e](https://github.com/kirana-style/kirana/commit/e33de7e3fcb2d0ebe18c54cc2804a011782d47a1))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Performance
|
|
42
|
+
|
|
43
|
+
* keep the stylesheet and project diagnostics until something changes ([#65](https://github.com/kirana-style/kirana/issues/65)) ([91b67fa](https://github.com/kirana-style/kirana/commit/91b67fa77f99e714a2485752291139c54900cfd0))
|
|
44
|
+
* order atoms within a conflict key so adjacent keys share rules ([#63](https://github.com/kirana-style/kirana/issues/63)) ([42be523](https://github.com/kirana-style/kirana/commit/42be5231df063e5f9cece88a705808515bc13076))
|
|
45
|
+
* **site:** load the homepage's chapters below the hero on their own ([#68](https://github.com/kirana-style/kirana/issues/68)) ([5ccf916](https://github.com/kirana-style/kirana/commit/5ccf916d00cb253616650e7146d5d75d8ffefb3b))
|
|
46
|
+
* **site:** no software webgl, repository numbers through the worker ([#67](https://github.com/kirana-style/kirana/issues/67)) ([db11850](https://github.com/kirana-style/kirana/commit/db1185057b9048cb7296082318768f5307a9ed2d))
|
|
47
|
+
* **site:** prerender pages, split shared chunks, two new scenes ([#66](https://github.com/kirana-style/kirana/issues/66)) ([8e5160e](https://github.com/kirana-style/kirana/commit/8e5160e271970859dddb844e0290005d3cdd797c))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Dependencies
|
|
51
|
+
|
|
52
|
+
* bump the minor-and-patch group across 1 directory with 2 updates ([#75](https://github.com/kirana-style/kirana/issues/75)) ([bccbb0c](https://github.com/kirana-style/kirana/commit/bccbb0c42e50915943e53b8c0dc3fc623ad9d5fa))
|
|
53
|
+
* bump the minor-and-patch group with 16 updates ([#76](https://github.com/kirana-style/kirana/issues/76)) ([9f4df94](https://github.com/kirana-style/kirana/commit/9f4df947dda37e45e80231fd36203cc08399e903))
|
|
54
|
+
* bump the oxc group in /packages/kirana with 7 updates ([#74](https://github.com/kirana-style/kirana/issues/74)) ([7718a1c](https://github.com/kirana-style/kirana/commit/7718a1cc0acb57d6816146ded78b02853b16c928))
|
|
55
|
+
* vite-plus 1.3.0, and a licence check for javascript dependencies ([#77](https://github.com/kirana-style/kirana/issues/77)) ([1ab86c3](https://github.com/kirana-style/kirana/commit/1ab86c33205b58ce714a5e605d7f9f0a3c63a4aa))
|
|
56
|
+
|
|
3
57
|
## [0.2.4](https://github.com/kirana-style/kirana/compare/v0.2.3...v0.2.4) (2026-10-19)
|
|
4
58
|
|
|
5
59
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirana-style/rolldown",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Kirana for Rolldown: compiles modules and emits the stylesheet.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "The Kirana authors",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@kirana-style/compiler": "0.
|
|
29
|
-
"@kirana-style/core": "0.
|
|
28
|
+
"@kirana-style/compiler": "0.3.1",
|
|
29
|
+
"@kirana-style/core": "0.3.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"rolldown": "^1.2.12"
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"LICENSE",
|
|
47
47
|
"builders.json",
|
|
48
48
|
"schemas",
|
|
49
|
+
"licenses",
|
|
49
50
|
"gatsby-node.mjs",
|
|
50
51
|
"rules",
|
|
51
52
|
"recommended.json",
|
package/src/index.d.ts
CHANGED
|
@@ -54,7 +54,9 @@ export declare function createKirana(options?: KiranaRolldownOptions, host?: Hos
|
|
|
54
54
|
watchMode: boolean;
|
|
55
55
|
};
|
|
56
56
|
}): Promise<void>;
|
|
57
|
-
renderChunk(
|
|
57
|
+
renderChunk(this: {
|
|
58
|
+
error: (message: string) => never;
|
|
59
|
+
}, code: string, chunk: {
|
|
58
60
|
fileName: string;
|
|
59
61
|
}): Promise<{
|
|
60
62
|
code: string;
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COMPONENT, Driver } from "@kirana-style/compiler";
|
|
2
|
-
import { ASSET_QUERY, PLACEHOLDER, SCRIPT, STYLE_BEARING, cleanId, createReporter, fillStylesheet, renameAsset, stylesheetPath } from "@kirana-style/compiler/host";
|
|
2
|
+
import { ASSET_QUERY, PLACEHOLDER, SCRIPT, STYLE_BEARING, VIRTUAL, cleanId, createReporter, fillStylesheet, renameAsset, stylesheetPath, tokenNames } from "@kirana-style/compiler/host";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
//#region src/index.ts
|
|
@@ -32,6 +32,13 @@ function createKirana(options = {}, host = {}) {
|
|
|
32
32
|
const development = () => host.development?.() ?? false;
|
|
33
33
|
const fileName = options.fileName ?? "kirana.css";
|
|
34
34
|
const dense = () => options.names === "dense" && !development();
|
|
35
|
+
/**
|
|
36
|
+
* Every variable token the bundle's chunks and other files name, across environments, and the
|
|
37
|
+
* ones the last stylesheet left out by identity (D-086): a token only code names is written when
|
|
38
|
+
* the finished bundle still names it, and a chunk rendered later must not name one left out.
|
|
39
|
+
*/
|
|
40
|
+
const named = /* @__PURE__ */ new Set();
|
|
41
|
+
let pruned = /* @__PURE__ */ new Map();
|
|
35
42
|
const session = () => {
|
|
36
43
|
driver ??= Driver.create({
|
|
37
44
|
root: state.root,
|
|
@@ -52,8 +59,17 @@ function createKirana(options = {}, host = {}) {
|
|
|
52
59
|
}
|
|
53
60
|
},
|
|
54
61
|
async renderChunk(code, chunk) {
|
|
62
|
+
if (development()) return null;
|
|
63
|
+
const compiler = await session();
|
|
64
|
+
const names = tokenNames(code, compiler.prefix);
|
|
65
|
+
const late = names.filter((name) => pruned.has(name));
|
|
66
|
+
if (late.length > 0) {
|
|
67
|
+
const list = late.map((name) => `${pruned.get(name)} (${name})`).join(", ");
|
|
68
|
+
this.error(`kirana: ${chunk.fileName} reads tokens the stylesheet left out: ${list}. Nothing the stylesheet's own build bundled named them at runtime. Declare each one \`runtime: true\` in defineTokens (D-086).`);
|
|
69
|
+
}
|
|
70
|
+
for (const name of names) named.add(name);
|
|
55
71
|
if (!dense()) return null;
|
|
56
|
-
return
|
|
72
|
+
return compiler.dense(code, chunk.fileName) ?? null;
|
|
57
73
|
},
|
|
58
74
|
load: {
|
|
59
75
|
filter: { id: [/stylesheet\.css/, COMPONENT] },
|
|
@@ -84,7 +100,11 @@ function createKirana(options = {}, host = {}) {
|
|
|
84
100
|
filter: {
|
|
85
101
|
id: {
|
|
86
102
|
include: SCRIPT,
|
|
87
|
-
exclude: [
|
|
103
|
+
exclude: [
|
|
104
|
+
ASSET_QUERY,
|
|
105
|
+
COMPONENT_PART,
|
|
106
|
+
VIRTUAL
|
|
107
|
+
]
|
|
88
108
|
},
|
|
89
109
|
code: STYLE_BEARING
|
|
90
110
|
},
|
|
@@ -114,7 +134,7 @@ function createKirana(options = {}, host = {}) {
|
|
|
114
134
|
order: "pre",
|
|
115
135
|
async handler(_output, bundle) {
|
|
116
136
|
if (!host.bundlesCss) {
|
|
117
|
-
const css =
|
|
137
|
+
const css = await finished(bundle);
|
|
118
138
|
this.emitFile({
|
|
119
139
|
type: "asset",
|
|
120
140
|
fileName,
|
|
@@ -127,13 +147,24 @@ function createKirana(options = {}, host = {}) {
|
|
|
127
147
|
}
|
|
128
148
|
};
|
|
129
149
|
/**
|
|
150
|
+
* The stylesheet for this bundle (D-086): the token names its other files hold join the chunks',
|
|
151
|
+
* and the tokens left out are kept for the chunks rendered after it.
|
|
152
|
+
*/
|
|
153
|
+
const finished = async (bundle) => {
|
|
154
|
+
const compiler = await session();
|
|
155
|
+
for (const file of Object.values(bundle)) if (file.type === "asset" && typeof file.source === "string") for (const name of tokenNames(file.source, compiler.prefix)) named.add(name);
|
|
156
|
+
const result = compiler.finishedStylesheet(named, dense());
|
|
157
|
+
pruned = new Map(result.pruned.map((token) => [token.variable, token.identity]));
|
|
158
|
+
return result.css;
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
130
161
|
* Fills every stylesheet asset still holding the placeholder, renaming it by content unless the
|
|
131
162
|
* host keeps names, and points the chunks and assets that named it at the new name. A second pass
|
|
132
163
|
* finds nothing to do, so a host may run it again later in `generateBundle` for assets another
|
|
133
164
|
* plugin added after the first pass (Qwik's).
|
|
134
165
|
*/
|
|
135
166
|
const fill = async (bundle, emitFile) => {
|
|
136
|
-
const css =
|
|
167
|
+
const css = await finished(bundle);
|
|
137
168
|
for (const [key, asset] of Object.entries(bundle)) {
|
|
138
169
|
if (asset.type !== "asset") continue;
|
|
139
170
|
const source = fillStylesheet(String(asset.source), css);
|