@tokenoftrust/cli 2.5.2 → 2.5.4
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 +12 -6
- package/package.json +1 -1
- package/src/commands/clone.mjs +2 -1
- package/src/declared-config.mjs +42 -3
- package/template/private-app/README.md +8 -4
package/README.md
CHANGED
|
@@ -5,12 +5,17 @@ One command to go from a Token of Trust invite to a running store.
|
|
|
5
5
|
```sh
|
|
6
6
|
npm i -g @tokenoftrust/cli
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
tot clone
|
|
8
|
+
# list the stores you can build on
|
|
9
|
+
tot clone
|
|
10
|
+
# mirrors `git clone`; dir defaults to <tenant>
|
|
11
|
+
tot clone <tenant> my-store
|
|
10
12
|
cd my-store
|
|
11
|
-
|
|
12
|
-
tot
|
|
13
|
-
|
|
13
|
+
# run it locally with save→reload — no Docker needed
|
|
14
|
+
tot dev
|
|
15
|
+
# bundle your edits into a compliance-reviewed preview
|
|
16
|
+
tot preview
|
|
17
|
+
# promote a reconciled preview live (diff + one confirm)
|
|
18
|
+
tot ship
|
|
14
19
|
```
|
|
15
20
|
|
|
16
21
|
**Prerequisites: Node.js and an invite. Nothing else.** `tot dev` downloads the
|
|
@@ -88,7 +93,8 @@ tot login tot login
|
|
|
88
93
|
The value is an **opaque label** — any string works, so it's easy to script parallel identities:
|
|
89
94
|
|
|
90
95
|
```
|
|
91
|
-
|
|
96
|
+
# a fresh isolated identity per terminal / test worker
|
|
97
|
+
export TOT_PROFILE=$(uuidgen)
|
|
92
98
|
tot login
|
|
93
99
|
```
|
|
94
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.4",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
package/src/commands/clone.mjs
CHANGED
|
@@ -306,7 +306,8 @@ export async function run(argv, ctx, deps = {}) {
|
|
|
306
306
|
tenant: args.tenant, dir: /** @type {string} */ (res.dir), env, storefrontUrl: args.url, redact, readTopology, cloneDeps,
|
|
307
307
|
});
|
|
308
308
|
console.log(`\nYour local working clone is at ${res.dir}.`);
|
|
309
|
-
console.log(
|
|
309
|
+
console.log(" # run it locally with save→reload");
|
|
310
|
+
console.log(` cd ${res.dir} && tot dev`);
|
|
310
311
|
console.log(` (origin has no token — \`tot\` mints one fresh at fetch/push time)`);
|
|
311
312
|
return 0;
|
|
312
313
|
}
|
package/src/declared-config.mjs
CHANGED
|
@@ -712,6 +712,15 @@ export function describeNicotineWarningPresentation(p) {
|
|
|
712
712
|
* of every page; "block" is the reinforced box on the product page. Every interpolated value
|
|
713
713
|
* is a validated hex colour, enum or number. Styling is inline (no utility classes), so the
|
|
714
714
|
* markup renders the same wherever it is served, whatever stylesheet the page carries.
|
|
715
|
+
*
|
|
716
|
+
* Every presentation and visibility declaration is inline `!important`, which no tenant
|
|
717
|
+
* stylesheet rule can override: tenant CSS cannot hide, move, clip, fade or restyle the warning,
|
|
718
|
+
* and the text element re-asserts the warning's own presentation so a tenant `p { … }` rule does
|
|
719
|
+
* not reach it. What inline styles cannot stop is another element painting over the warning (a
|
|
720
|
+
* fixed or sticky header pinned to the top of the viewport). Raising the warning above page
|
|
721
|
+
* chrome would paint it over the tenant's own open menus and drawers, so occlusion is measured
|
|
722
|
+
* instead: the page browser gate (`validate-page-browser.mjs`, `nicotineWarning`) fails a page
|
|
723
|
+
* whose warning is covered at a phone, tablet or desktop width and names the covering element.
|
|
715
724
|
* @param {unknown} declaration the tenant's `compliance.nicotineWarning`
|
|
716
725
|
* @param {"bar" | "block"} variant
|
|
717
726
|
*/
|
|
@@ -719,11 +728,40 @@ export function nicotineWarningHtml(declaration, variant) {
|
|
|
719
728
|
const { presentation, preset } = resolveNicotineWarning(declaration);
|
|
720
729
|
const attrs = `style="${nicotineWarningStyle(presentation, variant)}" role="note" aria-label="Health warning" ` +
|
|
721
730
|
`data-compliance="nicotine-warning" data-nicotine-warning-preset="${preset ?? "custom"}"`;
|
|
731
|
+
const text = NICOTINE_WARNING_TEXT_LOCK;
|
|
722
732
|
return variant === "bar"
|
|
723
|
-
? `<div ${attrs}><p class="container-prose" style="margin-block:0;padding-block:0.5rem;text-align:center">${NICOTINE_WARNING_TEXT}</p></div>`
|
|
724
|
-
: `<div ${attrs}><p style="margin:0">${NICOTINE_WARNING_TEXT}</p></div>`;
|
|
733
|
+
? `<div ${attrs}><p class="container-prose" style="margin-block:0;padding-block:0.5rem;text-align:center;${text}">${NICOTINE_WARNING_TEXT}</p></div>`
|
|
734
|
+
: `<div ${attrs}><p style="margin:0;${text}">${NICOTINE_WARNING_TEXT}</p></div>`;
|
|
725
735
|
}
|
|
726
736
|
|
|
737
|
+
/** Declarations that keep the warning on screen, at full opacity, in its own place. */
|
|
738
|
+
const NICOTINE_WARNING_VISIBILITY_LOCK = [
|
|
739
|
+
"display:block",
|
|
740
|
+
"visibility:visible",
|
|
741
|
+
"opacity:1",
|
|
742
|
+
"position:relative",
|
|
743
|
+
"inset:auto",
|
|
744
|
+
"transform:none",
|
|
745
|
+
"clip-path:none",
|
|
746
|
+
"filter:none",
|
|
747
|
+
"height:auto",
|
|
748
|
+
"max-height:none",
|
|
749
|
+
"overflow:visible",
|
|
750
|
+
];
|
|
751
|
+
|
|
752
|
+
/** The text element inherits the warning's presentation, whatever a tenant `p` rule says. */
|
|
753
|
+
const NICOTINE_WARNING_TEXT_LOCK = [
|
|
754
|
+
"display:block",
|
|
755
|
+
"visibility:visible",
|
|
756
|
+
"opacity:1",
|
|
757
|
+
"color:inherit",
|
|
758
|
+
"font-size:inherit",
|
|
759
|
+
"font-weight:inherit",
|
|
760
|
+
"text-transform:inherit",
|
|
761
|
+
"letter-spacing:inherit",
|
|
762
|
+
"line-height:inherit",
|
|
763
|
+
].map((d) => `${d}!important`).join(";");
|
|
764
|
+
|
|
727
765
|
/**
|
|
728
766
|
* Inline CSS for a presentation. `variant` "block" (the product page) never renders smaller
|
|
729
767
|
* than 14px.
|
|
@@ -744,5 +782,6 @@ export function nicotineWarningStyle(p, variant) {
|
|
|
744
782
|
`font-weight:${p.fontWeight}`,
|
|
745
783
|
`font-size:${size}px`,
|
|
746
784
|
"line-height:1.4",
|
|
747
|
-
|
|
785
|
+
...NICOTINE_WARNING_VISIBILITY_LOCK,
|
|
786
|
+
].map((d) => `${d}!important`).join(";");
|
|
748
787
|
}
|
|
@@ -30,10 +30,14 @@ are the stable human and LLM entry points.
|
|
|
30
30
|
## Local loop (no network, no real ToT account needed)
|
|
31
31
|
|
|
32
32
|
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
# lint tot-app.json against the contract
|
|
34
|
+
tot app dev validate
|
|
35
|
+
# start the stub receiver
|
|
36
|
+
node server.js &
|
|
37
|
+
# sign a fixture CloudEvent and POST it in
|
|
38
|
+
tot app dev emit order.created
|
|
39
|
+
# mint a dev widget-launch JWT against an ephemeral key
|
|
40
|
+
tot app dev mint
|
|
37
41
|
```
|
|
38
42
|
|
|
39
43
|
`tot app dev` generates its own throwaway RS256 keypair per app directory
|