@vergelijkdirect/comparison-forms 2.0.1 → 2.0.2-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +46 -6
  2. package/dist/client/.vite/ssr-manifest.json +600 -0
  3. package/dist/client/assets/index-6Enzr9rU.css +4 -0
  4. package/dist/client/assets/index-6Enzr9rU.css.br +0 -0
  5. package/dist/client/assets/index-DUchBxEo.js +57 -0
  6. package/dist/client/assets/index-DUchBxEo.js.br +0 -0
  7. package/dist/client/index.html +15 -0
  8. package/dist/server/entry-server.js +9981 -0
  9. package/dist/server/entry-server.js.br +0 -0
  10. package/dist/vue/comparison-forms.d.ts +1 -2
  11. package/dist/vue/comparison-forms.js +180 -251
  12. package/dist/wc/comparison-forms.js +2808 -2879
  13. package/dist/wc-forms/bike.cjs +1 -1
  14. package/dist/wc-forms/{birthdate.schema-C-y732mA.cjs → birthdate.schema-rpmbSDZH.cjs} +1 -1
  15. package/dist/wc-forms/car.cjs +1 -1
  16. package/dist/wc-forms/caravan.cjs +1 -1
  17. package/dist/wc-forms/{familyComposition.schema-gvSnx-ea.cjs → familyComposition.schema-DW6scNvt.cjs} +1 -1
  18. package/dist/wc-forms/house.cjs +1 -1
  19. package/dist/wc-forms/houseOwnedBuilding.model-DgIQ2pQN.cjs +1 -0
  20. package/dist/wc-forms/legal.cjs +1 -1
  21. package/dist/wc-forms/liability.cjs +1 -1
  22. package/dist/wc-forms/loan.cjs +1 -1
  23. package/dist/wc-forms/{messages-CX8jVyEo.cjs → messages-stJTqN-x.cjs} +1 -1
  24. package/dist/wc-forms/moped.cjs +1 -1
  25. package/dist/wc-forms/motor.cjs +1 -1
  26. package/dist/wc-forms/package.cjs +1 -1
  27. package/dist/wc-forms/pet.cjs +1 -1
  28. package/dist/wc-forms/travel.cjs +1 -1
  29. package/dist/wc-noitc/comparison-forms.umd.cjs +1 -1
  30. package/package.json +4 -3
  31. package/dist/wc-forms/houseOwnedBuilding.model-G9AqKTZo.cjs +0 -1
package/README.md CHANGED
@@ -29,7 +29,7 @@ import '@vergelijkdirect/comparison-forms/vue/styles';
29
29
 
30
30
  ## Usage
31
31
 
32
- ### 1. Drop-in (recommended) — the form handles everything
32
+ ### 1. Drop-in (recommended for VD) — the form handles everything
33
33
 
34
34
  ```vue
35
35
  <script setup>
@@ -130,6 +130,7 @@ The 2.x event contract is a deliberate break. How each legacy event maps:
130
130
 
131
131
  ```bash
132
132
  npm run dev # live sandbox (preview/) — demos for every component and form
133
+ npm run verify # lint + format:check + typecheck + test:unit — the one gate
133
134
  npm run test:unit # vitest run
134
135
  npm run typecheck # vue-tsc --noEmit
135
136
  npm run lint # eslint src tests preview (lint:fix to autofix)
