@kirana-style/angular 0.0.0-stage → 0.1.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 CHANGED
@@ -1,3 +1,33 @@
1
- # Temporary Holding Version
1
+ # @kirana-style/angular
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Kirana for Angular: the `[sx]` directive for templates, a Vite plugin for Analog, and builders for
4
+ the Angular CLI ([11-integrations](../../../../spec/11-integrations.md), D-068).
5
+
6
+ ```ts
7
+ // a component
8
+ import { Component } from "@angular/core"
9
+ import { SxDirective } from "@kirana-style/angular"
10
+ import { css } from "@kirana-style/core"
11
+
12
+ const styles = { card: css({ padding: "1rem" }) }
13
+
14
+ @Component({
15
+ selector: "app-card",
16
+ imports: [SxDirective],
17
+ template: `<div [sx]="styles.card"></div>`,
18
+ })
19
+ export class Card {
20
+ protected readonly styles = styles
21
+ }
22
+ ```
23
+
24
+ - **`SxDirective`** merges the handles with Kirana's runtime and adds and removes only the classes
25
+ and custom properties it set. `provideKirana({ prefix })` matches a `names.prefix` other than `k`.
26
+ - **Analog.** `kiranaAngular()` from `@kirana-style/angular/vite`, after `analog()`, compiles the JavaScript
27
+ Angular emits. Import `@kirana-style/core/stylesheet.css` from `src/main.ts`.
28
+ - **Angular CLI.** In `angular.json`, `@kirana-style/angular:application` and `@kirana-style/angular:dev-server`
29
+ replace `@angular/build:application` and `:dev-server`, with the same options. They compile the
30
+ source root into `.kirana/` (ignore it), hand Angular the copy through `fileReplacements`, and add
31
+ `.kirana/kirana.css` to `styles`.
32
+
33
+ `kirana init` sets up either. How it works and what it costs: `design-notes/angular.md`.
package/builders.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "builders": {
3
+ "application": {
4
+ "implementation": "./src/application.js",
5
+ "schema": "./schemas/application.json",
6
+ "description": "Angular's application builder, with Kirana's compiled sources and stylesheet."
7
+ },
8
+ "dev-server": {
9
+ "implementation": "./src/dev-server.js",
10
+ "schema": "./schemas/dev-server.json",
11
+ "description": "Angular's development server, with Kirana's compiled sources and stylesheet."
12
+ }
13
+ }
14
+ }
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@kirana-style/angular",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Kirana for Angular: the [sx] directive, the Analog (Vite) plugin and Angular CLI builders.",
5
+ "license": "MIT",
6
+ "author": "The Kirana authors",
7
+ "homepage": "https://kirana.style",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kirana-style/kirana.git",
11
+ "directory": "packages/kirana/npm/angular"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/kirana-style/kirana/issues"
15
+ },
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "types": "./src/index.d.ts",
20
+ "default": "./src/index.js"
21
+ },
22
+ "./vite": {
23
+ "types": "./src/vite.d.ts",
24
+ "default": "./src/vite.js"
25
+ },
26
+ "./package.json": "./package.json",
27
+ "./builders.json": "./builders.json"
28
+ },
29
+ "dependencies": {
30
+ "@kirana-style/compiler": "0.1.0",
31
+ "@kirana-style/core": "0.1.0"
32
+ },
33
+ "peerDependencies": {
34
+ "@angular/core": ">=20.0.0",
35
+ "@angular/build": ">=20.0.0",
36
+ "@angular-devkit/architect": ">=0.2000.0",
37
+ "@kirana-style/vite": "0.1.0"
38
+ },
39
+ "builders": "./builders.json",
40
+ "peerDependenciesMeta": {
41
+ "@angular/build": {
42
+ "optional": true
43
+ },
44
+ "@angular-devkit/architect": {
45
+ "optional": true
46
+ },
47
+ "@kirana-style/vite": {
48
+ "optional": true
49
+ }
50
+ },
51
+ "files": [
52
+ "src",
53
+ "bin",
54
+ "*.d.ts",
55
+ "*.css",
56
+ "README.md",
57
+ "builders.json",
58
+ "schemas",
59
+ "gatsby-node.mjs",
60
+ "rules",
61
+ "recommended.json",
62
+ "strict.json"
63
+ ]
64
+ }