Skip to content

Commit

Permalink
feat: add quick-migrate justfile command
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Sep 30, 2023
1 parent 06f350d commit 7b828b4
Show file tree
Hide file tree
Showing 43 changed files with 312 additions and 321 deletions.
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import rubiin from "@rubiin/eslint-config";

export default rubiin({
stylistic: true, // enable stylistic rules
yaml: true, // enable yaml rules,
jsonc : true, // enable jsonc rules
markdown: true, // enable markdown rules
typescript: {
tsconfigPath: "tsconfig.json", // path to tsconfig.json
},
Expand Down
19 changes: 7 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ migrate env="dev":
unmigrate env="dev":
NODE_ENV={{env}} npm run orm migration:down

# one stop command to make migration and migrate it
quick-migrate: makemigration migrate

# run seeders to populate database
seed env="dev":
USER_PASSWORD=Test@1234 NODE_ENV={{env}} npm run orm seeder:run
Expand All @@ -25,7 +28,7 @@ test-e2e env="dev":


# clean all auto generated files and generate initial migration file
init: clean-files makemigration
init: clean-files build makemigration

# clean all auto generated files and run migration
clean-db: unmigrate migrate seed
Expand All @@ -49,18 +52,10 @@ build:
encryption:
sh scripts/encryption.sh

# run in shell mode
shell env="dev":
REPL=true npm run start:dev
# run in repl mode
repl env="dev":
REPL=true npm run start:repl

# run deploy script
deploy:
sh scripts/deploy.sh

# stop deployed containers
stop env="dev":
ENV=dev docker compose -f docker-compose.{{env}}.yml stop

# remove deployed containers
remove env="dev":
ENV=dev docker compose -f docker-compose.{{env}}.yml down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"scripts": {
"build": "nest build",
"lint": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs '{src,test}/**/*.ts' --cache",
"lint:fix": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs '{src,test}/**/*.ts' --cache --fix",
"lint:fix": "ESLINT_USE_FLAT_CONFIG=true eslint -c eslint.config.mjs '{src,test}/**/*.ts' --cache --fix --debug",
"orm": "npx mikro-orm",
"prebuild": "rimraf dist",
"sample": "cd env; npx sample-env --env .env.dev",
Expand All @@ -58,11 +58,11 @@
"@golevelup/nestjs-rabbitmq": "^4.0.0",
"@golevelup/nestjs-stripe": "^0.6.3",
"@golevelup/nestjs-webhooks": "^0.2.16",
"@mikro-orm/core": "^5.8.4",
"@mikro-orm/migrations": "^5.8.4",
"@mikro-orm/core": "^5.8.5",
"@mikro-orm/migrations": "^5.8.5",
"@mikro-orm/nestjs": "^5.2.2",
"@mikro-orm/postgresql": "^5.8.4",
"@mikro-orm/reflection": "^5.8.4",
"@mikro-orm/postgresql": "^5.8.5",
"@mikro-orm/reflection": "^5.8.5",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@nestjs/axios": "^3.0.0",
"@nestjs/cache-manager": "^2.1.0",
Expand Down Expand Up @@ -141,12 +141,12 @@
"@firebase/app-compat": "^0.2.19",
"@firebase/app-types": "^0.9.0",
"@golevelup/ts-jest": "^0.4.0",
"@mikro-orm/cli": "^5.8.4",
"@mikro-orm/seeder": "^5.8.4",
"@mikro-orm/cli": "^5.8.5",
"@mikro-orm/seeder": "^5.8.5",
"@nestjs/cli": "10.1.18",
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.6",
"@rubiin/eslint-config": "^1.8.4",
"@rubiin/eslint-config": "^1.8.6-beta.4",
"@rubiin/tsconfig": "^1.1.0",
"@sentry/types": "^7.72.0",
"@side/jest-runtime": "^1.1.0",
Expand All @@ -159,7 +159,7 @@
"@types/jest": "^29.5.5",
"@types/mime-types": "^2.1.2",
"@types/multer": "^1.4.8",
"@types/node": "^20.7.1",
"@types/node": "^20.8.0",
"@types/nodemailer": "^6.4.11",
"@types/passport": "^1.0.13",
"@types/passport-facebook": "^3.0.1",
Expand Down
Loading

0 comments on commit 7b828b4

Please sign in to comment.