Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support css modules in storybook #4931

Merged
merged 102 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from 96 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
d20d5c7
wip: working fresh storybook vite
Aug 16, 2024
6ede709
moved over old storybook config
Aug 16, 2024
f81087c
migrate old preview and test runner
Aug 16, 2024
9877b68
delete old storybook
Aug 16, 2024
5b42427
migrate tailwind package to package-bundler
Aug 16, 2024
c211ad0
remove unnecessary config
Aug 16, 2024
0bcc975
remove old docs
Aug 16, 2024
7ebc318
migrated design-tokens to packaghe-bundler
Aug 16, 2024
762f5c4
shuffled
Aug 16, 2024
f2cba31
add KAIO styles
Aug 16, 2024
9a0cea4
generate the tailwind css within the kaizen/tailwind package and use …
Aug 16, 2024
99bf4ab
fix tailwind docs
Aug 16, 2024
04c4de7
remove unused tailwind + update build config
Aug 16, 2024
db5c0ef
Fix linting
Aug 16, 2024
3ce07b7
remove unused paths in root tsconfig
Aug 16, 2024
9100ada
fix types
Aug 19, 2024
a787f4a
fix lint
Aug 19, 2024
261e4c5
Merge branch 'main' into support-css-modules-in-storybook
gyfchong Aug 19, 2024
edfabb6
add changeset
Aug 19, 2024
82134f8
Merge branch 'support-css-modules-in-storybook' of github.com:culture…
Aug 19, 2024
eeec01a
working
Aug 19, 2024
081dc0d
fix aliases
Aug 19, 2024
69eee7d
move KAIO to dep for storybook
Aug 19, 2024
fda2db0
fixed turbo
Aug 19, 2024
c76625c
fix pnpm lock
Aug 19, 2024
d56e00a
fix types
Aug 19, 2024
5424945
Update .gitignore
gyfchong Aug 19, 2024
29d1d76
target current directory for config
Aug 19, 2024
cfbe04e
fix build
Aug 19, 2024
4feca65
Merge branch 'support-css-modules-in-storybook' of github.com:culture…
Aug 19, 2024
faeaaad
encapsulate storybook commands into storybook workspace
Aug 19, 2024
57c81eb
fixups
Aug 19, 2024
1c6b360
fix type errors
Aug 19, 2024
f3c1a0d
fix type errors
Aug 19, 2024
ce31a6d
introduce css linting
Aug 19, 2024
4e175a3
remove postcss from root
Aug 19, 2024
f0fa928
pt1 of root dep clean up
Aug 19, 2024
e4b49b9
update pnpm lock
Aug 19, 2024
bd97f49
fix playwright
Aug 19, 2024
65b0da4
move token stories to design-tokens package
Aug 19, 2024
2b56bf3
fix storybook deps
Aug 19, 2024
53cda36
more deps shuffling
Aug 19, 2024
b2c9fab
move stylinting to the root
Aug 19, 2024
0e60035
comment on dev deps
Aug 19, 2024
9d2f9f1
add types for react-highlight
Aug 19, 2024
112722c
add chromatic to storybook
Aug 19, 2024
4951259
add standard styleint config
Aug 19, 2024
dbda2a0
upgrade pnpm version
Aug 20, 2024
0fd23d3
fix pnpm lock??
Aug 20, 2024
cadc02f
remove need for exporting styles
Aug 20, 2024
561199a
Update packages/tailwind/src/_docs/pages/modifiers/media-queries.stor…
gyfchong Aug 20, 2024
3b01ade
Update packages/tailwind/src/_docs/pages/working-with-tailwind.storie…
gyfchong Aug 20, 2024
e534ef6
Update .storybook/components/StickerSheet/types.ts
gyfchong Aug 20, 2024
e8b565e
cleanup
Aug 20, 2024
cad6078
Merge branch 'support-css-modules-in-storybook' of github.com:culture…
Aug 20, 2024
5f6d9da
fix name of dosanddons
Aug 20, 2024
5a5bfeb
fix name of dosanddons
Aug 20, 2024
2a87f69
update storybook components
Aug 20, 2024
54b9495
fix
Aug 20, 2024
857457c
add back highlight.js
Aug 20, 2024
1fa2342
bring back black and spacing updates
Aug 20, 2024
f01f95f
restore
Aug 20, 2024
0e45ea7
fix ups
Aug 20, 2024
838e73a
fix ups
Aug 20, 2024
c059910
fix design-tokens distribution
Aug 20, 2024
ed08d5c
fix design-tokens distribution
Aug 20, 2024
79eb4b8
fix tailwind KAIO references
Aug 20, 2024
9b896b4
build before lint ts
Aug 20, 2024
5826bc6
get rid of render-hook
Aug 20, 2024
3169574
up the numbers
Aug 20, 2024
4991344
added changesets
Aug 20, 2024
dea9ee5
added changesets
Aug 20, 2024
88390dd
deprecate useResizeObserver
Aug 20, 2024
a31b68c
update changese
Aug 20, 2024
d86e2b3
fix storybook test gha
Aug 20, 2024
5ac4337
moved storybook output file
Aug 20, 2024
73badcd
fix chromatic gha build
Aug 20, 2024
6e16436
fix shard command to chromatic test
Aug 20, 2024
f4f27cf
move storybook to docs
Aug 20, 2024
c458d01
fix chromatic workflow
Aug 20, 2024
c754be6
introduce chromatic command
Aug 20, 2024
c01e547
fix lint
Aug 20, 2024
b13e4ba
fix tailwind for docs
Aug 20, 2024
e75ab0f
fix publish shell script
Aug 20, 2024
785b4c7
fix gitignore
Aug 20, 2024
429aaf9
update ignores
Aug 20, 2024
40c4710
fix aliases
Aug 20, 2024
d829d0f
fix docs tailwind config
Aug 21, 2024
32d2989
Merge branch 'main' into support-css-modules-in-storybook
gyfchong Aug 21, 2024
6a098be
fix pseudo storybook addon
Aug 21, 2024
d04085c
Merge branch 'main' into support-css-modules-in-storybook
gyfchong Aug 21, 2024
350dd8e
Merge branch 'support-css-modules-in-storybook' of github.com:culture…
Aug 21, 2024
8d4ede5
update stylelint rules for CSS
Aug 21, 2024
9dafe21
move @types/react to root for all packages to use
Aug 21, 2024
936a53c
moved types.d.ts into individual packages
Aug 21, 2024
9a06254
fix docs
Aug 21, 2024
097344a
fixups
Aug 22, 2024
ac8eb8b
moved chromatic from KAIO to root
Aug 22, 2024
50c2385
shuffled deps
Aug 22, 2024
9ae640a
move docs util/tailwind.css to preview.css and ignore
Aug 22, 2024
f1309f2
fix linting
Aug 22, 2024
2da5bdd
fix chromatic flag
Aug 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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:storybook:build:prod
pnpm turbo @docs/storybook#build -- --docs
tar -czf ./storybook.tar.gz ./storybook/public
2 changes: 1 addition & 1 deletion .buildkite/scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "Publishing to ${KAIZEN_DOMAIN_NAME}"

