diff --git a/lib/app/pages/index.vue b/lib/app/pages/index.vue index b308055207..7fec99cfa0 100644 --- a/lib/app/pages/index.vue +++ b/lib/app/pages/index.vue @@ -14,6 +14,7 @@ Get Started +

Please create the pages directory to suppress this default page.

@@ -66,6 +67,18 @@ word-spacing: 5px; } + .Landscape__Page__Explanation { + font-family: "Quicksand", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + color: #35495e; + margin: 16px 0 0; + font-size: 16px; + } + + .Landscape__Page__Explanation > a { + color: #3b8070; + text-decoration: underline; + } + @media (min-width: 992px) { .Landscape__Title { font-size: 60px; diff --git a/lib/builder/builder.js b/lib/builder/builder.js index bafaccfa7d..d04522a527 100644 --- a/lib/builder/builder.js +++ b/lib/builder/builder.js @@ -133,6 +133,12 @@ export default class Builder { ) } else { this._defaultPage = true + consola.warn({ + message: `No \`${this.options.dir.pages}\` directory found in ${dir}.`, + additional: 'Using the default built-in page.\n', + additionalStyle: 'yellowBright', + badge: true + }) } } } diff --git a/test/fixtures/missing-pages-dir/missing-pages-dir.test.js b/test/fixtures/missing-pages-dir/missing-pages-dir.test.js new file mode 100644 index 0000000000..8a1fe1b5f5 --- /dev/null +++ b/test/fixtures/missing-pages-dir/missing-pages-dir.test.js @@ -0,0 +1,17 @@ +import consola from 'consola' +import { buildFixture } from '../../utils/build' + +describe('missing-pages-dir', () => { + buildFixture('missing-pages-dir', (builder) => { + const options = builder.nuxt.options + expect(consola.warn).toHaveBeenCalledTimes(1) + expect(consola.warn.mock.calls).toMatchObject([ + [{ + message: `No \`${options.dir.pages}\` directory found in ${options.srcDir}.`, + additional: 'Using the default built-in page.\n', + additionalStyle: 'yellowBright', + badge: true + }] + ]) + }) +}) diff --git a/test/unit/nuxt.test.js b/test/unit/nuxt.test.js index fbaebc7c65..992ce269b4 100644 --- a/test/unit/nuxt.test.js +++ b/test/unit/nuxt.test.js @@ -40,6 +40,7 @@ describe('nuxt', () => { const { html } = await nuxt.renderRoute('/') expect(html.includes('Universal Vue.js Applications')).toBe(true) + expect(/Landscape__Page__Explanation/.test(html)).toBe(true) await nuxt.close() })