flexui-vite 2.0.0-alpha.1 → 2.0.0-alpha.3
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 +62 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +38 -37
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# flexui-vite
|
|
2
|
+
|
|
3
|
+
The Vite plugin for FlexUI. It runs the same compiler binary as the CLI, so a
|
|
4
|
+
Vite project and a plain CLI project produce byte-identical stylesheets. During
|
|
5
|
+
`vite build` the stylesheet is compiled before the bundle is written; during
|
|
6
|
+
`vite dev` the plugin starts `flexui watch` and forwards compiler errors to the
|
|
7
|
+
Vite logger with file and line information.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev flexui-compiler flexui-vite
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
// vite.config.ts
|
|
17
|
+
import { defineConfig } from "vite";
|
|
18
|
+
import { flexui } from "flexui-vite";
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [flexui({ minify: true })],
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The plugin resolves the compiler through `flexui-compiler`, so the same platform
|
|
26
|
+
packages and checksum verification apply.
|
|
27
|
+
|
|
28
|
+
## Options
|
|
29
|
+
|
|
30
|
+
| Option | Type | Default | Purpose |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| `minify` | `boolean` | `false` | Minify the generated stylesheet. |
|
|
33
|
+
| `input` | `string` | config value | Entry stylesheet. |
|
|
34
|
+
| `output` | `string` | config value | Output stylesheet path. |
|
|
35
|
+
| `content` | `string[]` | config value | Override the content globs. |
|
|
36
|
+
| `safelist` | `string[]` | config value | Classes that are always emitted. |
|
|
37
|
+
| `config` | `string` | `flexui.config.json` | Path to the configuration file. |
|
|
38
|
+
| `command` | `string` | resolved | Use a specific compiler binary. |
|
|
39
|
+
| `watch` | `boolean` | `true` in dev | Recompile while the dev server runs. |
|
|
40
|
+
|
|
41
|
+
## How it works
|
|
42
|
+
|
|
43
|
+
- **Dev** — the plugin spawns `flexui watch` once, keeps it running with the dev
|
|
44
|
+
server, and sends `error` events so Vite overlays show compiler failures.
|
|
45
|
+
- **Build** — the plugin compiles once in `buildStart`, before Vite reads the
|
|
46
|
+
stylesheet, so the bundle always contains the latest output.
|
|
47
|
+
- **Errors** — stderr is captured and formatted with the failing arguments, so a
|
|
48
|
+
broken class or config points at a line instead of a silent empty file.
|
|
49
|
+
|
|
50
|
+
## Programmatic helpers
|
|
51
|
+
|
|
52
|
+
`resolveCommand`, `compilerArgs` and `formatFailure` are exported for build tools
|
|
53
|
+
that want the same behaviour without the plugin itself.
|
|
54
|
+
|
|
55
|
+
## Documentation
|
|
56
|
+
|
|
57
|
+
See [docs/integrations.md](https://github.com/Ahaduzzamankhan/flexui/blob/main/docs/integrations.md)
|
|
58
|
+
and the [FlexUI repository](https://github.com/Ahaduzzamankhan/flexui#readme).
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare function formatFailure(args: readonly string[], stderr: string):
|
|
|
76
76
|
* ```ts
|
|
77
77
|
* // vite.config.ts
|
|
78
78
|
* import { defineConfig } from "vite";
|
|
79
|
-
* import { flexui } from "
|
|
79
|
+
* import { flexui } from "flexui-vite";
|
|
80
80
|
*
|
|
81
81
|
* export default defineConfig({ plugins: [flexui({ minify: true })] });
|
|
82
82
|
* ```
|
package/dist/index.js
CHANGED
|
@@ -99,7 +99,7 @@ function startWatcher(command, args, cwd, report) {
|
|
|
99
99
|
* ```ts
|
|
100
100
|
* // vite.config.ts
|
|
101
101
|
* import { defineConfig } from "vite";
|
|
102
|
-
* import { flexui } from "
|
|
102
|
+
* import { flexui } from "flexui-vite";
|
|
103
103
|
*
|
|
104
104
|
* export default defineConfig({ plugins: [flexui({ minify: true })] });
|
|
105
105
|
* ```
|
package/package.json
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "flexui-vite",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
4
|
-
"description": "Vite plugin that compiles FlexUI stylesheets for dev and build",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"default": "./dist/index.js"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"files": [
|
|
17
|
-
"dist"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "flexui-vite",
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
|
+
"description": "Vite plugin that compiles FlexUI stylesheets for dev and build",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"test": "bun test test"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"vite": ">=5.0.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependenciesMeta": {
|
|
29
|
+
"vite": {
|
|
30
|
+
"optional": true
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"flexui",
|
|
35
|
+
"vite-plugin",
|
|
36
|
+
"css"
|
|
37
|
+
]
|
|
38
|
+
}
|