Skip to content

Commit 9eb8cbc

Browse files
authored
chore: upgrade docus, migrate to pnpm and use bumpp (nuxt-modules#309)
1 parent 8f17563 commit 9eb8cbc

34 files changed

+4278
-22118
lines changed

.github/workflows/ci.yml

+11-17
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,25 @@ jobs:
1818
node: [14]
1919

2020
steps:
21+
22+
- uses: actions/checkout@v3
23+
- run: corepack enable
2124
- uses: actions/setup-node@v3
2225
with:
2326
node-version: ${{ matrix.node }}
27+
cache: "pnpm"
2428

25-
- name: checkout
26-
uses: actions/checkout@v3
27-
28-
- name: cache node_modules
29-
uses: actions/cache@v3
30-
with:
31-
path: node_modules
32-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
33-
34-
- name: Install dependencies
35-
if: steps.cache.outputs.cache-hit != 'true'
36-
run: yarn
29+
- name: 📦 Install dependencies
30+
run: pnpm install
3731

38-
- name: Prepare environment
39-
run: yarn dev:prepare
32+
- name: 🚧 Set up project
33+
run: pnpm dev:prepare
4034

41-
- name: Lint
42-
run: yarn lint:all
35+
- name: 🔠 Lint project
36+
run: pnpm run lint:all
4337

4438
- name: Test
45-
run: yarn test
39+
run: pnpm test
4640

4741
- name: Coverage
4842
uses: codecov/codecov-action@v3

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint-staged
4+
pnpm lint-staged

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

docs/.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
node_modules
3+
.output
4+
.nuxt

docs/.eslintrc.cjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@nuxt/eslint-config',
4+
rules: {
5+
'vue/max-attributes-per-line': 'off',
6+
'vue/multi-word-component-names': 'off'
7+
}
8+
}

docs/.gitignore

100644100755
+12-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
static/sw.js
1+
node_modules
2+
*.iml
3+
.idea
4+
*.log*
5+
.nuxt
6+
.vscode
7+
.DS_Store
8+
coverage
9+
dist
10+
sw.*
11+
.env
12+
.output

docs/.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false

docs/app.config.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
export default defineAppConfig({
2+
docus: {
3+
title: '@nuxtjs/html-validator',
4+
url: 'https://html-validator.nuxtjs.org',
5+
description: 'The best place to start your documentation.',
6+
socials: {
7+
github: 'nuxt-modules/html-validator',
8+
},
9+
image: 'https://html-validator.nuxtjs.org/preview.png',
10+
aside: {
11+
level: 0,
12+
exclude: []
13+
},
14+
header: {
15+
logo: true
16+
},
17+
footer: {
18+
iconLinks: [
19+
{
20+
href: 'https://nuxt.com',
21+
icon: 'simple-icons:nuxtdotjs'
22+
}
23+
]
24+
}
25+
}
26+
})

docs/components/Logo.vue

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<template>
2+
<img class="dark-img" src="/logo-dark.svg">
3+
<img class="light-img" src="/logo-light.svg">
4+
</template>
5+
6+
<style lang="ts">
7+
css({
8+
'.light .dark-img': {
9+
display: 'none',
10+
},
11+
'.dark .light-img': {
12+
display: 'none',
13+
},
14+
})
15+
</style>

docs/content/en/index.md renamed to docs/content/0.index.md

+38-36
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
title: Introduction
33
description: 'Automatically validate Nuxt server-rendered HTML (SSR and SSG) to detect common issues with HTML that can lead to hydration errors, as well as improve accessibility and best practice.'
44
category: Getting started
5-
items:
6-
- Zero-configuration required
7-
- Helps reduce hydration errors
8-
- Detects common accessibility mistakes
95

106
---
117

@@ -14,76 +10,82 @@ items:
1410

1511
## Key features
1612

17-
<list :items="items"></list>
13+
::list
14+
- Zero-configuration required
15+
- Helps reduce hydration errors
16+
- Detects common accessibility mistakes
17+
::
1818

