@gjsify/oxfmt-native 0.23.0 → 0.24.1

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
@@ -44,8 +44,8 @@ gjsify workspace @gjsify/oxfmt-native build:prebuilds # needs meson + vala + c
44
44
 
45
45
  | Platform | Prebuild | Built by |
46
46
  |---|---|---|
47
- | `linux-x86_64` | ✅ `.so` + `.gir` + `.typelib` | native runner |
48
- | `linux-aarch64` | ✅ | native runner |
47
+ | `linux-x64` | ✅ `.so` + `.gir` + `.typelib` | native runner |
48
+ | `linux-arm64` | ✅ | native runner |
49
49
  | `linux-ppc64`, `linux-s390x`, `linux-riscv64` | ❌ | not built — the `refs/oxc` crate graph is too slow under QEMU |
50
50
  | `darwin-arm64` (macOS, Apple silicon) | ✅ `.dylib` + `.gir` + `.typelib` | `macos-latest` runner |
51
51
  | `darwin-x64` (macOS, Intel) | ❌ | — no runner leg yet |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/oxfmt-native",
3
- "version": "0.23.0",
3
+ "version": "0.24.1",
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",
@@ -21,8 +21,8 @@
21
21
  ],
22
22
  "gjsify": {
23
23
  "platforms": [
24
- "linux-x86_64",
25
- "linux-aarch64",
24
+ "linux-x64",
25
+ "linux-arm64",
26
26
  "darwin-arm64"
27
27
  ],
28
28
  "prebuilds": "prebuilds",
@@ -62,7 +62,7 @@
62
62
  "@girs/gobject-2.0": "^4.1.0"
63
63
  },
64
64
  "devDependencies": {
65
- "@gjsify/cli": "^0.23.0",
65
+ "@gjsify/cli": "^0.24.1",
66
66
  "@types/node": "^25.9.2",
67
67
  "typescript": "^6.0.3"
68
68
  },
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0"?>
2
+ <!-- GjsifyOxfmt-1.0.gir generated by valac 0.56.19, do not modify. -->
3
+ <repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
4
+ <include name="GObject" version="2.0"/>
5
+ <include name="GLib" version="2.0"/>
6
+ <package name="gjsifyoxfmt"/>
7
+ <c:include name="gjsify-oxfmt-glue.h"/>
8
+ <c:include name="gjsifyoxfmt.h"/>
9
+ <doc:format name="unknown"/>
10
+ <namespace name="GjsifyOxfmt" version="1.0" shared-library="libgjsifyoxfmt.dylib" c:prefix="GjsifyOxfmt" c:identifier-prefixes="GjsifyOxfmt" c:symbol-prefixes="gjsify_oxfmt">
11
+ <class name="Formatter" c:type="GjsifyOxfmtFormatter" c:symbol-prefix="formatter" glib:type-name="GjsifyOxfmtFormatter" glib:get-type="gjsify_oxfmt_formatter_get_type" glib:type-struct="FormatterClass" parent="GObject.Object">
12
+ <field name="parent_instance" readable="0" private="1">
13
+ <type name="GObject.Object" c:type="GObject"/>
14
+ </field>
15
+ <field name="priv" readable="0" private="1">
16
+ <type name="FormatterPrivate" c:type="GjsifyOxfmtFormatterPrivate*"/>
17
+ </field>
18
+ <method name="format" c:identifier="gjsify_oxfmt_formatter_format" throws="1">
19
+ <return-value transfer-ownership="full">
20
+ <type name="GLib.Bytes" c:type="GBytes*"/>
21
+ </return-value>
22
+ <parameters>
23
+ <instance-parameter name="self" transfer-ownership="none">
24
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
25
+ </instance-parameter>
26
+ <parameter name="filename" transfer-ownership="none" nullable="1">
27
+ <type name="utf8" c:type="const gchar*"/>
28
+ </parameter>
29
+ <parameter name="code" transfer-ownership="none">
30
+ <type name="GLib.Bytes" c:type="GBytes*"/>
31
+ </parameter>
32
+ </parameters>
33
+ </method>
34
+ <method name="run" c:identifier="gjsify_oxfmt_formatter_run">
35
+ <return-value transfer-ownership="full">
36
+ <type name="gint" c:type="gint"/>
37
+ </return-value>
38
+ <parameters>
39
+ <instance-parameter name="self" transfer-ownership="none">
40
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
41
+ </instance-parameter>
42
+ <parameter name="args" transfer-ownership="none">
43
+ <array length="1" c:type="gchar**">
44
+ <type name="utf8" c:type="gchar*"/>
45
+ </array>
46
+ </parameter>
47
+ <parameter name="args_length1" transfer-ownership="none">
48
+ <type name="gint" c:type="gint"/>
49
+ </parameter>
50
+ </parameters>
51
+ </method>
52
+ <constructor name="new" c:identifier="gjsify_oxfmt_formatter_new">
53
+ <return-value transfer-ownership="full">
54
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
55
+ </return-value>
56
+ </constructor>
57
+ </class>
58
+ <record name="FormatterClass" c:type="GjsifyOxfmtFormatterClass" glib:is-gtype-struct-for="Formatter">
59
+ <field name="parent_class" readable="0" private="1">
60
+ <type name="GObject.ObjectClass" c:type="GObjectClass"/>
61
+ </field>
62
+ </record>
63
+ <record name="FormatterPrivate" c:type="GjsifyOxfmtFormatterPrivate" disguised="1"/>
64
+ </namespace>
65
+ </repository>
@@ -0,0 +1,65 @@
1
+ <?xml version="1.0"?>
2
+ <!-- GjsifyOxfmt-1.0.gir generated by valac 0.56.19, do not modify. -->
3
+ <repository version="1.2" xmlns="http://www.gtk.org/introspection/core/1.0" xmlns:c="http://www.gtk.org/introspection/c/1.0" xmlns:doc="http://www.gtk.org/introspection/doc/1.0" xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
4
+ <include name="GObject" version="2.0"/>
5
+ <include name="GLib" version="2.0"/>
6
+ <package name="gjsifyoxfmt"/>
7
+ <c:include name="gjsify-oxfmt-glue.h"/>
8
+ <c:include name="gjsifyoxfmt.h"/>
9
+ <doc:format name="unknown"/>
10
+ <namespace name="GjsifyOxfmt" version="1.0" shared-library="libgjsifyoxfmt.so" c:prefix="GjsifyOxfmt" c:identifier-prefixes="GjsifyOxfmt" c:symbol-prefixes="gjsify_oxfmt">
11
+ <class name="Formatter" c:type="GjsifyOxfmtFormatter" c:symbol-prefix="formatter" glib:type-name="GjsifyOxfmtFormatter" glib:get-type="gjsify_oxfmt_formatter_get_type" glib:type-struct="FormatterClass" parent="GObject.Object">
12
+ <field name="parent_instance" readable="0" private="1">
13
+ <type name="GObject.Object" c:type="GObject"/>
14
+ </field>
15
+ <field name="priv" readable="0" private="1">
16
+ <type name="FormatterPrivate" c:type="GjsifyOxfmtFormatterPrivate*"/>
17
+ </field>
18
+ <method name="format" c:identifier="gjsify_oxfmt_formatter_format" throws="1">
19
+ <return-value transfer-ownership="full">
20
+ <type name="GLib.Bytes" c:type="GBytes*"/>
21
+ </return-value>
22
+ <parameters>
23
+ <instance-parameter name="self" transfer-ownership="none">
24
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
25
+ </instance-parameter>
26
+ <parameter name="filename" transfer-ownership="none" nullable="1">
27
+ <type name="utf8" c:type="const gchar*"/>
28
+ </parameter>
29
+ <parameter name="code" transfer-ownership="none">
30
+ <type name="GLib.Bytes" c:type="GBytes*"/>
31
+ </parameter>
32
+ </parameters>
33
+ </method>
34
+ <method name="run" c:identifier="gjsify_oxfmt_formatter_run">
35
+ <return-value transfer-ownership="full">
36
+ <type name="gint" c:type="gint"/>
37
+ </return-value>
38
+ <parameters>
39
+ <instance-parameter name="self" transfer-ownership="none">
40
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
41
+ </instance-parameter>
42
+ <parameter name="args" transfer-ownership="none">
43
+ <array length="1" c:type="gchar**">
44
+ <type name="utf8" c:type="gchar*"/>
45
+ </array>
46
+ </parameter>
47
+ <parameter name="args_length1" transfer-ownership="none">
48
+ <type name="gint" c:type="gint"/>
49
+ </parameter>
50
+ </parameters>
51
+ </method>
52
+ <constructor name="new" c:identifier="gjsify_oxfmt_formatter_new">
53
+ <return-value transfer-ownership="full">
54
+ <type name="GjsifyOxfmt.Formatter" c:type="GjsifyOxfmtFormatter*"/>
55
+ </return-value>
56
+ </constructor>
57
+ </class>
58
+ <record name="FormatterClass" c:type="GjsifyOxfmtFormatterClass" glib:is-gtype-struct-for="Formatter">
59
+ <field name="parent_class" readable="0" private="1">
60
+ <type name="GObject.ObjectClass" c:type="GObjectClass"/>
61
+ </field>
62
+ </record>
63
+ <record name="FormatterPrivate" c:type="GjsifyOxfmtFormatterPrivate" disguised="1"/>
64
+ </namespace>
65
+ </repository>
@@ -32,6 +32,27 @@ oxc_formatter = { path = "../../../../../refs/oxc/crates/oxc_formatter" }
32
32
  oxc_span = { path = "../../../../../refs/oxc/crates/oxc_span" }
