@sugarcube-org/vite 0.0.0-alpha.13 → 0.0.0-alpha.15
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 +15 -3
- package/dist/index.d.mts +10 -7
- package/package.json +3 -6
package/README.md
CHANGED
|
@@ -6,8 +6,20 @@
|
|
|
6
6
|
<a href="https://github.com/sugarcube-org/sugarcube/blob/main/LICENSE.md"><img src="https://img.shields.io/badge/license-see%20LICENSE-blue" alt="License"></a>
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
> **Alpha** — This project is in early development.
|
|
10
|
-
|
|
11
9
|
Vite plugin for [sugarcube](https://sugarcube.sh).
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
Automatically regenerates CSS variables and utilities when your design tokens change during development.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -D @sugarcube-org/vite
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
For full documentation, visit [sugarcube.sh](https://sugarcube.sh).
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
See [LICENSE.md](./LICENSE.md) for terms.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { InternalConfig } from '@sugarcube-org/core';
|
|
1
|
+
import { InternalConfig, NormalizedConvertedTokens } from '@sugarcube-org/core';
|
|
2
2
|
export { SugarcubeConfig } from '@sugarcube-org/core';
|
|
3
|
-
import {
|
|
3
|
+
import { ViteDevServer, Logger, Plugin } from 'vite';
|
|
4
4
|
|
|
5
|
+
/** CSS object for UnoCSS rules - matches @unocss/core CSSObject */
|
|
6
|
+
type CSSObject = Record<string, string | number | undefined>;
|
|
7
|
+
/** UnoCSS dynamic rule: [pattern, handler] */
|
|
8
|
+
type UnoRule = [RegExp, (match: RegExpMatchArray) => CSSObject];
|
|
5
9
|
interface SugarcubePluginContext {
|
|
6
10
|
ready: Promise<void>;
|
|
7
11
|
config: InternalConfig | null;
|
|
8
|
-
tokens:
|
|
9
|
-
/** Get all generated CSS variables */
|
|
12
|
+
tokens: NormalizedConvertedTokens | null;
|
|
10
13
|
getCSS: () => string;
|
|
11
14
|
reloadConfig: () => Promise<void>;
|
|
12
15
|
reloadTokens: () => Promise<void>;
|
|
13
|
-
getRules: () =>
|
|
16
|
+
getRules: () => UnoRule[];
|
|
14
17
|
getTokenDirs: () => string[];
|
|
15
18
|
invalidate: (server: ViteDevServer) => void;
|
|
16
19
|
onReload: (fn: () => void) => void;
|
|
17
|
-
tasks: Promise<
|
|
18
|
-
flushTasks: () => Promise<
|
|
20
|
+
tasks: Promise<void>[];
|
|
21
|
+
flushTasks: () => Promise<void>;
|
|
19
22
|
setLogger: (logger: Logger) => void;
|
|
20
23
|
}
|
|
21
24
|
interface SugarcubePluginOptions<T = any> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarcube-org/vite",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -35,17 +35,14 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@sugarcube-org/core": "0.0.1-alpha.
|
|
39
|
-
"@
|
|
40
|
-
"@unocss/vite": "66.5.2",
|
|
41
|
-
"fast-glob": "3.3.3"
|
|
38
|
+
"@sugarcube-org/core": "0.0.1-alpha.17",
|
|
39
|
+
"@unocss/vite": "66.5.2"
|
|
42
40
|
},
|
|
43
41
|
"peerDependencies": {
|
|
44
42
|
"vite": "^5.2.0 || ^6 || ^7"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
45
|
"pkgroll": "2.5.1",
|
|
48
|
-
"tsx": "4.19.2",
|
|
49
46
|
"vite": "5.2.0"
|
|
50
47
|
},
|
|
51
48
|
"scripts": {
|