Skip to content

Commit edb3290

Browse files
authored
Move docsite to main repo (#1204)
## Summary We are moving our docsite to this repo for better coordination. ## What's changed? - The docsite codebase is now in docs/ - The docsite will replace storybook as the published GitHub Pages site for this repo - Storybook will now be hosted at https://docs.waveterm.dev/storybook - A new CI workflow will validate any changes to Storybook or the docsite - A combined CD workflow will build and deploy Storybook and the docsite as a single artifact - The Build Helper workflow will now build an embedded version of the docsite before building the app, ensuring the docsite version it has is always the latest
1 parent 42e85ae commit edb3290

Some content is hidden

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

55 files changed

+18014
-6473
lines changed

.github/dependabot.yml

+19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
version: 2
22
updates:
3+
- package-ecosystem: "npm"
4+
directory: "docs/"
5+
schedule:
6+
interval: "weekly"
7+
day: "friday"
8+
time: "09:00"
9+
timezone: "America/Los_Angeles"
10+
groups:
11+
docsite-dev-dependencies:
12+
dependency-type: "development"
13+
exclude-patterns:
14+
- "*docusaurus*"
15+
docsite-docusaurus:
16+
patterns:
17+
- "*docusaurus*"
18+
docsite-prod-dependencies:
19+
dependency-type: "production"
20+
exclude-patterns:
21+
- "*docusaurus*"
322
- package-ecosystem: "npm"
423
directory: "/"
524
schedule:

.github/workflows/build-helper.yml

+26-10
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,28 @@ env:
1414
NODE_VERSION: "20"
1515
STATIC_DOCSITE_PATH: docsite
1616
jobs:
17-
runbuild:
18-
permissions:
19-
contents: write
17+
build-docsite:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: ${{env.NODE_VERSION}}
24+
- name: Install Yarn
25+
run: |
26+
corepack enable
27+
yarn install
28+
working-directory: docs/
29+
- name: Build embedded docsite
30+
run: yarn build-embedded
31+
working-directory: docs/
32+
- name: Upload Build Artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: docsite
36+
path: docs/build
37+
build-app:
38+
needs: build-docsite
2039
outputs:
2140
version: ${{ steps.set-version.outputs.WAVETERM_VERSION }}
2241
strategy:
@@ -109,13 +128,10 @@ jobs:
109128
smctl windows certsync
110129
shell: cmd
111130

112-
- name: Download waveterm-docs static site
113-
uses: dawidd6/action-download-artifact@v6
131+
- name: Download embedded docsite
132+
uses: actions/download-artifact@v4
114133
with:
115-
github_token: ${{secrets.GITHUB_TOKEN}}
116-
workflow: build-embedded.yml
117-
repo: wavetermdev/waveterm-docs
118-
name: static-site
134+
name: docsite
119135
path: ${{env.STATIC_DOCSITE_PATH}}
120136

121137
# Build and upload packages
@@ -162,7 +178,7 @@ jobs:
162178
path: make
163179
create-release:
164180
runs-on: ubuntu-latest
165-
needs: runbuild
181+
needs: build-app
166182
permissions:
167183
contents: write
168184
if: ${{ github.event_name != 'workflow_dispatch' }}

.github/workflows/deploy-docsite.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy Docsite and Storybook
2+
3+
env:
4+
NODE_VERSION: 20
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
# Review gh actions docs if you want to further define triggers, paths, etc
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
name: Build Docsite
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{env.NODE_VERSION}}
25+
- name: Install yarn
26+
run: |
27+
corepack enable
28+
yarn install
29+
- name: Build docsite
30+
run: yarn build
31+
working-directory: docs/
32+
33+
- name: Build Storybook
34+
run: yarn build-storybook
35+
working-directory: storybook/
36+
- name: Copy Storybook to docs
37+
run: cp -r storybook-static docs/build/storybook
38+
- name: Upload Build Artifact
39+
uses: actions/upload-pages-artifact@v3
40+
with:
41+
path: docs/build
42+
deploy:
43+
name: Deploy to GitHub Pages
44+
needs: build
45+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
46+
permissions:
47+
pages: write # to deploy to Pages
48+
id-token: write # to verify the deployment originates from an appropriate source
49+
50+
# Deploy to the github-pages environment
51+
environment:
52+
name: github-pages
53+
url: ${{ steps.deployment.outputs.page_url }}
54+
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4

.github/workflows/deploy-storybook.yml

-42
This file was deleted.
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test Docsite and Storybook Build
2+
3+
env:
4+
NODE_VERSION: 20
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
# Review gh actions docs if you want to further define triggers, paths, etc
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
12+
paths:
13+
- "docs/**"
14+
- "storybook/**"
15+
- "**/*.story.*"
16+
- "**/*.stories.*"
17+
jobs:
18+
test-deploy:
19+
name: Test deployment
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{env.NODE_VERSION}}
28+
- name: Install yarn
29+
run: |
30+
corepack enable
31+
yarn install
32+
- name: Test build website
33+
run: yarn build
34+
working-directory: docs/
35+
- name: Test build storybook
36+
run: yarn build-storybook

.storybook/theme.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { create } from "@storybook/theming";
33
export const light = create({
44
base: "light",
55
brandTitle: "Wave Terminal Storybook",
6-
brandUrl: "https://storybook.waveterm.dev",
6+
brandUrl: "https://docs.waveterm.dev/storybook/",
77
brandImage: "/assets/wave-light.png",
88
brandTarget: "_self",
99
});
1010

1111
export const dark = create({
1212
base: "dark",
1313
brandTitle: "Wave Terminal Storybook",
14-
brandUrl: "https://storybook.waveterm.dev",
14+
brandUrl: "https://docs.waveterm.dev/storybook/",
1515
brandImage: "/assets/wave-dark.png",
1616
brandTarget: "_self",
1717
});

CNAME

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
storybook.waveterm.dev
1+
docs.waveterm.dev

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ We welcome and value contributions to Wave Terminal! Wave is an open source proj
44

55
- Submit issues related to bugs or new feature requests
66
- Fix outstanding [issues](https://github.com/wavetermdev/waveterm/issues) with the existing code
7-
- Contribute to [documentation](https://github.com/wavetermdev/waveterm-docs)
7+
- Contribute to [documentation](./docs)
88
- Spread the word on social media (tag us on [LinkedIn](https://www.linkedin.com/company/wavetermdev), [Twitter/X](https://x.com/wavetermdev))
99
- Or simply ⭐️ the repository to show your appreciation
1010

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Find more information in our [Contributions Guide](CONTRIBUTING.md), which inclu
7070

7171
- [Ways to contribute](CONTRIBUTING.md#contributing-to-wave-terminal)
7272
- [Contribution guidelines](CONTRIBUTING.md#before-you-start)
73-
- [Storybook](https://storybook.waveterm.dev)
73+
- [Storybook](https://docs.waveterm.dev/storybook)
7474

7575
### Activity
7676

docs/.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
[*.{js,jsx,ts,tsx,cjs,json,yml,yaml,css,less}]
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
12+
[CNAME]
13+
insert_final_newline = false

docs/.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependencies
2+
/node_modules
3+
/.yarn
4+
5+
# Production
6+
/build
7+
build.zip
8+
9+
# Generated files
10+
.docusaurus
11+
.cache-loader
12+
13+
# Misc
14+
.DS_Store
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

docs/.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
.git
3+
node_modules
4+
*.min.*
5+
*.mdx
6+
CNAME

docs/.remarkrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"plugins": [
3+
"remark-preset-lint-consistent",
4+
"remark-preset-lint-recommended",
5+
"remark-mdx",
6+
"remark-frontmatter"
7+
]
8+
}

docs/.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

docs/README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<p align="center">
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="./assets/wave-dark.png">
4+
<source media="(prefers-color-scheme: light)" srcset="./assets/wave-light.png">
5+
<img alt="Wave Terminal Logo" src="./assets/wave-light.png" width="240">
6+
</picture>
7+
<br/>
8+
</p>
9+
10+
# Wave Terminal Documentation
11+
12+
This is the home for Wave Terminal's documentation site. This README is specifically about _building_ and contributing to the docs site. If you are looking for the actual hosted docs, go here -- https://docs.waveterm.dev
13+
14+
### Installation
15+
16+
Our docs are built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
17+
18+
```sh
19+
yarn
20+
```
21+
22+
### Local Development
23+
24+
```sh
25+
yarn start
26+
```
27+
28+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
29+
30+
### Build
31+
32+
```sh
33+
yarn build
34+
```
35+
36+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
37+
38+
### Deployment
39+
40+
Deployments are handled automatically by the [Deploy action](.github/workflows/deploy.yml)

docs/babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
3+
};

0 commit comments

Comments
 (0)