ci: typecheck code samples in docs (#25777)

This commit is contained in:
Anthony Fu 2024-02-15 11:07:39 +01:00 committed by GitHub
parent 1901cb1c68
commit 3f882c95f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 1097 additions and 2 deletions

View File

@ -134,6 +134,9 @@ jobs:
env:
MODULE_RESOLUTION: ${{ matrix.module }}
- name: Typecheck (docs)
run: pnpm typecheck:docs
lint:
# autofix workflow will be triggered instead for PRs
if: github.event_name == 'push'

View File

@ -32,3 +32,9 @@ jobs:
- name: Lint (docs)
run: pnpm lint:docs
- name: Build Nuxt
run: pnpm build
- name: Typecheck (docs)
run: pnpm typecheck:docs

View File

@ -1 +1,3 @@
telemetry.enabled=false
# For pnpm typecheck:docs to generate correct types
pages=true

View File

@ -327,6 +327,7 @@ definePageMeta({
mode: 'out-in'
},
middleware (to, from) {
if (to.meta.pageTransition && typeof to.meta.pageTransition !== 'boolean')
to.meta.pageTransition.name = +to.params.id > +from.params.id ? 'slide-left' : 'slide-right'
}
})

View File

@ -29,7 +29,8 @@
"test:runtime": "vitest -c vitest.nuxt.config.ts --coverage",
"test:types": "pnpm --filter './test/fixtures/**' test:types",
"test:unit": "vitest run packages/ --coverage",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"typecheck:docs": "nuxi prepare && nuxt-content-twoslash verify --content-dir docs"
},
"resolutions": {
"@nuxt/kit": "workspace:*",
@ -71,6 +72,7 @@
"nitropack": "2.8.1",
"nuxi": "3.10.1",
"nuxt": "workspace:*",
"nuxt-content-twoslash": "^0.0.4",
"ofetch": "1.3.3",
"pathe": "1.1.2",
"playwright-core": "1.41.2",

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url'
const testWithInlineVue = process.env.EXTERNAL_VUE === 'false'
export default defineNuxtConfig({
pages: false,
experimental: {
externalVue: !testWithInlineVue
},

View File

@ -10,6 +10,7 @@ export default defineVitestConfig({
environmentOptions: {
nuxt: {
overrides: {
pages: false,
appConfig: {
nuxt: {
buildId: 'override'