Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"dependencies": {
"@ast-grep/napi": "^0.34.1",
"@dotenvx/dotenvx": "catalog:",
"@opennextjs/aws": "https://pkg.pr.new/@opennextjs/aws@748",
"@opennextjs/aws": "https://pkg.pr.new/@opennextjs/aws@756",
"enquirer": "^2.4.1",
"glob": "catalog:",
"yaml": "^2.7.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/src/api/d1-tag-cache.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { debug, error } from "@opennextjs/aws/adapters/logger.js";
import type { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
import type { TagCache } from "@opennextjs/aws/types/overrides.js";
import type { OriginalTagCache } from "@opennextjs/aws/types/overrides.js";
import { RecoverableError } from "@opennextjs/aws/utils/error.js";

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

public async getByPath(rawPath: string): Promise<string[]> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { installDependencies } from "@opennextjs/aws/build/installDeps.js";
import logger from "@opennextjs/aws/logger.js";
import { minifyAll } from "@opennextjs/aws/minimize-js.js";
import { openNextEdgePlugins } from "@opennextjs/aws/plugins/edge.js";
import { openNextExternalMiddlewarePlugin } from "@opennextjs/aws/plugins/externalMiddleware.js";
import { openNextReplacementPlugin } from "@opennextjs/aws/plugins/replacement.js";
import { openNextResolvePlugin } from "@opennextjs/aws/plugins/resolve.js";
import type { FunctionOptions, SplittedFunctionOptions } from "@opennextjs/aws/types/open-next.js";
Expand Down Expand Up @@ -150,13 +151,13 @@ async function generateBundle(
buildHelper.copyEnvFile(appBuildOutputPath, packagePath, outputPath);

// Copy all necessary traced files
await copyTracedFiles(
appBuildOutputPath,
await copyTracedFiles({
buildOutputPath: appBuildOutputPath,
packagePath,
outputPath,
fnOptions.routes ?? ["app/page.tsx"],
isBundled
);
outputDir: outputPath,
routes: fnOptions.routes ?? ["app/page.tsx"],
bundledNextServer: isBundled,
});

// Build Lambda code
// note: bundle in OpenNext package b/c the adapter relies on the
Expand Down Expand Up @@ -198,9 +199,10 @@ async function generateBundle(
overrides,
}),

openNextExternalMiddlewarePlugin(path.join(options.openNextDistDir, "core", "edgeFunctionHandler.js")),

openNextEdgePlugins({
nextDir: path.join(options.appBuildOutputPath, ".next"),
edgeFunctionHandlerPath: path.join(options.openNextDistDir, "core", "edgeFunctionHandler.js"),
isInCloudfare: true,
}),
];
Expand Down
49 changes: 30 additions & 19 deletions pnpm-lock.yaml

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