Unverified Commit b9ec2e4f authored by Jude Gao's avatar Jude Gao Committed by GitHub

[AI] Ship bundled docs in next and generate AGENTS.md in create-next-app (#89850)

AI coding agents often rely on outdated training data when working with
Next.js projects, leading to hallucinated APIs and deprecated patterns.
This PR addresses that by shipping version-matched documentation inside
the `next` npm package and generating agent instruction files during
`create-next-app`.

During `next` build, a new `copy_docs` task copies `docs/` from the repo
root into `dist/docs/`. Since `"dist"` is already in the package's
`files` array, the docs are automatically published at
`node_modules/next/dist/docs/`.

`create-next-app` gains a new `--agents-md` / `--no-agents-md` flag
(defaults to `true`). When enabled it writes two files:

- `AGENTS.md` — instructs agents to read `node_modules/next/dist/docs/`
instead of relying on training data
- `CLAUDE.md` — uses `@AGENTS.md` import syntax for Claude Code

The option appears in the recommended defaults display and is prompted
during the customize flow. Existing tests are updated with
`--no-agents-md` to avoid the new prompt.
parent c49cc9fa
...@@ -17,6 +17,7 @@ import { install } from './helpers/install' ...@@ -17,6 +17,7 @@ import { install } from './helpers/install'
import { isFolderEmpty } from './helpers/is-folder-empty' import { isFolderEmpty } from './helpers/is-folder-empty'
import { getOnline } from './helpers/is-online' import { getOnline } from './helpers/is-online'
import { isWriteable } from './helpers/is-writeable' import { isWriteable } from './helpers/is-writeable'
import { generateAgentFiles } from './helpers/generate-agent-files'
import { runTypegen } from './helpers/typegen' import { runTypegen } from './helpers/typegen'
import type { Bundler, TemplateMode, TemplateType } from './templates' import type { Bundler, TemplateMode, TemplateType } from './templates'
...@@ -42,6 +43,7 @@ export async function createApp({ ...@@ -42,6 +43,7 @@ export async function createApp({
bundler, bundler,
disableGit, disableGit,
reactCompiler, reactCompiler,
agentsMd,
}: { }: {
appPath: string appPath: string
packageManager: PackageManager packageManager: PackageManager
...@@ -60,6 +62,7 @@ export async function createApp({ ...@@ -60,6 +62,7 @@ export async function createApp({
bundler: Bundler bundler: Bundler
disableGit?: boolean disableGit?: boolean
reactCompiler: boolean reactCompiler: boolean
agentsMd: boolean
}): Promise<void> { }): Promise<void> {
let repoInfo: RepoInfo | undefined let repoInfo: RepoInfo | undefined
const mode: TemplateMode = typescript ? 'ts' : 'js' const mode: TemplateMode = typescript ? 'ts' : 'js'
...@@ -255,6 +258,10 @@ export async function createApp({ ...@@ -255,6 +258,10 @@ export async function createApp({
}) })
} }
if (agentsMd) {
generateAgentFiles(root)
}
if (disableGit) { if (disableGit) {
console.log('Skipping git initialization.') console.log('Skipping git initialization.')
console.log() console.log()
......
import fs from 'fs'
import path from 'path'
/**
* Generate AGENTS.md and CLAUDE.md in the project root.
* AGENTS.md contains the instructions, CLAUDE.md references it using @ syntax.
*/
export function generateAgentFiles(root: string): void {
const agentsMdContent = `<!-- BEGIN:nextjs-agent-rules -->
# Next.js: ALWAYS read docs before coding
Before any Next.js work, find and read the relevant doc in \`node_modules/next/dist/docs/\`. Your training data is outdated — the docs are the source of truth.
<!-- END:nextjs-agent-rules -->
`
const claudeMdContent = `@AGENTS.md
`
const agentsMdPath = path.join(root, 'AGENTS.md')
const claudeMdPath = path.join(root, 'CLAUDE.md')
fs.writeFileSync(agentsMdPath, agentsMdContent, 'utf-8')
fs.writeFileSync(claudeMdPath, claudeMdContent, 'utf-8')
}
...@@ -106,6 +106,10 @@ const program = new Command(packageJson.name) ...@@ -106,6 +106,10 @@ const program = new Command(packageJson.name)
--example-path foo/bar --example-path foo/bar
` `
) )
.option(
'--agents-md',
'Include AGENTS.md to guide coding agents to write up-to-date Next.js code. (default)'
)
.option('--disable-git', `Skip initializing a git repository.`) .option('--disable-git', `Skip initializing a git repository.`)
.action((name) => { .action((name) => {
// Commander does not implicitly support negated options. When they are used // Commander does not implicitly support negated options. When they are used
...@@ -241,6 +245,7 @@ async function run(): Promise<void> { ...@@ -241,6 +245,7 @@ async function run(): Promise<void> {
empty: false, empty: false,
disableGit: false, disableGit: false,
reactCompiler: false, reactCompiler: false,
agentsMd: true,
} }
type DisplayConfigItem = { type DisplayConfigItem = {
...@@ -258,6 +263,7 @@ async function run(): Promise<void> { ...@@ -258,6 +263,7 @@ async function run(): Promise<void> {
{ key: 'tailwind', values: { true: 'Tailwind CSS' } }, { key: 'tailwind', values: { true: 'Tailwind CSS' } },
{ key: 'srcDir', values: { true: 'src/ dir' } }, { key: 'srcDir', values: { true: 'src/ dir' } },
{ key: 'app', values: { true: 'App Router', false: 'Pages Router' } }, { key: 'app', values: { true: 'App Router', false: 'Pages Router' } },
{ key: 'agentsMd', values: { true: 'AGENTS.md' } },
] ]
// Helper to format settings for display based on displayConfig // Helper to format settings for display based on displayConfig
...@@ -586,6 +592,34 @@ async function run(): Promise<void> { ...@@ -586,6 +592,34 @@ async function run(): Promise<void> {
} }
} }
} }
if (args.includes('--no-agents-md')) {
opts.agentsMd = false
} else if (!opts.agentsMd) {
if (skipPrompt) {
opts.agentsMd = getPrefOrDefault('agentsMd')
} else {
const { agentsMd } = await prompts(
{
type: 'toggle',
name: 'agentsMd',
message:
'Would you like to include AGENTS.md to guide coding agents to write up-to-date Next.js code?',
initial: getPrefOrDefault('agentsMd'),
active: 'Yes',
inactive: 'No',
},
{
onCancel: () => {
console.error('Exiting.')
process.exit(1)
},
}
)
opts.agentsMd = Boolean(agentsMd)
preferences.agentsMd = Boolean(agentsMd)
}
}
} }
const bundler: Bundler = opts.rspack ? Bundler.Rspack : Bundler.Turbopack const bundler: Bundler = opts.rspack ? Bundler.Rspack : Bundler.Turbopack
...@@ -609,6 +643,7 @@ async function run(): Promise<void> { ...@@ -609,6 +643,7 @@ async function run(): Promise<void> {
bundler, bundler,
disableGit: opts.disableGit, disableGit: opts.disableGit,
reactCompiler: opts.reactCompiler, reactCompiler: opts.reactCompiler,
agentsMd: opts.agentsMd,
}) })
} catch (reason) { } catch (reason) {
if (!(reason instanceof DownloadError)) { if (!(reason instanceof DownloadError)) {
...@@ -643,6 +678,7 @@ async function run(): Promise<void> { ...@@ -643,6 +678,7 @@ async function run(): Promise<void> {
bundler, bundler,
disableGit: opts.disableGit, disableGit: opts.disableGit,
reactCompiler: opts.reactCompiler, reactCompiler: opts.reactCompiler,
agentsMd: opts.agentsMd,
}) })
} }
conf.set('preferences', preferences) conf.set('preferences', preferences)
......
...@@ -31,6 +31,12 @@ export async function copy_regenerator_runtime(task, opts) { ...@@ -31,6 +31,12 @@ export async function copy_regenerator_runtime(task, opts) {
.target('src/compiled/regenerator-runtime') .target('src/compiled/regenerator-runtime')
} }
export async function copy_docs(task, opts) {
// Copy documentation from repo root into the package
const docsSource = join(__dirname, '../../docs')
await task.source(join(docsSource, '**/*')).target('dist/docs')
}
export async function copy_styled_jsx_assets(task, opts) { export async function copy_styled_jsx_assets(task, opts) {
// we copy the styled-jsx types so that we can reference them // we copy the styled-jsx types so that we can reference them
// in the next-env.d.ts file so it doesn't matter if the styled-jsx // in the next-env.d.ts file so it doesn't matter if the styled-jsx
...@@ -2188,7 +2194,7 @@ export async function ncc_safe_stable_stringify(task, opts) { ...@@ -2188,7 +2194,7 @@ export async function ncc_safe_stable_stringify(task, opts) {
export async function precompile(task, opts) { export async function precompile(task, opts) {
await task.parallel( await task.parallel(
['browser_polyfills', 'copy_ncced', 'copy_styled_jsx_assets'], ['browser_polyfills', 'copy_ncced', 'copy_styled_jsx_assets', 'copy_docs'],
opts opts
) )
} }
......
...@@ -31,6 +31,7 @@ describe('create-next-app Biome configuration', () => { ...@@ -31,6 +31,7 @@ describe('create-next-app Biome configuration', () => {
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
'--skip-install', '--skip-install',
], ],
nextTgzFilename, nextTgzFilename,
...@@ -59,6 +60,7 @@ describe('create-next-app Biome configuration', () => { ...@@ -59,6 +60,7 @@ describe('create-next-app Biome configuration', () => {
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ cwd } { cwd }
...@@ -95,6 +97,7 @@ describe('create-next-app Biome configuration', () => { ...@@ -95,6 +97,7 @@ describe('create-next-app Biome configuration', () => {
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ cwd } { cwd }
...@@ -131,6 +134,7 @@ describe('create-next-app Biome configuration', () => { ...@@ -131,6 +134,7 @@ describe('create-next-app Biome configuration', () => {
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ cwd } { cwd }
...@@ -167,6 +171,7 @@ describe('create-next-app Biome configuration', () => { ...@@ -167,6 +171,7 @@ describe('create-next-app Biome configuration', () => {
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ cwd } { cwd }
......
...@@ -29,6 +29,7 @@ describe('create-next-app ESLint configuration', () => { ...@@ -29,6 +29,7 @@ describe('create-next-app ESLint configuration', () => {
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--skip-install', '--skip-install',
...@@ -76,6 +77,7 @@ describe('create-next-app ESLint configuration', () => { ...@@ -76,6 +77,7 @@ describe('create-next-app ESLint configuration', () => {
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
'--app', '--app',
'--no-import-alias', '--no-import-alias',
'--skip-install', '--skip-install',
......
...@@ -39,6 +39,7 @@ describe('create-next-app', () => { ...@@ -39,6 +39,7 @@ describe('create-next-app', () => {
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -81,6 +82,7 @@ describe('create-next-app', () => { ...@@ -81,6 +82,7 @@ describe('create-next-app', () => {
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -98,6 +100,70 @@ describe('create-next-app', () => { ...@@ -98,6 +100,70 @@ describe('create-next-app', () => {
} }
}) })
}) })
it('should create AGENTS.md and CLAUDE.md with --agents-md flag', async () => {
await useTempDir(async (cwd) => {
const projectName = 'with-agents-md'
const res = await run(
[
projectName,
'--ts',
'--app',
'--no-linter',
'--no-tailwind',
'--no-src-dir',
'--no-import-alias',
'--no-react-compiler',
'--agents-md',
'--skip-install',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
],
nextTgzFilename,
{
cwd,
}
)
expect(res.exitCode).toBe(0)
projectFilesShouldExist({
cwd,
projectName,
files: ['AGENTS.md', 'CLAUDE.md'],
})
})
})
it('should not create AGENTS.md and CLAUDE.md with --no-agents-md flag', async () => {
await useTempDir(async (cwd) => {
const projectName = 'without-agents-md'
const res = await run(
[
projectName,
'--ts',
'--app',
'--no-linter',
'--no-tailwind',
'--no-src-dir',
'--no-import-alias',
'--no-react-compiler',
'--no-agents-md',
'--skip-install',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
],
nextTgzFilename,
{
cwd,
}
)
expect(res.exitCode).toBe(0)
projectFilesShouldNotExist({
cwd,
projectName,
files: ['AGENTS.md', 'CLAUDE.md'],
})
})
})
it('should not install dependencies if --skip-install', async () => { it('should not install dependencies if --skip-install', async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'empty-dir' const projectName = 'empty-dir'
...@@ -113,6 +179,7 @@ describe('create-next-app', () => { ...@@ -113,6 +179,7 @@ describe('create-next-app', () => {
'--no-import-alias', '--no-import-alias',
'--skip-install', '--skip-install',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
......
...@@ -49,6 +49,7 @@ describe('create-next-app with package manager bun', () => { ...@@ -49,6 +49,7 @@ describe('create-next-app with package manager bun', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
...@@ -78,6 +79,7 @@ describe('create-next-app with package manager bun', () => { ...@@ -78,6 +79,7 @@ describe('create-next-app with package manager bun', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
......
...@@ -38,6 +38,7 @@ describe('create-next-app with package manager npm', () => { ...@@ -38,6 +38,7 @@ describe('create-next-app with package manager npm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
...@@ -67,6 +68,7 @@ describe('create-next-app with package manager npm', () => { ...@@ -67,6 +68,7 @@ describe('create-next-app with package manager npm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
......
...@@ -39,6 +39,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -39,6 +39,7 @@ describe('create-next-app with package manager pnpm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
...@@ -68,6 +69,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -68,6 +69,7 @@ describe('create-next-app with package manager pnpm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
...@@ -102,6 +104,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -102,6 +104,7 @@ describe('create-next-app with package manager pnpm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
'--skip-install', '--skip-install',
], ],
nextTgzFilename, nextTgzFilename,
...@@ -133,6 +136,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -133,6 +136,7 @@ describe('create-next-app with package manager pnpm', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
'--skip-install', '--skip-install',
], ],
nextTgzFilename, nextTgzFilename,
......
...@@ -46,6 +46,7 @@ describe('create-next-app with package manager yarn', () => { ...@@ -46,6 +46,7 @@ describe('create-next-app with package manager yarn', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
...@@ -75,6 +76,7 @@ describe('create-next-app with package manager yarn', () => { ...@@ -75,6 +76,7 @@ describe('create-next-app with package manager yarn', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
nextTgzFilename, nextTgzFilename,
{ {
......
...@@ -29,6 +29,7 @@ describe('create-next-app prompts', () => { ...@@ -29,6 +29,7 @@ describe('create-next-app prompts', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
{ {
cwd, cwd,
...@@ -68,6 +69,7 @@ describe('create-next-app prompts', () => { ...@@ -68,6 +69,7 @@ describe('create-next-app prompts', () => {
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
{ {
cwd, cwd,
...@@ -104,6 +106,7 @@ describe('create-next-app prompts', () => { ...@@ -104,6 +106,7 @@ describe('create-next-app prompts', () => {
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
{ {
cwd, cwd,
...@@ -140,6 +143,7 @@ describe('create-next-app prompts', () => { ...@@ -140,6 +143,7 @@ describe('create-next-app prompts', () => {
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
], ],
{ {
cwd, cwd,
...@@ -197,6 +201,8 @@ describe('create-next-app prompts', () => { ...@@ -197,6 +201,8 @@ describe('create-next-app prompts', () => {
'package.json', 'package.json',
'postcss.config.mjs', 'postcss.config.mjs',
'tsconfig.json', 'tsconfig.json',
'AGENTS.md',
'CLAUDE.md',
], ],
}) })
resolve() resolve()
...@@ -238,6 +244,8 @@ describe('create-next-app prompts', () => { ...@@ -238,6 +244,8 @@ describe('create-next-app prompts', () => {
'package.json', 'package.json',
'postcss.config.mjs', // tailwind 'postcss.config.mjs', // tailwind
'tsconfig.json', // typescript 'tsconfig.json', // typescript
'AGENTS.md', // agent files
'CLAUDE.md',
], ],
}) })
resolve() resolve()
......
...@@ -67,6 +67,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -67,6 +67,7 @@ describe('create-next-app --api (Headless App)', () => {
'--api', '--api',
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -99,6 +100,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -99,6 +100,7 @@ describe('create-next-app --api (Headless App)', () => {
'--api', '--api',
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -128,6 +130,7 @@ describe('create-next-app --api (Headless App)', () => { ...@@ -128,6 +130,7 @@ describe('create-next-app --api (Headless App)', () => {
'--api', '--api',
'--src-dir', '--src-dir',
'--no-import-alias', '--no-import-alias',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
......
...@@ -34,6 +34,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -34,6 +34,7 @@ describe('create-next-app --app (App Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -64,6 +65,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -64,6 +65,7 @@ describe('create-next-app --app (App Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -92,6 +94,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -92,6 +94,7 @@ describe('create-next-app --app (App Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -129,6 +132,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -129,6 +132,7 @@ describe('create-next-app --app (App Router)', () => {
'--tailwind', '--tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -166,6 +170,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -166,6 +170,7 @@ describe('create-next-app --app (App Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -205,6 +210,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -205,6 +210,7 @@ describe('create-next-app --app (App Router)', () => {
'--empty', '--empty',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
......
...@@ -35,8 +35,8 @@ describe.each(['app', 'pages'] as const)( ...@@ -35,8 +35,8 @@ describe.each(['app', 'pages'] as const)(
// srcDir and reactCompiler don't interact so we're testing them together // srcDir and reactCompiler don't interact so we're testing them together
// instead of all permutations. // instead of all permutations.
srcDirAndCompiler: [ srcDirAndCompiler: [
'--src-dir --react-compiler', '--src-dir --react-compiler --no-agents-md',
'--no-src-dir --no-react-compiler', '--no-src-dir --no-react-compiler --no-agents-md',
], ],
tailwind: ['--tailwind', '--no-tailwind'], tailwind: ['--tailwind', '--no-tailwind'],
......
...@@ -34,6 +34,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -34,6 +34,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -69,6 +70,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -69,6 +70,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -101,6 +103,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -101,6 +103,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -137,6 +140,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -137,6 +140,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--tailwind', '--tailwind',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -175,6 +179,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -175,6 +179,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--empty', '--empty',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
...@@ -215,6 +220,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -215,6 +220,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--empty', '--empty',
'--no-import-alias', '--no-import-alias',
'--no-react-compiler', '--no-react-compiler',
'--no-agents-md',
...(process.env.NEXT_RSPACK ? ['--rspack'] : []), ...(process.env.NEXT_RSPACK ? ['--rspack'] : []),
], ],
nextTgzFilename, nextTgzFilename,
......
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