Skip to content

Keep packaged type sources compilable under strict consumer flags - #447

Merged
0thernet merged 3 commits into
mainfrom
codex/erasable-syntax-consumers
Sep 28, 2026
Merged

0thernet merged 3 commits into
mainfrom
codex/erasable-syntax-consumers

Conversation

@0thernet

Copy link
Copy Markdown
Member

Summary

Jungle consumers typecheck Ghostget's shipped src/*.ts under their own compiler policy (the package's types exports resolve to source, so skipLibCheck cannot hide errors). Three latent breaks surfaced once a consumer set erasableSyntaxOnly and hosted a Next-style ProcessEnv that narrows NODE_ENV to the literal union:

  • src/cookie-safe-storage.ts used a constructor parameter property (TS1294).
  • src/storage.ts widened helperEnvironment.NODE_ENV to string, which is not assignable when ProcessEnv.NODE_ENV is "development" | "test" | "production" (TS2769 on both spawnSync call sites).
  • src/provider-plugin-portable-runtime.ts passed an explicitly-optional body to RequestInit under exactOptionalPropertyTypes (TS2379).

Fixes:

  • The parameter property is now an explicit field assigned after super().
  • The helper environment keeps NODE_ENV as literals ("production"/"test" unchanged at runtime).
  • A missing request body omits the key instead of passing undefined (same wire behavior).
  • @hraness/local-custody moves to 0.9.1 (Make shipped TypeScript sources erasable-syntax clean local-custody#26, released as v0.9.1), whose shipped sources made the same erasable-syntax cleanup; bun.lock updated to the immutable release tarball.
  • scripts/package-smoke.ts's clean-consumer typecheck now carries the strict posture it guards against: erasableSyntaxOnly, exactOptionalPropertyTypes, verbatimModuleSyntax, noUncheckedIndexedAccess, and an ambient ProcessEnv narrowed to the Next.js NODE_ENV union.
  • Package budget remeasured on the final tree (npm 11.19.0, Node 24.18.1, darwin arm64): 618 entries, 12,125,748 packed / 23,940,758 unpacked bytes, SHA-256 d5681ab1…11177d5; ceilings now 12,142,231 / 23,941,176.
  • Restores src/cli.ts to its tracked 0755 mode after local drift left it 777.

Test plan

  • bun run typecheck — root + verification projects clean
  • bun run check:package — build + package smoke pass; the smoke's strict clean-consumer tsc (typescript@6.0.3, erasableSyntaxOnly, narrowed ProcessEnv) reports zero errors
  • bun run test:npm-release — 49/49 pass with remeasured budget pins
  • bun run check:effect / check:cost-surfaces / website:check — pass
  • Focused tests: cookie-safe-storage, storage state-home/persistent-helper/cas/batch-read, provider-plugin-portable-runtime — 80 pass, 0 fail
  • Standalone consumer verification: packed tarball installed into a scratch consumer with erasableSyntaxOnly: true + Jungle's strict flags — 0 errors
  • No live provider calls

Generated with Devin

Jungle consumers typecheck the shipped src/*.ts under their own compiler
policy. Three latent breaks surfaced once a consumer set erasableSyntaxOnly
and hosted a Next-style ProcessEnv that narrows NODE_ENV to the literal
union:

- cookie-safe-storage.ts used a constructor parameter property (TS1294).
- storage.ts widened helperEnvironment.NODE_ENV to string, which is not
  assignable when ProcessEnv.NODE_ENV is "development" | "test" |
  "production" (TS2769 on both spawnSync call sites).
- provider-plugin-portable-runtime.ts passed an explicitly-optional body to
  RequestInit under exactOptionalPropertyTypes with DOM types (TS2379).

The parameter property is now an explicit field assigned after super(), the
helper environment keeps NODE_ENV as literals, and a missing request body
omits the key instead of passing undefined. @hraness/local-custody moves to
0.9.1, whose shipped sources made the same erasable-syntax cleanup.

package-smoke's clean-consumer typecheck now carries the strict posture it
guards against: erasableSyntaxOnly, exactOptionalPropertyTypes,
verbatimModuleSyntax, noUncheckedIndexedAccess, and an ambient ProcessEnv
narrowed to the Next.js NODE_ENV union.
After bun run build, a clean npm 11.19.0 pack --ignore-scripts with Node
24.18.1 on darwin arm64 measured 618 entries, 12,125,748 packed bytes,
and 23,940,758 unpacked bytes (SHA-256 d5681ab1…11177d5), covering the
three changed packed sources, their rebuilt bundles, and the changelog
entry. Ceilings retain the same projections and allowances:
12,142,231 packed, 23,941,176 unpacked.

Also restores src/cli.ts to its tracked 0755 mode after local drift left
it 777, which the artifact mode check correctly rejected.
@vercel

vercel Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ghostget Ready Ready Preview Sep 28, 2026 10:48am UTC

Request Review

The clean-closure assertion still expected the v0.9.0 release tarball and
its byte pins. Point the dependency spec at the v0.9.1 archive, bump each
expected version to 0.9.1, and update the three artifact digests that
changed in the release: the rust-artifacts manifest and the darwin-arm64
and darwin-x64 sidecar binaries (the version bump is embedded in the
rebuilt binaries). The JS entry points and linux-x64 artifacts are
byte-identical and keep their existing pins. All hashes measured from the
published v0.9.1 release tarball.
@0thernet
0thernet merged commit 2ed33bb into main Sep 28, 2026
27 checks passed
@0thernet
0thernet deleted the codex/erasable-syntax-consumers branch September 28, 2026 11:25
@0thernet 0thernet mentioned this pull request Sep 28, 2026
8 tasks
0thernet added a commit that referenced this pull request Sep 28, 2026
Release 0.18.45: version pins, the `## 0.18.45` changelog section,
rebuilt dist (only the version chunk renamed), and a remeasured archive
over merged main `2ed33bb`.

Carries #447: the packaged type sources now compile under strict
consumer flags — `erasableSyntaxOnly`, a Next-style narrowed
`ProcessEnv.NODE_ENV` union, and `exactOptionalPropertyTypes` — and the
package smoke's clean-consumer typecheck enforces that posture.
`@hraness/local-custody` is pinned to the released `0.9.1` tarball, and
the standalone smoke's closure pins were repinned to its byte-exact
artifacts.

Also carries the earlier Wordcell 0.24.0 runtime adoption (#445).

Archive measurement (after `bun run build`, npm 11.19.0 `pack
--ignore-scripts`, Node 24.18.1, darwin arm64, merged with main
`2ed33bb`): 618 entries, 12,125,761 packed / 23,940,938 unpacked bytes,
SHA-256
`0d6a1de00fd825d700b1ed0505b6fa34992f11d1deb42a5c255f7cfc295eedbc`.
Budgets keep the same projections and allowances: 12,142,244 packed,
23,941,356 unpacked, 24,574,976 tar bytes.

#### Test plan

- [x] `bun run build` (only the version chunk renamed)
- [x] `bun run typecheck` — clean
- [x] `bun run test:npm-release` — 49/49 pass with remeasured budget
pins
- [x] `bun run check:package` — build + package smoke pass; strict
clean-consumer `tsc` reports zero errors on the 0.18.45 tarball
- [x] `bun run website:check` — 126 pass; release-notes renderer accepts
the 0.18.45 section
- [x] `bun run test:standalone` — closure pins verified against released
local-custody 0.9.1 artifacts
- [ ] Required CI
- [ ] After merge: main CI green on the merge commit, administrator
readbacks, tag `v0.18.45` on that exact commit

Generated with [Devin](https://devin.ai)

Co-authored-by: 0thernet <894119+0thernet@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 7f809f95 Deployed Sep 28, 2026 by vercel[bot]
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.

1 participant