This repository has been archived by the owner on Aug 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
819 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/built/ | ||
/src/static/ | ||
package.json | ||
package-lock.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Simple script to generate index.ts files for each folder listed in the paths array | ||
|
||
const PATHS = [ | ||
"./src/api/controllers", | ||
"./src/api/decorators", | ||
"./src/api/dto", | ||
"./src/api/errors", | ||
"./src/api/interceptors", | ||
"./src/api/middlewares", | ||
"./src/api/params", | ||
"./src/api/transformers", | ||
"./src/api/utils", | ||
"./src/api/validators", | ||
"./src/enums", | ||
"./src/models", | ||
"./src/type" | ||
]; | ||
|
||
import { readdirSync, writeFileSync } from "fs"; | ||
|
||
const encoder = new TextEncoder(); | ||
|
||
const generateIndex = (paths: string[]) => { | ||
for (const path of paths) { | ||
const files = readdirSync(path); | ||
// Sort files by file name | ||
files.sort((a, b) => a.localeCompare(b)); | ||
|
||
let indexContent = ""; | ||
|
||
for (const file of files) { | ||
if (file.endsWith(".ts") && file !== "index.ts") { | ||
indexContent += `export * from "./${file.split(".")[0]}.js";\n`; | ||
} | ||
} | ||
|
||
writeFileSync(`${path}/index.ts`, encoder.encode(indexContent)); | ||
} | ||
}; | ||
|
||
generateIndex(PATHS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.