diff --git a/package.json b/package.json index ce31f6262b..99a3cc8959 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,8 @@ "object-hash": "^2.2.0", "pathe": "^0.2.0", "typescript": "^4.4.3", - "unbuild": "^0.5.6" + "unbuild": "^0.5.6", + "vue-router": "next" }, "packageManager": "yarn@3.0.2" } diff --git a/packages/nitro/package.json b/packages/nitro/package.json index 44c80a5699..96be52d6f6 100644 --- a/packages/nitro/package.json +++ b/packages/nitro/package.json @@ -15,7 +15,7 @@ "dependencies": { "@cloudflare/kv-asset-handler": "^0.1.3", "@netlify/functions": "^0.7.2", - "@nuxt/design": "0.1.1", + "@nuxt/design": "0.1.3", "@nuxt/devalue": "^2.0.0", "@nuxt/kit": "3.0.0", "@rollup/plugin-alias": "^3.1.5", diff --git a/packages/nuxi/package.json b/packages/nuxi/package.json index 718fa7f72b..504b087a31 100644 --- a/packages/nuxi/package.json +++ b/packages/nuxi/package.json @@ -23,7 +23,7 @@ "fsevents": "~2.3.2" }, "devDependencies": { - "@nuxt/design": "0.1.1", + "@nuxt/design": "0.1.3", "@nuxt/kit": "3.0.0", "@types/clear": "^0", "@types/debounce-promise": "^3", diff --git a/packages/nuxt3/package.json b/packages/nuxt3/package.json index 943a642eba..ce511437bf 100644 --- a/packages/nuxt3/package.json +++ b/packages/nuxt3/package.json @@ -18,6 +18,7 @@ "prepack": "unbuild" }, "dependencies": { + "@nuxt/design": "^0.1.3", "@nuxt/kit": "3.0.0", "@nuxt/nitro": "3.0.0", "@nuxt/vite-builder": "3.0.0", diff --git a/packages/nuxt3/src/app/app.tutorial.vue b/packages/nuxt3/src/app/app.tutorial.vue deleted file mode 100644 index b2797453f9..0000000000 --- a/packages/nuxt3/src/app/app.tutorial.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - Documentation - - - - - We highly recommend you take a look at the Nuxt documentation, whether you are new or have previous experience with the framework. - - - - - - - - Twitter - - - - - Follow the Nuxt Twitter account to get latest news about releases, new modules, tutorials and tips. - @nuxt_js - - - - - - - To remove this welcome page, you have 2 options: - - Create an app.vue - Create a pages/index.vue - - - - - diff --git a/packages/nuxt3/src/app/components/nuxt-welcome.vue b/packages/nuxt3/src/app/components/nuxt-welcome.vue new file mode 100644 index 0000000000..d0c6f389cf --- /dev/null +++ b/packages/nuxt3/src/app/components/nuxt-welcome.vue @@ -0,0 +1,9 @@ + + + + + + diff --git a/packages/nuxt3/src/app/nuxt.ts b/packages/nuxt3/src/app/nuxt.ts index a4f3eeb251..fc3bbe1478 100644 --- a/packages/nuxt3/src/app/nuxt.ts +++ b/packages/nuxt3/src/app/nuxt.ts @@ -1,5 +1,5 @@ /* eslint-disable no-use-before-define */ -import { getCurrentInstance, reactive } from 'vue' +import { getCurrentInstance, reactive, defineAsyncComponent } from 'vue' import type { App, VNode } from 'vue' import { createHooks, Hookable } from 'hookable' import { defineGetter } from './utils' @@ -100,6 +100,11 @@ export function createNuxtApp (options: CreateOptions) { nuxt.ssrContext.nuxt = nuxt } + // (temporary) Expose NuxtWelcome component in dev + if (process.dev) { + nuxt.app.component('NuxtWelcome', defineAsyncComponent(() => import('./components/nuxt-welcome.vue'))) + } + if (process.server) { // Expose to server renderer to create window.__NUXT__ nuxt.ssrContext = nuxt.ssrContext || {} diff --git a/packages/nuxt3/src/core/app.ts b/packages/nuxt3/src/core/app.ts index 2a027f369d..0e54fb76ec 100644 --- a/packages/nuxt3/src/core/app.ts +++ b/packages/nuxt3/src/core/app.ts @@ -63,7 +63,7 @@ export async function resolveApp (nuxt: Nuxt, app: NuxtApp) { app.main = tryResolvePath('~/App', resolveOptions) || tryResolvePath('~/app', resolveOptions) } if (!app.main) { - app.main = resolve(nuxt.options.appDir, 'app.tutorial.vue') + app.main = resolve(nuxt.options.appDir, 'components/nuxt-welcome.vue') } // Resolve plugins diff --git a/packages/nuxt3/src/pages/module.ts b/packages/nuxt3/src/pages/module.ts index 6e22231d03..571141e6cc 100644 --- a/packages/nuxt3/src/pages/module.ts +++ b/packages/nuxt3/src/pages/module.ts @@ -25,7 +25,7 @@ export default defineNuxtModule({ // Add default layout for pages nuxt.hook('app:resolve', (app) => { - if (app.main.includes('app.tutorial')) { + if (app.main.includes('nuxt-welcome')) { app.main = resolve(runtimeDir, 'app.vue') } }) diff --git a/yarn.lock b/yarn.lock index 4924ddbd32..257d977546 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2511,10 +2511,10 @@ __metadata: languageName: node linkType: hard -"@nuxt/design@npm:0.1.1": - version: 0.1.1 - resolution: "@nuxt/design@npm:0.1.1" - checksum: ccdcfaaae848cf36bf7fb555ff1c5715de8ee6004a26412ea156a0c2812e01ad0503b68ebb4ad23c07ec9c536199325d416410e231d060753ac212184f902b55 +"@nuxt/design@npm:0.1.3, @nuxt/design@npm:^0.1.3": + version: 0.1.3 + resolution: "@nuxt/design@npm:0.1.3" + checksum: 57f8cb6119b96eb51f12f4b643fc46bcf9879359a4d8ae4576d2f12b39876344c3cbcf13360f5844b53eef9d08367c91872520aa90256a32e2c0f028233a5269 languageName: node linkType: hard @@ -2612,7 +2612,7 @@ __metadata: dependencies: "@cloudflare/kv-asset-handler": ^0.1.3 "@netlify/functions": ^0.7.2 - "@nuxt/design": 0.1.1 + "@nuxt/design": 0.1.3 "@nuxt/devalue": ^2.0.0 "@nuxt/kit": 3.0.0 "@rollup/plugin-alias": ^3.1.5 @@ -13643,7 +13643,7 @@ fsevents@~2.3.2: version: 0.0.0-use.local resolution: "nuxi@workspace:packages/nuxi" dependencies: - "@nuxt/design": 0.1.1 + "@nuxt/design": 0.1.3 "@nuxt/kit": 3.0.0 "@types/clear": ^0 "@types/debounce-promise": ^3 @@ -13701,6 +13701,7 @@ fsevents@~2.3.2: pathe: ^0.2.0 typescript: ^4.4.3 unbuild: ^0.5.6 + vue-router: next languageName: unknown linkType: soft @@ -13737,6 +13738,7 @@ fsevents@~2.3.2: version: 0.0.0-use.local resolution: "nuxt3@workspace:packages/nuxt3" dependencies: + "@nuxt/design": ^0.1.3 "@nuxt/kit": 3.0.0 "@nuxt/nitro": 3.0.0 "@nuxt/vite-builder": 3.0.0 @@ -19349,7 +19351,7 @@ fsevents@~2.3.2: languageName: node linkType: hard -"vue-router@npm:^4.0.11": +"vue-router@npm:^4.0.11, vue-router@npm:next": version: 4.0.11 resolution: "vue-router@npm:4.0.11" dependencies:
To remove this welcome page, you have 2 options:
app.vue
pages/index.vue