Repository navigation
Releases
CAD Viewer 0.8.4
CAD Viewer 0.8.4 preserves authored MTEXT box width and line spacing, handles CAD text escapes, and renders supported embedded HATCH line and dot patterns. It includes DXF text-decoding and layer-table fixes and requires DWF Viewer 0.6.8 for complete loading of the drawing reported in #2.
v0.8.3
Fix CAD declarations for strict NodeNext and Bundler consumers by using explicit ESM import paths. A separate browser entry retains the stylesheet while the public declaration entry remains compatible with TypeScript consumers.
Validation passed: both pull request and main-branch CI checks, 44 regression tests, 10 publishing guard tests, WASM checks, and normal npm pack validation.
v0.8.2
v0.8.1
v0.8.0 - CAD BOM extraction
Highlights
- Extract typed BOM data from DWG and DXF block attributes, MINSERT quantities, cached CAD tables, DataTable, optional XDATA/XRECORD sources, and high-confidence text grids.
- Use
CadViewer.getBom()orextractCadBom(), then export spreadsheet-safe CSV or JSON. - Inspect and export BOM tables directly from the demo.
- Upgrade LibreDWG WebAssembly to 0.7.9 and keep valid drawings loading when complex linetypes contain a null STYLE reference.
- Restore handleless R12 DXF attribute ownership and bound malformed table, metadata, and recursive-quantity workloads.
DWF, DWFx, and XPS preview remains supported, but those native render paths do not expose normalized BOM metadata yet.
npm install @flyfish-dev/cad-viewer@0.8.0v0.7.0 - External SHX references
Highlights
- Added complete external SHX reference handling for complex DWG linetypes, with missing/incompatible state reporting, browser-local parsing, required-glyph validation and cached shape/text outline rendering.
- Added
onReferenceStateChange,addReferenceFile(),addReferenceBuffer()and the reference lifecycle/query APIs. The demo now exposes a contextual SHX upload control. - Corrected block-contained geometry after PLAN/UCS transforms, including text and INSERT angles, closed and wide polylines, linetype scale inheritance, dash phase and SHX glyph placement.
- Canvas2D and retained WebGL rebuild supplied reference geometry without resetting the current view.
Verification
- GitHub CI passed on Node.js 22.
- TypeScript checks, production library/demo builds and all 13 regression tests passed.
- LibreDWG and DWF WASM assets were verified.
- The 65-file npm package was inspected and production dependencies report 0 known vulnerabilities.
- The supplied DWG was exercised in both WebGL and Canvas2D with missing-reference fallback and post-upload redraw.
Install
npm install @flyfish-dev/cad-viewer@0.7.0Exact complex-linetype symbols require the original SHX file referenced by the drawing; unavailable or incompatible files retain the safe marker fallback.
v0.6.6 - Smarter DWG initial fit
Highlights
- Fixed DWG files whose valid geometry is split across widely separated coordinate clusters. The default initial view now focuses on meaningful content inside a valid active VPORT instead of shrinking the main sheet into a dot.
- Added
fitMode: 'auto' | 'saved-view' | 'extents'andviewer.fit(mode)for automatic content fitting, exact saved-view restoration, or complete drawing extents. - Unified bounds and fit behavior across the retained WebGL renderer and Canvas2D fallback.
Verification
- TypeScript typecheck and production library/demo builds passed.
- All 9 DWG normalization and rendering regressions passed.
- Runtime WASM assets and the 63-file npm package were verified.
Install
npm install @flyfish-dev/cad-viewer@0.6.6v0.6.5 - DWG saved views and linetypes
Highlights
- Preserves active DWG VPORT/header UCS saved views and applies safe planar scene transforms exactly once.
- Adds LTYPE normalization and rendering for dashed, dotted, BYLAYER, and BYBLOCK patterns in Canvas2D and WebGL.
- Preserves converter-specific closed-polyline flags and stable linetype scaling.
- Adds
getSourceDocument()plus public line-pattern and scene helpers. - Adds eight DWG normalization regression tests and a stricter prepublish gate.
Compatibility and safety
- Invalid, non-finite, missing, or tilted
VIEWDIRvalues retain WCS coordinates and emit a warning. - Complex SHX linetype glyphs use a marker approximation.
- Microscopic or corrupt patterns fall back to visible source edges.
Verification
npm testnpm run buildnpm run check:wasmnpm run pack:dry- Production browser smoke test and runtime asset checks
See CHANGELOG.md for the full change list.
v0.6.4 - Stable DWG worker asset
Highlights
- Added the package export
@flyfish-dev/cad-viewer/wasm/dwg-worker.jsfor copying runtime assets from npm packages. - Changed default DWG worker loading to the page-relative runtime asset
wasm/dwg-worker.js, avoiding bundler-generated worker chunk assumptions. - Updated dev, demo, npm package and Cloudflare Pages build flows to build and copy the same DWG worker runtime asset.
- Prevented stale public worker files from overwriting the freshly built package worker during library asset copying.
Verification
npm run buildnpm run check:wasmnpm run pack:dry- Local Vite preview smoke test for
/,/wasm/dwg-worker.js,/wasm/libredwg-web.js,/wasm/libredwg-web.wasmand/wasm/dwfv-render.wasm - Published npm package:
@flyfish-dev/cad-viewer@0.6.4 - Published Cloudflare Pages demo: https://cad-viewer-iys.pages.dev
v0.6.3 - DXF codepage decoding
Highlights
- Added
dxfEncodingtoCadLoadOptionsfor explicit legacy DXF text decoding. - Made DXF loading codepage-aware: explicit encoding, BOM and
$DWGCODEPAGEare honored before legacy fallback candidates. - Fixed Chinese DXF decoding cases that previously fell through to lossy ISO-8859-1-style text.
- Normalized common CAD text escapes in DXF text entities:
\U+XXXX,%%c,%%d,%%pand\P.
Published Artifacts
- npm:
@flyfish-dev/cad-viewer@0.6.3 - Cloudflare Pages stable demo: https://cad-viewer-iys.pages.dev
- Cloudflare deployment: https://93c1c883.cad-viewer-iys.pages.dev
- Commit:
38b3330dcee32fdbfdce85c07e9c98020df73e03 - Release asset SHA256:
af20a83df17fddbf51a3466f79735479bfeab3b039c5507791686ced317521ee
Verification
npm run typechecknpm run build- Built-package DXF smoke test for ANSI_936 / GB18030 text plus CAD escapes
npm run check:wasmnpm run pack:drynpm audit --omit=dev --audit-level=moderatereports 0 runtime vulnerabilities- npm registry verification for latest
0.6.3 - Cloudflare Pages deployment verification
npm audit --audit-level=moderate still reports esbuild advisories through dev-only Vite/Wrangler tooling. The available automatic fix requires a breaking Vite major upgrade, so this patch release keeps the current toolchain and ships with clean runtime dependency audit results.