Unverified Commit cfa003c7 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add --turbopack CLI flag (#71657)

Changes `--turbo` -> `--turbopack` to avoid confusion.

- Updated docs
- Updates create-next-app -- For create-next-app it's a rename as
otherwise there is an ordering problem with the prompts
- For the CLI `next dev --turbo` is still supported, will eventually be
a warning in a future version to swap with `--turbopack` but is not a
requirement today, can be handled automatically by the upgrade codemod
- New CLI flag: `next dev --turbopack`

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

---------
Co-authored-by: 's avatarWill Binns-Smith <wbinnssmith@gmail.com>
parent 9bd38dd1
...@@ -735,7 +735,7 @@ const createCommentPostAsync = ...@@ -735,7 +735,7 @@ const createCommentPostAsync =
console.log('Created a new comment', result.data.html_url) console.log('Created a new comment', result.data.html_url)
} }
// An action report failed next.js integration test with --turbo // An action report failed next.js integration test with --turbopack
async function run() { async function run() {
const { const {
token, token,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev-turbopack": "next dev --turbo", "dev-turbopack": "next dev --turbopack",
"dev-webpack": "next dev", "dev-webpack": "next dev",
"build-turbopack": "TURBOPACK=1 TURBOPACK_BUILD=1 next build", "build-turbopack": "TURBOPACK=1 TURBOPACK_BUILD=1 next build",
"build-webpack": "next build", "build-webpack": "next build",
......
...@@ -13,7 +13,7 @@ use crate::next_api::project::NapiDefineEnv; ...@@ -13,7 +13,7 @@ use crate::next_api::project::NapiDefineEnv;
#[napi(object, object_to_js = false)] #[napi(object, object_to_js = false)]
#[derive(Debug)] #[derive(Debug)]
pub struct NextBuildContext { pub struct NextBuildContext {
// Added by Next.js for next build --turbo specifically. // Added by Next.js for next build --turbopack specifically.
/// The root directory of the workspace. /// The root directory of the workspace.
pub root: Option<String>, pub root: Option<String>,
......
...@@ -6,7 +6,7 @@ use turbopack_ecmascript_runtime::RuntimeType; ...@@ -6,7 +6,7 @@ use turbopack_ecmascript_runtime::RuntimeType;
#[turbo_tasks::value(shared)] #[turbo_tasks::value(shared)]
#[derive(Debug, Copy, Clone, TaskInput, Ord, PartialOrd, Hash)] #[derive(Debug, Copy, Clone, TaskInput, Ord, PartialOrd, Hash)]
pub enum NextMode { pub enum NextMode {
/// `next dev --turbo` /// `next dev --turbopack`
Development, Development,
/// `next build` /// `next build`
Build, Build,
......
...@@ -784,7 +784,7 @@ module.exports = withMDX({ ...@@ -784,7 +784,7 @@ module.exports = withMDX({
> **Good to know**: > **Good to know**:
> >
> This option is required when processing markdown and MDX while using [Turbopack](/docs/architecture/turbopack) (`next dev --turbo`). > This option is required when processing markdown and MDX while using [Turbopack](/docs/architecture/turbopack) (`next dev --turbopack`).
## Helpful Links ## Helpful Links
......
...@@ -480,7 +480,7 @@ Create React App and Next.js both default to using webpack for bundling. ...@@ -480,7 +480,7 @@ Create React App and Next.js both default to using webpack for bundling.
When migrating your CRA application to Next.js, you might have a custom webpack configuration you're looking to migrate. Next.js supports providing a [custom webpack configuration](/docs/app/api-reference/next-config-js/webpack). When migrating your CRA application to Next.js, you might have a custom webpack configuration you're looking to migrate. Next.js supports providing a [custom webpack configuration](/docs/app/api-reference/next-config-js/webpack).
Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config-js/turbo) through `next dev --turbo` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/next-config-js/turbo) as well for compatibility and incremental adoption. Further, Next.js has support for [Turbopack](/docs/app/api-reference/next-config-js/turbo) through `next dev --turbopack` to improve your local dev performance. Turbopack supports some [webpack loaders](/docs/app/api-reference/next-config-js/turbo) as well for compatibility and incremental adoption.
## Next Steps ## Next Steps
......
...@@ -28,7 +28,7 @@ The following options are available: ...@@ -28,7 +28,7 @@ The following options are available:
| `--eslint` | Initialize with ESLint config | | `--eslint` | Initialize with ESLint config |
| `--app` | Initialize as an App Router project | | `--app` | Initialize as an App Router project |
| `--src-dir` | Initialize inside a `src/` directory | | `--src-dir` | Initialize inside a `src/` directory |
| `--turbo` | Enable Turbopack by default for development | | `--turbopack` | Enable Turbopack by default for development |
| `--import-alias <alias-to-configure>` | Specify import alias to use (default "@/\*") | | `--import-alias <alias-to-configure>` | Specify import alias to use (default "@/\*") |
| `--empty` | Initialize an empty project | | `--empty` | Initialize an empty project |
| `--use-npm` | Explicitly tell the CLI to bootstrap the application using npm | | `--use-npm` | Explicitly tell the CLI to bootstrap the application using npm |
......
...@@ -45,7 +45,7 @@ The following commands are available: ...@@ -45,7 +45,7 @@ The following commands are available:
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `-h, --help` | Show all available options. | | `-h, --help` | Show all available options. |
| `[directory]` | A directory in which to build the application. If not provided, current directory is used. | | `[directory]` | A directory in which to build the application. If not provided, current directory is used. |
| `--turbo` | Starts development mode using [Turbopack](https://nextjs.org/docs/architecture/turbopack). | | `--turbopack` | Starts development mode using [Turbopack](https://nextjs.org/docs/architecture/turbopack). |
| `-p` or `--port <port>` | Specify a port number on which to start the application. Default: 3000, env: PORT | | `-p` or `--port <port>` | Specify a port number on which to start the application. Default: 3000, env: PORT |
| `-H`or `--hostname <hostname>` | Specify a hostname on which to start the application. Useful for making the application available for other devices on the network. Default: 0.0.0.0 | | `-H`or `--hostname <hostname>` | Specify a hostname on which to start the application. Useful for making the application available for other devices on the network. Default: 0.0.0.0 |
| `--experimental-https` | Starts the server with HTTPS and generates a self-signed certificate. | | `--experimental-https` | Starts the server with HTTPS and generates a self-signed certificate. |
......
...@@ -7,12 +7,12 @@ description: Turbopack is an incremental bundler optimized for JavaScript and Ty ...@@ -7,12 +7,12 @@ description: Turbopack is an incremental bundler optimized for JavaScript and Ty
## Usage ## Usage
Turbopack can be used in Next.js in both the `pages` and `app` directories for faster local development. To enable Turbopack, use the `--turbo` flag when running the Next.js development server. Turbopack can be used in Next.js in both the `pages` and `app` directories for faster local development. To enable Turbopack, use the `--turbopack` flag when running the Next.js development server.
```json filename="package.json" highlight={3} ```json filename="package.json" highlight={3}
{ {
"scripts": { "scripts": {
"dev": "next dev --turbo", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint" "lint": "next lint"
...@@ -76,6 +76,6 @@ These features are currently not supported: ...@@ -76,6 +76,6 @@ These features are currently not supported:
## Generating Trace Files ## Generating Trace Files
Trace files allow the Next.js team to investigate and improve performance metrics and memory usage. To generate a trace file, append `NEXT_TURBOPACK_TRACING=1` to the `next dev --turbo` command, this will generate a `.next/trace.log` file. Trace files allow the Next.js team to investigate and improve performance metrics and memory usage. To generate a trace file, append `NEXT_TURBOPACK_TRACING=1` to the `next dev --turbopack` command, this will generate a `.next/trace.log` file.
When reporting issues related to Turbopack performance and memory usage, please include the trace file in your [GitHub](https://github.com/vercel/next.js) issue. When reporting issues related to Turbopack performance and memory usage, please include the trace file in your [GitHub](https://github.com/vercel/next.js) issue.
...@@ -59,7 +59,7 @@ Options: ...@@ -59,7 +59,7 @@ Options:
Initialize inside a `src/` directory. Initialize inside a `src/` directory.
--turbo --turbopack
Enable Turbopack by default for development. Enable Turbopack by default for development.
......
...@@ -36,7 +36,7 @@ export async function createApp({ ...@@ -36,7 +36,7 @@ export async function createApp({
importAlias, importAlias,
skipInstall, skipInstall,
empty, empty,
turbo, turbopack,
disableGit, disableGit,
}: { }: {
appPath: string appPath: string
...@@ -51,7 +51,7 @@ export async function createApp({ ...@@ -51,7 +51,7 @@ export async function createApp({
importAlias: string importAlias: string
skipInstall: boolean skipInstall: boolean
empty: boolean empty: boolean
turbo: boolean turbopack: boolean
disableGit?: boolean disableGit?: boolean
}): Promise<void> { }): Promise<void> {
let repoInfo: RepoInfo | undefined let repoInfo: RepoInfo | undefined
...@@ -233,7 +233,7 @@ export async function createApp({ ...@@ -233,7 +233,7 @@ export async function createApp({
srcDir, srcDir,
importAlias, importAlias,
skipInstall, skipInstall,
turbo, turbopack,
}) })
} }
......
...@@ -52,7 +52,7 @@ const program = new Command(packageJson.name) ...@@ -52,7 +52,7 @@ const program = new Command(packageJson.name)
.option('--eslint', 'Initialize with ESLint config.') .option('--eslint', 'Initialize with ESLint config.')
.option('--app', 'Initialize as an App Router project.') .option('--app', 'Initialize as an App Router project.')
.option('--src-dir', "Initialize inside a 'src/' directory.") .option('--src-dir', "Initialize inside a 'src/' directory.")
.option('--turbo', 'Enable Turbopack by default for development.') .option('--turbopack', 'Enable Turbopack by default for development.')
.option( .option(
'--import-alias <prefix/*>', '--import-alias <prefix/*>',
'Specify import alias to use (default "@/*").' 'Specify import alias to use (default "@/*").'
...@@ -233,7 +233,7 @@ async function run(): Promise<void> { ...@@ -233,7 +233,7 @@ async function run(): Promise<void> {
importAlias: '@/*', importAlias: '@/*',
customizeImportAlias: false, customizeImportAlias: false,
empty: false, empty: false,
turbo: false, turbopack: false,
disableGit: false, disableGit: false,
} }
const getPrefOrDefault = (field: string) => const getPrefOrDefault = (field: string) =>
...@@ -351,22 +351,22 @@ async function run(): Promise<void> { ...@@ -351,22 +351,22 @@ async function run(): Promise<void> {
} }
} }
if (!opts.turbo && !args.includes('--no-turbo')) { if (!opts.turbopack && !args.includes('--no-turbopack')) {
if (skipPrompt) { if (skipPrompt) {
opts.turbo = getPrefOrDefault('turbo') opts.turbopack = getPrefOrDefault('turbopack')
} else { } else {
const styledTurbo = blue('Turbopack') const styledTurbo = blue('Turbopack')
const { turbo } = await prompts({ const { turbopack } = await prompts({
onState: onPromptState, onState: onPromptState,
type: 'toggle', type: 'toggle',
name: 'turbo', name: 'turbopack',
message: `Would you like to use ${styledTurbo} for ${`next dev`}?`, message: `Would you like to use ${styledTurbo} for ${`next dev`}?`,
initial: getPrefOrDefault('turbo'), initial: getPrefOrDefault('turbopack'),
active: 'Yes', active: 'Yes',
inactive: 'No', inactive: 'No',
}) })
opts.turbo = Boolean(turbo) opts.turbopack = Boolean(turbopack)
preferences.turbo = Boolean(turbo) preferences.turbopack = Boolean(turbopack)
} }
} }
...@@ -429,7 +429,7 @@ async function run(): Promise<void> { ...@@ -429,7 +429,7 @@ async function run(): Promise<void> {
importAlias: opts.importAlias, importAlias: opts.importAlias,
skipInstall: opts.skipInstall, skipInstall: opts.skipInstall,
empty: opts.empty, empty: opts.empty,
turbo: opts.turbo, turbopack: opts.turbopack,
disableGit: opts.disableGit, disableGit: opts.disableGit,
}) })
} catch (reason) { } catch (reason) {
...@@ -461,7 +461,7 @@ async function run(): Promise<void> { ...@@ -461,7 +461,7 @@ async function run(): Promise<void> {
importAlias: opts.importAlias, importAlias: opts.importAlias,
skipInstall: opts.skipInstall, skipInstall: opts.skipInstall,
empty: opts.empty, empty: opts.empty,
turbo: opts.turbo, turbopack: opts.turbopack,
disableGit: opts.disableGit, disableGit: opts.disableGit,
}) })
} }
......
...@@ -43,7 +43,7 @@ export const installTemplate = async ({ ...@@ -43,7 +43,7 @@ export const installTemplate = async ({
srcDir, srcDir,
importAlias, importAlias,
skipInstall, skipInstall,
turbo, turbopack,
}: InstallTemplateArgs) => { }: InstallTemplateArgs) => {
console.log(bold(`Using ${packageManager}.`)); console.log(bold(`Using ${packageManager}.`));
...@@ -188,7 +188,7 @@ export const installTemplate = async ({ ...@@ -188,7 +188,7 @@ export const installTemplate = async ({
version: "0.1.0", version: "0.1.0",
private: true, private: true,
scripts: { scripts: {
dev: `next dev${turbo ? " --turbo" : ""}`, dev: `next dev${turbopack ? " --turbopack" : ""}`,
build: "next build", build: "next build",
start: "next start", start: "next start",
lint: "next lint", lint: "next lint",
......
...@@ -29,5 +29,5 @@ export interface InstallTemplateArgs { ...@@ -29,5 +29,5 @@ export interface InstallTemplateArgs {
srcDir: boolean; srcDir: boolean;
importAlias: string; importAlias: string;
skipInstall: boolean; skipInstall: boolean;
turbo: boolean; turbopack: boolean;
} }
...@@ -403,16 +403,16 @@ function isUsingAppDir(projectPath: string): boolean { ...@@ -403,16 +403,16 @@ function isUsingAppDir(projectPath: string): boolean {
* Heuristics are used to determine whether to Turbopack is enabled or not and * Heuristics are used to determine whether to Turbopack is enabled or not and
* to determine how to update the dev script. * to determine how to update the dev script.
* *
* 1. If the dev script contains `--turbo` option, we assume that Turbopack is * 1. If the dev script contains `--turbopack` option, we assume that Turbopack is
* already enabled. * already enabled.
* 2. If the dev script contains the string `next dev`, we replace it to * 2. If the dev script contains the string `next dev`, we replace it to
* `next dev --turbo`. * `next dev --turbopack`.
* 3. Otherwise, we ask the user to manually add `--turbo` to their dev command, * 3. Otherwise, we ask the user to manually add `--turbopack` to their dev command,
* showing the current dev command as the initial value. * showing the current dev command as the initial value.
*/ */
async function suggestTurbopack(packageJson: any): Promise<void> { async function suggestTurbopack(packageJson: any): Promise<void> {
const devScript: string = packageJson.scripts['dev'] const devScript: string = packageJson.scripts['dev']
if (devScript.includes('--turbo')) return if (devScript.includes('--turbopack')) return
const responseTurbopack = await prompts( const responseTurbopack = await prompts(
{ {
...@@ -431,7 +431,7 @@ async function suggestTurbopack(packageJson: any): Promise<void> { ...@@ -431,7 +431,7 @@ async function suggestTurbopack(packageJson: any): Promise<void> {
if (devScript.includes('next dev')) { if (devScript.includes('next dev')) {
packageJson.scripts['dev'] = devScript.replace( packageJson.scripts['dev'] = devScript.replace(
'next dev', 'next dev',
'next dev --turbo' 'next dev --turbopack'
) )
return return
} }
...@@ -444,7 +444,7 @@ async function suggestTurbopack(packageJson: any): Promise<void> { ...@@ -444,7 +444,7 @@ async function suggestTurbopack(packageJson: any): Promise<void> {
{ {
type: 'text', type: 'text',
name: 'customDevScript', name: 'customDevScript',
message: 'Please manually add "--turbo" to your dev command.', message: 'Please manually add "--turbopack" to your dev command.',
initial: devScript, initial: devScript,
}, },
{ onCancel } { onCancel }
......
...@@ -157,7 +157,8 @@ program ...@@ -157,7 +157,8 @@ program
'If no directory is provided, the current directory will be used.' 'If no directory is provided, the current directory will be used.'
)}` )}`
) )
.option('--turbo', 'Starts development mode using Turbopack (beta).') .option('--turbo', 'Starts development mode using Turbopack.')
.option('--turbopack', 'Starts development mode using Turbopack.')
.addOption( .addOption(
new Option( new Option(
'-p, --port <port>', '-p, --port <port>',
......
...@@ -40,6 +40,7 @@ import { flushAllTraces, trace } from '../trace' ...@@ -40,6 +40,7 @@ import { flushAllTraces, trace } from '../trace'
export type NextDevOptions = { export type NextDevOptions = {
turbo?: boolean turbo?: boolean
turbopack?: boolean
port: number port: number
hostname?: string hostname?: string
experimentalHttps?: boolean experimentalHttps?: boolean
...@@ -232,7 +233,7 @@ const nextDev = async ( ...@@ -232,7 +233,7 @@ const nextDev = async (
hostname: host, hostname: host,
} }
if (options.turbo) { if (options.turbo || options.turbopack) {
process.env.TURBOPACK = '1' process.env.TURBOPACK = '1'
} }
......
...@@ -28,7 +28,7 @@ export function VersionStalenessInfo({ ...@@ -28,7 +28,7 @@ export function VersionStalenessInfo({
(learn more) (learn more)
</a> </a>
)} )}
{process.env.TURBOPACK ? ' (turbo)' : ''} {process.env.TURBOPACK ? ' (Turbopack)' : ''}
</span> </span>
) )
} }
......
...@@ -47,7 +47,7 @@ const unsupportedTurbopackNextConfigOptions = [ ...@@ -47,7 +47,7 @@ const unsupportedTurbopackNextConfigOptions = [
'experimental.urlImports', 'experimental.urlImports',
] ]
// The following will need to be supported by `next build --turbo` // The following will need to be supported by `next build --turbopack`
const unsupportedProductionSpecificTurbopackNextConfigOptions: string[] = [ const unsupportedProductionSpecificTurbopackNextConfigOptions: string[] = [
// TODO: Support disabling sourcemaps, currently they're always enabled. // TODO: Support disabling sourcemaps, currently they're always enabled.
// 'productionBrowserSourceMaps', // 'productionBrowserSourceMaps',
......
...@@ -115,7 +115,7 @@ export type TurboRuleConfigItem = ...@@ -115,7 +115,7 @@ export type TurboRuleConfigItem =
export interface ExperimentalTurboOptions { export interface ExperimentalTurboOptions {
/** /**
* (`next --turbo` only) A mapping of aliased imports to modules to load in their place. * (`next --turbopack` only) A mapping of aliased imports to modules to load in their place.
* *
* @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias) * @see [Resolve Alias](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-alias)
*/ */
...@@ -125,21 +125,21 @@ export interface ExperimentalTurboOptions { ...@@ -125,21 +125,21 @@ export interface ExperimentalTurboOptions {
> >
/** /**
* (`next --turbo` only) A list of extensions to resolve when importing files. * (`next --turbopack` only) A list of extensions to resolve when importing files.
* *
* @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions) * @see [Resolve Extensions](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#resolve-extensions)
*/ */
resolveExtensions?: string[] resolveExtensions?: string[]
/** /**
* (`next --turbo` only) A list of webpack loaders to apply when running with Turbopack. * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.
* *
* @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders) * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)
*/ */
loaders?: Record<string, TurboLoaderItem[]> loaders?: Record<string, TurboLoaderItem[]>
/** /**
* (`next --turbo` only) A list of webpack loaders to apply when running with Turbopack. * (`next --turbopack` only) A list of webpack loaders to apply when running with Turbopack.
* *
* @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders) * @see [Turbopack Loaders](https://nextjs.org/docs/app/api-reference/next-config-js/turbo#webpack-loaders)
*/ */
......
...@@ -23,7 +23,7 @@ export function logStartInfo({ ...@@ -23,7 +23,7 @@ export function logStartInfo({
Log.bootstrap( Log.bootstrap(
`${bold( `${bold(
purple(`${Log.prefixes.ready} Next.js ${process.env.__NEXT_VERSION}`) purple(`${Log.prefixes.ready} Next.js ${process.env.__NEXT_VERSION}`)
)}${process.env.TURBOPACK ? ' (turbo)' : ''}` )}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`
) )
if (appUrl) { if (appUrl) {
Log.bootstrap(`- Local: ${appUrl}`) Log.bootstrap(`- Local: ${appUrl}`)
......
...@@ -354,9 +354,10 @@ class NextCustomServer extends NextServer { ...@@ -354,9 +354,10 @@ class NextCustomServer extends NextServer {
function createServer( function createServer(
options: NextServerOptions & { options: NextServerOptions & {
turbo?: boolean turbo?: boolean
turbopack?: boolean
} }
): NextServer { ): NextServer {
if (options && options.turbo) { if (options && (options.turbo || options.turbopack)) {
process.env.TURBOPACK = '1' process.env.TURBOPACK = '1'
} }
// The package is used as a TypeScript plugin. // The package is used as a TypeScript plugin.
......
...@@ -49,7 +49,7 @@ describe('Error Overlay version staleness', () => { ...@@ -49,7 +49,7 @@ describe('Error Overlay version staleness', () => {
if (process.env.TURBOPACK) { if (process.env.TURBOPACK) {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
`"Next.js (1.0.0) is outdated (learn more) (turbo)"` `"Next.js (1.0.0) is outdated (learn more) (Turbopack)"`
) )
} else { } else {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
...@@ -86,7 +86,7 @@ describe('Error Overlay version staleness', () => { ...@@ -86,7 +86,7 @@ describe('Error Overlay version staleness', () => {
if (process.env.TURBOPACK) { if (process.env.TURBOPACK) {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
`"Next.js (2.0.0) is outdated (learn more) (turbo)"` `"Next.js (2.0.0) is outdated (learn more) (Turbopack)"`
) )
} else { } else {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
...@@ -120,7 +120,7 @@ describe('Error Overlay version staleness', () => { ...@@ -120,7 +120,7 @@ describe('Error Overlay version staleness', () => {
if (process.env.TURBOPACK) { if (process.env.TURBOPACK) {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
`"Next.js (3.0.0) is outdated (learn more) (turbo)"` `"Next.js (3.0.0) is outdated (learn more) (Turbopack)"`
) )
} else { } else {
expect(await getStaleness(browser)).toMatchInlineSnapshot( expect(await getStaleness(browser)).toMatchInlineSnapshot(
......
...@@ -34,7 +34,7 @@ describe('create-next-app', () => { ...@@ -34,7 +34,7 @@ describe('create-next-app', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
...@@ -75,7 +75,7 @@ describe('create-next-app', () => { ...@@ -75,7 +75,7 @@ describe('create-next-app', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
...@@ -105,7 +105,7 @@ describe('create-next-app', () => { ...@@ -105,7 +105,7 @@ describe('create-next-app', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
......
...@@ -38,7 +38,7 @@ describe('create-next-app with package manager bun', () => { ...@@ -38,7 +38,7 @@ describe('create-next-app with package manager bun', () => {
'--ts', '--ts',
'--app', '--app',
'--use-bun', '--use-bun',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -67,7 +67,7 @@ describe('create-next-app with package manager bun', () => { ...@@ -67,7 +67,7 @@ describe('create-next-app with package manager bun', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
......
...@@ -33,7 +33,7 @@ describe('create-next-app with package manager npm', () => { ...@@ -33,7 +33,7 @@ describe('create-next-app with package manager npm', () => {
'--ts', '--ts',
'--app', '--app',
'--use-npm', '--use-npm',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -62,7 +62,7 @@ describe('create-next-app with package manager npm', () => { ...@@ -62,7 +62,7 @@ describe('create-next-app with package manager npm', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
......
...@@ -33,7 +33,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -33,7 +33,7 @@ describe('create-next-app with package manager pnpm', () => {
'--ts', '--ts',
'--app', '--app',
'--use-pnpm', '--use-pnpm',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -62,7 +62,7 @@ describe('create-next-app with package manager pnpm', () => { ...@@ -62,7 +62,7 @@ describe('create-next-app with package manager pnpm', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
......
...@@ -41,7 +41,7 @@ describe('create-next-app with package manager yarn', () => { ...@@ -41,7 +41,7 @@ describe('create-next-app with package manager yarn', () => {
'--ts', '--ts',
'--app', '--app',
'--use-yarn', '--use-yarn',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -70,7 +70,7 @@ describe('create-next-app with package manager yarn', () => { ...@@ -70,7 +70,7 @@ describe('create-next-app with package manager yarn', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--no-eslint', '--no-eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
......
...@@ -25,7 +25,7 @@ describe('create-next-app prompts', () => { ...@@ -25,7 +25,7 @@ describe('create-next-app prompts', () => {
'--ts', '--ts',
'--app', '--app',
'--eslint', '--eslint',
'--no-turbo', '--no-turbopack',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
...@@ -64,7 +64,7 @@ describe('create-next-app prompts', () => { ...@@ -64,7 +64,7 @@ describe('create-next-app prompts', () => {
projectName, projectName,
'--app', '--app',
'--eslint', '--eslint',
'--no-turbo', '--no-turbopack',
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
...@@ -101,7 +101,7 @@ describe('create-next-app prompts', () => { ...@@ -101,7 +101,7 @@ describe('create-next-app prompts', () => {
'--ts', '--ts',
'--app', '--app',
'--eslint', '--eslint',
'--no-turbo', '--no-turbopack',
'--no-src-dir', '--no-src-dir',
'--no-import-alias', '--no-import-alias',
], ],
...@@ -137,7 +137,7 @@ describe('create-next-app prompts', () => { ...@@ -137,7 +137,7 @@ describe('create-next-app prompts', () => {
'--ts', '--ts',
'--app', '--app',
'--eslint', '--eslint',
'--no-turbo', '--no-turbopack',
'--no-tailwind', '--no-tailwind',
'--no-src-dir', '--no-src-dir',
], ],
......
...@@ -30,7 +30,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -30,7 +30,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--js', '--js',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -59,7 +59,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -59,7 +59,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -86,7 +86,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -86,7 +86,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -122,7 +122,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -122,7 +122,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--tailwind', '--tailwind',
...@@ -157,7 +157,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -157,7 +157,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--empty', '--empty',
...@@ -195,7 +195,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -195,7 +195,7 @@ describe('create-next-app --app (App Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--app', '--app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--tailwind', '--tailwind',
...@@ -225,7 +225,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -225,7 +225,7 @@ describe('create-next-app --app (App Router)', () => {
}) })
}) })
it('should enable turbopack dev with --turbo flag', async () => { it('should enable turbopack dev with --turbopack flag', async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'app-turbo' const projectName = 'app-turbo'
const { exitCode } = await run( const { exitCode } = await run(
...@@ -234,7 +234,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -234,7 +234,7 @@ describe('create-next-app --app (App Router)', () => {
'--ts', '--ts',
'--app', '--app',
'--eslint', '--eslint',
'--turbo', '--turbopack',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
...@@ -248,7 +248,7 @@ describe('create-next-app --app (App Router)', () => { ...@@ -248,7 +248,7 @@ describe('create-next-app --app (App Router)', () => {
expect(exitCode).toBe(0) expect(exitCode).toBe(0)
const projectRoot = join(cwd, projectName) const projectRoot = join(cwd, projectName)
const pkgJson = require(join(projectRoot, 'package.json')) const pkgJson = require(join(projectRoot, 'package.json'))
expect(pkgJson.scripts.dev).toBe('next dev --turbo') expect(pkgJson.scripts.dev).toBe('next dev --turbopack')
}) })
}) })
}) })
...@@ -21,7 +21,7 @@ describe.each(['app', 'pages'] as const)( ...@@ -21,7 +21,7 @@ describe.each(['app', 'pages'] as const)(
const allFlagValues = { const allFlagValues = {
app: [isApp ? '--app' : '--no-app'], app: [isApp ? '--app' : '--no-app'],
turbo: [process.env.TURBOPACK ? '--turbo' : '--no-turbo'], turbo: [process.env.TURBOPACK ? '--turbopack' : '--no-turbopack'],
ts: ['--js', '--ts'], ts: ['--js', '--ts'],
importAlias: [ importAlias: [
......
...@@ -30,7 +30,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -30,7 +30,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--js', '--js',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -64,7 +64,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -64,7 +64,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -95,7 +95,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -95,7 +95,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -130,7 +130,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -130,7 +130,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--tailwind', '--tailwind',
...@@ -166,7 +166,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -166,7 +166,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--no-tailwind', '--no-tailwind',
...@@ -205,7 +205,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -205,7 +205,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
projectName, projectName,
'--ts', '--ts',
'--no-app', '--no-app',
'--no-turbo', '--no-turbopack',
'--eslint', '--eslint',
'--src-dir', '--src-dir',
'--tailwind', '--tailwind',
...@@ -236,7 +236,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -236,7 +236,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
}) })
}) })
it('should enable turbopack dev with --turbo flag', async () => { it('should enable turbopack dev with --turbopack flag', async () => {
await useTempDir(async (cwd) => { await useTempDir(async (cwd) => {
const projectName = 'pages-turbo' const projectName = 'pages-turbo'
const { exitCode } = await run( const { exitCode } = await run(
...@@ -245,7 +245,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -245,7 +245,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
'--ts', '--ts',
'--no-app', '--no-app',
'--eslint', '--eslint',
'--turbo', '--turbopack',
'--no-src-dir', '--no-src-dir',
'--no-tailwind', '--no-tailwind',
'--no-import-alias', '--no-import-alias',
...@@ -259,7 +259,7 @@ describe('create-next-app --no-app (Pages Router)', () => { ...@@ -259,7 +259,7 @@ describe('create-next-app --no-app (Pages Router)', () => {
expect(exitCode).toBe(0) expect(exitCode).toBe(0)
const projectRoot = join(cwd, projectName) const projectRoot = join(cwd, projectName)
const pkgJson = require(join(projectRoot, 'package.json')) const pkgJson = require(join(projectRoot, 'package.json'))
expect(pkgJson.scripts.dev).toBe('next dev --turbo') expect(pkgJson.scripts.dev).toBe('next dev --turbopack')
}) })
}) })
}) })
...@@ -26,7 +26,7 @@ describe('turbopack unsupported features log', () => { ...@@ -26,7 +26,7 @@ describe('turbopack unsupported features log', () => {
try { try {
expect(await renderViaHTTP(appPort, '/')).toContain('hello world') expect(await renderViaHTTP(appPort, '/')).toContain('hello world')
expect(output).toContain('(turbo)') expect(output).toContain('(Turbopack)')
expect(output).not.toContain( expect(output).not.toContain(
'You are using configuration and/or tools that are not yet' 'You are using configuration and/or tools that are not yet'
) )
...@@ -50,7 +50,7 @@ describe('turbopack unsupported features log', () => { ...@@ -50,7 +50,7 @@ describe('turbopack unsupported features log', () => {
}) })
try { try {
expect(output).toContain('(turbo)') expect(output).toContain('(Turbopack)')
expect(output).not.toContain( expect(output).not.toContain(
'You are using configuration and/or tools that are not yet' 'You are using configuration and/or tools that are not yet'
) )
...@@ -84,7 +84,7 @@ describe('turbopack unsupported features log', () => { ...@@ -84,7 +84,7 @@ describe('turbopack unsupported features log', () => {
try { try {
await check(() => { await check(() => {
expect(output).toContain('(turbo)') expect(output).toContain('(Turbopack)')
expect(output).toContain( expect(output).toContain(
'You are using configuration and/or tools that are not yet' 'You are using configuration and/or tools that are not yet'
) )
......
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