Skip to content

Commit 3250ec5

Browse files
authored
Merge pull request #16 from grega/astro
Migrate site to Astro
2 parents 7bc3b53 + d0c3c54 commit 3250ec5

37 files changed

Lines changed: 10812 additions & 3 deletions

.gitignore

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,28 @@ Thumbs.db
1010

1111
# logs
1212
*.log
13+
npm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+
pnpm-debug.log*
1317

1418
# Node / Playwright (site tests)
1519
node_modules/
16-
site/test-results/
17-
site/playwright-report/
20+
test-results/
21+
playwright-report/
22+
blob-report/
23+
playwright/.cache/
24+
playwright/.auth/
25+
26+
# build output
27+
dist/
28+
29+
# generated types
30+
.astro/
31+
32+
# environment variables
33+
.env
34+
.env.production
35+
36+
# jetbrains setting folder
37+
.idea/

.prettierrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
{}
1+
{
2+
"plugins": ["prettier-plugin-astro"],
3+
"overrides": [
4+
{
5+
"files": "*.astro",
6+
"options": {
7+
"parser": "astro"
8+
}
9+
}
10+
]
11+
}

demo/demo-latte.tape

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
# Requires: brew install vhs
44

55
Output demo/demo-latte.gif
6+
Output website/src/assets/demo-latte.gif
67
Set Theme "Catppuccin Latte"
78
Source demo/demo-content.tape

demo/demo-mocha.tape

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
# Requires: brew install vhs
44

55
Output demo/demo-mocha.gif
6+
Output website/src/assets/demo-mocha.gif
67
Set Theme "Catppuccin Mocha"
78
Source demo/demo-content.tape
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Playwright Tests
2+
on:
3+
push:
4+
branches: [ main, master ]
5+
pull_request:
6+
branches: [ main, master ]
7+
jobs:
8+
test:
9+
timeout-minutes: 60
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: lts/*
16+
- name: Install dependencies
17+
run: npm ci
18+
- name: Install Playwright Browsers
19+
run: npx playwright install --with-deps
20+
- name: Run Playwright tests
21+
run: npx playwright test
22+
- uses: actions/upload-artifact@v4
23+
if: ${{ !cancelled() }}
24+
with:
25+
name: playwright-report
26+
path: playwright-report/
27+
retention-days: 30

website/.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodejs 24.14.0

website/.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

website/.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

website/.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"prettier.documentSelectors": ["**/*.astro"],
3+
"[astro]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
}
6+
}

website/README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# hdi website
2+
3+
Information page and interactive demo of the `hdi` CLI, built with [Astro](https://astro.build).
4+
5+
## Local development
6+
7+
Install Node via [asdf](https://asdf-vm.com/) (see `.tool-versions`):
8+
9+
```bash
10+
asdf install
11+
```
12+
13+
Install dependencies:
14+
15+
```bash
16+
npm install
17+
```
18+
19+
Start the dev server:
20+
21+
```bash
22+
npm run dev
23+
```
24+
25+
Dev server will open at http://localhost:4321
26+
27+
## Formatting
28+
29+
This project uses Prettier for formatting.
30+
31+
Run manually:
32+
33+
```bash
34+
npm run format
35+
```
36+
37+
Run without writing:
38+
39+
```bash
40+
npm run format:check
41+
```
42+
43+
## E2E tests
44+
45+
This project uses Playwright for E2E tests. Tests run on chromium, firefox and webkit.
46+
47+
Run in headless mode:
48+
49+
```bash
50+
npm run test
51+
```
52+
53+
Run with browser ui:
54+
55+
```bash
56+
npm run test:ui
57+
```
58+
59+
Run in debug mode:
60+
61+
```bash
62+
npm run test:debug
63+
```
64+
65+
## Preview & build
66+
67+
Preview your build locally, before deploying:
68+
69+
```bash
70+
npm run preview
71+
```
72+
73+
Build website:
74+
75+
```bash
76+
npm run build
77+
```
78+
79+
## Astro commands
80+
81+
Get help using the Astro CLI:
82+
83+
```bash
84+
npm run astro -- --help
85+
```
86+
87+
## Regenerating data
88+
89+
`src/data/data.js` is auto-generated from the fixture READMEs using `hdi --json`. To regenerate after changing fixtures or the parser locally, run from the `website/` directory:
90+
91+
```bash
92+
./generate-data.sh
93+
```

0 commit comments

Comments
 (0)