-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"watch": ["src"], | ||
"ext": "ts", | ||
"ignore": ["src/**/*.spec.ts", "src/**/*.test.ts"], | ||
"exec": "bash scripts/start.sh" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
CLR_PREFIX="\033[" | ||
CLR_SUFFIX="m" | ||
|
||
CYAN="0;34" | ||
GREEN="1;32" | ||
GREY="1;30" | ||
RED="1;31" | ||
|
||
RESET="0" | ||
|
||
color() { | ||
if [ "$PROD_ENV" == "true" ]; then | ||
echo "" | ||
else | ||
local colorCode="${1:-$RESET}" | ||
echo "$CLR_PREFIX$colorCode$CLR_SUFFIX" | ||
fi | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
SPINNER_PID= | ||
SPINNER_MSG_LEFT= | ||
SPINNER_MSG_RIGHT= | ||
INITIAL_SPINNER_STATE="✅" | ||
EMPTY="" | ||
|
||
LOADER_SEQUENCE_1=("⊏" "⊓" "⊐" "⊔") | ||
LOADER_SEQUENCE_2=("⣾" "⣽" "⣻" "⢿" "⡿" "⣟" "⣯" "⣷") | ||
LOADER_SEQUENCE_3=("𓃉𓃉𓃉" "𓃉𓃉∘" "𓃉∘°" "∘°∘" "°∘𓃉" "∘𓃉𓃉") | ||
LOADER_SEQUENCE_4=("/" "-" "\\" "|") | ||
|
||
LOADER_SEQUENCE=("${LOADER_SEQUENCE_2[@]}") | ||
|
||
spinner() { | ||
local delay=0.1 | ||
local idx=0 | ||
|
||
while true; do | ||
echo -ne "\r$1${LOADER_SEQUENCE[$idx]}$2" | ||
idx=$(( (idx + 1) % ${#LOADER_SEQUENCE[@]} )) | ||
sleep $delay | ||
done | ||
} | ||
|
||
start() { | ||
SPINNER_MSG_LEFT="${1:-$EMPTY}" | ||
SPINNER_MSG_RIGHT="${2:-$EMPTY}" | ||
if [ "$PROD_ENV" == "true" ]; then | ||
echo -e "$SPINNER_MSG_LEFT${LOADER_SEQUENCE[0]}$SPINNER_MSG_RIGHT" | ||
else | ||
echo "" | ||
spinner "$SPINNER_MSG_LEFT" "$SPINNER_MSG_RIGHT" & SPINNER_PID=$! | ||
fi | ||
} | ||
|
||
stop() { | ||
if [ "$PROD_ENV" != "true" ]; then | ||
FINISH_REPLACER="${1:-$INITIAL_SPINNER_STATE}" | ||
kill $SPINNER_PID | ||
echo -ne "\r$SPINNER_MSG_LEFT$FINISH_REPLACER$SPINNER_MSG_RIGHT" | ||
fi | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
|
||
PWD_THIS=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
source "${PWD_THIS}/shared/spinner.sh" | ||
source "${PWD_THIS}/shared/colors.sh" | ||
|
||
PWD_BACKEND="$PWD_THIS/.." | ||
|
||
APP="$1" | ||
VERSION="$2" | ||
|
||
export PACKAGE_JSON_VERSION=$(grep -o '\"version\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}') | ||
|
||
rm -rf dist | ||
|
||
start "" " $(color $CYAN)1.$(color) Compiling shared package" | ||
cd "${PWD_BACKEND}/../shared" && rm -rf dist && npx tsc | ||
stop "$(color $GREEN)✓$(color)" | ||
|
||
start "" " $(color $CYAN)2.$(color) Compiling backend package" | ||
cd "${PWD_BACKEND}" && rm -rf dist && npx tsc | ||
stop "$(color $GREEN)✓$(color)" | ||
|
||
start "" " $(color $CYAN)3.$(color) Converting path aliases to relative paths" | ||
npx tsc-alias -p "${PWD_BACKEND}/tsconfig.json" | ||
stop "$(color $GREEN)✓$(color)" | ||
|
||
echo -e "\n$(color $GREEN)✓ $(color $CYAN)3.$(color) Starting...\n" | ||
node --no-warnings --loader ts-node/esm --experimental-specifier-resolution=node "${PWD_BACKEND}/dist/main.js" | ||
|
||
# | ||
# | ||
# | ||
#export PACKAGE_JSON_VERSION=$(grep -o '\"version\": *\"[^\"]*\"' package.json | awk -F'\"' '{print $4}') | ||
#node --no-warnings --loader ts-node/esm --experimental-specifier-resolution=node ./dist/main.js | ||
|
||
echo -e "\n" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//import { MongoMemoryServer } from "mongodb-memory-server"; | ||
|
||
// This will hold the instance of MongoMemoryServer | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
let mongoServer: any = null; | ||
|
||
export async function setup() { | ||
//mongoServer = await MongoMemoryServer.create(); | ||
//const uri = mongoServer.getUri(); | ||
//await mongoose.connect(uri); | ||
} | ||
|
||
export async function teardown() { | ||
//if (mongoose.connection.readyState !== 0) { | ||
// await mongoose.disconnect(); | ||
//} | ||
//if (mongoServer) { | ||
// await mongoServer.stop(); | ||
//} | ||
} | ||
|
||
export default { setup, teardown }; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"ts-node": { | ||
"transpileOnly": true, | ||
"files": true, | ||
// Tell ts-node CLI to install the --loader automatically, explained below | ||
"esm": true, | ||
"compilerOptions": { | ||
"module": "ESNext" | ||
}, | ||
"require": ["tsconfig-paths/register"] | ||
}, | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
"outDir": "./dist", | ||
"types": ["jest", "node", "@types/jest"], | ||
"esModuleInterop": true, | ||
"moduleResolution": "Node", | ||
|
||
"baseUrl": ".", | ||
"baseUrl": "./src", | ||
"paths": { | ||
"@org/backend/config": ["./src/config/index"], | ||
"@org/backend/config/*": ["./src/config/*"], | ||
"@org/backend/decorators": ["./src/decorators/index"], | ||
"@org/backend/decorators/*": ["./src/decorators/*"], | ||
"@org/backend/types": ["./src/types/index"], | ||
"@org/backend/types/*": ["./src/types/*"], | ||
"@org/backend/infrastructure": ["./src/infrastructure/index"], | ||
"@org/backend/infrastructure/*": ["./src/infrastructure/*"] | ||
"@org/backend/*": ["*"], | ||
"@org/shared": ["../../shared/dist/index"], | ||
"*": ["../node_modules/*"] | ||
} | ||
}, | ||
"ts-node": { | ||
"esm": true, | ||
"experimentalSpecifierResolution": "node" | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["src/logs"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export {}; | ||
import "./setup"; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import z from "zod"; | ||
export declare const ErrorLog: z.ZodObject< | ||
{ | ||
_id: z.ZodType<String, z.ZodTypeDef, String>; | ||
details: z.ZodString; | ||
status: z.ZodNumber; | ||
message: z.ZodString; | ||
path: z.ZodString; | ||
timestamp: z.ZodString; | ||
metadata: z.ZodRecord<z.ZodString, z.ZodAny>; | ||
}, | ||
"strip", | ||
z.ZodTypeAny, | ||
{ | ||
path: string; | ||
message: string; | ||
status: number; | ||
_id: String; | ||
details: string; | ||
timestamp: string; | ||
metadata: Record<string, any>; | ||
}, | ||
{ | ||
path: string; | ||
message: string; | ||
status: number; | ||
_id: String; | ||
details: string; | ||
timestamp: string; | ||
metadata: Record<string, any>; | ||
} | ||
>; | ||
export type ErrorLog = z.infer<typeof ErrorLog>; | ||
//# sourceMappingURL=ErrorLog.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.