build(scripts): server ratchets share one baseline library at the repository root

scripts/lib/ratchet.mjs carries the tree walk, the CRLF-safe reader and the
baseline handling the client ratchets already use, next to a warning tally and
a format comparison that take ESLint and Prettier from the calling workspace.
server lint:size now runs on it with the same messages and exit codes, and the
libraries have node:test suites that CI runs in the server job.
This commit is contained in:
Maurice
2026-10-10 11:45:27 +02:00
parent 5644e3d77e
commit 889afeae92
12 changed files with 978 additions and 88 deletions
+3 -1
View File
@@ -37,12 +37,14 @@ export const AREAS = {
// The type, lint, test, coverage, bundle and end-to-end jobs. npm workspaces
// hoist every dependency into the root lockfile, so a dependency bump touches
// none of the package directories. The Dockerfile and the entrypoint script
// are pinned by server/tests/unit/docker-entrypoint.test.ts.
// are pinned by server/tests/unit/docker-entrypoint.test.ts. scripts/lib/
// holds the ratchet code the server and shared gates run.
code: [
'server/',
'client/',
'shared/',
'plugin-sdk/',
'scripts/lib/',
'package.json',
'package-lock.json',
'.nvmrc',
+4
View File
@@ -48,6 +48,10 @@ describe('classify', () => {
assert.deepEqual(classify(['plugin-sdk/src/index.ts']), { code: true, image: false, deploy: false });
});
it('runs the tests but not the image for a change to the shared ratchet code', () => {
assert.deepEqual(classify(['scripts/lib/ratchet.mjs']), { code: true, image: false, deploy: false });
});
it('runs the image but not the tests for a .dockerignore change', () => {
assert.deepEqual(classify(['.dockerignore']), { code: false, image: true, deploy: false });
});