Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
"suggest:format": "echo \"\nTo resolve this, run: $(tput bold)npm run format$(tput sgr0)\" && exit 1",
"test:format": "prettier --check . || npm run suggest:format",
"test:spelling": "cspell \"spec/**/*.md\" README.md LICENSE.md",
"test:structure": "find ./gaps -maxdepth 1 -type d -name 'GAP-*' | xargs -I{} ./scripts/validate-structure.js {}",
"sync:codeowners": "node scripts/sync-codeowners.js"
"test:structure": "node scripts/validate-structure.ts",
"sync:codeowners": "node scripts/sync-codeowners.ts"
},
"devDependencies": {
"@mlarah/spec-md": "^3.1.0",
"@tsconfig/node-ts": "^23.6.4",
"@tsconfig/node24": "^24.0.4",
"@types/node": "^24.13.2",
"@types/validator": "^13.15.10",
"ajv": "^8.17.1",
"cspell": "5.9.1",
"handlebars": "^4.7.9",
Expand All @@ -25,6 +29,7 @@
"nodemon": "2.0.20",
"p-limit": "^7.3.0",
"prettier": "^3.8.1",
"typescript": "^6.0.3",
"validator": "^13.12.0",
"yaml": "^2.7.0"
}
Expand Down
19 changes: 12 additions & 7 deletions scripts/sync-codeowners.js → scripts/sync-codeowners.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
#!/usr/bin/env node

import { readdir, readFile, writeFile } from "node:fs/promises";
import { join, dirname } from "node:path";
import { fileURLToPath } from "node:url";
import { join } from "node:path";
import { parse as parseYaml } from "yaml";

const __dirname = dirname(fileURLToPath(import.meta.url));
const rootDir = join(__dirname, "..");
const rootDir = join(import.meta.dirname, "..");
const gapsDir = join(rootDir, "gaps");

async function getGapDirs() {
const entries = await readdir(gapsDir, { withFileTypes: true });
return entries.filter((d) => d.isDirectory() && /^GAP-[1-9]\d*$/.test(d.name));
return entries.filter(
(d) => d.isDirectory() && /^GAP-[1-9]\d*$/.test(d.name),
);
}

async function main() {
const dirs = await getGapDirs();
dirs.sort((a, b) => parseInt(a.name.split("-")[1], 10) - parseInt(b.name.split("-")[1], 10));
dirs.sort(
(a, b) =>
parseInt(a.name.split("-")[1], 10) - parseInt(b.name.split("-")[1], 10),
);

const lines = await Promise.all(
dirs.map(async (dir) => {
const metadataPath = join(gapsDir, dir.name, "metadata.yml");
const metadata = parseYaml(await readFile(metadataPath, "utf8"));
const owners = metadata.authors.map((a) => a.githubUsername.replace(/^@/, ""));
const owners = metadata.authors.map((a) =>
a.githubUsername.replace(/^@/, ""),
);
const ownerList = owners.map((o) => `@${o}`).join(" ");
return `/gaps/${dir.name}/ ${ownerList}`;
}),
Expand Down
147 changes: 0 additions & 147 deletions scripts/validate-structure.js

This file was deleted.

Loading