@gjsify/lightningcss-native 0.4.43 → 0.5.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 ADDED
@@ -0,0 +1,37 @@
1
+ # @gjsify/lightningcss-native
2
+
3
+ A native Rust cdylib + Vala/GObject bridge that exposes the Rust `lightningcss` CSS transformer and minifier to GJS via `gi://`. Ships prebuilt `.so` + `.typelib` for Linux and is loaded lazily at runtime — the consuming package (`@gjsify/rolldown-plugin-gjsify`'s `cssAsStringPlugin`) falls back to the npm `lightningcss` package when the prebuild is unavailable.
4
+
5
+ Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ gjsify install @gjsify/lightningcss-native
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```typescript
16
+ import { hasNativeLightningcss, transform, bundle } from '@gjsify/lightningcss-native';
17
+
18
+ if (hasNativeLightningcss()) {
19
+ // Transform a CSS string with GTK4-compatible lowering
20
+ const result = transform({
21
+ filename: 'app.css',
22
+ code: 'a { color: oklch(50% 0.2 270); }',
23
+ targets: 'firefox >= 60',
24
+ minify: true,
25
+ });
26
+ console.log(new TextDecoder().decode(result.code));
27
+
28
+ // Bundle a CSS entry file (resolves @import chains)
29
+ const bundled = bundle({ filename: '/path/to/app.css', targets: 'firefox >= 60' });
30
+ }
31
+ ```
32
+
33
+ The native bridge is consumed automatically by `gjsify build --app gjs` via `@gjsify/rolldown-plugin-gjsify`. Direct use is only needed when calling the CSS pipeline outside of a gjsify build.
34
+
35
+ ## License
36
+
37
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/lightningcss-native",
3
- "version": "0.4.43",
3
+ "version": "0.5.0",
4
4
  "description": "Vala/GObject + Rust cdylib bridge to lightningcss for GJS. Replaces the Node-only npm `lightningcss` package: parse, transform, minify, and browserslist-target lowering of CSS without leaving a Node-free GJS process. Backs `@gjsify/rolldown-plugin-gjsify`'s cssAsStringPlugin under `--app gjs` so GTK4-CSS lowering (firefox60) works without a Node runtime in the build pipeline.",
5
5
  "type": "module",
6
6
  "main": "lib/esm/index.js",
@@ -50,9 +50,9 @@
50
50
  "@girs/gobject-2.0": "2.88.0-4.0.4"
51
51
  },
52
52
  "devDependencies": {
53
- "@gjsify/cli": "^0.4.43",
53
+ "@gjsify/cli": "^0.5.0",
54
54
  "@ts-for-gir/cli": "^4.0.4",
55
- "@types/node": "^25.9.1",
55
+ "@types/node": "^25.9.2",
56
56
  "typescript": "^6.0.3"
57
57
  },
58
58
  "author": "Pascal Garber <pascal@artandcode.studio>",