Skip to content

Commit 2c85d4c

Browse files
committed
chore!: family hygiene from the amqp-contract cross-review
- rename CreateTypedClientOptions -> CreateClientOptions (the family-shared name for the Typed*.create() options shape, matching amqp-contract; its own JSDoc already claimed the shared role) - add a package-check CI job running publint + are-the-types-wrong on every publishable package (mirrors amqp-contract's job) - root package.json gains the engines field the packages already declare - changeset $schema points at the versioned unpkg URL instead of a local node_modules path - changeset entries for the declare* middleware rename, the client options rename, and the time-skipping testEnv fixture typing fix
1 parent ee189ef commit 2c85d4c

7 files changed

Lines changed: 22 additions & 7 deletions

File tree

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "../node_modules/@changesets/config/schema.json",
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.4/schema.json",
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
55
"fixed": [

.changeset/v8-review-remediation.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ v8 review remediation — the full-surface overhaul from the six-track 8.0 revie
2121
- `TypedClient` is split from the contract: `TypedClient.create({ client })` is connection-scoped, and `typedClient.for(contract)` returns the contract-bound `ContractClient` with the workflow/schedule methods. A `readonly raw` escape hatch exposes the underlying `Client`.
2222
- `getHandle` is synchronous, returns `Result<TypedWorkflowHandle, WorkflowNotInContractError>`, and accepts `runId`/`firstExecutionRunId` options; handles carry `runId`/`firstExecutionRunId`; typed `startUpdate` joins `executeUpdate`.
2323
- `WorkflowNotFoundError` is renamed `WorkflowNotInContractError`.
24+
- `CreateTypedClientOptions` is renamed `CreateClientOptions` — the family-shared name for the `Typed*.create()` options shape (matching amqp-contract).
2425
- Schedule surface parity: typed `ScheduleAlreadyExistsError`/`ScheduleNotFoundError` on the error channel (instead of defects), plus `update`, `backfill`, and `list`.
2526
- The six unused `ClientInfer*` type exports are deleted.
2627

@@ -29,6 +30,7 @@ v8 review remediation — the full-surface overhaul from the six-track 8.0 revie
2930
- Invalid signal payloads are dropped and logged (`log.warn`), never thrown — `SignalInputValidationError` is deleted; a stale client can no longer terminally kill a workflow execution.
3031
- Contract misuse inside workflow code (unknown signal/query/update or workflow name, async schema, uncovered activity options) now fails fast as a non-retryable `ContractMisuseError` `ApplicationFailure` instead of hanging executions in Workflow Task retries.
3132
- Exported `qualify` is renamed `qualifyFailure` (no alias), and the deprecated `createWorkerOrThrow` is removed — use `createWorker(...).get()`.
33+
- `defineActivityMiddleware` is renamed `declareActivityMiddleware` — the family convention is `define*` for contract authoring and `declare*` for implementation-side APIs, and middleware was the one implementation-side holdout.
3234
- `activities` is optional on `createWorker`, and activity-less workflows no longer need `{}` entries in the implementations map.
3335
- `TypedChildWorkflowHandle` gains a typed `signals` map and `firstExecutionRunId`.
3436

@@ -37,3 +39,4 @@ v8 review remediation — the full-surface overhaul from the six-track 8.0 revie
3739
- New contract-aware fixtures: `createContractTest(contract, { workflowsPath, activities?, workerOptions? })` yields `{ client, typedClient, worker }` against the testcontainers server, and `runActivity(definition, implementation, input, { env? })` runs one implementation inside `MockActivityEnvironment` (vitest-free).
3840
- Configurable environments: `createTimeSkippingTest(options?)` / `createTimeSkippingEnvironment(options?)` forward `TimeSkippingTestWorkflowEnvironmentOptions`; `createGlobalSetup({ postgresImage?, temporalImage?, temporalEnv?, quiet? })` pins container images and env.
3941
- The package now peer-depends on `@temporal-contract/contract`, `@temporal-contract/client`, `@temporal-contract/worker`, and `unthrown`.
42+
- The time-skipping `testEnv` fixture is correctly typed (the fixture record previously declared a phantom `$worker` key, leaving `testEnv` untyped in consuming suites).

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,14 @@ jobs:
1818
with:
1919
integration-tests: true
2020
node-versions: '["", "22.19.0"]'
21+
22+
package-check:
23+
name: Package
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v7
28+
- name: Setup
29+
uses: ./.github/actions/setup
30+
- name: Validate published surfaces (publint + are-the-types-wrong)
31+
run: pnpm run check:packages

docs/how-to/upgrade-to-v8.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ carries everything the old contract-coupled client had.
264264
| `TypedClient.create({ contract, client })` | `TypedClient.create({ client }).for(contract)` |
265265
| `TypedClient<typeof contract>` (type annotation) | `ContractClient<typeof contract>` |
266266
| `TypedClient.createOrThrow(contract, client, ...)` | removed — use `create(...).get()` |
267+
| `CreateTypedClientOptions` | `CreateClientOptions` |
267268

268269
```typescript
269270
// 7.x — one client per contract, constructed per contract

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
"oxlint": "catalog:",
3333
"turbo": "catalog:"
3434
},
35+
"engines": {
36+
"node": ">=22.19.0"
37+
},
3538
"packageManager": "pnpm@11.7.0"
3639
}

packages/client/src/client.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ async function resolveDefinitionAndValidateInput<
474474
* Options for {@link TypedClient.create} — the single options-object shape
475475
* shared by the org's `Typed*.create()` factories.
476476
*/
477-
export type CreateTypedClientOptions = {
477+
export type CreateClientOptions = {
478478
/** The underlying `@temporalio/client` `Client`. */
479479
client: Client;
480480
/**
@@ -551,10 +551,7 @@ export class TypedClient {
551551
* const client = await TypedClient.create({ client: temporalClient }).get();
552552
* ```
553553
*/
554-
static create({
555-
client,
556-
interceptors,
557-
}: CreateTypedClientOptions): AsyncResult<TypedClient, never> {
554+
static create({ client, interceptors }: CreateClientOptions): AsyncResult<TypedClient, never> {
558555
const work = async (): Promise<Result<TypedClient, never>> => {
559556
// `client.schedule` is the ScheduleClient wired into Temporal's
560557
// top-level `Client` since 1.16. The peer dep allows all of `^1`, so a

packages/client/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export {
22
ContractClient,
33
readTypedSearchAttributes,
44
TypedClient,
5-
type CreateTypedClientOptions,
5+
type CreateClientOptions,
66
type TypedGetHandleOptions,
77
type TypedSearchAttributeMap,
88
type TypedSignalWithStartOptions,

0 commit comments

Comments
 (0)