mirror of https://github.com/nuxt/nuxt.git
ci: typecheck code samples in docs (#25777)
This commit is contained in:
parent
1901cb1c68
commit
3f882c95f6
|
@ -134,6 +134,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
MODULE_RESOLUTION: ${{ matrix.module }}
|
MODULE_RESOLUTION: ${{ matrix.module }}
|
||||||
|
|
||||||
|
- name: Typecheck (docs)
|
||||||
|
run: pnpm typecheck:docs
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
# autofix workflow will be triggered instead for PRs
|
# autofix workflow will be triggered instead for PRs
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
|
|
|
@ -32,3 +32,9 @@ jobs:
|
||||||
|
|
||||||
- name: Lint (docs)
|
- name: Lint (docs)
|
||||||
run: pnpm lint:docs
|
run: pnpm lint:docs
|
||||||
|
|
||||||
|
- name: Build Nuxt
|
||||||
|
run: pnpm build
|
||||||
|
|
||||||
|
- name: Typecheck (docs)
|
||||||
|
run: pnpm typecheck:docs
|
||||||
|
|
2
.nuxtrc
2
.nuxtrc
|
@ -1 +1,3 @@
|
||||||
telemetry.enabled=false
|
telemetry.enabled=false
|
||||||
|
# For pnpm typecheck:docs to generate correct types
|
||||||
|
pages=true
|
||||||
|
|
|
@ -327,6 +327,7 @@ definePageMeta({
|
||||||
mode: 'out-in'
|
mode: 'out-in'
|
||||||
},
|
},
|
||||||
middleware (to, from) {
|
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'
|
to.meta.pageTransition.name = +to.params.id > +from.params.id ? 'slide-left' : 'slide-right'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -29,7 +29,8 @@
|
||||||
"test:runtime": "vitest -c vitest.nuxt.config.ts --coverage",
|
"test:runtime": "vitest -c vitest.nuxt.config.ts --coverage",
|
||||||
"test:types": "pnpm --filter './test/fixtures/**' test:types",
|
"test:types": "pnpm --filter './test/fixtures/**' test:types",
|
||||||
"test:unit": "vitest run packages/ --coverage",
|
"test:unit": "vitest run packages/ --coverage",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit",
|
||||||
|
"typecheck:docs": "nuxi prepare && nuxt-content-twoslash verify --content-dir docs"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@nuxt/kit": "workspace:*",
|
"@nuxt/kit": "workspace:*",
|
||||||
|
@ -71,6 +72,7 @@
|
||||||
"nitropack": "2.8.1",
|
"nitropack": "2.8.1",
|
||||||
"nuxi": "3.10.1",
|
"nuxi": "3.10.1",
|
||||||
"nuxt": "workspace:*",
|
"nuxt": "workspace:*",
|
||||||
|
"nuxt-content-twoslash": "^0.0.4",
|
||||||
"ofetch": "1.3.3",
|
"ofetch": "1.3.3",
|
||||||
"pathe": "1.1.2",
|
"pathe": "1.1.2",
|
||||||
"playwright-core": "1.41.2",
|
"playwright-core": "1.41.2",
|
||||||
|
|
1079
pnpm-lock.yaml
1079
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -3,6 +3,7 @@ import { fileURLToPath } from 'node:url'
|
||||||
const testWithInlineVue = process.env.EXTERNAL_VUE === 'false'
|
const testWithInlineVue = process.env.EXTERNAL_VUE === 'false'
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
|
pages: false,
|
||||||
experimental: {
|
experimental: {
|
||||||
externalVue: !testWithInlineVue
|
externalVue: !testWithInlineVue
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,6 +10,7 @@ export default defineVitestConfig({
|
||||||
environmentOptions: {
|
environmentOptions: {
|
||||||
nuxt: {
|
nuxt: {
|
||||||
overrides: {
|
overrides: {
|
||||||
|
pages: false,
|
||||||
appConfig: {
|
appConfig: {
|
||||||
nuxt: {
|
nuxt: {
|
||||||
buildId: 'override'
|
buildId: 'override'
|
||||||
|
|
Loading…
Reference in New Issue