diff --git a/examples/common/apps.ts b/examples/common/apps.ts index 141ababc4..4f2820750 100644 --- a/examples/common/apps.ts +++ b/examples/common/apps.ts @@ -35,7 +35,7 @@ const BASE_NEXT_PORT = 3100; /** * Returns a distinct port for each application so they can run in parallel. */ -export function getAppPort(app: AppName, { isWorker = true } = {}) { +export function getAppPort(app: AppName, { isWorker = true } = {}): number { const index = apps.indexOf(app); if (index === -1) { throw new Error(`Unknown app: ${app}`); @@ -46,7 +46,7 @@ export function getAppPort(app: AppName, { isWorker = true } = {}) { /** * Returns a distinct port for each application so they can run in parallel. */ -export function getInspectorPort(app: AppName) { +export function getInspectorPort(app: AppName): number { const index = apps.indexOf(app); if (index === -1) { throw new Error(`Unknown app: ${app}`); diff --git a/examples/common/config-e2e.ts b/examples/common/config-e2e.ts index 4df2c5c84..f0704cee9 100644 --- a/examples/common/config-e2e.ts +++ b/examples/common/config-e2e.ts @@ -1,8 +1,6 @@ -import { defineConfig, devices } from "@playwright/test"; +import { defineConfig, devices, type PlaywrightTestConfig } from "@playwright/test"; import { getAppPort, getInspectorPort, type AppName } from "./apps"; -declare const process: typeof nodeProcess; - export function configurePlaywright( app: AppName, { @@ -17,7 +15,7 @@ export function configurePlaywright( // Use the turbopack runtime useTurbopack = false, } = {} -) { +): PlaywrightTestConfig { const port = getAppPort(app, { isWorker }); const inspectorPort = getInspectorPort(app); const baseURL = `http://localhost:${port}`; diff --git a/examples/common/package.json b/examples/common/package.json index a145c38e2..32a910467 100644 --- a/examples/common/package.json +++ b/examples/common/package.json @@ -1,5 +1,9 @@ { "name": "common", "private": true, - "type": "module" + "type": "module", + "devDependencies": { + "typescript": "catalog:", + "@types/node": "catalog:" + } } diff --git a/examples/common/tsconfig.json b/examples/common/tsconfig.json index f30272bf7..ba6fc2b72 100644 --- a/examples/common/tsconfig.json +++ b/examples/common/tsconfig.json @@ -1,15 +1,15 @@ { "compilerOptions": { "lib": ["esnext"], - "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, "noEmit": true, "incremental": true, "module": "esnext", "esModuleInterop": true, "moduleResolution": "node", "resolveJsonModule": true, - "isolatedModules": true + "isolatedModules": true, + "types": ["node"] } } diff --git a/packages/cloudflare/src/api/cloudflare-context.ts b/packages/cloudflare/src/api/cloudflare-context.ts index cfde3167b..18f98489b 100644 --- a/packages/cloudflare/src/api/cloudflare-context.ts +++ b/packages/cloudflare/src/api/cloudflare-context.ts @@ -245,7 +245,7 @@ async function getCloudflareContextAsync< * Note: this function should only be called inside the Next.js config file, and although async it doesn't need to be `await`ed * @param options options on how the function should operate and if/where to persist the platform data */ -export async function initOpenNextCloudflareForDev(options?: GetPlatformProxyOptions) { +export async function initOpenNextCloudflareForDev(options?: GetPlatformProxyOptions): Promise { const shouldInitializationRun = shouldContextInitializationRun(); if (!shouldInitializationRun) return; diff --git a/packages/cloudflare/src/api/durable-objects/bucket-cache-purge.ts b/packages/cloudflare/src/api/durable-objects/bucket-cache-purge.ts index 88087280f..fee082b41 100644 --- a/packages/cloudflare/src/api/durable-objects/bucket-cache-purge.ts +++ b/packages/cloudflare/src/api/durable-objects/bucket-cache-purge.ts @@ -26,7 +26,7 @@ export class BucketCachePurge extends DurableObject { }); } - async purgeCacheByTags(tags: string[]) { + async purgeCacheByTags(tags: string[]): Promise { for (const tag of tags) { // Insert the tag into the sql table this.ctx.storage.sql.exec( @@ -43,7 +43,7 @@ export class BucketCachePurge extends DurableObject { } } - override async alarm() { + override async alarm(): Promise { let tags = this.ctx.storage.sql .exec<{ tag: string }>( ` diff --git a/packages/cloudflare/src/api/durable-objects/queue.ts b/packages/cloudflare/src/api/durable-objects/queue.ts index c8b8f7a65..96f49fc90 100644 --- a/packages/cloudflare/src/api/durable-objects/queue.ts +++ b/packages/cloudflare/src/api/durable-objects/queue.ts @@ -72,7 +72,7 @@ export class DOQueueHandler extends DurableObject { debug(`Durable object initialized`); } - async revalidate(msg: QueueMessage) { + async revalidate(msg: QueueMessage): Promise { if (this.ongoingRevalidations.size > 2 * this.maxRevalidations) { warn( `Your durable object has 2 times the maximum number of revalidations (${this.maxRevalidations}) in progress. If this happens often, you should consider increasing the NEXT_CACHE_DO_QUEUE_MAX_REVALIDATION or the number of durable objects with the MAX_REVALIDATE_CONCURRENCY env var.` @@ -110,7 +110,7 @@ export class DOQueueHandler extends DurableObject { this.ctx.waitUntil(revalidationPromise); } - async executeRevalidation(msg: QueueMessage) { + async executeRevalidation(msg: QueueMessage): Promise { let response: Response | undefined; try { debug(`Revalidating ${msg.MessageBody.host}${msg.MessageBody.url}`); @@ -187,7 +187,7 @@ export class DOQueueHandler extends DurableObject { } } - override async alarm() { + override async alarm(): Promise { const currentDateTime = Date.now(); // We fetch the first event that needs to be retried or if the date is expired const nextEventToRetry = Array.from(this.routeInFailedState.values()) @@ -204,7 +204,7 @@ export class DOQueueHandler extends DurableObject { } } - async addToFailedState(msg: QueueMessage) { + async addToFailedState(msg: QueueMessage): Promise { debug(`Adding ${msg.MessageBody.host}${msg.MessageBody.url} to the failed state`); const existingFailedState = this.routeInFailedState.get(msg.MessageDeduplicationId); @@ -245,7 +245,7 @@ export class DOQueueHandler extends DurableObject { await this.addAlarm(); } - async addAlarm() { + async addAlarm(): Promise { const existingAlarm = await this.ctx.storage.getAlarm({ allowConcurrency: false }); if (existingAlarm) return; if (this.routeInFailedState.size === 0) return; @@ -263,7 +263,7 @@ export class DOQueueHandler extends DurableObject { // This function is used to restore the state of the durable object // We don't restore the ongoing revalidations because we cannot know in which state they are // We only restore the failed state and the alarm - async initState() { + async initState(): Promise { if (this.disableSQLite) return; // We store the failed state as a blob, we don't want to do anything with it anyway besides restoring this.sql.exec("CREATE TABLE IF NOT EXISTS failed_state (id TEXT PRIMARY KEY, data TEXT, buildId TEXT)"); @@ -290,7 +290,7 @@ export class DOQueueHandler extends DurableObject { * @param msg * @returns `true` if the route has been revalidated since the lastModified from the message, `false` otherwise */ - checkSyncTable(msg: QueueMessage) { + checkSyncTable(msg: QueueMessage): boolean { try { if (this.disableSQLite) return false; return ( diff --git a/packages/cloudflare/src/api/overrides/cache-purge/index.ts b/packages/cloudflare/src/api/overrides/cache-purge/index.ts index f82683615..8ea3089ab 100644 --- a/packages/cloudflare/src/api/overrides/cache-purge/index.ts +++ b/packages/cloudflare/src/api/overrides/cache-purge/index.ts @@ -8,7 +8,7 @@ interface PurgeOptions { type: "durableObject" | "direct"; } -export const purgeCache = ({ type = "direct" }: PurgeOptions) => { +export const purgeCache = ({ type = "direct" }: PurgeOptions): CDNInvalidationHandler => { return { name: "cloudflare", async invalidatePaths(paths) { @@ -29,7 +29,7 @@ export const purgeCache = ({ type = "direct" }: PurgeOptions) => { } debugCache("cdnInvalidation", "Invalidated paths:", tags); }, - } satisfies CDNInvalidationHandler; + }; }; export default purgeCache; diff --git a/packages/cloudflare/src/api/overrides/incremental-cache/regional-cache.ts b/packages/cloudflare/src/api/overrides/incremental-cache/regional-cache.ts index 2513d0e0d..78d24bfe3 100644 --- a/packages/cloudflare/src/api/overrides/incremental-cache/regional-cache.ts +++ b/packages/cloudflare/src/api/overrides/incremental-cache/regional-cache.ts @@ -218,7 +218,7 @@ class RegionalCache implements IncrementalCache { return this.localCache; } - protected getCacheUrlKey(key: string, cacheType?: CacheEntryType) { + protected getCacheUrlKey(key: string, cacheType?: CacheEntryType): string { const buildId = process.env.OPEN_NEXT_BUILD_ID ?? FALLBACK_BUILD_ID; return "http://cache.local" + `/${buildId}/${key}`.replace(/\/+/g, "/") + `.${cacheType ?? "cache"}`; } @@ -264,7 +264,7 @@ class RegionalCache implements IncrementalCache { * @param cache Incremental cache instance. * @param opts Options for the regional cache. */ -export function withRegionalCache(cache: IncrementalCache, opts: Options) { +export function withRegionalCache(cache: IncrementalCache, opts: Options): RegionalCache { return new RegionalCache(cache, opts); } diff --git a/packages/cloudflare/src/api/overrides/internal.ts b/packages/cloudflare/src/api/overrides/internal.ts index cc7c115d4..f65c76026 100644 --- a/packages/cloudflare/src/api/overrides/internal.ts +++ b/packages/cloudflare/src/api/overrides/internal.ts @@ -10,7 +10,7 @@ export type IncrementalCacheEntry = { lastModified: number; }; -export const debugCache = (name: string, ...args: unknown[]) => { +export const debugCache = (name: string, ...args: unknown[]): void => { if (process.env.NEXT_PRIVATE_DEBUG_CACHE) { console.log(`[${name}] `, ...args); } @@ -26,7 +26,7 @@ export type KeyOptions = { buildId: string | undefined; }; -export function computeCacheKey(key: string, options: KeyOptions) { +export function computeCacheKey(key: string, options: KeyOptions): string { const { cacheType = "cache", prefix = DEFAULT_PREFIX, buildId = FALLBACK_BUILD_ID } = options; const hash = createHash("sha256").update(key).digest("hex"); return `${prefix}/${buildId}/${hash}.${cacheType}`.replace(/\/+/g, "/"); @@ -39,7 +39,7 @@ export function isPurgeCacheEnabled(): boolean { return cdnInvalidation !== undefined && cdnInvalidation !== "dummy"; } -export async function purgeCacheByTags(tags: string[]) { +export async function purgeCacheByTags(tags: string[]): Promise { const { env } = getCloudflareContext(); // We have a durable object for purging cache // We should use it @@ -55,7 +55,7 @@ export async function purgeCacheByTags(tags: string[]) { } } -export async function internalPurgeCacheByTags(env: CloudflareEnv, tags: string[]) { +export async function internalPurgeCacheByTags(env: CloudflareEnv, tags: string[]): Promise { if (!env.CACHE_PURGE_ZONE_ID || !env.CACHE_PURGE_API_TOKEN) { // THIS IS A NO-OP error("No cache zone ID or API token provided. Skipping cache purge."); diff --git a/packages/cloudflare/src/api/overrides/queue/do-queue.ts b/packages/cloudflare/src/api/overrides/queue/do-queue.ts index ebb1a272c..2c70f3922 100644 --- a/packages/cloudflare/src/api/overrides/queue/do-queue.ts +++ b/packages/cloudflare/src/api/overrides/queue/do-queue.ts @@ -5,7 +5,7 @@ import { getCloudflareContext } from "../../cloudflare-context.js"; export default { name: "durable-queue", - send: async (msg: QueueMessage) => { + send: async (msg: QueueMessage): Promise => { const durableObject = getCloudflareContext().env.NEXT_CACHE_DO_QUEUE; if (!durableObject) throw new IgnorableError("No durable object binding for cache revalidation"); diff --git a/packages/cloudflare/src/api/overrides/queue/queue-cache.ts b/packages/cloudflare/src/api/overrides/queue/queue-cache.ts index f084907e1..2bc0b331e 100644 --- a/packages/cloudflare/src/api/overrides/queue/queue-cache.ts +++ b/packages/cloudflare/src/api/overrides/queue/queue-cache.ts @@ -20,7 +20,7 @@ interface QueueCachingOptions { const DEFAULT_QUEUE_CACHE_TTL_SEC = 5; class QueueCache implements Queue { - readonly name; + readonly name: string; readonly regionalCacheTtlSec: number; readonly waitForQueueAck: boolean; cache: Cache | undefined; @@ -36,7 +36,7 @@ class QueueCache implements Queue { this.waitForQueueAck = options.waitForQueueAck ?? false; } - async send(msg: QueueMessage) { + async send(msg: QueueMessage): Promise { try { const isCached = await this.isInCache(msg); if (isCached) { @@ -119,4 +119,5 @@ class QueueCache implements Queue { } } -export default (originalQueue: Queue, opts: QueueCachingOptions = {}) => new QueueCache(originalQueue, opts); +export default (originalQueue: Queue, opts: QueueCachingOptions = {}): QueueCache => + new QueueCache(originalQueue, opts); diff --git a/packages/cloudflare/src/api/overrides/tag-cache/d1-next-tag-cache.ts b/packages/cloudflare/src/api/overrides/tag-cache/d1-next-tag-cache.ts index e288c841e..bb1266b4f 100644 --- a/packages/cloudflare/src/api/overrides/tag-cache/d1-next-tag-cache.ts +++ b/packages/cloudflare/src/api/overrides/tag-cache/d1-next-tag-cache.ts @@ -191,18 +191,18 @@ export class D1NextModeTagCache implements NextModeTagCache { }; } - protected getCacheKey(key: string) { + protected getCacheKey(key: string): string { return `${this.getBuildId()}/${key}`.replaceAll("//", "/"); } - protected getBuildId() { + protected getBuildId(): string { return process.env.OPEN_NEXT_BUILD_ID ?? FALLBACK_BUILD_ID; } /** * @returns request scoped in-memory cache for tag values, or undefined if ALS is not available. */ - protected getItemsCache() { + protected getItemsCache(): Map | undefined { const store = globalThis.__openNextAls?.getStore(); return store?.requestCache.getOrCreate("d1-nextMode:tagItems"); } diff --git a/packages/cloudflare/src/api/overrides/tag-cache/do-sharded-tag-cache.ts b/packages/cloudflare/src/api/overrides/tag-cache/do-sharded-tag-cache.ts index 26f4d222d..394253abf 100644 --- a/packages/cloudflare/src/api/overrides/tag-cache/do-sharded-tag-cache.ts +++ b/packages/cloudflare/src/api/overrides/tag-cache/do-sharded-tag-cache.ts @@ -249,7 +249,11 @@ class ShardedDOTagCache implements NextModeTagCache { * The following methods are public only because they are accessed from the tests */ - public async performWriteTagsWithRetry(doId: DOId, tags: NormalizedTagInput[], retryNumber = 0) { + public async performWriteTagsWithRetry( + doId: DOId, + tags: NormalizedTagInput[], + retryNumber = 0 + ): Promise { try { const stub = this.getDurableObjectStub(doId); await stub.writeTags(tags); @@ -275,7 +279,7 @@ class ShardedDOTagCache implements NextModeTagCache { return `http://local.cache/shard/${doId.shardId}?tag=${encodeURIComponent(tag)}`; } - public async getCacheInstance() { + public async getCacheInstance(): Promise { if (!this.localCache && this.opts.regionalCache) { this.localCache = await caches.open("sharded-do-tag-cache"); } @@ -332,7 +336,7 @@ class ShardedDOTagCache implements NextModeTagCache { optsKey: CacheTagKeyOptions, stub: DurableObjectStub, prefetchedTagData?: Record - ) { + ): Promise { if (!this.opts.regionalCache) return; const cache = await this.getCacheInstance(); if (!cache) return; @@ -374,7 +378,7 @@ class ShardedDOTagCache implements NextModeTagCache { * Deletes the regional cache for the given tags * This is used to ensure that the cache is cleared when the tags are revalidated */ - public async deleteRegionalCache(optsKey: CacheTagKeyOptions) { + public async deleteRegionalCache(optsKey: CacheTagKeyOptions): Promise { // We never want to crash because of the cache try { if (!this.opts.regionalCache) return; @@ -403,7 +407,7 @@ class ShardedDOTagCache implements NextModeTagCache { }: { tags: string[]; generateAllReplicas?: boolean; - }) { + }): CacheTagKeyOptions[] { // Here we'll start by splitting soft tags from hard tags // This will greatly increase the cache hit rate for the soft tag (which are the most likely to cause issue because of load) const softTags = this.generateDOIdArray({ tags, shardType: "soft", generateAllReplicas }); @@ -643,4 +647,4 @@ interface CacheTagKeyOptions { tags: string[]; } -export default (opts?: ShardedDOTagCacheOptions) => new ShardedDOTagCache(opts); +export default (opts?: ShardedDOTagCacheOptions): ShardedDOTagCache => new ShardedDOTagCache(opts); diff --git a/packages/cloudflare/src/api/overrides/tag-cache/kv-next-tag-cache.ts b/packages/cloudflare/src/api/overrides/tag-cache/kv-next-tag-cache.ts index 50ab91b1c..48627b97f 100644 --- a/packages/cloudflare/src/api/overrides/tag-cache/kv-next-tag-cache.ts +++ b/packages/cloudflare/src/api/overrides/tag-cache/kv-next-tag-cache.ts @@ -217,18 +217,18 @@ export class KVNextModeTagCache implements NextModeTagCache { return isDisabled ? undefined : kv; } - protected getCacheKey(key: string) { + protected getCacheKey(key: string): string { return `${this.getBuildId()}/${key}`.replaceAll("//", "/"); } - protected getBuildId() { + protected getBuildId(): string { return process.env.OPEN_NEXT_BUILD_ID ?? FALLBACK_BUILD_ID; } /** * @returns request scoped in-memory cache for tag values, or undefined if ALS is not available. */ - protected getItemsCache() { + protected getItemsCache(): Map | undefined { const store = globalThis.__openNextAls?.getStore(); return store?.requestCache.getOrCreate("kv-nextMode:tagItems"); } diff --git a/packages/cloudflare/src/cli/build/open-next/compile-cache-assets-manifest.ts b/packages/cloudflare/src/cli/build/open-next/compile-cache-assets-manifest.ts index 07ea51140..7888a3334 100644 --- a/packages/cloudflare/src/cli/build/open-next/compile-cache-assets-manifest.ts +++ b/packages/cloudflare/src/cli/build/open-next/compile-cache-assets-manifest.ts @@ -7,7 +7,10 @@ import type { TagCacheMetaFile } from "@opennextjs/aws/types/cache.js"; /** * Generates SQL statements that can be used to initialize the cache assets manifest in an SQL data store. */ -export function compileCacheAssetsManifestSqlFile(options: BuildOptions, metaFiles: TagCacheMetaFile[]) { +export function compileCacheAssetsManifestSqlFile( + options: BuildOptions, + metaFiles: TagCacheMetaFile[] +): void { const outputPath = path.join(options.outputDir, "cloudflare/cache-assets-manifest.sql"); mkdirSync(path.dirname(outputPath), { recursive: true }); diff --git a/packages/cloudflare/src/cli/build/open-next/compile-env-files.ts b/packages/cloudflare/src/cli/build/open-next/compile-env-files.ts index 9da91d3ec..2dd9928d5 100644 --- a/packages/cloudflare/src/cli/build/open-next/compile-env-files.ts +++ b/packages/cloudflare/src/cli/build/open-next/compile-env-files.ts @@ -8,7 +8,7 @@ import { extractProjectEnvVars } from "../../utils/extract-project-env-vars.js"; /** * Compiles the values extracted from the project's env files to the output directory for use in the worker. */ -export function compileEnvFiles(buildOpts: BuildOptions) { +export function compileEnvFiles(buildOpts: BuildOptions): void { const envDir = path.join(buildOpts.outputDir, "cloudflare"); fs.mkdirSync(envDir, { recursive: true }); ["production", "development", "test"].forEach((mode) => diff --git a/packages/cloudflare/src/cli/build/open-next/compile-images.ts b/packages/cloudflare/src/cli/build/open-next/compile-images.ts index f3b2525c4..8e181d742 100644 --- a/packages/cloudflare/src/cli/build/open-next/compile-images.ts +++ b/packages/cloudflare/src/cli/build/open-next/compile-images.ts @@ -8,7 +8,7 @@ import { build } from "esbuild"; /** * Compiles the initialization code for the workerd runtime */ -export async function compileImages(options: BuildOptions) { +export async function compileImages(options: BuildOptions): Promise { const currentDir = path.join(path.dirname(fileURLToPath(import.meta.url))); const templatesDir = path.join(currentDir, "../../templates"); const imagesPath = path.join(templatesDir, "images.js"); diff --git a/packages/cloudflare/src/cli/build/open-next/compile-init.ts b/packages/cloudflare/src/cli/build/open-next/compile-init.ts index 6ccf4ffda..9dbe4a25b 100644 --- a/packages/cloudflare/src/cli/build/open-next/compile-init.ts +++ b/packages/cloudflare/src/cli/build/open-next/compile-init.ts @@ -9,7 +9,7 @@ import type { Unstable_Config } from "wrangler"; /** * Compiles the initialization code for the workerd runtime */ -export async function compileInit(options: BuildOptions, wranglerConfig: Unstable_Config) { +export async function compileInit(options: BuildOptions, wranglerConfig: Unstable_Config): Promise { const currentDir = path.join(path.dirname(fileURLToPath(import.meta.url))); const templatesDir = path.join(currentDir, "../../templates"); const initPath = path.join(templatesDir, "init.js"); diff --git a/packages/cloudflare/src/cli/build/open-next/compile-skew-protection.ts b/packages/cloudflare/src/cli/build/open-next/compile-skew-protection.ts index bd70f252c..f4b284bda 100644 --- a/packages/cloudflare/src/cli/build/open-next/compile-skew-protection.ts +++ b/packages/cloudflare/src/cli/build/open-next/compile-skew-protection.ts @@ -6,7 +6,7 @@ import { build } from "esbuild"; import type { OpenNextConfig } from "../../../api/index.js"; -export async function compileSkewProtection(options: BuildOptions, config: OpenNextConfig) { +export async function compileSkewProtection(options: BuildOptions, config: OpenNextConfig): Promise { const currentDir = path.join(path.dirname(fileURLToPath(import.meta.url))); const templatesDir = path.join(currentDir, "../../templates"); const initPath = path.join(templatesDir, "skew-protection.js"); diff --git a/packages/cloudflare/src/cli/build/open-next/compileDurableObjects.ts b/packages/cloudflare/src/cli/build/open-next/compileDurableObjects.ts index 8696bc9a9..f9631a885 100644 --- a/packages/cloudflare/src/cli/build/open-next/compileDurableObjects.ts +++ b/packages/cloudflare/src/cli/build/open-next/compileDurableObjects.ts @@ -4,7 +4,7 @@ import path from "node:path"; import { loadBuildId, loadConfig, loadPrerenderManifest } from "@opennextjs/aws/adapters/config/util.js"; import { type BuildOptions, esbuildSync } from "@opennextjs/aws/build/helper.js"; -export function compileDurableObjects(buildOpts: BuildOptions) { +export function compileDurableObjects(buildOpts: BuildOptions): void { const _require = createRequire(import.meta.url); const entryPoints = [ _require.resolve("@opennextjs/cloudflare/durable-objects/queue"), diff --git a/packages/cloudflare/src/cli/build/open-next/createServerBundle.ts b/packages/cloudflare/src/cli/build/open-next/createServerBundle.ts index c556b6026..73080f5eb 100644 --- a/packages/cloudflare/src/cli/build/open-next/createServerBundle.ts +++ b/packages/cloudflare/src/cli/build/open-next/createServerBundle.ts @@ -43,7 +43,7 @@ interface CodeCustomization { export async function createServerBundle( options: buildHelper.BuildOptions, codeCustomization?: CodeCustomization -) { +): Promise { const { config } = options; const foundRoutes = new Set(); // Get all functions to build diff --git a/packages/cloudflare/src/cli/build/patches/ast/vercel-og.ts b/packages/cloudflare/src/cli/build/patches/ast/vercel-og.ts index ca871938d..a8d3fcb0d 100644 --- a/packages/cloudflare/src/cli/build/patches/ast/vercel-og.ts +++ b/packages/cloudflare/src/cli/build/patches/ast/vercel-og.ts @@ -24,7 +24,7 @@ fix: |- * @param root Root node. * @returns Results of applying the rule. */ -export function patchVercelOgImport(root: SgNode) { +export function patchVercelOgImport(root: SgNode): ReturnType { return applyRule(vercelOgImportRule, root); } @@ -60,6 +60,6 @@ fix: |- * @param root Root node. * @returns Results of applying the rule. */ -export function patchVercelOgFallbackFont(root: SgNode) { +export function patchVercelOgFallbackFont(root: SgNode): ReturnType { return applyRule(vercelOgFallbackFontRule, root); } diff --git a/packages/cloudflare/src/cli/build/patches/ast/webpack-runtime.ts b/packages/cloudflare/src/cli/build/patches/ast/webpack-runtime.ts index d1eda60d6..4e2655661 100644 --- a/packages/cloudflare/src/cli/build/patches/ast/webpack-runtime.ts +++ b/packages/cloudflare/src/cli/build/patches/ast/webpack-runtime.ts @@ -73,7 +73,7 @@ fix: | * Fixes the webpack-runtime.js and webpack-api-runtime.js files by inlining * the webpack dynamic requires. */ -export async function patchWebpackRuntime(buildOpts: BuildOptions) { +export async function patchWebpackRuntime(buildOpts: BuildOptions): Promise { const { outputDir } = buildOpts; const dotNextServerDir = join( diff --git a/packages/cloudflare/src/cli/build/patches/plugins/dynamic-requires.ts b/packages/cloudflare/src/cli/build/patches/plugins/dynamic-requires.ts index 7c1ebd9f4..7350dd995 100644 --- a/packages/cloudflare/src/cli/build/patches/plugins/dynamic-requires.ts +++ b/packages/cloudflare/src/cli/build/patches/plugins/dynamic-requires.ts @@ -30,7 +30,7 @@ function getServerDir(buildOpts: BuildOptions) { return join(buildOpts.outputDir, "server-functions/default", getPackagePath(buildOpts), ".next/server"); } -export function getRequires(idVariable: string, files: string[], serverDir: string) { +export function getRequires(idVariable: string, files: string[], serverDir: string): string { // Inline fs access and dynamic requires that are not supported by workerd. // Sort by path length descending so longer (more specific) paths match first. // Without this, `/test/app/page.js` could match the `.endsWith("app/page.js")` diff --git a/packages/cloudflare/src/cli/build/patches/plugins/optional-deps.ts b/packages/cloudflare/src/cli/build/patches/plugins/optional-deps.ts index 4c03b292f..153e0e20a 100644 --- a/packages/cloudflare/src/cli/build/patches/plugins/optional-deps.ts +++ b/packages/cloudflare/src/cli/build/patches/plugins/optional-deps.ts @@ -11,7 +11,10 @@ import type { OnResolveResult, PluginBuild } from "esbuild"; -export function handleOptionalDependencies(dependencies: string[]) { +export function handleOptionalDependencies(dependencies: string[]): { + name: string; + setup: (build: PluginBuild) => Promise; +} { // Regex matching either a full module ("module") or a prefix ("module/...") const filter = new RegExp( `^(${dependencies.flatMap((name) => [`${name}$`, String.raw`${name}/`]).join("|")})` diff --git a/packages/cloudflare/src/cli/build/patches/plugins/pages-router-context.ts b/packages/cloudflare/src/cli/build/patches/plugins/pages-router-context.ts index aac87ab11..18a26209e 100644 --- a/packages/cloudflare/src/cli/build/patches/plugins/pages-router-context.ts +++ b/packages/cloudflare/src/cli/build/patches/plugins/pages-router-context.ts @@ -14,7 +14,7 @@ export function patchPagesRouterContext(buildOpts: BuildOptions) { const basePath = `next/dist/server/${isAfter15 ? "" : "future/"}route-modules/pages/vendored/contexts/`; return { name: "pages-router-context", - setup: (build: PluginBuild) => { + setup: (build: PluginBuild): void => { // If we are after 15.3, we don't need to patch the context anymore if (isAfter153) { return; diff --git a/packages/cloudflare/src/cli/build/patches/plugins/wrangler-external.ts b/packages/cloudflare/src/cli/build/patches/plugins/wrangler-external.ts index ce7a34290..7f55c8523 100644 --- a/packages/cloudflare/src/cli/build/patches/plugins/wrangler-external.ts +++ b/packages/cloudflare/src/cli/build/patches/plugins/wrangler-external.ts @@ -24,7 +24,7 @@ export function setWranglerExternal() { return { name: "wrangler-externals", - setup: async (build: PluginBuild) => { + setup: async (build: PluginBuild): Promise => { const namespace = "wrangler-externals-plugin"; //TODO: Ideally in the future we would like to analyze the files in case they are using wasm in a Node way (i.e. WebAssembly.instantiate) diff --git a/packages/cloudflare/src/cli/build/utils/copy-package-cli-files.ts b/packages/cloudflare/src/cli/build/utils/copy-package-cli-files.ts index 2e4174451..e6fdb7d5b 100644 --- a/packages/cloudflare/src/cli/build/utils/copy-package-cli-files.ts +++ b/packages/cloudflare/src/cli/build/utils/copy-package-cli-files.ts @@ -10,7 +10,7 @@ import { getOutputWorkerPath } from "../bundle-server.js"; * - the template files present in the cloudflare adapter package to `.open-next/cloudflare-templates` * - `worker.js` to `.open-next/` */ -export function copyPackageCliFiles(packageDistDir: string, buildOpts: BuildOptions) { +export function copyPackageCliFiles(packageDistDir: string, buildOpts: BuildOptions): void { console.log("# copyPackageTemplateFiles"); const sourceDir = path.join(packageDistDir, "cli/templates"); diff --git a/packages/cloudflare/src/cli/build/utils/ensure-cf-config.ts b/packages/cloudflare/src/cli/build/utils/ensure-cf-config.ts index 426fb2188..2ccdcfd0f 100644 --- a/packages/cloudflare/src/cli/build/utils/ensure-cf-config.ts +++ b/packages/cloudflare/src/cli/build/utils/ensure-cf-config.ts @@ -8,7 +8,7 @@ import type { OpenNextConfig } from "../../../api/config.js"; * * @param config OpenNext configuration. */ -export function ensureCloudflareConfig(config: OpenNextConfig) { +export function ensureCloudflareConfig(config: OpenNextConfig): void { const mwIsMiddlewareExternal = config.middleware?.external === true; const mwConfig = mwIsMiddlewareExternal ? (config.middleware as ExternalMiddlewareConfig) : undefined; diff --git a/packages/cloudflare/src/cli/build/utils/needs-experimental-react.ts b/packages/cloudflare/src/cli/build/utils/needs-experimental-react.ts index 84406ed2e..ebd180470 100644 --- a/packages/cloudflare/src/cli/build/utils/needs-experimental-react.ts +++ b/packages/cloudflare/src/cli/build/utils/needs-experimental-react.ts @@ -13,7 +13,7 @@ interface ExtendedNextConfig extends NextConfig { } // Copied from https://github.com/vercel/next.js/blob/4518bc91641a0fd938664b781e12ae7c145f3396/packages/next/src/lib/needs-experimental-react.ts#L3-L6 -export function needsExperimentalReact(nextConfig: ExtendedNextConfig) { +export function needsExperimentalReact(nextConfig: ExtendedNextConfig): boolean { const { ppr, taint, viewTransition } = nextConfig.experimental || {}; return Boolean(ppr || taint || viewTransition); } diff --git a/packages/cloudflare/src/cli/build/utils/workerd.ts b/packages/cloudflare/src/cli/build/utils/workerd.ts index 5c2d8a586..a2e29c41e 100644 --- a/packages/cloudflare/src/cli/build/utils/workerd.ts +++ b/packages/cloudflare/src/cli/build/utils/workerd.ts @@ -60,7 +60,10 @@ interface PackageJson { * @param json The package.json object * @returns An object with the transformed package.json and a boolean indicating if the build condition was found */ -export function transformPackageJson(json: PackageJson) { +export function transformPackageJson(json: PackageJson): { + transformed: PackageJson; + hasBuildCondition: boolean; +} { const transformed: PackageJson = structuredClone(json); let hasBuildCondition = false; if (json.exports) { @@ -76,7 +79,10 @@ export function transformPackageJson(json: PackageJson) { return { transformed, hasBuildCondition }; } -export async function copyWorkerdPackages(options: BuildOptions, nodePackages: Map) { +export async function copyWorkerdPackages( + options: BuildOptions, + nodePackages: Map +): Promise { const isNodeModuleRegex = getCrossPlatformPathRegex(`.*/node_modules/(?.*)`, { escape: false }); // Copy full external packages when they use "workerd" build condition diff --git a/packages/cloudflare/src/cli/commands/populate-cache.ts b/packages/cloudflare/src/cli/commands/populate-cache.ts index 2ddcffefc..38aeaf5bf 100644 --- a/packages/cloudflare/src/cli/commands/populate-cache.ts +++ b/packages/cloudflare/src/cli/commands/populate-cache.ts @@ -100,7 +100,7 @@ export async function populateCache( wranglerConfig: WranglerConfig, populateCacheOptions: PopulateCacheOptions, envVars: WorkerEnvVar -) { +): Promise { const { incrementalCache, tagCache } = config.default.override ?? {}; if (!fs.existsSync(buildOpts.outputDir)) { diff --git a/packages/cloudflare/src/cli/commands/utils/helpers.ts b/packages/cloudflare/src/cli/commands/utils/helpers.ts index b38ab57d9..68d014171 100644 --- a/packages/cloudflare/src/cli/commands/utils/helpers.ts +++ b/packages/cloudflare/src/cli/commands/utils/helpers.ts @@ -34,7 +34,10 @@ export type WorkerEnvVar = Record; * @param buildOpts Open Next build options * @returns the env vars */ -export async function getEnvFromPlatformProxy(options: GetPlatformProxyOptions, buildOpts: BuildOptions) { +export async function getEnvFromPlatformProxy( + options: GetPlatformProxyOptions, + buildOpts: BuildOptions +): Promise { // 1. Start from `process.env` const envVars = process.env; @@ -82,7 +85,7 @@ export async function getEnvFromPlatformProxy(options: GetPlatformProxyOptions, * @param arg * @returns escaped arg */ -export function quoteShellMeta(arg: string) { +export function quoteShellMeta(arg: string): string { if (process.platform === "win32") { if (arg.length === 0) { return '""'; diff --git a/packages/cloudflare/src/cli/commands/utils/utils.ts b/packages/cloudflare/src/cli/commands/utils/utils.ts index 1f78fdce6..4b127abb0 100644 --- a/packages/cloudflare/src/cli/commands/utils/utils.ts +++ b/packages/cloudflare/src/cli/commands/utils/utils.ts @@ -4,7 +4,7 @@ import path from "node:path"; import url from "node:url"; import { compileOpenNextConfig } from "@opennextjs/aws/build/compileConfig.js"; -import { normalizeOptions } from "@opennextjs/aws/build/helper.js"; +import { type BuildOptions, normalizeOptions } from "@opennextjs/aws/build/helper.js"; import { printHeader, showWarningOnWindows } from "@opennextjs/aws/build/utils.js"; import logger from "@opennextjs/aws/logger.js"; import { unstable_readConfig } from "wrangler"; @@ -27,14 +27,14 @@ export type WithWranglerArgs = T & { env: string | undefined; }; -export const nextAppDir = process.cwd(); +export const nextAppDir: string = process.cwd(); /** * Print headers and warnings for the CLI. * * @param command */ -export function printHeaders(command: string) { +export function printHeaders(command: string): void { printHeader(`Cloudflare ${command}`); showWarningOnWindows(); @@ -55,7 +55,10 @@ export function printHeaders(command: string) { * @returns The compiled OpenNext config and the build directory. * */ -export async function compileConfig(configPath: string | undefined) { +export async function compileConfig(configPath: string | undefined): Promise<{ + config: OpenNextConfig; + buildDir: string; +}> { if (configPath && !existsSync(configPath)) { throw new Error(`Custom config file not found at ${configPath}`); } @@ -94,7 +97,7 @@ export async function compileConfig(configPath: string | undefined) { * * @returns OpenNext config. */ -export async function retrieveCompiledConfig() { +export async function retrieveCompiledConfig(): Promise<{ config: OpenNextConfig }> { const configPath = path.join(nextAppDir, ".open-next/.build/open-next.config.edge.mjs"); if (!existsSync(configPath)) { @@ -115,7 +118,7 @@ export async function retrieveCompiledConfig() { * @param buildDir Directory to use when building the application * @returns Normalized options. */ -export function getNormalizedOptions(config: OpenNextConfig, buildDir = nextAppDir) { +export function getNormalizedOptions(config: OpenNextConfig, buildDir: string = nextAppDir): BuildOptions { const require = createRequire(import.meta.url); const openNextDistDir = path.dirname(require.resolve("@opennextjs/aws/index.js")); @@ -131,7 +134,9 @@ export function getNormalizedOptions(config: OpenNextConfig, buildDir = nextAppD * @param args Wrangler environment and config path. * @returns Wrangler config. */ -export async function readWranglerConfig(args: WithWranglerArgs) { +export async function readWranglerConfig( + args: WithWranglerArgs +): Promise> { // Note: `unstable_readConfig` is sync as of wrangler 4.60.0 // But it will eventually become async. // See https://github.com/cloudflare/workers-sdk/pull/12031 diff --git a/packages/cloudflare/src/cli/templates/shims/env.ts b/packages/cloudflare/src/cli/templates/shims/env.ts index b3f413efd..beee417ee 100644 --- a/packages/cloudflare/src/cli/templates/shims/env.ts +++ b/packages/cloudflare/src/cli/templates/shims/env.ts @@ -1 +1 @@ -export function loadEnvConfig() {} +export function loadEnvConfig(): void {} diff --git a/packages/cloudflare/src/cli/templates/worker.ts b/packages/cloudflare/src/cli/templates/worker.ts index 602b75d9b..5b57f8e6c 100644 --- a/packages/cloudflare/src/cli/templates/worker.ts +++ b/packages/cloudflare/src/cli/templates/worker.ts @@ -14,7 +14,7 @@ export { DOShardedTagCache } from "./.build/durable-objects/sharded-tag-cache.js export { BucketCachePurge } from "./.build/durable-objects/bucket-cache-purge.js"; export default { - async fetch(request, env, ctx) { + async fetch(request: Request, env: CloudflareEnv, ctx: ExecutionContext) { return runWithCloudflareRequestContext(request, env, ctx, async () => { const response = maybeGetSkewProtectionResponse(request); diff --git a/packages/cloudflare/src/cli/utils/extract-project-env-vars.ts b/packages/cloudflare/src/cli/utils/extract-project-env-vars.ts index 2ec853950..b16a2e217 100644 --- a/packages/cloudflare/src/cli/utils/extract-project-env-vars.ts +++ b/packages/cloudflare/src/cli/utils/extract-project-env-vars.ts @@ -26,7 +26,10 @@ function readEnvFile(filePath: string) { * In a monorepo, the env files in an app's directory will take precedence over * the env files at the root of the monorepo. */ -export function extractProjectEnvVars(mode: string, { monorepoRoot, appPath }: BuildOptions) { +export function extractProjectEnvVars( + mode: string, + { monorepoRoot, appPath }: BuildOptions +): Record { return [".env", `.env.${mode}`, ...(mode !== "test" ? [".env.local"] : []), `.env.${mode}.local`] .flatMap((fileName) => [ ...(monorepoRoot !== appPath ? [readEnvFile(path.join(monorepoRoot, fileName))] : []), diff --git a/packages/cloudflare/src/cli/utils/nextjs-support.ts b/packages/cloudflare/src/cli/utils/nextjs-support.ts index fbe01df63..bb52d6f09 100644 --- a/packages/cloudflare/src/cli/utils/nextjs-support.ts +++ b/packages/cloudflare/src/cli/utils/nextjs-support.ts @@ -11,7 +11,7 @@ import logger from "@opennextjs/aws/logger.js"; */ export async function ensureNextjsVersionSupported({ nextVersion, -}: Pick) { +}: Pick): Promise { if (buildHelper.compareSemver(nextVersion, "<", "14.2.0")) { throw new Error("Next.js version unsupported, please upgrade to version 14.2 or greater."); } diff --git a/packages/cloudflare/src/cli/utils/normalize-path.ts b/packages/cloudflare/src/cli/utils/normalize-path.ts index 59f7f2e41..580e3ba6a 100644 --- a/packages/cloudflare/src/cli/utils/normalize-path.ts +++ b/packages/cloudflare/src/cli/utils/normalize-path.ts @@ -1,5 +1,5 @@ import { posix, sep } from "node:path"; -export function normalizePath(path: string) { +export function normalizePath(path: string): string { return path.replaceAll(sep, posix.sep); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9f2dd65f2..f4f73e4e0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -382,6 +382,15 @@ importers: specifier: 'catalog:' version: 4.84.1(@cloudflare/workers-types@4.20260423.1) + examples/common: + devDependencies: + '@types/node': + specifier: 'catalog:' + version: 22.12.0 + typescript: + specifier: 'catalog:' + version: 5.9.3 + examples/create-next-app: dependencies: next: @@ -1247,24 +1256,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@ast-grep/napi-linux-arm64-musl@0.40.5': resolution: {integrity: sha512-/qKsmds5FMoaEj6FdNzepbmLMtlFuBLdrAn9GIWCqOIcVcYvM1Nka8+mncfeXB/MFZKOrzQsQdPTWqrrQzXLrA==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@ast-grep/napi-linux-x64-gnu@0.40.5': resolution: {integrity: sha512-DP4oDbq7f/1A2hRTFLhJfDFR6aI5mRWdEfKfHzRItmlKsR9WlcEl1qDJs/zX9R2EEtIDsSKRzuJNfJllY3/W8Q==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@ast-grep/napi-linux-x64-musl@0.40.5': resolution: {integrity: sha512-BRZUvVBPUNpWPo6Ns8chXVzxHPY+k9gpsubGTHy92Q26ecZULd/dTkWWdnvfhRqttsSQ9Pe/XQdi5+hDQ6RYcg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@ast-grep/napi-win32-arm64-msvc@0.40.5': resolution: {integrity: sha512-y95zSEwc7vhxmcrcH0GnK4ZHEBQrmrszRBNQovzaciF9GUqEcCACNLoBesn4V47IaOp4fYgD2/EhGRTIBFb2Ug==} @@ -3022,155 +3035,183 @@ packages: resolution: {integrity: sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm64@1.2.4': resolution: {integrity: sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.0.5': resolution: {integrity: sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-arm@1.2.4': resolution: {integrity: sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-ppc64@1.2.4': resolution: {integrity: sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-riscv64@1.2.4': resolution: {integrity: sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.0.4': resolution: {integrity: sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-s390x@1.2.4': resolution: {integrity: sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.0.4': resolution: {integrity: sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linux-x64@1.2.4': resolution: {integrity: sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-libvips-linuxmusl-arm64@1.0.4': resolution: {integrity: sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-arm64@1.2.4': resolution: {integrity: sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.0.4': resolution: {integrity: sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-libvips-linuxmusl-x64@1.2.4': resolution: {integrity: sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linux-arm64@0.33.5': resolution: {integrity: sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm64@0.34.5': resolution: {integrity: sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.33.5': resolution: {integrity: sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-arm@0.34.5': resolution: {integrity: sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] + libc: [glibc] '@img/sharp-linux-ppc64@0.34.5': resolution: {integrity: sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@img/sharp-linux-riscv64@0.34.5': resolution: {integrity: sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.33.5': resolution: {integrity: sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-s390x@0.34.5': resolution: {integrity: sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.33.5': resolution: {integrity: sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linux-x64@0.34.5': resolution: {integrity: sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [glibc] '@img/sharp-linuxmusl-arm64@0.33.5': resolution: {integrity: sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-arm64@0.34.5': resolution: {integrity: sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.33.5': resolution: {integrity: sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-linuxmusl-x64@0.34.5': resolution: {integrity: sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] + libc: [musl] '@img/sharp-wasm32@0.33.5': resolution: {integrity: sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==} @@ -3417,96 +3458,112 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-gnu@15.0.0-canary.174': resolution: {integrity: sha512-kVEibHYyQ12zzFPY+YHbYX9z81HhLVK5pQgt1NlFet2M0iBj1PxvOJuu6In1EEV7f3jNEr4r3gf5ieyY3ywnLw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-gnu@15.5.15': resolution: {integrity: sha512-eVkrMcVIBqGfXB+QUC7jjZ94Z6uX/dNStbQFabewAnk13Uy18Igd1YZ/GtPRzdhtm7QwC0e6o7zOQecul4iC1w==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-gnu@16.2.3': resolution: {integrity: sha512-U6vtblPtU/P14Y/b/n9ZY0GOxbbIhTFuaFR7F4/uMBidCi2nSdaOFhA0Go81L61Zd6527+yvuX44T4ksnf8T+Q==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@next/swc-linux-arm64-musl@14.2.33': resolution: {integrity: sha512-Bm+QulsAItD/x6Ih8wGIMfRJy4G73tu1HJsrccPW6AfqdZd0Sfm5Imhgkgq2+kly065rYMnCOxTBvmvFY1BKfg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-arm64-musl@15.0.0-canary.174': resolution: {integrity: sha512-NzfcraJW3jpWDx3dJHzMxLFUAJxdq9GROpO49SIWXu9HKmdZszrInTfnYK98v2C73FNnpFoCGEvBYi/GTnvECw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-arm64-musl@15.5.15': resolution: {integrity: sha512-RwSHKMQ7InLy5GfkY2/n5PcFycKA08qI1VST78n09nN36nUPqCvGSMiLXlfUmzmpQpF6XeBYP2KRWHi0UW3uNg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-arm64-musl@16.2.3': resolution: {integrity: sha512-/YV0LgjHUmfhQpn9bVoGc4x4nan64pkhWR5wyEV8yCOfwwrH630KpvRg86olQHTwHIn1z59uh6JwKvHq1h4QEw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@next/swc-linux-x64-gnu@14.2.33': resolution: {integrity: sha512-FnFn+ZBgsVMbGDsTqo8zsnRzydvsGV8vfiWwUo1LD8FTmPTdV+otGSWKc4LJec0oSexFnCYVO4hX8P8qQKaSlg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-gnu@15.0.0-canary.174': resolution: {integrity: sha512-fJ5W8PrbZZkxCrtX9lmlqn43zvUrQQ5wF/GxcQDFdcwT9l3lx8IhdMZH7Q5rWuikWpI0pU+jqqRdhTpODqpuHA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-gnu@15.5.15': resolution: {integrity: sha512-nplqvY86LakS+eeiuWsNWvfmK8pFcOEW7ZtVRt4QH70lL+0x6LG/m1OpJ/tvrbwjmR8HH9/fH2jzW1GlL03TIg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-gnu@16.2.3': resolution: {integrity: sha512-/HiWEcp+WMZ7VajuiMEFGZ6cg0+aYZPqCJD3YJEfpVWQsKYSjXQG06vJP6F1rdA03COD9Fef4aODs3YxKx+RDQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@next/swc-linux-x64-musl@14.2.33': resolution: {integrity: sha512-345tsIWMzoXaQndUTDv1qypDRiebFxGYx9pYkhwY4hBRaOLt8UGfiWKr9FSSHs25dFIf8ZqIFaPdy5MljdoawA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-linux-x64-musl@15.0.0-canary.174': resolution: {integrity: sha512-OMSzmdZxrh5c7X46ILiK3GvTPgSZghpSFF4wrnXloBpW1LrbbjSYGVSGer5IoVqXR18lpnMscsV9N35FX0MIVw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-linux-x64-musl@15.5.15': resolution: {integrity: sha512-eAgl9NKQ84/sww0v81DQINl/vL2IBxD7sMybd0cWRw6wqgouVI53brVRBrggqBRP/NWeIAE1dm5cbKYoiMlqDQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-linux-x64-musl@16.2.3': resolution: {integrity: sha512-Kt44hGJfZSefebhk/7nIdivoDr3Ugp5+oNz9VvF3GUtfxutucUIHfIO0ZYO8QlOPDQloUVQn4NVC/9JvHRk9hw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@next/swc-win32-arm64-msvc@14.2.33': resolution: {integrity: sha512-nscpt0G6UCTkrT2ppnJnFsYbPDQwmum4GNXYTeoTIdsmMydSKFz9Iny2jpaRupTb+Wl298+Rh82WKzt9LCcqSQ==} @@ -3799,36 +3856,42 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.0-rc.15': resolution: {integrity: sha512-ZvRYMGrAklV9PEkgt4LQM6MjQX2P58HPAuecwYObY2DhS2t35R0I810bKi0wmaYORt6m/2Sm+Z+nFgb0WhXNcQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.15': resolution: {integrity: sha512-VDpgGBzgfg5hLg+uBpCLoFG5kVvEyafmfxGUV0UHLcL5irxAK7PKNeC2MwClgk6ZAiNhmo9FLhRYgvMmedLtnQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.15': resolution: {integrity: sha512-y1uXY3qQWCzcPgRJATPSOUP4tCemh4uBdY7e3EZbVwCJTY3gLJWnQABgeUetvED+bt1FQ01OeZwvhLS2bpNrAQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.0-rc.15': resolution: {integrity: sha512-023bTPBod7J3Y/4fzAN6QtpkSABR0rigtrwaP+qSEabUh5zf6ELr9Nc7GujaROuPY3uwdSIXWrvhn1KxOvurWA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.0-rc.15': resolution: {integrity: sha512-witB2O0/hU4CgfOOKUoeFgQ4GktPi1eEbAhaLAIpgD6+ZnhcPkUtPsoKKHRzmOoWPZue46IThdSgdo4XneOLYw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.0-rc.15': resolution: {integrity: sha512-UCL68NJ0Ud5zRipXZE9dF5PmirzJE4E4BCIOOssEnM7wLDsxjc6Qb0sGDxTNRTP53I6MZpygyCpY8Aa8sPfKPg==} @@ -3899,56 +3962,67 @@ packages: resolution: {integrity: sha512-ehSKrewwsESPt1TgSE/na9nIhWCosfGSFqv7vwEtjyAqZcvbGIg4JAcV7ZEh2tfj/IlfBeZjgOXm35iOOjadcg==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.40.1': resolution: {integrity: sha512-m39iO/aaurh5FVIu/F4/Zsl8xppd76S4qoID8E+dSRQvTyZTOI2gVk3T4oqzfq1PtcvOfAVlwLMK3KRQMaR8lg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.40.1': resolution: {integrity: sha512-Y+GHnGaku4aVLSgrT0uWe2o2Rq8te9hi+MwqGF9r9ORgXhmHK5Q71N757u0F8yU1OIwUIFy6YiJtKjtyktk5hg==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.40.1': resolution: {integrity: sha512-jEwjn3jCA+tQGswK3aEWcD09/7M5wGwc6+flhva7dsQNRZZTe30vkalgIzV4tjkopsTS9Jd7Y1Bsj6a4lzz8gQ==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.40.1': resolution: {integrity: sha512-ySyWikVhNzv+BV/IDCsrraOAZ3UaC8SZB67FZlqVwXwnFhPihOso9rPOxzZbjp81suB1O2Topw+6Ug3JNegejQ==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.40.1': resolution: {integrity: sha512-BvvA64QxZlh7WZWqDPPdt0GH4bznuL6uOO1pmgPnnv86rpUpc8ZxgZwcEgXvo02GRIZX1hQ0j0pAnhwkhwPqWg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.40.1': resolution: {integrity: sha512-EQSP+8+1VuSulm9RKSMKitTav89fKbHymTf25n5+Yr6gAPZxYWpj3DzAsQqoaHAk9YX2lwEyAf9S4W8F4l3VBQ==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.40.1': resolution: {integrity: sha512-n/vQ4xRZXKuIpqukkMXZt9RWdl+2zgGNx7Uda8NtmLJ06NL8jiHxUawbwC+hdSq1rrw/9CghCpEONor+l1e2gA==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.40.1': resolution: {integrity: sha512-h8d28xzYb98fMQKUz0w2fMc1XuGzLLjdyxVIbhbil4ELfk5/orZlSTpF/xdI9C8K0I8lCkq+1En2RJsawZekkg==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.40.1': resolution: {integrity: sha512-XiK5z70PEFEFqcNj3/zRSz/qX4bp4QIraTy9QjwJAb/Z8GM7kVUsD0Uk8maIPeTyPCP03ChdI+VVmJriKYbRHQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.40.1': resolution: {integrity: sha512-2BRORitq5rQ4Da9blVovzNCMaUlyKrzMSvkVR0D4qPuOy/+pMCrh1d7o01RATwVy+6Fa1WBw+da7QPeLWU/1mQ==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.40.1': resolution: {integrity: sha512-b2bcNm9Kbde03H+q+Jjw9tSfhYkzrDUf2d5MAd1bOJuVplXvFhWz7tRtWvD8/ORZi7qSCy0idW6tf2HgxSXQSg==} @@ -4450,24 +4524,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-arm64-musl@4.1.17': resolution: {integrity: sha512-HvZLfGr42i5anKtIeQzxdkw/wPqIbpeZqe7vd3V9vI3RQxe3xU1fLjss0TjyhxWcBaipk7NYwSrwTwK1hJARMg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@tailwindcss/oxide-linux-x64-gnu@4.1.17': resolution: {integrity: sha512-M3XZuORCGB7VPOEDH+nzpJ21XPvK5PyjlkSFkFziNHGLc5d6g3di2McAAblmaSUNl8IOmzYwLx9NsE7bplNkwQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@tailwindcss/oxide-linux-x64-musl@4.1.17': resolution: {integrity: sha512-k7f+pf9eXLEey4pBlw+8dgfJHY4PZ5qOUFDyNf7SI6lHjQ9Zt7+NcscjpwdCEbYi6FI5c2KDTDWyf2iHcCSyyQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@tailwindcss/oxide-wasm32-wasi@4.1.17': resolution: {integrity: sha512-cEytGqSSoy7zK4JRWiTCx43FsKP/zGr0CsuMawhH67ONlH+T79VteQeJQRO/X7L0juEUA8ZyuYikcRBf0vsxhg==} @@ -7284,48 +7362,56 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-gnu@1.32.0: resolution: {integrity: sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.30.2: resolution: {integrity: sha512-5Vh9dGeblpTxWHpOx8iauV02popZDsCYMPIgiuw97OJ5uaDsL86cnqSFs5LZkG3ghHoX5isLgWzMs+eD1YzrnA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-arm64-musl@1.32.0: resolution: {integrity: sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.30.2: resolution: {integrity: sha512-Cfd46gdmj1vQ+lR6VRTTadNHu6ALuw2pKR9lYq4FnhvgBc4zWY1EtZcAc6EffShbb1MFrIPfLDXD6Xprbnni4w==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-gnu@1.32.0: resolution: {integrity: sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.30.2: resolution: {integrity: sha512-XJaLUUFXb6/QG2lGIW6aIk6jKdtjtcffUT0NKvIqhSBY3hh9Ch+1LCeH80dR9q9LBjG3ewbDjnumefsLsP6aiA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-linux-x64-musl@1.32.0: resolution: {integrity: sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.30.2: resolution: {integrity: sha512-FZn+vaj7zLv//D/192WFFVA0RgHawIcHqLX9xuWiQt7P0PtdFEVaxgF9rjM/IRYHQXNnk61/H/gb2Ei+kUQ4xQ==} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3599ebbb3..b7344b904 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -4,7 +4,6 @@ packages: - examples/e2e/* - examples/bugs/* - examples/overrides/* - - "!examples/common" - benchmarking catalog: