From 1c28a48299b666090522f501a31411db668e697b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Thu, 27 Aug 2026 07:09:06 +0000 Subject: [PATCH] the check can look at either plugins directory, and knows what is not a plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit there are two now. `platform/plugins/` is what this machine has INSTALLED; `officer-dev/plugins/` is every repo in the org cloned side by side, which is where a plugin is worked on from now on. they hold different sets, so the check has to be pointable rather than assuming the one it sits next to. and it skips a repo with no manifest.ts instead of reporting it broken. `av-club` is the case — a standalone media service in the plugins org, meant to become a plugin in time. checking it against a plugin's conventions would flag its branch name as a defect for ever, and a check that cries wolf is one people stop reading. presence is the declaration here exactly as in discover.ts: the manifest is what makes something a plugin, so its absence is what makes something not one yet. --- scripts/plugins-check.ts | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/scripts/plugins-check.ts b/scripts/plugins-check.ts index 2dce48b2..4ea24a82 100644 --- a/scripts/plugins-check.ts +++ b/scripts/plugins-check.ts @@ -28,7 +28,14 @@ import { readdirSync, existsSync } from 'node:fs'; import { join } from 'node:path'; -const PLUGINS_DIR = join(import.meta.dir, '..', 'plugins'); +/* + Which plugins directory to check. + + There are two as of 2026-08-27: `platform/plugins/` — what this machine has INSTALLED — and + `officer-dev/plugins/`, every repo in the org cloned side by side for working on. They hold different + sets, so the check has to be pointable at either rather than assuming the one it happens to sit next to. +*/ +const PLUGINS_DIR = process.env.PLUGINS_DIR ?? join(import.meta.dir, '..', 'plugins'); const HOST = 'git@gitea.officer.dev'; const BRANCH = 'master'; const REFSPEC = '+refs/heads/*:refs/remotes/origin/*'; @@ -50,7 +57,20 @@ const dirs = readdirSync(PLUGINS_DIR, { withFileTypes: true }) .filter((name) => existsSync(join(PLUGINS_DIR, name, '.git'))) .sort(); -for (const name of dirs) { +/* + A repo with no `manifest.ts` is not a plugin, and that is not drift. + + `av-club` is the case: a standalone media service living in the plugins org, intended to become a + plugin in time. Checking it against a plugin's conventions would report its branch name as a defect + forever, and a check that cries wolf is one people stop reading. + + Presence is the declaration here exactly as it is in `plugins/discover.ts` — the manifest is what makes + something a plugin, so its absence is what makes something not one yet. +*/ +const notYet = dirs.filter((name) => !existsSync(join(PLUGINS_DIR, name, 'manifest.ts'))); +const checkable = dirs.filter((name) => !notYet.includes(name)); + +for (const name of checkable) { const dir = join(PLUGINS_DIR, name); const expected = `${HOST}:plugins/${name}.git`; @@ -107,8 +127,10 @@ for (const name of dirs) { } } +const skipped = notYet.length ? ` (${notYet.length} not a plugin yet: ${notYet.join(', ')})` : ''; + if (!problems.length) { - console.log(`plugins:check — ${dirs.length} plugin repositories, all well-formed`); + console.log(`plugins:check — ${checkable.length} plugin repositories, all well-formed${skipped}`); process.exit(0); }