feat: recognize .msix / .msixbundle assets and 'msix' package format - #46
Merged
Conversation
Reimplementation of #26 on the unified ReleaseService resolution pipeline (msix as a first-class package format on the discrete {os, arch, pkg} model): - SUPPORTED_FILE_EXTENSIONS gains .msix / .msixbundle; getDownloadExtensionsByOs("windows", "msix") returns [".msixbundle", ".msix"], preferring the multi-arch bundle. - PACKAGE_FORMATS gains "msix"; filenameToPackageFormat detects both extensions; new filetypeToPackageFormat maps ?filetype=msix|msixbundle to the msix pkg at the HTTP edge (other filetypes keep their platform-default semantics). - filenameToOperatingSystem maps .msix / .msixbundle to windows; filenameToArchitecture treats .msixbundle as universal (multi-arch by definition), single-arch .msix derives arch from the filename suffix. - New composite platform ids windows_msix{,_32,_64,_universal} so msix assets survive ingestion; arm64 .msix drops like any arm64 windows asset. - assetMatchesPlatform: a universal msix asset satisfies any windows arch when msix is explicitly requested; default windows flows (pkg "default") never widen to msix, so Squirrel clients keep resolving the .exe when msix assets are published alongside it. - /update/:platform/:version?filetype=msix serves the existing Squirrel.Mac-shaped JSON that Electron 41+'s MSIX autoUpdater consumes; /download/...?filetype=msix and /dl/windows/:arch?pkg=msix route to the assets. The Squirrel.Windows RELEASES/.nupkg path is untouched. Co-Authored-By: Jeff Robbins <321284+jjeff@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019F5tixJXBm2R1FAjAfH1se
4 tasks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019F5tixJXBm2R1FAjAfH1se
There was a problem hiding this comment.
Pull request overview
Adds first-class MSIX support to Pecans’ discrete {os, arch, pkg} resolution pipeline so Electron 41+ MSIX autoUpdater clients can request updates via ?filetype=msix|msixbundle and resolve to .msix / .msixbundle assets without affecting default Windows (Squirrel/.exe) behavior.
Changes:
- Extend detection + platform modeling to recognize
.msix/.msixbundle, introducepkg: "msix", and ingest MSIX assets aswindows_msix_*platforms. - Update resolution semantics so universal
.msixbundlecan satisfy arch-specific Windows requests only whenpkg: "msix"is requested, while default Windows flows remain.exe. - Add end-to-end integration coverage and documentation for MSIX update/download routes.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/unit/SupportedFileExtension.spec.ts | Adds MSIX/MSIXBUNDLE extension coverage and Windows msix download-extension expectations. |
| test/unit/service.spec.ts | Adds parsePlatform, matching, and resolution tests for msix (including universal bundle widening under pkg: "msix"). |
| test/unit/platforms.spec.ts | Verifies filename→platform resolution for .msix/.msixbundle including arm64 drop behavior. |
| test/unit/PackageFormat.spec.ts | Expands PackageFormat to include msix and tests filetypeToPackageFormat. |
| test/unit/OperatingSystem.spec.ts | Adds OS detection expectations for .msix/.msixbundle as Windows. |
| test/unit/github.spec.ts | Ensures GitHub backend normalization retains msix assets alongside exe assets. |
| test/unit/Architecture.spec.ts | Adds .msixbundle→universal and .msix suffix arch detection tests. |
| test/integration/msix.spec.ts | New integration suite covering update/download/dl behavior for MSIX end-to-end. |
| src/utils/SupportedFileExtension.ts | Adds supported extensions and Windows pkg=msix download-extension preference ordering. |
| src/utils/platforms.ts | Adds windows_msix* platform IDs and allows filenameToPlatform to encode msix as a pkg segment. |
| src/utils/PackageFormat.ts | Adds msix package format detection + filetypeToPackageFormat mapping for HTTP filetype. |
| src/utils/OperatingSystem.ts | Recognizes .msix/.msixbundle as Windows. |
| src/utils/Architecture.ts | Treats .msixbundle as universal by definition. |
| src/service.ts | Allows universal msix assets to satisfy arch-specific Windows filters when pkg: "msix". |
| src/http/updates.ts | Applies msix pkg implication based on ?filetype=... for the Squirrel.Mac-shaped update feed. |
| src/http/downloads.ts | Applies msix pkg implication at the legacy /download/* HTTP edge when ?filetype=msix*. |
| docs/update-windows.md | Documents Electron 41+ MSIX update usage and how it interacts with default Windows behavior. |
filetypeToPackageFormat accepts ?filetype=MSIX case-insensitively, but the handler embedded the caller's casing into the generated download url, which the download route's case-sensitive filetype validation then rejects with a 400. Lowercase the filetype before both the pkg mapping and the feed url. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019F5tixJXBm2R1FAjAfH1se
The filetype->pkg implication belongs to platform-based resolution; an explicit :filename already identifies the asset and its package format, so a stray ?filetype=msix on an .exe filename request must not narrow release resolution (previously a 404 when no msix assets exist). Also reword the filetypeToPackageFormat doc comment: internal windows_msix* composite ids exist for ingestion, they're just not part of the legacy request vocabulary. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019F5tixJXBm2R1FAjAfH1se
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 21, 2026
# [2.0.0-next.18](v2.0.0-next.17...v2.0.0-next.18) (2026-07-21) * feat!: unified ReleaseService resolution pipeline on discrete os/arch/pkg (Phase 7 PR B) ([#44](#44)) ([8a2f06a](8a2f06a)) ### Bug Fixes * **github:** default octokit to native fetch to prevent empty release lists ([#28](#28)) ([0f6eac6](0f6eac6)) * honor route params in downloads, dead code removal, small fixes (Phase 2) ([#31](#31)) ([9fd8f79](9fd8f79)) * semantic-release trusted publishing ([4f1ee88](4f1ee88)) * semantic-release trusted publishing ([#53](#53)) ([3d4d4ce](3d4d4ce)) * working generic refresh webhook; document raw as the backend-private asset slot (Phase 7 PR A) ([#43](#43)) ([23d1d9f](23d1d9f)) ### chore * esm only ([#24](#24)) ([1b8a546](1b8a546)) ### Features * dependency modernization — Express 5, octokit 22, remove UA autodetection (Phase 5) ([#41](#41)) ([8ea329a](8ea329a)) * modernize packaging and dev tooling (Phase 3) ([#32](#32)) ([3345ed7](3345ed7)) * recognize .msix / .msixbundle assets and 'msix' package format ([#46](#46)) ([4f848b9](4f848b9)), closes [#26](#26) * typed HTTP errors with router-scoped error handling (Phase 6) ([#42](#42)) ([e3b7b54](e3b7b54)) ### BREAKING CHANGES * @dopry/pecans is now ESM-only. require('@dopry/pecans') is no longer supported; use import (Node >= 22.12). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017zXcPSv6FFTPgD59T4KudM * refactor: import model types with import type in runtime modules Follows up on Copilot review: PecansRelease/PecansReleases (and other names used only in type positions) are classes, so tsc accepts plain imports, but with verbatimModuleSyntax they would stay in the emitted JS as runtime imports. Convert the type-only usages to import type to keep the runtime module graph minimal and cycle-free. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017zXcPSv6FFTPgD59T4KudM * Pecans no longer exposes a versions property. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * feat!: remove the Versions and resolveReleaseAssetForVersion adapters The deprecation shims this PR introduced are dropped instead of carried to 3.0: route handlers and consumers resolve through ReleaseService / resolveAssetForRelease directly. The table-driven specs that pinned the legacy composite-id resolution semantics are migrated onto the pipeline (via platformToQuery) so the behavioral pins survive the adapter removal; unique Versions coverage moved into service.spec. Pre-existing deprecations (GitHubBackend, PecansSettings.timeout, PecansReleaseDTO.channel) keep their 3.0 schedule. * Versions, VersionFilterOpts, PlatformQuery, and resolveReleaseAssetForVersion are no longer exported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * getArchFromUserAgent, getOsFromUserAgent, and getPlatformFromUserAgent now take the internal UserAgentDetails type instead of express-useragent's Details, and getArchFromUserAgent defaults Windows and Linux to '64' (32-bit desktops are effectively extinct; the function is not used internally). pecans consumed exactly four booleans from the unmaintained express-useragent package; src/utils/userAgent.ts derives them from the User-Agent header directly, with mobile exclusions the old library handled via separate flags (iOS UAs contain 'like Mac OS X', Android UAs contain 'Linux'). The middleware attaches the same req.useragent shape. Unit specs cover the parser; the Phase 1 UA-driven download contract tests pass unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: validate update-route params through getStringParam consistently Review feedback: handleUpdateOSX truthiness-checked req.params directly but read values through getStringParam, and handleUpdateWin had no version guard at all; a missing tag would have produced a '>=undefined' range. Validate once through the helper and reuse the validated values. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: exclude Macintosh+Mobile webview UAs from macOS detection Review feedback (partial): a Mobile token alongside Macintosh indicates an iPad-class webview masquerading as a Mac; genuine macOS browsers never send it. Fixture + test added. Note true iPadOS desktop-mode UAs are byte-identical to Mac Safari and undetectable by any parser. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: short-circuit dlfilename when the filename param is absent Review feedback: an undefined filename passed into queryReleases matches every release (the predicate treats undefined as no-filter), which would serve an arbitrary asset instead of a 404. Unreachable via the current route but guarded for consistency with the update handlers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * feat: remove user-agent platform autodetection * selecting a platform is now the client's responsibility. GET / is no longer a download route, and the platform segment is required on /download, /download/version/:tag, and /download/channel/:channel (a missing platform returns 400). The user-agent parser, its middleware, and the getPlatformFromUserAgent / getArchFromUserAgent / getOsFromUserAgent helpers are removed. Autodetection only ever served bare browser links - Squirrel update clients and /dl/* always send explicit platforms - and reliable device detection is better handled client-side where UA Client Hints are available. Reverting this commit restores the feature wholesale if anyone misses it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: remove imports orphaned by the autodetection removal Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: validate tag ranges early in validateReqQueryTag Review feedback: validRange's result was discarded, so invalid tags only failed deep in release matching with a generic 'Invalid Range Specified' error. Invalid ranges now throw UnsupportedTagError at the parameter boundary ('latest' stays allowed), and the error message no longer says 'channel' for tags (copy-paste from UnsupportedChannelError). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * build output moves from dist/cjs + dist/mjs to a tsup bundle (dist/index.js CJS, dist/index.mjs ESM). Deep imports into dist paths no longer resolve; all models (PecansRelease, PecansAsset, PecansReleases, ...) are now exported from the package root instead. - replace the dual-tsc + fixup.sh build with tsup (CJS + ESM + d.ts + sourcemaps, node22 target); consolidate four tsconfigs into one typecheck-only tsconfig.json - add a proper exports map with types for both module systems; verified with publint and arethetypeswrong (all green: node10/node16/bundler) - declare debug and qs as real dependencies - both are imported directly but were only present transitively via express, which broke the ESM bundle (inlined CJS require calls) - guard the run-directly check with typeof require so the ESM build is importable; node dist/index.js still starts the server - ts-node out of runtime dependencies; dev now runs tsx watch; start runs the compiled dist; drop nodemon - ESLint 9 flat config + prettier (replaces the stale mocha-era .eslintrc); fix the 19 findings it surfaced (unused imports/vars, case-block declarations, error causes, no-useless-assignment) - add explicit @types/node; add lint/format/typecheck scripts - package.json: type commonjs, sideEffects false, canonical repo url Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: rank .tar.gz assets by their full extension in resolveForVersion path.extname reports '.gz' for .tar.gz filenames, so the sort fallback ranked them at prefs.indexOf(-1) - ahead of every genuine preference - whenever .tgz and .tar.gz assets coexisted. Use getSupportedExt, which handles the double extension, matching the Phase 2 fix to PecansAsset.satisfiesExtensions. Regression test added. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: throw Error from configure(), correct Listening typo Review feedback: the default switch case in configure() threw a raw string (no stack trace); the startup log said 'Lisening'. The test that pinned the typo is updated to match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM * fix: throw on invalid os in getDownloadExtensionsByOs Review feedback: the switch had no default, so an invalid OperatingSystem cast in at runtime silently returned undefined against the declared SupportedFileExtension[] return type. Fail loudly instead; edge-case test updated to pin the throw. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015zUyj4PpSog9RkrYxzFRhM
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
Supersedes #26 (thanks @jjeff for the original contribution — authorship is credited via
Co-Authored-Byon the commit). That PR was written against the pre-refactor codebase and can't be rebased mechanically:nexthas since replacedversions.ts/resolveForVersion.tswith the unifiedReleaseServicepipeline on the discrete{os, arch, pkg}model (#41–#45), and the PR's head lives on a fork branch this session can't push to. This PR reimplements the same feature idiomatically on the new architecture, preserving the external contract #26 established.Pecans can now act as the update server for an Electron 41+ app packaged as MSIX: the
/update/:platform/:versionendpoint already emits the Squirrel.Mac-shaped{url, name, notes, pub_date}JSON that Electron's MSIXautoUpdaterconsumes — Pecans just needs to recognize.msix/.msixbundleassets and route to them when the client asks for themsixfiletype.Changes
SUPPORTED_FILE_EXTENSIONSgains.msix/.msixbundle;PACKAGE_FORMATSgainsmsix;filenameToOperatingSystemmaps both extensions towindows;filenameToArchitecturetreats.msixbundleasuniversal(multi-arch by definition) while single-arch.msixderives arch from the filename suffix (_x64,_arm64,_x86);getDownloadExtensionsByOs("windows", "msix")returns[".msixbundle", ".msix"], preferring the bundle.windows_msix_64/windows_msix_32/windows_msix_universal(newPLATFORMSentries), exactly likelinux_deb_64. This is what makes them reachparsePlatform/assetMatchesPlatformcleanly. arm64.msixassets drop at ingestion like any other arm64 windows asset.assetMatchesPlatform): a universal msix asset satisfies any windows arch only when msix is explicitly requested (pkg: "msix"); default windows flows (pkg: "default") never widen to msix, so a.msixbundle-only release counts toward msix availability but never toward default availability. (feat: recognize .msix / .msixbundle assets and 'msix' package format #26's ingestion-order fix made bundle availability unconditional — a bundle-only release would 200 on a default update request and then 404 on the download; the discrete model lets us return an honest 204 instead.)filetypeToPackageFormatmaps?filetype=msix|msixbundletopkg: "msix"on the update and composite download routes. Other filetypes (deb,rpm,zip…) deliberately imply no pkg, preserving their existing platform-default semantics. The discrete route gets msix for free:/dl/windows/64?pkg=msixand/dl/windows/universal?pkg=msix.docs/update-windows.md.Downstream compatibility
[".exe"]unless msix is explicitly requested — pinned by a regression test with.exe+.msix+.msixbundlepublished side by side.RELEASES/.nupkgpath is untouched.PackageFormat/SupportedFileExtension/Platformunions widen, which only affects TypeScript consumers doing exhaustive switches — semver-minor.Test plan
normalizeReleaseingestion seam, service-level resolution semantics)test/integration/msix.spec.tscovers the feature end-to-end through the HTTP surface: Squirrel.Mac-shaped 200/204s for?filetype=msix|msixbundle, feed-url → bundle download resolution, bundle-only releases satisfying arch-specific clients, default flows still serving the.exe, and the/dl+/dl/:filenameroutesnext),tsc --noEmitclean,eslintcleanNotes
Server-side half of MSIX support for spaceagetv/missioncontrol (Visibox). References: Electron 41 release notes, electron/electron#49230.
🤖 Generated with Claude Code
https://claude.ai/code/session_019F5tixJXBm2R1FAjAfH1se
Generated by Claude Code