@gjsify/oxfmt-native 0.24.1 → 0.24.2
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 +25 -0
- package/meson.build +9 -1
- package/package.json +2 -2
- package/prebuilds/darwin-arm64/libgjsify_oxfmt.dylib +0 -0
- package/prebuilds/darwin-arm64/libgjsifyoxfmt.dylib +0 -0
- package/prebuilds/linux-arm64/libgjsify_oxfmt.so +0 -0
- package/prebuilds/linux-x64/libgjsify_oxfmt.so +0 -0
- package/src/rust/Cargo.lock +1650 -0
package/README.md
CHANGED
|
@@ -40,6 +40,31 @@ git submodule update --init refs/oxc
|
|
|
40
40
|
gjsify workspace @gjsify/oxfmt-native build:prebuilds # needs meson + vala + cargo
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
+
### Dependency lock
|
|
44
|
+
|
|
45
|
+
`src/rust/Cargo.lock` is **committed**. It pins the crates.io half of the graph the way
|
|
46
|
+
[`scripts/check-refs-pin.mjs`](../../../scripts/check-refs-pin.mjs) pins the `refs/` half, so the
|
|
47
|
+
prebuild in this repository can be re-linked against the exact transitive set it was built from.
|
|
48
|
+
CI builds with `--locked` (`${CI:+--locked}` on the `cargo build` in `meson.build`; every CI leg
|
|
49
|
+
runs with `CI=true`), so a lock that no longer satisfies `Cargo.toml` fails the run instead of
|
|
50
|
+
being silently rewritten. Local builds are unlocked, so editing `Cargo.toml` still just works —
|
|
51
|
+
commit the resulting lock diff with the change.
|
|
52
|
+
|
|
53
|
+
Updating a dependency is a deliberate act:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cd packages/infra/oxfmt-native/src/rust
|
|
57
|
+
cargo update -p <crate> # or plain `cargo update` for the whole registry side
|
|
58
|
+
cargo tree -d # no crate may appear as BOTH a path and a registry entry
|
|
59
|
+
cd -
|
|
60
|
+
gjsify workspace @gjsify/oxfmt-native build:prebuilds
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `cargo tree -d` step is not optional here: `refs/oxc` publishes `oxc_allocator` to crates.io
|
|
64
|
+
*and* path-deps it in-tree, so the `[patch.crates-io]` table in `src/rust/Cargo.toml` is what keeps
|
|
65
|
+
the graph to a single crate identity. Bumping `refs/oxc` moves the path crates' own versions and
|
|
66
|
+
therefore invalidates the lock — regenerate it in the same commit as the submodule pin.
|
|
67
|
+
|
|
43
68
|
## Platform coverage
|
|
44
69
|
|
|
45
70
|
| Platform | Prebuild | Built by |
|
package/meson.build
CHANGED
|
@@ -70,16 +70,24 @@ cargo = find_program('cargo')
|
|
|
70
70
|
|
|
71
71
|
rust_sources = files(
|
|
72
72
|
'src/rust/Cargo.toml',
|
|
73
|
+
'src/rust/Cargo.lock',
|
|
73
74
|
'src/rust/src/lib.rs',
|
|
74
75
|
)
|
|
75
76
|
|
|
76
77
|
rust_target_dir = meson.current_build_dir() / 'cargo-target'
|
|
77
78
|
|
|
79
|
+
# `${CI:+--locked}` — on a CI runner (GitHub Actions always exports CI=true) the
|
|
80
|
+
# committed src/rust/Cargo.lock is ENFORCED: cargo fails loudly instead of
|
|
81
|
+
# re-resolving the registry and rewriting the lock, so a lock that no longer
|
|
82
|
+
# satisfies Cargo.toml (or a refs/oxc bump that moved a path crate's version)
|
|
83
|
+
# reds the run rather than silently shipping a differently-linked prebuild.
|
|
84
|
+
# Locally the flag expands to nothing, so editing Cargo.toml still just works —
|
|
85
|
+
# commit the resulting lock diff together with the change.
|
|
78
86
|
rust_cdylib = custom_target('gjsify-oxfmt-rust',
|
|
79
87
|
input: rust_sources,
|
|
80
88
|
output: rust_cdylib_name,
|
|
81
89
|
command: ['sh', '-c',
|
|
82
|
-
'cargo build --release --manifest-path "$1" --target-dir "$2" && cp "$2/release/'
|
|
90
|
+
'cargo build --release ${CI:+--locked} --manifest-path "$1" --target-dir "$2" && cp "$2/release/'
|
|
83
91
|
+ rust_cdylib_name + '" "$3"' + rust_cdylib_post,
|
|
84
92
|
'sh',
|
|
85
93
|
meson.current_source_dir() / 'src/rust/Cargo.toml',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/oxfmt-native",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.2",
|
|
4
4
|
"description": "Vala/GObject + Rust cdylib bridge to oxc's formatter (oxfmt) for GJS. Formats JavaScript/TypeScript/JSX under GJS without a Node runtime — the Node-free counterpart to the npm `oxfmt` native napi binary, backing `gjsify format` under GJS. Wraps oxc_formatter (Prettier-compatible) via a single-shot FFI; the embedded CSS/HTML/Markdown ExternalFormatter (Prettier-NAPI) is out of scope.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/esm/index.js",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@girs/gobject-2.0": "^4.1.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@gjsify/cli": "^0.24.
|
|
65
|
+
"@gjsify/cli": "^0.24.2",
|
|
66
66
|
"@types/node": "^25.9.2",
|
|
67
67
|
"typescript": "^6.0.3"
|
|
68
68
|
},
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|