Repository navigation
feat: ship raw binaries (not zips) in npm process-plugin packages - #5
Merged
Merged
Conversation
dprint now supports referencing a raw executable from a process plugin's per-platform npm sub-package (no zip wrapper required), so `createDprintOrgNpmPackages` was placing an unnecessary intermediate .zip into each sub-package. Changes: - `CreateDprintOrgNpmPackagesOptions.platforms[].zipFilePath` renamed to `binaryPath` (breaking). - The binary is copied verbatim into the sub-package under its basename and marked executable (mode 0o755) on Unix; the main package's plugin.json references it as `npm:<sub>@<version>/<basename>` instead of `.../plugin.zip`. - Generated `package.json` files put `name` and `version` at the top, then caller-supplied `packageJsonExtra`, then managed platform/dependency fields. Extras still can't override managed fields. Tests updated to use binary fixtures and assert the new reference format. New test pins the `name`/`version`-at-top contract. Note: cross-OS publishing caveat — when running `npm pack` from Windows, the binary will be packed without the Unix executable bit because the host filesystem can't carry that mode. Publish from a Unix host (CI is Ubuntu) for correctness.
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 now supports referencing a raw executable from a process plugin's per-platform npm sub-package, so the helper no longer needs to wrap the binary in a
.zip. Two changes:Raw binaries in sub-packages.
CreateDprintOrgNpmPackagesOptions.platforms[].zipFilePathis renamed tobinaryPath(breaking — only one PR was using it). The file atbinaryPathis copied verbatim into the sub-package under its basename, marked executable (mode 0o755) on Unix, and referenced from the main package'splugin.jsonasnpm:<sub-package>@<version>/<basename>instead of.../plugin.zip.nameandversionat the top ofpackage.json. Generatedpackage.jsonfiles now order keys as:name,version, then caller-suppliedpackageJsonExtra(any fields that collide with managed keys are dropped), then managed platform/dependency fields (os/cpu/libcfor sub-packages,optionalDependenciesfor the main).Caveats
npm pack/publishfrom Windows packs files without the Unix executable bit, because the host filesystem can't carry that mode. CI on Ubuntu is fine; for local bootstrap publishes, use a Unix host.PluginFileBuilderAPI is unchanged — thezipFilePath/zipUrlparameter names are now slightly misleading (they accept any file) but the behavior is general and renaming would breakcreate_plugin_file.tsstyle callers that still ship zips via GitHub releases.Test plan
deno test -P— 7/7 pass, including a new test pinning thename/version-at-top contract and updated assertions for the new reference URL format.deno check/dprint checkclean.dprint-plugin-exec'screate_npm_packages.tswill be updated to extract the platform zips and pass the binaries through to the helper.