Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish auto create layout warning color #57190

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/next/src/build/webpack/loaders/next-app-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from 'path'
import { stringify } from 'querystring'
import { bold } from '../../../lib/picocolors'
import { getModuleBuildInfo } from './get-module-build-info'
import { verifyRootLayout } from '../../../lib/verifyRootLayout'
import { verifyRootLayout } from '../../../lib/verify-root-layout'
import * as Log from '../../output/log'
import { APP_DIR_ALIAS, WEBPACK_RESOURCE_QUERIES } from '../../../lib/constants'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'path'
import * as Log from '../build/output/log'
import { promises as fs } from 'fs'
import { bold, green } from './picocolors'
import { bold } from './picocolors'
import { APP_DIR_ALIAS } from './constants'

const globOrig =
Expand Down Expand Up @@ -123,14 +124,12 @@ export async function verifyRootLayout({
)
await fs.writeFile(rootLayoutPath, getRootLayout(hasTsConfig))

console.log(
green(
`\nYour page ${bold(
`app/${normalizedPagePath}`
)} did not have a root layout. We created ${bold(
`app${rootLayoutPath.replace(appDir, '')}`
)} for you.`
) + '\n'
Log.warn(
`Your page ${bold(
`app/${normalizedPagePath}`
)} did not have a root layout. We created ${bold(
`app${rootLayoutPath.replace(appDir, '')}`
)} for you.`
)

// Created root layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ describe('app-dir create root layout', () => {
path.join(__dirname, 'next.config.js')
),
},
dependencies: {
react: 'latest',
'react-dom': 'latest',
},
})
})
afterAll(() => next.destroy())
Expand Down