Skip to content

Commit df3676e

Browse files
authored
feat(ui): storybook + chromatic (#4)
Signed-off-by: Sam Gammon <[email protected]>
1 parent 7c50767 commit df3676e

Some content is hidden

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

43 files changed

+5453
-1564
lines changed

.github/workflows/check.chromatic.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: "Check: Chromatic"
2+
3+
on:
4+
workflow_dispatch: {}
5+
workflow_call:
6+
secrets:
7+
CHROMATIC_TOKEN:
8+
description: "Chromatic Token"
9+
required: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
check-chromatic:
16+
name: "Storybook"
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: "Setup: Harden Runner"
20+
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
21+
with:
22+
egress-policy: audit
23+
- name: "Setup: Checkout"
24+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
25+
with:
26+
persist-credentials: false
27+
fetch-depth: 0
28+
- name: "Setup: Node"
29+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
30+
with:
31+
node-version: ${{ vars.NODE_VERSION || '21' }}
32+
- name: "Setup: Bun"
33+
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
34+
with:
35+
bun-version: ${{ vars.BUN_VERSION || 'latest' }}
36+
- name: "Setup: PNPM"
37+
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
38+
with:
39+
version: ${{ vars.PNPM_VERSION || '8' }}
40+
run_install: |
41+
- recursive: true
42+
args: [--frozen-lockfile, --strict-peer-dependencies]
43+
- name: "Setup: Doppler"
44+
uses: dopplerhq/cli-action@014df23b1329b615816a38eb5f473bb9000700b1 # v3
45+
- name: "Build: Libraries"
46+
run: pnpm run libs:build
47+
- name: "Build: Storybook"
48+
run: pnpm run chromatic
49+
env:
50+
CHROMATIC_TOKEN: ${{ secrets.CHROMATIC_TOKEN }}

.github/workflows/check.prettier.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: "Setup: Node"
2424
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2525
with:
26-
node-version: ${{ vars.NODE_VERSION || '20' }}
26+
node-version: ${{ vars.NODE_VERSION || '21' }}
2727
- name: "Setup: Bun"
2828
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
2929
with:

.github/workflows/check.workflows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: "Setup: Node"
2424
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2525
with:
26-
node-version: ${{ vars.NODE_VERSION || '20' }}
26+
node-version: ${{ vars.NODE_VERSION || '21' }}
2727
- name: "Setup: Bun"
2828
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
2929
with:

.github/workflows/ci.build.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: "Setup: Node"
2626
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2727
with:
28-
node-version: ${{ vars.NODE_VERSION || '20' }}
28+
node-version: ${{ vars.NODE_VERSION || '21' }}
2929
- name: "Setup: Bun"
3030
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
3131
with:
@@ -39,6 +39,8 @@ jobs:
3939
args: [--frozen-lockfile, --strict-peer-dependencies]
4040
- name: "Setup: Buildless"
4141
uses: buildless/setup@30e82389418c7f17046606183bc4c78b2c8913e0 # v1.0.2
42+
- name: "Setup: Doppler"
43+
uses: dopplerhq/cli-action@014df23b1329b615816a38eb5f473bb9000700b1 # v3
4244
- name: "Build: Libraries"
4345
run: pnpm run libs:build
4446
- name: "Build: Distribution"

.github/workflows/ci.deploy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: "Setup: Node"
4646
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
4747
with:
48-
node-version: ${{ vars.NODE_VERSION || '20' }}
48+
node-version: ${{ vars.NODE_VERSION || '21' }}
4949
- name: "Setup: Bun"
5050
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
5151
with:
@@ -96,7 +96,7 @@ jobs:
9696
- name: "Setup: Node"
9797
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
9898
with:
99-
node-version: ${{ vars.NODE_VERSION || '20' }}
99+
node-version: ${{ vars.NODE_VERSION || '21' }}
100100
- name: "Setup: Bun"
101101
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
102102
with:
@@ -141,7 +141,7 @@ jobs:
141141
- name: "Setup: Node"
142142
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
143143
with:
144-
node-version: ${{ vars.NODE_VERSION || '20' }}
144+
node-version: ${{ vars.NODE_VERSION || '21' }}
145145
- name: "Setup: Bun"
146146
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
147147
with:

.github/workflows/ci.test.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: "Setup: Node"
2626
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2727
with:
28-
node-version: ${{ vars.NODE_VERSION || '20' }}
28+
node-version: ${{ vars.NODE_VERSION || '21' }}
2929
- name: "Setup: Bun"
3030
uses: oven-sh/setup-bun@d3603274aca5625baad52ec06108517a089cdd00 # v1.2.0
3131
with:
@@ -59,3 +59,8 @@ jobs:
5959
workers/*/coverage/**/*.*
6060
workers/*/reports/*.*
6161
workers/*/reports/**/*.*
62+
- name: "Reporting: Coverage"
63+
uses: codecov/[email protected]
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}
66+
slug: javamodules/javamodules.dev

