Unverified Commit 66b6a80c authored by Will Binns-Smith's avatar Will Binns-Smith Committed by GitHub

Introduce `next analyze`: a built-in bundle analyzer for Turbopack (#85915)

This implements `next experimental-analyze`, which generates bundle analyzer data without without writing chunks or other artifacts to disk. It also optionally serves the bundle analyzer so it can be browsed easily.

Examples:

`next experimental-analyze` - writes analyzer data and UI to `.next/diagnostics/analyze`
`next experimental-analyze --serve` - writes analyzer data and UI as well as serves the files on a static file server on localhost (by default on port 4000)
`next experimental-analyze --serve --port 4001` -- runs the above on port 4001
parent 9c416ee2
...@@ -925,5 +925,7 @@ ...@@ -925,5 +925,7 @@
"924": "Invalid interception route: %s", "924": "Invalid interception route: %s",
"925": "You cannot define a route with the same specificity as an optional catch-all route (\"%s\" and \"/[[...%s]]\").", "925": "You cannot define a route with the same specificity as an optional catch-all route (\"%s\" and \"/[[...%s]]\").",
"926": "Optional route parameters are not yet supported (\"[%s]\") in route \"%s\".", "926": "Optional route parameters are not yet supported (\"[%s]\") in route \"%s\".",
"927": "No debug targets found" "927": "No debug targets found",
"928": "Unable to get server address",
"929": "No pages or app directory found."
} }
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
"@types/react-is": "18.2.4", "@types/react-is": "18.2.4",
"@types/semver": "7.3.1", "@types/semver": "7.3.1",
"@types/send": "0.14.4", "@types/send": "0.14.4",
"@types/serve-handler": "6.1.4",
"@types/shell-quote": "1.7.1", "@types/shell-quote": "1.7.1",
"@types/tar": "6.1.5", "@types/tar": "6.1.5",
"@types/text-table": "0.2.1", "@types/text-table": "0.2.1",
...@@ -315,6 +316,7 @@ ...@@ -315,6 +316,7 @@
"schema-utils3": "npm:schema-utils@3.0.0", "schema-utils3": "npm:schema-utils@3.0.0",
"semver": "7.3.2", "semver": "7.3.2",
"send": "0.18.0", "send": "0.18.0",
"serve-handler": "6.1.6",
"server-only": "0.0.1", "server-only": "0.0.1",
"setimmediate": "1.0.5", "setimmediate": "1.0.5",
"shell-quote": "1.7.3", "shell-quote": "1.7.3",
......
...@@ -27,6 +27,7 @@ import type { NextTelemetryOptions } from '../cli/next-telemetry.js' ...@@ -27,6 +27,7 @@ import type { NextTelemetryOptions } from '../cli/next-telemetry.js'
import type { NextStartOptions } from '../cli/next-start.js' import type { NextStartOptions } from '../cli/next-start.js'
import type { NextInfoOptions } from '../cli/next-info.js' import type { NextInfoOptions } from '../cli/next-info.js'
import type { NextDevOptions } from '../cli/next-dev.js' import type { NextDevOptions } from '../cli/next-dev.js'
import type { NextAnalyzeOptions } from '../cli/next-analyze.js'
import type { NextBuildOptions } from '../cli/next-build.js' import type { NextBuildOptions } from '../cli/next-build.js'
import type { NextTypegenOptions } from '../cli/next-typegen.js' import type { NextTypegenOptions } from '../cli/next-typegen.js'
...@@ -198,6 +199,42 @@ program ...@@ -198,6 +199,42 @@ program
}) })
.usage('[directory] [options]') .usage('[directory] [options]')
program
.command('experimental-analyze')
.description(
'Analyze bundle output. Does not produce build artifacts. Only compatible with Turbopack.'
)
.argument(
'[directory]',
`A directory on which to analyze the application. ${italic(
'If no directory is provided, the current directory will be used.'
)}`
)
.option('--no-mangling', 'Disables mangling.')
.option('--profile', 'Enables production profiling for React.')
.option('--serve', 'Serve the bundle analyzer in a browser after analysis.')
.addOption(
new Option(
'--port <port>',
'Specify a port number to serve the analyzer on.'
)
.implies({ serve: true })
.argParser(parseValidPositiveInteger)
.default(4000)
.env('PORT')
)
.action((directory: string, options: NextAnalyzeOptions) => {
return import('../cli/next-analyze.js')
.then((mod) => mod.nextAnalyze(options, directory))
.then(() => {
if (!options.serve) {
// The Next.js process is held open by something on the event loop. Exit manually like the `build` command does.
// TODO: Fix the underlying issue so this is not necessary.
process.exit(0)
}
})
})
program program
.command('dev', { isDefault: true }) .command('dev', { isDefault: true })
.description( .description(
......
import type { NextConfigComplete } from '../../server/config-shared'
import type { __ApiPreviewProps } from '../../server/api-utils'
import { setGlobal } from '../../trace'
import * as Log from '../output/log'
import * as path from 'node:path'
import loadConfig from '../../server/config'
import { PHASE_ANALYZE } from '../../shared/lib/constants'
import { turbopackAnalyze, type AnalyzeContext } from '../turbopack-analyze'
import { durationToString } from '../duration-to-string'
import { cp, writeFile, mkdir } from 'node:fs/promises'
import {
collectAppFiles,
collectPagesFiles,
createPagesMapping,
} from '../entries'
import { createValidFileMatcher } from '../../server/lib/find-page-file'
import { findPagesDir } from '../../lib/find-pages-dir'
import { PAGE_TYPES } from '../../lib/page-types'
import loadCustomRoutes from '../../lib/load-custom-routes'
import { generateRoutesManifest } from '../generate-routes-manifest'
import { checkIsAppPPREnabled } from '../../server/lib/experimental/ppr'
import { normalizeAppPath } from '../../shared/lib/router/utils/app-paths'
import http from 'node:http'
// @ts-expect-error types are in @types/serve-handler
import serveHandler from 'next/dist/compiled/serve-handler'
import { Telemetry } from '../../telemetry/storage'
import { eventAnalyzeCompleted } from '../../telemetry/events'
import { traceGlobals } from '../../trace/shared'
import type { RoutesManifest } from '..'
const ANALYZE_PATH = '.next/diagnostics/analyze'
export type AnalyzeOptions = {
dir: string
reactProductionProfiling?: boolean
noMangling?: boolean
appDirOnly?: boolean
serve?: boolean
port?: number
}
export default async function analyze({
dir,
reactProductionProfiling = false,
noMangling = false,
appDirOnly = false,
serve = false,
port = 4000,
}: AnalyzeOptions): Promise<void> {
try {
const config: NextConfigComplete = await loadConfig(PHASE_ANALYZE, dir, {
silent: false,
reactProductionProfiling,
})
process.env.NEXT_DEPLOYMENT_ID = config.deploymentId || ''
const distDir = path.join(dir, '.next')
const telemetry = new Telemetry({ distDir })
setGlobal('phase', PHASE_ANALYZE)
setGlobal('distDir', distDir)
setGlobal('telemetry', telemetry)
Log.info('Analyzing a production build...')
const analyzeContext: AnalyzeContext = {
config,
dir,
distDir,
noMangling,
appDirOnly,
}
const { duration: analyzeDuration, shutdownPromise } =
await turbopackAnalyze(analyzeContext)
const durationString = durationToString(analyzeDuration)
Log.event(
`Analyze data created successfully in ${durationString}. To explore it, run \`next experimental-analyze --serve\`.`
)
await shutdownPromise
await cp(
path.join(__dirname, '../../bundle-analyzer'),
path.join(dir, ANALYZE_PATH),
{ recursive: true }
)
// Collect and write routes for the bundle analyzer
const routes = await collectRoutesForAnalyze(dir, config, appDirOnly)
await mkdir(path.join(dir, ANALYZE_PATH, 'data'), { recursive: true })
await writeFile(
path.join(dir, ANALYZE_PATH, 'data', 'routes.json'),
JSON.stringify(routes, null, 2)
)
telemetry.record(
eventAnalyzeCompleted({
success: true,
durationInSeconds: Math.round(analyzeDuration),
totalPageCount: routes.length,
})
)
if (serve) {
await startServer(path.join(dir, ANALYZE_PATH), port)
}
} catch (e) {
const telemetry = traceGlobals.get('telemetry') as Telemetry | undefined
if (telemetry) {
telemetry.record(
eventAnalyzeCompleted({
success: false,
})
)
}
throw e
}
}
/**
* Collects all routes from the project for the bundle analyzer.
* Returns a list of route paths (both static and dynamic).
*/
async function collectRoutesForAnalyze(
dir: string,
config: NextConfigComplete,
appDirOnly: boolean
): Promise<string[]> {
const { pagesDir, appDir } = findPagesDir(dir)
const validFileMatcher = createValidFileMatcher(config.pageExtensions, appDir)
let appType: RoutesManifest['appType']
if (pagesDir && appDir) {
appType = 'hybrid'
} else if (pagesDir) {
appType = 'pages'
} else if (appDir) {
appType = 'app'
} else {
throw new Error('No pages or app directory found.')
}
const { appPaths } = appDir
? await collectAppFiles(appDir, validFileMatcher)
: { appPaths: [] }
const pagesPaths = pagesDir
? await collectPagesFiles(pagesDir, validFileMatcher)
: null
const appMapping = await createPagesMapping({
pagePaths: appPaths,
isDev: false,
pagesType: PAGE_TYPES.APP,
pageExtensions: config.pageExtensions,
pagesDir,
appDir,
appDirOnly,
})
const pagesMapping = pagesPaths
? await createPagesMapping({
pagePaths: pagesPaths,
isDev: false,
pagesType: PAGE_TYPES.PAGES,
pageExtensions: config.pageExtensions,
pagesDir,
appDir,
appDirOnly,
})
: null
const pageKeys = {
pages: pagesMapping ? Object.keys(pagesMapping) : [],
app: appMapping
? Object.keys(appMapping).map((key) => normalizeAppPath(key))
: undefined,
}
// Load custom routes
const { redirects, headers, rewrites } = await loadCustomRoutes(config)
// Compute restricted redirect paths
const restrictedRedirectPaths = ['/_next'].map((pathPrefix) =>
config.basePath ? `${config.basePath}${pathPrefix}` : pathPrefix
)
const isAppPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)
// Generate routes manifest
const { routesManifest } = generateRoutesManifest({
appType,
pageKeys,
config,
redirects,
headers,
rewrites,
restrictedRedirectPaths,
isAppPPREnabled,
})
return routesManifest.dynamicRoutes
.map((r) => r.page)
.concat(routesManifest.staticRoutes.map((r) => r.page))
}
function startServer(dir: string, port: number): Promise<void> {
const server = http.createServer((req, res) => {
return serveHandler(req, res, {
public: dir,
})
})
return new Promise((resolve, reject) => {
function onError(err: Error) {
server.close(() => {
reject(err)
})
}
server.on('error', onError)
server.listen(port, 'localhost', () => {
const address = server.address()
if (address == null) {
reject(new Error('Unable to get server address'))
return
}
// No longer needed after startup
server.removeListener('error', onError)
let addressString
if (typeof address === 'string') {
addressString = address
} else {
addressString = `${address.address === '::' ? 'localhost' : address.address}:${address.port}`
}
Log.info(`Bundle analyzer available at http://${addressString}`)
resolve()
})
})
}
import type { NextConfigComplete } from '../server/config-shared'
import type { CustomRoutes } from '../lib/load-custom-routes'
import {
RSC_HEADER,
NEXT_ROUTER_STATE_TREE_HEADER,
NEXT_ROUTER_PREFETCH_HEADER,
NEXT_DID_POSTPONE_HEADER,
RSC_CONTENT_TYPE_HEADER,
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
NEXT_REWRITTEN_PATH_HEADER,
NEXT_REWRITTEN_QUERY_HEADER,
} from '../client/components/app-router-headers'
import {
RSC_SUFFIX,
RSC_PREFETCH_SUFFIX,
RSC_SEGMENT_SUFFIX,
RSC_SEGMENTS_DIR_SUFFIX,
NEXT_RESUME_HEADER,
} from '../lib/constants'
import { isDynamicRoute } from '../shared/lib/router/utils'
import { buildCustomRoute } from '../lib/build-custom-route'
import { isReservedPage, pageToRoute } from './utils'
import type { DynamicManifestRoute } from './utils'
import type { RoutesManifest, ManifestRoute } from './index'
import { sortPages } from '../shared/lib/router/utils/sortable-routes'
export interface GenerateRoutesManifestOptions {
pageKeys: {
pages: string[]
app?: string[]
}
config: NextConfigComplete
redirects: CustomRoutes['redirects']
headers: CustomRoutes['headers']
rewrites: CustomRoutes['rewrites']
restrictedRedirectPaths: string[]
isAppPPREnabled: boolean
appType: 'pages' | 'app' | 'hybrid'
}
export interface GenerateRoutesManifestResult {
routesManifest: RoutesManifest
dynamicRoutes: Array<DynamicManifestRoute>
sourcePages: Map<string, string>
}
/**
* Generates the routes manifest from the given page keys and configuration.
* This function extracts the route manifest generation logic to be reusable
* across different build contexts (webpack build, turbopack build, analyze, etc.)
*/
export function generateRoutesManifest(
options: GenerateRoutesManifestOptions
): GenerateRoutesManifestResult {
const {
pageKeys,
config,
redirects,
headers,
rewrites,
restrictedRedirectPaths,
isAppPPREnabled,
appType,
} = options
const sortedRoutes = sortPages([...pageKeys.pages, ...(pageKeys.app ?? [])])
const staticRoutes: Array<ManifestRoute> = []
const dynamicRoutes: Array<DynamicManifestRoute> = []
/**
* A map of all the pages to their sourcePage value. This is only used for
* routes that have PPR enabled and clientSegmentEnabled is true.
*/
const sourcePages = new Map<string, string>()
for (const route of sortedRoutes) {
if (isDynamicRoute(route)) {
dynamicRoutes.push(
pageToRoute(
route,
// This property is only relevant when PPR is enabled.
undefined
)
)
} else if (
!isReservedPage(route) ||
// don't consider /api reserved here
route.match(/^\/(api(\/|$))/)
) {
staticRoutes.push(pageToRoute(route))
}
}
const routesManifest: RoutesManifest = {
version: 3,
pages404: true,
appType,
caseSensitive: !!config.experimental.caseSensitiveRoutes,
basePath: config.basePath,
redirects: redirects.map((r) =>
buildCustomRoute('redirect', r, restrictedRedirectPaths)
),
headers: headers.map((r) => buildCustomRoute('header', r)),
rewrites: {
beforeFiles: rewrites.beforeFiles.map((r) =>
buildCustomRoute('rewrite', r)
),
afterFiles: rewrites.afterFiles.map((r) =>
buildCustomRoute('rewrite', r)
),
fallback: rewrites.fallback.map((r) => buildCustomRoute('rewrite', r)),
},
dynamicRoutes,
staticRoutes,
dataRoutes: [],
i18n: config.i18n || undefined,
rsc: {
header: RSC_HEADER,
// This vary header is used as a default. It is technically re-assigned in `base-server`,
// and may include an additional Vary option for `Next-URL`.
varyHeader: `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE_HEADER}, ${NEXT_ROUTER_PREFETCH_HEADER}, ${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`,
prefetchHeader: NEXT_ROUTER_PREFETCH_HEADER,
didPostponeHeader: NEXT_DID_POSTPONE_HEADER,
contentTypeHeader: RSC_CONTENT_TYPE_HEADER,
suffix: RSC_SUFFIX,
prefetchSuffix: RSC_PREFETCH_SUFFIX,
prefetchSegmentHeader: NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
prefetchSegmentSuffix: RSC_SEGMENT_SUFFIX,
prefetchSegmentDirSuffix: RSC_SEGMENTS_DIR_SUFFIX,
clientParamParsing: config.cacheComponents ?? false,
clientParamParsingOrigins: config.experimental.clientParamParsingOrigins,
dynamicRSCPrerender: isAppPPREnabled && config.cacheComponents === true,
},
rewriteHeaders: {
pathHeader: NEXT_REWRITTEN_PATH_HEADER,
queryHeader: NEXT_REWRITTEN_QUERY_HEADER,
},
skipProxyUrlNormalize: config.skipProxyUrlNormalize,
ppr: isAppPPREnabled
? {
chain: {
headers: {
[NEXT_RESUME_HEADER]: '1',
},
},
}
: undefined,
}
return {
routesManifest,
dynamicRoutes,
sourcePages,
}
}
...@@ -26,14 +26,13 @@ import { ...@@ -26,14 +26,13 @@ import {
INSTRUMENTATION_HOOK_FILENAME, INSTRUMENTATION_HOOK_FILENAME,
RSC_PREFETCH_SUFFIX, RSC_PREFETCH_SUFFIX,
RSC_SUFFIX, RSC_SUFFIX,
NEXT_RESUME_HEADER,
PRERENDER_REVALIDATE_HEADER, PRERENDER_REVALIDATE_HEADER,
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER, PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER,
NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER, NEXT_CACHE_REVALIDATE_TAG_TOKEN_HEADER,
NEXT_CACHE_REVALIDATED_TAGS_HEADER, NEXT_CACHE_REVALIDATED_TAGS_HEADER,
MATCHED_PATH_HEADER, MATCHED_PATH_HEADER,
RSC_SEGMENTS_DIR_SUFFIX, type RSC_SEGMENTS_DIR_SUFFIX,
RSC_SEGMENT_SUFFIX, type RSC_SEGMENT_SUFFIX,
} from '../lib/constants' } from '../lib/constants'
import { FileType, fileExists } from '../lib/file-exists' import { FileType, fileExists } from '../lib/file-exists'
import { findPagesDir } from '../lib/find-pages-dir' import { findPagesDir } from '../lib/find-pages-dir'
...@@ -140,8 +139,9 @@ import { ...@@ -140,8 +139,9 @@ import {
collectRoutesUsingEdgeRuntime, collectRoutesUsingEdgeRuntime,
collectMeta, collectMeta,
isProxyFile, isProxyFile,
pageToRoute,
} from './utils' } from './utils'
import type { PageInfo, PageInfos } from './utils' import type { DynamicManifestRoute, PageInfo, PageInfos } from './utils'
import type { FallbackRouteParam, PrerenderedRoute } from './static-paths/types' import type { FallbackRouteParam, PrerenderedRoute } from './static-paths/types'
import type { AppSegmentConfig } from './segment-config/app/app-segment-config' import type { AppSegmentConfig } from './segment-config/app/app-segment-config'
import { writeBuildId } from './write-build-id' import { writeBuildId } from './write-build-id'
...@@ -158,14 +158,13 @@ import { eventSwcPlugins } from '../telemetry/events/swc-plugins' ...@@ -158,14 +158,13 @@ import { eventSwcPlugins } from '../telemetry/events/swc-plugins'
import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' import { normalizeAppPath } from '../shared/lib/router/utils/app-paths'
import { import {
ACTION_HEADER, ACTION_HEADER,
NEXT_ROUTER_PREFETCH_HEADER, type NEXT_ROUTER_PREFETCH_HEADER,
RSC_HEADER, type RSC_HEADER,
RSC_CONTENT_TYPE_HEADER, type RSC_CONTENT_TYPE_HEADER,
NEXT_ROUTER_STATE_TREE_HEADER, type NEXT_DID_POSTPONE_HEADER,
NEXT_DID_POSTPONE_HEADER, type NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
NEXT_ROUTER_SEGMENT_PREFETCH_HEADER, type NEXT_REWRITTEN_PATH_HEADER,
NEXT_REWRITTEN_PATH_HEADER, type NEXT_REWRITTEN_QUERY_HEADER,
NEXT_REWRITTEN_QUERY_HEADER,
} from '../client/components/app-router-headers' } from '../client/components/app-router-headers'
import { webpackBuild } from './webpack-build' import { webpackBuild } from './webpack-build'
import { NextBuildContext, type MappedPages } from './build-context' import { NextBuildContext, type MappedPages } from './build-context'
...@@ -188,7 +187,6 @@ import { ...@@ -188,7 +187,6 @@ import {
import { getStartServerInfo, logStartInfo } from '../server/lib/app-info-log' import { getStartServerInfo, logStartInfo } from '../server/lib/app-info-log'
import type { NextEnabledDirectories } from '../server/base-server' import type { NextEnabledDirectories } from '../server/base-server'
import { hasCustomExportOutput } from '../export/utils' import { hasCustomExportOutput } from '../export/utils'
import { buildCustomRoute } from '../lib/build-custom-route'
import { traceMemoryUsage } from '../lib/memory/trace' import { traceMemoryUsage } from '../lib/memory/trace'
import { generateEncryptionKeyBase64 } from '../server/app-render/encryption-utils-server' import { generateEncryptionKeyBase64 } from '../server/app-render/encryption-utils-server'
import type { DeepReadonly } from '../shared/lib/deep-readonly' import type { DeepReadonly } from '../shared/lib/deep-readonly'
...@@ -231,6 +229,7 @@ import { ...@@ -231,6 +229,7 @@ import {
} from '../server/lib/router-utils/route-types-utils' } from '../server/lib/router-utils/route-types-utils'
import { Lockfile } from './lockfile' import { Lockfile } from './lockfile'
import { validateAppPaths } from './validate-app-paths' import { validateAppPaths } from './validate-app-paths'
import { generateRoutesManifest } from './generate-routes-manifest'
type Fallback = null | boolean | string type Fallback = null | boolean | string
...@@ -417,15 +416,6 @@ export type ManifestRoute = ManifestBuiltRoute & { ...@@ -417,15 +416,6 @@ export type ManifestRoute = ManifestBuiltRoute & {
skipInternalRouting?: boolean skipInternalRouting?: boolean
} }
type DynamicManifestRoute = ManifestRoute & {
/**
* The source page that this route is based on. This is used to determine the
* source page for the route and is only relevant for app pages where PPR is
* enabled and the page differs from the source page.
*/
sourcePage: string | undefined
}
type ManifestDataRoute = { type ManifestDataRoute = {
page: string page: string
routeKeys?: { [key: string]: string } routeKeys?: { [key: string]: string }
...@@ -508,42 +498,6 @@ export type RoutesManifest = { ...@@ -508,42 +498,6 @@ export type RoutesManifest = {
} }
} }
/**
* Converts a page to a manifest route.
*
* @param page The page to convert to a route.
* @returns A route object.
*/
function pageToRoute(page: string): ManifestRoute
/**
* Converts a page to a dynamic manifest route.
*
* @param page The page to convert to a route.
* @param sourcePage The source page that this route is based on. This is used
* to determine the source page for the route and is only relevant for app
* pages when PPR is enabled on them.
* @returns A route object.
*/
function pageToRoute(
page: string,
sourcePage: string | undefined
): DynamicManifestRoute
function pageToRoute(
page: string,
sourcePage?: string
): DynamicManifestRoute | ManifestRoute {
const routeRegex = getNamedRouteRegex(page, {
prefixRouteKeys: true,
})
return {
sourcePage,
page,
regex: normalizeRouteRegex(routeRegex.re.source),
routeKeys: routeRegex.routeKeys,
namedRegex: routeRegex.namedRegex,
}
}
function getCacheDir(distDir: string): string { function getCacheDir(distDir: string): string {
const cacheDir = path.join(distDir, 'cache') const cacheDir = path.join(distDir, 'cache')
if (ciEnvironment.isCI && !ciEnvironment.hasNextSupport) { if (ciEnvironment.isCI && !ciEnvironment.hasNextSupport) {
...@@ -1605,100 +1559,22 @@ export default async function build( ...@@ -1605,100 +1559,22 @@ export default async function build(
const isAppPPREnabled = checkIsAppPPREnabled(config.experimental.ppr) const isAppPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)
const routesManifestPath = path.join(distDir, ROUTES_MANIFEST) const routesManifestPath = path.join(distDir, ROUTES_MANIFEST)
const dynamicRoutes: Array<DynamicManifestRoute> = []
/** // Generate the routes manifest using the extracted helper
* A map of all the pages to their sourcePage value. This is only used for const { routesManifest, dynamicRoutes, sourcePages } = nextBuildSpan
* routes that have PPR enabled and clientSegmentEnabled is true.
*/
const sourcePages = new Map<string, string>()
const routesManifest: RoutesManifest = nextBuildSpan
.traceChild('generate-routes-manifest') .traceChild('generate-routes-manifest')
.traceFn(() => { .traceFn(() =>
const sortedRoutes = sortPages([ generateRoutesManifest({
...pageKeys.pages,
...(pageKeys.app ?? []),
])
const staticRoutes: Array<ManifestRoute> = []
for (const route of sortedRoutes) {
if (isDynamicRoute(route)) {
dynamicRoutes.push(
pageToRoute(
route,
// This property is only relevant when PPR is enabled.
undefined
)
)
} else if (
!isReservedPage(route) ||
// don't consider /api reserved here
route.match(/^\/(api(\/|$))/)
) {
staticRoutes.push(pageToRoute(route))
}
}
return {
version: 3,
pages404: true,
appType, appType,
caseSensitive: !!config.experimental.caseSensitiveRoutes, pageKeys,
basePath: config.basePath, config,
redirects: redirects.map((r) => redirects,
buildCustomRoute('redirect', r, restrictedRedirectPaths) headers,
), rewrites,
headers: headers.map((r) => buildCustomRoute('header', r)), restrictedRedirectPaths,
rewrites: { isAppPPREnabled,
beforeFiles: rewrites.beforeFiles.map((r) => })
buildCustomRoute('rewrite', r) )
),
afterFiles: rewrites.afterFiles.map((r) =>
buildCustomRoute('rewrite', r)
),
fallback: rewrites.fallback.map((r) =>
buildCustomRoute('rewrite', r)
),
},
dynamicRoutes,
staticRoutes,
dataRoutes: [],
i18n: config.i18n || undefined,
rsc: {
header: RSC_HEADER,
// This vary header is used as a default. It is technically re-assigned in `base-server`,
// and may include an additional Vary option for `Next-URL`.
varyHeader: `${RSC_HEADER}, ${NEXT_ROUTER_STATE_TREE_HEADER}, ${NEXT_ROUTER_PREFETCH_HEADER}, ${NEXT_ROUTER_SEGMENT_PREFETCH_HEADER}`,
prefetchHeader: NEXT_ROUTER_PREFETCH_HEADER,
didPostponeHeader: NEXT_DID_POSTPONE_HEADER,
contentTypeHeader: RSC_CONTENT_TYPE_HEADER,
suffix: RSC_SUFFIX,
prefetchSuffix: RSC_PREFETCH_SUFFIX,
prefetchSegmentHeader: NEXT_ROUTER_SEGMENT_PREFETCH_HEADER,
prefetchSegmentSuffix: RSC_SEGMENT_SUFFIX,
prefetchSegmentDirSuffix: RSC_SEGMENTS_DIR_SUFFIX,
clientParamParsing: config.cacheComponents ?? false,
clientParamParsingOrigins:
config.experimental.clientParamParsingOrigins,
dynamicRSCPrerender:
isAppPPREnabled && config.cacheComponents === true,
},
rewriteHeaders: {
pathHeader: NEXT_REWRITTEN_PATH_HEADER,
queryHeader: NEXT_REWRITTEN_QUERY_HEADER,
},
skipProxyUrlNormalize: config.skipProxyUrlNormalize,
ppr: isAppPPREnabled
? {
chain: {
headers: {
[NEXT_RESUME_HEADER]: '1',
},
},
}
: undefined,
} satisfies RoutesManifest
})
// For pages directory, we run type checking after route collection but before build. // For pages directory, we run type checking after route collection but before build.
if (!appDir && !isCompileMode) { if (!appDir && !isCompileMode) {
......
import path from 'path'
import { validateTurboNextConfig } from '../../lib/turbopack-warning'
import { isFileSystemCacheEnabledForBuild } from '../../shared/lib/turbopack/utils'
import { createDefineEnv, loadBindings } from '../swc'
import { isCI } from '../../server/ci-info'
import { backgroundLogCompilationEvents } from '../../shared/lib/turbopack/compilation-events'
import { getSupportedBrowsers } from '../utils'
import { normalizePath } from '../../lib/normalize-path'
import type { NextConfigComplete } from '../../server/config-shared'
import type { __ApiPreviewProps } from '../../server/api-utils'
export type AnalyzeContext = {
config: NextConfigComplete
distDir: string
dir: string
noMangling: boolean
appDirOnly: boolean
}
export async function turbopackAnalyze(
analyzeContext: AnalyzeContext
): Promise<{
duration: number
shutdownPromise: Promise<void>
}> {
await validateTurboNextConfig({
dir: analyzeContext.dir,
isDev: false,
})
const { config, dir, distDir, noMangling } = analyzeContext
const currentNodeJsVersion = process.versions.node
const startTime = process.hrtime()
const bindings = await loadBindings(config?.experimental?.useWasmBinary)
const dev = false
const supportedBrowsers = getSupportedBrowsers(dir, dev)
const persistentCaching = isFileSystemCacheEnabledForBuild(config)
const rootPath = config.turbopack?.root || config.outputFileTracingRoot || dir
const project = await bindings.turbo.createProject(
{
rootPath: config.turbopack?.root || config.outputFileTracingRoot || dir,
projectPath: normalizePath(path.relative(rootPath, dir) || '.'),
distDir,
nextConfig: config,
watch: {
enable: false,
},
dev,
env: process.env as Record<string, string>,
defineEnv: createDefineEnv({
isTurbopack: true,
config,
dev,
distDir,
projectPath: dir,
fetchCacheKeyPrefix: config.experimental.fetchCacheKeyPrefix,
hasRewrites: false,
// Implemented separately in Turbopack, doesn't have to be passed here.
middlewareMatchers: undefined,
rewrites: {
beforeFiles: [],
afterFiles: [],
fallback: [],
},
}),
buildId: 'analyze-build',
encryptionKey: '',
previewProps: {
previewModeId: '',
previewModeEncryptionKey: '',
previewModeSigningKey: '',
},
browserslistQuery: supportedBrowsers.join(', '),
noMangling,
currentNodeJsVersion,
},
{
persistentCaching,
memoryLimit: config.experimental?.turbopackMemoryLimit,
dependencyTracking: persistentCaching,
isCi: isCI,
isShortSession: true,
}
)
try {
backgroundLogCompilationEvents(project)
await project.writeAnalyzeData(analyzeContext.appDirOnly)
const shutdownPromise = project.shutdown()
const time = process.hrtime(startTime)
return {
duration: time[0] + time[1] / 1e9,
shutdownPromise,
}
} catch (err) {
await project.shutdown()
throw err
}
}
let shutdownPromise: Promise<void> | undefined
export async function waitForShutdown(): Promise<void> {
if (shutdownPromise) {
await shutdownPromise
}
}
...@@ -4,11 +4,12 @@ import { checkIsRoutePPREnabled } from '../server/lib/experimental/ppr' ...@@ -4,11 +4,12 @@ import { checkIsRoutePPREnabled } from '../server/lib/experimental/ppr'
import type { AssetBinding } from './webpack/loaders/get-module-build-info' import type { AssetBinding } from './webpack/loaders/get-module-build-info'
import type { ServerRuntime } from '../types' import type { ServerRuntime } from '../types'
import type { BuildManifest } from '../server/get-page-files' import type { BuildManifest } from '../server/get-page-files'
import type { import {
CustomRoutes, normalizeRouteRegex,
Header, type CustomRoutes,
Redirect, type Header,
Rewrite, type Redirect,
type Rewrite,
} from '../lib/load-custom-routes' } from '../lib/load-custom-routes'
import type { import type {
EdgeFunctionDefinition, EdgeFunctionDefinition,
...@@ -75,10 +76,20 @@ import { formatExpire, formatRevalidate } from './output/format' ...@@ -75,10 +76,20 @@ import { formatExpire, formatRevalidate } from './output/format'
import type { AppRouteRouteModule } from '../server/route-modules/app-route/module' import type { AppRouteRouteModule } from '../server/route-modules/app-route/module'
import { formatIssue, isRelevantWarning } from '../shared/lib/turbopack/utils' import { formatIssue, isRelevantWarning } from '../shared/lib/turbopack/utils'
import type { TurbopackResult } from './swc/types' import type { TurbopackResult } from './swc/types'
import type { FunctionsConfigManifest } from './index' import type { FunctionsConfigManifest, ManifestRoute } from './index'
import { getNamedRouteRegex } from '../shared/lib/router/utils/route-regex'
export type ROUTER_TYPE = 'pages' | 'app' export type ROUTER_TYPE = 'pages' | 'app'
export type DynamicManifestRoute = ManifestRoute & {
/**
* The source page that this route is based on. This is used to determine the
* source page for the route and is only relevant for app pages where PPR is
* enabled and the page differs from the source page.
*/
sourcePage: string | undefined
}
// Use `print()` for expected console output // Use `print()` for expected console output
const print = console.log const print = console.log
...@@ -1599,3 +1610,39 @@ export function collectMeta({ ...@@ -1599,3 +1610,39 @@ export function collectMeta({
export const RSPACK_DEFAULT_LAYERS_REGEX = new RegExp( export const RSPACK_DEFAULT_LAYERS_REGEX = new RegExp(
`^(|${[WEBPACK_LAYERS.pagesDirBrowser, WEBPACK_LAYERS.pagesDirEdge, WEBPACK_LAYERS.pagesDirNode].join('|')})$` `^(|${[WEBPACK_LAYERS.pagesDirBrowser, WEBPACK_LAYERS.pagesDirEdge, WEBPACK_LAYERS.pagesDirNode].join('|')})$`
) )
/**
* Converts a page to a manifest route.
*
* @param page The page to convert to a route.
* @returns A route object.
*/
export function pageToRoute(page: string): ManifestRoute
/**
* Converts a page to a dynamic manifest route.
*
* @param page The page to convert to a route.
* @param sourcePage The source page that this route is based on. This is used
* to determine the source page for the route and is only relevant for app
* pages when PPR is enabled on them.
* @returns A route object.
*/
export function pageToRoute(
page: string,
sourcePage: string | undefined
): DynamicManifestRoute
export function pageToRoute(
page: string,
sourcePage?: string
): DynamicManifestRoute | ManifestRoute {
const routeRegex = getNamedRouteRegex(page, {
prefixRouteKeys: true,
})
return {
sourcePage,
page,
regex: normalizeRouteRegex(routeRegex.re.source),
routeKeys: routeRegex.routeKeys,
namedRegex: routeRegex.namedRegex,
}
}
#!/usr/bin/env node
import '../server/lib/cpu-profile'
import { existsSync } from 'fs'
import { italic } from '../lib/picocolors'
import analyze from '../build/analyze'
import { warn } from '../build/output/log'
import { printAndExit } from '../server/lib/utils'
import { getProjectDir } from '../lib/get-project-dir'
export type NextAnalyzeOptions = {
experimentalAnalyze?: boolean
profile?: boolean
mangling: boolean
port: number
serve: boolean
experimentalAppOnly?: boolean
}
const nextAnalyze = async (options: NextAnalyzeOptions, directory?: string) => {
process.on('SIGTERM', () => process.exit(143))
process.on('SIGINT', () => process.exit(130))
const { profile, mangling, experimentalAppOnly, serve, port } = options
if (!mangling) {
warn(
`Mangling is disabled. ${italic('Note: This may affect performance and should only be used for debugging purposes.')}`
)
}
if (profile) {
warn(
`Profiling is enabled. ${italic('Note: This may affect performance.')}`
)
}
const dir = getProjectDir(directory)
if (!existsSync(dir)) {
printAndExit(`> No such directory exists as the project root: ${dir}`)
}
return analyze({
dir,
reactProductionProfiling: profile,
noMangling: !mangling,
appDirOnly: experimentalAppOnly,
serve,
port,
})
}
export { nextAnalyze }
MIT License
Copyright (c) 2018 ZEIT, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"name":"serve-handler","main":"index.js","author":"leo","license":"MIT"}
...@@ -68,6 +68,7 @@ export enum AdapterOutputType { ...@@ -68,6 +68,7 @@ export enum AdapterOutputType {
} }
export const PHASE_EXPORT = 'phase-export' export const PHASE_EXPORT = 'phase-export'
export const PHASE_ANALYZE = 'phase-analyze'
export const PHASE_PRODUCTION_BUILD = 'phase-production-build' export const PHASE_PRODUCTION_BUILD = 'phase-production-build'
export const PHASE_PRODUCTION_SERVER = 'phase-production-server' export const PHASE_PRODUCTION_SERVER = 'phase-production-server'
export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server' export const PHASE_DEVELOPMENT_SERVER = 'phase-development-server'
...@@ -78,6 +79,7 @@ export type PHASE_TYPE = ...@@ -78,6 +79,7 @@ export type PHASE_TYPE =
| typeof PHASE_INFO | typeof PHASE_INFO
| typeof PHASE_TEST | typeof PHASE_TEST
| typeof PHASE_EXPORT | typeof PHASE_EXPORT
| typeof PHASE_ANALYZE
| typeof PHASE_PRODUCTION_BUILD | typeof PHASE_PRODUCTION_BUILD
| typeof PHASE_PRODUCTION_SERVER | typeof PHASE_PRODUCTION_SERVER
| typeof PHASE_DEVELOPMENT_SERVER | typeof PHASE_DEVELOPMENT_SERVER
......
...@@ -52,6 +52,27 @@ export function eventLintCheckCompleted(event: EventLintCheckCompleted): { ...@@ -52,6 +52,27 @@ export function eventLintCheckCompleted(event: EventLintCheckCompleted): {
} }
} }
const EVENT_ANALYZE_COMPLETED = 'NEXT_ANALYZE_COMPLETED'
type AnalyzeEventCompleted =
| {
durationInSeconds: number
success: true
totalPageCount: number
}
| {
success: false
}
export function eventAnalyzeCompleted(event: AnalyzeEventCompleted): {
eventName: string
payload: AnalyzeEventCompleted
} {
return {
eventName: EVENT_ANALYZE_COMPLETED,
payload: event,
}
}
const EVENT_BUILD_COMPLETED = 'NEXT_BUILD_COMPLETED' const EVENT_BUILD_COMPLETED = 'NEXT_BUILD_COMPLETED'
type EventBuildCompleted = { type EventBuildCompleted = {
bundler: 'webpack' | 'rspack' | 'turbopack' bundler: 'webpack' | 'rspack' | 'turbopack'
......
...@@ -1869,6 +1869,13 @@ export async function ncc_source_map08(task, opts) { ...@@ -1869,6 +1869,13 @@ export async function ncc_source_map08(task, opts) {
}) })
.target('src/compiled/source-map08') .target('src/compiled/source-map08')
} }
externals['serve-handler'] = 'next/dist/compiled/serve-handler'
export async function ncc_serve_handler(task, opts) {
await task
.source(relative(__dirname, require.resolve('serve-handler')))
.ncc({ packageName: 'serve-handler', externals })
.target('src/compiled/serve-handler')
}
externals['string-hash'] = 'next/dist/compiled/string-hash' externals['string-hash'] = 'next/dist/compiled/string-hash'
export async function ncc_string_hash(task, opts) { export async function ncc_string_hash(task, opts) {
await task await task
...@@ -2286,6 +2293,7 @@ export async function ncc(task, opts) { ...@@ -2286,6 +2293,7 @@ export async function ncc(task, opts) {
'ncc_send', 'ncc_send',
'ncc_source_map', 'ncc_source_map',
'ncc_source_map08', 'ncc_source_map08',
'ncc_serve_handler',
'ncc_string_hash', 'ncc_string_hash',
'ncc_strip_ansi', 'ncc_strip_ansi',
'ncc_superstruct', 'ncc_superstruct',
......
...@@ -742,7 +742,7 @@ importers: ...@@ -742,7 +742,7 @@ importers:
version: 9.37.0(jiti@2.5.1) version: 9.37.0(jiti@2.5.1)
eslint-config-next: eslint-config-next:
specifier: canary specifier: canary
version: 16.0.2-canary.6(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2) version: 16.0.2-canary.9(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2)
tailwindcss: tailwindcss:
specifier: 4.1.13 specifier: 4.1.13
version: 4.1.13 version: 4.1.13
...@@ -1341,6 +1341,9 @@ importers: ...@@ -1341,6 +1341,9 @@ importers:
'@types/send': '@types/send':
specifier: 0.14.4 specifier: 0.14.4
version: 0.14.4 version: 0.14.4
'@types/serve-handler':
specifier: 6.1.4
version: 6.1.4
'@types/shell-quote': '@types/shell-quote':
specifier: 1.7.1 specifier: 1.7.1
version: 1.7.1 version: 1.7.1
...@@ -1656,6 +1659,9 @@ importers: ...@@ -1656,6 +1659,9 @@ importers:
send: send:
specifier: 0.18.0 specifier: 0.18.0
version: 0.18.0 version: 0.18.0
serve-handler:
specifier: 6.1.6
version: 6.1.6
server-only: server-only:
specifier: 0.0.1 specifier: 0.0.1
version: 0.0.1 version: 0.0.1
...@@ -2956,6 +2962,7 @@ packages: ...@@ -2956,6 +2962,7 @@ packages:
'@datadog/native-iast-rewriter@2.0.1': '@datadog/native-iast-rewriter@2.0.1':
resolution: {integrity: sha512-Mm+FG3XxEbPrAfJQPOMHts7iZZXRvg9gnGeeFRGkyirmRcQcOpZO4wFe/8K61DUVa5pXpgAJQ2ZkBGYF1O9STg==} resolution: {integrity: sha512-Mm+FG3XxEbPrAfJQPOMHts7iZZXRvg9gnGeeFRGkyirmRcQcOpZO4wFe/8K61DUVa5pXpgAJQ2ZkBGYF1O9STg==}
engines: {node: '>= 10'} engines: {node: '>= 10'}
deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
'@datadog/native-iast-taint-tracking@1.5.0': '@datadog/native-iast-taint-tracking@1.5.0':
resolution: {integrity: sha512-SOWIk1M6PZH0osNB191Voz2rKBPoF5hISWVSK9GiJPrD40+xjib1Z/bFDV7EkDn3kjOyordSBdNPG5zOqZJdyg==} resolution: {integrity: sha512-SOWIk1M6PZH0osNB191Voz2rKBPoF5hISWVSK9GiJPrD40+xjib1Z/bFDV7EkDn3kjOyordSBdNPG5zOqZJdyg==}
...@@ -4367,8 +4374,8 @@ packages: ...@@ -4367,8 +4374,8 @@ packages:
'@next/env@16.0.1': '@next/env@16.0.1':
resolution: {integrity: sha512-LFvlK0TG2L3fEOX77OC35KowL8D7DlFF45C0OvKMC4hy8c/md1RC4UMNDlUGJqfCoCS2VWrZ4dSE6OjaX5+8mw==} resolution: {integrity: sha512-LFvlK0TG2L3fEOX77OC35KowL8D7DlFF45C0OvKMC4hy8c/md1RC4UMNDlUGJqfCoCS2VWrZ4dSE6OjaX5+8mw==}
'@next/eslint-plugin-next@16.0.2-canary.6': '@next/eslint-plugin-next@16.0.2-canary.9':
resolution: {integrity: sha512-09uFg+CCkoEM6wE6oELax26zgSYWh3xW8bhA94zTGKwqsu9yUPWsNv7konBLcDV7AZlVxQ0w5rxftDsSEWHe0w==} resolution: {integrity: sha512-tD2tHSOf512E9f/+XETez/A1j5cFNs0rCr7eDLjDTAiuxJiH2sQaf8txkIIwsP1z3wMDSOEFy0kyjqEaMVfWyQ==}
'@next/rspack-binding-android-arm-eabi@1.0.1': '@next/rspack-binding-android-arm-eabi@1.0.1':
resolution: {integrity: sha512-ZLEy3shsHk8FpJDeoU4gN3a7eVaOagA7AW2BXSVefBAO4hR6j3Kt/T732FUmf9G5328C2vsbMAWskHRHPbhTig==} resolution: {integrity: sha512-ZLEy3shsHk8FpJDeoU4gN3a7eVaOagA7AW2BXSVefBAO4hR6j3Kt/T732FUmf9G5328C2vsbMAWskHRHPbhTig==}
...@@ -6585,6 +6592,9 @@ packages: ...@@ -6585,6 +6592,9 @@ packages:
'@types/send@0.14.4': '@types/send@0.14.4':
resolution: {integrity: sha512-SCVCRRjSbpwoKgA34wK8cq14OUPu4qrKigO85/ZH6J04NGws37khLtq7YQr17zyOH01p4T5oy8e1TxEzql01Pg==} resolution: {integrity: sha512-SCVCRRjSbpwoKgA34wK8cq14OUPu4qrKigO85/ZH6J04NGws37khLtq7YQr17zyOH01p4T5oy8e1TxEzql01Pg==}
'@types/serve-handler@6.1.4':
resolution: {integrity: sha512-aXy58tNie0NkuSCY291xUxl0X+kGYy986l4kqW6Gi4kEXgr6Tx0fpSH7YwUSa5usPpG3s9DBeIR6hHcDtL2IvQ==}
'@types/serve-index@1.9.4': '@types/serve-index@1.9.4':
resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==} resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==}
...@@ -9675,8 +9685,8 @@ packages: ...@@ -9675,8 +9685,8 @@ packages:
engines: {node: '>=6.0'} engines: {node: '>=6.0'}
hasBin: true hasBin: true
eslint-config-next@16.0.2-canary.6: eslint-config-next@16.0.2-canary.9:
resolution: {integrity: sha512-I0+bDWAkdumL67vpBJn5fBrPlHPtZKDyCPFPi5rUKF7Zr8q5Npt8PpyqSqECaXasO0PY1t6X8ypCjl+MAg4WfA==} resolution: {integrity: sha512-XysPzo1pUNVJJUpEfHDKJwg3zbFVvZetVohFziDHX6A7l6lpyQBwmODEzDIkWGK0x3uSkvtWyqTolbhQDe7wyA==}
peerDependencies: peerDependencies:
eslint: '>=9.0.0' eslint: '>=9.0.0'
typescript: '>=3.3.1' typescript: '>=3.3.1'
...@@ -10061,6 +10071,7 @@ packages: ...@@ -10061,6 +10071,7 @@ packages:
expect-playwright@0.8.0: expect-playwright@0.8.0:
resolution: {integrity: sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==} resolution: {integrity: sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==}
deprecated: ⚠️ The 'expect-playwright' package is deprecated. The Playwright core assertions (via @playwright/test) now cover the same functionality. Please migrate to built-in expect. See https://playwright.dev/docs/test-assertions for migration.
expect-type@0.14.2: expect-type@0.14.2:
resolution: {integrity: sha512-ed3+tr5ujbIYXZ8Pl/VgIphwJQ0q5tBLGGdn7Zvwt1WyPBRX83xjT5pT77P/GkuQbctx0K2ZNSSan7eruJqTCQ==} resolution: {integrity: sha512-ed3+tr5ujbIYXZ8Pl/VgIphwJQ0q5tBLGGdn7Zvwt1WyPBRX83xjT5pT77P/GkuQbctx0K2ZNSSan7eruJqTCQ==}
...@@ -12015,6 +12026,7 @@ packages: ...@@ -12015,6 +12026,7 @@ packages:
jest-playwright-preset@4.0.0: jest-playwright-preset@4.0.0:
resolution: {integrity: sha512-+dGZ1X2KqtwXaabVjTGxy0a3VzYfvYsWaRcuO8vMhyclHSOpGSI1+5cmlqzzCwQ3+fv0EjkTc7I5aV9lo08dYw==} resolution: {integrity: sha512-+dGZ1X2KqtwXaabVjTGxy0a3VzYfvYsWaRcuO8vMhyclHSOpGSI1+5cmlqzzCwQ3+fv0EjkTc7I5aV9lo08dYw==}
deprecated: ⚠️ The 'jest-playwright-preset' package is deprecated. Please migrate to Playwright's built-in test runner (@playwright/test) which now includes full Jest-style features and parallel testing. See https://playwright.dev/docs/intro for details.
peerDependencies: peerDependencies:
jest: ^29.3.1 jest: ^29.3.1
jest-circus: ^29.3.1 jest-circus: ^29.3.1
...@@ -12032,6 +12044,7 @@ packages: ...@@ -12032,6 +12044,7 @@ packages:
jest-process-manager@0.4.0: jest-process-manager@0.4.0:
resolution: {integrity: sha512-80Y6snDyb0p8GG83pDxGI/kQzwVTkCxc7ep5FPe/F6JYdvRDhwr6RzRmPSP7SEwuLhxo80lBS/NqOdUIbHIfhw==} resolution: {integrity: sha512-80Y6snDyb0p8GG83pDxGI/kQzwVTkCxc7ep5FPe/F6JYdvRDhwr6RzRmPSP7SEwuLhxo80lBS/NqOdUIbHIfhw==}
deprecated: ⚠️ The 'jest-process-manager' package is deprecated. Please migrate to Playwright's built-in test runner (@playwright/test) which now includes full Jest-style features and parallel testing. See https://playwright.dev/docs/intro for details.
jest-regex-util@29.4.3: jest-regex-util@29.4.3:
resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==}
...@@ -16972,7 +16985,7 @@ packages: ...@@ -16972,7 +16985,7 @@ packages:
superagent@3.8.3: superagent@3.8.3:
resolution: {integrity: sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==} resolution: {integrity: sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==}
engines: {node: '>= 4.0'} engines: {node: '>= 4.0'}
deprecated: Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net deprecated: Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net
superstruct@1.0.3: superstruct@1.0.3:
resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==} resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==}
...@@ -21528,7 +21541,7 @@ snapshots: ...@@ -21528,7 +21541,7 @@ snapshots:
'@next/env@16.0.1': {} '@next/env@16.0.1': {}
'@next/eslint-plugin-next@16.0.2-canary.6': '@next/eslint-plugin-next@16.0.2-canary.9':
dependencies: dependencies:
fast-glob: 3.3.1 fast-glob: 3.3.1
...@@ -23913,6 +23926,10 @@ snapshots: ...@@ -23913,6 +23926,10 @@ snapshots:
'@types/mime': 2.0.1 '@types/mime': 2.0.1
'@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu) '@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu)
'@types/serve-handler@6.1.4':
dependencies:
'@types/node': 20.17.6(patch_hash=rvl3vkomen3tospgr67bzubfyu)
'@types/serve-index@1.9.4': '@types/serve-index@1.9.4':
dependencies: dependencies:
'@types/express': 4.17.21 '@types/express': 4.17.21
...@@ -27608,9 +27625,9 @@ snapshots: ...@@ -27608,9 +27625,9 @@ snapshots:
optionalDependencies: optionalDependencies:
source-map: 0.6.1 source-map: 0.6.1
eslint-config-next@16.0.2-canary.6(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2): eslint-config-next@16.0.2-canary.9(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2):
dependencies: dependencies:
'@next/eslint-plugin-next': 16.0.2-canary.6 '@next/eslint-plugin-next': 16.0.2-canary.9
eslint: 9.37.0(jiti@2.5.1) eslint: 9.37.0(jiti@2.5.1)
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint-plugin-import@2.32.0(eslint@9.37.0(jiti@2.5.1)))(eslint@9.37.0(jiti@2.5.1)) eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.3.1(eslint@9.37.0(jiti@2.5.1))(typescript@5.9.2))(eslint-plugin-import@2.32.0(eslint@9.37.0(jiti@2.5.1)))(eslint@9.37.0(jiti@2.5.1))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment