Skip to content

Commit c3b55b2

Browse files
Fix formatting for js files
1 parent d3d885a commit c3b55b2

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"serve": "vite --port 3000",
99
"build": "vite build",
1010
"generate:snapshot": "node scripts/snapshot.js",
11-
"lint-prettier:fix": "prettier --write \"data/**/*.json\" \"src/**/*.js\"",
12-
"lint-prettier:check": "prettier --check \"data/**/*.json\" \"src/**/*.js\" "
11+
"lint-prettier:fix": "prettier --write \"data/**/*.json\" \"src/**/*.js\" \"scripts/**/*.js\"",
12+
"lint-prettier:check": "prettier --check \"data/**/*.json\" \"src/**/*.js\" \"scripts/**/*.js\""
1313
},
1414
"dependencies": {
1515
"js-yaml": "^4.1.0",

scripts/snapshot.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,13 @@ function main() {
3131

3232
const config = loadConfig(ROOT);
3333
const toolFiles = loadToolFiles(ROOT);
34-
const tools = toolFiles.map((t) => t.data).sort((a, b) => a.name.localeCompare(b.name));
34+
const tools = toolFiles
35+
.map((t) => t.data)
36+
.sort((a, b) => a.name.localeCompare(b.name));
3537

36-
console.log(`\n Generating snapshot for ${dateStr} (${tools.length} tools)...\n`);
38+
console.log(
39+
`\n Generating snapshot for ${dateStr} (${tools.length} tools)...\n`,
40+
);
3741

3842
// ── tools.json ─────────────────────────────────────────────────────────────
3943
const catalogSnapshot = {
@@ -54,15 +58,22 @@ function main() {
5458
const byLicense = {};
5559

5660
tools.forEach((t) => {
57-
byTier[t.tier] = (byTier[t.tier] || 0) + 1;
61+
byTier[t.tier] = (byTier[t.tier] || 0) + 1;
5862
bySoftwareType[t.softwareType] = (bySoftwareType[t.softwareType] || 0) + 1;
59-
byLicense[t.license] = (byLicense[t.license] || 0) + 1;
63+
byLicense[t.license] = (byLicense[t.license] || 0) + 1;
6064
(t.dimensions || []).forEach((d) => {
6165
byDimension[d] = (byDimension[d] || 0) + 1;
6266
});
6367
});
6468

65-
const stats = { generatedAt: date.toISOString(), releaseDate: dateStr, byTier, bySoftwareType, byDimension, byLicense };
69+
const stats = {
70+
generatedAt: date.toISOString(),
71+
releaseDate: dateStr,
72+
byTier,
73+
bySoftwareType,
74+
byDimension,
75+
byLicense,
76+
};
6677
const statsPath = path.join(outDir, "stats.json");
6778
fs.writeFileSync(statsPath, JSON.stringify(stats, null, 2));
6879
console.log(` ✓ Wrote ${path.relative(ROOT, statsPath)}`);

0 commit comments

Comments
 (0)