.github/workflows/on.pr.yml

+9-2
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@ jobs:
1616
test:
1717
name: "Build & Test"
1818
uses: ./.github/workflows/ci.test.yml
19+
secrets: inherit # codecov/sonar tokens
1920

2021
check-prettier:
21-
name: "Check: Prettier"
22+
name: "Checks"
2223
uses: ./.github/workflows/check.prettier.yml
2324

2425
check-workflows:
25-
name: "Check: Workflows"
26+
name: "Checks"
2627
uses: ./.github/workflows/check.workflows.yml
2728

29+
check-chromatic:
30+
name: "Checks"
31+
uses: ./.github/workflows/check.chromatic.yml
32+
secrets: inherit
33+
2834
deploy:
2935
name: "Deploy"
3036
if: false
3137
needs: [build, test, check-prettier, check-workflows]
3238
uses: ./.github/workflows/ci.deploy.yml
39+
secrets: inherit

.github/workflows/on.push.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,21 @@ jobs:
1616
test:
1717
name: "Build"
1818
uses: ./.github/workflows/ci.test.yml
19+
secrets: inherit # codecov/sonar tokens
1920

2021
check-prettier:
21-
name: "Check: Prettier"
22+
name: "Checks"
2223
uses: ./.github/workflows/check.prettier.yml
2324

2425
check-workflows:
25-
name: "Check: Workflows"
26+
name: "Checks"
2627
uses: ./.github/workflows/check.workflows.yml
2728

29+
check-chromatic:
30+
name: "Checks"
31+
uses: ./.github/workflows/check.chromatic.yml
32+
secrets: inherit
33+
2834
deploy:
2935
name: "Deploy"
3036
uses: ./.github/workflows/ci.deploy.yml

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ side-effects-cache=true
2020
engine-strict=false
2121
package-import-method=auto
2222

23-
git-branch-lockfile=true
23+
git-branch-lockfile=false
2424
merge-git-branch-lockfiles-branch-pattern[]=main
2525
merge-git-branch-lockfiles-branch-pattern[]=release*
2626

bun.lockb

151 KB
Binary file not shown.

package.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"devcontainer:build": "docker buildx build --attest=type=provenance --attest=type=sbom --push -t ghcr.io/javamodules/javamodules.dev/devcontainer -f .devcontainer/Dockerfile .",
1616
"devcontainer:push": "docker push ghcr.io/javamodules/javamodules.dev/devcontainer",
1717
"devcontainer": "docker run --rm -it ghcr.io/javamodules/javamodules.dev/devcontainer",
18+
"format": "pnpm run fmt:write",
1819
"fmt:check": "prettier . --check",
1920
"fmt:write": "prettier . --write",
2021
"libs:build": "pnpm --filter !@javamodules/site -r build",
@@ -32,7 +33,10 @@
3233
"build:remote-cache": "cp -f .turbo/config.tpl.json .turbo/config.json && mv bun.lockb bun.inert && turbo build --token $BUILDLESS_APIKEY --no-daemon --cache-dir .dev/cache/turbo --no-update-notifier ; mv bun.inert bun.lockb && rm -f ./.turbo/config.json",
3334
"test": "mv bun.lockb bun.inert && turbo test --no-daemon --cache-dir .dev/cache/turbo --no-update-notifier ; mv bun.inert bun.lockb",
3435
"test:remote-cache": "cp -f .turbo/config.tpl.json .turbo/config.json && mv bun.lockb bun.inert && turbo test --token $BUILDLESS_APIKEY --no-daemon --cache-dir .dev/cache/turbo --no-update-notifier ; mv bun.inert bun.lockb && rm -f ./.turbo/config.json",
35-
"prepare": "husky"
36+
"storybook": "pnpm run build && cd site && pnpm run storybook",
37+
"chromatic": "pnpm run build && cd site && pnpm run chromatic",
38+
"prepare": "husky",
39+
"turbo": "turbo"
3640
},
3741
"devDependencies": {
3842
"@changesets/cli": "2.27.1",
@@ -42,6 +46,7 @@
4246
"husky": "9.0.11",
4347
"lint-staged": "15.2.2",
4448
"prettier": "3.2.5",
49+
"turbo": "1.12.5",
4550
"typescript": "5.4.2"
4651
},
4752
"husky": {

0 commit comments

Comments
 (0)