release(v4.0.1): strict-TS publishability fixes
Some checks failed
Test / test (push) Has been cancelled
Docker build and publish / docker (push) Has been cancelled
Publish / publish (push) Has been cancelled

4.0.0 shipped TypeScript source as published main/types, but several
files only compiled inside the monorepo. Consumer projects (Dispatch,
etc.) running their own strict tsc against our published source hit:

- @shade/key-transparency: 4 noUnusedLocals violations
  (IndexAbsenceProof, IndexInclusionProof, IndexProofWire, nodeHash)
- @shade/sdk: KT verifier callbacks returned Promise<unknown> instead
  of Promise<STHWire> / Promise<{ proof: string[] }>
- @shade/sdk: thumbnail.ts globalThis cast collided with consumer's
  lib.dom-supplied createImageBitmap signature
- @shade/files: cycle with @shade/sdk produced "this is not assignable
  to type 'Shade'" because hoisted node_modules layouts duplicated the
  Shade class. Broken by replacing `import type { Shade }` with a
  local structural ShadeBridge interface.
- @shade/storage-encrypted: KeyUsage (lib.dom) used under
  lib: ["ES2022"]
- @shade/transport-bridge: ReadableStreamDefaultReader<any> ↔
  <Uint8Array> mismatch
- @shade/keychain / @shade/dashboard / @shade/storage-encrypted
  tsconfig rootDir / include hygiene

Tooling: scripts/typecheck-all.ts runs `bunx tsc --noEmit` against
every workspace package's tsconfig and fails on any error. Wired into
publish:dry / publish:all and publish-shade.sh as a hard gate so this
class of bug cannot recur.

All 24 packages bumped to 4.0.1 in lockstep.

Migration: <ShadeFilesProvider> now requires an explicit `files` prop
(pass `shade.files`). Wire format unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 19:36:47 +02:00
parent f301b391a5
commit 70e319fef8
47 changed files with 335 additions and 59 deletions

View File

@@ -5,6 +5,103 @@ All notable changes to Shade are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [4.0.1] — 2026-05-03 — Strict-TS publishability fixes
`4.0.0` shipped TypeScript source files as the published `main` /
`types`, which meant every consumer's `tsc` had to compile our code
under their own strict settings. Several files only compiled inside
the monorepo (where peer-dep cycles resolve via workspace links and
the `lib` array doesn't include `DOM`). This release makes all 24
packages compile cleanly under the strict-flagged tsconfig that ships
with the repo, and wires a `bun run typecheck` gate into both the
`publish:dry` and `publish:all` flows so this category of bug cannot
recur.
### Fixed
#### `@shade/key-transparency`
- Removed unused imports `IndexAbsenceProof`, `IndexInclusionProof`
(`src/manager.ts`), `nodeHash` (`src/index-tree.ts`).
- `IndexProofWire` is now exported (was a private type that
`noUnusedLocals` flagged).
- Added missing `tsconfig.json` so the package can be type-checked
in isolation.
#### `@shade/sdk`
- KT verifier wiring: `fetchLatestSTH()` and `fetchConsistencyProof()`
now have explicit return types (`Promise<STHWire>` and
`Promise<{ proof: string[] }>`) so consumers don't see
`Promise<unknown>` from `res.json()`.
- `STHWire` type is now imported from `@shade/key-transparency`.
- `thumbnail.ts`: cast `globalThis` through `unknown` first when
reading optional DOM globals (`OffscreenCanvas`, `createImageBitmap`)
so consumer projects that include `lib.dom` don't reject our
narrower local types as "insufficiently overlapping".
#### `@shade/files`
- **Broke the `@shade/sdk``@shade/files` dependency cycle.**
`@shade/files` no longer imports `Shade` from `@shade/sdk` — every
callsite uses a new local `ShadeBridge` interface defined in
`src/integration/shade-bridge.ts`. This is the structural surface
Shade must satisfy: `myAddress`, `send`, `onMessage`, `upload`,
`onIncomingTransfer`, `getFingerprintFor` (required) plus
`getObservability`, `deliverControlEnvelope` (optional). The Shade
class structurally implements every member, so
`createFilesNamespace(this)` from the SDK side compiles regardless
of how many copies of `@shade/sdk` a consumer's package manager
hoists. **Fixes "this is not assignable to type 'Shade'"** in
consumer builds.
- `<ShadeFilesProvider>` now takes `files: FilesNamespace` as an
explicit prop instead of reading `shade.files`. Consumers pass
`shade.files` (or any `createFilesNamespace(...)` result for tests)
directly.
- `ShadeFileRpcChannel.send` now raises a clear error when
`deliverControlEnvelope` is undefined instead of producing an
implicit-undefined-call error at compile time.
#### `@shade/storage-encrypted`
- Replaced `KeyUsage` (a `lib.dom` type) with a local
`WebCryptoKeyUsage` union so the package compiles under
`lib: ["ES2022"]` without DOM.
- Fixed `tsconfig.json` `rootDir` so package-level `bunx tsc` works.
#### `@shade/transport-bridge`
- `sse-bridge.ts`: cast `res.body.getReader()` to
`ReadableStreamDefaultReader<Uint8Array>` so the strict reader-type
parity check in the consume loop passes.
#### `@shade/keychain` / `@shade/dashboard`
- Fixed `tsconfig.json` `rootDir` and `include` so the packages can
type-check standalone (and so `vite.config.ts` doesn't get pulled
into the dashboard's `rootDir`).
#### `@shade/widgets`
- Removed unused `ThumbnailMime` import in
`components/transfer/ThumbnailPreview.tsx`.
### Tooling
- New `scripts/typecheck-all.ts` — runs `bunx tsc --noEmit` against
every workspace package's `tsconfig.json` and fails if any reports
errors.
- New `bun run typecheck` script.
- `publish:dry` and `publish:all` now run `prepublish:check`
(`typecheck` + `test`) before any package is packed or published.
- `scripts/publish-shade.sh` calls the typecheck-all gate before
invoking the publisher.
### Migration
`4.0.0 → 4.0.1` is wire-compatible and source-compatible with one
exception:
- `<ShadeFilesProvider>` requires a `files` prop. Previously
`<ShadeFilesProvider shade={shade}>...</ShadeFilesProvider>` worked;
it now must be `<ShadeFilesProvider shade={shade} files={shade.files}>`.
No on-disk schema changes. No package-version-pin changes outside
the lockstep `4.0.0 → 4.0.1` bump.
## [4.0.0] — 2026-05-03 — General Availability
Shade 4.0 is the first GA-marked release: every plan from V3.1 through