Skip to content
Draft
11 changes: 9 additions & 2 deletions examples/app-pages-router/open-next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import type { OpenNextConfig, OverrideOptions } from "@opennextjs/aws/types/open
const devOverride = {
wrapper: "express-dev",
converter: "node",
incrementalCache: "fs-dev",
cache: "local",
queue: "direct",
tagCache: "fs-dev-nextMode",
} satisfies OverrideOptions;

export default {
Expand All @@ -26,6 +25,14 @@ export default {
},
loader: "fs-dev",
},
cacheHandler: {
override: {
wrapper: "dummy",
converter: "dummy",
},
incrementalCache: "fs-dev",
tagCache: "fs-dev-nextMode",
},
// You can override the build command here so that you don't have to rebuild next every time you make a change
// buildCommand: "echo 'No build command'",
} satisfies OpenNextConfig;
12 changes: 10 additions & 2 deletions examples/app-router/open-next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export default {
override: {
wrapper: "express-dev",
converter: "node",
incrementalCache: "fs-dev",
cache: "local",
queue: "direct",
tagCache: "fs-dev-nextMode",
},
},

Expand All @@ -23,6 +22,15 @@ export default {
loader: "fs-dev",
},

cacheHandler: {
override: {
wrapper: "dummy",
converter: "dummy",
},
incrementalCache: "fs-dev",
tagCache: "fs-dev-nextMode",
},

// You can override the build command here so that you don't have to rebuild next every time you make a change
//buildCommand: "echo 'No build command'",
} satisfies OpenNextConfig;
12 changes: 10 additions & 2 deletions examples/experimental/open-next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export default {
override: {
wrapper: "express-dev",
converter: "node",
incrementalCache: "fs-dev",
queue: "direct",
tagCache: "fs-dev-nextMode",
cache: "local",
},
},

Expand All @@ -19,6 +18,15 @@ export default {
loader: "fs-dev",
},

cacheHandler: {
override: {
wrapper: "dummy",
converter: "dummy",
},
incrementalCache: "fs-dev",
tagCache: "fs-dev-nextMode",
},

// You can override the build command here so that you don't have to rebuild next every time you make a change
//buildCommand: "echo 'No build command'",
} satisfies OpenNextConfig;
12 changes: 10 additions & 2 deletions examples/pages-router/open-next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ export default {
override: {
wrapper: "express-dev",
converter: "node",
incrementalCache: "fs-dev",
queue: "direct",
tagCache: "dummy",
cache: "local",
},
},

Expand All @@ -17,6 +16,15 @@ export default {
loader: "fs-dev",
},

cacheHandler: {
override: {
wrapper: "dummy",
converter: "dummy",
},
incrementalCache: "fs-dev",
tagCache: "dummy",
},

// You can override the build command here so that you don't have to rebuild next every time you make a change
//buildCommand: "echo 'No build command'",
};
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { NextModeTagCache } from "@opennextjs/aws/types/overrides.js";
import { NextModeTagCache, NextModeTagCacheWriteInput } from "@opennextjs/aws/types/overrides.js";

interface WithFilterOptions {
/**
* The original tag cache.
* Call to this will receive only the filtered tags.
*/
tagCache: NextModeTagCache;

/**
* The function to filter tags.
* @param tag The tag to filter.
* Filter function that returns true if the tag should be forwarded to the underlying tag cache.
* @returns true if the tag should be forwarded, false otherwise.
*/
filterFn: (tag: string) => boolean;
filterFn: (tag: string | NextModeTagCacheWriteInput) => boolean;
}

/**
Expand Down Expand Up @@ -60,6 +59,7 @@ export function withFilter({ tagCache, filterFn }: WithFilterOptions): NextModeT
* This is used to filter out internal soft tags.
* Can be used if `revalidatePath` is not used.
*/
export function softTagFilter(tag: string): boolean {
return !tag.startsWith("_N_T_");
export function softTagFilter(tag: string | { tag: string }): boolean {
const tagStr = typeof tag === "string" ? tag : tag.tag;
return !tagStr.startsWith("_N_T_");
}
5 changes: 5 additions & 0 deletions packages/open-next/src/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { compileCache } from "./build/compileCache.js";
import { compileOpenNextConfig } from "./build/compileConfig.js";
import { compileTagCacheProvider } from "./build/compileTagCacheProvider.js";
import { createCacheAssets, createStaticAssets } from "./build/createAssets.js";
import { createCacheBundle } from "./build/createCacheBundle.js";
import { createImageOptimizationBundle } from "./build/createImageOptimizationBundle.js";
import { createMiddleware } from "./build/createMiddleware.js";
import { createRevalidationBundle } from "./build/createRevalidationBundle.js";
Expand Down Expand Up @@ -130,6 +131,10 @@ export default {
console.log("Revalidation bundle created");
await createImageOptimizationBundle(buildOpts);
console.log("Image optimization bundle created");
if (buildOpts.config.dangerous?.disableIncrementalCache !== true) {
await createCacheBundle(buildOpts);
console.log("Cache bundle created");
}
await createWarmerBundle(buildOpts);
console.log("Warmer bundle created");
await generateOutput(buildOpts);
Expand Down
Loading
Loading