Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/1.getting-started/2.installation.md
  • Loading branch information
Ivan Bochkarev committed Nov 24, 2024
2 parents 2e755ec + f68589c commit bca4534
Show file tree
Hide file tree
Showing 30 changed files with 1,215 additions and 1,210 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Initialize CodeQL
uses: github/codeql-action/init@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
uses: github/codeql-action/init@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
with:
config: |
paths:
Expand All @@ -91,7 +91,7 @@ jobs:
queries: +security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
with:
category: "/language:javascript-typescript"

Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
TEST_PAYLOAD: ${{ matrix.payload }}
SKIP_BUNDLE_SIZE: ${{ github.event_name != 'push' || matrix.env == 'dev' || matrix.builder == 'webpack' || matrix.context == 'default' || matrix.payload == 'js' || runner.os == 'Windows' }}

- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
- uses: codecov/codecov-action@015f24e6818733317a2da2edd6290ab26238649a # v5.0.7
if: github.event_name != 'push' && matrix.env == 'built' && matrix.builder == 'vite' && matrix.context == 'default' && matrix.os == 'ubuntu-latest' && matrix.manifest == 'manifest-on'
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
2 changes: 1 addition & 1 deletion .github/workflows/docs-check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Lychee link checker
uses: lycheeverse/lychee-action@5cd5ba7877bce8b3973756ae3c9474ce1e50be2f # for v1.8.0
uses: lycheeverse/lychee-action@4aa18b6ccdac05029fab067313a6a04f941e6494 # for v1.8.0
with:
# arguments with file types to check
args: >-
Expand Down
84 changes: 0 additions & 84 deletions .github/workflows/release-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@ea9e4e37992a54ee68a9622e985e60c8e8f12d9f # v3.27.4
uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5
if: github.repository == 'nuxt/nuxt' && success()
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions docs/1.getting-started/2.installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ navigation.icon: i-ph-play
<!-- markdownlint-disable-next-line MD001 -->
#### Требования

- **Node.js** - [`v18.0.0`](https://nodejs.org/en) или новее
- **Редактор кода** - Мы рекомендуем [Visual Studio Code](https://code.visualstudio.com/) с [официальным расширением Vue](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (ранее известным как Volar)
- **Node.js** - [`18.x`](https://nodejs.org/en) или более новые (но мы рекомендуем [активную LTS-версию](https://github.com/nodejs/release#release-schedule))
- **Редактор кода** - Нет требований к IDE, но мы рекомендуем [Visual Studio Code](https://code.visualstudio.com/) с [официальным расширением Vue](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (ранее известным как Volar) или [WebStorm](https://www.jetbrains.com/webstorm/), который, наряду с [другими JetBrains IDEs](https://www.jetbrains.com/ides/), предлагает отличную поддержку Nuxt прямо из коробки.
- **Терминал** - Что бы запускать команды Nuxt

::note
Expand Down
2 changes: 1 addition & 1 deletion docs/3.api/2.composables/use-seo-meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const title = ref('My title')
useSeoMeta({
title,
description: () => `description: ${title.value}`
description: () => `This is a description for the ${title.value} page`
})
</script>
```
Expand Down
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export default createConfigForNuxt({
},
},
// Sort rule keys in eslint config
// @ts-expect-error incorrect types 🤔
{
files: ['**/eslint.config.mjs'],
name: 'local/sort-eslint-config',
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,42 +40,42 @@
"@nuxt/ui-templates": "workspace:*",
"@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*",
"@types/node": "22.9.0",
"@types/node": "22.9.1",
"@unhead/dom": "1.11.11",
"@unhead/shared": "1.11.11",
"@unhead/vue": "1.11.11",
"@unhead/schema": "1.11.11",
"@unhead/ssr": "1.11.11",
"@vue/compiler-core": "3.5.12",
"@vue/compiler-dom": "3.5.12",
"@vue/shared": "3.5.12",
"@vue/compiler-core": "3.5.13",
"@vue/compiler-dom": "3.5.13",
"@vue/shared": "3.5.13",
"c12": "2.0.1",
"h3": "npm:[email protected]",
"jiti": "2.4.0",
"magic-string": "^0.30.12",
"magic-string": "^0.30.13",
"nitro": "npm:[email protected]",
"nuxt": "workspace:*",
"ohash": "1.1.4",
"postcss": "8.4.49",
"rollup": "4.26.0",
"rollup": "4.27.3",
"send": ">=1.1.0",
"typescript": "5.6.3",
"ufo": "1.5.4",
"unbuild": "3.0.0-rc.11",
"unhead": "1.11.11",
"vite": "5.4.11",
"vue": "3.5.12"
"vue": "3.5.13"
},
"devDependencies": {
"@eslint/js": "9.14.0",
"@nuxt/eslint-config": "0.6.1",
"@eslint/js": "9.15.0",
"@nuxt/eslint-config": "0.7.1",
"@nuxt/kit": "workspace:*",
"@nuxt/rspack-builder": "workspace:*",
"@nuxt/test-utils": "3.14.4",
"@nuxt/webpack-builder": "workspace:*",
"@testing-library/vue": "8.1.0",
"@types/eslint__js": "8.42.3",
"@types/node": "22.9.0",
"@types/node": "22.9.1",
"@types/semver": "7.5.8",
"@unhead/schema": "1.11.11",
"@unhead/vue": "1.11.11",
Expand All @@ -89,9 +89,9 @@
"cssnano": "7.0.6",
"destr": "2.0.3",
"devalue": "5.1.1",
"eslint": "9.14.0",
"eslint": "9.15.0",
"eslint-plugin-no-only-tests": "3.3.0",
"eslint-plugin-perfectionist": "3.9.1",
"eslint-plugin-perfectionist": "4.0.3",
"eslint-typegen": "0.3.2",
"h3": "npm:[email protected]",
"happy-dom": "15.11.6",
Expand All @@ -103,22 +103,22 @@
"nuxt-content-twoslash": "0.1.1",
"ofetch": "1.4.1",
"pathe": "1.1.2",
"playwright-core": "1.48.2",
"playwright-core": "1.49.0",
"rimraf": "6.0.1",
"semver": "7.6.3",
"sherif": "1.0.1",
"sherif": "1.0.2",
"std-env": "3.8.0",
"tinyexec": "0.3.1",
"tinyglobby": "0.2.10",
"typescript": "5.6.3",
"ufo": "1.5.4",
"vitest": "2.1.5",
"vitest-environment-nuxt": "1.0.1",
"vue": "3.5.12",
"vue": "3.5.13",
"vue-router": "4.4.5",
"vue-tsc": "2.1.10"
},
"packageManager": "pnpm@9.13.2",
"packageManager": "pnpm@9.14.2",
"engines": {
"node": "^16.10.0 || >=18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"untyped": "^1.5.1"
},
"devDependencies": {
"@rspack/core": "1.1.1",
"@rspack/core": "1.1.3",
"@types/hash-sum": "1.0.2",
"@types/semver": "7.5.8",
"nitro": "npm:[email protected]",
Expand Down
20 changes: 15 additions & 5 deletions packages/kit/src/module/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { dirname, isAbsolute, join, resolve } from 'pathe'
import { defu } from 'defu'
import { createJiti } from 'jiti'
import { resolve as resolveModule } from 'mlly'
import { isRelative } from 'ufo'
import { useNuxt } from '../context'
import { resolveAlias, resolvePath } from '../resolve'
import { logger } from '../logger'
Expand Down Expand Up @@ -78,14 +79,23 @@ export async function loadNuxtModuleInstance (nuxtModule: string | NuxtModule, n

// Import if input is string
if (typeof nuxtModule === 'string') {
const paths = [join(nuxtModule, 'nuxt'), join(nuxtModule, 'module'), nuxtModule, join(nuxt.options.rootDir, nuxtModule)]
const paths = new Set<string>()
nuxtModule = resolveAlias(nuxtModule, nuxt.options.alias)

if (isRelative(nuxtModule)) {
nuxtModule = resolve(nuxt.options.rootDir, nuxtModule)
}

paths.add(join(nuxtModule, 'nuxt'))
paths.add(join(nuxtModule, 'module'))
paths.add(nuxtModule)

for (const path of paths) {
for (const parentURL of nuxt.options.modulesDir) {
try {
const resolved = resolveAlias(path, nuxt.options.alias)
const src = isAbsolute(resolved)
? pathToFileURL(await resolvePath(resolved, { cwd: parentURL, fallbackToOriginal: false, extensions: nuxt.options.extensions })).href
: await resolveModule(resolved, { url: pathToFileURL(parentURL.replace(/\/node_modules\/?$/, '')), extensions: nuxt.options.extensions })
const src = isAbsolute(path)
? pathToFileURL(await resolvePath(path, { cwd: parentURL, fallbackToOriginal: false, extensions: nuxt.options.extensions })).href
: await resolveModule(path, { url: pathToFileURL(parentURL.replace(/\/node_modules\/?$/, '')), extensions: nuxt.options.extensions })

nuxtModule = await jiti.import(src, { default: true }) as NuxtModule

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ export function addTemplate<T> (_template: NuxtTemplate<T> | string) {
// Normalize template
const template = normalizeTemplate(_template)

// Remove any existing template with the same filename
// Remove any existing template with the same destination path
nuxt.options.build.templates = nuxt.options.build.templates
.filter(p => normalizeTemplate(p).filename !== template.filename)
.filter(p => normalizeTemplate(p).dst !== template.dst)

// Add to templates array
nuxt.options.build.templates.push(template)
Expand Down
10 changes: 5 additions & 5 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
},
"dependencies": {
"@nuxt/devalue": "^2.0.2",
"@nuxt/devtools": "^1.6.0",
"@nuxt/devtools": "^1.6.1",
"@nuxt/kit": "workspace:*",
"@nuxt/schema": "workspace:*",
"@nuxt/telemetry": "^2.6.0",
Expand All @@ -69,7 +69,7 @@
"@unhead/shared": "^1.11.11",
"@unhead/ssr": "^1.11.11",
"@unhead/vue": "^1.11.11",
"@vue/shared": "^3.5.12",
"@vue/shared": "^3.5.13",
"acorn": "8.14.0",
"c12": "^2.0.1",
"chokidar": "^4.0.1",
Expand All @@ -91,7 +91,7 @@
"jiti": "^2.4.0",
"klona": "^2.0.6",
"knitwork": "^1.1.0",
"magic-string": "^0.30.12",
"magic-string": "^0.30.13",
"mlly": "^1.7.3",
"nanotar": "^0.1.1",
"nitro": "npm:[email protected]",
Expand Down Expand Up @@ -119,7 +119,7 @@
"unplugin-vue-router": "^0.10.8",
"unstorage": "^1.13.1",
"untyped": "^1.5.1",
"vue": "^3.5.12",
"vue": "^3.5.13",
"vue-bundle-renderer": "^2.1.1",
"vue-devtools-stub": "^0.1.0",
"vue-router": "^4.4.5"
Expand All @@ -130,7 +130,7 @@
"@parcel/watcher": "2.5.0",
"@types/estree": "1.0.6",
"@vitejs/plugin-vue": "5.2.0",
"@vue/compiler-sfc": "3.5.12",
"@vue/compiler-sfc": "3.5.13",
"unbuild": "3.0.0-rc.11",
"vite": "5.4.11",
"vitest": "2.1.5"
Expand Down
8 changes: 2 additions & 6 deletions packages/nuxt/src/app/components/nuxt-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ import layouts from '#build/layouts'
// @ts-expect-error virtual file
import { appLayoutTransition as defaultLayoutTransition } from '#build/nuxt.config.mjs'

// TODO: revert back to defineAsyncComponent when https://github.com/vuejs/core/issues/6638 is resolved
const LayoutLoader = defineComponent({
name: 'LayoutLoader',
inheritAttrs: false,
props: {
name: String,
layoutProps: Object,
},
async setup (props, context) {
setup (props, context) {
// This is a deliberate hack - this component must always be called with an explicit key to ensure
// that setup reruns when the name changes.

const LayoutComponent = await layouts[props.name]().then((r: any) => r.default || r)

return () => h(LayoutComponent, props.layoutProps, context.slots)
return () => h(layouts[props.name], props.layoutProps, context.slots)
},
})

Expand Down
Loading

0 comments on commit bca4534

Please sign in to comment.