Skip to content

Conversation

@AliceR
Copy link
Member

@AliceR AliceR commented Sep 15, 2025

Proposes renaming /storybook to /core and establishing it as the primary location for library components with gradual migration from the current scattered structure.

Context

  • Current library components are scattered throughout /app directory
  • Need clear separation between library and application-specific code
  • Opportunity to modernize build system based on successful Vite adoption

Proposed Solution

  • Rename /storybook → /core to reflect library purpose
  • Gradual migration strategy with backward compatibility
  • Dual build system during transition (legacy Parcel + new Vite)
  • Re-export strategy to avoid immediate component copying
  • Future state: standalone /core package

Benefits

  • Modern development environment with Vite
  • Clear component library boundaries
  • Unified documentation and development
  • Future-proof architecture for standalone library
  • Low-risk incremental migration path

With this setup, it will be much easier to keep track of our refactor and migration work!

Update: After this discussion, there was a slight shift in direction. Instead of renaming /storybook to /core, we’re moving toward a monorepo-based structure where the library lives under packages/veda-ui/. The goals and motivations below still apply.

Action items:

Proposes renaming /storybook to /core and establishing it as the primary
location for library components with gradual migration from the current
scattered structure.

## Context
- Current library components are scattered throughout /app directory
- Need clear separation between library and application-specific code
- Opportunity to modernize build system based on successful Vite adoption

## Proposed Solution
- Rename /storybook → /core to reflect library purpose
- Gradual migration strategy with backward compatibility
- Dual build system during transition (legacy Parcel + new Vite)
- Re-export strategy to avoid immediate component copying
- Future state: standalone /core package

## Benefits
- Modern development environment with Vite
- Clear component library boundaries
- Unified documentation and development
- Future-proof architecture for standalone library
- Low-risk incremental migration path

Addresses the natural evolution from the successful split architecture
that enabled Storybook development, building on proven Vite benefits.
@netlify
Copy link

netlify bot commented Sep 15, 2025

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit 056067a
🔍 Latest deploy log https://app.netlify.com/projects/veda-ui/deploys/6943f2f13e3906000820dbbb
😎 Deploy Preview https://deploy-preview-1871--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vgeorge
Copy link
Contributor

vgeorge commented Sep 22, 2025

Hi @AliceR, thanks for putting this ADR together, this is much needed. I agree with the problem statement and the decision to give our component library a proper home.

Thinking about the long term, I’d like to propose a small shift. My view is that the component library should be a standalone package, and apps like Storybook or the legacy SPA should be separated from it. Storybook is just a dev viewer for components (and potentially a docs website in the future), and the SPA in /app is a instance app that uses them and will be deprecated in the future in favor of next-veda-ui.

That’s why I think it makes sense to set up a monorepo with /packages and /apps. It gives us the target structure right away, and the migration then becomes about moving things into the right place.

Proposed steps

Step 1 – Create structure
Root package.json with workspaces (pnpm or yarn). Add /packages and /apps. Create /packages/components as the new clean library folder.

Step 2 – Start migrating components
Bring over the most critical pieces from /app/scripts/components. Keep compatibility by re-exporting.

Step 3 – Move Storybook
Relocate to /apps/storybook. Reconfigure it to import from /packages/components.

Step 4 – Isolate legacy SPA and shared code
Move /app to /apps/legacy-spa. Extract shared utilities into /packages/utils.

Why this path

  • Clear separation between reusable packages and runnable apps
  • Proper decoupling between the library and its consumers
  • A standard, scalable setup that matches what we’ll need as VEDA grows

This follows the spirit of your ADR but pushes us to a more conventional and future-proof end state.

@aboydnw
Copy link
Contributor

aboydnw commented Oct 28, 2025

How does this approach integrate with the plugin framework repo that we recently started, and with this idea that the plugin marketplace will have plugins made from components outside of veda-ui?

@vgeorge
Copy link
Contributor

vgeorge commented Nov 11, 2025

@AliceR given that we are entering maintenance mode on veda-ui and focusing on bug fixes and maintenance tasks, do you think we should close this?

@AliceR
Copy link
Member Author

AliceR commented Nov 11, 2025

We could also merge it as "proposed", for posterity – what do you think?

@vgeorge
Copy link
Contributor

vgeorge commented Nov 11, 2025

I think we can merge, but could we update the ADR to reference this PR and #1898? That one introduced the monorepo structure we discussed in check-ins, and linking both would help preserve the context.

@vgeorge
Copy link
Contributor

vgeorge commented Nov 21, 2025

It would be nice to hear feedback from the rest of the team on this ADR.

cc @dzole0311 @ifsimicoded @snmln

@ifsimicoded
Copy link
Contributor

ifsimicoded commented Nov 21, 2025

