Wrapper around sqlformat-rs for use as a dprint formatting plugin.
cargo test— run all testscargo build --target wasm32-unknown-unknown --features wasm --release— build the wasm plugincd deployment/npm && node setup.js && npm test— test the npm package (requires wasm build first)
src/format_text.rs— core formatting logic, delegates tosqlformat::format()src/wasm_plugin.rs— dprint wasm plugin interface (compiled only for wasm32 target withwasmfeature)src/configuration/— config types, resolution, and builderdeployment/npm/— npm package that shipsplugin.wasmdeployment/schema.json— JSON schema for plugin configurationscripts/update.ts— Deno script that checks crates.io for new sqlformat versions and auto-publishesscripts/generateReleaseNotes.ts— generates changelog for GitHub releases
When sqlformat-rs adds new options:
- Add the field to
Configurationinsrc/configuration/configuration.rs(add enums withgenerate_str_to_from!if needed) - Add resolution in
src/configuration/resolve_config.rsusingget_value() - Add a builder method in
src/configuration/builder.rsand update thecheck_all_values_settest - Wire it through in
src/format_text.rswhen constructingFormatOptions - Add the property to
deployment/schema.json - Add a spec test file in
tests/specs/Config/
Spec files live in tests/specs/ and use the dprint-development format:
== message ==starts a test case[expect]separates input from expected output~~ key: value, key: value ~~at the top of a file sets config for all specs in that file- Each config variation needs its own file since config is file-level
- Manual: trigger the
releaseworkflow with patch/minor - Automatic:
check_updatesworkflow runs daily, detects new sqlformat versions, and auto-publishes - On tag push: CI creates a GitHub release with
plugin.wasm, andpublish_npmpublishes to npm