fix(config): drain dist-archive substreams before zipping#3660
Merged
Conversation
The release `jspsych.zip` archive has been silently dropping the alphabetical tail of `dist/*.js` (e.g. `plugin-survey-multi-*`, `plugin-video-*`, `plugin-virtual-chinrest`, `plugin-visual-search-circle`, the `plugin-webgazer-*` plugins) and some `examples/*.html` files since the gulp examples-source split for the binary-encoding fix. Under gulp 5 (streamx-based Vinyl), `merge-stream` races with `gulp-zip`: the zip sink finalizes before slow upstreams flush, notably the 3 MB `plugin-survey/dist/index.browser.js`. The cutoff drifts run-to-run. Drain each substream into a vinyl array first, then feed `gulp-zip` from a single `Readable.from(...)` so every file is in hand before the archive starts.
🦋 Changeset detectedLatest commit: 181d006 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The async `createCoreDistArchive` returned the `dest()` stream from a Promise, which async-done resolves by value rather than by re-handling the stream. That meant gulp could mark the task done before `dist.zip` finished flushing to disk, risking truncated reads from chained tasks or CI artifact uploads. Await `finish`/`end` on the write stream before resolving the task.
Contributor
📦 Preview build readyBuilt from PR head Changed packages: Quick-start HTML: <script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/jspsych/dist/index.browser.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/jspsych/css/jspsych.css">
<script src="https://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-keyboard-response/dist/index.browser.min.js"></script>All package URLs
Last updated 2026-05-06 15:27 UTC for PR head |
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.
Fixes #3659.
Summary
Recent
jspsych.ziprelease archives have been silently dropping the alphabetical tail ofdist/*.js(e.g.plugin-survey-multi-*,plugin-video-*,plugin-virtual-chinrest,plugin-visual-search-circle, theplugin-webgazer-*plugins) along with someexamples/*.htmlfiles, with the cutoff drifting between runs. Under gulp 5's streamx-based Vinyl,merge-streamcan race withgulp-zipso the zip sink finalizes before slow upstreams (notably the 3 MBplugin-survey/dist/index.browser.js) have flushed. Anything not yet emitted is silently dropped.This PR replaces
merge-streamincreateCoreDistArchivewith acollectFiles()helper that drains each substream into a vinyl array up front, then feeds the flattened list intogulp-zipvia a singleReadable.from(...)stream. Same set of source globs and transforms; only the merge → zip pipeline is changed.packages/config/gulp.js— drain substreams before zipping.packages/config/package.json— drop the now-unusedmerge-streamdependency..changeset/dist-archive-no-merge-stream.md— patch changeset against@jspsych/config.See #3659 for the full investigation, including counts from
vsr-2.1.1(57 / complete),config-3.3.2(47 / 10 missing) andjspsych@8.2.3(46 / 11 missing) and the regression window matching PR #3615.Test plan
npm ci && npm run build && npm run build:archivefrom a clean checkoutunzip -l dist.zip | grep "dist/" | grep -E "\\.js$" | wc -lreturns 57 (53 plugins + 3 extensions +jspsych)examples/*.htmlfiles are present indist.zipexamples/img/are still byte-identical to source (sanity check that the fix images encoding in dist zip #3615 fix is preserved)Generated by Claude Code