Skip to content

Setup Storybook#8596

Open
bilalabbad wants to merge 9 commits intodevelopfrom
bab-design-system
Open

Setup Storybook#8596
bilalabbad wants to merge 9 commits intodevelopfrom
bab-design-system

Conversation

@bilalabbad
Copy link
Contributor

@bilalabbad bilalabbad commented Mar 13, 2026

This setup storybook and CI for it. Currently the storybook is empty. Components will be added in futur PRs.

Summary by CodeRabbit

  • New Features

    • Added a new design-system package with local dev, build, lint, format, and Storybook support.
  • Chores

    • Reorganized the UI library into the new design-system package and removed legacy UI package artifacts.
    • Updated CI/workflow paths and bumped Node.js runtime to v24.
    • Expanded ignore rules for design-system build artifacts and removed obsolete config files.

@bilalabbad bilalabbad self-assigned this Mar 13, 2026
@bilalabbad bilalabbad requested a review from a team as a code owner March 13, 2026 15:23
@bilalabbad bilalabbad added the group/frontend Issue related to the frontend (React) label Mar 13, 2026
@github-actions github-actions bot added the group/ci Issue related to the CI pipeline label Mar 13, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8c5bb615-7b32-4153-b00f-b7e3dffc19e7

📥 Commits

Reviewing files that changed from the base of the PR and between 333f6bc and 5895bf0.

📒 Files selected for processing (1)
  • .github/workflows/chromatic.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/chromatic.yml

Walkthrough

The PR replaces the existing UI package under frontend/packages/ui with a new frontend/design-system package. CI was updated to target the new path and Node.js was bumped to 24. The old UI package manifest, build/config files, components, stories, and tooling configs were removed. The design-system package adds package.json, TypeScript config, Vite config, Storybook config and preview, Tailwind entry CSS, and formatter/linter configs (oxfmt, oxlint). .gitignore rules were simplified globally and augmented with design-system-specific ignores.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is minimal but coherent, stating the PR purpose (setup Storybook and CI) and acknowledging that components will be added later. However, it lacks the structured sections recommended by the template such as 'Why', 'What changed', 'How to review', 'How to test', and 'Impact & rollout'. Expand the description with structured sections from the template: explain the problem being solved, detail specific changes (e.g., design-system migration, CI updates), provide testing instructions, and clarify any backward compatibility or deployment implications.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Setup Storybook' accurately describes the main objective of the PR, which involves setting up Storybook infrastructure and CI configuration for it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (4)
frontend/design-system/oxlint.config.ts (1)

4-12: Consider downgrading nursery category from "error" to "warn".

The nursery category contains experimental and unstable rules that may change between oxlint versions. Setting it to "error" could cause unexpected CI failures after dependency updates.

♻️ Proposed fix
   categories: {
     correctness: "error",
-    nursery: "error",
+    nursery: "warn",
     pedantic: "error",
     perf: "error",
     restriction: "error",
     style: "error",
     suspicious: "error",
   },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/design-system/oxlint.config.ts` around lines 4 - 12, The oxlint
config currently treats the "nursery" rules as errors which can cause CI
failures for experimental rules; update the categories object in
oxlint.config.ts by changing the nursery setting from "error" to "warn" (modify
the categories { ..., nursery: "error", ... } entry), commit the change, and
ensure any CI/lint scripts still run with the new severity.
frontend/design-system/package.json (1)

18-25: Move build-only dependencies to devDependencies.

@tailwindcss/vite is a Vite plugin used only during build/development, not a runtime dependency. It should be in devDependencies alongside the other Vite tooling.

♻️ Proposed fix
   "dependencies": {
-    "@tailwindcss/vite": "^4.2.1",
     "react": "^19.2.0",
     "react-dom": "^19.2.0",
     "tailwind-merge": "^3.5.0",
     "tailwind-variants": "^3.2.2",
     "tailwindcss": "^4.2.1"
   },
   "devDependencies": {
     "@storybook/react-vite": "^10.2.18",
+    "@tailwindcss/vite": "^4.2.1",
     "@types/node": "^25.5.0",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/design-system/package.json` around lines 18 - 25, The dependency
"@tailwindcss/vite" is declared under "dependencies" but is a build/dev-only
Vite plugin; move it from "dependencies" to "devDependencies" in the
package.json so it isn't installed at runtime—update the package.json object by
removing "@tailwindcss/vite" from "dependencies" and adding the same entry under
"devDependencies" alongside the existing Vite/tooling packages.
frontend/design-system/vite.config.ts (1)

