mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
ci: typecheck code samples in docs (#25777)
This commit is contained in:
parent
1901cb1c68
commit
3f882c95f6
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -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'
|
||||||
|
6
.github/workflows/docs.yml
vendored
6
.github/workflows/docs.yml
vendored
@ -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,7 +327,8 @@ definePageMeta({
|
|||||||
mode: 'out-in'
|
mode: 'out-in'
|
||||||
},
|
},
|
||||||
middleware (to, from) {
|
middleware (to, from) {
|
||||||
to.meta.pageTransition.name = +to.params.id > +from.params.id ? 'slide-left' : 'slide-right'
|
if (to.meta.pageTransition && typeof to.meta.pageTransition !== 'boolean')
|
||||||
|
to.meta.pageTransition.name = +to.params.id > +from.params.id ? 'slide-left' : 'slide-right'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -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
1
test/fixtures/minimal/nuxt.config.ts
vendored
1
test/fixtures/minimal/nuxt.config.ts
vendored
@ -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
Block a user