Skip to content

Commit 1965c0e

Browse files
committed
fix(ci): attempt to fix CI
1 parent 601f2f2 commit 1965c0e

7 files changed

Lines changed: 1070 additions & 15 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Cache Rust
4949
uses: Swatinem/rust-cache@v2
5050
- name: Install Nextest
51-
run: cargo install --force cargo-nextest
51+
run: cargo install --locked --force cargo-nextest
5252
- name: Build CLI
5353
run: cargo build -p odict-cli --verbose --target ${{ matrix.target }}
5454
- name: Run tests

.github/workflows/node.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
runs-on: ${{ matrix.settings.host }}
9999
steps:
100100
- uses: actions/checkout@v5
101+
- name: Enable Corepack
102+
run: corepack enable
101103
- name: Setup node
102104
uses: actions/setup-node@v5
103105
with:
@@ -226,6 +228,8 @@ jobs:
226228
runs-on: ${{ matrix.settings.host }}
227229
steps:
228230
- uses: actions/checkout@v5
231+
- name: Enable Corepack
232+
run: corepack enable
229233
- name: Setup node
230234
uses: actions/setup-node@v5
231235
with:
@@ -266,6 +270,8 @@ jobs:
266270
runs-on: ${{ contains(matrix.target, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
267271
steps:
268272
- uses: actions/checkout@v5
273+
- name: Enable Corepack
274+
run: corepack enable
269275
- name: Setup node
270276
uses: actions/setup-node@v5
271277
with:
@@ -325,6 +331,8 @@ jobs:
325331
runs-on: ubuntu-latest
326332
steps:
327333
- uses: actions/checkout@v5
334+
- name: Enable Corepack
335+
run: corepack enable
328336
- name: Setup node
329337
uses: actions/setup-node@v5
330338
with:
@@ -363,6 +371,8 @@ jobs:
363371
- test-wasi
364372
steps:
365373
- uses: actions/checkout@v5
374+
- name: Enable Corepack
375+
run: corepack enable
366376
- name: Setup node
367377
uses: actions/setup-node@v5
368378
with:

.github/workflows/python.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: PyO3/maturin-action@v1
4646
with:
4747
target: ${{ matrix.platform.target }}
48-
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
48+
args: --release --out dist --find-interpreter --manifest-path crates/python/Cargo.toml
4949
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5050
manylinux: auto
5151
- name: Upload wheels
@@ -62,7 +62,7 @@ jobs:
6262
source .venv/bin/activate
6363
pip install theopendictionary --find-links dist --force-reinstall
6464
pip install pytest syrupy pytest-asyncio
65-
cd python && pytest
65+
cd crates/python && pytest
6666
- name: pytest
6767
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
6868
uses: uraimo/run-on-arch-action@v2
@@ -77,7 +77,7 @@ jobs:
7777
run: |
7878
set -e
7979
pip3 install theopendictionary --find-links dist --force-reinstall
80-
cd python && pytest
80+
cd crates/python && pytest
8181
8282
musllinux:
8383
runs-on: ${{ matrix.platform.runner }}
@@ -101,7 +101,7 @@ jobs:
101101
uses: PyO3/maturin-action@v1
102102
with:
103103
target: ${{ matrix.platform.target }}
104-
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
104+
args: --release --out dist --find-interpreter --manifest-path crates/python/Cargo.toml
105105
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
106106
manylinux: musllinux_1_2
107107
- name: Upload wheels
@@ -119,7 +119,7 @@ jobs:
119119
source .venv/bin/activate
120120
pip install theopendictionary --no-index --find-links dist --force-reinstall
121121
pip install pytest syrupy pytest-asyncio
122-
cd python && pytest
122+
cd crates/python && pytest
123123
'
124124
- name: pytest
125125
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
@@ -136,7 +136,7 @@ jobs:
136136
source .venv/bin/activate
137137
pip install pytest syrupy pytest-asyncio
138138
pip install theopendictionary --find-links dist --force-reinstall
139-
cd python && pytest
139+
cd crates/python && pytest
140140
141141
windows:
142142
runs-on: ${{ matrix.platform.runner }}
@@ -162,7 +162,7 @@ jobs:
162162
uses: PyO3/maturin-action@v1
163163
with:
164164
target: ${{ matrix.platform.target }}
165-
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
165+
args: --release --out dist --find-interpreter --manifest-path crates/python/Cargo.toml
166166
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
167167
- name: Upload wheels
168168
uses: actions/upload-artifact@v5
@@ -177,7 +177,7 @@ jobs:
177177
source .venv/Scripts/activate
178178
pip install theopendictionary --find-links dist --force-reinstall
179179
pip install pytest syrupy pytest-asyncio
180-
cd python && pytest
180+
cd crates/python && pytest
181181
182182
macos:
183183
runs-on: ${{ matrix.platform.runner }}
@@ -197,7 +197,7 @@ jobs:
197197
uses: PyO3/maturin-action@v1
198198
with:
199199
target: ${{ matrix.platform.target }}
200-
args: --release --out dist --find-interpreter --manifest-path python/Cargo.toml
200+
args: --release --out dist --find-interpreter --manifest-path crates/python/Cargo.toml
201201
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
202202
- name: Upload wheels
203203
uses: actions/upload-artifact@v5
@@ -211,7 +211,7 @@ jobs:
211211
source .venv/bin/activate
212212
pip install theopendictionary --find-links dist --force-reinstall
213213
pip install pytest syrupy pytest-asyncio
214-
cd python && pytest
214+
cd crates/python && pytest
215215
216216
sdist:
217217
runs-on: ubuntu-latest
@@ -221,7 +221,7 @@ jobs:
221221
uses: PyO3/maturin-action@v1
222222
with:
223223
command: sdist
224-
args: --out dist --manifest-path python/Cargo.toml
224+
args: --out dist --manifest-path crates/python/Cargo.toml
225225
- name: Upload sdist
226226
uses: actions/upload-artifact@v5
227227
with:

.yarn/releases/yarn-4.13.0.cjs

Lines changed: 940 additions & 0 deletions
Large diffs are not rendered by default.

CLAUDE.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
ODict is a fast, portable dictionary file format. XML source files (.odxml) compile to compact binary dictionaries (.odict) using CBOR serialization and Brotli compression. The project is a Rust workspace monorepo with language bindings for Node.js and Python.
8+
9+
## Build & Development Commands
10+
11+
This project uses `mise` as the monorepo task runner. All tasks are defined in `mise.toml` and per-crate `mise.toml` files.
12+
13+
### Core Commands
14+
15+
| Command | Purpose |
16+
|---------|---------|
17+
| `mise build` | Build the CLI binary |
18+
| `mise build:all` | Build all packages (CLI, lib, node, python) |
19+
| `mise test` | Run core Rust tests (lib + cli + internal) |
20+
| `mise test:all` | Run all tests including language bindings |
21+
| `mise lint` | Lint all Rust code (clippy + per-crate lints) |
22+
| `mise fix` | Auto-fix clippy warnings |
23+
| `mise format` | Format all Rust code (`cargo fmt --all`) |
24+
| `mise snapshot` | Accept insta snapshot updates (`cargo insta accept`) |
25+
| `mise bench` | Run criterion benchmarks |
26+
| `mise setup` | Install all dependencies |
27+
28+
### Running a Single Test
29+
30+
```bash
31+
# By test name
32+
cargo nextest run -p odict --all-features <test_name>
33+
34+
# By crate
35+
cargo nextest run -p odict-cli --all-features
36+
```
37+
38+
### Language Binding Development
39+
40+
**Node** (`crates/node/`): Uses napi-rs, yarn 4, AVA for tests, oxlint + prettier for linting.
41+
```bash
42+
cd crates/node && mise test # runs yarn test (AVA)
43+
cd crates/node && mise build # builds native extension
44+
```
45+
46+
**Python** (`crates/python/`): Uses PyO3 + maturin, pytest + syrupy for snapshot tests, ruff for linting.
47+
```bash
48+
cd crates/python && mise test # runs pytest
49+
cd crates/python && mise build # builds wheel via maturin
50+
```
51+
52+
## Architecture
53+
54+
### Workspace Crates
55+
56+
```
57+
crates/
58+
├── lib/ → `odict` - Core library (cdylib + staticlib + rlib)
59+
│ All dictionary logic: compile, lookup, search, merge, serialize
60+
├── cli/ → `odict-cli` - CLI binary (clap-based)
61+
│ Subcommands: alias, compile, download, dump, index, info,
62+
│ lexicon, lookup, merge, new, search, serve, tokenize
63+
├── internal/ → `internal` - Shared internal utilities (not published)
64+
├── node/ → Node.js NAPI bindings
65+
└── python/ → Python PyO3 bindings
66+
```
67+
68+
### Feature Flags (lib crate)
69+
70+
The lib has extensive feature flags controlling optional functionality:
71+
72+
- **default**: `sql`, `config`
73+
- **search**: Full-text search via tantivy
74+
- **http**: Remote dictionary fetching via reqwest
75+
- **html/markdown**: Markup rendering in definitions
76+
- **alias**: Named dictionary shortcuts
77+
- **tokenize**: Text tokenization (with per-language sub-features: `tokenize-chinese`, `tokenize-japanese`, `tokenize-thai`, etc.)
78+
79+
The CLI enables: `sql`, `search`, `http`, `alias`, `html`, `tokenize`.
80+
81+
### Key Patterns
82+
83+
- **Error handling**: `thiserror` derive macros with a central `Error` enum per crate; `Result<T> = Result<T, Error>` alias
84+
- **Serialization**: `rkyv` for zero-copy deserialization of dictionary data, `serde` for config/interchange formats
85+
- **Testing**: `cargo-nextest` runner, `insta` for snapshot assertions, test dictionaries loaded via `LazyLock` from `examples/` directory
86+
- **XML Schema**: Dictionary format defined in `odict.xsd`
87+
88+
### Data Flow
89+
90+
XML source (.odxml) → `quick-xml` parser → internal AST → `rkyv` serialization → Brotli compression → .odict binary
91+
92+
Lookup: .odict binary → Brotli decompression → `rkyv` zero-copy access → results
93+
94+
## CI/CD
95+
96+
- **ci.yml**: Builds and tests on Linux/macOS/Windows
97+
- **node.yml**: Builds native extensions for 14+ platforms, publishes to npm
98+
- **python.yml**: Builds wheels for multiple architectures, publishes to PyPI
99+
- **release-please.yml**: Automated version bumping and release PRs (lib+cli linked, node/python separate)
100+
101+
## Release Configuration
102+
103+
Release profiles use `lto = true`, `codegen-units = 1`, `strip = true`, `opt-level = 3` for maximum optimization. Distribution builds (`profile.dist`) use `lto = "thin"` for faster CI builds.
104+
105+
Cross-compilation targets are configured in `.cargo/config.toml` (Windows static CRT, ARM linker settings).

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ COPY . .
1111

1212
RUN mise trust -y
1313
RUN mise install rust
14-
RUN mise run build --release
14+
RUN mise run build -- --release
1515

1616
FROM debian:latest
1717

mise.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ config_roots = ["crates/*"]
1515
lockfile = true
1616

1717
[tasks.run]
18-
depends = ["//crates/cli:run"]
18+
run = "cargo run --release -p odict-cli --"
1919

2020
[tasks.build]
21-
depends = ["//crates/cli:build"]
21+
run = "cargo build -p odict-cli"
2222

2323
[tasks.clean]
2424
run = "cargo clean"

0 commit comments

Comments
 (0)