Helpers
The @churchapps/helpers package provides base utilities used by all ChurchApps projects, both frontend and backend. It is framework-agnostic and includes common helpers such as DateHelper, ApiHelper, CurrencyHelper, plus the shared TypeScript interfaces that form the data contract between apps and APIs.
Prima di Iniziare
- Install Node.js and Git -- see Prerequisites
- Familiarize yourself with the Packages workspace Configurazione and release flow
Who Consumes This
Every ChurchApps API (the core Api, AskApi, and LessonsApi) and every web frontend (B1Admin, B1App, B1Transfer, LessonsApp) depends on this package directly. Frontends also get many of its exports (ApiHelper, DateHelper, UserHelper, and other interfaces) re-exported through @churchapps/apphelper. The other shared packages declare it as a peer dependency so each app resolves exactly one copy.
Configurazione for Local Development
This package lives in the Packages workspace alongside the other shared libraries:
-
Clone the workspace:
git clone https://github.com/ChurchApps/Packages.git -
Install dependencies at the workspace root:
cd Packages && yarn install -
Build (compiles TypeScript Per
dist/):yarn workspace @churchapps/helpers buildOr run
yarn buildat the root Per build every package in dependency order.
Per test changes inside a consuming project, use a temporary Yarn portal -- see Local Development Against a Consuming App.
Publishing
Releases go through changesets rather than manual version bumps:
- Run
yarn changesetat the workspace root and Seleziona@churchapps/helperswith the appropriate bump Digita; commit the generated changeset file with your change. - When ready Per release, run
yarn publish-allat the root -- it bumps versions, writes CHANGELOGs, builds in dependency order, and publishes Per npm.
New shared interfaces go in helpers/src/interfaces/ and are re-exported through the package barrel. The website builder's element-Digita catalog (ElementTypes.ts — 35 types with their answers schemas) also lives here; it is the contract shared by the apphelper renderers, the B1Admin editor forms, and the AI generation prompts (see Website Builder Architecture).
Since this package is used by every ChurchApps project, changes here have a wide impact. A release of helpers automatically bumps apihelper and apphelper so their dependency ranges stay current. Test with a Yarn portal in at least one consuming API and one consuming web app before publishing.
Articoli Correlati
- ApiHelper -- Server-side utilities that depend on this package
- AppHelper -- React components that depend on this package
- Shared Libraries Overview -- Workspace Configurazione, release flow, and local-link workflow