Skip to content

Commit

Permalink
Use .ts extensions instead of .js
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams committed Nov 25, 2024
1 parent bc40226 commit 7eb442f
Show file tree
Hide file tree
Showing 48 changed files with 218 additions and 216 deletions.
18 changes: 9 additions & 9 deletions packages/inngest/src/api/api.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import { type fetch } from "cross-fetch";
import { type ExecutionVersion } from "../components/execution/InngestExecution.js";
import { type ExecutionVersion } from "../components/execution/InngestExecution.ts";
import {
defaultDevServerHost,
defaultInngestApiBaseUrl,
} from "../helpers/consts.js";
import { devServerAvailable } from "../helpers/devserver.js";
import { type Mode } from "../helpers/env.js";
import { getErrorMessage } from "../helpers/errors.js";
import { fetchWithAuthFallback } from "../helpers/net.js";
import { hashSigningKey } from "../helpers/strings.js";
import { err, ok, type Result } from "../types.js";
} from "../helpers/consts.ts";
import { devServerAvailable } from "../helpers/devserver.ts";
import { type Mode } from "../helpers/env.ts";
import { getErrorMessage } from "../helpers/errors.ts";
import { fetchWithAuthFallback } from "../helpers/net.ts";
import { hashSigningKey } from "../helpers/strings.ts";
import { err, ok, type Result } from "../types.ts";
import {
batchSchema,
errorSchema,
stepsSchemas,
type BatchResponse,
type ErrorResponse,
type StepsResponse,
} from "./schema.js";
} from "./schema.ts";

type FetchT = typeof fetch;

Expand Down
4 changes: 2 additions & 2 deletions packages/inngest/src/api/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from "zod";
import { ExecutionVersion } from "../components/execution/InngestExecution.js";
import { jsonErrorSchema, type EventPayload } from "../types.js";
import { ExecutionVersion } from "../components/execution/InngestExecution.ts";
import { jsonErrorSchema, type EventPayload } from "../types.ts";

