Vai al contenuto principale

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

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:

  1. Clone the workspace:

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

    cd Packages && yarn install
  3. Build (compiles TypeScript Per dist/):

    yarn workspace @churchapps/helpers build

    Or run yarn build at 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:

  1. Run yarn changeset at the workspace root and Seleziona @churchapps/helpers with the appropriate bump Digita; commit the generated changeset file with your change.
  2. When ready Per release, run yarn publish-all at 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).

Avviso

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