@marwanvx/oxyaml 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ All notable changes are listed here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## 1.1.0
8
+
9
+ ### Added
10
+
11
+ - `yaml.folding.regions`: fold `#region` / `#endregion` comment blocks. Off by default.
12
+ - `yaml.format.preserveQuotes`: the formatter keeps each string's quote style as written. Off by
13
+ default.
14
+
15
+ ## 1.0.1
16
+
17
+ ### Added
18
+
19
+ - Published on crates.io: `cargo install --locked oxyaml` or `cargo binstall oxyaml`.
20
+ - The GitHub Action resolves the moving `v1` tag to the latest release binary, and has a
21
+ Marketplace icon and description.
22
+
23
+ ### Changed
24
+
25
+ - Releases publish to the VS Code Marketplace with trusted publishing, and update the winget
26
+ package and the pre-commit mirror automatically.
27
+
28
+ ### Fixed
29
+
30
+ - npm install command in the release notes now uses the `@marwanvx/oxyaml` package name.
31
+
7
32
  ## 1.0.0
8
33
 
9
34
  ### Added
package/README.md CHANGED
@@ -1,14 +1,25 @@
1
1
  # oxyaml
2
2
 
3
- [![CI](https://github.com/marwanvx/oxyaml/actions/workflows/ci.yml/badge.svg)](https://github.com/marwanvx/oxyaml/actions/workflows/ci.yml)
4
- [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue)](#license)
3
+ [![CI](https://img.shields.io/github/actions/workflow/status/marwanvx/oxyaml/ci.yml?branch=main&label=CI)](https://github.com/marwanvx/oxyaml/actions/workflows/ci.yml)
4
+ [![Release](https://img.shields.io/github/v/release/marwanvx/oxyaml)](https://github.com/marwanvx/oxyaml/releases/latest)
5
+ [![MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue)](#license)
6
+ [![crates.io](https://img.shields.io/crates/v/oxyaml)](https://crates.io/crates/oxyaml)
7
+ [![PyPI](https://img.shields.io/pypi/v/oxyaml)](https://pypi.org/project/oxyaml/)
8
+ [![npm](https://img.shields.io/npm/v/%40marwanvx%2Foxyaml)](https://npmjs.com/package/@marwanvx/oxyaml)
9
+ [![VS Code Marketplace](https://img.shields.io/badge/VS%20Code-Marketplace-007ACC)](https://marketplace.visualstudio.com/items?itemName=marwanvx.oxyaml)
10
+ [![Open VSX](https://img.shields.io/open-vsx/v/marwanvx/oxyaml)](https://open-vsx.org/extension/marwanvx/oxyaml)
5
11
 
6
- **A YAML language server in Rust, up to 400× faster than yaml-language-server on large files, with the same settings and no Node.js.**
12
+ [![Support me on Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W4Y52BT776)
7
13
 
8
- oxyaml is a YAML language server and command-line checker written in Rust. It brings schema
9
- validation, completion, hover, and formatting to your editor, and checks the same files in CI.
10
- Switch from [yaml-language-server](https://github.com/redhat-developer/yaml-language-server) using
11
- the same editor settings and schemas. The binary runs without Node.js.
14
+ **A fast YAML language server and command-line checker, written in Rust.**
15
+
16
+ oxyaml validates YAML against JSON Schema as you edit and runs the same checks in CI. It is a
17
+ drop-in replacement for yaml-language-server (the engine behind Red Hat's YAML extension): same
18
+ settings, same schemas, no Node.js, and up to 400× faster edits with 15× less memory on large files.
19
+
20
+ <img alt="oxyaml check finds a misspelled runs-on key, a wrong type and a YAML syntax error" src="docs/assets/check-demo.png" width="760">
21
+
22
+ [Website](https://oxyaml.velixsoft.net)
12
23
 
13
24
  ## Benchmarks
14
25
 
@@ -17,87 +28,94 @@ the same editor settings and schemas. The binary runs without Node.js.
17
28
  <img alt="Edit to diagnostics: oxyaml 2.6 ms, yaml-language-server 1,040 ms. Open to diagnostics: oxyaml 103 ms, yaml-language-server 1,064 ms. Peak memory: oxyaml 91.4 MB, yaml-language-server 1,345 MB." src="docs/assets/benchmark-light.svg">
18
29
  </picture>
19
30
 
20
- | | oxyaml | yaml-language-server | |
21
- |---|---:|---:|---:|
22
- | **Big file** (50,000 lines): edit → diagnostics | **2.6 ms** | 1,040 ms | 400× faster |
23
- | open → diagnostics | **103 ms** | 1,064 ms | 10× faster |
24
- | completion | **1 ms** | 81.1 ms | 81× faster |
25
- | peak memory | **91.4 MB** | 1,345 MB | 15× less |
26
- | **Small file** (500 lines): edit → diagnostics | **0.3 ms** | 214 ms | 712× faster |
27
- | startup | **2.6 ms** | 230 ms | 89× faster |
28
- | peak memory | **16.6 MB** | 123 MB | 7.4× less |
29
-
30
- Measured on a GitHub Actions `ubuntu-latest` runner (the [bench-gate workflow](.github/workflows/bench-gate.yml)):
31
- same files and the same Kubernetes schema for both servers, median of 5 sessions. yaml-language-server
32
- waits 200 ms before validating, which is part of what an editor sees. How to reproduce: [docs/benchmarks.md](docs/benchmarks.md).
33
-
34
- ## Install
35
-
36
- Release binaries target Linux, macOS, and Windows on x86-64 and ARM64. For installers and archives,
37
- see [GitHub Releases](https://github.com/marwanvx/oxyaml/releases).
38
-
39
- | Method | Command or location |
40
- |---|---|
41
- | Shell (Linux or macOS) | `curl -fsSL https://github.com/marwanvx/oxyaml/releases/latest/download/oxyaml-installer.sh \| sh` |
42
- | PowerShell (Windows) | `irm https://github.com/marwanvx/oxyaml/releases/latest/download/oxyaml-installer.ps1 \| iex` |
43
- | Homebrew | `brew install marwanvx/tap/oxyaml` once the tap is published |
44
- | npm | `npm install -g oxyaml` once the package is published |
45
- | PyPI | `pip install oxyaml` or `uvx oxyaml check` once the package is published |
46
- | WinGet | `winget install --id marwanvx.oxyaml --exact` once the package is listed |
47
- | VS Code | Look for `marwanvx.oxyaml` in the [Marketplace](https://marketplace.visualstudio.com/items?itemName=marwanvx.oxyaml) or [Open VSX](https://open-vsx.org/extension/marwanvx/oxyaml) once listed. You can also [build a VSIX](editors/vscode/README.md#development-and-packaging) and use **Install from VSIX** in Extensions. |
48
- | Zed | Search Extensions for `oxyaml` once listed, or [install the development extension](editors/zed/README.md#local-development). |
49
- | From source | `cargo install --locked --git https://github.com/marwanvx/oxyaml oxyaml` with the Rust toolchain in [`rust-toolchain.toml`](rust-toolchain.toml) |
50
-
51
- ## Migrating from yaml-language-server / redhat.vscode-yaml
52
-
53
- Change your editor's server command to `oxyaml --stdio`. Keep your `yaml.*` settings,
54
- including `yaml.schemas` glob associations, and leave existing modelines such as
55
- `# yaml-language-server: $schema=./schema.json` in your YAML files. See
56
- [behaviour differences](docs/DIFFERENCES.md).
57
-
58
- ### Editors
59
-
60
- | Editor | What to change |
61
- |---|---|
62
- | [VS Code](editors/vscode/README.md) | Install oxyaml and disable Red Hat YAML for the workspace when prompted. Switch `editor.defaultFormatter` to `marwanvx.oxyaml` if it points to Red Hat YAML. |
63
- | [Zed](editors/zed/README.md) | Set YAML's `language_servers` to `["oxyaml", "!yaml-language-server"]` and move `lsp.yaml-language-server.settings` to `lsp.oxyaml.settings`. |
64
- | [Neovim](docs/editors/neovim.md) | Set `yamlls`'s `cmd` to `{ "oxyaml", "--stdio" }`. |
65
- | [Helix](docs/editors/helix.md) | Set `command = "oxyaml"` and `args = ["--stdio"]` under `[language-server.yaml-language-server]`. |
66
- | [Sublime Text](docs/editors/sublime.md) | Set `command` to `["oxyaml", "--stdio"]` in LSP-yaml or configure a standalone LSP client. |
67
- | [Emacs](docs/editors/emacs.md) | Set the command to `("oxyaml" "--stdio")` in `eglot-server-programs` or `lsp-yaml-server-command`. |
68
- | [Claude Code](editors/claude-code/README.md) | Put `oxyaml` on your PATH and load the `oxyaml-lsp` plugin for YAML. |
69
-
70
- ## Editor features
71
-
72
- | Feature | What you get |
73
- |---|---|
74
- | Diagnostics | YAML 1.1 and 1.2 syntax, custom tags, style rules, and anchor hints |
75
- | JSON Schema validation | Local and remote schemas, SchemaStore, Kubernetes, and custom resource definitions (CRDs) |
76
- | Completion and hover | Schema-based keys, values, snippets, and documentation, plus anchor previews |
77
- | Formatting | Whole-document formatting and indentation as you type |
78
- | Code actions and lenses | Quick fixes and a link to the active schema |
79
- | Outline and navigation | Document symbols, folding, expand selection, clickable links, and go to anchor definition |
80
- | Rename | Rename an anchor and its aliases together |
81
-
82
- ## Check YAML in CI and before committing
83
-
84
- Run `oxyaml check .` to validate YAML in the current directory. The checker looks for
85
- `.oxyaml.toml` in the current directory and its parents. Use `--config <FILE>` to choose another
86
- settings file and `--format json` or `--format sarif` for machine-readable output. Validation
87
- errors exit with status 1.
88
-
89
- Both integrations below use the `v1.0.0` tag. Add the hook to `.pre-commit-config.yaml` and run
90
- `pre-commit install`. The hook requires Rust to build oxyaml.
31
+ <picture>
32
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/benchmark-table-dark.png">
33
+ <img alt="oxyaml vs yaml-language-server. Big file (50,000 lines): edit 2.6 ms vs 1,040 ms (400x faster), open 103 ms vs 1,064 ms, completion 1 ms vs 81.1 ms, peak memory 91.4 MB vs 1,345 MB. Small file (500 lines): edit 0.3 ms vs 214 ms, startup 2.6 ms vs 230 ms, peak memory 16.6 MB vs 123 MB." src="docs/assets/benchmark-table-light.png">
34
+ </picture>
91
35
 
92
- ```yaml
93
- repos:
94
- - repo: https://github.com/marwanvx/oxyaml
95
- rev: v1.0.0
96
- hooks:
97
- - id: oxyaml-check
36
+ Measured on a GitHub Actions runner, median of 5 sessions. How to reproduce: [docs/benchmarks.md](docs/benchmarks.md).
37
+
38
+ ## Highlights
39
+
40
+ - Validate YAML 1.1 and 1.2 with JSON Schema, SchemaStore, and Kubernetes schemas, including custom resource definitions (CRDs).
41
+ - Get schema-aware completion and hover, document formatting, indentation as you type, and code actions.
42
+ - Navigate with document symbols, folding, and links. Rename anchors and their aliases together.
43
+ - Keep your yaml-language-server settings and schema modelines. The native binary runs without Node.js.
44
+ - Check files and directories with `oxyaml check` and report diagnostics as text, JSON, or SARIF.
45
+ - Bound alias expansion and schema validation work when processing hostile YAML and schemas.
46
+
47
+ ## Installation
48
+
49
+ Prebuilt binaries are available for Linux, macOS, and Windows on x86-64 and ARM64.
50
+
51
+ | Method | Command or download |
52
+ | --- | --- |
53
+ | <img src="docs/assets/icons/terminal.svg" height="16" alt=""> Shell (Linux and macOS) | `curl -fsSL https://github.com/marwanvx/oxyaml/releases/latest/download/oxyaml-installer.sh \| sh` |
54
+ | <img src="docs/assets/icons/terminal.svg" height="16" alt=""> PowerShell (Windows) | `irm https://github.com/marwanvx/oxyaml/releases/latest/download/oxyaml-installer.ps1 \| iex` |
55
+ | <img src="docs/assets/icons/homebrew.svg" height="16" alt=""> Homebrew | `brew install marwanvx/tap/oxyaml` |
56
+ | <img src="docs/assets/icons/npm.svg" height="16" alt=""> npm | `npm install -g @marwanvx/oxyaml` installs the `oxyaml` command. |
57
+ | <img src="docs/assets/icons/pypi.svg" height="16" alt=""> PyPI | `pip install oxyaml` or `pipx install oxyaml`. Run via `uvx oxyaml check`. |
58
+ | <img src="docs/assets/icons/docker.svg" height="16" alt=""> Docker | `docker run --rm -v "$PWD:/work" ghcr.io/marwanvx/oxyaml check .` |
59
+ | <img src="docs/assets/icons/winget.png" height="16" alt=""> WinGet | `marwanvx.oxyaml` is coming soon ([package submission](https://github.com/microsoft/winget-pkgs/pull/497034)). |
60
+ | <img src="docs/assets/icons/rust.svg" height="16" alt=""> Cargo | `cargo install --locked oxyaml` (or `cargo binstall oxyaml` for the prebuilt binary). |
61
+ | <img src="docs/assets/icons/download.svg" height="16" alt=""> Prebuilt&nbsp;archives | Download an archive for your platform from [GitHub Releases](https://github.com/marwanvx/oxyaml/releases). |
62
+
63
+ ## Editor setup
64
+
65
+ | Editor or coding assistant | Setup |
66
+ | --- | --- |
67
+ | <img src="docs/assets/icons/vscode.svg" height="16" alt=""> [VS Code](editors/vscode/README.md) | Install [oxyaml from the VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=marwanvx.oxyaml). The extension bundles the binary. |
68
+ | <img src="docs/assets/icons/cursor.svg" height="16" alt=""> Cursor<br><img src="docs/assets/icons/vscodium.svg" height="16" alt=""> VSCodium<br><img src="docs/assets/icons/windsurf.svg" height="16" alt=""> Windsurf | Install the extension from [Open VSX](https://open-vsx.org/extension/marwanvx/oxyaml). |
69
+ | <picture><source media="(prefers-color-scheme: dark)" srcset="docs/assets/icons/zed-dark.svg"><img src="docs/assets/icons/zed.svg" height="16" alt=""></picture> Zed | Store listing coming soon. [Install the development extension](editors/zed/README.md#local-development). |
70
+ | <img src="docs/assets/icons/neovim.svg" height="16" alt=""> Neovim | Follow the [Neovim](docs/editors/neovim.md) guide. |
71
+ | <img src="docs/assets/icons/helix.svg" height="16" alt=""> Helix | Follow the [Helix](docs/editors/helix.md) guide. |
72
+ | <img src="docs/assets/icons/sublime-text.svg" height="16" alt=""> Sublime Text | Follow the [Sublime Text](docs/editors/sublime.md) guide. |
73
+ | <img src="docs/assets/icons/emacs.svg" height="16" alt=""> Emacs | Follow the [Emacs](docs/editors/emacs.md) guide. |
74
+ | <img src="docs/assets/icons/claude-code.svg" height="16" alt=""> Claude Code | Install the [`oxyaml-lsp` plugin](editors/claude-code/README.md#install). |
75
+
76
+ If you already use yaml-language-server, change your editor's server command to `oxyaml --stdio`
77
+ and keep your `yaml.*` settings and schema modelines. In VS Code, use the extension's prompt
78
+ to disable Red Hat YAML for the workspace and switch the default YAML formatter if you set it
79
+ explicitly. See the [behaviour differences](docs/DIFFERENCES.md) and
80
+ [Editor integrators: LSP extensions](docs/lsp-extensions.md).
81
+
82
+ ## Command line
83
+
84
+ ### Usage
85
+
86
+ Run `oxyaml check [PATH...]` to validate files or directories. With no paths, it checks the
87
+ current directory. For all options, run `oxyaml check --help`.
88
+
89
+ ```sh
90
+ oxyaml check .
91
+ ```
92
+
93
+ The checker uses the nearest `.oxyaml.toml` in the current directory or its parents. Pass
94
+ `--config <FILE>` to select a file explicitly.
95
+
96
+ ### Exit codes
97
+
98
+ | Exit code | Meaning |
99
+ | --- | --- |
100
+ | `0` | No errors. Warnings alone pass. |
101
+ | `1` | Validation errors or a check failure, such as an unreadable input or invalid config. |
102
+ | `2` | Invalid command-line arguments to `check`. |
103
+
104
+ ### Output formats
105
+
106
+ The default output format is `text`. Use `--format` to select JSON or SARIF.
107
+
108
+ ```sh
109
+ oxyaml check --format json .github/workflows
110
+ oxyaml check --format sarif . > oxyaml.sarif
98
111
  ```
99
112
 
100
- For GitHub Actions, check out your repository before running the action.
113
+ ## CI
114
+
115
+ ### GitHub Actions
116
+
117
+ Add this workflow to check your repository's YAML on pushes and pull requests. On supported runners
118
+ the release-tagged action downloads and verifies a prebuilt binary. See the [action inputs](action.yml).
101
119
 
102
120
  ```yaml
103
121
  name: Check YAML
@@ -109,21 +127,68 @@ jobs:
109
127
  runs-on: ubuntu-latest
110
128
  steps:
111
129
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
112
- - uses: marwanvx/oxyaml@v1.0.0
130
+ - uses: marwanvx/oxyaml@v1 # moves to the latest 1.x release
113
131
  with:
114
- paths: .github/workflows
115
132
  format: text
116
133
  ```
117
134
 
118
- On a release tag the action downloads the prebuilt binary (checksum-verified, cached); other refs build
119
- from source. It defaults to checking `.` and writing a SARIF report. See the
120
- [action inputs](action.yml) for configuration and uploading the report to code scanning.
135
+ ### pre-commit
136
+
137
+ Add the hook to `.pre-commit-config.yaml` and run `pre-commit install`. The hook installs the
138
+ prebuilt PyPI wheel, so it runs without a Rust toolchain.
139
+
140
+ ```yaml
141
+ repos:
142
+ - repo: https://github.com/marwanvx/oxyaml-pre-commit
143
+ rev: v1.1.0
144
+ hooks:
145
+ - id: oxyaml-check
146
+ ```
147
+
148
+ Run `pre-commit autoupdate` to get new versions.
149
+
150
+ ### GitLab CI
151
+
152
+ Use the container image with an empty entrypoint:
153
+
154
+ ```yaml
155
+ yaml:
156
+ image:
157
+ name: ghcr.io/marwanvx/oxyaml
158
+ entrypoint: [""]
159
+ script:
160
+ - oxyaml check .
161
+ ```
162
+
163
+ ## Configuration
164
+
165
+ oxyaml accepts the same `yaml.*` settings as yaml-language-server, including `yaml.schemas`
166
+ for file associations and `yaml.format.*` for formatting. For the CLI, use TOML sections such
167
+ as `[yaml]` and `[yaml.schemas]` in `.oxyaml.toml`. See the [settings reference](editors/vscode/README.md#settings).
168
+
169
+ ## Roadmap
170
+
171
+ The [roadmap issues](https://github.com/marwanvx/oxyaml/issues?q=label%3Aroadmap) cover yamllint
172
+ rules, Helm templates, zero-config Kubernetes schemas, GitHub Actions expressions, cross-file
173
+ `$ref` navigation, inlay hints and semantic tokens, Python and Node APIs, a web playground,
174
+ `oxyaml check --fix`, `oxyaml schema infer`, and an MCP server.
121
175
 
122
176
  ## Contributing
123
177
 
124
- See the [contribution guide](CONTRIBUTING.md), [security policy](SECURITY.md),
125
- [code of conduct](CODE_OF_CONDUCT.md), and [changelog](CHANGELOG.md).
178
+ See the [contribution guide](CONTRIBUTING.md) for how to report bugs and submit changes. For
179
+ security reports, see the [security policy](SECURITY.md).
180
+
181
+ ## Support
182
+
183
+ If oxyaml saves you time, [star the repository](https://github.com/marwanvx/oxyaml) or buy me a coffee:
184
+
185
+ [![Support me on Ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W4Y52BT776)
186
+
187
+ ## Acknowledgements
188
+
189
+ - [yaml-language-server](https://github.com/redhat-developer/yaml-language-server) is the reference for oxyaml's editor behaviour and the oracle for parity tests.
190
+ - [eemeli/yaml](https://github.com/eemeli/yaml) is the basis for the Rust YAML parser port.
126
191
 
127
192
  ## License
128
193
 
129
- [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE).
194
+ Licensed under either [MIT](LICENSE-MIT) or [Apache-2.0](LICENSE-APACHE), at your option.
@@ -19,7 +19,7 @@
19
19
  "hasInstallScript": true,
20
20
  "license": "MIT OR Apache-2.0",
21
21
  "name": "@marwanvx/oxyaml",
22
- "version": "1.0.0"
22
+ "version": "1.1.0"
23
23
  },
24
24
  "node_modules/detect-libc": {
25
25
  "engines": {
@@ -48,5 +48,5 @@
48
48
  }
49
49
  },
50
50
  "requires": true,
51
- "version": "1.0.0"
52
- }
51
+ "version": "1.1.0"
52
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "artifactDownloadUrls": [
3
- "https://github.com/marwanvx/oxyaml/releases/download/v1.0.0"
3
+ "https://github.com/marwanvx/oxyaml/releases/download/v1.1.0"
4
4
  ],
5
5
  "bin": {
6
6
  "oxyaml": "run-oxyaml.js"
@@ -20,7 +20,6 @@
20
20
  "major": 2,
21
21
  "series": 35
22
22
  },
23
- "homepage": "https://github.com/marwanvx/oxyaml",
24
23
  "keywords": [
25
24
  "development-tools",
26
25
  "command-line-utilities",
@@ -126,9 +125,9 @@
126
125
  "zipExt": ".tar.xz"
127
126
  }
128
127
  },
129
- "version": "1.0.0",
128
+ "version": "1.1.0",
130
129
  "volta": {
131
130
  "node": "18.14.1",
132
131
  "npm": "9.5.0"
133
132
  }
134
- }
133
+ }