Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: typecheck code samples in docs #25777

Merged
merged 8 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/docs.yml
Expand Up @@ -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
Comment on lines +35 to +40
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is an opportunity here to move docs workflow back into main ci.yml but use tj-actions/changed-files instead to granularly enable workflows.

2 changes: 2 additions & 0 deletions .nuxtrc
@@ -1 +1,3 @@
telemetry.enabled=false
# For pnpm typecheck:docs to generate correct types
pages=true
danielroe marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 2 additions & 1 deletion docs/1.getting-started/5.transitions.md
Expand Up @@ -327,7 +327,8 @@ definePageMeta({
mode: 'out-in'
},
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>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -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:*",
Expand Down Expand Up @@ -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",
Expand Down