Skip to content

feat: complete the components barrel for sibling apps (#259) - #262

Open
ayushsingh82 wants to merge 3 commits into
NEARBuilders:mainfrom
ayushsingh82:feat/259-components-barrel
Open

ayushsingh82 wants to merge 3 commits into
NEARBuilders:mainfrom
ayushsingh82:feat/259-components-barrel

Conversation

@ayushsingh82

Copy link
Copy Markdown
Contributor

Refs #259. #258 (canonical style pass) is still open and this was built without it; the ported primitives use the existing tokens, which already cover everything they need.

What changed

  • The ./components Module Federation expose now exports every generic primitive: avatar, checkbox, dropdown-menu, markdown, navigation-menu, radio-group, select, separator, sheet, sonner, table, textarea, tooltip, data-table, aspect-ratio, segmented-filter and social icons, alongside what it already had. 162 names in total.
  • Ported the primitives sibling apps need but this app lacked: field, spinner, stepper, sidebar, breadcrumb, toggle, toggle-group and info-row. The toggles use the existing radix-ui dependency, so no new packages.
  • App-specific components (api key manager, catalog claim flow, member card, org switcher, vote button, under construction) are no longer exported from the barrel. The two files that imported them through it now use direct imports. ConfirmDialog stays, as a generic dialog pattern; happy to move it out if you prefer.
  • New /design-system route (noindex) renders the full primitive set from the barrel.

Verification

  • Typecheck, 83 tests and the full lint (biome plus the shadcn rules) pass. The sidebar's calc widths and transition lists carry oxlint-disable-next-line comments with reasons, in the repo's existing style.
  • The demo route renders in a browser with no console errors; all sections show, including the sidebar, spinner, fields and toggles.
  • feedback.nearbuilders.org loaded and ran against a local build of this remote with no errors or crashes. All 45 names its barrel wraps are present in this remote's exports.

Not done

Make the Module Federation "./components" expose a complete design-system barrel.

- Export every generic primitive from the barrel (avatar, checkbox, dropdown-menu,
  markdown, navigation-menu, radio-group, select, separator, sheet, sonner, table,
  textarea, tooltip, data-table, aspect-ratio, segmented-filter, social icons, ...).
- Port the primitives sibling apps need but this app lacked, on the existing tokens:
  field, spinner, stepper, sidebar, breadcrumb, toggle, toggle-group, info-row.
- Move app-specific components (api key manager, member card, ...) out of the barrel;
  the two files that imported them through it now use direct imports.
- Add a /design-system route that renders the full primitive set from the barrel.
}: {
label: string;
value: ReactNode;
mono?: boolean;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove anything from /ui that isn't a shadcn component

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Append any shadcn components here that feedback app needs -- this may mean doing a full shadcn init to grab all components

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@elliotBraem done in 8140f68: the non-shadcn components (info-row, back-button, data-table, markdown, stepper, etc.) moved out of ui/ into components/common/, and the barrel and all imports are updated. PR: #262

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@elliotBraem added the missing shadcn components (accordion, alert, alert-dialog, calendar, command, drawer, popover, switch, slider, pagination, input-group, combobox and more) and exported them from the barrel in 8140f68. PR: #262

FieldGroup,
FieldLabel,
GithubIcon,
InfoRow,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmmm, could we maybe move this to /brand/design-system instead of here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@elliotBraem moved to /brand/design-system (brand.tsx is now brand/index.tsx, with a link to it from the brand page) in 8140f68. PR: #262

…to /brand

- move non-shadcn components from ui/ to components/common/
- add missing shadcn components and export them from the barrel
- move /design-system to /brand/design-system
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.

2 participants