Перейти до основного вмісту

AppHelper

The @churchapps/apphelper package provides shared React components and utilities for all ChurchApps web applications. It is a single published package that exposes feature modules through subpath entry points -- login, donations, forms, markdown, and website/CMS functionality -- alongside a core set of shared components and helpers.

Before You Begin

Entry Points

The package defines subpath exports in its package.json, so each feature module is importable on its own:

Entry pointContents
@churchapps/apphelperCore components, helpers, and hooks
@churchapps/apphelper/loginLogin and registration UI
@churchapps/apphelper/donationsGiving and donation components
@churchapps/apphelper/formsForm submission components
@churchapps/apphelper/markdownMarkdown and HTML editors and renderers
@churchapps/apphelper/websiteWebsite builder and CMS components

Who Consumes What

Before changing a shared export, check which apps import it:

Export areaWhat it providesConsumed by
Root -- core components & hooksDisplayBox, InputBox, Loading, PageHeader, PersonAvatar, SmallButton, ErrorMessages, ExportLink, useMountedState, plus re-exported @churchapps/helpers utilities (ApiHelper, DateHelper, Locale, UserHelper, etc.)B1Admin, B1App, B1Transfer, LessonsApp
Root -- site chromeSiteHeader (nav, user menu, notifications)B1Admin, B1Transfer, LessonsApp
Root -- admin content editorsImageEditor, HelpIconB1Admin
Root -- realtime plumbingSocketHelper, SubscriptionManager, NotificationServiceB1Admin, B1App
Root -- chat/presence storesConversationStore, PresenceStoreB1App
Root -- notes & messaging UINotes (staff notes on people/tasks); AddNote, SubscriptionToggle (member messaging)B1Admin (Notes), B1App (AddNote, SubscriptionToggle)
Root -- Lessons-specificAnalyticsHelper, FloatingSupport, SupportModalLessonsApp
./loginLoginPage, LogoutPageB1Admin, B1App, B1Transfer, LessonsApp
./markdownMarkdownEditor, MarkdownPreviewLight (shared); MarkdownPreview, HtmlEditor (admin content editing)B1Admin, B1App, LessonsApp
./donationsMultiGatewayDonationForm, RecurringDonations, PaymentMethods, StripePaymentMethod, DonationHelper/getPaymentProvider (shared); FundDonations (admin only)B1Admin, B1App
./formsFormSubmissionEdit (renders ConversationalForm when the form's displayMode is conversational)B1Admin, B1App
./websitePage-rendering core shared by the editor and renderer (Element + the per-type renderers resolved via ElementRegistry, StyleHelper, DroppableArea, DraggableWrapper, Theme, YoutubeBackground, SectionDivider/parseDividerConfig); site-wide widgets (AnnouncementBanner, Launcher + their parse*Config helpers); Animate, ElementBlock, NonAuthDonationWrapper, SermonElement used only by the public-facing rendererB1Admin (editor), B1App (editor components + renderer)

B1Transfer and LessonsApp use only the root and login entry points -- the donations, forms, and website subpaths are consumed exclusively by B1Admin and B1App today.

Setup for Local Development

This package lives in the Packages workspace alongside the other shared libraries:

  1. Clone the workspace:

    git clone https://github.com/ChurchApps/Packages.git
  2. Install dependencies at the workspace root:

    cd Packages && yarn install
  3. Launch the Vite playground from the package directory:

    cd apphelper && yarn dev

    The playground dev server starts at http://localhost:3001. Copy playground/dotenv.sample to playground/.env and fill in the required values first.

To build the package for consumption (compiles to dist/ and copies locale/CSS assets), run yarn workspace @churchapps/apphelper build -- or yarn build at the root to build every package in dependency order. To test an unpublished build inside a consuming app, use a temporary Yarn portal -- see Local Development Against a Consuming App.

поради

The playground is the fastest way to develop and test AppHelper components. It hot-reloads the Vite dev server so you can see changes in real time.

Publishing

Releases go through changesets: run yarn changeset at the workspace root with every change, then yarn publish-all when ready to release. See the Shared Libraries Overview for the full flow.

попередження

Never remove or rename an export until the replacement is published and every consumer has been migrated -- grep all consuming repos before merging a removal.

  • Helpers -- The base utility package used alongside AppHelper
  • Web Apps -- The web applications that consume this package
  • Shared Libraries Overview -- Workspace setup, release flow, and local-link workflow