pi-kiosk-shared 2.3.10 → 2.3.11
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 +7 -5
- package/package.json +1 -1
- package/src/tokens/responsive.css +41 -0
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.10**). Same caveat as `up-backend/docs/DEPLOYMENT/DEPLOY_SEPARATE_REPOS.md`.
|
|
13
13
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
@@ -74,7 +74,7 @@ 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.10**. Monorepo consumers pin **`file:../shared/pi-kiosk-shared-2.3.10.tgz`** (or overlay sibling `../shared`). **Registry / app-only clones** should pin **`^2.3.10`** — versions **< 2.3.10** lack adaptive add-to-cart CQ rules (`.rp-add-cta--always-long`, `@container rp-add-cta` at **14rem**) in `src/tokens/responsive.css`. **Committed locks resolve the npm registry tarball** (`https://registry.npmjs.org/pi-kiosk-shared/-/pi-kiosk-shared-2.3.10.tgz` after refresh) — that is what Railway / app-only `npm ci` installs when not using monorepo overlay.
|
|
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
|
|
|
@@ -87,18 +87,20 @@ After every `shared` version bump: `npm publish` (or your release pipeline), the
|
|
|
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
|
+
**Monorepo tarball refresh (local):** from `shared/`, run `npm run publish:local` to build and pack `pi-kiosk-shared-<version>.tgz`; reinstall in consumers with `npm install file:../shared/pi-kiosk-shared-<version>.tgz`.
|
|
91
|
+
|
|
90
92
|
### Distribution paths
|
|
91
93
|
|
|
92
94
|
| Path | When | How rewrite reaches consumers |
|
|
93
95
|
|------|------|-------------------------------|
|
|
94
96
|
| **Local overlay** | Monorepo with sibling `shared/` | `npm ci` / `npm install` hooks → `ensureDist.mjs` |
|
|
95
|
-
| **Registry `^2.3.
|
|
97
|
+
| **Registry `^2.3.10`** | Railway, app-only clones | `npm ci` → registry tarball from lockfile (≥ 2.3.10 for adaptive-label CSS) |
|
|
96
98
|
|
|
97
99
|
Verify publish contents (maintainers only):
|
|
98
100
|
|
|
99
101
|
```powershell
|
|
100
102
|
cd shared; npm run build; npm pack
|
|
101
|
-
tar -xOf pi-kiosk-shared-2.3.
|
|
103
|
+
tar -xOf pi-kiosk-shared-2.3.10.tgz package/src/tokens/responsive.css | Select-String "rp-add-cta--always-long"
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
**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:
|
|
@@ -136,7 +138,7 @@ npm run gate:main-barrel-node-safe
|
|
|
136
138
|
|
|
137
139
|
From `shared/`, prove the documented cold path:
|
|
138
140
|
|
|
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.
|
|
141
|
+
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.10**.
|
|
140
142
|
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`.
|
|
141
143
|
|
|
142
144
|
```bash
|
package/package.json
CHANGED
|
@@ -92,3 +92,44 @@
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Adaptive add-to-cart CTA copy — long label when the inner frame is wide enough,
|
|
98
|
+
* short label in narrow 2-col browse card cells. Parent button must be block/w-full;
|
|
99
|
+
* AdaptiveAddToCartLabel renders the `.rp-add-cta` frame inside the button.
|
|
100
|
+
*
|
|
101
|
+
* Threshold 14rem: ~390px viewport 2-col action cells (~175px) stay short; full-width
|
|
102
|
+
* detail footer uses `.rp-add-cta--always-long` instead of CQ.
|
|
103
|
+
*/
|
|
104
|
+
.rp-add-cta {
|
|
105
|
+
container-type: inline-size;
|
|
106
|
+
container-name: rp-add-cta;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.rp-add-cta-label-long {
|
|
110
|
+
display: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.rp-add-cta-label-short {
|
|
114
|
+
display: inline;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.rp-add-cta--always-long .rp-add-cta-label-long {
|
|
118
|
+
display: inline;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.rp-add-cta--always-long .rp-add-cta-label-short {
|
|
122
|
+
display: none;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@supports (container-type: inline-size) {
|
|
126
|
+
@container rp-add-cta (min-width: 14rem) {
|
|
127
|
+
.rp-add-cta:not(.rp-add-cta--always-long) .rp-add-cta-label-long {
|
|
128
|
+
display: inline;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.rp-add-cta:not(.rp-add-cta--always-long) .rp-add-cta-label-short {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|