@kirana-style/angular 0.3.5 → 0.3.7

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 CHANGED
@@ -1,5 +1,93 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.7](https://github.com/kirana-style/kirana/compare/v0.3.6...v0.3.7) (2026-11-02)
4
+
5
+
6
+ ### Features
7
+
8
+ * a component's physical side that beats a caller's logical one is reported ([#218](https://github.com/kirana-style/kirana/pull/218)) ([863aeb9](https://github.com/kirana-style/kirana/commit/863aeb9bbf7caa853dcb6fa6dfb9b67203a3b9a6))
9
+ * kirana-style init sets up vinext, with an example and a guide ([#221](https://github.com/kirana-style/kirana/pull/221)) ([a7df384](https://github.com/kirana-style/kirana/commit/a7df384ae30ded242bd046907dcd4d06ae5b89e5))
10
+
11
+
12
+ ### Bug fixes
13
+
14
+ * a registry item can publish its axis builds without style builds ([#220](https://github.com/kirana-style/kirana/pull/220)) ([56fdcd6](https://github.com/kirana-style/kirana/commit/56fdcd64672ffd090a6825c167e677c933d624ee))
15
+ * a style helper that cannot fold is reported, not merged at runtime ([#224](https://github.com/kirana-style/kirana/pull/224)) ([8fa8235](https://github.com/kirana-style/kirana/commit/8fa8235f37e586c5da59228e89d7621a2d89cef9))
16
+ * ark ui parts that call another part's getter have their state keys ([#227](https://github.com/kirana-style/kirana/pull/227)) ([41e2a65](https://github.com/kirana-style/kirana/commit/41e2a654de650cd79d8ffc4ca90f2d30f3c2380e))
17
+ * ark ui's radio and segment group items have their state keys ([#225](https://github.com/kirana-style/kirana/pull/225)) ([68f070d](https://github.com/kirana-style/kirana/commit/68f070dfd5e2838b9d489f30049e38949aa58d80))
18
+ * kirana-style check compiles every framework's components ([#228](https://github.com/kirana-style/kirana/pull/228)) ([78a50ff](https://github.com/kirana-style/kirana/commit/78a50ffa9756b227640338573e732ebab2f59ab0))
19
+ * sx in a component's template records anchors and carries resets ([#226](https://github.com/kirana-style/kirana/pull/226)) ([6032bbd](https://github.com/kirana-style/kirana/commit/6032bbd364d87b57d50d918af44ebe767e553530))
20
+ * the background shorthand takes a single layer, gradients included ([#223](https://github.com/kirana-style/kirana/pull/223)) ([024653e](https://github.com/kirana-style/kirana/commit/024653e33ffbf85d1e25f33adb07cf02f6283ce0))
21
+ * the language server writes a reply larger than the pipe whole ([#212](https://github.com/kirana-style/kirana/pull/212)) ([929994f](https://github.com/kirana-style/kirana/commit/929994fb5569dd8c4036bd1b688d1785c9bcbdff))
22
+
23
+
24
+ ### Performance
25
+
26
+ * a module resolves and reads each import once ([#216](https://github.com/kirana-style/kirana/pull/216)) ([7e481af](https://github.com/kirana-style/kirana/commit/7e481af23a3fee237532684d7d002e73c3cdf7b8))
27
+ * a style compiles without repeating work it already did ([#215](https://github.com/kirana-style/kirana/pull/215)) ([f87b030](https://github.com/kirana-style/kirana/commit/f87b0300b890b5eed4ae2fa50960b745e3627905))
28
+ * an import the compiler folded away is removed ([#219](https://github.com/kirana-style/kirana/pull/219)) ([4724deb](https://github.com/kirana-style/kirana/commit/4724deb189647856642b3ac39d7f51acb6685660))
29
+ * an unchanged module is answered without the engine, and a one-off build watches no files ([#217](https://github.com/kirana-style/kirana/pull/217)) ([b919894](https://github.com/kirana-style/kirana/commit/b919894ee30cabc698420d230cb0f94c72856a95))
30
+
31
+
32
+ ### Documentation
33
+
34
+ * take the benchmarks of kirana 0.3.6 from kirana-lab ([#214](https://github.com/kirana-style/kirana/pull/214)) ([af9c009](https://github.com/kirana-style/kirana/commit/af9c009b8d2433eb2d4b4ba4b71eef4e393dee6e))
35
+ * take the benchmarks of kirana 0.3.6 from kirana-lab ([#222](https://github.com/kirana-style/kirana/pull/222)) ([430b667](https://github.com/kirana-style/kirana/commit/430b667e88bf86da6091e3153081bd3ab3d13c39))
36
+
37
+ ## [0.3.6](https://github.com/kirana-style/kirana/compare/v0.3.5...v0.3.6) (2026-10-31)
38
+
39
+
40
+ ### Features
41
+
42
+ * a contextual target may name a class ([#206](https://github.com/kirana-style/kirana/pull/206)) ([e71ff55](https://github.com/kirana-style/kirana/commit/e71ff551e41d0b645c7e00e238b736ab0a54a090))
43
+ * diagnostics print as oxc's graphical report, with the source ([#207](https://github.com/kirana-style/kirana/pull/207)) ([cbbdbe5](https://github.com/kirana-style/kirana/commit/cbbdbe5224e31739681576e1d29133122881d764))
44
+ * fallback() reads a token, then another, then a value ([#211](https://github.com/kirana-style/kirana/pull/211)) ([6e72f71](https://github.com/kirana-style/kirana/commit/6e72f71274ae0f98fb0fddcb3b2674a10a8d8e90))
45
+ * layers.tiers puts each ladder tier in a sub-layer of kirana.atoms ([#172](https://github.com/kirana-style/kirana/pull/172)) ([8bca0d5](https://github.com/kirana-style/kirana/commit/8bca0d55fe9edff698e4de10dcca2c2d4ee61093))
46
+ * migrate stylex writes styles as stylex read them ([#193](https://github.com/kirana-style/kirana/pull/193)) ([88a3a42](https://github.com/kirana-style/kirana/commit/88a3a42df4b38cf024e57caf620c05ad82da54ff))
47
+ * migrate tailwind reads a design system's conditions and handles ([#204](https://github.com/kirana-style/kirana/pull/204)) ([d753322](https://github.com/kirana-style/kirana/commit/d753322d29c272b1175278d30e480c29094ce40f))
48
+ * relation-read-on-anchor, a state read on its own anchor ([#186](https://github.com/kirana-style/kirana/pull/186)) ([3676f00](https://github.com/kirana-style/kirana/commit/3676f000aeaaf00e0aed681e5050390cadc23db1))
49
+ * the language server in a browser page, as project.language ([#184](https://github.com/kirana-style/kirana/pull/184)) ([c2d1bec](https://github.com/kirana-style/kirana/commit/c2d1bec0388bf3e430bdb92eb51b80d739b31c20))
50
+ * ui flattens each design axis, or keeps every design ([#209](https://github.com/kirana-style/kirana/pull/209)) ([2559372](https://github.com/kirana-style/kirana/commit/2559372d569c8000daf2eb2ebe6cb5df1bcb4e0c))
51
+ * ui init and ui preset take --pointer and --rtl ([#202](https://github.com/kirana-style/kirana/pull/202)) ([19859f8](https://github.com/kirana-style/kirana/commit/19859f8eb7fd41e5d7b5ada395af7c0522bc5e5f))
52
+
53
+
54
+ ### Bug fixes
55
+
56
+ * a dev page that loaded an older stylesheet gets the current one ([#187](https://github.com/kirana-style/kirana/pull/187)) ([8ba8538](https://github.com/kirana-style/kirana/commit/8ba853804b1a71f8a47f99babd0c6ad0babe19f7))
57
+ * a host reads the package root's config from a folder without one ([#183](https://github.com/kirana-style/kirana/pull/183)) ([47fa994](https://github.com/kirana-style/kirana/commit/47fa994a47339532272485cce2a4105b6704e49b))
58
+ * a key or spread decided at runtime is reported where it is written ([#208](https://github.com/kirana-style/kirana/pull/208)) ([2594a25](https://github.com/kirana-style/kirana/commit/2594a255a0f6242c8693fbc86b4e63638ab8fcb9))
59
+ * a listed library's components read sx, so it is not reported ([#196](https://github.com/kirana-style/kirana/pull/196)) ([16cc0d4](https://github.com/kirana-style/kirana/commit/16cc0d4fbd38a1e8c99309d38a2049740d45efea))
60
+ * a long editor or dev session no longer grows its memory with every edit ([#175](https://github.com/kirana-style/kirana/pull/175)) ([76e8a41](https://github.com/kirana-style/kirana/commit/76e8a412e0e0d3d1fa1d67ccb1004fd02988d073))
61
+ * a watch build forgets the tokens a rebuild no longer names ([#180](https://github.com/kirana-style/kirana/pull/180)) ([91bbc81](https://github.com/kirana-style/kirana/commit/91bbc8181f624b53186db9a64f78701e76640e41))
62
+ * an optional relation anchored without its readers is not reported ([#181](https://github.com/kirana-style/kirana/pull/181)) ([4acdcf7](https://github.com/kirana-style/kirana/commit/4acdcf76259e425797b912ae088669f85ad359d4))
63
+ * base-ui's accordion item, header and panel have closed ([#185](https://github.com/kirana-style/kirana/pull/185)) ([a33889f](https://github.com/kirana-style/kirana/commit/a33889ff0799cc7b6e57b8b7596dd518f738b923))
64
+ * removing both logical axes clears a component's physical box ([#200](https://github.com/kirana-style/kirana/pull/200)) ([9b61d15](https://github.com/kirana-style/kirana/commit/9b61d15b397e30f63476c14d11d5e6c2da9e9dee))
65
+ * tailwind migration keeps line heights, images and single layers ([#201](https://github.com/kirana-style/kirana/pull/201)) ([a34017c](https://github.com/kirana-style/kirana/commit/a34017cea2ffb6b2560df960d97adfed6e330e4e))
66
+ * the utility grammar hints import scales as its default export ([#182](https://github.com/kirana-style/kirana/pull/182)) ([22fca2b](https://github.com/kirana-style/kirana/commit/22fca2b7e39e78b2f9b921a11a25bd64828d1e69))
67
+
68
+
69
+ ### Performance
70
+
71
+ * a build that writes no source maps does not build them ([#176](https://github.com/kirana-style/kirana/pull/176)) ([4d8da10](https://github.com/kirana-style/kirana/commit/4d8da1039e915762767b7399604bf577c48ac44d))
72
+ * a dense build without source maps renames chunks in one pass ([#189](https://github.com/kirana-style/kirana/pull/189)) ([4ab17c5](https://github.com/kirana-style/kirana/commit/4ab17c5b31dd693c840868018eaec6e8c9d3a049))
73
+ * a style reused from another value is not copied ([#192](https://github.com/kirana-style/kirana/pull/192)) ([a79d1bd](https://github.com/kirana-style/kirana/commit/a79d1bdb95ab1c45fbeaae776f360fe25495f927))
74
+ * check places a file's diagnostics without walking it for each one ([#194](https://github.com/kirana-style/kirana/pull/194)) ([a21f5d7](https://github.com/kirana-style/kirana/commit/a21f5d70873485c99d622c0110ac3696dafe5a20))
75
+ * declarations compile without parsing longhands or copying plans ([#188](https://github.com/kirana-style/kirana/pull/188)) ([cd39382](https://github.com/kirana-style/kirana/commit/cd393829e0b92c7c41a75ad0bf68b77c89d9812d))
76
+ * esbuild, bun, webpack, next and parcel compile modules in parallel ([#195](https://github.com/kirana-style/kirana/pull/195)) ([7961d2e](https://github.com/kirana-style/kirana/commit/7961d2e9df3d7c023680f420485501a012653cc7))
77
+ * formatting diagnostics no longer walks the source for each one ([#190](https://github.com/kirana-style/kirana/pull/190)) ([700bea8](https://github.com/kirana-style/kirana/commit/700bea8d93387a268822b98da2e78045dc02bef1))
78
+ * merging styles and naming their classes copies and allocates less ([#178](https://github.com/kirana-style/kirana/pull/178)) ([f9fb902](https://github.com/kirana-style/kirana/commit/f9fb902591a08955495a0ff1138255a536b5cb75))
79
+ * styles compile and stylesheets are written with less repeated work ([#174](https://github.com/kirana-style/kirana/pull/174)) ([085984a](https://github.com/kirana-style/kirana/commit/085984a0c94f05a6122cfb50d31e79361c6cb693))
80
+ * the stylesheet is written from atoms kept in its order ([#179](https://github.com/kirana-style/kirana/pull/179)) ([428dda4](https://github.com/kirana-style/kirana/commit/428dda4e3b44e0417293ea4f1d89f6f8fbb1a09a))
81
+ * the stylesheet writes each key's values in order, which compresses better ([#191](https://github.com/kirana-style/kirana/pull/191)) ([4465ca5](https://github.com/kirana-style/kirana/commit/4465ca53f4b178e0674f820a975b76fb2d793441))
82
+
83
+
84
+ ### Documentation
85
+
86
+ * counts from their sources, two readmes, four more checks ([#203](https://github.com/kirana-style/kirana/pull/203)) ([3855e4c](https://github.com/kirana-style/kirana/commit/3855e4c4c6d7d6a10872994d5b3c0232060ffde6))
87
+ * every page says what the code does, and two more checks hold it ([#199](https://github.com/kirana-style/kirana/pull/199)) ([6615452](https://github.com/kirana-style/kirana/commit/661545274459072480780f25326018586bcf37d8))
88
+ * take the benchmarks of kirana 0.3.5 from kirana-lab ([#177](https://github.com/kirana-style/kirana/pull/177)) ([0920e23](https://github.com/kirana-style/kirana/commit/0920e23fc9614474bce7702a1f8bfe8c3b3b30bd))
89
+ * the agent skills say what shipped since 0.3.0 ([#197](https://github.com/kirana-style/kirana/pull/197)) ([8cfc693](https://github.com/kirana-style/kirana/commit/8cfc6938f0808fe2d6e977e5414826544219a4dc))
90
+
3
91
  ## [0.3.5](https://github.com/kirana-style/kirana/compare/v0.3.4...v0.3.5) (2026-10-28)
4
92
 
5
93
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirana-style/angular",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Kirana for Angular: the [sx] directive, the Analog (Vite) plugin and Angular CLI builders.",
5
5
  "license": "MIT",
6
6
  "author": "The Kirana authors",
@@ -30,14 +30,14 @@
30
30
  "./builders.json": "./builders.json"
31
31
  },
32
32
  "dependencies": {
33
- "@kirana-style/compiler": "0.3.5",
34
- "@kirana-style/core": "0.3.5"
33
+ "@kirana-style/compiler": "0.3.7",
34
+ "@kirana-style/core": "0.3.7"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@angular/core": ">=20.0.0",
38
38
  "@angular/build": ">=20.0.0",
39
39
  "@angular-devkit/architect": ">=0.2000.0",
40
- "@kirana-style/vite": "0.3.5"
40
+ "@kirana-style/vite": "0.3.7"
41
41
  },
42
42
  "builders": "./builders.json",
43
43
  "peerDependenciesMeta": {
package/src/builders.js CHANGED
@@ -10,8 +10,7 @@ import { buildApplication, executeDevServerBuilder } from "@angular/build";
10
10
  * "build": { "builder": "@kirana-style/angular:application", "options": { … as before … } }
11
11
  * "serve": { "builder": "@kirana-style/angular:dev-server", … }
12
12
  *
13
- * The dev server is Angular's, run with a context whose build target's options carry the mirror:
14
- * Angular reads those options itself and compiles them with its internal application build.
13
+ * The dev server is Angular's, given a context whose build target's options carry the mirror.
15
14
  */
16
15
  /** The project's source folder, from its configuration (`src` unless it says otherwise). */
17
16
  async function sourceRootOf(context) {
@@ -36,8 +35,8 @@ function withMirror(options, mirror) {
36
35
  }
37
36
  /** Prints the mirror's warnings and errors through the builder's logger (infos stay quiet). */
38
37
  function report(context, mirror) {
39
- for (const message of mirror.messages()) if (message.startsWith("error")) context.logger.error(message);
40
- else if (message.startsWith("warning")) context.logger.warn(message);
38
+ for (const { severity, text } of mirror.messages()) if (severity === "error") context.logger.error(text);
39
+ else if (severity === "warning") context.logger.warn(text);
41
40
  }
42
41
  async function* application(options, context) {
43
42
  const sourceRoot = await sourceRootOf(context);
@@ -7,11 +7,10 @@ export declare function provideKirana(options: {
7
7
  prefix: string;
8
8
  }): i0.Provider[];
9
9
  /**
10
- * Provided by a part: an attribute directive that takes `sx` itself and merges it with its own
11
- * styles, the caller's last (D-100, `partSx`). `SxDirective` on the same element then applies nothing, so a
12
- * template can import it for its plain elements and still hold parts (KF-049): both would read the
13
- * one `[sx]` binding, and a class `SxDirective` added would be dropped when the part's `[class]`
14
- * binding next changed. A part lists `provideSxPart()` in its `providers`.
10
+ * Provided by a part, a directive that merges `sx` with its own styles itself (D-100, `partSx`):
11
+ * `SxDirective` on the same element then applies nothing, since a class it added would be dropped
12
+ * when the part's `[class]` binding next changed (KF-049). A part lists `provideSxPart()` in its
13
+ * `providers`.
15
14
  */
16
15
  export declare const SX_PART: i0.InjectionToken<boolean>;
17
16
  /** The provider that marks a part's element, so `SxDirective` leaves `[sx]` to the part. */
@@ -3,16 +3,10 @@ import * as i0 from "@angular/core";
3
3
  // src/fesm2022/directive.ts
4
4
  /**
5
5
  * `[sx]` for Angular templates (D-068). A template reaches only its component's members, so `sx`
6
- * cannot be compiled away there as it is in JSX and in Vue, Svelte or Astro templates: this
7
- * directive merges the handles at runtime with Kirana's runtime instead, and keeps the element's own
8
- * classes and styles.
9
- *
10
- * The class carries Angular's partial declarations (`ɵɵngDeclareFactory`, `ɵɵngDeclareDirective`),
11
- * the form `ngc` emits for a library and Angular's linker compiles in every app build. They are
12
- * written here rather than generated because this workspace's TypeScript (7) has no JavaScript API
13
- * for `ngc` to run on; the Analog and Angular CLI examples build them in CI. The static types are the
14
- * ones `ngc` would declare, so templates type-check `[sx]` against `Sx`. The file sits under
15
- * `fesm2022/`, the Angular Package Format's folder, because Analog links only files on such a path.
6
+ * cannot be compiled away: this directive merges the handles with Kirana's runtime and keeps the
7
+ * element's own classes and styles. Its partial declarations (`ɵɵngDeclare*`, with the types `ngc`
8
+ * would declare) are hand-written because TypeScript 7 has no JavaScript API for `ngc`; the examples
9
+ * build them in CI. It sits under `fesm2022/` because Analog links only files on such a path.
16
10
  */
17
11
  /** The class-name prefix (`names.prefix`); `k` unless the app provides another (`provideKirana`). */
18
12
  const KIRANA_PREFIX = new i0.InjectionToken("kirana prefix", {
@@ -27,11 +21,10 @@ function provideKirana(options) {
27
21
  }];
28
22
  }
29
23
  /**
30
- * Provided by a part: an attribute directive that takes `sx` itself and merges it with its own
31
- * styles, the caller's last (D-100, `partSx`). `SxDirective` on the same element then applies nothing, so a
32
- * template can import it for its plain elements and still hold parts (KF-049): both would read the
33
- * one `[sx]` binding, and a class `SxDirective` added would be dropped when the part's `[class]`
34
- * binding next changed. A part lists `provideSxPart()` in its `providers`.
24
+ * Provided by a part, a directive that merges `sx` with its own styles itself (D-100, `partSx`):
25
+ * `SxDirective` on the same element then applies nothing, since a class it added would be dropped
26
+ * when the part's `[class]` binding next changed (KF-049). A part lists `provideSxPart()` in its
27
+ * `providers`.
35
28
  */
36
29
  const SX_PART = new i0.InjectionToken("kirana sx part");
37
30
  /** The provider that marks a part's element, so `SxDirective` leaves `[sx]` to the part. */
package/src/mirror.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { watch } from "node:fs";
2
+ import { Diagnostic } from "@kirana-style/compiler";
2
3
  /** Where the mirror lives, under the workspace root. */
3
4
  export declare const MIRROR = ".kirana";
4
5
  /** The stylesheet the builders add to `styles`. */
@@ -13,8 +14,11 @@ export type Mirror = {
13
14
  }[];
14
15
  /** Mirrors one changed or deleted file (and what read from it); returns whether anything changed. */
15
16
  update: (file: string) => boolean;
16
- /** Diagnostics from the last pass, formatted. */
17
- messages: () => string[];
17
+ /** Diagnostics from the last pass, each formatted with its severity. */
18
+ messages: () => {
19
+ severity: Diagnostic["severity"];
20
+ text: string;
21
+ }[];
18
22
  };
19
23
  /** Builds the mirror of `sourceRoot` (relative to `root`) and writes the stylesheet. */
20
24
  export declare function createMirror(root: string, sourceRoot: string, options?: {
package/src/mirror.js CHANGED
@@ -1,17 +1,14 @@
1
1
  import path from "node:path";
2
2
  import { copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, watch, writeFileSync } from "node:fs";
3
- import { Driver, formatDiagnostic } from "@kirana-style/compiler";
3
+ import { Driver, formatDiagnostics } from "@kirana-style/compiler";
4
4
  import { SKIPPED, shouldCompile } from "@kirana-style/compiler/host";
5
5
  // src/mirror.ts
6
6
  /**
7
- * Kirana for the Angular CLI (D-068, `design-notes/angular.md`). Angular's application builder
8
- * compiles TypeScript from its own program and offers no hook to change a source first, but it
9
- * honours `fileReplacements`, by redirecting module resolution to the replacement file. So the
10
- * builders keep a mirror of the source folder in `.kirana/`: every file copied, the ones that hold
11
- * styles compiled by Kirana. A replacement's relative imports and `templateUrl`s then resolve inside
12
- * the mirror, where every file exists. Every TypeScript file is replaced, the stylesheet is written
13
- * beside the mirror, and in watch mode each change is mirrored again — Angular, which watches the
14
- * replacements, rebuilds from there.
7
+ * Kirana for the Angular CLI (D-068, `design-notes/angular.md`). Angular's builder offers no hook to
8
+ * change a source, but honours `fileReplacements`, so the builders keep a mirror of the source folder
9
+ * in `.kirana/`: every file copied, the ones that hold styles compiled. Relative imports and
10
+ * `templateUrl`s resolve inside the mirror; in watch mode each change is mirrored again and Angular,
11
+ * which watches the replacements, rebuilds.
15
12
  */
16
13
  /** Where the mirror lives, under the workspace root. */
17
14
  const MIRROR = ".kirana";
@@ -50,7 +47,7 @@ async function createMirror(root, sourceRoot, options = {}) {
50
47
  copyFileSync(from, to);
51
48
  return;
52
49
  }
53
- const result = driver.transform(from, text);
50
+ const result = driver.transform(from, text, { map: false });
54
51
  texts.set(path.relative(root, from).replaceAll("\\", "/"), text);
55
52
  reported.push(...result.diagnostics);
56
53
  writeFileSync(to, result.code ?? text);
@@ -82,7 +79,13 @@ async function createMirror(root, sourceRoot, options = {}) {
82
79
  for (const changed of affected) mirror(path.relative(source, changed));
83
80
  return stylesheet();
84
81
  },
85
- messages: () => reported.map((diagnostic) => formatDiagnostic(diagnostic, texts.get(diagnostic.file)))
82
+ messages: () => {
83
+ const formatted = formatDiagnostics(reported, (file) => texts.get(file));
84
+ return reported.map(({ severity }, index) => ({
85
+ severity,
86
+ text: formatted[index]
87
+ }));
88
+ }
86
89
  };
87
90
  }
88
91
  /** Mirrors every change under the source folder until closed (watch builds and the dev server). */