Skip to content

Commit

Permalink
Merge branch 'main' into refactor-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
int128 authored Jun 30, 2024
2 parents a17dbef + b4ab02a commit 913baba
Show file tree
Hide file tree
Showing 36 changed files with 2,456 additions and 1,895 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/react.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- .github/workflows/react.yaml
- src/**
- '*.json'
- '*.config.*'
- pnpm-lock.yaml
push:
branches:
Expand All @@ -14,6 +15,7 @@ on:
- .github/workflows/react.yaml
- src/**
- '*.json'
- '*.config.*'
- pnpm-lock.yaml

jobs:
Expand Down Expand Up @@ -56,28 +58,3 @@ jobs:
- run: pnpm i
- run: pnpm run format
- uses: int128/update-generated-files-action@v2

storycap:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- run: corepack enable pnpm
- run: pnpm i
- run: pnpm run storycap
- uses: int128/upload-artifact-wiki-action@v1
id: upload-artifact-wiki
with:
path: __screenshots__/**/*.png
- uses: int128/comment-action@v1
with:
update-if-exists: replace
post: |
<table>
<tr>
<td><img src="${{ steps.upload-artifact-wiki.outputs.url }}/__screenshots__/App/component/Primary.png"></td>
</tr>
</table>
52 changes: 52 additions & 0 deletions .github/workflows/storybook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: storybook

on:
pull_request:
paths:
- .github/workflows/storybook.yaml
- .storybook/**
- src/**
- '*.json'
- '*.config.*'
- pnpm-lock.yaml
push:
branches:
- main
paths:
- .github/workflows/storybook.yaml
- .storybook/**
- src/**
- '*.json'
- '*.config.*'
- pnpm-lock.yaml

jobs:
storycap:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- run: corepack enable pnpm
- run: pnpm i
- run: pnpm run storycap
- uses: int128/upload-artifact-wiki-action@v1
id: upload-artifact-wiki
with:
path: __screenshots__/**/*.png
- uses: int128/comment-action@v1
with:
update-if-exists: replace
post: |
<table>
<tr>
<td><img src="${{ steps.upload-artifact-wiki.outputs.url }}/__screenshots__/App/component/Primary.png"></td>
<td><img src="${{ steps.upload-artifact-wiki.outputs.url }}/__screenshots__/App/component/Dark.png"></td>
</tr>
<tr>
<td><img src="${{ steps.upload-artifact-wiki.outputs.url }}/__screenshots__/BookmarkEditor/component/Primary.png"></td>
<td><img src="${{ steps.upload-artifact-wiki.outputs.url }}/__screenshots__/Preferences/component/Primary.png"></td>
</tr>
</table>
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.12
20.15
6 changes: 6 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ const preview: Preview = {
parameters: {
screenshot: {
delay: 250,
viewport: {
// Chrome Web Store requirement
width: 1280,
height: 800,
deviceScaleFactor: 1,
},
},
controls: {
matchers: {
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ https://chrome.google.com/webstore/detail/feeleilgbmkkpapllljmclmbeddcdeeh

## Screenshots

Here are screenshots automatically generated by Cypress.
Here are the screenshots generated by Storycap in GitHub Actions.

<table>
<thead>
<th>Light</th>
<th>Dark</th>
</thead>
<tr>
<td><img src="https://raw.githubusercontent.com/wiki/int128/bntp/main/cypress/screenshots/App.cy.tsx/App%20--%20mounts.png"></td>
<td><img src="https://raw.githubusercontent.com/wiki/int128/bntp/main/cypress/screenshots/App.cy.tsx/App%20--%20enables%20dark%20mode.png"></td>
<td><img src="https://github.com/int128/bntp/wiki/main/__screenshots__/App/component/Primary.png"></td>
<td><img src="https://github.com/int128/bntp/wiki/main/__screenshots__/App/component/Dark.png">
</tr>
<thead>
<th>Bookmark Editor</th>
<th></th>
<th>Preferences</th>
</thead>
<tr>
<td><img src="https://raw.githubusercontent.com/wiki/int128/bntp/main/cypress/screenshots/App.cy.tsx/App%20--%20opens%20the%20bookmark%20editor.png"></td>
<td></td>
<td><img src="https://github.com/int128/bntp/wiki/main/__screenshots__/BookmarkEditor/component/Primary.png"></td>
<td><img src="https://github.com/int128/bntp/wiki/main/__screenshots__/Preferences/component/Primary.png"></td>
</tr>
</table>

Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@
"devDependencies": {
"@storybook/react": "^8.0.8",
"@storybook/react-vite": "^8.0.8",
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "15.0.6",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@tsconfig/vite-react": "^3.0.1",
"@types/chrome": "0.0.267",
"@types/node": "20.12.8",
"@types/react": "18.3.1",
"@types/chrome": "0.0.268",
"@types/node": "20.14.9",
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint": "^9.0.0",
"eslint-plugin-react": "^7.34.1",
"jsdom": "^24.0.0",
"prettier": "3.2.5",
"prettier": "3.3.2",
"storybook": "^8.0.8",
"storycap": "^5.0.0",
"typescript": "5.4.5",
"typescript": "5.5.2",
"typescript-eslint": "^7.5.0",
"vite": "^5.1.6",
"vitest": "^1.4.0"
}
},
"packageManager": "[email protected]"
}
Loading

0 comments on commit 913baba

Please sign in to comment.