Skip to content

Commit

Permalink
fix comma splice in verifyRootLayout.ts (#42324)
Browse files Browse the repository at this point in the history
The phrase "Your page X did not have a root layout, we created Y for
you." creates a [comma
splice](https://en.wikipedia.org/wiki/Comma_splice). This PR fixes it.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
hughlilly and ijjk committed Nov 10, 2022
1 parent 101a70b commit 031ed55
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/next/lib/verifyRootLayout.ts
Expand Up @@ -138,7 +138,7 @@ export async function verifyRootLayout({
chalk.green(
`\nYour page ${chalk.bold(
`app/${normalizedPagePath}`
)} did not have a root layout, we created ${chalk.bold(
)} did not have a root layout. We created ${chalk.bold(
`app${rootLayoutPath.replace(appDir, '')}`
)}${
!hasHead
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/app-dir/create-root-layout.test.ts
Expand Up @@ -50,7 +50,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/
)
expect(next.cliOutput.slice(outputIndex)).toMatch(
'Your page app/route/page.js did not have a root layout, we created app/layout.js and app/head.js for you.'
'Your page app/route/page.js did not have a root layout. We created app/layout.js and app/head.js for you.'
)

expect(await next.readFile('app/layout.js')).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -112,7 +112,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/
)
expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/(group)/page.js did not have a root layout, we created app/(group)/layout.js and app/(group)/head.js for you.'
'Your page app/(group)/page.js did not have a root layout. We created app/(group)/layout.js and app/(group)/head.js for you.'
)

expect(await next.readFile('app/(group)/layout.js'))
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/
)
expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/(group)/route/second/inner/page.js did not have a root layout, we created app/(group)/route/second/layout.js and app/(group)/route/second/head.js for you.'
'Your page app/(group)/route/second/inner/page.js did not have a root layout. We created app/(group)/route/second/layout.js and app/(group)/route/second/head.js for you.'
)

expect(await next.readFile('app/(group)/route/second/layout.js'))
Expand Down Expand Up @@ -247,7 +247,7 @@ describe('app-dir create root layout', () => {
/did not have a root layout/
)
expect(next.cliOutput.slice(outputIndex)).toInclude(
'Your page app/page.tsx did not have a root layout, we created app/layout.tsx and app/head.tsx for you.'
'Your page app/page.tsx did not have a root layout. We created app/layout.tsx and app/head.tsx for you.'
)

expect(await next.readFile('app/layout.tsx')).toMatchInlineSnapshot(`
Expand Down

0 comments on commit 031ed55

Please sign in to comment.