Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/visual-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Visual Regression
on:
pull_request:
branches: [graphiql-6]
permissions:
contents: read
jobs:
lost-pixel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: yarn
- run: yarn install --immutable
- run: yarn build
- run: yarn workspace @graphiql/react build-storybook
- uses: lost-pixel/lost-pixel@v3.22.0
env:
LOST_PIXEL_CONFIG_DIR: packages/graphiql-react
- if: failure()
uses: actions/upload-artifact@v4
with:
name: lost-pixel-difference
path: packages/graphiql-react/.lostpixel/difference/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ packages/graphiql/webpack/
.react-router/

storybook-static/

packages/graphiql-react/.lostpixel/current/
packages/graphiql-react/.lostpixel/difference/
2 changes: 2 additions & 0 deletions packages/graphiql-react/.lostpixel/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
current
difference
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions packages/graphiql-react/lostpixel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type {import('lost-pixel').CustomProjectConfig} */
export default {
storybookShots: {
storybookUrl: './storybook-static',
},
imagePathBaseline: './.lostpixel/baseline',
imagePathCurrent: './.lostpixel/current',
imagePathDifference: './.lostpixel/difference',
threshold: 0.001,
failOnDifference: true,
generateOnly: true,
storybookConfig: {
mask: [],
},
};
5 changes: 4 additions & 1 deletion packages/graphiql-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"build": "vite build",
"build-storybook": "storybook build",
"storybook": "storybook dev -p 6006",
"test": "vitest run --typecheck"
"test": "vitest run --typecheck",
"test:vr": "lost-pixel",
"test:vr:update": "lost-pixel update"
},
"peerDependencies": {
"graphql": "^15.5.0 || ^16.0.0 || ^17.0.0",
Expand Down Expand Up @@ -80,6 +82,7 @@
"@vitejs/plugin-react": "^4.4.1",
"babel-plugin-react-compiler": "19.1.0-rc.1",
"graphql": "^16.9.0",
"lost-pixel": "^3.22.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"storybook": "^10.3.6",
Expand Down
1 change: 1 addition & 0 deletions resources/custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ linenumbers
linkify
listbox
listvalues
lostpixel
lostplan
maint
manypkg
Expand Down
Loading
Loading