@@ -142,13 +143,16 @@ avoids the npm optional-dependency bug ([npm#4828](https://github.com/npm/cli/is
142
143
  can drop rolldown's native binding and break `vite`. If a machine gets into that state, a clean
143
144
  `rm -rf node_modules && npm ci` fixes it.
144
145
 
146
+ Bumping a `@vergelijkdirect/*` package has rules of its own (exact pins, and a second step for
147
+ ITC) — see [DEPENDENCIES.md](DEPENDENCIES.md).
148
+
145
149
  `src/environment/environment.ts` is gitignored — create it from the checked-in
146
150
  `environment.dev.ts` / `environment.prod.ts` first.
147
151
 
148
152
  ### Builds
149
153
 
150
154
  ```bash
151
- npm run build # typecheck, then every build below (also runs on prepublishOnly)
155
+ npm run build # typecheck, then every build below (prepublishOnly runs verify + this)
152
156
  npm run build:lib # dist/vue — Vue 3 library, vue external
153
157
  npm run build:wc # dist/wc — self-contained <vd-comparison-form> (ES; ITC + Vue inlined)
154
158
  npm run build:wc-noitc # dist/wc-noitc — same element, UMD, ITC left external (host resolves it)
@@ -159,14 +163,50 @@ npm run build:wc-forms # dist/wc-forms — one CJS element bundle per form (<nam
159
163
  `wc-forms` variants keep `@vergelijkdirect/insurance-transmission-client` external so a host
160
164
  bundler (webpack 5) shares its own configured client with the forms.
161
165
 
166
+ ### Publishing to npm
167
+
168
+ Manual — no pipeline publishes. Needs membership of the `@vergelijkdirect` npm org (`npm whoami`)
169
+ and a clean working tree.
170
+
171
+ ```bash
172
+ nvm use
173
+ npm ci
174
+ npm run verify # also runs on publish — but fail before the version commit
175
+
176
+ npm version <patch|minor|major|prerelease> # bumps + commits; the tag it makes stays local
177
+ npm publish --tag <latest|next|legacy|rc>
178
+ git push
179
+
180
+ npm view @vergelijkdirect/comparison-forms dist-tags
181
+ ```
182
+
183
+ `--tag` is not optional: a bare `npm publish` writes `latest` even for a prerelease.
184
+ `latest` = stable 2.x, `next` = 2.x RCs, `legacy` = 1.3.x, `rc` = 1.x prereleases.
185
+
162
186
  ## Architecture
163
187
 
164
188
  ```
165
- entries (lib.ts, wc.ts) → flow (useComparisonSubmit, ComparisonFormFlow)
189
+ entries (lib.ts, wc*.ts) → flow (useComparisonSubmit, ComparisonFormFlow)
166
190
  → comparisons (registry + one dir per comparison: Form, schema, models, presenter)
167
191
  → components (fields: address/licensePlate/company → ui: Vd* primitives)
168
- data/itc.ts — the single gateway to the ITC client interfaces — shared types
192
+
193
+ entries → questionnaires → components (one-off track; never through flow/ or comparisons/)
194
+ data/itc.ts — the single gateway to the ITC client
195
+ constants / models / utils / schemas / enums / interfaces — shared leaves, any layer may import
169
196
  ```
170
197
 
171
- Forms are headless: they validate (yup via `useValidator`) and emit `submitted` with typed, valid
172
- data — no API calls, no redirects, no global state inside a form.
198
+ Path alias: `@` `src/`. The rules that matter:
199
+
200
+ - **Forms are headless.** They validate (yup via `useValidator`) and emit `submitted` with typed,
201
+ valid data — no API calls, no redirects, no global state. Whoever handles `submitted` decides
202
+ the scenario.
203
+ - **One component per comparison.** Vertical/horizontal is the `layout` prop, not a second file.
204
+ - **Dependency arrows point down only.** Comparisons never import each other, and never `flow/`.
205
+ - **Only `data/` touches the ITC client** — everyone else goes through the `@/data` barrel.
206
+ - **Barrels export named symbols only.** `export *` is an ESLint error under `src/` (tree shaking).
207
+ - **All CSS comes from `@vergelijkdirect/styles`** (`.vd-*`) — the library writes none of its own.
208
+
209
+ ## Adding a new comparison form
210
+
211
+ **[CONTRIBUTING.md](CONTRIBUTING.md)** — step by step, from the field list to the definition of
212
+ done, including the seven places a new form must be registered.