Add portable PowerShell formatter packages - #1
Merged
Merged
Conversation
Provide a parser-backed formatter core without runspace or session-state requirements, plus a trimmed WebAssembly package for browsers and Node.js.
Describe the API, isolation boundary, build workflow, security model, and current `Invoke-Formatter` parity so contributors can extend and validate the portable formatter without reverse-engineering the code.
Compile the C# formatter into one dprint ABI module with an embedded Mono runtime and internal WASI shims, so dprint can load it without a process host. Pin reproducible tools and validate the artifact, schema, diagnostics, UTF-8 handling, and idempotence while documenting both WASM outputs.
Derive published metadata from the assembly version, embed the full MIT license, and validate the schema identity so registry updates stay in lockstep with the release artifact. Document installation and immutable releases, and publish the verified WASM, schema, and checksums only when a bare-semver tag matches the plugin project version.
Group the formatter implementations under `Formatter`, expose the browser WASM package through typed ESM exports, and validate it with shared PowerShell release tooling. Add repository-local dprint orchestration and prefixed npm release workflow support so both WASM distributions use the pinned toolchain.
Use `dprint-<version>` tags so formatter releases cannot collide with PSScriptAnalyzer versions or the separate npm release namespace. Run every release step as valid PowerShell and surface native-command failures through GitHub workflow error annotations.
Provision the browser and WASI workloads before `build.ps1 -All` so the formatter projects compile on every Pester matrix runner.
Install the repository's `wasi-sdk` tool through mise and export `WASI_SDK_PATH` so the native dprint plugin links during `build.ps1 -All`.
This comment was marked as spam.
This comment was marked as spam.
Keep portable core and browser WASM builds on every CI runner, while restricting the native dprint link and its WASI SDK to Linux where the pinned toolchain provides clang.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dprint-andnpm-tag namespacesValidation
actionlint,actup check, anddprint check