Skip to content

Commit

Permalink
add --omit=dev to npm ci in Dockerfile; fix assignment uniqueness bug…
Browse files Browse the repository at this point in the history
…; refactor some code in test.ts; seperate prisma into another file; add checking start.js after build; move jest-mock-extended to dev dependencies; run npm update
  • Loading branch information
NewBieCoderXD committed Aug 15, 2024
1 parent d953954 commit b5f9568
Show file tree
Hide file tree
Showing 10 changed files with 284 additions and 160 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/on_push_and_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ jobs:
- run: npm ci
- run: npm test
- run: npm run lint
- run: npm run checkStyle
- run: npm run checkStyle
- run: npm run build
- run: |
if ! [ -f build/start.js ]; then
exit 1;
fi
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /home/node/app
COPY . .

# Install dependencies
RUN npm ci
RUN npm ci --omit=dev

RUN npm run build

Expand Down
103 changes: 87 additions & 16 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"envalid": "^8.0.0",
"express": "^4.18.2",
"fp-ts": "^2.16.7",
"mcv-discord-bot": "file:",
"node-cache": "^5.1.2",
"zod": "^3.23.8"
},
Expand All @@ -25,6 +24,7 @@
"eslint-plugin-unused-imports": "^3.2.0",
"globals": "^15.8.0",
"jest": "^29.7.0",
"jest-mock-extended": "^3.0.7",
"nodemon": "^3.1.4",
"prettier": "^3.3.2",
"prisma": "^5.16.1",
Expand Down
9 changes: 3 additions & 6 deletions src/database/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ const cacheOption = {
stdTTL: 10000, //seconds
deleteOnExpire: true,
}
// const assignmentsRawCache = new NodeCache();
// const coursesRawCache = new NodeCache();

class wrapperCache<T> {
class WrapperCache<T> {
_rawCache = new NodeCache(cacheOption)
set(key: string, value: T) {
this._rawCache.set(key, value)
Expand All @@ -17,6 +15,5 @@ class wrapperCache<T> {
}
}

export const assignmentsCache = new wrapperCache<Assignment>()
export const coursesCache = new wrapperCache<Course>()
// export ={assignmentsCache, coursesCache};
export const assignmentsCache = new WrapperCache<Assignment>()
export const coursesCache = new WrapperCache<Course>()
Loading

0 comments on commit b5f9568

Please sign in to comment.