1919
This module configures [`html-validate`](https://html-validate.org/) to automatically validate Nuxt server-rendered HTML (SSR and SSG) to detect common issues with HTML that can lead to hydration errors, as well as improve accessibility and best practice.
2020

2121
## Quick start
2222

2323
### Install
2424

25-
<code-group>
26-
<code-block label="Yarn" active>
27-
28-
```bash
25+
::code-group
26+
```bash [pnpm]
27+
pnpm i -D @nuxtjs/html-validator
28+
```
29+
```bash [Yarn]
2930
yarn add @nuxtjs/html-validator --dev
3031
```
31-
32-
</code-block>
33-
<code-block label="NPM">
34-
35-
```bash
32+
```bash [npm]
3633
npm install @nuxtjs/html-validator --save-dev
3734
```
38-
39-
</code-block>
40-
</code-group>
35+
::
4136

4237
### nuxt.config.js
4338

44-
<code-group>
45-
<code-block label="Nuxt 2.9+" active>
46-
47-
```js{}[nuxt.config.js]
48-
{
39+
::code-group
40+
```js [Nuxt 3]
41+
defineNuxtConfig({
42+
modules: ['@nuxtjs/html-validator']
43+
})
44+
```
45+
```js {}[Nuxt 2.9+]
46+
export default {
4947
buildModules: ['@nuxtjs/html-validator']
5048
}
5149
```
52-
53-
</code-block>
54-
<code-block label="Nuxt < 2.9">
55-
56-
```js{}[nuxt.config.js]
57-
{
50+
```js [Nuxt < 2.9">
51+
export default {
5852
// Install @nuxtjs/html-validator as dependency instead of devDependency
5953
modules: ['@nuxtjs/html-validator']
6054
}
6155
```
56+
::
6257

63-
</code-block>
64-
</code-group>
65-
66-
<alert type="info">`html-validator` won't be added to your production bundle - it's just used in development and at build/generate time.</alert>
58+
::alert{type="info"}
59+
`html-validator` won't be added to your production bundle - it's just used in development and at build/generate time.
60+
::
6761

6862
### Configuration (optional)
6963

7064
`@nuxtjs/html-validator` takes four options.
7165

7266
- `usePrettier` enables prettier printing of your source code to show errors in-context.
7367

74-
<alert>Consider not enabling this if you are using TailwindCSS, as prettier will struggle to cope with parsing the size of your HTML in development mode.</alert>
68+
::alert
69+
Consider not enabling this if you are using TailwindCSS, as prettier will struggle to cope with parsing the size of your HTML in development mode.
70+
::
7571

7672
- `logLevel` sets the verbosity to one of `verbose`, `warning` or `error`. It defaults to `verbose` in dev, and `warning` when generating.
7773

78-
<alert>You can use this configuration option to turn off console logging for the `No HTML validation errors found for ...` message.</alert>
74+
::alert
75+
You can use this configuration option to turn off console logging for the `No HTML validation errors found for ...` message.
76+
::
7977

8078
- `failOnError` will throw an error after running `nuxt generate` if there are any validation errors with the generated pages.
8179

82-
<alert>Useful in continuous integration.</alert>
80+
::alert
81+
Useful in continuous integration.
82+
::
8383

8484
- `options` allows you to pass in `html-validate` options that will be merged with the default configuration
8585

86-
<alert type="info">You can find more about configuring `html-validate` [here](https://html-validate.org/rules/index.html).</alert>
86+
::alert{type="info"}
87+
You can find more about configuring `html-validate` [here](https://html-validate.org/rules/index.html).
88+
::
8789

8890
**Defaults**
8991

docs/content/settings.json

-10
This file was deleted.

docs/nuxt.config.js

-7
This file was deleted.

docs/nuxt.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default defineNuxtConfig({
2+
extends: '@nuxt-themes/docus'
3+
})

docs/package.json

100644100755
+14-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
{
2+
"name": "docus-starter",
3+
"version": "0.1.0",
24
"private": true,
35
"scripts": {
4-
"dev": "nuxt",
5-
"generate": "nuxt generate"
6+
"dev": "nuxi dev",
7+
"build": "nuxi build",
8+
"generate": "nuxi generate",
9+
"preview": "nuxi preview",
10+
"lint": "eslint ."
611
},
712
"devDependencies": {
8-
"@nuxt/content-theme-docs": "latest",
9-
"nuxt-edge": "latest"
13+
"@nuxt-themes/docus": "^1.9.0",
14+
"@nuxt/eslint-config": "^0.1.1",
15+
"eslint": "^8.35.0",
16+
"nuxt": "^3.2.2"
17+
},
18+
"dependencies": {
19+
"pinceau": "^0.18.8"
1020
}
1121
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/static/.gitkeep

Whitespace-only changes.

docs/tokens.config.ts

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineTheme } from 'pinceau'
2+
3+
// E6F0F0
4+
5+
export default defineTheme({
6+
color: {
7+
primary: {
8+
'50': '#eefbf5',
9+
'100': '#d7f4e5',
10+
'200': '#b1e9cf',
11+
'300': '#7fd6b4',
12+
'400': '#41b38a',
13+
'500': '#27a27a',
14+
'600': '#198262',
15+
'700': '#146850',
16+
'800': '#125341',
17+
'900': '#104436',
18+
}
19+
}
20+
})

docs/tsconfig.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./.nuxt/tsconfig.json"
3+
}

0 commit comments

Comments
 (0)