@gjsify/lightningcss-wasm 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.
Files changed (2) hide show
  1. package/README.md +34 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @gjsify/lightningcss-wasm
2
+
3
+ A WebAssembly build of the `lightningcss` CSS transformer for GJS — the portable fallback to `@gjsify/lightningcss-native` for platforms where a prebuilt `.so` is unavailable. Loads the `.wasm` via `@gjsify/fs`, uses SpiderMonkey 140's synchronous `WebAssembly.Module`/`Instance` constructors, and seeds randomness from `globalThis.crypto`.
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-wasm
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```javascript
16
+ import { transform, bundle, bundleAsync } from '@gjsify/lightningcss-wasm';
17
+
18
+ // Transform a CSS source string
19
+ const result = transform({
20
+ filename: 'app.css',
21
+ code: Buffer.from('a { color: red; }'),
22
+ minify: true,
23
+ });
24
+ console.log(Buffer.from(result.code).toString());
25
+
26
+ // Bundle a CSS entry file (resolves @import chains via the filesystem)
27
+ const bundled = await bundleAsync({ filename: '/path/to/app.css' });
28
+ ```
29
+
30
+ The API mirrors the npm `lightningcss-wasm` package. `@gjsify/rolldown-plugin-gjsify`'s `cssAsStringPlugin` selects between the native bridge and this WASM fallback automatically.
31
+
32
+ ## License
33
+
34
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/lightningcss-wasm",
3
- "version": "0.4.43",
3
+ "version": "0.5.0",
4
4
  "description": "Phase D-2 POC: GJS-compatible loader for the lightningcss WASM bundle. Re-exports the `lightningcss-wasm` npm package's transform/bundle/bundleAsync API on top of SpiderMonkey 140's synchronous `new WebAssembly.Module/Instance` constructors. Reads the .wasm via @gjsify/fs (or Node's native fs), resolves randomness via globalThis.crypto. No WASI, no SharedArrayBuffer — single-shot CSS pipeline. Intended as the WASM-track counterpart to `@gjsify/lightningcss-native`; the better of the two wins the slot in `@gjsify/rolldown-plugin-gjsify`'s cssAsStringPlugin (see Phase D-2 decision matrix).",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
@@ -29,8 +29,8 @@
29
29
  "napi-wasm"
30
30
  ],
31
31
  "dependencies": {
32
- "@gjsify/fs": "^0.4.43",
33
- "@gjsify/webcrypto": "^0.4.43"
32
+ "@gjsify/fs": "^0.5.0",
33
+ "@gjsify/webcrypto": "^0.5.0"
34
34
  },
35
35
  "author": "Pascal Garber <pascal@artandcode.studio>",
36
36
  "license": "MIT",