export const errorSchema = z.object({
error: z.string(),
Expand Down
4 changes: 2 additions & 2 deletions packages/inngest/src/astro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import {
InngestCommHandler,
type ServeHandlerOptions,
} from "./components/InngestCommHandler.js";
import { type SupportedFrameworkName } from "./types.js";
} from "./components/InngestCommHandler.ts";
import { type SupportedFrameworkName } from "./types.ts";

/**
* The name of the framework, used to identify the framework in Inngest
Expand Down
6 changes: 3 additions & 3 deletions packages/inngest/src/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import {
type InternalServeHandlerOptions,
type ServeHandlerOptions,
} from "./components/InngestCommHandler.js";
import { serve as serveEdge } from "./edge.js";
import { type SupportedFrameworkName } from "./types.js";
} from "./components/InngestCommHandler.ts";
import { serve as serveEdge } from "./edge.ts";
import { type SupportedFrameworkName } from "./types.ts";

/**
* The name of the framework, used to identify the framework in Inngest
Expand Down
6 changes: 3 additions & 3 deletions packages/inngest/src/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
import {
InngestCommHandler,
type ServeHandlerOptions,
} from "./components/InngestCommHandler.js";
import { type Either } from "./helpers/types.js";
import { type SupportedFrameworkName } from "./types.js";
} from "./components/InngestCommHandler.ts";
import { type Either } from "./helpers/types.ts";
import { type SupportedFrameworkName } from "./types.ts";

/**
* The name of the framework, used to identify the framework in Inngest
Expand Down
8 changes: 4 additions & 4 deletions packages/inngest/src/components/EventSchemas.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { type internalEvents } from "../helpers/consts.js";
import { type internalEvents } from "../helpers/consts.ts";
import {
type IsEmptyObject,
type IsStringLiteral,
type Simplify,
} from "../helpers/types.js";
import type * as z from "../helpers/validators/zod.js";
} from "../helpers/types.ts";
import type * as z from "../helpers/validators/zod.ts";
import {
type EventPayload,
type FailureEventPayload,
type FinishedEventPayload,
type InvokedEventPayload,
type ScheduledTimerEventPayload,
} from "../types.js";
} from "../types.ts";

/**
* Declares the shape of an event schema we expect from the user. This may be
Expand Down
28 changes: 14 additions & 14 deletions packages/inngest/src/components/Inngest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InngestApi } from "../api/api.js";
import { InngestApi } from "../api/api.ts";
import {
defaultDevServerHost,
defaultInngestApiBaseUrl,
Expand All @@ -7,32 +7,32 @@ import {
envKeys,
headerKeys,
logPrefix,
} from "../helpers/consts.js";
import { devServerAvailable, devServerUrl } from "../helpers/devserver.js";
} from "../helpers/consts.ts";
import { devServerAvailable, devServerUrl } from "../helpers/devserver.ts";
import {
allProcessEnv,
getFetch,
getMode,
inngestHeaders,
processEnv,
type Mode,
} from "../helpers/env.js";
import { fixEventKeyMissingSteps, prettyError } from "../helpers/errors.js";
import { type Jsonify } from "../helpers/jsonify.js";
import { stringify } from "../helpers/strings.js";
} from "../helpers/env.ts";
import { fixEventKeyMissingSteps, prettyError } from "../helpers/errors.ts";
import { type Jsonify } from "../helpers/jsonify.ts";
import { stringify } from "../helpers/strings.ts";
import {
type AsArray,
type IsNever,
type SendEventPayload,
type SimplifyDeep,
type SingleOrArray,
type WithoutInternal,
} from "../helpers/types.js";
} from "../helpers/types.ts";
import {
DefaultLogger,
ProxyLogger,
type Logger,
} from "../middleware/logger.js";
} from "../middleware/logger.ts";
import {
sendEventResponseSchema,
type ClientOptions,
Expand All @@ -44,10 +44,10 @@ import {
type SendEventOutput,
type SendEventResponse,
type TriggersFromClient,
} from "../types.js";
import { type EventSchemas } from "./EventSchemas.js";
import { InngestFunction } from "./InngestFunction.js";
import { type InngestFunctionReference } from "./InngestFunctionReference.js";
} from "../types.ts";
import { type EventSchemas } from "./EventSchemas.ts";
import { InngestFunction } from "./InngestFunction.ts";
import { type InngestFunctionReference } from "./InngestFunctionReference.ts";
import {
InngestMiddleware,
getHookStack,
Expand All @@ -56,7 +56,7 @@ import {
type MiddlewareRegisterFn,
type MiddlewareRegisterReturn,
type SendEventHookStack,
} from "./InngestMiddleware.js";
} from "./InngestMiddleware.ts";

/**
* Capturing the global type of fetch so that we can reliably access it below.
Expand Down
34 changes: 17 additions & 17 deletions packages/inngest/src/components/InngestCommHandler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import debug from "debug";
import { z } from "zod";
import { ServerTiming } from "../helpers/ServerTiming.js";
import { ServerTiming } from "../helpers/ServerTiming.ts";
import {
debugPrefix,
defaultInngestApiBaseUrl,
Expand All @@ -12,9 +12,9 @@ import {
probe as probeEnum,
queryKeys,
syncKind,
} from "../helpers/consts.js";
import { devServerAvailable, devServerUrl } from "../helpers/devserver.js";
import { enumFromValue } from "../helpers/enum.js";
} from "../helpers/consts.ts";
import { devServerAvailable, devServerUrl } from "../helpers/devserver.ts";
import { enumFromValue } from "../helpers/enum.ts";
import {
allProcessEnv,
devServerHost,
Expand All @@ -26,19 +26,19 @@ import {
parseAsBoolean,
platformSupportsStreaming,
type Env,
} from "../helpers/env.js";
import { rethrowError, serializeError } from "../helpers/errors.js";
} from "../helpers/env.ts";
import { rethrowError, serializeError } from "../helpers/errors.ts";
import {
fetchAllFnData,
parseFnData,
undefinedToNull,
type FnData,
} from "../helpers/functions.js";
import { fetchWithAuthFallback, signDataWithKey } from "../helpers/net.js";
import { runAsPromise } from "../helpers/promises.js";
import { createStream } from "../helpers/stream.js";
import { hashEventKey, hashSigningKey, stringify } from "../helpers/strings.js";
import { type MaybePromise } from "../helpers/types.js";
} from "../helpers/functions.ts";
import { fetchWithAuthFallback, signDataWithKey } from "../helpers/net.ts";
import { runAsPromise } from "../helpers/promises.ts";
import { createStream } from "../helpers/stream.ts";
import { hashEventKey, hashSigningKey, stringify } from "../helpers/strings.ts";
import { type MaybePromise } from "../helpers/types.ts";
import {
functionConfigSchema,
inBandSyncRequestBodySchema,
Expand All @@ -53,21 +53,21 @@ import {
type RegisterRequest,
type SupportedFrameworkName,
type UnauthenticatedIntrospection,
} from "../types.js";
import { version } from "../version.js";
import { type Inngest } from "./Inngest.js";
} from "../types.ts";
import { version } from "../version.ts";
import { type Inngest } from "./Inngest.ts";
import {
type CreateExecutionOptions,
type InngestFunction,
} from "./InngestFunction.js";
} from "./InngestFunction.ts";
import {
ExecutionVersion,
PREFERRED_EXECUTION_VERSION,
type ExecutionResult,
type ExecutionResultHandler,
type ExecutionResultHandlers,
type InngestExecutionOptions,
} from "./execution/InngestExecution.js";
} from "./execution/InngestExecution.ts";

/**
* A set of options that can be passed to a serve handler, intended to be used
Expand Down
18 changes: 9 additions & 9 deletions packages/inngest/src/components/InngestFunction.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { internalEvents, queryKeys } from "../helpers/consts.js";
import { timeStr } from "../helpers/strings.js";
import { type RecursiveTuple, type StrictUnion } from "../helpers/types.js";
import { internalEvents, queryKeys } from "../helpers/consts.ts";
import { timeStr } from "../helpers/strings.ts";
import { type RecursiveTuple, type StrictUnion } from "../helpers/types.ts";
import {
type Cancellation,
type ConcurrencyOption,
Expand All @@ -9,19 +9,19 @@ import {
type TimeStr,
type TimeStrBatch,
type TriggersFromClient,
} from "../types.js";
import { type GetEvents, type Inngest } from "./Inngest.js";
} from "../types.ts";
import { type GetEvents, type Inngest } from "./Inngest.ts";
import {
type InngestMiddleware,
type MiddlewareRegisterReturn,
} from "./InngestMiddleware.js";
} from "./InngestMiddleware.ts";
import {
ExecutionVersion,
type IInngestExecution,
type InngestExecutionOptions,
} from "./execution/InngestExecution.js";
import { createV0InngestExecution } from "./execution/v0.js";
import { createV1InngestExecution } from "./execution/v1.js";
} from "./execution/InngestExecution.ts";
import { createV0InngestExecution } from "./execution/v0.ts";
import { createV1InngestExecution } from "./execution/v1.ts";

/**
* A stateless Inngest function, wrapping up function configuration and any
Expand Down
10 changes: 5 additions & 5 deletions packages/inngest/src/components/InngestFunctionReference.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { type IsAny, type Simplify } from "../helpers/types.js";
import { type IsAny, type Simplify } from "../helpers/types.ts";
import {
type ResolveSchema,
type ValidSchemaInput,
type ValidSchemaOutput,
} from "../helpers/validators/index.js";
} from "../helpers/validators/index.ts";
import {
type MinimalEventPayload,
type PayloadForAnyInngestFunction,
} from "../types.js";
import { type GetFunctionOutput } from "./Inngest.js";
import { type InngestFunction } from "./InngestFunction.js";
} from "../types.ts";
import { type GetFunctionOutput } from "./Inngest.ts";
import { type InngestFunction } from "./InngestFunction.ts";

/**
* A reference to an `InngestFunction` that can be used to represent both local
Expand Down
10 changes: 5 additions & 5 deletions packages/inngest/src/components/InngestMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { cacheFn, waterfall } from "../helpers/functions.js";
import { cacheFn, waterfall } from "../helpers/functions.ts";
import {
type Await,
type MaybePromise,
type ObjectAssign,
type PartialK,
type Simplify,
} from "../helpers/types.js";
} from "../helpers/types.ts";
import {
type BaseContext,
type EventPayload,
type IncomingOp,
type OutgoingOp,
type SendEventBaseOutput,
type TriggersFromClient,
} from "../types.js";
import { type Inngest } from "./Inngest.js";
import { type InngestFunction } from "./InngestFunction.js";
} from "../types.ts";
import { type Inngest } from "./Inngest.ts";
import { type InngestFunction } from "./InngestFunction.ts";

/**
* A middleware that can be registered with Inngest to hook into various
Expand Down
20 changes: 10 additions & 10 deletions packages/inngest/src/components/InngestStepTools.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { z } from "zod";
import { logPrefix } from "../helpers/consts.js";
import { type Jsonify } from "../helpers/jsonify.js";
import { timeStr } from "../helpers/strings.js";
import { logPrefix } from "../helpers/consts.ts";
import { type Jsonify } from "../helpers/jsonify.ts";
import { timeStr } from "../helpers/strings.ts";
import {
type ExclusiveKeys,
type ParametersExceptFirst,
type SendEventPayload,
type SimplifyDeep,
type WithoutInternalStr,
} from "../helpers/types.js";
} from "../helpers/types.ts";
import {
StepOpCode,
type EventPayload,
Expand All @@ -21,18 +21,18 @@ import {
type StepOptionsOrId,
type TriggerEventFromFunction,
type TriggersFromClient,
} from "../types.js";
} from "../types.ts";
import {
type ClientOptionsFromInngest,
type GetEvents,
type GetFunctionOutput,
type Inngest,
} from "./Inngest.js";
import { InngestFunction } from "./InngestFunction.js";
import { InngestFunctionReference } from "./InngestFunctionReference.js";
import { gemini, openai, type AiAdapter } from "./ai/index.js";
} from "./Inngest.ts";
import { InngestFunction } from "./InngestFunction.ts";
import { InngestFunctionReference } from "./InngestFunctionReference.ts";
import { gemini, openai, type AiAdapter } from "./ai/index.ts";

import { type InngestExecution } from "./execution/InngestExecution.js";
import { type InngestExecution } from "./execution/InngestExecution.ts";

export interface FoundStep extends HashedOp {
hashedId: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/inngest/src/components/StepError.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { deserializeError } from "../helpers/errors.js";
import { jsonErrorSchema } from "../types.js";
import { deserializeError } from "../helpers/errors.ts";
import { jsonErrorSchema } from "../types.ts";

/**
* An error that represents a step exhausting all retries and failing. This is
Expand Down
2 changes: 1 addition & 1 deletion packages/inngest/src/components/ai/adapters/openai.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type AiAdapter, type types } from "../adapter.js";
import { type AiAdapter, type types } from "../adapter.ts";

/**
* An OpenAI model using the OpenAI format for I/O.
Expand Down
Loading

0 comments on commit 7eb442f

Please sign in to comment.