This page captures the workspace-level development and test workflow for docxly.
npm package:
- package name:
@docxly/core-rs - runtime target: Node + Browser
- public npm APIs:
generateDocx(markdown, options) -> Promise<Uint8Array>generateHwpx(markdown, options) -> Promise<Uint8Array>as a beta surface for the current approved HWPX content baseline- npm HWPX currently exposes
title,author, andstrictMode, but not the Rust HWPX style override surface
Rust crate:
- source of truth:
packages/core-rs - publication status: not currently published to
crates.io - use cases today:
- use
@docxly/core-rsfrom npm for Node and browser runtimes - use the Rust crate from this repository workspace or as a path dependency
- use
Install workspace dependencies from the repository root:
npm installCommon root commands:
npm run build:web
npm run test:web
npm run demo
npm run build:pages
npm run test:allWhat each command does:
build:web: builds the npm WASM wrapper packagetest:web: runs Node, browser bundle, and packed package smoke testsdemo: builds the Pages artifact and serves the browser demo locallybuild:pages: creates the static GitHub Pages artifact atpackages/npm-core-rs/site-disttest:all: runs Rust lint, Rust tests, and web smoke tests from one root entrypoint
Run the Rust workspace tests from the repository root:
cargo testRun tests for the crate only:
cargo test -p core-rsRun only the internal HWPX parser tests:
cargo test -p core-rs parser::hwpxRun a single integration test target:
cargo test -p core-rs --test docx_testRun strict lint checks for the crate:
cargo clippy -p core-rs --all-targets -- -D warningsInspect an HWPX archive from the repository tooling path:
cargo run -p core-rs --bin decode_hwpx -- --parse path/to/sample.hwpxUseful flags:
--help: print CLI usage--parse: print the internal semantic dump instead of raw XML console output--out <directory>: extract the package to disk for inspection
The project uses golden DOCX fixtures plus normalized hashing instead of comparing raw archive bytes.
Test checks include:
- the generated archive can be unzipped
- required DOCX entries exist
- XML files are well-formed
golden.docxnormalizes to the committedexpected/tree- normalized SHA-256 hash matches the committed
hash.txt - generated output normalizes to the same contents as
golden.docx
Fixture files currently live under:
packages/core-rs/tests/fixtures/
Each DOCX fixture directory contains:
input.md
fixture.toml
golden.docx
expected/
hash.txt
golden.docx is a read-only baseline. There is no general-purpose command in the normal workflow that rewrites approved golden fixtures.
HWPX adds a second repository-level strategy on top of the golden generation checks:
- approved HWPX fixtures are release-gate goldens
- the internal parser reverse-parses approved
golden.hwpxfiles back into the internalDocumentmodel - parser tests use fixture-specific expected documents instead of relying on the Markdown parser as a runtime oracle
- malformed archives and unsupported HWPX structures are expected to fail fast
- Keep README content and Git commit messages in English.
- Prefer adding tests before implementation changes.
- Keep archive output deterministic so fixture hashes remain stable.
- Keep new public surface area small. High-level generation functions and option types are the supported API.
- Keep repo-only debugging paths such as
decode_hwpx --parseout of the stable public contract. - npm release is gated by a successful WASM build in CI.
- GitHub Pages deploys the static demo from the mono repo using a dedicated Pages workflow.