Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node-version }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Enable corepack
run: |
corepack enable
corepack prepare yarn@stable --activate

- name: Init docker
run: docker compose up -d
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ dist
temp
node_modules
.idea
.yarn/*
!.yarn/patches
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
3 changes: 2 additions & 1 deletion app/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { EntityManager, EntityRepository, MikroORM, RequestContext } from '@mikr

import { AuthorController, BookController } from './controllers';
import { Author, Book } from './entities';
import config from './mikro-orm.config';

export const DI = {} as {
server: http.Server;
Expand All @@ -18,7 +19,7 @@ export const app = express();
const port = process.env.PORT || 3000;

export const init = (async () => {
DI.orm = await MikroORM.init();
DI.orm = await MikroORM.init(config);
DI.em = DI.orm.em;
DI.authors = DI.orm.em.getRepository(Author);
DI.books = DI.orm.em.getRepository(Book);
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"test": "jest --runInBand --silent"
},
"dependencies": {
"@mikro-orm/core": "^6.0.0",
"@mikro-orm/core": "^6.4.5",
"@mikro-orm/mongo-highlighter": "^1.0.0",
"@mikro-orm/mongodb": "^6.0.0",
"@mikro-orm/mongodb": "^6.4.5",
"express": "^4.18.2",
"express-promise-router": "^4.1.1",
"tsc-watch": "^6.0.4",
"typescript": "5.3.3"
"typescript": "5.7.3"
},
"devDependencies": {
"@mikro-orm/cli": "^6.0.0",
"@mikro-orm/cli": "^6.4.5",
"@types/express": "^4.17.21",
"@types/express-promise-router": "^3.0.0",
"@types/jest": "29.5.12",
Expand All @@ -37,5 +37,6 @@
"./app/mikro-orm.config.ts",
"./dist/mikro-orm.config.js"
]
}
},
"packageManager": "[email protected]"
}
Loading