Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into v0.14.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wpf500 committed May 16, 2024
2 parents 2632c56 + b0931c7 commit 3021fa6
Show file tree
Hide file tree
Showing 61 changed files with 819 additions and 453 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/built/
/src/static/
package.json
package-lock.json
159 changes: 153 additions & 6 deletions package-lock.json

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

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dev:api:watch": "tsc-watch -p tsconfig.build.json --noClear --onSuccess 'docker compose restart api_app router'",
"dev:api:logs": "while true; do docker compose logs -f --tail=0 api_app; sleep 1; done",
"build": "rimraf built/ && gulp build && tsc -p ./tsconfig.build.json",
"generate:index": "ts-node scripts/generate-index.ts",
"watch": "tsc-watch -p tsconfig.build.json --noClear",
"check": "concurrently npm:check:*",
"check:tsc": "tsc --noEmit",
Expand All @@ -34,7 +35,7 @@
"test": "jest --setupFiles dotenv/config"
},
"dependencies": {
"@beabee/beabee-common": "^0.20.10",
"@beabee/beabee-common": "^0.21.0",
"@captchafox/node": "^1.2.0",
"@inquirer/prompts": "^3.3.0",
"@sendgrid/mail": "^8.1.0",
Expand Down Expand Up @@ -132,7 +133,8 @@
"ts-jest": "^29.1.1",
"tsc-watch": "^6.0.4",
"tsconfig": "^7.0.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"ts-node": "^10.9.2"
},
"browserslist": [
"last 1 versions",
Expand All @@ -153,4 +155,4 @@
"postcss": "8.4.32"
}
}
}
}
41 changes: 41 additions & 0 deletions scripts/generate-index.ts
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);
2 changes: 1 addition & 1 deletion src/api/controllers/CalloutController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import CalloutResponseTag from "@models/CalloutResponseTag";
import CalloutTag from "@models/CalloutTag";
import Contact from "@models/Contact";

import { CalloutCaptcha } from "@enums/callout-captcha";
import { CalloutCaptcha } from "@beabee/beabee-common";

import { AuthInfo } from "@type/auth-info";

Expand Down
Loading

0 comments on commit 3021fa6

Please sign in to comment.