@opennextjs/aws 4.1.7 → 4.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/cache.d.ts +1 -1
- package/dist/adapters/cache.js +7 -6
- package/dist/adapters/composable-cache.d.ts +1 -1
- package/dist/adapters/composable-cache.js +2 -2
- package/dist/adapters/config/util.d.ts +10 -10
- package/dist/adapters/edge-adapter.js +2 -2
- package/dist/adapters/middleware.js +2 -2
- package/dist/build/copyTracedFiles.js +6 -2
- package/dist/build/edge/createEdgeBundle.d.ts +2 -2
- package/dist/build/installDeps.d.ts +1 -1
- package/dist/build/patch/patches/patchBackgroundRevalidation.d.ts +2 -1
- package/dist/build/patch/patches/patchBackgroundRevalidation.js +26 -7
- package/dist/build/validateConfig.d.ts +1 -1
- package/dist/core/createGenericHandler.d.ts +2 -2
- package/dist/core/edgeFunctionHandler.d.ts +1 -1
- package/dist/core/nodeMiddlewareHandler.d.ts +1 -1
- package/dist/core/requestHandler.d.ts +2 -2
- package/dist/core/requestHandler.js +15 -7
- package/dist/core/resolve.d.ts +10 -10
- package/dist/core/routing/cacheInterceptor.d.ts +1 -1
- package/dist/core/routing/cacheInterceptor.js +6 -6
- package/dist/core/routing/i18n/index.d.ts +2 -2
- package/dist/core/routing/matcher.d.ts +61 -6
- package/dist/core/routing/matcher.js +283 -55
- package/dist/core/routing/routeMatcher.d.ts +1 -1
- package/dist/core/routing/routeMatcher.js +1 -1
- package/dist/core/routing/util.d.ts +20 -4
- package/dist/core/routing/util.js +32 -15
- package/dist/core/routingHandler.d.ts +2 -2
- package/dist/core/routingHandler.js +3 -3
- package/dist/helpers/withCloudflare.d.ts +1 -1
- package/dist/helpers/withSST.d.ts +2 -2
- package/dist/http/openNextResponse.d.ts +1 -1
- package/dist/overrides/assetResolver/dummy.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v1.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v1.js +1 -1
- package/dist/overrides/converters/aws-apigw-v2.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v2.js +2 -2
- package/dist/overrides/converters/aws-cloudfront.d.ts +1 -1
- package/dist/overrides/converters/aws-cloudfront.js +2 -2
- package/dist/overrides/converters/dummy.d.ts +1 -1
- package/dist/overrides/converters/edge.d.ts +2 -2
- package/dist/overrides/converters/edge.js +1 -1
- package/dist/overrides/converters/node.d.ts +1 -1
- package/dist/overrides/converters/sqs-revalidate.d.ts +1 -1
- package/dist/overrides/imageLoader/dummy.d.ts +1 -1
- package/dist/overrides/imageLoader/dummy.js +1 -1
- package/dist/overrides/imageLoader/fs-dev.js +2 -2
- package/dist/overrides/imageLoader/host.d.ts +1 -1
- package/dist/overrides/imageLoader/host.js +1 -1
- package/dist/overrides/imageLoader/s3-lite.d.ts +1 -1
- package/dist/overrides/imageLoader/s3-lite.js +1 -1
- package/dist/overrides/imageLoader/s3.d.ts +1 -1
- package/dist/overrides/imageLoader/s3.js +1 -1
- package/dist/overrides/incrementalCache/dummy.d.ts +1 -1
- package/dist/overrides/incrementalCache/dummy.js +1 -1
- package/dist/overrides/incrementalCache/fs-dev.js +1 -1
- package/dist/overrides/incrementalCache/multi-tier-ddb-s3.d.ts +1 -1
- package/dist/overrides/incrementalCache/multi-tier-ddb-s3.js +2 -2
- package/dist/overrides/incrementalCache/s3-lite.d.ts +1 -1
- package/dist/overrides/incrementalCache/s3-lite.js +2 -2
- package/dist/overrides/incrementalCache/s3.d.ts +1 -1
- package/dist/overrides/originResolver/dummy.d.ts +1 -1
- package/dist/overrides/originResolver/pattern-env.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/dummy.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/dummy.js +1 -1
- package/dist/overrides/proxyExternalRequest/fetch.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/fetch.js +1 -1
- package/dist/overrides/proxyExternalRequest/node.d.ts +1 -1
- package/dist/overrides/queue/dummy.d.ts +1 -1
- package/dist/overrides/queue/dummy.js +1 -1
- package/dist/overrides/queue/sqs-lite.d.ts +1 -1
- package/dist/overrides/queue/sqs-lite.js +2 -2
- package/dist/overrides/queue/sqs.d.ts +1 -1
- package/dist/overrides/tagCache/dummy.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-lite.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-lite.js +2 -2
- package/dist/overrides/tagCache/dynamodb-nextMode.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-nextMode.js +2 -2
- package/dist/overrides/tagCache/dynamodb.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev-nextMode.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev.js +1 -1
- package/dist/overrides/warmer/aws-lambda.d.ts +1 -1
- package/dist/overrides/warmer/dummy.d.ts +1 -1
- package/dist/overrides/warmer/dummy.js +1 -1
- package/dist/overrides/wrappers/aws-apigw-streaming.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda-compressed.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda-streaming.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda.d.ts +1 -1
- package/dist/overrides/wrappers/cloudflare-edge.d.ts +2 -2
- package/dist/overrides/wrappers/cloudflare-node.d.ts +2 -2
- package/dist/overrides/wrappers/dummy.d.ts +1 -1
- package/dist/overrides/wrappers/express-dev.js +2 -2
- package/dist/overrides/wrappers/node.d.ts +1 -1
- package/dist/plugins/resolve.d.ts +2 -2
- package/dist/types/global.d.ts +1 -1
- package/dist/types/overrides.d.ts +1 -1
- package/dist/utils/cache.d.ts +1 -1
- package/dist/utils/promise.d.ts +18 -1
- package/dist/utils/promise.js +27 -9
- package/package.json +12 -12
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { BuildId, ConfigHeaders, NextConfig, PrerenderManifest, RoutesManifest, } from "../adapters/config/index";
|
|
1
|
+
import { BuildId, ConfigHeaders, NextConfig, PrerenderManifest, RoutesManifest, } from "../adapters/config/index.js";
|
|
2
2
|
import { debug, error } from "../adapters/logger";
|
|
3
3
|
import { NO_STORE_CACHE_CONTROL } from "../utils/cacheHeaders";
|
|
4
4
|
import { cacheInterceptor } from "./routing/cacheInterceptor";
|
|
5
5
|
import { detectLocale } from "./routing/i18n";
|
|
6
|
-
import { fixDataPage, getNextConfigHeaders, handleFallbackFalse, handleRedirects, handleRewrites, } from "./routing/matcher";
|
|
6
|
+
import { fixDataPage, getNextConfigHeaders, handleBeforeFilesRewrites, handleFallbackFalse, handleRedirects, handleRewrites, } from "./routing/matcher";
|
|
7
7
|
import { handleMiddleware } from "./routing/middleware";
|
|
8
8
|
import { dynamicRouteMatcher, staticRouteMatcher, } from "./routing/routeMatcher";
|
|
9
9
|
import { constructNextUrl, normalizeLocationHeader } from "./routing/util";
|
|
@@ -116,7 +116,7 @@ export default async function routingHandler(event, { assetResolver }) {
|
|
|
116
116
|
eventOrResult = middlewareEventOrResult;
|
|
117
117
|
if (!isExternalRewrite) {
|
|
118
118
|
// First rewrite to be applied
|
|
119
|
-
const beforeRewrite =
|
|
119
|
+
const beforeRewrite = handleBeforeFilesRewrites(eventOrResult, RoutesManifest.rewrites.beforeFiles);
|
|
120
120
|
eventOrResult = beforeRewrite.internalEvent;
|
|
121
121
|
isExternalRewrite = beforeRewrite.isExternalRewrite;
|
|
122
122
|
// Check for matching public files after `beforeFiles` rewrites
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunctionOptions, OpenNextConfig, RouteTemplate, SplittedFunctionOptions } from "../types/open-next";
|
|
1
|
+
import type { FunctionOptions, OpenNextConfig, RouteTemplate, SplittedFunctionOptions } from "../types/open-next.js";
|
|
2
2
|
type CloudflareCompatibleFunction<Placement extends "regional" | "global"> = Placement extends "regional" ? FunctionOptions & {
|
|
3
3
|
placement: "regional";
|
|
4
4
|
} : {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunctionOptions, OpenNextConfig, RouteTemplate } from "../types/open-next";
|
|
1
|
+
import type { FunctionOptions, OpenNextConfig, RouteTemplate } from "../types/open-next.js";
|
|
2
2
|
type SSTCompatibleFunction = FunctionOptions & {
|
|
3
3
|
override?: {
|
|
4
4
|
wrapper?: "aws-lambda-streaming" | "aws-lambda";
|
|
@@ -45,7 +45,7 @@ export declare function withSST<Fn extends Record<string, SSTCompatibleSplittedF
|
|
|
45
45
|
middleware?: {
|
|
46
46
|
external: true;
|
|
47
47
|
};
|
|
48
|
-
dangerous?: import("../types/open-next").DangerousOptions | undefined;
|
|
48
|
+
dangerous?: import("../types/open-next.js").DangerousOptions | undefined;
|
|
49
49
|
buildCommand?: string | undefined;
|
|
50
50
|
buildOutputPath?: string | undefined;
|
|
51
51
|
appPath?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import type { IncomingMessage, OutgoingHttpHeader, OutgoingHttpHeaders, ServerRe
|
|
|
2
2
|
import type { Socket } from "node:net";
|
|
3
3
|
import type { TransformCallback } from "node:stream";
|
|
4
4
|
import { Transform } from "node:stream";
|
|
5
|
-
import type { StreamCreator } from "../types/open-next";
|
|
5
|
+
import type { StreamCreator } from "../types/open-next.js";
|
|
6
6
|
export declare class OpenNextNodeResponse extends Transform implements ServerResponse {
|
|
7
7
|
private fixHeadersFn;
|
|
8
8
|
private onEnd;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fromReadableStream } from "../../utils/stream";
|
|
1
|
+
import { fromReadableStream } from "../../utils/stream.js";
|
|
2
2
|
import { debug } from "../../adapters/logger";
|
|
3
3
|
import { extractHostFromHeaders, removeUndefinedFromQuery } from "./utils";
|
|
4
4
|
function normalizeAPIGatewayProxyEventHeaders(event) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseSetCookieHeader } from "../../http/util";
|
|
2
|
-
import { fromReadableStream } from "../../utils/stream";
|
|
1
|
+
import { parseSetCookieHeader } from "../../http/util.js";
|
|
2
|
+
import { fromReadableStream } from "../../utils/stream.js";
|
|
3
3
|
import { debug } from "../../adapters/logger";
|
|
4
4
|
import { convertToQuery } from "../../core/routing/util";
|
|
5
5
|
import { extractHostFromHeaders, removeUndefinedFromQuery } from "./utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseSetCookieHeader } from "../../http/util";
|
|
2
|
-
import { fromReadableStream } from "../../utils/stream";
|
|
1
|
+
import { parseSetCookieHeader } from "../../http/util.js";
|
|
2
|
+
import { fromReadableStream } from "../../utils/stream.js";
|
|
3
3
|
import { debug } from "../../adapters/logger";
|
|
4
4
|
import { convertToQuery, convertToQueryString } from "../../core/routing/util";
|
|
5
5
|
import { extractHostFromHeaders } from "./utils";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next";
|
|
2
|
-
import type { Converter } from "../../types/overrides";
|
|
1
|
+
import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next.js";
|
|
2
|
+
import type { Converter } from "../../types/overrides.js";
|
|
3
3
|
declare global {
|
|
4
4
|
var __dangerous_ON_edge_converter_returns_request: boolean | undefined;
|
|
5
5
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
2
|
import cookieParser from "cookie";
|
|
3
|
-
import { parseSetCookieHeader } from "../../http/util";
|
|
3
|
+
import { parseSetCookieHeader } from "../../http/util.js";
|
|
4
4
|
import { getQueryFromSearchParams } from "./utils.js";
|
|
5
5
|
// https://fetch.spec.whatwg.org/#statuses
|
|
6
6
|
const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Converter } from "../../types/overrides";
|
|
1
|
+
import type { Converter } from "../../types/overrides.js";
|
|
2
2
|
import type { RevalidateEvent } from "../../adapters/revalidate";
|
|
3
3
|
declare const converter: Converter<RevalidateEvent, RevalidateEvent>;
|
|
4
4
|
export default converter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { NextConfig } from "../../adapters/config/index";
|
|
4
|
-
import { getMonorepoRelativePath } from "../../utils/normalize-path";
|
|
3
|
+
import { NextConfig } from "../../adapters/config/index.js";
|
|
4
|
+
import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
|
|
5
5
|
export default {
|
|
6
6
|
name: "fs-dev",
|
|
7
7
|
load: async (url) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from "node:stream";
|
|
2
2
|
import { AwsClient } from "aws4fetch";
|
|
3
|
-
import { FatalError } from "../../utils/error";
|
|
3
|
+
import { FatalError } from "../../utils/error.js";
|
|
4
4
|
let awsClient = null;
|
|
5
5
|
const { BUCKET_NAME, BUCKET_KEY_PREFIX } = process.env;
|
|
6
6
|
// https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
|
|
2
|
-
import { FatalError } from "../../utils/error";
|
|
2
|
+
import { FatalError } from "../../utils/error.js";
|
|
3
3
|
import { awsLogger } from "../../adapters/logger";
|
|
4
4
|
const { BUCKET_NAME, BUCKET_KEY_PREFIX } = process.env;
|
|
5
5
|
function ensureBucketExists() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { getMonorepoRelativePath } from "../../utils/normalize-path";
|
|
3
|
+
import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
|
|
4
4
|
const buildId = process.env.OPEN_NEXT_BUILD_ID;
|
|
5
5
|
const basePath = path.join(getMonorepoRelativePath(), "cache");
|
|
6
6
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IncrementalCache } from "../../types/overrides";
|
|
1
|
+
import type { IncrementalCache } from "../../types/overrides.js";
|
|
2
2
|
/**
|
|
3
3
|
* This cache implementation uses a multi-tier cache with a local cache, a DynamoDB metadata cache and an S3 cache.
|
|
4
4
|
* It uses the same DynamoDB table as the default tag cache and the same S3 bucket as the default incremental cache.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { customFetchClient } from "../../utils/fetch";
|
|
2
|
-
import { LRUCache } from "../../utils/lru";
|
|
1
|
+
import { customFetchClient } from "../../utils/fetch.js";
|
|
2
|
+
import { LRUCache } from "../../utils/lru.js";
|
|
3
3
|
import { debug } from "../../adapters/logger";
|
|
4
4
|
import S3Cache, { getAwsClient } from "./s3-lite";
|
|
5
5
|
// TTL for the local cache in milliseconds
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AwsClient } from "aws4fetch";
|
|
2
|
-
import type { IncrementalCache } from "../../types/overrides";
|
|
2
|
+
import type { IncrementalCache } from "../../types/overrides.js";
|
|
3
3
|
export declare const getAwsClient: () => AwsClient;
|
|
4
4
|
declare const incrementalCache: IncrementalCache;
|
|
5
5
|
export default incrementalCache;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { AwsClient } from "aws4fetch";
|
|
4
|
-
import { IgnorableError, RecoverableError } from "../../utils/error";
|
|
5
|
-
import { customFetchClient } from "../../utils/fetch";
|
|
4
|
+
import { IgnorableError, RecoverableError } from "../../utils/error.js";
|
|
5
|
+
import { customFetchClient } from "../../utils/fetch.js";
|
|
6
6
|
import { parseNumberFromEnv } from "../../adapters/util";
|
|
7
7
|
let awsClient = null;
|
|
8
8
|
export const getAwsClient = () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AwsClient } from "aws4fetch";
|
|
2
|
-
import { RecoverableError } from "../../utils/error";
|
|
3
|
-
import { customFetchClient } from "../../utils/fetch";
|
|
2
|
+
import { RecoverableError } from "../../utils/error.js";
|
|
3
|
+
import { customFetchClient } from "../../utils/fetch.js";
|
|
4
4
|
import { error } from "../../adapters/logger";
|
|
5
5
|
let awsClient = null;
|
|
6
6
|
const getAwsClient = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { AwsClient } from "aws4fetch";
|
|
4
|
-
import { RecoverableError } from "../../utils/error";
|
|
5
|
-
import { customFetchClient } from "../../utils/fetch";
|
|
4
|
+
import { RecoverableError } from "../../utils/error.js";
|
|
5
|
+
import { customFetchClient } from "../../utils/fetch.js";
|
|
6
6
|
import { debug, error } from "../../adapters/logger";
|
|
7
7
|
import { chunk, parseNumberFromEnv } from "../../adapters/util";
|
|
8
8
|
import { MAX_DYNAMO_BATCH_WRITE_ITEM_COUNT, getDynamoBatchWriteCommandConcurrency, } from "./constants";
|
|
@@ -4,6 +4,6 @@ declare const _default: {
|
|
|
4
4
|
getLastRevalidated: (tags: string[]) => Promise<number>;
|
|
5
5
|
hasBeenRevalidated: (tags: string[], lastModified?: number) => Promise<boolean>;
|
|
6
6
|
isStale: (tags: string[], lastModified?: number) => Promise<boolean>;
|
|
7
|
-
writeTags: (tags: import("../../types/overrides").NextModeTagCacheWriteInput[]) => Promise<void>;
|
|
7
|
+
writeTags: (tags: import("../../types/overrides.js").NextModeTagCacheWriteInput[]) => Promise<void>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AwsClient } from "aws4fetch";
|
|
2
|
-
import { RecoverableError } from "../../utils/error";
|
|
3
|
-
import { customFetchClient } from "../../utils/fetch";
|
|
2
|
+
import { RecoverableError } from "../../utils/error.js";
|
|
3
|
+
import { customFetchClient } from "../../utils/fetch.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { debug, error } from "../../adapters/logger";
|
|
6
6
|
import { chunk, parseNumberFromEnv } from "../../adapters/util";
|
|
@@ -4,6 +4,6 @@ declare const _default: {
|
|
|
4
4
|
getLastRevalidated: (tags: string[]) => Promise<number>;
|
|
5
5
|
hasBeenRevalidated: (tags: string[], lastModified?: number) => Promise<boolean>;
|
|
6
6
|
isStale: (tags: string[], lastModified?: number) => Promise<boolean>;
|
|
7
|
-
writeTags: (tags: import("../../types/overrides").NextModeTagCacheWriteInput[]) => Promise<void>;
|
|
7
|
+
writeTags: (tags: import("../../types/overrides.js").NextModeTagCacheWriteInput[]) => Promise<void>;
|
|
8
8
|
};
|
|
9
9
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { getMonorepoRelativePath } from "../../utils/normalize-path";
|
|
3
|
+
import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
|
|
4
4
|
const tagFile = path.join(getMonorepoRelativePath(), "dynamodb-provider/dynamodb-cache.json");
|
|
5
5
|
const tagContent = fs.readFileSync(tagFile, "utf-8");
|
|
6
6
|
let tags = JSON.parse(tagContent);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WrapperHandler } from "../../types/overrides";
|
|
1
|
+
import type { WrapperHandler } from "../../types/overrides.js";
|
|
2
2
|
import type { WarmerEvent, WarmerResponse } from "../../adapters/warmer-function";
|
|
3
3
|
export declare function formatWarmerResponse(event: WarmerEvent): Promise<WarmerResponse>;
|
|
4
4
|
declare const _default: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next";
|
|
2
|
-
import type { WrapperHandler } from "../../types/overrides";
|
|
1
|
+
import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next.js";
|
|
2
|
+
import type { WrapperHandler } from "../../types/overrides.js";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
wrapper: WrapperHandler<InternalEvent, InternalResult | MiddlewareResult>;
|
|
5
5
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InternalEvent, InternalResult } from "../../types/open-next";
|
|
2
|
-
import type { WrapperHandler } from "../../types/overrides";
|
|
1
|
+
import type { InternalEvent, InternalResult } from "../../types/open-next.js";
|
|
2
|
+
import type { WrapperHandler } from "../../types/overrides.js";
|
|
3
3
|
declare const _default: {
|
|
4
4
|
wrapper: WrapperHandler<InternalEvent, InternalResult>;
|
|
5
5
|
name: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import express from "express";
|
|
3
|
-
import { NextConfig } from "../../adapters/config/index";
|
|
4
|
-
import { getMonorepoRelativePath } from "../../utils/normalize-path";
|
|
3
|
+
import { NextConfig } from "../../adapters/config/index.js";
|
|
4
|
+
import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
|
|
5
5
|
const wrapper = async (handler, converter) => {
|
|
6
6
|
const app = express();
|
|
7
7
|
// We disable this cause we wanna use it ourself
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from "esbuild";
|
|
2
|
-
import type { DefaultOverrideOptions, IncludedImageLoader, IncludedOriginResolver, IncludedWarmer, LazyLoadedOverride, OverrideOptions } from "../types/open-next";
|
|
3
|
-
import type { ImageLoader, OriginResolver, Warmer } from "../types/overrides";
|
|
2
|
+
import type { DefaultOverrideOptions, IncludedImageLoader, IncludedOriginResolver, IncludedWarmer, LazyLoadedOverride, OverrideOptions } from "../types/open-next.js";
|
|
3
|
+
import type { ImageLoader, OriginResolver, Warmer } from "../types/overrides.js";
|
|
4
4
|
export interface IPluginSettings {
|
|
5
5
|
overrides?: {
|
|
6
6
|
wrapper?: DefaultOverrideOptions<any, any>["wrapper"];
|
package/dist/types/global.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import type { OutgoingHttpHeaders } from "node:http";
|
|
3
|
-
import type { AssetResolver, CDNInvalidationHandler, IncrementalCache, ProxyExternalRequest, Queue, TagCache } from "./overrides";
|
|
3
|
+
import type { AssetResolver, CDNInvalidationHandler, IncrementalCache, ProxyExternalRequest, Queue, TagCache } from "./overrides.js";
|
|
4
4
|
import type { DetachedPromiseRunner } from "../utils/promise";
|
|
5
5
|
import type { RequestCache } from "../utils/requestCache";
|
|
6
6
|
import type { OpenNextConfig, WaitUntil } from "./open-next";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Readable } from "node:stream";
|
|
2
|
-
import type { Extension, Meta, StoredComposableCacheEntry } from "./cache";
|
|
2
|
+
import type { Extension, Meta, StoredComposableCacheEntry } from "./cache.js";
|
|
3
3
|
import type { BaseEventOrResult, BaseOverride, InternalEvent, InternalResult, Origin, ResolvedRoute, StreamCreator, WaitUntil } from "./open-next";
|
|
4
4
|
export interface QueueMessage {
|
|
5
5
|
MessageDeduplicationId: string;
|
package/dist/utils/cache.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CacheValue, NextModeTagCacheWriteInput, OriginalTagCacheWriteInput, WithLastModified } from "../types/overrides";
|
|
1
|
+
import type { CacheValue, NextModeTagCacheWriteInput, OriginalTagCacheWriteInput, WithLastModified } from "../types/overrides.js";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param key The key for that specific cache entry
|
package/dist/utils/promise.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WaitUntil } from "../types/open-next";
|
|
1
|
+
import type { WaitUntil } from "../types/open-next.js";
|
|
2
2
|
/**
|
|
3
3
|
* A `Promise.withResolvers` implementation that exposes the `resolve` and
|
|
4
4
|
* `reject` functions on a `Promise`.
|
|
@@ -13,8 +13,25 @@ export declare class DetachedPromise<T = any> {
|
|
|
13
13
|
}
|
|
14
14
|
export declare class DetachedPromiseRunner {
|
|
15
15
|
private promises;
|
|
16
|
+
/**
|
|
17
|
+
* Create a deferred promise tracked by this runner.
|
|
18
|
+
*
|
|
19
|
+
* @returns The tracked promise and its resolve/reject functions.
|
|
20
|
+
*/
|
|
16
21
|
withResolvers<T>(): DetachedPromise<T>;
|
|
22
|
+
/**
|
|
23
|
+
* Track background work and handle failures immediately.
|
|
24
|
+
*
|
|
25
|
+
* @param promise Work to await, including work registered during an active drain.
|
|
26
|
+
* @returns Nothing; failures are logged rather than propagated.
|
|
27
|
+
*/
|
|
17
28
|
add<T>(promise: Promise<T>): void;
|
|
29
|
+
/**
|
|
30
|
+
* Drain tracked work, including additions made while earlier work is pending.
|
|
31
|
+
*
|
|
32
|
+
* Work started after the drain has settled still needs a new runtime waitUntil.
|
|
33
|
+
* @returns Resolves when all work registered during this drain has settled.
|
|
34
|
+
*/
|
|
18
35
|
await(): Promise<void>;
|
|
19
36
|
}
|
|
20
37
|
export declare function runWithOpenNextRequestContext<T>({ isISRRevalidation, waitUntil, requestId, }: {
|