# Publish to production bucket
aws s3 sync --delete \
"storybook/public" \
"docs/storybook-static" \
"s3://${KAIZEN_DOMAIN_NAME}/storybook"

aws cloudfront create-invalidation \
Expand Down
5 changes: 5 additions & 0 deletions .changeset/cool-oranges-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kaizen/hosted-assets": minor
---

Deprecated hosted-assets in favour of KAIO
7 changes: 7 additions & 0 deletions .changeset/strong-apples-clap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@kaizen/design-tokens": minor
"@kaizen/tailwind": minor
---

- Added ESM bundle
- Fixed design-tokens js entrypoint
6 changes: 6 additions & 0 deletions .changeset/strong-pigs-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kaizen/components": minor
---

- Exported types from LikertScale
- Deprecated `useResizeObserver` in favour of native DOM API `ResizeObserver`
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/packages/**/dist
/packages/components/src/Icon/bin/Template.tsx
storybook/public
/docs/storybook-static
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ module.exports = {
overrides: [
{
files: [
"storybook/*",
".storybook/*",
"**/_docs/**/*",
"**/__tests__/**/*",
"*.stories.tsx",
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/run-storybook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ runs:
uses: actions/download-artifact@v3
with:
name: ${{ inputs.artifactName }}
path: "./storybook/public"
path: "./docs/storybook-static"
- name: Run storybook
uses: Eun/http-server-action@v1
with:
directory: "./storybook/public"
directory: "./docs/storybook-static"
port: 6006
4 changes: 2 additions & 2 deletions .github/workflows/chromatic-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/setup
- name: Build Storybook
run: pnpm turbo:storybook:build
run: pnpm turbo @docs/storybook#build:chromatic
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
token: ${{ github.token }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: "./storybook/public"
storybookBuildDir: "./docs/storybook-static"
autoAcceptChanges: main # 👈 Auto accept main builds (why https://www.chromatic.com/docs/github-actions#github-squashrebase-merge-and-the-main-branch)
15 changes: 8 additions & 7 deletions .github/workflows/test-stories.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: pnpm turbo:storybook:build:test
- run: pnpm turbo @docs/storybook#build -- --test
- name: Upload Storybook build as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: "./storybook/public"
path: "./docs/storybook-static"
retention-days: 1

storybook-tests-1:
Expand All @@ -62,7 +62,7 @@ jobs:
with:
artifactName: ${{ env.ARTIFACT_NAME }}
- name: Storybook tests (1/3)
run: pnpm storybook:test --shard 1/3
run: pnpm -F @docs/storybook test -- --shard 1/3

storybook-tests-2:
name: "test-storybook"
Expand All @@ -78,7 +78,7 @@ jobs:
with:
artifactName: ${{ env.ARTIFACT_NAME }}
- name: Storybook tests (2/3)
run: pnpm storybook:test --shard 2/3
run: pnpm -F @docs/storybook test -- --shard 2/3

storybook-tests-3:
name: "test-storybook"
Expand All @@ -94,7 +94,7 @@ jobs:
with:
artifactName: ${{ env.ARTIFACT_NAME }}
- name: Storybook tests (3/3)
run: pnpm storybook:test --shard 3/3
run: pnpm -F @docs/storybook test -- --shard 3/3

chromatic:
needs: run-check
Expand All @@ -109,17 +109,18 @@ jobs:
- uses: ./.github/actions/setup
- name: Build Storybook for Chromatic
# We want both stories and docs for the branch preview
run: pnpm turbo:storybook:build:chromatic-turbo-snap
run: pnpm turbo @docs/storybook#build:chromatic
- id: publishChromatic
name: Publish to Chromatic
uses: chromaui/action@v11
with:
token: ${{ github.token }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: "./storybook/public"
storybookBuildDir: "./docs/storybook-static"
onlyChanged: "!(main)"
externals: |
**/!(*.module).scss
**/!(*.module).css
packages/components/**/*.css
gyfchong marked this conversation as resolved.
Show resolved Hide resolved

update-branch-preview:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules
yarn-*.log
/storybook/public/
docs/storybook-static
.DS_Store
dist
.cache
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# Explicitly ignore...
pnpm-lock.yaml
**/node_modules/
/storybook/public/
/docs/storybook-static/
/docs/utils/tailwind.css
/packages/**/dist
/packages/components/locales
/packages/design-tokens/css
7 changes: 6 additions & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
packages/design-tokens/**/*.scss
packages/design-tokens/**/*.css
packages/components/locales/*
storybook/styles/*
packages/components/dist/*
packages/design-tokens/dist/*
packages/tailwind/dist/*
gyfchong marked this conversation as resolved.
Show resolved Hide resolved
docs/storybook-static/*
docs/utils/tailwind.css
docs/tailwind.css
8 changes: 8 additions & 0 deletions .stylelintrc-css.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('stylelint').Config} */
// For CSS linting only, SCSS linting is handled in the root .stylelintrc.json
export default {
extends: "stylelint-config-standard",
rules: {
"selector-class-pattern": null,
},
}
File renamed without changes.
File renamed without changes
Loading
Loading