Skip to content

Commit

Permalink
Set up docs (#403)
Browse files Browse the repository at this point in the history
* deploy web-test to pages

* fix: workflow syntax

* fix: workflow syntax

* fix: rename

* fix: action

* fix

* fix

* fix for upstream

* setup doc generation

* test deploy in pr

* remove pr trigger

* fix lint
  • Loading branch information
qiweiii authored Sep 15, 2023
1 parent a27d2b3 commit db79e9f
Show file tree
Hide file tree
Showing 12 changed files with 1,776 additions and 18 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ jobs:
yarn check
yarn build-wasm
yarn build
- name: Generate Docs
run: |
yarn docs:build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './packages/web-test/dist'
path: './dist'

deploy-web-test:
deploy:
needs: setup
# Deploy to the github-pages environment
environment:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,9 @@ preview/

lib
.parcel-cache

# api-extractor output folder
docs-src

# vitepress cache
.vitepress/cache
30 changes: 30 additions & 0 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Chopsticks (WIP)',
description: 'Chopsticks Types Documentation',
// Required for api-extractor markdown (https://github.com/vuejs/vitepress/pull/664)
markdown: { attrs: { disable: true } },
base: '/docs/',
srcDir: 'docs-src',
outDir: 'dist/docs',
rewrites: {
'chopsticks/:file': ':file',
'core/:file': ':file',
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [{ text: 'Home', link: '/' }],
sidebar: [
{
text: 'Packages',
items: [
{ text: 'Chopsticks', link: '/chopsticks.html' },
{ text: 'Core', link: '/chopsticks-core.html' },
],
},
],
socialLinks: [{ icon: 'github', link: 'https://github.com/AcalaNetwork/chopsticks' }],
},
})
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"test": "vitest run",
"test:watch": "vitest",
"start": "yarn script:start",
"dev": "yarn script:run"
"dev": "yarn script:run",
"docs:prep": "yarn workspaces foreach -pvit run docs:prep",
"docs:dev": "yarn docs:prep && vitepress dev",
"docs:build": "yarn docs:prep && vitepress build",
"docs:preview": "yarn docs:build && vitepress preview"
},
"engines": {
"node": ">=v14"
Expand All @@ -34,6 +38,8 @@
"*.{js,ts,css,md}": "prettier --write"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.22.33",
"@microsoft/api-extractor": "^7.36.4",
"@swc/core": "^1.3.78",
"@types/node": "^20.5.7",
"@types/prettier": "^3.0.0",
Expand All @@ -49,6 +55,7 @@
"typescript": "^5.1.6",
"unplugin-swc": "^1.4.2",
"vite-tsconfig-paths": "^4.2.0",
"vitepress": "^1.0.0-rc.13",
"vitest": "^0.34.2",
"wasm-pack": "^0.12.1"
},
Expand Down
Loading

0 comments on commit db79e9f

Please sign in to comment.