refactor: prepare monorepo for multi-app integration#19
Open
augmentcode[bot] wants to merge 3 commits into
Open
refactor: prepare monorepo for multi-app integration#19augmentcode[bot] wants to merge 3 commits into
augmentcode[bot] wants to merge 3 commits into
Conversation
Consolidate duplicated abstractions, add configuration surfaces, and improve code organization in advance of merging additional web apps into this repository. Changes by area: packages/topo (design system): - Add PageDataProvider/usePageData to Theme for app-level page data - Make service IDs overridable from ThemeProvider (cognitoFormsId, usercentricsSettingsId, apiEndpoint) with existing values as defaults - Split monolithic Provider.tsx into sub-providers (Fonts, CmsStrings) - Remove deprecated PropTypes usage (TypeScript interface already exists) - Remove forwardRef wrappers from 15+ components (unnecessary in React 19) - Simplify pureRef/makePureBox utilities accordingly - Add new shared components: VideoPlayer, VideoLink, Markdown, Highlight, CalendlyEmbed (extracted from apps/www) - Add createStaticProps helper for standardized data fetching - Deduplicate ThemeData (remove dead themeContext.ts) - Make apiFetch accept optional endpoint parameter packages/utils: - Add shared arr.ts (dedupeFirstByKey) and splitGroups.ts utilities apps/www: - Replace local QueryProvider with topo's PageDataProvider/usePageData - Move tracking IDs to environment variables with fallback defaults - Update component imports to use new topo exports - Remove deleted local utility files apps/_template: - New minimal Next.js app scaffold for adding future apps
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Component extractions to packages/topo: - ContentfulRichText → topo/Molecule (Contentful JSON rich text renderer) - FlexScatter → topo/Molecule (randomized flex layout) - OnlyVisibleBox → topo/Atom (visibility-conditional rendering) Component breakdowns in apps/www: - Wizard.tsx (409 lines) → 5 files: BackgroundStep, RegionStep, ContactStep, ConfirmationStep, orchestrator index - Community.tsx (290 lines) → 4 files: PhotoTextCard, PhotoCard, Card, orchestrator index - Programs.tsx (193 lines) → 4 files: NextEventDate, RegionList, ProgramCard, orchestrator index - EventInfo.tsx (181 lines) → 2 files: SubscribeBox, main component - Page.tsx (141 lines) → 3 files: NavMenu, DisclaimerFooter, main Other cleanups: - Remove StaticContent.tsx (noop wrapper, deprecated since React 18) - Consolidate near-duplicate Teaser + PreviewVideo into shared MuxAutoplayVideo component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prepares the monorepo for integrating additional web applications by consolidating duplicated abstractions, adding configuration surfaces to the shared design system, improving code organization, and breaking down large components.
Changes
packages/topo (design system)
New configuration surfaces — ThemeProvider now accepts optional override props (all with backward-compatible defaults):
cognitoFormsId— override Cognito Forms account IDusercentricsSettingsId— override Usercentrics CMP settings IDapiEndpoint— override the GraphQL API endpointlocalizationConfigwas already a propConsolidated QueryProvider — Added
PageDataProvider/usePageDatato topo for app-level page data. This replaces the duplicate context that www had in its ownquery.ts.Split Provider.tsx — Extracted font loading into
providers/Fonts.tsxand CMS string fetching intoproviders/CmsStrings.tsx. Provider.tsx is now a thin 105-line composition layer (was 240).New shared components (extracted from apps/www):
Highlight(Atom) — text highlight wrapperOnlyVisibleBox(Atom) — renders children only when element has dimensionsVideoPlayer(Molecule) — HLS-capable video playerVideoLink(Molecule) — video modal triggerMarkdown(Molecule) — themed ReactMarkdown wrapperCalendlyEmbed(Molecule) — Calendly scheduling embedContentfulRichText(Molecule) — Contentful JSON rich text renderer (split into ContentfulAsset sub-component)FlexScatter(Molecule) — randomized flex layout with seeded RNGNew helper —
createStaticPropsin@codeday/topo/utilsfor standardizedgetStaticPropswith GraphQL.React 19 cleanup:
PropTypes(TypeScript interface already existed)forwardReffrom 15+ components and thepureRefutility (React 19 passes ref as a regular prop)Other — Deduplicated
ThemeDatatype (removed deadthemeContext.ts), madeapiFetchaccept optional endpoint parameter.packages/utils
dedupeFirstByKey(fromarr.ts) andsplitGroupsutilities, moved from www.apps/www
Import updates:
useQuerynow importusePageDatafrom@codeday/topo/ThemeLarge component breakdowns:
Volunteer/Wizard.tsxIndex/Community.tsxIndex/Programs.tsxEventInfo.tsxPage.tsxOther cleanups:
StaticContent.tsx(noopcreateElementwrapper, deprecated since React 18)Teaser.tsx+PreviewVideo.tsxinto sharedMuxAutoplayVideocomponentapps/_template (new)
Build status
doi/crossrefpage (undefineddescriptionfrom API, unrelated to this PR)