33
33
  oxfmt = { path = "../../../../../refs/oxc/apps/oxfmt", default-features = false }
34
34
 
35
+ # `oxc_allocator` is dogfooded in-tree (the path deps above) AND published to
36
+ # crates.io. Two of the formatter's leaf parsers are only ON crates.io — the
37
+ # `oxc_formatter_{css,graphql}` wrappers live in refs/oxc, but the parsers they
38
+ # call (`oxc-css-parser`, `oxc-graphql-parser`) do not, so they pull
39
+ # `oxc_allocator` from the REGISTRY. Cargo treats registry and path copies as
40
+ # separate crate instances even at the same version, so `&oxc_allocator::Allocator`
41
+ # from the path copy cannot be passed to a parser typed against the registry one
42
+ # (E0308 `there are multiple different versions of crate oxc_allocator`).
43
+ #
44
+ # refs/oxc solves this for its OWN workspace with the identical patch, but a
45
+ # `[patch]` table is only honoured from the ROOT of the workspace being built —
46
+ # path-depping INTO refs/oxc does not inherit it. `gjsify_oxfmt` is a standalone
47
+ # package (no enclosing [workspace]), so it is its own root and must repeat it.
48
+ #
49
+ # Without this the resolution also floats: the parsers require
50
+ # `oxc_allocator >=0.137.0`, so cargo re-picks the newest published version on
51
+ # every build (0.141.0 today) with nothing pinning it. Patching to the path copy
52
+ # collapses the duplicate class AND removes the float in one step.
53
+ [patch.crates-io]
54
+ oxc_allocator = { path = "../../../../../refs/oxc/crates/oxc_allocator" }
55
+
35
56
  [profile.release]
36
57
  lto = true
37
58
  codegen-units = 1