From 2410f2621229d41e7ac2f10944b06edc0c134de1 Mon Sep 17 00:00:00 2001 From: Van Nguyen Date: Tue, 13 Oct 2026 23:54:50 +0700 Subject: [PATCH] docs(playground): say that the Dockerfile stack needs repokeeper 0.9.0 The page names the first repokeeper that knows the standard, 0.8.2, and adds a note for the two switches that came later. The Dockerfile stack came with 0.9.0 too and had no note, so the page offered a file that 0.8.2 refuses. --- playground/config.d.ts | 1 + playground/config.js | 7 +++++++ test/playground.test.ts | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/playground/config.d.ts b/playground/config.d.ts index fcb89e4..37329b3 100644 --- a/playground/config.d.ts +++ b/playground/config.d.ts @@ -14,6 +14,7 @@ export const STANDARD: string; export const NEEDS_VERSION: string; export const AUTOUPDATE_NEEDS_VERSION: string; export const SECURITY_NEEDS_VERSION: string; +export const STACK_NEEDS_VERSION: Record; export const STACKS: Array<{ id: string; label: string }>; export const PLATFORM_STACKS: Record<"github" | "gitlab", string[]>; export const PRESETS: Array<{ id: string; summary: string }>; diff --git a/playground/config.js b/playground/config.js index f65faa7..344bbff 100644 --- a/playground/config.js +++ b/playground/config.js @@ -16,6 +16,9 @@ export const AUTOUPDATE_NEEDS_VERSION = "0.9.0"; /** The same for code scanning. */ export const SECURITY_NEEDS_VERSION = "0.9.0"; +/** The same for the stacks added after the standard the file names: an earlier repokeeper does not know them. */ +export const STACK_NEEDS_VERSION = { docker: "0.9.0" }; + export const STACKS = [ { id: "node", label: "Node.js" }, { id: "python", label: "Python" }, @@ -200,6 +203,10 @@ export function problems(input) { if (/^\/|(^|\/)\.\.(\/|$)/.test(stack.directory)) { found.push(`The folder of ${stack.id} has to be a path inside the repository.`); } + if (STACK_NEEDS_VERSION[stack.id]) { + const { label } = STACKS.find((known) => known.id === stack.id); + found.push(`The ${label} stack needs repokeeper ${STACK_NEEDS_VERSION[stack.id]} or newer.`); + } } if (input.modules.health) { const { health } = input; diff --git a/test/playground.test.ts b/test/playground.test.ts index 1fc8595..d1030fd 100644 --- a/test/playground.test.ts +++ b/test/playground.test.ts @@ -244,6 +244,13 @@ describe("playground", () => { ]); }); + it("names the repokeeper a stack newer than the standard needs", () => { + const note = "The Dockerfile stack needs repokeeper 0.9.0 or newer."; + expect(problems(filled("standard", "github", [{ id: "docker" }]))).toEqual([note]); + expect(problems(filled("standard", "gitlab", [{ id: "node" }, { id: "docker" }]))).toEqual([note]); + expect(problems(filled("standard", "github", [{ id: "node" }]))).toEqual([]); + }); + it("offers the command only while a preset says everything the form says", () => { expect(shortcutCommand(filled("standard"))).toBe("npx repokeeper init --stack node"); expect(shortcutCommand(filled("essential"))).toBe("npx repokeeper init --preset essential --stack node");