Skip to content

Commit

Permalink
feat: SKFP-1127 bump dep, fix lint issues and use config instead of h…
Browse files Browse the repository at this point in the history
…ardcoded index name
  • Loading branch information
celinepelletier authored Jun 10, 2024
1 parent f6fdbae commit 862bf1e
Show file tree
Hide file tree
Showing 53 changed files with 4,875 additions and 8,355 deletions.
5 changes: 4 additions & 1 deletion .env schema
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ KEYCLOAK_REALM=
KEYCLOAK_CLIENT=

# Riff
RIFF_URL=
RIFF_URL=

# Indexs name
ES_BIOSPECIMEN_INDEX=
7 changes: 5 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"simple-import-sort"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
Expand All @@ -29,12 +31,13 @@
"ignoreComments": true
}
],
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-explicit-any": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-console": ["error", { "allow": ["warn", "error", "time", "timeEnd", "assert"] }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"prefer-spread": "error",
"prettier/prettier": ["error"],
"simple-import-sort/imports": "error"
}
}

26 changes: 26 additions & 0 deletions .github/workflows/check_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check Pull Request Quality

on:
pull_request:
branches: [master]

jobs:
tests:
name: Run Tests
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Use Dependencies Cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Dependencies
run: npm ci
- name: Run tests and coverage
run: npm run test:coverage
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
FROM node:20-alpine3.18 AS build-image
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run clean
RUN npm run build
RUN npm ci && npm run clean && npm run build && npm run test:silent

# Second image, that creates an image for production
FROM node:20-alpine3.18 AS prod-image
WORKDIR /app
COPY --from=build-image ./app/dist ./dist
COPY package* ./
RUN npm ci --production
CMD [ "node", "./dist/src/index.js" ]
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3 && npm ci --production
ENV NODE_ENV=production
CMD [ "node", "./dist/src/index.js" ]
15 changes: 9 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
module.exports = {
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json',
},
},
moduleFileExtensions: ['ts', 'js'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
},
],
},
testMatch: ['**/src/**/*.test.(ts|js)'],
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/dist/'],
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: '<rootDir>/coverage/',
};
6 changes: 6 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ignore": ["**/*.test.ts", "**/*.spec.ts", "node_modules"],
"watch": ["src"],
"exec": "npm start",
"ext": "ts"
}
Loading

0 comments on commit 862bf1e

Please sign in to comment.