mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
The CLI is the product, and the way you get it was nowhere on the site. You had to already know the URL of a script served out of public/. Two placements, one command: - The homepage hero gets the loud version, directly under the lede and above the fold -- a bordered dark panel, the command at full size, Copy alongside. - Every page carries a compact version in the rail, between the brand and the nav. Present on arrival, never competing with navigation. Both come from renderInstallCommand() in one module. The homepage builds its HTML as a string and the rest of the site is JSX, which is precisely the shape that lets one copy of a command drift while the other stays right -- so there is one definition and SiteShell renders it rather than restating it. The command keeps its flags: `curl -fsSL`. Without -f, curl prints an HTTP error body and still exits 0, so a 404 gets piped into sh; without -L the install breaks the first time the URL redirects. This is the form install.sh already documents in its own header. Copy is one delegated listener on document for any [data-copy] button, mounted site-wide in the layout. Delegation because the two placements arrive by different rendering paths and a document listener does not care which; it also means the next copy button needs the attribute and no wiring. It falls back to a throwaway textarea + execCommand outside a secure context, where navigator.clipboard is simply undefined, so the button never no-ops silently. The contract tests pin the command, both placements, and that the clipboard payload equals the visible text -- a Copy button that hands over something other than what is on screen is worse than no button. They also read public/install.sh and assert it is #!/bin/sh and documents this exact command, so `| sh` cannot quietly become a lie. apps/logicsrc-web: 13 new tests pass, 46 total. The ontology-api contract file fails to resolve @logicsrc/validators, which it also does on a pristine origin/master -- unbuilt workspace package, unrelated to this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| apex-rewrites.contract.test.ts | ||
| html-sanitizer.test.ts | ||
| install-command.contract.test.ts | ||
| logicsrc-web.contract.test.ts | ||
| ontology-api.contract.test.ts | ||