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
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"prepare": "husky install"
},
"dependencies": {
"@types/debug": "^4.1.12",
"@types/js-yaml": "^4.0.2",
"@types/jsonld": "^1.5.15",
"@types/markdown-table": "2.0.0",
Comment on lines +24 to +27
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Getting the @types out of devDependencies looks very weird since they should only be needed at build time 🤔 Would that be a symptom of something else being wonky in the setup (e.g. not packaging the correct files, …)? Maybe linked to the fact that act-tools is not properly released (we always load it from the repo).

Not blocking due to that as its minor, but it is maybe something we should look at.

"axios": "^1.13.5",
"commander": "^14.0.3",
"debug": "^4.4.3",
Expand All @@ -41,11 +45,7 @@
},
"devDependencies": {
"@fastify/pre-commit": "^2.2.1",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.1",
"@types/js-yaml": "^4.0.2",
"@types/jsonld": "^1.5.15",
"@types/markdown-table": "2.0.0",
"@types/node": "^25.2.0",
"@types/unist": "^2.0.6",
"@typescript-eslint/eslint-plugin": "^4.28.3",
Expand Down
14 changes: 10 additions & 4 deletions src/implementations-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function cliProgram({
const implementationMappings = await createImplementationMappings(
implementationPath,
outDir,
testCaseJson
testCaseJson,
);

for (const ruleId of getRuleIds(testCaseJson)) {
Expand All @@ -41,7 +41,7 @@ export async function cliProgram({
async function createImplementationMappings(
implementationPath: string,
outDir: string,
testCasesJson: TestCaseJson
testCasesJson: TestCaseJson,
): Promise<ActImplementationReport[]> {
const implementations = loadImplementations(implementationPath);
const implementationMappings: ActImplementationReport[] = [];
Expand All @@ -54,7 +54,7 @@ async function createImplementationMappings(
{
name,
vendor,
}
},
);
const filePath = path.resolve(outDir, `${filenameEscape(name)}.json`);
console.log(`Writing file ${filePath}`);
Expand All @@ -69,8 +69,14 @@ function loadImplementations(implementationPath: string): Implementation[] {
if (typeof yamlData !== "object" || yamlData === null) {
return [];
}
const yamlRecord = yamlData as Record<string, unknown>;
const implementations: Implementation[] = [];
Object.entries(yamlData).forEach(([name, { vendor, report }]) => {
Object.entries(yamlRecord).forEach(([name, entry]) => {
if (typeof entry !== "object" || entry === null) {
console.warn(`Failed to load ${name}. Properties missing or invalid`);
return;
}
const { vendor, report } = entry as Record<string, unknown>;
if (typeof vendor === "string" && typeof report === "string") {
implementations.push({ name, vendor, report });
} else {
Expand Down