由 Sam W. 出售

Next.js is a production-grade React framework supporting App Router, static generation, SSR, API routes, and streaming — with 40+ example integrations covering CMS platforms, authentication, GraphQL, caching, and more.
This block delivers the full Next.js framework source under packages/next, including the client runtime, server logic, build pipeline, CSS processing, font handling, and all public entry points. It targets backend and full-stack engineers who need to fork, extend, or deeply integrate Next.js internals into a custom Node.js/TypeScript project rather than consuming it as a black-box npm package.
.storybook/ - Storybook configuration for visually testing Next.js UI componentscompat/ - Legacy compatibility shims (e.g. compat/router for older router APIs)experimental/ - Unstable, opt-in experimental features not yet in the public APIfont/ - Google and local font optimization modules (font/google, font/local)image-types/ - TypeScript type definitions for Next.js image handlinglegacy/ - Deprecated APIs kept for backwards compatibilitynavigation-types/ - TypeScript types for App Router navigation primitivessrc/ - Full framework source: client runtime, server, build system, shared utilitiestypes/ - Supplemental ambient TypeScript declarationswebpack-plugins/ - Custom webpack plugins used during the Next.js buildapp.js / app.d.ts - next/app entry point for custom _app componentsbabel.js / babel.d.ts - next/babel preset entrycache.js / cache.d.ts - React cache utilities for App Routerclient.js / client.d.ts - next/client hydration entry pointconstants.js / constants.d.ts - Shared build/runtime constantsdocument.js / document.d.ts - Custom _document entrydynamic.js / dynamic.d.ts - Dynamic import / lazy-loading helpererror.js / error.d.ts - Built-in error page componenterrors.json - Canonical error code registry启动隔离沙箱并在服务器端直接运行 — 无需本地配置。
此版本的 Tetrees AI Review
This Next.js, Express web app completed archive review. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
管道 avcp-2026-08-04.1 · SHA-256 98158f456fd957ef…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
审查日期 2026年8月4日
将此产品直接导入你的 AI IDE、网页构建器或云端 IDE。
将 Tetrees 连接到兼容的 AI IDE,列出你拥有的产品并获取已验证 ZIP,同时不会开放卖家上传权限。
暂无评价。
Sign in to join the discussion
Loading discussion…
form.jsform.d.tshead.js / head.d.ts - <Head> component for Pages Routerheaders.js / headers.d.ts - next/headers server APIimage.js / image.d.ts - <Image> componentjest.js / jest.d.ts - Jest transform/config helperslink.js / link.d.ts - <Link> componentnavigation.js / navigation.d.ts - App Router navigation hooksog.js / og.d.ts - Edge-runtime Open Graph image generationrouter.js / router.d.ts - Pages Router imperative APIscript.js / script.d.ts - <Script> componentserver.js / server.d.ts - Server-side helpers (NextRequest, NextResponse, etc.)taskfile.js / taskfile-*.js - Internal build task runners (ncc, swc, webpack, watch)tsconfig.json / tsconfig.build.json - TypeScript configuration for the packageweb-vitals.js / web-vitals.d.ts - Web Vitals reporting helpersnpm install react react-dom
npm install postcss
npm install next
If you are running the source build pipeline directly (taskfile, swc compilation), you also need the native SWC binaries that match your platform. These ship as optional dependencies of
next(e.g.@next/swc-linux-x64-gnu). Runnpm install next --ignore-scriptsonly if you want to skip native compilation; otherwise let the default install resolve the correct binary automatically.
source/ directory into your repository, e.g. ./packages/next/.package.json, add a workspace entry (if using npm/yarn workspaces):
{
"workspaces": ["packages/next"]
}
tsconfig.json so your application can resolve the package as nextjs-project:
{
"compilerOptions": {
"paths": {
"nextjs-project": ["./packages/next/index.d.ts"],
"nextjs-project/*": ["./packages/next/*"]
}
}
}
source/babel.js as a preset in babel.config.js:
module.exports = { presets: ['./packages/next/babel.js'] }
NODE_ENV=production # or development
NEXT_TELEMETRY_DISABLED=1 # opt out of telemetry during dev
cssnano-simple, require it directly:
const cssnanoSimple = require('./packages/next/src/bundles/cssnano-simple/index.js')
import postcss from 'postcss'
const cssnanoSimple: (
opts?: {
excludeAll?: boolean
[pluginName: string]: boolean | { exclude?: boolean } | undefined
},
postcss?: typeof import('postcss')
) => postcss.Plugin
A lightweight PostCSS plugin factory. Use it when you need deterministic, fast CSS minification in a custom build pipeline. Pass excludeAll: true to start with all sub-plugins disabled and opt individual ones back in.
interface PostCSSPlugin {
postcssPlugin: string
prepare(): Record<string, never>
}
declare function pluginCreator(): PostCSSPlugin
pluginCreator.postcss: true
A no-op PostCSS plugin stub used internally to replace postcss-svgo when building cssnano-preset-simple. Reference it when you need to neutralize a PostCSS plugin without removing it from the pipeline.
src/client/index.tsx)// Internal API - consumed via the built client bundle
import type { NextWebVitalsMetric, NEXT_DATA } from './shared/lib/utils'
import type Router from './shared/lib/router/router'
import type { AppComponent, AppProps, PrivateRouteInfo } from './shared/lib/router/router'
The client hydration entry wires React, the Pages Router, head management, image config, and App Router adapters into the browser. Use it as a reference when implementing a custom client bootstrap or patching hydration behavior.
A build script that reads raw CSS and outputs a minified version using the bundled cssnano-simple without pulling in the full cssnano package.
import postcss from 'postcss'
// Require the bundled implementation directly
const cssnanoSimple = require('./packages/next/src/bundles/cssnano-simple/index.js')
async function minifyCSS(rawCSS: string, filePath: string): Promise<string> {
const plugin = cssnanoSimple({ excludeAll: false }, postcss)
const result = await postcss([plugin]).process(rawCSS, { from: filePath })
return result.css
}
minifyCSS('body { color: red; margin: 0 }', 'styles.css').then(console.log)
// → body{color:red;margin:0}
When assembling a custom PostCSS pipeline and you want to include a plugin slot that does nothing (useful for conditional pipelines in tests or CI).
const pluginCreator =
require('./packages/next/src/bundles/postcss-plugin-stub/index.js')
import postcss from 'postcss'
async function processWithStub(css: string): Promise<string> {
// pluginCreator is a valid postcss plugin; it performs no transforms
const result = await postcss([pluginCreator()]).process(css, { from: undefined })
return result.css
}
processWithStub('h1 { font-size: 2rem }').then(console.log)
// → h1 { font-size: 2rem } (unchanged)
Enable only specific cssnano sub-plugins to avoid undesirable transforms (e.g. keep calc() intact while still deduplicating rules).
const cssnanoSimple = require('./packages/next/src/bundles/cssnano-simple/index.js')
import postcss from 'postcss'
async function minifySafe(css: string): Promise<string> {
// Start with everything excluded, then opt specific plugins back in
const plugin = cssnanoSimple(
{
excludeAll: true,
// re-enable only deduplicate rules
rawCache: false,
},
postcss
)
const result = await postcss([plugin]).process(css, { from: undefined })
return result.css
}
.storybook/ - Storybook main config, preview body HTML, preview entry, and test-runner setup for component-level visual tests.compat/ - Re-exports of older router APIs (compat/router) that maintain backwards compatibility for consumers on prior major versions.experimental/ - Feature-flagged modules not covered by semantic versioning; import at your own risk.font/ - font/google/index.js and font/local/index.js implement font optimization, subsetting, and CSS variable injection.image-types/ - Ambient .d.ts files describing image import shapes for TypeScript consumers.legacy/ - Shims for APIs removed from the public surface but still needed by some downstream packages.navigation-types/ - TypeScript declarations for useRouter, usePathname, useSearchParams, and related App Router hooks.src/ - Core source tree: src/client/ (browser runtime), src/server/ (Node.js server), src/build/ (webpack/SWC pipeline), src/shared/ (isomorphic utilities), and src/bundles/ (vendored deps like cssnano-simple).types/ - Top-level ambient declarations supplementing the per-entry .d.ts files.webpack-plugins/ - Custom webpack plugins invoked during next build (e.g. font optimization, telemetry).taskfile.js / taskfile-*.js - Task runner scripts for compiling the framework itself via ncc, SWC, or webpack; not needed at runtime.errors.json - Machine-readable map of error codes to documentation URLs; consumed by the error overlay.tsconfig.json / tsconfig.build.json - TypeScript project references; tsconfig.build.json is used for production compilation..node files for @next/swc-* must match the exact next version; fix by running npm install next@<exact-version> and letting postinstall download the correct binary.cssnano-simple: The bundled cssnano-simple exports a CommonJS function; use require() or set "esModuleInterop": true in tsconfig.json with a default import.cssnano-simple imports postcss as a peer; pin to user@example.com because the plugin API changed incompatibly between v7 and v8.NEXT_TELEMETRY_DISABLED missing: Without this env var, the build pipeline attempts network calls during development; set it to 1 in .env.local to prevent unexpected outbound traffic.src/client/index.tsx is not a public entry point: Do not import it directly in application code; it is the internal hydration bootstrap and assumes a specific Webpack chunk graph produced by next build./* variants: A paths entry for nextjs-project without a matching nextjs-project/* entry will cause TS2307 errors for sub-path imports like nextjs-project/server.I have added the Next.js framework source to my project under `./packages/next/`
and have a `USAGE.md` describing its structure and API.
Upstream package name: user@example.com
Please help me integrate it step by step:
1. Read `USAGE.md` and `source/` to understand what is available.
2. Update `tsconfig.json` to add path aliases for `nextjs-project` and `nextjs-project/*`
pointing at `./packages/next/`.
3. Wire `source/src/bundles/cssnano-simple/index.js` into my existing PostCSS pipeline
in `build/css.ts`, replacing the current `cssnano` dependency.
4. Add a `minifyCSS(input: string): Promise<string>` utility that uses the bundled
cssnano-simple with the options I specify.
5. Show me how to run the internal taskfile build (`taskfile.js`) to recompile
the package after I modify source files.
6. Point out any peer dependency version conflicts between my current `package.json`
and what `source/` requires, and suggest pinned versions.
Constraints: do not invent APIs not present in `USAGE.md` or `source/`.
Keep all imports relative to `./packages/next/` or using the `nextjs-project` alias.
Next.js is released under the MIT License. See source/license.md for the full text. The upstream project is maintained by Vercel at https://github.com/vercel/next.js and published to npm as next. The vendored cssnano-simple implementation originates from https://github.com/Timer/cssnano-simple, also MIT licensed.
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
完整安装指南与集成提示词将在购买后解锁。
Automation, Utilities & Developer Tools
免费