Make shipped TypeScript sources erasable-syntax clean - #26
Merged
Merged
Conversation
Consumers that resolve this package's "types" entries compile the shipped src/*.ts under their own compiler options. With erasableSyntaxOnly the four error classes that used constructor parameter properties failed with TS1294. Declare the fields explicitly and assign them after super() so the emitted dist keeps the same own properties and values. Enable erasableSyntaxOnly in tsconfig so the repository gate rejects regressions.
0thernet
added a commit
that referenced
this pull request
Sep 28, 2026
Version bump for the merged consumer-compiler fix (#26): `package.json`, `rust/Cargo.toml`, `Cargo.lock`, `portfolio-inventory.json`, and a README change note. `bun run check` passes on the exact tree. Co-authored-by: 0thernet <894119+0thernet@users.noreply.github.com>
7 tasks
0thernet
added a commit
to hraness/ghostget
that referenced
this pull request
Sep 28, 2026
## 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` (hraness/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 - [x] `bun run typecheck` — root + verification projects clean - [x] `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 - [x] `bun run test:npm-release` — 49/49 pass with remeasured budget pins - [x] `bun run check:effect` / `check:cost-surfaces` / `website:check` — pass - [x] Focused tests: cookie-safe-storage, storage state-home/persistent-helper/cas/batch-read, provider-plugin-portable-runtime — 80 pass, 0 fail - [x] Standalone consumer verification: packed tarball installed into a scratch consumer with `erasableSyntaxOnly: true` + Jungle's strict flags — 0 errors - [x] No live provider calls Generated with [Devin](https://devin.ai) --------- Co-authored-by: 0thernet <894119+0thernet@users.noreply.github.com>
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.
Downstream consumers resolve this package's
typesexports tosrc/*.tsand compile them under their own compiler options. WitherasableSyntaxOnly: true(now the default posture for strict consumers), the four error classes that used constructor parameter properties fail with TS1294:src/control-socket.ts—ControlSocketErrorsrc/protected-input.ts—ProtectedInputErrorsrc/custody-rust.ts—CustodySidecarNotFoundError,CustodySidecarTimeoutError,CustodySidecarProtocolError,CustodyErrorEach parameter property is now an explicit readonly field assigned after
super(), preserving initialization order and the emitted own-property set indist/.tsconfig.jsongainserasableSyntaxOnly: truesobun run typecheck(part ofbun run check) rejects regressions.Verified locally:
bun run checkpasses end to end (lint, typecheck, tests, cargo check/clippy/test, build, determinism, packed-consumer smoke).