@impeccable/reviews 0.1.17 → 0.1.19

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.
@@ -478,7 +478,7 @@ export function showRun(opts) {
478
478
  }
479
479
  /** The outro in plain lines, for the scrollback: what stays once the screen has gone. */
480
480
  function summary(o) {
481
- return ['', `${OUTCOME[o.outcome]} ${o.title}. ${o.result}`, ...o.links.map((l) => `${l.label}: ${l.url}`), ...o.todo.map((line) => `→ ${line}`), ...o.warnings.map((warning) => `! ${warning}`)];
481
+ return ['', `${OUTCOME[o.outcome]} ${o.title}. ${o.result}`, ...(o.used ?? []), ...o.links.map((l) => `${l.label}: ${l.url}`), ...o.todo.map((line) => `→ ${line}`), ...o.warnings.map((warning) => `! ${warning}`)];
482
482
  }
483
483
  /** Opens `url` in the browser and puts it on the clipboard, true once it is there. Neither can fail the screen, which shows the link either way. */
484
484
  async function handOver(url, hand) {
@@ -507,7 +507,7 @@ export async function showPullRequest(url, hand) {
507
507
  /** The last screen: what happened, what is left, any warnings and its pull request (handed over as it appears) or the links, until a key other than ↑↓ PgUp PgDn is pressed, or for 20 minutes. Its summary then stays in the scrollback. */
508
508
  export async function showOutro(outro, hand) {
509
509
  // What is left and why it stopped can be the model's words, which reach the scrollback after the clipboard holds the pull request.
510
- const o = { ...outro, result: plainText(outro.result), todo: outro.todo.map(plainText), warnings: outro.warnings.map(plainText) };
510
+ const o = { ...outro, result: plainText(outro.result), todo: outro.todo.map(plainText), warnings: outro.warnings.map(plainText), ...(outro.used ? { used: outro.used.map(plainText) } : {}) };
511
511
  const screen = host();
512
512
  if (screen) {
513
513
  const copied = o.link && hand ? await handOver(o.link, hand) : false;
package/dist/vercel.js CHANGED
@@ -2,7 +2,7 @@ import { readFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { setTimeout as sleep } from 'node:timers/promises';
4
4
  import { folderOf, matchesBranch, TEST_DRIVE_BRANCH } from './host-previews.js';
5
- import { asLink, readLink } from './vercel-bypass.js';
5
+ import { asLink, isBypassSecret, readLink, SECRET_NOTE } from './vercel-bypass.js';
6
6
  /** `vercel whoami`: the CLI prints the username, or says it has no credentials and exits 1. */
7
7
  export async function vercelStatus(vercel) {
8
8
  try {
@@ -147,7 +147,9 @@ export async function readLinkedProject(vercel, link) {
147
147
  // The live app: the production deployment's first alias, the project's own domain, as Vercel lists them (its automatic aliases follow). Its own hashed address is one build's, which the next production deployment leaves behind: never the before.
148
148
  const live = target && !failed(target) ? (Array.isArray(target.alias) ? target.alias : []).map(hostname).find(Boolean) : undefined;
149
149
  const root = folderOf(project.rootDirectory);
150
- return { ...(root !== undefined ? { rootDirectory: root } : {}), ...(typeof project.name === 'string' && project.name ? { name: project.name } : {}), production: exists ? 'exists' : 'none', ...(typeof branch === 'string' && branch ? { productionBranch: branch } : {}), ...(live ? { productionUrl: `https://${live}` } : {}), protection: typeof protection === 'string' ? protection : null, previewsProtected, deploymentHosts: new Set(hosts), ...(repository ? { repository } : {}), ignoredBuildStep: typeof ignore === 'string' && ignore.trim().length > 0, githubDeployments: record(project.gitProviderOptions)?.createDeployments !== 'disabled' };
150
+ // As impeccable_vercel_bypass picks its secret: one for automation, labelled for Impeccable.
151
+ const labelled = Object.entries(record(project.protectionBypass) ?? {}).some(([value, meta]) => isBypassSecret(value) && record(meta)?.scope === 'automation-bypass' && record(meta)?.note === SECRET_NOTE);
152
+ return { ...(labelled ? { bypassLabelled: true } : {}), ...(root !== undefined ? { rootDirectory: root } : {}), ...(typeof project.name === 'string' && project.name ? { name: project.name } : {}), production: exists ? 'exists' : 'none', ...(typeof branch === 'string' && branch ? { productionBranch: branch } : {}), ...(live ? { productionUrl: `https://${live}` } : {}), protection: typeof protection === 'string' ? protection : null, previewsProtected, deploymentHosts: new Set(hosts), ...(repository ? { repository } : {}), ignoredBuildStep: typeof ignore === 'string' && ignore.trim().length > 0, githubDeployments: record(project.gitProviderOptions)?.createDeployments !== 'disabled' };
151
153
  }
152
154
  /**
153
155
  * The linked project as this repository's: read now, and connected to the repository on Vercel, which its Git link
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@impeccable/reviews",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Set up a repository for Impeccable for PRs from your terminal.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,
@@ -1,16 +0,0 @@
1
- ### When this applies
2
-
3
- The pages need no server from this repository: plain HTML, or a build that writes a complete static site. Pages that need SSR, API routes or a backend here follow server-previews; an external API they call does not change that. A build that writes only JavaScript, CSS or types is a library, not a site.
4
-
5
- ### Steps
6
-
7
- 1. **Find the output**: the folder the build writes the pages to (framework config, scripts), or, with no build, the folder that holds the real `index.html`. Done when you can name that folder and the build command, or that there is none.
8
- 2. **Prove it** with impeccable_verify_preview in static mode. Done when it answers `verified: true` with the folder's `index.html` in `files`; a failure names its `stage`, which the report explains, and pull-requests' "No preview, no test drive" says how the run goes on without a proof. When it answers that this machine has no sandbox for the check (Linux, or `--no-sandbox`), the check is skipped: save the build the scripts name in step 3, and the preview job on the pull request proves it; put that under "What is not verified".
9
- 3. **Save it** with impeccable_write to `preview`: `intendedMethod: "static-upload"`, `outputDir` and the commands you proved, clearing a saved command you did not prove; when the check was skipped on this machine, the build the scripts name is what you save, and the preview job proves it. Done when the answer's `keys` show each key stored or unchanged.
10
-
11
- ### Reference
12
-
13
- - **No build**: `steps` is empty and the output is the page's folder, `.` for the checkout's root. Invent no manifest, build, runtime or server for plain HTML.
14
- - **A base path**: `<base>/index.html` must exist under the output folder; pass `basePath` to the check, and save it.
15
- - **A single-page app**: the write takes no `spa` key, and the entry check proves no deep link; report a route the preview cannot serve.
16
- - A verified result proves the entry files exist, nothing more: rendering, assets, deep links and external APIs go under "What is not verified".