If the goal is simply to move files, and introduce a new build (while maintaining the old), I'm not sure it's worth the time. If this is just phase 1 of a committed larger refactor by more than a couple individuals, that makes sense!

Very keen on these broad goals:

  • Clear component library boundaries
  • Unified documentation and development
  • Future-proof architecture for standalone library
    👏

Assuming this is just phase 1, here's some thoughts from my end (but please note I'm not familiar with the depths of this repo, so my approach could be off!!!)

Suggestions

Concerns:

  • Commitment to finish and concrete timeline

    If there isn't full commitment to finish this work on a well-defined timeline with broad communication to the bulk of the library's contributors, a gradual migration strategy, especially with a temporary dual build system with contributors still adding code to the legacy system, can lead to an even more fragmented state of the library, where maintenance becomes even more confusing with increased opportunity for esoteric bugs.

@vgeorge
Copy link
Contributor

vgeorge commented Nov 25, 2025

@ifsimicoded thanks for the feedback. I agree we should define concrete actions to get this across the finish line, especially since the PR has been open for more than 60 days. My proposed scope is:

Out of scope

@ifsimicoded
Copy link
Contributor

ifsimicoded commented Dec 11, 2025

@vgeorge apologies for the delay! You're free to move things around but I'm not sure that actually addresses the larger concerns I've heard voiced and i've personally experienced about working with veda-ui. If moving things around is part of a larger plan to address the developer concerns of the library that I've heard, please do link that! But currently I don't see the action plan to address what's below, so I'm not sure what moving files accommplishes.

  1. no uniform design system or style approach backing the library (USWDS, dev-seed-ui)
  2. no uniform approach to managing style customization (styled components, scss files, not utilizing expected USWDS pattern)
  3. components are not easily usable as independent modules / components are quite entangled with logic and other view components
  4. difficult dev-x with deeply nested props and intermixed logic and view code
  5. existing tickets I listed in my comment above (mysterious build failures, build errors swallowed, a plethora of bugs)

- Document evolution from Option C to Option D (monorepo structure)
- Update status to reflect PR #1898 merge
- Add action items from PR #1871 discussion
- Capture ifsimicoded's concerns about broader developer experience
- Update implementation plan to reflect actual monorepo structure
- Remove outdated /core references and verbose content
@vgeorge vgeorge marked this pull request as draft December 12, 2025 13:04
@vgeorge
Copy link
Contributor

vgeorge commented Dec 12, 2025

Hi @ifsimicoded, thanks for the feedback! I’ve updated the ADR to capture the broader developer-experience concerns you raised.

I’ve also moved forward with PR #1898 together with @dzole0311, which initializes the monorepo structure by relocating the library to packages/veda-ui/. That PR is now merged.

I’ll continue with the remaining migrations (Storybook to apps/storybook/, SPA to apps/legacy-spa/) as outlined. Once this work is finished, I’ll update the ADR to document the outcome.

Please let me know if you have any additional feedback.

I’ve converted this PR to draft until we conclude the migration.

@vgeorge vgeorge marked this pull request as ready for review December 16, 2025 13:12
@vgeorge vgeorge marked this pull request as draft December 16, 2025 13:12
Add brief VEDA2 background pointer and reference link.
Update header metadata to reflect decision acceptance.
Reduce verbosity and clarify pre-monorepo pain points.
Keep /core proposal while shortening trade-offs and consequences.
Replace repeated end-of-doc consequences with a trade-offs list under option D.
Reinstate key pros/cons for the original /core and Storybook proposals.
Keep packages/apps intent while leaving Storybook placement flexible.
Point build tooling follow-up to v7 roadmap and build tooling issue.
Keep only ADR 006, architecture docs, and ADR PR.
Reference ADR 004 alongside ADR 006 for VEDA2 and monorepo direction.
Make ADR links in ARCHITECTURE easier to scan.
@vgeorge vgeorge marked this pull request as ready for review December 18, 2025 12:27
@vgeorge
Copy link
Contributor

vgeorge commented Dec 18, 2025

@ifsimicoded @dzole0311 As we are moving forward with the monorepo approach, I believe it makes sense to merge this PR as accepted. I did an overhaul of the documentation to make it easier to read. I tried to keep the main points of the original document, please let me know if I left something important out. This is ready for review.

Copy link
Contributor

@ifsimicoded ifsimicoded left a comment

Choose a reason for hiding this comment

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

Thanks for continuing to push through on keeping this repo documented and organized. I'm excited to co-plan a strategy for "v7"

@vgeorge vgeorge merged commit 9a23d3f into main Dec 19, 2025
15 checks passed
@vgeorge vgeorge deleted the docs/adr-004-component-library-restructure branch December 19, 2025 09:28
@vgeorge
Copy link
Contributor

vgeorge commented Dec 19, 2025

Great, thank you!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants