Skip to content

Commit c34f36e

Browse files
committed
[major] migrate to hero-ui frontend
1 parent d20628b commit c34f36e

Some content is hidden

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

45 files changed

+4976
-1894
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
frontend/github.css linguist-vendored
1+
yarn.lock -diff
2+
worker-configuration.d.ts -diff
23

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
- name: "Setup"
2020
run: yarn install
2121

22+
- name: "Build Frontend"
23+
run: yarn build:frontend
24+
2225
- name: "Test"
2326
run: |
2427
yarn prettier -c .

.github/workflows/pr.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,53 @@ on:
33
pull_request:
44

55
jobs:
6+
coverage-goshujin:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
ref: goshujin
13+
14+
- name: "Install Node"
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: "22"
18+
cache: "yarn"
19+
20+
- name: "Coverage"
21+
run: |
22+
yarn install
23+
yarn build:frontend || true
24+
yarn test
25+
yarn coverage
26+
27+
- name: "Upload Coverage"
28+
uses: actions/upload-artifact@v4
29+
with:
30+
name: coverage-goshujin
31+
path: coverage
32+
633
test:
734
runs-on: ubuntu-latest
8-
strategy:
9-
matrix:
10-
include:
11-
- ref: ${{ github.ref }}
12-
name: "head"
13-
- ref: "goshujin"
14-
name: "goshujin"
15-
16-
permissions:
17-
contents: read
18-
pull-requests: write
1935

2036
steps:
2137
- uses: actions/checkout@v4
2238
with:
23-
ref: ${{ matrix.ref }}
39+
ref: ${{ github.ref }}
2440

2541
- name: "Install Node"
2642
uses: actions/setup-node@v4
2743
with:
28-
node-version: "20"
44+
node-version: "22"
2945
cache: "yarn"
3046

3147
- name: "Install Deps"
3248
run: yarn install
3349

50+
- name: "Build Frontend"
51+
run: yarn build:frontend
52+
3453
- name: "Test"
3554
run: |
3655
yarn prettier -c .
@@ -43,7 +62,7 @@ jobs:
4362
- name: "Upload Coverage"
4463
uses: actions/upload-artifact@v4
4564
with:
46-
name: coverage-${{ matrix.name }}
65+
name: coverage-head
4766
path: coverage
4867

4968
report-coverage:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/target
2-
/dist
2+
dist
33
**/*.rs.bk
44
Cargo.lock
55
bin/
@@ -12,3 +12,4 @@ node_modules/
1212
.idea
1313
.wrangler
1414
coverage
15+
.dev.vars*

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"semi": false,
44
"trailingComma": "all",
55
"tabWidth": 2,
6-
"printWidth": 80
6+
"printWidth": 120
77
}

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,26 @@ $ yarn -s wrangler kv key list --binding PB > kv_list.json
9797

9898
## Development
9999

100-
Run a local simulator:
100+
Note that the frontend and worker code are built separatedly. To start a Vite development server of the frontend,
101+
102+
```console
103+
$ yarn dev:frontend
104+
```
105+
106+
To develop the backend worker, we must build a develop version of frontend,
107+
108+
```console
109+
$ yarn build:frontend:dev
110+
```
111+
112+
Then starts a local worker,
101113

102114
```console
103115
$ yarn dev
104116
```
105117

118+
The difference between `build:frontend:dev` and `build:frontend` is that the former will points the API endpoint to your deployment URL, while the later points to `http://localhost:8787`, the address of a local worker.
119+
106120
Run tests:
107121

108122
```console
File renamed without changes.

eslint.config.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ export default tseslint.config(
1515
},
1616
},
1717
},
18-
globalIgnores([
19-
"dist/**",
20-
".wrangler/**",
21-
"coverage/**",
22-
"worker-configuration.d.ts",
23-
]),
18+
globalIgnores(["dist/**", ".wrangler/**", "coverage/**", "worker-configuration.d.ts"]),
2419
{
2520
rules: {
2621
"no-unused-vars": "off",
2722
"@typescript-eslint/no-unused-vars": [
28-
"error",
23+
"warn",
2924
{
3025
argsIgnorePattern: "^_",
3126
varsIgnorePattern: "^_",
@@ -34,7 +29,7 @@ export default tseslint.config(
3429
},
3530
},
3631
{
37-
files: ["*.config.js"],
32+
files: ["**/*.config.js"],
3833
extends: [tseslint.configs.disableTypeChecked],
3934
},
4035
)

frontend/github.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/hero.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { heroui } from "@heroui/react"
2+
export default heroui()

0 commit comments

Comments
 (0)