flexui-compiler 2.0.0-alpha.2 → 2.0.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 +69 -31
- package/checksums.json +6 -6
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,63 +1,101 @@
|
|
|
1
1
|
# flexui-compiler
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The FlexUI 2.0 compiler. It scans your markup and scripts, keeps only the
|
|
4
|
+
utilities you actually use, and writes one deterministic stylesheet.
|
|
5
|
+
|
|
6
|
+
The compiler is a native binary built in Go. This package finds the right
|
|
7
|
+
prebuilt binary for your machine, checks its SHA-256 against the bundled
|
|
8
|
+
manifest, and runs it. There is nothing to compile and no install script to
|
|
9
|
+
trust.
|
|
4
10
|
|
|
5
11
|
```bash
|
|
6
12
|
npm install --save-dev flexui-compiler
|
|
7
|
-
npx flexui
|
|
8
|
-
npx flexui
|
|
9
|
-
|
|
10
|
-
The installed command is `flexui`, so `npx flexui-compiler` and a local
|
|
11
|
-
`node_modules/.bin/flexui` both work.
|
|
13
|
+
npx flexui init
|
|
14
|
+
npx flexui build --minify
|
|
12
15
|
```
|
|
13
16
|
|
|
14
|
-
The
|
|
15
|
-
|
|
16
|
-
on your machine and no install script is required.
|
|
17
|
+
The installed command is `flexui`, so `npx flexui` and
|
|
18
|
+
`node_modules/.bin/flexui` both work.
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## Commands
|
|
19
21
|
|
|
20
|
-
|
|
|
22
|
+
| Command | What it does |
|
|
21
23
|
| --- | --- |
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
24
|
+
| `flexui init` | Write `flexui.config.json` and an entry stylesheet. |
|
|
25
|
+
| `flexui build` | Compile the project once and write the stylesheet. |
|
|
26
|
+
| `flexui watch` | Recompile when source files change. |
|
|
27
|
+
| `flexui inspect` | Print the rules a build would emit, without writing a file. |
|
|
28
|
+
| `flexui clean` | Remove the build cache and generated output. |
|
|
29
|
+
| `flexui version` | Print the compiler version. |
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
Flags: `--minify`, `--watch`, `--config <path>`, `--input <path>`,
|
|
32
|
+
`--output <path>`, `--content <glob>`, `--safelist <classes>`,
|
|
33
|
+
`--no-cache`, `--verbose`.
|
|
31
34
|
|
|
32
|
-
##
|
|
35
|
+
## Configuration
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
`flexui init` creates `flexui.config.json`:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"content": ["src/**/*.{html,jsx,tsx,vue,svelte,astro,md}"],
|
|
42
|
+
"input": "src/styles.css",
|
|
43
|
+
"output": "dist/flexui.css",
|
|
44
|
+
"theme": { "colors": { "brand": "#4f46e5" } }
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Themes, components, animations, variants and the content globs all live in this
|
|
49
|
+
file; the [project documentation](https://github.com/Ahaduzzamankhan/flexui#readme)
|
|
50
|
+
walks through each block.
|
|
51
|
+
|
|
52
|
+
## TypeScript API
|
|
36
53
|
|
|
37
54
|
```ts
|
|
38
55
|
import { build, inspect, version } from "flexui-compiler";
|
|
39
56
|
|
|
40
|
-
await build({ minify: true,
|
|
41
|
-
const result = await inspect(
|
|
57
|
+
await build({ minify: true, output: "dist/flexui.css" });
|
|
58
|
+
const result = await inspect();
|
|
42
59
|
console.log(result.stdout);
|
|
60
|
+
console.log(await version());
|
|
43
61
|
```
|
|
44
62
|
|
|
45
63
|
| Export | Purpose |
|
|
46
64
|
| --- | --- |
|
|
47
65
|
| `build(options)` | Compile the project and write the stylesheet. |
|
|
48
66
|
| `watch(options)` | Start watch mode. |
|
|
49
|
-
| `inspect(options)` |
|
|
67
|
+
| `inspect(options)` | Return the resolved rules. |
|
|
50
68
|
| `version(options)` | Read the compiler version. |
|
|
51
69
|
| `run(args, options)` | Run the compiler with arbitrary arguments, capturing output. |
|
|
52
|
-
| `runInherit(args, options)` | Run with inherited stdio
|
|
70
|
+
| `runInherit(args, options)` | Run with inherited stdio and return the exit code. |
|
|
53
71
|
| `resolveBinary()` | Path and verification state of the resolved binary. |
|
|
54
72
|
| `optArgs(options)` | Map options to compiler flags. |
|
|
55
73
|
|
|
56
74
|
`RunOptions` covers `cwd`, `root`, `config`, `input`, `output`, `content`,
|
|
57
|
-
`safelist`, `minify`, `verbose`, `noCache` and `env`.
|
|
58
|
-
`FlexUIError`
|
|
75
|
+
`safelist`, `minify`, `verbose`, `noCache` and `env`. A failed build rejects with
|
|
76
|
+
a `FlexUIError` that carries `exitCode`, `stdout` and `stderr`.
|
|
77
|
+
|
|
78
|
+
## Platform packages
|
|
79
|
+
|
|
80
|
+
The binary arrives through an optional dependency that matches your operating
|
|
81
|
+
system and CPU:
|
|
82
|
+
|
|
83
|
+
| Platform | Package |
|
|
84
|
+
| --- | --- |
|
|
85
|
+
| Windows x64 | `flexui-cli-windows-x64` |
|
|
86
|
+
| Windows ARM64 | `flexui-cli-windows-arm64` |
|
|
87
|
+
| Linux x64 | `flexui-cli-linux-x64` |
|
|
88
|
+
| Linux ARM64 | `flexui-cli-linux-arm64` |
|
|
89
|
+
| macOS x64 | `flexui-cli-darwin-x64` |
|
|
90
|
+
| macOS ARM64 | `flexui-cli-darwin-arm64` |
|
|
91
|
+
|
|
92
|
+
`FLEXUI_BINARY` points the wrapper at any `flexui` executable when you keep the
|
|
93
|
+
compiler somewhere else, for example a system-wide install or a CI cache.
|
|
94
|
+
|
|
95
|
+
## Requirements
|
|
96
|
+
|
|
97
|
+
Node.js 18 or newer, or Bun. The package has no runtime dependencies.
|
|
59
98
|
|
|
60
|
-
##
|
|
99
|
+
## License
|
|
61
100
|
|
|
62
|
-
|
|
63
|
-
development-only.
|
|
101
|
+
MIT
|
package/checksums.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"win32-x64": { "file": "flexui.exe", "sha256": "
|
|
3
|
-
"win32-arm64": { "file": "flexui.exe", "sha256": "
|
|
4
|
-
"linux-x64": { "file": "flexui", "sha256": "
|
|
5
|
-
"linux-arm64": { "file": "flexui", "sha256": "
|
|
6
|
-
"darwin-x64": { "file": "flexui", "sha256": "
|
|
7
|
-
"darwin-arm64": { "file": "flexui", "sha256": "
|
|
2
|
+
"win32-x64": { "file": "flexui.exe", "sha256": "975f4209cdc59aec43ed79661c5a9326db413b43668c57bb557f25b40bb3fd33", "version": "2.0.0" },
|
|
3
|
+
"win32-arm64": { "file": "flexui.exe", "sha256": "a90f6b6c0d82466e773a46c7795f4fa12247551631aa5cb14dde674772eda813", "version": "2.0.0" },
|
|
4
|
+
"linux-x64": { "file": "flexui", "sha256": "23731b18a08417479244917938e41c82d9d1b713bc337b2f2c408e85cd197780", "version": "2.0.0" },
|
|
5
|
+
"linux-arm64": { "file": "flexui", "sha256": "f6315aa926c7cf978e6008bf1d5d2075eec65f95345ee82addd8127da3209618", "version": "2.0.0" },
|
|
6
|
+
"darwin-x64": { "file": "flexui", "sha256": "e9ec2941f241bb8dcfaab5951bccb4e7c11ef29f62e98d8e2a76f23611d0a1b1", "version": "2.0.0" },
|
|
7
|
+
"darwin-arm64": { "file": "flexui", "sha256": "55130cf10759544ee3a1bf08ae899c678d10a04a1416d1bc88783e54ec574790", "version": "2.0.0" }
|
|
8
8
|
}
|
package/dist/cli.d.ts
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
/** Bin entry point for the `flexui` command (package
|
|
3
|
+
/** Bin entry point for the `flexui` command (package `flexui-compiler`). */
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
const index_1 = require("./index");
|
|
6
6
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flexui-compiler",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "FlexUI 2.0 - a utility-first CSS compiler written in Go, distributed as precompiled native binaries",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/Ahaduzzamankhan/flexui",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"prepare": "tsc -p tsconfig.json"
|
|
42
42
|
},
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"flexui-cli-windows-x64": "2.0.0
|
|
45
|
-
"flexui-cli-windows-arm64": "2.0.0
|
|
46
|
-
"flexui-cli-linux-x64": "2.0.0
|
|
47
|
-
"flexui-cli-linux-arm64": "2.0.0
|
|
48
|
-
"flexui-cli-darwin-x64": "2.0.0
|
|
49
|
-
"flexui-cli-darwin-arm64": "2.0.0
|
|
44
|
+
"flexui-cli-windows-x64": "2.0.0",
|
|
45
|
+
"flexui-cli-windows-arm64": "2.0.0",
|
|
46
|
+
"flexui-cli-linux-x64": "2.0.0",
|
|
47
|
+
"flexui-cli-linux-arm64": "2.0.0",
|
|
48
|
+
"flexui-cli-darwin-x64": "2.0.0",
|
|
49
|
+
"flexui-cli-darwin-arm64": "2.0.0"
|
|
50
50
|
}
|
|
51
51
|
}
|