Skip to content

Make shipped TypeScript sources erasable-syntax clean - #26

Merged
0thernet merged 1 commit into
mainfrom
codex/erasable-syntax-only
Sep 28, 2026
Merged

0thernet merged 1 commit into
mainfrom
codex/erasable-syntax-only

Conversation

@0thernet

Copy link
Copy Markdown
Member

Downstream consumers resolve this package's types exports to src/*.ts and compile them under their own compiler options. With erasableSyntaxOnly: true (now the default posture for strict consumers), the four error classes that used constructor parameter properties fail with TS1294:

  • src/control-socket.ts — ControlSocketError
  • src/protected-input.ts — ProtectedInputError
  • src/custody-rust.ts — CustodySidecarNotFoundError, CustodySidecarTimeoutError, CustodySidecarProtocolError, CustodyError

Each parameter property is now an explicit readonly field assigned after super(), preserving initialization order and the emitted own-property set in dist/.

tsconfig.json gains erasableSyntaxOnly: true so bun run typecheck (part of bun run check) rejects regressions.

Verified locally: bun run check passes end to end (lint, typecheck, tests, cargo check/clippy/test, build, determinism, packed-consumer smoke).

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
0thernet merged commit 0f91a2c into main Sep 28, 2026
7 checks passed
@0thernet
0thernet deleted the codex/erasable-syntax-only branch September 28, 2026 10:18
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>
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>
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