Skip to content

Commit 0b8f69c

Browse files
committed
refactor(overrides): move types to top level types folder
1 parent 6f798de commit 0b8f69c

File tree

17 files changed

+57
-49
lines changed

17 files changed

+57
-49
lines changed

packages/open-next/src/adapters/cache.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type { IncrementalCache } from "../overrides/incrementalCache/types.js";
2-
import type { TagCache } from "../overrides/tagCache/types.js";
3-
import { isBinaryContentType } from "./binary.js";
4-
import { debug, error, warn } from "./logger.js";
1+
import type { IncrementalCache, TagCache } from "types/overrides";
2+
3+
import { isBinaryContentType } from "./binary";
4+
import { debug, error, warn } from "./logger";
55

66
interface CachedFetchValue {
77
kind: "FETCH";

packages/open-next/src/core/createMainHandler.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import type { AsyncLocalStorage } from "node:async_hooks";
22

33
import type { OpenNextConfig } from "types/open-next";
4+
import type { IncrementalCache, Queue } from "types/overrides";
45
import type { DetachedPromiseRunner } from "utils/promise";
56

67
import { debug } from "../adapters/logger";
78
import { generateUniqueId } from "../adapters/util";
8-
import type { IncrementalCache } from "../overrides/incrementalCache/types";
9-
import type { Queue } from "../overrides/queue/types";
10-
import { openNextHandler } from "./requestHandler.js";
9+
import { openNextHandler } from "./requestHandler";
1110
import {
1211
resolveConverter,
1312
resolveIncrementalCache,

packages/open-next/src/core/resolve.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ import type {
1010
OverrideOptions,
1111
Warmer,
1212
Wrapper,
13-
} from "types/open-next.js";
14-
15-
import type { TagCache } from "../overrides/tagCache/types.js";
13+
} from "types/open-next";
14+
import type { TagCache } from "types/overrides";
1615

1716
export async function resolveConverter<
1817
E extends BaseEventOrResult = InternalEvent,

packages/open-next/src/core/routing/cacheInterceptor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { createHash } from "node:crypto";
22

33
import { NextConfig, PrerenderManifest } from "config/index";
44
import type { InternalEvent, InternalResult } from "types/open-next";
5+
import type { CacheValue } from "types/overrides";
56
import { emptyReadableStream, toReadableStream } from "utils/stream";
67

78
import { debug } from "../../adapters/logger";
8-
import type { CacheValue } from "../../overrides/incrementalCache/types";
99
import { localizePath } from "./i18n";
1010
import { generateMessageGroupId } from "./util";
1111

packages/open-next/src/overrides/incrementalCache/dummy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { IncrementalCache } from "./types";
1+
import type { IncrementalCache } from "types/overrides";
22

33
const dummyIncrementalCache: IncrementalCache = {
44
name: "dummy",

packages/open-next/src/overrides/incrementalCache/s3-lite.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2+
import path from "node:path";
3+
24
import { AwsClient } from "aws4fetch";
3-
import path from "path";
45
import type { Extension } from "types/cache";
6+
import type { IncrementalCache } from "types/overrides";
57
import { IgnorableError, RecoverableError } from "utils/error";
68
import { customFetchClient } from "utils/fetch";
79

810
import { parseNumberFromEnv } from "../../adapters/util";
9-
import type { IncrementalCache } from "./types";
1011

1112
let awsClient: AwsClient | null = null;
1213

packages/open-next/src/overrides/incrementalCache/s3.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
import path from "node:path";
2+
13
import type { S3ClientConfig } from "@aws-sdk/client-s3";
24
import {
35
DeleteObjectCommand,
46
GetObjectCommand,
57
PutObjectCommand,
68
S3Client,
79
} from "@aws-sdk/client-s3";
8-
import path from "path";
910
import type { Extension } from "types/cache";
11+
import type { IncrementalCache } from "types/overrides";
1012

1113
import { awsLogger } from "../../adapters/logger";
1214
import { parseNumberFromEnv } from "../../adapters/util";
13-
import type { IncrementalCache } from "./types";
1415

1516
const {
1617
CACHE_BUCKET_REGION,

packages/open-next/src/overrides/queue/dummy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Queue } from "./types";
1+
import type { Queue } from "types/overrides";
22

33
const dummyQueue: Queue = {
44
name: "dummy",

packages/open-next/src/overrides/queue/sqs-lite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { AwsClient } from "aws4fetch";
2+
import type { Queue } from "types/overrides";
23
import { RecoverableError } from "utils/error";
34
import { customFetchClient } from "utils/fetch";
45

56
import { error } from "../../adapters/logger";
6-
import type { Queue } from "./types";
77

88
let awsClient: AwsClient | null = null;
99

packages/open-next/src/overrides/queue/sqs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { SendMessageCommand, SQSClient } from "@aws-sdk/client-sqs";
2+
import type { Queue } from "types/overrides";
23

34
import { awsLogger } from "../../adapters/logger";
4-
import type { Queue } from "./types";
55

66
// Expected environment variables
77
const { REVALIDATION_QUEUE_REGION, REVALIDATION_QUEUE_URL } = process.env;

0 commit comments

Comments
 (0)