Skip to content

fix(config): drain dist-archive substreams before zipping#3660

Merged
jodeleeuw merged 2 commits into
mainfrom
claude/investigate-missing-plugins-9NaKn
May 6, 2026
Merged

fix(config): drain dist-archive substreams before zipping#3660
jodeleeuw merged 2 commits into
mainfrom
claude/investigate-missing-plugins-9NaKn

Conversation

@jodeleeuw
Copy link
Copy Markdown
Member

Fixes #3659.

Summary

Recent jspsych.zip release archives have 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) along with some examples/*.html files, with the cutoff drifting between runs. Under gulp 5's streamx-based Vinyl, merge-stream can race with gulp-zip so the zip sink finalizes before slow upstreams (notably the 3 MB plugin-survey/dist/index.browser.js) have flushed. Anything not yet emitted is silently dropped.

This PR replaces merge-stream in createCoreDistArchive with a collectFiles() helper that drains each substream into a vinyl array up front, then feeds the flattened list into gulp-zip via a single Readable.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-unused merge-stream dependency.
  • .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) and jspsych@8.2.3 (46 / 11 missing) and the regression window matching PR #3615.

Test plan

  • npm ci && npm run build && npm run build:archive from a clean checkout
  • unzip -l dist.zip | grep "dist/" | grep -E "\\.js$" | wc -l returns 57 (53 plugins + 3 extensions + jspsych)
  • All examples/*.html files are present in dist.zip
  • Binary files in examples/img/ are still byte-identical to source (sanity check that the fix images encoding in dist zip #3615 fix is preserved)
  • Re-run the build a few times; counts stay stable

Generated by Claude Code

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-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 28, 2026

🦋 Changeset detected

Latest commit: 181d006

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@jspsych/config Patch

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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

📦 Preview build ready

Built from PR head 62c0208 and published at 418a649 on branch preview/pr-3660.
URLs below are pinned to an immutable commit SHA, so they are safe to share and are cached permanently by jsDelivr.

Changed packages: config

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
  • @jspsych/extension-mouse-trackinghttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/extension-mouse-tracking/dist/index.browser.min.js
  • @jspsych/extension-record-videohttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/extension-record-video/dist/index.browser.min.js
  • @jspsych/extension-webgazerhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/extension-webgazer/dist/index.browser.min.js
  • jspsychhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/jspsych/dist/index.browser.min.js
  • @jspsych/plugin-animationhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-animation/dist/index.browser.min.js
  • @jspsych/plugin-audio-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-audio-button-response/dist/index.browser.min.js
  • @jspsych/plugin-audio-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-audio-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-audio-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-audio-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-browser-checkhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-browser-check/dist/index.browser.min.js
  • @jspsych/plugin-call-functionhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-call-function/dist/index.browser.min.js
  • @jspsych/plugin-canvas-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-canvas-button-response/dist/index.browser.min.js
  • @jspsych/plugin-canvas-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-canvas-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-canvas-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-canvas-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-categorize-animationhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-categorize-animation/dist/index.browser.min.js
  • @jspsych/plugin-categorize-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-categorize-html/dist/index.browser.min.js
  • @jspsych/plugin-categorize-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-categorize-image/dist/index.browser.min.js
  • @jspsych/plugin-clozehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-cloze/dist/index.browser.min.js
  • @jspsych/plugin-external-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-external-html/dist/index.browser.min.js
  • @jspsych/plugin-free-sorthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-free-sort/dist/index.browser.min.js
  • @jspsych/plugin-fullscreenhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-fullscreen/dist/index.browser.min.js
  • @jspsych/plugin-html-audio-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-audio-response/dist/index.browser.min.js
  • @jspsych/plugin-html-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-button-response/dist/index.browser.min.js
  • @jspsych/plugin-html-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-html-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-html-video-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-html-video-response/dist/index.browser.min.js
  • @jspsych/plugin-iat-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-iat-html/dist/index.browser.min.js
  • @jspsych/plugin-iat-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-iat-image/dist/index.browser.min.js
  • @jspsych/plugin-image-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-image-button-response/dist/index.browser.min.js
  • @jspsych/plugin-image-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-image-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-image-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-image-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-initialize-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-initialize-camera/dist/index.browser.min.js
  • @jspsych/plugin-initialize-microphonehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-initialize-microphone/dist/index.browser.min.js
  • @jspsych/plugin-instructionshttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-instructions/dist/index.browser.min.js
  • @jspsych/plugin-maxdiffhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-maxdiff/dist/index.browser.min.js
  • @jspsych/plugin-mirror-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-mirror-camera/dist/index.browser.min.js
  • @jspsych/plugin-preloadhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-preload/dist/index.browser.min.js
  • @jspsych/plugin-reconstructionhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-reconstruction/dist/index.browser.min.js
  • @jspsych/plugin-resizehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-resize/dist/index.browser.min.js
  • @jspsych/plugin-same-different-htmlhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-same-different-html/dist/index.browser.min.js
  • @jspsych/plugin-same-different-imagehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-same-different-image/dist/index.browser.min.js
  • @jspsych/plugin-serial-reaction-time-mousehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-serial-reaction-time-mouse/dist/index.browser.min.js
  • @jspsych/plugin-serial-reaction-timehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-serial-reaction-time/dist/index.browser.min.js
  • @jspsych/plugin-sketchpadhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-sketchpad/dist/index.browser.min.js
  • @jspsych/plugin-survey-html-formhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey-html-form/dist/index.browser.min.js
  • @jspsych/plugin-survey-likerthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey-likert/dist/index.browser.min.js
  • @jspsych/plugin-survey-multi-choicehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey-multi-choice/dist/index.browser.min.js
  • @jspsych/plugin-survey-multi-selecthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey-multi-select/dist/index.browser.min.js
  • @jspsych/plugin-survey-texthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey-text/dist/index.browser.min.js
  • @jspsych/plugin-surveyhttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-survey/dist/index.browser.min.js
  • @jspsych/plugin-video-button-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-video-button-response/dist/index.browser.min.js
  • @jspsych/plugin-video-keyboard-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-video-keyboard-response/dist/index.browser.min.js
  • @jspsych/plugin-video-slider-responsehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-video-slider-response/dist/index.browser.min.js
  • @jspsych/plugin-virtual-chinresthttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-virtual-chinrest/dist/index.browser.min.js
  • @jspsych/plugin-visual-search-circlehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-visual-search-circle/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-calibratehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-webgazer-calibrate/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-init-camerahttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-webgazer-init-camera/dist/index.browser.min.js
  • @jspsych/plugin-webgazer-validatehttps://cdn.jsdelivr.net/gh/jspsych/jsPsych@418a649303c371a0c282feae48194430959b237f/packages/plugin-webgazer-validate/dist/index.browser.min.js

Last updated 2026-05-06 15:27 UTC for PR head 62c0208.

@jodeleeuw jodeleeuw merged commit 8bd0605 into main May 6, 2026
5 checks passed
@jodeleeuw jodeleeuw deleted the claude/investigate-missing-plugins-9NaKn branch May 6, 2026 15:35
@github-actions github-actions Bot mentioned this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recent dist archives (jspsych.zip) are missing plugins from dist/

2 participants