Skip to content

Commit 76b29e8

Browse files
committed
feat: add new docs website
1 parent 44edb63 commit 76b29e8

File tree

200 files changed

+14491
-5659
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+14491
-5659
lines changed

.browserslistrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
defaults and supports es6-module

.github/actions/install-dependencies/action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ runs:
1919
- name: Install dependencies
2020
run: pnpm install --frozen-lockfile --ignore-scripts
2121
shell: bash
22+
23+
- name: Generate content collection types
24+
run: pnpm exec astro sync
25+
shell: bash

.github/actions/install-tools/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
node-version: 20
1010

1111
- name: Install pnpm
12-
uses: pnpm/action-setup@v2
12+
uses: pnpm/action-setup@v4
1313
with:
1414
version: 9
1515
run_install: false

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Deploy to Netlify
2727
uses: nwtgck/[email protected]
2828
with:
29-
publish-dir: './docs/.vitepress/dist'
29+
publish-dir: './dist'
3030
production-branch: main
3131
deploy-message: 'deploy from github actions'
3232
enable-pull-request-comment: false

.github/workflows/test.yml

+34
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ on:
77
pull_request:
88

99
jobs:
10+
astro:
11+
name: Astro
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install Tools
19+
uses: ./.github/actions/install-tools
20+
21+
- name: Install Dependencies
22+
uses: ./.github/actions/install-dependencies
23+
24+
- name: Test
25+
run: pnpm test:astro
26+
1027
css:
1128
name: CSS
1229
runs-on: ubuntu-latest
@@ -58,6 +75,23 @@ jobs:
5875
- name: Test
5976
run: pnpm test:js
6077

78+
svelte:
79+
name: Svelte
80+
runs-on: ubuntu-latest
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v4
85+
86+
- name: Install Tools
87+
uses: ./.github/actions/install-tools
88+
89+
- name: Install Dependencies
90+
uses: ./.github/actions/install-dependencies
91+
92+
- name: Test
93+
run: pnpm test:svelte
94+
6195
types:
6296
name: Types
6397
runs-on: ubuntu-latest

.gitignore

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ dist/
99
.vscode/
1010
.vim/
1111

12-
# VitePress
13-
docs/.vitepress/cache/
14-
docs/.vitepress/temp/
12+
# Astro
13+
.astro/
1514

1615
# Test
1716
coverage/

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
**/*.mdx
12
changelog.md
23
package.json

.prettierrc

+13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"plugins": ["prettier-plugin-astro", "prettier-plugin-svelte"],
23
"arrowParens": "avoid",
34
"bracketSpacing": true,
45
"endOfLine": "lf",
@@ -10,6 +11,18 @@
1011
"trailingComma": "all",
1112
"useTabs": false,
1213
"overrides": [
14+
{
15+
"files": "*.astro",
16+
"options": {
17+
"parser": "astro"
18+
}
19+
},
20+
{
21+
"files": "*.svelte",
22+
"options": {
23+
"parser": "svelte"
24+
}
25+
},
1326
{
1427
"files": "index.ts",
1528
"options": {

.stylelintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "@azat-io/stylelint-config",
3-
"ignoreFiles": ["coverage/**/*", "docs/.vitepress/dist/**/*"],
3+
"ignoreFiles": ["coverage/**/*"],
44
"overrides": [
55
{
6-
"files": ["**/*.vue"],
6+
"files": ["**/*.astro", "**/*.svelte"],
77
"customSyntax": "postcss-html"
88
}
99
]

astro.config.ts

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
import rehypeExternalLinks from 'rehype-external-links'
2+
import { browserslistToTargets } from 'lightningcss'
3+
import svelteSvg from '@poppanator/sveltekit-svg'
4+
import remarkSectionize from 'remark-sectionize'
5+
import { defineConfig } from 'astro/config'
6+
import compress from '@playform/compress'
7+
import { fileURLToPath } from 'node:url'
8+
import browserslist from 'browserslist'
9+
import sitemap from '@astrojs/sitemap'
10+
import svelte from '@astrojs/svelte'
11+
import mdx from '@astrojs/mdx'
12+
import path from 'node:path'
13+
14+
import { remarkHeadings } from './docs/plugins/remark-headings'
15+
import { colorTheme } from './docs/utils/shiki-theme'
16+
17+
let dirname = fileURLToPath(path.dirname(import.meta.url))
18+
19+
export default defineConfig({
20+
markdown: {
21+
shikiConfig: {
22+
transformers: [
23+
{
24+
pre: node => {
25+
delete node.properties.tabindex
26+
delete node.properties.style
27+
},
28+
},
29+
],
30+
theme: colorTheme,
31+
},
32+
rehypePlugins: [
33+
[
34+
rehypeExternalLinks,
35+
{
36+
rel: ['noopener', 'noreferrer'],
37+
target: '_blank',
38+
},
39+
],
40+
],
41+
remarkPlugins: [remarkSectionize, remarkHeadings],
42+
},
43+
vite: {
44+
css: {
45+
lightningcss: {
46+
targets: browserslistToTargets(
47+
browserslist(null, {
48+
config: path.join(dirname, './.browserslistrc'),
49+
}),
50+
),
51+
},
52+
transformer: 'lightningcss',
53+
},
54+
plugins: [
55+
// @ts-ignore
56+
svelteSvg(),
57+
],
58+
},
59+
integrations: [
60+
compress({
61+
JavaScript: true,
62+
Image: true,
63+
CSS: false,
64+
HTML: true,
65+
SVG: true,
66+
}),
67+
svelte({
68+
compilerOptions: {
69+
cssHash: ({ hash, css }) => `s-${hash(css)}`,
70+
discloseVersion: false,
71+
},
72+
}),
73+
sitemap(),
74+
mdx(),
75+
],
76+
prefetch: {
77+
defaultStrategy: 'viewport',
78+
prefetchAll: true,
79+
},
80+
build: {
81+
inlineStylesheets: 'always',
82+
format: 'file',
83+
},
84+
experimental: {
85+
clientPrerender: true,
86+
},
87+
publicDir: path.join(dirname, './docs/public'),
88+
server: {
89+
port: 3000,
90+
host: true,
91+
},
92+
srcDir: path.join(dirname, './docs'),
93+
root: path.join(dirname, './docs'),
94+
site: 'https://perfectionist.dev',
95+
compressHTML: true,
96+
})

0 commit comments

Comments
 (0)