1-15: Missing path alias resolution for @/* imports.

The tsconfig.json defines a @/*./src/* path alias (line 14-16 in tsconfig.json), but Vite won't resolve these imports at build time without additional configuration. The frontend/app/vite.config.ts handles this with the vite-tsconfig-paths plugin.

Either add the plugin or configure resolve.alias directly. Currently the design-system package.json doesn't include vite-tsconfig-paths as a dependency.

♻️ Proposed fix using vite-tsconfig-paths

First, add the dependency:

npm install -D vite-tsconfig-paths

Then update the config:

 import tailwindcss from "@tailwindcss/vite";
 import react from "@vitejs/plugin-react";
 import { defineConfig } from "vite";
+import tsconfigPaths from "vite-tsconfig-paths";
 
 // https://vite.dev/config/
 export default defineConfig({
   plugins: [
     react({
       babel: {
         plugins: [["babel-plugin-react-compiler"]],
       },
     }),
     tailwindcss(),
+    tsconfigPaths(),
   ],
 });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/design-system/vite.config.ts` around lines 1 - 15, Vite config is
not resolving the TypeScript path alias `@/*` defined in tsconfig, so imports
will break at build; add the vite-tsconfig-paths plugin (install it as a dev
dependency) and include it in the plugins array of the export in vite.config.ts
(or alternatively set resolve.alias to map "@/": "./src/"); update the plugins
list where react(...) and tailwindcss() are added so vite-tsconfig-paths runs
before other plugins to ensure `@/*` imports resolve.
frontend/design-system/tsconfig.json (1)

40-47: Consider including .storybook directory for type-checking.

The .storybook/main.ts and .storybook/preview.ts files are TypeScript but not included in the compilation scope. This means they won't benefit from the strict type-checking configured here.

♻️ Proposed fix
   "include": [
     "src",
+    ".storybook",
     "tests/mocks",
     "tests/unit/components",
     "tests/unit/utils",
     "tests/unit/data",
     "tests/integrations/tests"
   ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/design-system/tsconfig.json` around lines 40 - 47, The tsconfig
include array currently omits Storybook config so TypeScript won't check
.storybook files; update the "include" in frontend/design-system/tsconfig.json
(the include array used by the compiler) to add the ".storybook" directory so
.storybook/main.ts and .storybook/preview.ts are covered by the project
type-checking and strict rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/chromatic.yml:
- Around line 16-18: The workflow's defaults.run.working-directory value is
missing the leading "./" and should be corrected; update the defaults -> run ->
working-directory entry from ".frontend/design-system" to
"./frontend/design-system" so the job runs in the intended directory (adjust the
value under the defaults.run.working-directory key in the chromatic.yml file).

In `@frontend/design-system/oxlint.config.ts`:
- Around line 13-21: The plugins array in oxlint.config.ts includes "vitest" but
vitest isn't installed; either remove the "vitest" entry from the plugins array
or install vitest as a dev dependency. To fix, edit the plugins array in
oxlint.config.ts to drop "vitest" if you don't plan to run tests, or run your
package manager to add vitest as a devDependency (e.g., npm/yarn/pnpm add -D
vitest) and update package.json accordingly so the "vitest" plugin is valid.

---

Nitpick comments:
In `@frontend/design-system/oxlint.config.ts`:
- Around line 4-12: The oxlint config currently treats the "nursery" rules as
errors which can cause CI failures for experimental rules; update the categories
object in oxlint.config.ts by changing the nursery setting from "error" to
"warn" (modify the categories { ..., nursery: "error", ... } entry), commit the
change, and ensure any CI/lint scripts still run with the new severity.

In `@frontend/design-system/package.json`:
- Around line 18-25: The dependency "@tailwindcss/vite" is declared under
"dependencies" but is a build/dev-only Vite plugin; move it from "dependencies"
to "devDependencies" in the package.json so it isn't installed at runtime—update
the package.json object by removing "@tailwindcss/vite" from "dependencies" and
adding the same entry under "devDependencies" alongside the existing
Vite/tooling packages.

In `@frontend/design-system/tsconfig.json`:
- Around line 40-47: The tsconfig include array currently omits Storybook config
so TypeScript won't check .storybook files; update the "include" in
frontend/design-system/tsconfig.json (the include array used by the compiler) to
add the ".storybook" directory so .storybook/main.ts and .storybook/preview.ts
are covered by the project type-checking and strict rules.

In `@frontend/design-system/vite.config.ts`:
- Around line 1-15: Vite config is not resolving the TypeScript path alias `@/*`
defined in tsconfig, so imports will break at build; add the vite-tsconfig-paths
plugin (install it as a dev dependency) and include it in the plugins array of
the export in vite.config.ts (or alternatively set resolve.alias to map "@/":
"./src/"); update the plugins list where react(...) and tailwindcss() are added
so vite-tsconfig-paths runs before other plugins to ensure `@/*` imports
resolve.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5604209a-f51c-49d3-9564-bb6ef0b7f656

📥 Commits

Reviewing files that changed from the base of the PR and between cf15488 and 333f6bc.

⛔ Files ignored due to path filters (18)
  • frontend/design-system/package-lock.json is excluded by !**/package-lock.json
  • frontend/package-lock.json is excluded by !**/package-lock.json
  • frontend/packages/ui/package-lock.json is excluded by !**/package-lock.json
  • frontend/packages/ui/src/stories/assets/accessibility.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/accessibility.svg is excluded by !**/*.svg
  • frontend/packages/ui/src/stories/assets/addon-library.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/assets.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/context.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/discord.svg is excluded by !**/*.svg
  • frontend/packages/ui/src/stories/assets/docs.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/figma-plugin.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/github.svg is excluded by !**/*.svg
  • frontend/packages/ui/src/stories/assets/share.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/styling.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/testing.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/theming.png is excluded by !**/*.png
  • frontend/packages/ui/src/stories/assets/tutorials.svg is excluded by !**/*.svg
  • frontend/packages/ui/src/stories/assets/youtube.svg is excluded by !**/*.svg
