Skip to content

Commit ea820fc

Browse files
authored
Merge pull request #350 from quarto-dev/feature/bd-egcyeym9-error-reporting-cutover
Consume published quarto-error-reporting 0.1.0 from crates.io (bd-egcyeym9, Phase 3 cutover)
2 parents e014af5 + 1d12785 commit ea820fc

32 files changed

Lines changed: 68 additions & 4971 deletions

CLAUDE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,11 @@ When fixing ANY bug:
296296
**Core libraries:**
297297
- `quarto-core`: core rendering infrastructure for Quarto
298298
- `quarto-util`: shared utilities for Quarto crates
299-
- `quarto-error-reporting`: uniform, helpful, beautiful error messages
300-
- `quarto-source-map`: maintain source location information for data structures
299+
- `quarto-error-catalog`: Quarto's `Q-*` error-code catalog data + the `CatalogProvider` it installs into `quarto-error-reporting`
300+
301+
**Externalized foundation crates** (published to crates.io from their own `posit-dev/` repos; consumed here as version deps, no longer in `crates/`):
302+
- `quarto-error-reporting`: uniform, helpful, beautiful error messages — now **catalog-agnostic** (the `Q-*` data lives in the in-tree `quarto-error-catalog`). Repo: `posit-dev/quarto-error-reporting`. The `json` wire shape is behind a default-off `json` feature; q2's wire-shape consumers enable it.
303+
- `quarto-source-map`: maintain source location information for data structures. Repo: `posit-dev/quarto-source-map`. (See `claude-notes/plans/2026-06-26-extract-error-reporting-foundation.md` for the extraction.)
301304

302305
**Parsing libraries:**
303306
- `quarto-yaml`: YAML parser with accurate fine-grained source locations

Cargo.lock

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ path = "./crates/quarto-yaml"
113113
path = "./crates/quarto-yaml-validation"
114114

115115
[workspace.dependencies.quarto-error-reporting]
116-
path = "./crates/quarto-error-reporting"
116+
version = "0.1.0"
117117

118118
[workspace.dependencies.quarto-error-catalog]
119119
path = "./crates/quarto-error-catalog"

claude-notes/plans/2026-06-26-extract-error-reporting-foundation.md

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -320,25 +320,54 @@ would otherwise come from an uninitialised global.
320320

321321
Requires Phase 1 (source-map published) **and** Phase 2 (carve-out done).
322322

323-
- [ ] **3a.** Create `posit-dev/<error-reporting-repo>`; **copy** the
324-
`quarto-error-reporting` sources (fresh `git init`, no history). Own
325-
`[workspace.package]`. Crucially, its `quarto-source-map` dependency is now
326-
the **published version** dep (Phase 1c), *not* a path dep. (`json.rs` +
327-
`coalesce.rs` travel with it, `json` behind its feature; the catalog data
328-
already left in Phase 2c.)
329-
- [ ] **3b.** Standalone CI: `cargo build` + `cargo nextest run` with the
330-
**`EmptyCatalog`** default — proving catalog-agnostic operation with zero
331-
Quarto policy present.
332-
- [ ] **3c.** External-consumer smoke test: a throwaway crate builds a
333-
`DiagnosticMessage`, installs a trivial `CatalogProvider`, renders — proving
334-
the published API is usable with no Quarto context.
335-
- [ ] **3d.** Publish `quarto-error-reporting` to crates.io.
336-
- [ ] **3e.** q2 cutover: replace the in-tree `quarto-error-reporting` path dep with
337-
the published version dep (enable `features = ["json"]`); delete the in-tree
338-
copy. `quarto-error-catalog` stays in q2 and now depends on the external
339-
`quarto-error-reporting`. **Full `cargo xtask verify` incl. hub-build** (WASM
340-
risk surface again, now de-risked by Phase 1d).
341-
- [ ] **3f.** Update `CLAUDE.md`'s crate-layout section + the workspace member list.
323+
- [x] **3a.** Created **`posit-dev/quarto-error-reporting`** (public,
324+
https://github.com/posit-dev/quarto-error-reporting): copied src/ + tests/ +
325+
examples/ + `schemas/` + LICENSE; standalone single-crate manifest
326+
(`version = "0.1.0"`, edition 2024, explicit dep versions,
327+
**`quarto-source-map = "0.1.0"`** published dep, `schemars` optional +
328+
`[features] json`). Dropped `CONTRIBUTING-ERRORS.md` (Quarto catalog policy —
329+
belongs with `quarto-error-catalog`) and rewrote `README.md` for the
330+
catalog-agnostic library. One source fix needed for stable-clippy
331+
`-D warnings`: `macros.rs` had `items_after_test_module` (q2's pinned-nightly
332+
clippy tolerated it) — moved the test module below the `#[macro_export]`
333+
macros + dropped the now-redundant macro imports. (q2 deletes its copy at
334+
3e, so the standalone becomes the single source; no divergence.)
335+
- [x] **3b.** Standalone CI green locally: builds **default (json off, no
336+
schemars)** and `--all-features`; `cargo test` 51 / `--all-features` 61 +
337+
doctests + schema_drift; fmt + clippy (both feature sets) clean.
338+
`.github/workflows/ci.yml` added (Linux/macOS/Windows, both feature sets).
339+
CI running on the new repo.
340+
- [x] **3c.** External-consumer smoke test (scratchpad `er-smoke`): a separate
341+
crate with **default features** builds+renders a `DiagnosticMessage`, gets
342+
`EmptyCatalog` (no docs URL), then installs a custom `CatalogProvider` and
343+
resolves a URL — `cargo tree` confirms **no schemars** in its tree. Passes.
344+
`cargo publish --dry-run` clean (24 files, verify-built).
345+
- [ ] **3d.** Publish `quarto-error-reporting` to crates.io. **(User step — needs
346+
crates.io credentials; depends on the published `quarto-source-map 0.1.0`,
347+
which is already live.)**
348+
- [x] **3e.** q2 cutover (branch `braid/bd-egcyeym9-error-reporting-cutover`):
349+
flipped `[workspace.dependencies.quarto-error-reporting]` `path`
350+
`version = "0.1.0"`; consolidated the 7 plain path-deps onto `{ workspace =
351+
true }`; the WASM crate (excluded standalone workspace) → `{ version =
352+
"0.1.0", features = ["json"] }`; the json consumers (`quarto`, `quarto-core`,
353+
`quarto-preview`) kept their `features = ["json"]` (now resolving to the
354+
external crate); deleted in-tree `crates/quarto-error-reporting`.
355+
`quarto-error-catalog` now depends on the external crate. Cargo.lock resolves
356+
`quarto-error-reporting 0.1.0` + transitively `quarto-source-map 0.1.0` from
357+
the registry. `cargo nextest run --workspace` **10177 passed**; **full
358+
`cargo xtask verify` GREEN** (all 14 steps incl. WASM — precache succeeded,
359+
bundle under limit).
360+
361+
**Phase 3 is COMPLETE.** Both foundation crates (`quarto-source-map`,
362+
`quarto-error-reporting`) are now published to crates.io from their own
363+
`posit-dev/` repos and consumed by q2 as version deps. The q2 tree keeps
364+
`quarto-error-catalog` (the `Q-*` policy) + the 4 json consumers. Next up: the
365+
YAML stack (`quarto-yaml` + `quarto-yaml-validation`) per the sibling plan.
366+
- [x] **3f.** Updated `CLAUDE.md` crate layout: `quarto-error-reporting` +
367+
`quarto-source-map` moved to an "Externalized foundation crates" section
368+
(published from `posit-dev/`); added `quarto-error-catalog`. (Workspace member
369+
list needs no edit — the in-tree crate was pulled in via the `crates/*` glob,
370+
so deleting the directory removes it.)
342371

343372
## Decisions
344373

crates/pampa/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tree-sitter = { workspace = true }
4040
tree-sitter-qmd = { workspace = true }
4141
comrak = { version = "0.52.0", default-features = false }
4242
comrak-to-pandoc = { path = "../comrak-to-pandoc" }
43-
quarto-error-reporting = { path = "../quarto-error-reporting" }
43+
quarto-error-reporting = { workspace = true }
4444
quarto-source-map = { workspace = true }
4545
quarto-yaml = { path = "../quarto-yaml" }
4646
quarto-config = { path = "../quarto-config" }

crates/quarto-citeproc/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "Citation processing engine using CSL styles"
88

99
[dependencies]
1010
quarto-csl = { path = "../quarto-csl" }
11-
quarto-error-reporting = { path = "../quarto-error-reporting" }
11+
quarto-error-reporting = { workspace = true }
1212
quarto-pandoc-types = { path = "../quarto-pandoc-types" }
1313
quarto-source-map = { workspace = true }
1414
quarto-xml = { path = "../quarto-xml" }

crates/quarto-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description = "Configuration merging with source tracking for Quarto"
1515
quarto-source-map = { workspace = true }
1616
quarto-yaml = { path = "../quarto-yaml" }
1717
quarto-pandoc-types = { path = "../quarto-pandoc-types" }
18-
quarto-error-reporting = { path = "../quarto-error-reporting" }
18+
quarto-error-reporting = { workspace = true }
1919
indexmap = "2.13"
2020
thiserror = { workspace = true }
2121
yaml-rust2 = { workspace = true }

crates/quarto-csl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository.workspace = true
88
description = "CSL (Citation Style Language) parsing with source tracking for Quarto"
99

1010
[dependencies]
11-
quarto-error-reporting = { path = "../quarto-error-reporting" }
11+
quarto-error-reporting = { workspace = true }
1212
quarto-source-map = { workspace = true }
1313
quarto-xml = { path = "../quarto-xml" }
1414
thiserror = { workspace = true }

crates/quarto-doctemplate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ quarto-treesitter-ast = { workspace = true }
2121

2222
# Error reporting infrastructure
2323
quarto-parse-errors = { path = "../quarto-parse-errors" }
24-
quarto-error-reporting = { path = "../quarto-error-reporting" }
24+
quarto-error-reporting = { workspace = true }
2525
quarto-source-map = { workspace = true }
2626

2727
# Serialization (for TemplateValue conversion from JSON)

0 commit comments

Comments
 (0)