Skip to content

Commit

Permalink
feat: approve patch (#2041)
Browse files Browse the repository at this point in the history
* feat: approve patch

* chore: use vite-plugin-turbosnap
  • Loading branch information
9renpoto authored Feb 23, 2024
1 parent 99f4aa2 commit e3b9187
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Approve a PR
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Enable auto-merge for Dependabot PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ jobs:
uses: chromaui/action@v10
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true # 👈 Required option to enable TurboSnap
skip: "@(renovate/**|dependabot/**)"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.turbo/
lib/
storybook-static/

Expand Down
10 changes: 9 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
"rust",
"typescript"
],
"words": ["Autoprefix", "gtag", "lucide", "preact", "serde"]
"words": [
"autodocs",
"Autoprefix",
"gtag",
"lucide",
"preact",
"serde",
"turbosnap"
]
}
9 changes: 8 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { StorybookConfig } from "@storybook/preact-vite";
import { mergeConfig } from "vite";
import turbosnap from "vite-plugin-turbosnap";

const config: StorybookConfig = {
stories: ["../src/**/*.stories.@(ts|tsx)"],
Expand All @@ -12,6 +14,15 @@ const config: StorybookConfig = {
name: "@storybook/preact-vite",
options: {},
},
async viteFinal(config, { configType }) {
const isProduction = configType === "PRODUCTION";

return mergeConfig(config, {
plugins: isProduction
? [turbosnap({ rootDir: config.root ?? process.cwd() })]
: [],
});
},
docs: {
autodocs: "tag",
},
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"@testing-library/preact": "^3.2.3",
"@twind/preset-autoprefix": "^1.0.7",
"@twind/preset-tailwind": "^1.1.4",
"storybook": "^7.6.17"
"storybook": "^7.6.17",
"vite-plugin-turbosnap": "^1.0.3"
},
"typings": "lib/index.d.ts",
"dependencies": {
Expand Down

0 comments on commit e3b9187

Please sign in to comment.