@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 +32 -2
- package/builders.json +14 -0
- package/package.json +62 -4
- package/schemas/application.json +737 -0
- package/schemas/dev-server.json +138 -0
- package/src/application.d.ts +3 -0
- package/src/application.js +3 -0
- package/src/builders.d.ts +19 -0
- package/src/builders.js +85 -0
- package/src/dev-server.d.ts +3 -0
- package/src/dev-server.js +3 -0
- package/src/fesm2022/directive.d.ts +39 -0
- package/src/fesm2022/directive.js +59 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +2 -0
- package/src/mirror.d.ts +36 -0
- package/src/mirror.js +107 -0
- package/src/sx.d.ts +25 -0
- package/src/sx.js +38 -0
- package/src/vite.d.ts +5 -0
- package/src/vite.js +15 -0
package/README.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @kirana-style/angular
|
|
2
2
|
|
|
3
|
-
|
|
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.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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
|
+
}
|