pi-kiosk-shared 2.3.5 → 2.3.6
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.
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Shared types, API contracts, and error classes for the Pi Kiosk system.
|
|
|
9
9
|
|
|
10
10
|
## Temporary retention
|
|
11
11
|
|
|
12
|
-
`up-backend` keeps production `react` / `react-dom` until cold/start paths consume a Node-safe published or overlaid main barrel. Do **not** drop those deps until that consume path is proven on the version actually installed (registry tarball from `npm view`, or monorepo overlay of sibling `../shared` **2.3.
|
|
12
|
+
`up-backend` keeps production `react` / `react-dom` until cold/start paths consume a Node-safe published or overlaid main barrel. Do **not** drop those deps until that consume path is proven on the version actually installed (registry tarball from `npm view`, or monorepo overlay of sibling `../shared` **2.3.5**). Same caveat as `up-backend/docs/DEPLOYMENT/DEPLOY_SEPARATE_REPOS.md`.
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -74,72 +74,33 @@ Frontends import React modules from `/ui`. The **target** main barrel (local ove
|
|
|
74
74
|
|
|
75
75
|
## Local monorepo overlay
|
|
76
76
|
|
|
77
|
-
**Honesty (SSOT):** Live monorepo source is `shared/package.json` **2.3.
|
|
77
|
+
**Honesty (SSOT):** Live monorepo source is `shared/package.json` **2.3.5**. All consumers pin **`^2.3.5`** in `package.json`. **Committed locks resolve the npm registry tarball** (`https://registry.npmjs.org/pi-kiosk-shared/-/pi-kiosk-shared-2.3.5.tgz` after refresh) — that is what Railway / app-only `npm ci` installs.
|
|
78
78
|
|
|
79
|
-
**
|
|
79
|
+
**Local monorepo dev does not use committed tarballs.** When sibling `../shared` exists, `postinstall`/`prepare` → `overlaySharedIfPresent.mjs` → `ensureDist.mjs` copies `shared/dist` into each consumer's `node_modules/pi-kiosk-shared`. You work against live source; registry version in `node_modules` is overwritten on install.
|
|
80
80
|
|
|
81
|
-
|
|
|
82
|
-
|
|
83
|
-
|
|
|
84
|
-
|
|
|
81
|
+
| Context | Source of `pi-kiosk-shared` |
|
|
82
|
+
|---------|----------------------------|
|
|
83
|
+
| **Local monorepo** | Sibling `../shared` overlay (`ensureDist.mjs`) |
|
|
84
|
+
| **Railway / app-only clone** | npm registry via `package-lock.json` (`npm ci`) |
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
After every `shared` version bump: `npm publish` (or your release pipeline), then in **each consumer** run `npm update pi-kiosk-shared` and commit the lock refresh. Confirm with `npm view pi-kiosk-shared version`.
|
|
87
87
|
|
|
88
|
-
|
|
88
|
+
Do **not** commit `file:../shared/pi-kiosk-shared-*.tgz` pins — stale registry locks (e.g. `2.3.2`) ship pre-rewrite outage UI on Railway until locks are refreshed.
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|------|------|----------------------------------------|
|
|
92
|
-
| **A — Monorepo overlay (local dev)** | Sibling `../shared` present | `npm install` / `npm ci` → `overlaySharedIfPresent.mjs` → `ensureDist.mjs` copies `shared/dist` into `node_modules/pi-kiosk-shared`. Vite alias reads sibling `dist` when present. |
|
|
93
|
-
| **B — Registry `^2.3.4` (app-only deploy)** | App-only clone / Railway | `npm ci` installs published tarball. **Requires** `npm view pi-kiosk-shared@2.3.4` (or latest satisfying `^2.3.4`) to include the rewrite. |
|
|
94
|
-
| **C — File tarball bootstrap (CI strict `npm ci`)** | Locks pinned to `file:../shared/pi-kiosk-shared-2.3.4.tgz` | Run `node scripts/workspace/bootstrap-pi-kiosk-shared-tarball.mjs` (repack + ephemeral integrity patch), then consumer `npm ci`. Tarball is **gitignored** — not in VCS. |
|
|
90
|
+
### Distribution paths
|
|
95
91
|
|
|
96
|
-
|
|
92
|
+
| Path | When | How rewrite reaches consumers |
|
|
93
|
+
|------|------|-------------------------------|
|
|
94
|
+
| **Local overlay** | Monorepo with sibling `shared/` | `npm ci` / `npm install` hooks → `ensureDist.mjs` |
|
|
95
|
+
| **Registry `^2.3.5`** | Railway, app-only clones | `npm ci` → registry tarball from lockfile |
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
tar -tf pi-kiosk-shared-2.3.4.tgz | Select-String DatabaseUnavailable
|
|
100
|
-
# dist/components/DatabaseUnavailable.js must contain "Aplikace teď není dostupná"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Consumer lock tarball bootstrap (Strategy A — optional)
|
|
104
|
-
|
|
105
|
-
When frontends use a **file tarball** pin (instead of registry `^2.3.4`):
|
|
106
|
-
|
|
107
|
-
```json
|
|
108
|
-
"pi-kiosk-shared": "file:../shared/pi-kiosk-shared-2.3.4.tgz"
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
The tarball is **gitignored** (`*.tgz` in repo root `.gitignore`) and is **not** in VCS. A fresh clone has no pack file until you build it:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
cd shared
|
|
115
|
-
npm run publish:local # build:clean + npm pack → shared/pi-kiosk-shared-<version>.tgz
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**Strict `npm ci` in a consumer** (file-pin layout; lockfile-only install without relying on overlay alone):
|
|
119
|
-
|
|
120
|
-
1. From repo root, run bootstrap SSOT (repack tarball + ephemeral lock integrity patch):
|
|
121
|
-
`node scripts/workspace/bootstrap-pi-kiosk-shared-tarball.mjs`
|
|
122
|
-
— wraps `shared` `publish:local` and patches consumer `package-lock.json` hashes in-place. **Do not commit** patched integrity fields.
|
|
123
|
-
2. **Stop local dev servers** on Windows if they lock `node_modules` binaries (common `npm ci` failure).
|
|
124
|
-
3. From a consumer (`admin-app`, `rpapp-customer`, `rpapp-pickup`, `rpapp-kiosk`):
|
|
97
|
+
Verify publish contents (maintainers only):
|
|
125
98
|
|
|
126
99
|
```powershell
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
npm ci
|
|
100
|
+
cd shared; npm run build; npm pack
|
|
101
|
+
tar -xOf pi-kiosk-shared-2.3.5.tgz package/dist/components/DatabaseUnavailable.js | Select-String "Aplikace"
|
|
130
102
|
```
|
|
131
103
|
|
|
132
|
-
**Version bump — committed lock refresh (manual):** when `shared/package.json` version changes, run in **every** consumer and commit the result:
|
|
133
|
-
`$env:HUSKY='0'; npm install pi-kiosk-shared@file:../shared/pi-kiosk-shared-<version>.tgz` (updates committed `package-lock.json` pins and `integrity`).
|
|
134
|
-
|
|
135
|
-
**Ephemeral lock patch (bootstrap SSOT):** `node scripts/workspace/bootstrap-pi-kiosk-shared-tarball.mjs` repacks the tarball and **patches consumer `package-lock.json` integrity in-place** so the next `npm ci` succeeds. Patches are local-only — **do not commit** bootstrap-dirtied hashes. Run bootstrap **before** local consumer `npm ci` when using file-pin layout. Bootstrap does **not** replace version-bump lock refresh; on bump still run the manual install above in each consumer and commit new pins.
|
|
136
|
-
|
|
137
|
-
**CI without sibling `shared/` source (file-pin layout):** every consumer workflow job runs [`.github/actions/bootstrap-pi-kiosk-shared-tarball`](../.github/actions/bootstrap-pi-kiosk-shared-tarball/action.yml) (SSOT: `node scripts/workspace/bootstrap-pi-kiosk-shared-tarball.mjs` → `shared npm ci && npm run publish:local` + lock integrity patch) before consumer `npm ci`. Root `cert:install:all` and `scripts/workspace/bootstrap.mjs` call the same script. See `hardening-gates.yml`, `retail-v1-cert.yml`, `rpapp-pickup-e2e.yml`.
|
|
138
|
-
|
|
139
|
-
**Local dev (preferred):** sibling `../shared` + `postinstall`/`prepare` overlay via `ensureDist.mjs` — tarball optional when the monorepo layout is complete and overlay runs on install.
|
|
140
|
-
|
|
141
|
-
**Registry-only / Railway app-only clones:** with **registry `^2.3.4` pins**, bare **`npm ci` succeeds** on app-only checkouts when the tarball is published — no sibling tarball required. If you use **monorepo `file:` tarball pins** instead, bare `npm ci` **fails** on app-only clones (missing pack file). **`prebuildShared.mjs` runs on `predev` / `prebuild` only** — npm has already finished `install`/`ci` by then, and the script does **not** rewrite `package.json` or `package-lock.json` (it side-installs `pi-kiosk-shared` into `node_modules` with `--no-save`, which does **not** make a later strict `npm ci` succeed on `file:` pins). App-only options for `file:` pins: **(a)** run `cd shared && npm run publish:local` and ensure `../shared/pi-kiosk-shared-<version>.tgz` exists on disk before consumer `npm ci` (see [Consumer lock tarball bootstrap](#consumer-lock-tarball-bootstrap)), or **(b)** commit app-only `package.json`/lock with registry pins after publish. Confirm with `npm view pi-kiosk-shared version` at deploy time.
|
|
142
|
-
|
|
143
104
|
**Documented cold path (monorepo):** `npm ci` / `npm install` in each app runs lifecycle hooks → `scripts/overlaySharedIfPresent.mjs` → `shared/scripts/ensureDist.mjs` when sibling `../shared` exists:
|
|
144
105
|
|
|
145
106
|
| Package | Install hook (cold path) |
|
|
@@ -175,7 +136,7 @@ npm run gate:main-barrel-node-safe
|
|
|
175
136
|
|
|
176
137
|
From `shared/`, prove the documented cold path:
|
|
177
138
|
|
|
178
|
-
1. **DIAGNOSTIC** — `npm pack` a known Node-safe registry tarball (`COLD_VERSION` in `prove-pi-kiosk-shared-cold-overlay.mjs`, currently `2.2.82` — intentional historical diagnostic fixture, not the live pin) in a temp dir and assert COLD_BAD markers (never installs into a consumer with `--ignore-scripts`). Live monorepo source is `shared/package.json` **2.3.
|
|
139
|
+
1. **DIAGNOSTIC** — `npm pack` a known Node-safe registry tarball (`COLD_VERSION` in `prove-pi-kiosk-shared-cold-overlay.mjs`, currently `2.2.82` — intentional historical diagnostic fixture, not the live pin) in a temp dir and assert COLD_BAD markers (never installs into a consumer with `--ignore-scripts`). Live monorepo source is `shared/package.json` **2.3.5**.
|
|
179
140
|
2. **PASS** — wipe that consumer’s `node_modules/pi-kiosk-shared`, then `npm install` with **scripts on** (no package args) so `prepare` / `postinstall` overlays during install; assert Node-safe barrel + `NODE_IMPORT_OK`.
|
|
180
141
|
|
|
181
142
|
```bash
|
|
@@ -3,7 +3,7 @@ import { cloneElement, forwardRef, isValidElement, useId, } from 'react';
|
|
|
3
3
|
import { tv } from '../tvShim.js';
|
|
4
4
|
const adminField = tv({
|
|
5
5
|
slots: {
|
|
6
|
-
wrapper: 'flex flex-col gap-1.5 w-full',
|
|
6
|
+
wrapper: 'form-field flex flex-col gap-1.5 w-full',
|
|
7
7
|
label: 'text-sm font-semibold text-[var(--color-an-text)]',
|
|
8
8
|
input: [
|
|
9
9
|
'h-10 w-full rounded-md border bg-[var(--color-an-surface)] px-3 text-sm',
|
|
@@ -26,7 +26,7 @@ const adminField = tv({
|
|
|
26
26
|
});
|
|
27
27
|
const consumerField = tv({
|
|
28
28
|
slots: {
|
|
29
|
-
wrapper: 'flex flex-col gap-1.5 w-full',
|
|
29
|
+
wrapper: 'form-field flex flex-col gap-1.5 w-full',
|
|
30
30
|
label: 'text-sm font-medium text-[var(--color-on-surface)]',
|
|
31
31
|
input: [
|
|
32
32
|
'w-full rounded-md border bg-[var(--color-surface)] px-3',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/ui/FormField/FormField.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,KAAK,GAIN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIlC,MAAM,UAAU,GAAG,EAAE,CAAC;IACpB,KAAK,EAAE;QACL,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FormField.js","sourceRoot":"","sources":["../../../src/ui/FormField/FormField.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,KAAK,GAIN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIlC,MAAM,UAAU,GAAG,EAAE,CAAC;IACpB,KAAK,EAAE;QACL,OAAO,EAAE,yCAAyC;QAClD,KAAK,EAAE,mDAAmD;QAC1D,KAAK,EAAE;YACL,yEAAyE;YACzE,6DAA6D;YAC7D,+CAA+C;YAC/C,wDAAwD;YACxD,4EAA4E;YAC5E,iDAAiD;SAClD,CAAC,IAAI,CAAC,GAAG,CAAC;QACX,MAAM,EAAE,2CAA2C;Q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