Skip to content

Commit

Permalink
Fix-storybook-issues (#4974)
Browse files Browse the repository at this point in the history
* fix buildkite command

* fix build commands to include docs

* fix tailwind docs scan

* fix more commands

* fix more commands

* fix docs flag

* add fake changeset

* fix gha

* fix turbo command

* fix turbo commands

* remove caches

* fix typo

* wait for tailwind to finish

* fix turbo commands

* removed unused command

* update gitignore

* turn turbo cache off

* turn turbo cache off

---------

Co-authored-by: Geoffrey Chong <[email protected]>
  • Loading branch information
gyfchong and Geoffrey Chong authored Aug 27, 2024
1 parent de29c45 commit abac598
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/build-storybook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set -e

corepack enable
pnpm install --frozen-lockfile
pnpm turbo @docs/storybook#build -- --docs
pnpm turbo @docs/storybook#build:docs
tar -czf ./storybook.tar.gz ./docs/storybook-static
5 changes: 5 additions & 0 deletions .changeset/olive-shirts-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/hosted-assets": patch
---

Remove this
10 changes: 5 additions & 5 deletions .github/workflows/test-stories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ jobs:
steps:
- run: echo "Run the Storybook tests"

build-storybook:
build-test-storybook:
needs: run-check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm turbo @docs/storybook#build:docs -- --test
- run: pnpm turbo @docs/storybook#build:test
- name: Upload Storybook build as artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -50,7 +50,7 @@ jobs:

storybook-tests-1:
name: "test-storybook"
needs: build-storybook
needs: build-test-storybook
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -66,7 +66,7 @@ jobs:

storybook-tests-2:
name: "test-storybook"
needs: build-storybook
needs: build-test-storybook
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand All @@ -82,7 +82,7 @@ jobs:

storybook-tests-3:
name: "test-storybook"
needs: build-storybook
needs: build-test-storybook
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ docs/storybook-static
docs/.storybook/preview.css
.DS_Store
dist
.cache
.yalc
yalc.loc
.turbo
9 changes: 5 additions & 4 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
"scripts": {
"lint": "eslint .",
"lint:ts": "tsc --noEmit",
"dev": "pnpm build:tailwind && storybook dev -p 6006",
"dev": "storybook dev -p 6006",
"preview": "NODE_ENV=production pnpm dev --docs",
"build:docs": "pnpm build:tailwind && storybook build",
"build:chromatic": "pnpm build:docs --webpack-stats-json",
"build:docs": "storybook build --docs",
"build:test": "storybook build --test",
"build:chromatic": "storybook build --webpack-stats-json",
"build:tailwind": "npx tailwindcss -i ./tailwind.css -o ./.storybook/preview.css",
"test": "test-storybook --skipTags='skip-test' --url http://127.0.0.1:6006",
"clean": "rimraf ./storybook-static && rimraf ./node_modules"
"clean": "rimraf './storybook-static' './node_modules' '.turbo'"
},
"dependencies": {
"react": "^18.3.1",
Expand Down
1 change: 1 addition & 0 deletions docs/tailwind.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Preset } from "@kaizen/tailwind"

module.exports = {
content: [
"../packages/tailwind/src/_docs/**/*.{ts,tsx}",
"../packages/**/*.mdx",
"../packages/**/*.stories.{ts,tsx}",
"./**/*.{ts,tsx,mdx}",
Expand Down
28 changes: 23 additions & 5 deletions pnpm-lock.yaml

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

20 changes: 18 additions & 2 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"dev": {
"dependsOn": ["^build"]
},
"@docs/storybook#dev": {
"dependsOn": ["^build", "build:tailwind"],
"cache": false
},
"lint:ts": {
"dependsOn": ["^build"]
},
Expand All @@ -17,14 +21,26 @@
"clean": {
"cache": false
},
"@docs/storybook#build:docs": {
"@docs/storybook#build:tailwind": {
"dependsOn": ["^build"],
"inputs": ["packages/**", "docs/**"],
"outputs": ["docs/.storybook/preview.css"],
"cache": false
},
"@docs/storybook#build:docs": {
"dependsOn": ["^build", "build:tailwind"],
"inputs": ["packages/**", "docs/**"],
"outputs": ["docs/storybook-static/**"],
"cache": false
},
"@docs/storybook#build:test": {
"dependsOn": ["^build", "build:tailwind"],
"inputs": ["packages/**", "docs/**"],
"outputs": ["docs/storybook-static/**"],
"cache": false
},
"@docs/storybook#build:chromatic": {
"dependsOn": ["^build"],
"dependsOn": ["^build", "build:tailwind"],
"outputs": ["docs/storybook-static/**"],
"cache": false
},
Expand Down

0 comments on commit abac598

Please sign in to comment.