Skip to content

Commit d72d9e8

Browse files
authored
Merge branch 'main' into refactor/_nuxt_island
2 parents fcfef40 + 6abda6e commit d72d9e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1682
-821
lines changed

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: 'Checkout Repository'
2020
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
22+
uses: actions/dependency-review-action@ce3cf9537a52e8119d91fd484ab5b8a807627bf8 # v4.6.0

.github/workflows/docs-check-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030

3131
- name: Lychee link checker
32-
uses: lycheeverse/lychee-action@a99389aeff3c193ffb6f0741178e519569d3f404 # for v1.8.0
32+
uses: lycheeverse/lychee-action@6f793a7135344461673eecb342c75f3f110f5ebd # for v1.8.0
3333
with:
3434
# arguments with file types to check
3535
args: >-

.github/workflows/semantic-pull-requests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
2424
with:
2525
scopes: |
26+
docs
2627
kit
2728
nuxi
2829
nuxt

docs/2.guide/1.concepts/8.typescript.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ Some of the references in the file are to files that are only generated within y
5959

6060
This file contains the recommended basic TypeScript configuration for your project, including resolved aliases injected by Nuxt or modules you are using, so you can get full type support and path auto-complete for aliases like `~/file` or `#build/file`.
6161

62+
::note
63+
Consider using the `imports` section of [nuxt.config](/docs/api/nuxt-config#imports) to include directories beyond the default ones. This can be useful for auto-importing types which you're using across your app.
64+
::
65+
6266
[Read more about how to extend this configuration](/docs/guide/directory-structure/tsconfig).
6367

6468
::tip{icon="i-lucide-video" to="https://youtu.be/umLI7SlPygY" target="_blank"}

docs/2.guide/2.directory-structure/3.app.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ head.title: "app.vue"
55
navigation.icon: i-lucide-file
66
---
77

8-
## Minimal Usage
8+
::tip
9+
If you have a `pages/` directory, the `app.vue` file is optional. Nuxt will automatically include a default `app.vue`, but you can still add your own to customize the structure and content as needed.
10+
::
11+
12+
## Usage
13+
14+
### Minimal Usage
915

10-
With Nuxt, the [`pages/`](/docs/guide/directory-structure/pages) directory is optional. If not present, Nuxt won't include [vue-router](https://router.vuejs.org) dependency. This is useful when working on a landing page or an application that does not need routing.
16+
With Nuxt, the [`pages/`](/docs/guide/directory-structure/pages) directory is optional. If it is not present, Nuxt will not include the [vue-router](https://router.vuejs.org) dependency. This is useful when building a landing page or an application that does not require routing.
1117

1218
```vue [app.vue]
1319
<template>
@@ -17,28 +23,50 @@ With Nuxt, the [`pages/`](/docs/guide/directory-structure/pages) directory is op
1723

1824
:link-example{to="/docs/examples/hello-world"}
1925

20-
## Usage with Pages
26+
### Usage with Pages
2127

22-
If you have a [`pages/`](/docs/guide/directory-structure/pages) directory, to display the current page, use the [`<NuxtPage>`](/docs/api/components/nuxt-page) component:
28+
When you have a [`pages/`](/docs/guide/directory-structure/pages) directory, you need to use the [`<NuxtPage>`](/docs/api/components/nuxt-page) component to display the current page:
2329

2430
```vue [app.vue]
2531
<template>
26-
<div>
27-
<NuxtLayout>
28-
<NuxtPage/>
29-
</NuxtLayout>
30-
</div>
32+
<NuxtPage />
3133
</template>
3234
```
3335

34-
::warning
35-
Since [`<NuxtPage>`](/docs/api/components/nuxt-page) internally uses Vue's [`<Suspense>`](https://vuejs.org/guide/built-ins/suspense.html#suspense) component, it cannot be set as a root element.
36-
::
36+
You can also define the common structure of your application directly in `app.vue`. This is useful when you want to include global elements such as a header or footer:
37+
38+
```vue [app.vue]
39+
<template>
40+
<header>
41+
Header content
42+
</header>
43+
<NuxtPage />
44+
<footer>
45+
Footer content
46+
</footer>
47+
</template>
48+
```
3749

3850
::note
3951
Remember that `app.vue` acts as the main component of your Nuxt application. Anything you add to it (JS and CSS) will be global and included in every page.
4052
::
4153

54+
::read-more{to="/docs/guide/directory-structure/pages"}
55+
Learn more about how to structure your pages using the `pages/` directory.
56+
::
57+
58+
### Usage with Layouts
59+
60+
When your application requires different layouts for different pages, you can use the `layouts/` directory with the [`<NuxtLayout>`](/docs/api/components/nuxt-layout) component. This allows you to define multiple layouts and apply them per page.
61+
62+
```vue [app.vue]
63+
<template>
64+
<NuxtLayout>
65+
<NuxtPage />
66+
</NuxtLayout>
67+
</template>
68+
```
69+
4270
::read-more{to="/docs/guide/directory-structure/layouts"}
43-
If you want to have the possibility to customize the structure around the page between pages, check out the `layouts/` directory.
71+
Learn more about how to structure your layouts using the `layouts/` directory.
4472
::

docs/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@nuxt/docs",
3+
"version": "4.0.0-0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/nuxt/nuxt.git",
7+
"directory": "docs"
8+
},
9+
"homepage": "https://nuxt.com",
10+
"description": "Documentation for Nuxt in raw markdown",
11+
"license": "MIT",
12+
"type": "module",
13+
"exports": {
14+
"./*": "./*"
15+
},
16+
"files": [
17+
"**/*.md",
18+
"**/*.yml"
19+
]
20+
}

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
"resolutions": {
4545
"@babel/core": "7.26.10",
4646
"@babel/helper-plugin-utils": "7.26.5",
47-
"@nuxt/cli": "3.23.1",
47+
"@nuxt/cli": "3.24.0",
4848
"@nuxt/kit": "workspace:*",
4949
"@nuxt/rspack-builder": "workspace:*",
5050
"@nuxt/schema": "workspace:*",
5151
"@nuxt/vite-builder": "workspace:*",
5252
"@nuxt/webpack-builder": "workspace:*",
53-
"@types/node": "22.13.14",
54-
"@unhead/vue": "2.0.2",
53+
"@types/node": "22.14.0",
54+
"@unhead/vue": "2.0.3",
5555
"@vue/compiler-core": "3.5.13",
5656
"@vue/compiler-dom": "3.5.13",
5757
"@vue/shared": "3.5.13",
@@ -62,22 +62,22 @@
6262
"nitro": "npm:[email protected]",
6363
"nuxt": "workspace:*",
6464
"postcss": "8.5.3",
65-
"rollup": "4.37.0",
65+
"rollup": "4.39.0",
6666
"send": ">=1.2.0",
6767
"typescript": "5.8.2",
6868
"ufo": "1.5.4",
6969
"unbuild": "3.5.0",
7070
"unimport": "4.1.3",
71-
"vite": "6.2.3",
71+
"vite": "6.2.4",
7272
"vue": "3.5.13"
7373
},
7474
"devDependencies": {
7575
"@arethetypeswrong/cli": "0.17.4",
7676
"@babel/core": "7.26.10",
7777
"@babel/helper-plugin-utils": "7.26.5",
7878
"@codspeed/vitest-plugin": "4.0.1",
79-
"@nuxt/cli": "3.23.1",
80-
"@nuxt/eslint-config": "1.2.0",
79+
"@nuxt/cli": "3.24.0",
80+
"@nuxt/eslint-config": "1.3.0",
8181
"@nuxt/kit": "workspace:*",
8282
"@nuxt/rspack-builder": "workspace:*",
8383
"@nuxt/test-utils": "3.17.2",
@@ -86,14 +86,14 @@
8686
"@testing-library/vue": "8.1.0",
8787
"@types/babel__core": "7.20.5",
8888
"@types/babel__helper-plugin-utils": "7.10.3",
89-
"@types/node": "22.13.14",
89+
"@types/node": "22.14.0",
9090
"@types/semver": "7.7.0",
91-
"@unhead/vue": "2.0.2",
92-
"@vitest/coverage-v8": "3.0.9",
91+
"@unhead/vue": "2.0.3",
92+
"@vitest/coverage-v8": "3.1.1",
9393
"@vue/test-utils": "2.4.6",
9494
"acorn": "8.14.1",
9595
"autoprefixer": "10.4.21",
96-
"case-police": "1.0.0",
96+
"case-police": "2.0.0",
9797
"changelogen": "0.6.1",
9898
"consola": "3.4.2",
9999
"cssnano": "7.0.6",
@@ -102,15 +102,15 @@
102102
"devalue": "5.1.1",
103103
"eslint": "9.23.0",
104104
"eslint-plugin-no-only-tests": "3.3.0",
105-
"eslint-plugin-perfectionist": "4.10.1",
105+
"eslint-plugin-perfectionist": "4.11.0",
106106
"eslint-typegen": "2.1.0",
107107
"estree-walker": "3.0.3",
108108
"get-port-please": "3.1.2",
109109
"h3": "1.15.1",
110110
"happy-dom": "17.4.4",
111111
"installed-check": "9.3.0",
112112
"jiti": "2.4.2",
113-
"knip": "5.46.2",
113+
"knip": "5.46.5",
114114
"magic-string": "0.30.17",
115115
"markdownlint-cli": "0.44.0",
116116
"memfs": "4.17.0",
@@ -119,25 +119,25 @@
119119
"nuxt-content-twoslash": "0.1.2",
120120
"ofetch": "1.4.1",
121121
"pathe": "2.0.3",
122-
"pkg-pr-new": "0.0.41",
122+
"pkg-pr-new": "0.0.42",
123123
"playwright-core": "1.51.1",
124-
"rollup": "4.37.0",
124+
"rollup": "4.39.0",
125125
"semver": "7.7.1",
126126
"sherif": "1.4.0",
127-
"srvx": "0.2.6",
127+
"srvx": "0.2.7",
128128
"std-env": "3.8.1",
129129
"tinyexec": "1.0.1",
130130
"tinyglobby": "0.2.12",
131131
"ts-blank-space": "0.6.1",
132132
"typescript": "5.8.2",
133133
"ufo": "1.5.4",
134134
"unbuild": "3.5.0",
135-
"vitest": "3.0.9",
135+
"vitest": "3.1.1",
136136
"vitest-environment-nuxt": "1.0.1",
137137
"vue": "3.5.13",
138138
"vue-tsc": "2.2.8",
139139
"webpack": "5.98.0"
140140
},
141-
"packageManager": "[email protected].0",
141+
"packageManager": "[email protected].1",
142142
"version": ""
143143
}

packages/kit/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@
5151
},
5252
"devDependencies": {
5353
"@nuxt/schema": "workspace:*",
54-
"@rspack/core": "1.3.0",
54+
"@rspack/core": "1.3.1",
5555
"@types/semver": "7.7.0",
5656
"nitro": "npm:[email protected]",
5757
"unbuild": "3.5.0",
58-
"vite": "6.2.3",
59-
"vitest": "3.0.9",
58+
"vite": "6.2.4",
59+
"vitest": "3.1.1",
6060
"webpack": "5.98.0"
6161
},
6262
"engines": {

packages/kit/src/loader/config.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { ConfigLayer, ConfigLayerMeta, LoadConfigOptions } from 'c12'
66
import { loadConfig } from 'c12'
77
import type { NuxtConfig, NuxtOptions } from '@nuxt/schema'
88
import { globby } from 'globby'
9-
import defu from 'defu'
9+
import defu, { createDefu } from 'defu'
1010
import { basename, join, relative } from 'pathe'
1111
import { resolveModuleURL } from 'exsolve'
1212

@@ -17,22 +17,31 @@ export interface LoadNuxtConfigOptions extends Omit<LoadConfigOptions<NuxtConfig
1717
overrides?: Exclude<LoadConfigOptions<NuxtConfig>['overrides'], Promise<any> | Function>
1818
}
1919

20+
const merger = createDefu((obj, key, value) => {
21+
if (Array.isArray(obj[key]) && Array.isArray(value)) {
22+
obj[key] = obj[key].concat(value)
23+
return true
24+
}
25+
})
26+
2027
export async function loadNuxtConfig (opts: LoadNuxtConfigOptions): Promise<NuxtOptions> {
2128
// Automatically detect and import layers from `~~/layers/` directory
2229
const localLayers = await globby('layers/*', { onlyDirectories: true, cwd: opts.cwd || process.cwd() })
23-
opts.overrides = defu(opts.overrides, { _extends: localLayers });
30+
opts.overrides = defu(opts.overrides, { _extends: localLayers })
2431

25-
(globalThis as any).defineNuxtConfig = (c: any) => c
32+
const globalSelf = globalThis as any
33+
globalSelf.defineNuxtConfig = (c: any) => c
2634
const { configFile, layers = [], cwd, config: nuxtConfig, meta } = await loadConfig<NuxtConfig>({
2735
name: 'nuxt',
2836
configFile: 'nuxt.config',
2937
rcFile: '.nuxtrc',
30-
extend: { extendKey: ['theme', 'extends', '_extends'] },
38+
extend: { extendKey: ['theme', '_extends', 'extends'] },
3139
dotenv: true,
3240
globalRc: true,
41+
merger: merger as any, // TODO: fix type in c12, it should accept createDefu directly
3342
...opts,
3443
})
35-
delete (globalThis as any).defineNuxtConfig
44+
delete globalSelf.defineNuxtConfig
3645

3746
// Fill config
3847
nuxtConfig.rootDir ||= cwd

packages/nuxt/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868
"test:attw": "attw --pack"
6969
},
7070
"dependencies": {
71-
"@nuxt/cli": "^3.23.1",
71+
"@nuxt/cli": "^3.24.0",
7272
"@nuxt/devalue": "^2.0.2",
7373
"@nuxt/devtools": "^2.3.2",
7474
"@nuxt/kit": "workspace:*",
7575
"@nuxt/schema": "workspace:*",
7676
"@nuxt/telemetry": "^2.6.6",
7777
"@nuxt/vite-builder": "workspace:*",
7878
"@oxc-parser/wasm": "^0.60.0",
79-
"@unhead/vue": "^2.0.2",
79+
"@unhead/vue": "^2.0.3",
8080
"@vue/shared": "^3.5.13",
8181
"c12": "^3.0.2",
8282
"chokidar": "^4.0.3",
@@ -87,7 +87,7 @@
8787
"destr": "^2.0.3",
8888
"devalue": "^5.1.1",
8989
"errx": "^0.1.0",
90-
"esbuild": "^0.25.1",
90+
"esbuild": "^0.25.2",
9191
"escape-string-regexp": "^5.0.0",
9292
"estree-walker": "^3.0.3",
9393
"exsolve": "^1.0.4",
@@ -140,8 +140,8 @@
140140
"@vitejs/plugin-vue-jsx": "4.1.2",
141141
"@vue/compiler-sfc": "3.5.13",
142142
"unbuild": "3.5.0",
143-
"vite": "6.2.3",
144-
"vitest": "3.0.9"
143+
"vite": "6.2.4",
144+
"vitest": "3.1.1"
145145
},
146146
"peerDependencies": {
147147
"@parcel/watcher": "^2.1.0",

0 commit comments

Comments
 (0)