flexui-compiler 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 CHANGED
@@ -1,63 +1,101 @@
1
1
  # flexui-compiler
2
2
 
3
- npm wrapper for the FlexUI 2.0 compiler.
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-compiler init
8
- npx flexui-compiler build --minify
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 compiler itself is a Go binary. This package resolves the right precompiled
15
- binary for your platform, verifies its checksum and runs it. Nothing is compiled
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
- ## Platform packages
20
+ ## Commands
19
21
 
20
- | Platform | Package |
22
+ | Command | What it does |
21
23
  | --- | --- |
22
- | Windows x64 | `flexui-cli-win32-x64` |
23
- | Windows ARM64 | `flexui-cli-win32-arm64` |
24
- | Linux x64 | `flexui-cli-linux-x64` |
25
- | Linux ARM64 | `flexui-cli-linux-arm64` |
26
- | macOS x64 | `flexui-cli-darwin-x64` |
27
- | macOS ARM64 | `flexui-cli-darwin-arm64` |
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
- If optional dependencies are disabled, install the platform package directly or
30
- set `FLEXUI_BINARY` to a `flexui` executable.
31
+ Flags: `--minify`, `--watch`, `--config <path>`, `--input <path>`,
32
+ `--output <path>`, `--content <glob>`, `--safelist <classes>`,
33
+ `--no-cache`, `--verbose`.
31
34
 
32
- ## TypeScript API
35
+ ## Configuration
33
36
 
34
- The wrapper is written in TypeScript. Sources live in `src/`, compiled output in
35
- `dist/` (generated by `tsc`; `npm install` builds it through `prepare`).
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, cwd: process.cwd(), output: "dist/flexui.css" });
41
- const result = await inspect({ cwd: process.cwd() });
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)` | Print resolved rules. |
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; returns the exit code. |
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`. Failed builds reject with a
58
- `FlexUIError` carrying `exitCode`, `stdout` and `stderr`.
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
- ## Zero runtime dependencies
99
+ ## License
61
100
 
62
- The published package has no `dependencies`. TypeScript and `@types/node` are
63
- development-only.
101
+ MIT
package/checksums.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "win32-x64": { "file": "flexui.exe", "sha256": "05050bfe06a8e9aeef874329e87312ad8de4f6d9deee44da8c6d692ee24938cf", "version": "2.0.0-alpha.1" },
3
- "win32-arm64": { "file": "flexui.exe", "sha256": "8937d448d2cfff7188a92023f6ea7810e9f579a79bde56fbcc523d1b0b65876c", "version": "2.0.0-alpha.1" },
4
- "linux-x64": { "file": "flexui", "sha256": "056408d5c6510711affeedad008b1d6410e444d16ee44252652c2256181fe249", "version": "2.0.0-alpha.1" },
5
- "linux-arm64": { "file": "flexui", "sha256": "cfa476aad7d118efeb1e0c20f578be9aa0b324499ca910f9f689374af2c4668f", "version": "2.0.0-alpha.1" },
6
- "darwin-x64": { "file": "flexui", "sha256": "325f86aee0dd7d957706b514f216df1d5801108eef3543cc475bd9aaf4374c95", "version": "2.0.0-alpha.1" },
7
- "darwin-arm64": { "file": "flexui", "sha256": "54c01aac001f7a1b80f0846198e3102fd8ba20b2eb875caeb307f5b44bf89d07", "version": "2.0.0-alpha.1" }
2
+ "win32-x64": { "file": "flexui.exe", "sha256": "50e80181832065a945bf00c0c4ccc8d009d227c9affd038ade4402d1833d6e69", "version": "2.0.0-alpha.3" },
3
+ "win32-arm64": { "file": "flexui.exe", "sha256": "b55d59d4eb0daa468e304d03c5299fff9d263222ec10da561bd10562b396aff0", "version": "2.0.0-alpha.3" },
4
+ "linux-x64": { "file": "flexui", "sha256": "9c9ba43e6953712949830de80735a3c0c9e73befcfe1f222bcb510d679303acd", "version": "2.0.0-alpha.3" },
5
+ "linux-arm64": { "file": "flexui", "sha256": "bd85b53915725cb27adc7df3629668acb5c9c49637574b6f3a8f6326f92e19b6", "version": "2.0.0-alpha.3" },
6
+ "darwin-x64": { "file": "flexui", "sha256": "f86e5631866027313685d0deb459726ffd99ab9635305986e6c9e8b2b8155549", "version": "2.0.0-alpha.3" },
7
+ "darwin-arm64": { "file": "flexui", "sha256": "bf39a07188d0065f3c83858b12ca77b60095143b7c41c661871c084e8a63248e", "version": "2.0.0-alpha.3" }
8
8
  }
package/dist/binary.js CHANGED
@@ -19,8 +19,8 @@ const node_crypto_1 = require("node:crypto");
19
19
  const node_fs_1 = require("node:fs");
20
20
  const node_path_1 = require("node:path");
21
21
  exports.PLATFORMS = {
22
- "win32-x64": { pkg: "flexui-cli-win32-x64", binary: "flexui.exe" },
23
- "win32-arm64": { pkg: "flexui-cli-win32-arm64", binary: "flexui.exe" },
22
+ "win32-x64": { pkg: "flexui-cli-windows-x64", binary: "flexui.exe" },
23
+ "win32-arm64": { pkg: "flexui-cli-windows-arm64", binary: "flexui.exe" },
24
24
  "linux-x64": { pkg: "flexui-cli-linux-x64", binary: "flexui" },
25
25
  "linux-arm64": { pkg: "flexui-cli-linux-arm64", binary: "flexui" },
26
26
  "darwin-x64": { pkg: "flexui-cli-darwin-x64", binary: "flexui" },
package/dist/cli.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- /** Bin entry point for the `flexui` command (package `@flexui/cli`). */
2
+ /** Bin entry point for the `flexui` command (package `flexui-compiler`). */
3
3
  export {};
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 `@flexui/cli`). */
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-alpha.1",
3
+ "version": "2.0.0-alpha.3",
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-win32-x64": "2.0.0-alpha.1",
45
- "flexui-cli-win32-arm64": "2.0.0-alpha.1",
46
- "flexui-cli-linux-x64": "2.0.0-alpha.1",
47
- "flexui-cli-linux-arm64": "2.0.0-alpha.1",
48
- "flexui-cli-darwin-x64": "2.0.0-alpha.1",
49
- "flexui-cli-darwin-arm64": "2.0.0-alpha.1"
44
+ "flexui-cli-windows-x64": "2.0.0-alpha.3",
45
+ "flexui-cli-windows-arm64": "2.0.0-alpha.3",
46
+ "flexui-cli-linux-x64": "2.0.0-alpha.3",
47
+ "flexui-cli-linux-arm64": "2.0.0-alpha.3",
48
+ "flexui-cli-darwin-x64": "2.0.0-alpha.3",
49
+ "flexui-cli-darwin-arm64": "2.0.0-alpha.3"
50
50
  }
51
51
  }