ci(publish): fix smoke test for object sentinel exports - #377
Merged
Conversation
The smoke test asserted typeof m[name] === 'function' for every
named export. This was wrong for 'none', which is exported as
'export const none: None = { ... }' — a runtime sentinel object,
not a function constructor. The smoke test failed on a real
release because 'none' is an 'object', not a 'function'.
Fix: accept either 'function' (ok/err/some/maybe) or 'object'
(none, sentinels). Same logic in release and hotfix jobs.
Observed on the e2e test (run 30816144216 after PR #376 merge):
release job passed anti-republish guard, build, test, then
failed at the smoke test step with:
Error: expected export missing: none
The publish itself never happened because the smoke test gate
is positioned before 'pnpm changeset publish' in the job
sequence.
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
Fixes the smoke test step in
publish.ymlso it accepts both functions and object sentinels when checking exports. Thenoneexport isexport const none: None = { ... }(an object), but the smoke test was assertingtypeof === 'function', which rejected it.Why
After #376 was merged and the e2e test was re-triggered, the release job progressed past the anti-republish guard but failed at the smoke test:
noneis correctly exported, but it's anobject, not afunction. The smoke test incorrectly assumed every expected export was a function constructor.Changes
.github/workflows/publish.yml: both smoke test occurrences (release and hotfix) now accept eitherfunctionorobjecttypes. Sentinel constants likenoneare now validated.The first commit on this branch (#376, already merged) removed the
check-releasegate from the release job. This commit adds the smoke test fix on top.Test plan
pnpm turbo type-checkpasses.pnpm turbo lintpasses.@1.0.2on npm@latest.Risk
Very low. Loosens a check from "must be function" to "must be function or object". Catches fewer false positives.
Rollback
Revert the merge commit. Smoke test fails again on object exports.
🤖 Generated with Claude Code