Skip to content

Commit

Permalink
Add typescript@rc to test for typescript@5.4 (#500)
Browse files Browse the repository at this point in the history
## Summary
<!-- Succinctly describe your change, providing context, what you've
changed, and why. -->

Adds `typescript@rc` (currently `typescript@5.4.0`). This is used to
test the 5.4 release candidate to resolve any issues before it ships.
When it does, we'll move this PR to target `typescript@5.4.0` and merge,
including a changeset if any changes needed to be made.

We should ship this change once the final build is submitted at the
beginning of March. See microsoft/TypeScript#56948

## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by
wrapping it in "~~"" and suffix it with "N/A My reason for skipping
this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] ~Added a [docs PR](https://github.com/inngest/website) that
references this PR~ N/A
- [x] Added unit/integration tests
- [x] Added changesets if applicable

## Related

- microsoft/TypeScript#56948
  • Loading branch information
jpwilliams committed Mar 1, 2024
1 parent affbdae commit f21ebed
Show file tree
Hide file tree
Showing 19 changed files with 421 additions and 83 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-poems-invite.md
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Add support for `typescript@5.4`
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Expand Up @@ -50,6 +50,7 @@ jobs:
matrix:
tsVersion:
- 'latest'
- 'rc'
- '~5.3.0'
- '~5.2.0'
- '~5.1.0'
Expand Down
17 changes: 8 additions & 9 deletions packages/inngest/etc/inngest.api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/inngest/package.json
Expand Up @@ -180,7 +180,6 @@
"ms": "^2.1.3",
"serialize-error-cjs": "^0.1.3",
"strip-ansi": "^5.2.0",
"type-fest": "^3.13.1",
"type-plus": "^5.1.0",
"zod": "~3.22.3"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/inngest/src/components/EventSchemas.ts
@@ -1,6 +1,9 @@
import { type Simplify } from "type-fest";
import { type internalEvents } from "../helpers/consts";
import { type IsEmptyObject, type IsStringLiteral } from "../helpers/types";
import {
type IsEmptyObject,
type IsStringLiteral,
type Simplify,
} from "../helpers/types";
import type * as z from "../helpers/validators/zod";
import {
type EventPayload,
Expand Down
21 changes: 9 additions & 12 deletions packages/inngest/src/components/Inngest.ts
@@ -1,5 +1,4 @@
import { type IfNever, type Jsonify } from "type-fest";
import { type SimplifyDeep } from "type-fest/source/merge-deep";
import { type IsNever } from "type-plus";
import { InngestApi } from "../api/api";
import {
defaultDevServerHost,
Expand All @@ -18,10 +17,12 @@ import {
type Mode,
} from "../helpers/env";
import { fixEventKeyMissingSteps, prettyError } from "../helpers/errors";
import { type Jsonify } from "../helpers/jsonify";
import { stringify } from "../helpers/strings";
import {
type ExclusiveKeys,
type SendEventPayload,
type SimplifyDeep,
type WithoutInternal,
} from "../helpers/types";
import { DefaultLogger, ProxyLogger, type Logger } from "../middleware/logger";
Expand Down Expand Up @@ -817,11 +818,9 @@ export type GetFunctionOutputFromInngestFunction<
TFunction extends InngestFunction.Any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
> = TFunction extends InngestFunction<any, any, any, any, infer IHandler>
? IfNever<
SimplifyDeep<Jsonify<Awaited<ReturnType<IHandler>>>>,
null,
SimplifyDeep<Jsonify<Awaited<ReturnType<IHandler>>>>
>
? IsNever<SimplifyDeep<Jsonify<ReturnType<IHandler>>>> extends true
? null
: SimplifyDeep<Jsonify<ReturnType<IHandler>>>
: unknown;

/**
Expand All @@ -837,11 +836,9 @@ export type GetFunctionOutputFromReferenceInngestFunction<
TFunction extends InngestFunctionReference.Any,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
> = TFunction extends InngestFunctionReference<any, infer IOutput>
? IfNever<
SimplifyDeep<Jsonify<IOutput>>,
null,
SimplifyDeep<Jsonify<IOutput>>
>
? IsNever<SimplifyDeep<Jsonify<IOutput>>> extends true
? null
: SimplifyDeep<Jsonify<IOutput>>
: unknown;

/**
Expand Down
3 changes: 1 addition & 2 deletions packages/inngest/src/components/InngestFunction.test.ts
Expand Up @@ -40,8 +40,7 @@ import {
type OutgoingOp,
} from "@local/types";
import { fromPartial } from "@total-typescript/shoehorn";
import { type IsEqual } from "type-fest";
import { assertType } from "type-plus";
import { assertType, type IsEqual } from "type-plus";
import { createClient, runFnWithStack } from "../test/helpers";

type TestEvents = {
Expand Down
3 changes: 1 addition & 2 deletions packages/inngest/src/components/InngestFunctionReference.ts
@@ -1,5 +1,4 @@
import { type Simplify } from "type-fest";
import { type IsAny } from "../helpers/types";
import { type IsAny, type Simplify } from "../helpers/types";
import {
type ResolveSchema,
type ValidSchemaInput,
Expand Down
2 changes: 1 addition & 1 deletion packages/inngest/src/components/InngestMiddleware.test.ts
Expand Up @@ -4,8 +4,8 @@ import { ExecutionVersion } from "@local/components/execution/InngestExecution";
import { Inngest } from "@local/components/Inngest";
import { referenceFunction } from "@local/components/InngestFunctionReference";
import { InngestMiddleware } from "@local/components/InngestMiddleware";
import { type IsUnknown } from "@local/helpers/types";
import { StepOpCode } from "@local/types";
import { type IsUnknown } from "type-fest";
import { assertType, type IsEqual } from "type-plus";
import { createClient, runFnWithStack, testClientId } from "../test/helpers";

Expand Down
2 changes: 1 addition & 1 deletion packages/inngest/src/components/InngestMiddleware.ts
@@ -1,10 +1,10 @@
import { type Simplify } from "type-fest";
import { cacheFn, waterfall } from "../helpers/functions";
import {
type Await,
type MaybePromise,
type ObjectAssign,
type PartialK,
type Simplify,
} from "../helpers/types";
import {
type BaseContext,
Expand Down
3 changes: 1 addition & 2 deletions packages/inngest/src/components/InngestStepTools.test.ts
Expand Up @@ -10,8 +10,7 @@ import {
type InvocationResult,
} from "@local/types";
import ms from "ms";
import { type IsEqual } from "type-fest";
import { assertType } from "type-plus";
import { assertType, type IsEqual } from "type-plus";
import { z } from "zod";
import {
createClient,
Expand Down
4 changes: 2 additions & 2 deletions packages/inngest/src/components/InngestStepTools.ts
@@ -1,13 +1,13 @@
import { type Jsonify } from "type-fest";
import { type SimplifyDeep } from "type-fest/source/merge-deep";
import { z } from "zod";
import { logPrefix } from "../helpers/consts";
import { type Jsonify } from "../helpers/jsonify";
import { timeStr } from "../helpers/strings";
import {
type ExclusiveKeys,
type ObjectPaths,
type ParametersExceptFirst,
type SendEventPayload,
type SimplifyDeep,
} from "../helpers/types";
import {
StepOpCode,
Expand Down
@@ -1,8 +1,8 @@
import Debug, { type Debugger } from "debug";
import { type Simplify } from "type-fest";
import { type MaybePromise } from "type-plus";
import { type ServerTiming } from "../../helpers/ServerTiming";
import { debugPrefix } from "../../helpers/consts";
import { type Simplify } from "../../helpers/types";
import { type Context, type IncomingOp, type OutgoingOp } from "../../types";
import { type Inngest } from "../Inngest";
import { type ActionResponse } from "../InngestCommHandler";
Expand Down
3 changes: 1 addition & 2 deletions packages/inngest/src/components/execution/v1.ts
@@ -1,5 +1,4 @@
import { sha1 } from "hash.js";
import { type Simplify } from "type-fest";
import { z } from "zod";
import { internalEvents } from "../../helpers/consts";
import {
Expand All @@ -16,7 +15,7 @@ import {
resolveAfterPending,
runAsPromise,
} from "../../helpers/promises";
import { type MaybePromise } from "../../helpers/types";
import { type MaybePromise, type Simplify } from "../../helpers/types";
import {
StepOpCode,
failureEventErrorSchema,
Expand Down

0 comments on commit f21ebed

Please sign in to comment.