Skip to content

Commit 47b673a

Browse files
conico974vicb
andauthored
fix: update @opennextjs/aws dependency version to 756 (#403)
* fix: update @opennextjs/aws dependency version to 725 * lint fix * updated to use #756 * prettier fix * Update packages/cloudflare/src/cli/build/open-next/createServerBundle.ts Co-authored-by: Victor Berchet <victor@suumit.com> --------- Co-authored-by: Victor Berchet <victor@suumit.com>
1 parent a7bf738 commit 47b673a

File tree

4 files changed

+42
-29
lines changed

4 files changed

+42
-29
lines changed

packages/cloudflare/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"dependencies": {
7474
"@ast-grep/napi": "^0.34.1",
7575
"@dotenvx/dotenvx": "catalog:",
76-
"@opennextjs/aws": "https://pkg.pr.new/@opennextjs/aws@748",
76+
"@opennextjs/aws": "https://pkg.pr.new/@opennextjs/aws@756",
7777
"enquirer": "^2.4.1",
7878
"glob": "catalog:",
7979
"yaml": "^2.7.0"

packages/cloudflare/src/api/d1-tag-cache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { debug, error } from "@opennextjs/aws/adapters/logger.js";
22
import type { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
3-
import type { TagCache } from "@opennextjs/aws/types/overrides.js";
3+
import type { OriginalTagCache } from "@opennextjs/aws/types/overrides.js";
44
import { RecoverableError } from "@opennextjs/aws/utils/error.js";
55

66
import { getCloudflareContext } from "./cloudflare-context.js";
@@ -22,7 +22,7 @@ import { getCloudflareContext } from "./cloudflare-context.js";
2222
* and `revalidatedAt`. The table name can be configured with `NEXT_CACHE_D1_REVALIDATIONS_TABLE`
2323
* environment variable.
2424
*/
25-
class D1TagCache implements TagCache {
25+
class D1TagCache implements OriginalTagCache {
2626
public readonly name = "d1-tag-cache";
2727

2828
public async getByPath(rawPath: string): Promise<string[]> {

packages/cloudflare/src/cli/build/open-next/createServerBundle.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { installDependencies } from "@opennextjs/aws/build/installDeps.js";
1313
import logger from "@opennextjs/aws/logger.js";
1414
import { minifyAll } from "@opennextjs/aws/minimize-js.js";
1515
import { openNextEdgePlugins } from "@opennextjs/aws/plugins/edge.js";
16+
import { openNextExternalMiddlewarePlugin } from "@opennextjs/aws/plugins/externalMiddleware.js";
1617
import { openNextReplacementPlugin } from "@opennextjs/aws/plugins/replacement.js";
1718
import { openNextResolvePlugin } from "@opennextjs/aws/plugins/resolve.js";
1819
import type { FunctionOptions, SplittedFunctionOptions } from "@opennextjs/aws/types/open-next.js";
@@ -150,13 +151,13 @@ async function generateBundle(
150151
buildHelper.copyEnvFile(appBuildOutputPath, packagePath, outputPath);
151152

152153
// Copy all necessary traced files
153-
await copyTracedFiles(
154-
appBuildOutputPath,
154+
await copyTracedFiles({
155+
buildOutputPath: appBuildOutputPath,
155156
packagePath,
156-
outputPath,
157-
fnOptions.routes ?? ["app/page.tsx"],
158-
isBundled
159-
);
157+
outputDir: outputPath,
158+
routes: fnOptions.routes ?? ["app/page.tsx"],
159+
bundledNextServer: isBundled,
160+
});
160161

161162
// Build Lambda code
162163
// note: bundle in OpenNext package b/c the adapter relies on the
@@ -198,9 +199,10 @@ async function generateBundle(
198199
overrides,
199200
}),
200201

202+
openNextExternalMiddlewarePlugin(path.join(options.openNextDistDir, "core/edgeFunctionHandler.js")),
203+
201204
openNextEdgePlugins({
202205
nextDir: path.join(options.appBuildOutputPath, ".next"),
203-
edgeFunctionHandlerPath: path.join(options.openNextDistDir, "core", "edgeFunctionHandler.js"),
204206
isInCloudfare: true,
205207
}),
206208
];

pnpm-lock.yaml

Lines changed: 30 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)