Skip to content

Commit d631fa8

Browse files
committed
Adjusted import -> require
1 parent 20ed966 commit d631fa8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

scripts/generate-api-map.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// scripts/generate-api-map.js
2-
import fs from 'fs';
3-
import path from 'path';
1+
const fs = require('fs');
2+
const path = require('path');
43

54
/**
65
* Recursively find all .js files in the /api directory,
7-
* excluding index.js and any test or helper files.
6+
* excluding index.js and any helper files.
87
*/
98
function getApiRoutes(dir = path.join(process.cwd(), 'api'), prefix = '') {
109
const entries = fs.readdirSync(dir, { withFileTypes: true });
@@ -33,8 +32,8 @@ try {
3332
const routes = getApiRoutes();
3433
const outputPath = path.join(process.cwd(), 'api-map.json');
3534
fs.writeFileSync(outputPath, JSON.stringify(routes, null, 2));
36-
console.log('api-map.json generated successfully:\n', routes);
35+
console.log('api-map.json generated successfully:\n', routes);
3736
} catch (error) {
38-
console.error('Failed to generate api-map.json:', error);
37+
console.error('Failed to generate api-map.json:', error);
3938
process.exit(1);
4039
}

0 commit comments

Comments
 (0)