@kirana-style/ember 0.1.0 → 0.2.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/CHANGELOG.md +47 -0
- package/LICENSE +21 -0
- package/package.json +7 -2
- package/src/index.d.ts +3 -1
- package/src/index.js +17 -14
- package/src/vite.d.ts +5 -4
- package/src/vite.js +42 -37
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0](https://github.com/kirana-style/kirana/compare/v0.1.0...v0.2.0) (2026-10-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* one command name, kirana-style ([#29](https://github.com/kirana-style/kirana/issues/29))
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **editor:** real editor output on the site, open vsx trusted publishing ([#21](https://github.com/kirana-style/kirana/issues/21)) ([350fa4e](https://github.com/kirana-style/kirana/commit/350fa4ec0d8054a082d6c7dcdae2b5be53f8d98a))
|
|
13
|
+
* one command name, kirana-style ([#29](https://github.com/kirana-style/kirana/issues/29)) ([b3f3154](https://github.com/kirana-style/kirana/commit/b3f3154662589dd1bd43fd0ff2341acf4f3df628))
|
|
14
|
+
* **site:** paper, ink, scenery and type for one identity ([#27](https://github.com/kirana-style/kirana/issues/27)) ([5da3c6f](https://github.com/kirana-style/kirana/commit/5da3c6f0f1c8cbfdb450b36a6609a3ab4b20e358))
|
|
15
|
+
* **site:** reorganise the homepage, product pages and docs ([#28](https://github.com/kirana-style/kirana/issues/28)) ([88b5209](https://github.com/kirana-style/kirana/commit/88b52093488b2aa0112b458ca04b836c83d03954))
|
|
16
|
+
* **site:** scenery gradients, logo downloads, pixel k, glass icons ([#25](https://github.com/kirana-style/kirana/issues/25)) ([2953dc1](https://github.com/kirana-style/kirana/commit/2953dc126f47b68257ebfdb33c61992984708c49))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug fixes
|
|
20
|
+
|
|
21
|
+
* hold emnapi at 2.0.0-alpha.6, the wasi engine fails on the beta ([#26](https://github.com/kirana-style/kirana/issues/26)) ([8aa33e1](https://github.com/kirana-style/kirana/commit/8aa33e1dbccaefa15b87f6487ac0a346bbf6581a))
|
|
22
|
+
* settle the ember dev check, resolve code scanning findings ([#23](https://github.com/kirana-style/kirana/issues/23)) ([0c266c8](https://github.com/kirana-style/kirana/commit/0c266c8428c1453892beeeb5f98918cbc0eae6ff))
|
|
23
|
+
* **site:** keep syntax colours in the production build ([#22](https://github.com/kirana-style/kirana/issues/22)) ([621f2fc](https://github.com/kirana-style/kirana/commit/621f2fcf67dada773ca66110e295ab7ac5605f56))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Documentation
|
|
27
|
+
|
|
28
|
+
* fix the extension's settings table ([#13](https://github.com/kirana-style/kirana/issues/13)) ([457e06d](https://github.com/kirana-style/kirana/commit/457e06d12f9e3b005e0820aab36faac5bf3f80b3))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Dependencies
|
|
32
|
+
|
|
33
|
+
* bump the minor-and-patch group across 1 directory with 3 updates ([#19](https://github.com/kirana-style/kirana/issues/19)) ([7ea00ed](https://github.com/kirana-style/kirana/commit/7ea00edcc5cc02b9ab5e41b13f152ae344ea448f))
|
|
34
|
+
* emnapi 2.0.0-beta.1, minor and patch updates ([#24](https://github.com/kirana-style/kirana/issues/24)) ([a399fa7](https://github.com/kirana-style/kirana/commit/a399fa78e53dcfd7f41f249ccee1133809e66544))
|
|
35
|
+
|
|
36
|
+
## [0.1.0](https://github.com/kirana-style/kirana/compare/v0.1.0...v0.1.0) (2026-10-13)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Features
|
|
40
|
+
|
|
41
|
+
* kirana goes public — write objects, read classes, ship css ([79732ed](https://github.com/kirana-style/kirana/commit/79732edd5cab419169ab74ad59e1c70053dfa57d))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Dependencies
|
|
45
|
+
|
|
46
|
+
* bump the minor-and-patch group in /packages/kirana with 6 updates ([#10](https://github.com/kirana-style/kirana/issues/10)) ([0deaf9f](https://github.com/kirana-style/kirana/commit/0deaf9f3e75ebc377d764c294250bd2577d53844))
|
|
47
|
+
* bump the oxc group in /packages/kirana with 7 updates ([#9](https://github.com/kirana-style/kirana/issues/9)) ([a3ca94c](https://github.com/kirana-style/kirana/commit/a3ca94c170b2ca49c9691abf5ad48c3ef4ac8620))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kirana authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirana-style/ember",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Kirana for Ember on Embroider and Vite: css() in .gjs and .gts files, and the sx template helper.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "The Kirana authors",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"url": "https://github.com/kirana-style/kirana/issues"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
17
20
|
"exports": {
|
|
18
21
|
".": {
|
|
19
22
|
"types": "./src/index.d.ts",
|
|
@@ -26,7 +29,7 @@
|
|
|
26
29
|
"./package.json": "./package.json"
|
|
27
30
|
},
|
|
28
31
|
"dependencies": {
|
|
29
|
-
"@kirana-style/core": "0.
|
|
32
|
+
"@kirana-style/core": "0.2.0"
|
|
30
33
|
},
|
|
31
34
|
"peerDependencies": {
|
|
32
35
|
"@kirana-style/vite": "0.1.0"
|
|
@@ -42,6 +45,8 @@
|
|
|
42
45
|
"*.d.ts",
|
|
43
46
|
"*.css",
|
|
44
47
|
"README.md",
|
|
48
|
+
"CHANGELOG.md",
|
|
49
|
+
"LICENSE",
|
|
45
50
|
"builders.json",
|
|
46
51
|
"schemas",
|
|
47
52
|
"gatsby-node.mjs",
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Handle } from "@kirana-style/core/internal";
|
|
2
|
+
//#region src/index.d.ts
|
|
2
3
|
/** A merge helper for another class-name prefix (`names.prefix`). */
|
|
3
4
|
export declare function createSx(prefix: string): (...handles: Handle[]) => string;
|
|
4
5
|
/** The merge helper for the default prefix, `k`. */
|
|
5
6
|
export declare const sx: (...handles: Handle[]) => string;
|
|
7
|
+
//#endregion
|
package/src/index.js
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `sx` for Ember templates (D-072). A template reaches the handles in its module's scope, but the
|
|
3
|
-
* merge `sx` does at build time elsewhere needs a function here: `class={{sx styles.card (if
|
|
4
|
-
* this.active styles.on)}}` merges the handles with Kirana's runtime, later ones winning, as an
|
|
5
|
-
* `sx` list does. Ember calls a plain function as a helper.
|
|
6
|
-
*
|
|
7
|
-
* A handle with values known only at runtime carries custom properties a class cannot hold; set
|
|
8
|
-
* those from the component's code, as the [Ember guide](https://kirana.style/docs/frameworks/ember)
|
|
9
|
-
* shows.
|
|
10
|
-
*/
|
|
11
1
|
import { runtime } from "@kirana-style/core/internal";
|
|
2
|
+
//#region src/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* `sx` for Ember templates (D-072). A template reaches the handles in its module's scope, but the
|
|
5
|
+
* merge `sx` does at build time elsewhere needs a function here: `class={{sx styles.card (if
|
|
6
|
+
* this.active styles.on)}}` merges the handles with Kirana's runtime, later ones winning, as an
|
|
7
|
+
* `sx` list does. Ember calls a plain function as a helper.
|
|
8
|
+
*
|
|
9
|
+
* A handle with values known only at runtime carries custom properties a class cannot hold; set
|
|
10
|
+
* those from the component's code, as the [Ember guide](https://kirana.style/docs/frameworks/ember)
|
|
11
|
+
* shows.
|
|
12
|
+
*/
|
|
12
13
|
/** A merge helper for another class-name prefix (`names.prefix`). */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
function createSx(prefix) {
|
|
15
|
+
const kirana = runtime(prefix, "class");
|
|
16
|
+
return (...handles) => kirana.sx(handles, [], []).class ?? "";
|
|
16
17
|
}
|
|
17
18
|
/** The merge helper for the default prefix, `k`. */
|
|
18
|
-
|
|
19
|
+
const sx = createSx("k");
|
|
20
|
+
//#endregion
|
|
21
|
+
export { createSx, sx };
|
package/src/vite.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { KiranaViteOptions } from "@kirana-style/vite";
|
|
2
|
+
import { Plugin } from "vite";
|
|
3
|
+
//#region src/vite.d.ts
|
|
4
4
|
/** Ember's template-tag modules, as Vite names them. */
|
|
5
5
|
export declare const TEMPLATE_TAG: RegExp;
|
|
6
6
|
/** What Embroider resolves and Node.js cannot: Ember's own modules. */
|
|
7
7
|
export declare const EMBER_EXTERNALS: string[];
|
|
8
8
|
export declare function kiranaEmber(options?: KiranaViteOptions): Plugin[];
|
|
9
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type KiranaViteOptions as KiranaEmberOptions, kiranaEmber as default };
|
package/src/vite.js
CHANGED
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kirana for Ember on Embroider and Vite (D-072). A `.gjs` or `.gts` file holds a `<template>`
|
|
3
|
-
* Kirana's parser does not read, so its Vite plugin runs after Embroider's instead and compiles the
|
|
4
|
-
* JavaScript Embroider emitted for each module, where `css()` calls and their imports are as written.
|
|
5
|
-
* Its transform takes those modules too, which a Vite plugin's filter would otherwise skip, and
|
|
6
|
-
* `@ember/`, `@glimmer/` and `@embroider/virtual/` — modules only Embroider resolves — are runtime values (`externals`).
|
|
7
|
-
*
|
|
8
|
-
* plugins: [classicEmberSupport(), ember(), babel({ … }), kiranaEmber()]
|
|
9
|
-
*/
|
|
10
1
|
import kirana from "@kirana-style/vite";
|
|
2
|
+
//#region src/vite.ts
|
|
3
|
+
/**
|
|
4
|
+
* Kirana for Ember on Embroider and Vite (D-072). A `.gjs` or `.gts` file holds a `<template>`
|
|
5
|
+
* Kirana's parser does not read, so its Vite plugin runs after Embroider's instead and compiles the
|
|
6
|
+
* JavaScript Embroider emitted for each module, where `css()` calls and their imports are as written.
|
|
7
|
+
* Its transform takes those modules too, which a Vite plugin's filter would otherwise skip, and
|
|
8
|
+
* `@ember/`, `@glimmer/` and `@embroider/virtual/` — modules only Embroider resolves — are runtime values (`externals`).
|
|
9
|
+
*
|
|
10
|
+
* plugins: [classicEmberSupport(), ember(), babel({ … }), kiranaEmber()]
|
|
11
|
+
*/
|
|
11
12
|
/** Ember's template-tag modules, as Vite names them. */
|
|
12
|
-
|
|
13
|
+
const TEMPLATE_TAG = /\.g[jt]s(?:[?#]|$)/;
|
|
13
14
|
/** What Embroider resolves and Node.js cannot: Ember's own modules. */
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
15
|
+
const EMBER_EXTERNALS = [
|
|
16
|
+
"@ember/",
|
|
17
|
+
"@glimmer/",
|
|
18
|
+
"@embroider/virtual/"
|
|
19
|
+
];
|
|
20
|
+
function kiranaEmber(options = {}) {
|
|
21
|
+
const externals = [...options.config?.externals ?? [], ...EMBER_EXTERNALS];
|
|
22
|
+
const [main, late] = kirana({
|
|
23
|
+
...options,
|
|
24
|
+
config: {
|
|
25
|
+
...options.config,
|
|
26
|
+
externals
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const transform = main.transform;
|
|
30
|
+
return [{
|
|
31
|
+
...main,
|
|
32
|
+
enforce: "post",
|
|
33
|
+
transform: {
|
|
34
|
+
...transform,
|
|
35
|
+
filter: {
|
|
36
|
+
...transform.filter,
|
|
37
|
+
id: {
|
|
38
|
+
...transform.filter.id,
|
|
39
|
+
include: [transform.filter.id.include, TEMPLATE_TAG]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}, late];
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
//#endregion
|
|
46
|
+
export { EMBER_EXTERNALS, TEMPLATE_TAG, kiranaEmber as default, kiranaEmber };
|