11/**
22 * The package smoke, the gate behind the npm library build: build lib/pkg/,
33 * judge the package shape (publint, attw), pack a tarball, install it into a
4- * fresh consumer project, import it under Node (the entry and the schema
4+ * fresh consumer project, import it under Node (both entries and the schema
55 * subpath), and compile a TypeScript consumer against the bundled index.d.ts
6- * with skipLibCheck off - a declaration that leaks a devDependency type, or a
6+ * and internal.d.ts with skipLibCheck off - a declaration that leaks a devDependency type, or a
77 * type the emitter could not name, fails here instead of on a consumer's
88 * machine. The installed bin is run under Node too: its help must name every
99 * subcommand, and `validate` must accept a small settings file.
@@ -42,22 +42,24 @@ const SCHEMA_ID =
4242 */
4343const NODE_CONSUMER = `import { deepStrictEqual } from "node:assert/strict";
4444import { SECTION_KEYS, validateSettings } from "${ PACKAGE } ";
45+ import { INPUT_DECLS } from "${ PACKAGE } /internal";
4546import schema from "${ PACKAGE } /settings.schema.json" with { type: "json" };
4647const result = validateSettings({ labels: [] });
4748if (result.isErr()) throw new Error("validateSettings rejected an empty labels list: " + result.error.code);
48- deepStrictEqual(result.value, { settings: { labels: [] }, warnings : [] });
49+ deepStrictEqual(result.value, { settings: { labels: [] }, log : [] });
4950deepStrictEqual([...SECTION_KEYS], ${ JSON . stringify ( SECTION_KEYS ) } );
5051deepStrictEqual(schema.$id, ${ JSON . stringify ( SCHEMA_ID ) } );
51- console.log("imported " + SECTION_KEYS.length + " section keys and the schema");
52+ deepStrictEqual(INPUT_DECLS["on-missing-permission"].default, "fail");
53+ console.log("imported " + SECTION_KEYS.length + " section keys, the internal entry, and the schema");
5254` ;
5355
5456/**
55- * The consumer compiled against index.d.ts, no client behind it. The expect-error lines are the
57+ * The consumer compiled against index.d.ts and internal.d.ts , no client behind it. The expect-error lines are the
5658 * controls that the bundle keeps DenialPolicy nominal (the literal is its public shape, so only the
5759 * private member rejects it) and keeps the context branded with its section's key.
5860 */
5961const TS_CONSUMER = `import {
60- type GithubClient ,
62+ type GitHubClient ,
6163 planContext,
6264 type RepoRef,
6365 SECTION_KEYS,
@@ -69,10 +71,13 @@ const TS_CONSUMER = `import {
6971 snapshotContext,
7072 validateSettings,
7173} from "${ PACKAGE } ";
74+ import { type InputName, INPUT_DECLS } from "${ PACKAGE } /internal";
7275const first: SectionKey | undefined = SECTION_KEYS[0];
76+ export const policy: InputName = "on-missing-permission";
77+ export const policyDefault: string = INPUT_DECLS["on-missing-permission"].default;
7378const result = validateSettings({ labels: [] });
7479export const ok: boolean = result.isOk() && first === "repository";
75- declare const client: GithubClient ;
80+ declare const client: GitHubClient ;
7681declare const repo: RepoRef;
7782const labels = sectionModule("labels");
7883const snapshotCtx = snapshotContext(labels, client, repo, "warn");
0 commit comments