Files
crewli/packages/form-schema
bert.hausmans 214a2debee refactor(form-schema): inline validators to remove @core transitive dep
Resolves TECH-07. Copies the four validators actually used
(requiredValidator, emailValidator, urlValidator, regexValidator) from
@core/utils/validators into packages/form-schema/src/utils/validators.ts
as pure boolean functions. Vuexy template copies in apps/*/src/@core/
remain for non-form UI use. Package is now genuinely standalone —
grep -rn "@core/" packages/form-schema/ returns zero matches.

Also corrects two documentation inconsistencies from commit 42dd626e:
dev-guide heading translated to Dutch for style consistency, and the
BACKLOG entry renumbered from TECH-DEBT-01 to TECH-07 to match the
flat numbering in the Technische schuld section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 00:20:15 +02:00
..

@form-schema

Shared schema contract and schema-driven behaviors for Crewli form rendering. Consumed by apps/portal (public submission) and apps/app (organizer builder + submissions review).

What lives here

  • types/ — TypeScript types and enum constants mirroring backend FormBuilder enums and PublicForm(Schema|Submission)Resource
  • utils/formValidation.ts — validation rule builders driven by FormFieldValidationRules
  • composables/useConditionalLogic.ts — evaluate conditional_logic.show_when against field values
  • composables/useFormSteps.ts — step navigation logic for multi-step forms
  • composables/formatFieldValue.ts — render a stored submission value as a human-readable string

What does NOT live here

Vue components. Each app renders its own UI. Portal has full-fidelity submit components; app has builder-preview and submissions-review components. Sharing renderers would couple the two apps' visual styles, which we explicitly want to avoid.

Contract stability

This is an alias-only shared directory inside the monorepo — no npm package, no semver. Breaking changes (new field type, new validation key, new conditional operator) require updating both apps in the same PR. TypeScript will flag missing cases in dispatchers.