📒 Files selected for processing (32)
  • .github/workflows/chromatic.yml
  • frontend/.gitignore
  • frontend/design-system/.gitignore
  • frontend/design-system/.storybook/main.ts
  • frontend/design-system/.storybook/preview.ts
  • frontend/design-system/oxfmt.config.ts
  • frontend/design-system/oxlint.config.ts
  • frontend/design-system/package.json
  • frontend/design-system/src/index.css
  • frontend/design-system/tsconfig.json
  • frontend/design-system/vite.config.ts
  • frontend/packages/ui/.eslintrc.cjs
  • frontend/packages/ui/.storybook/main.ts
  • frontend/packages/ui/.storybook/preview.css
  • frontend/packages/ui/README.md
  • frontend/packages/ui/index.ts
  • frontend/packages/ui/package.json
  • frontend/packages/ui/postcss.config.js
  • frontend/packages/ui/src/components/Badge/Badge.stories.tsx
  • frontend/packages/ui/src/components/Badge/Badge.tsx
  • frontend/packages/ui/src/components/Badge/index.ts
  • frontend/packages/ui/src/index.css
  • frontend/packages/ui/src/stories/Configure.mdx
  • frontend/packages/ui/src/stories/assets/avif-test-image.avif
  • frontend/packages/ui/src/tsconfig.node.json
  • frontend/packages/ui/src/utils/cn.ts
  • frontend/packages/ui/src/vite-env.d.ts
  • frontend/packages/ui/tailwind.config.js
  • frontend/packages/ui/tsconfig.app.json
  • frontend/packages/ui/tsconfig.json
  • frontend/packages/ui/tsconfig.node.json
  • frontend/packages/ui/vite.config.ts
💤 Files with no reviewable changes (20)
  • frontend/packages/ui/postcss.config.js
  • frontend/packages/ui/src/components/Badge/index.ts
  • frontend/packages/ui/src/vite-env.d.ts
  • frontend/packages/ui/.eslintrc.cjs
  • frontend/packages/ui/src/components/Badge/Badge.tsx
  • frontend/packages/ui/tailwind.config.js
  • frontend/packages/ui/src/components/Badge/Badge.stories.tsx
  • frontend/packages/ui/src/index.css
  • frontend/.gitignore
  • frontend/packages/ui/src/utils/cn.ts
  • frontend/packages/ui/index.ts
  • frontend/packages/ui/README.md
  • frontend/packages/ui/.storybook/main.ts
  • frontend/packages/ui/tsconfig.app.json
  • frontend/packages/ui/src/stories/Configure.mdx
  • frontend/packages/ui/package.json
  • frontend/packages/ui/tsconfig.json
  • frontend/packages/ui/.storybook/preview.css
  • frontend/packages/ui/vite.config.ts
  • frontend/packages/ui/tsconfig.node.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/ci Issue related to the CI pipeline group/frontend Issue related to the frontend (React)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants