Skip to content

Commit

Permalink
fix missing json files in production build by removing the build step…
Browse files Browse the repository at this point in the history
… altogether for resources package

This should be fine as long as we use the -T mode https://github.com/TypeStrong/ts-node/issues/104\#issuecomment-504945372
  • Loading branch information
rikukissa committed Aug 16, 2019
1 parent ee19610 commit 79c942c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ COPY package.json package.json
COPY packages/resources/package.json packages/resources/package.json
COPY packages/commons/package.json packages/commons/package.json
COPY yarn.lock yarn.lock
RUN yarn install --prodction
RUN yarn install --production

# Copy package source
COPY --from=opencrvs-build packages/resources/build packages/resources/build
COPY --from=opencrvs-build packages/resources/src packages/resources/src

# Copy dependant package(s) source
COPY --from=opencrvs-build packages/commons packages/commons
Expand Down
7 changes: 2 additions & 5 deletions packages/resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
"test": "jest --silent --noStackTrace && yarn test:compilation",
"test:compilation": "tsc --noEmit",
"start": "cross-env NODE_ENV=DEVELOPMENT nodemon --exec ts-node -r tsconfig-paths/register src/index.ts",
"start:prod": "node build/dist/src/index.js",
"start:prod": "ts-node --transpile-only -r tsconfig-paths/register src/index.ts",
"prep:employees:bgd": "ts-node -r tsconfig-paths/register src/bgd/features/employees/scripts/prepare-source-employees.ts",
"save:testLocations": "ts-node -r tsconfig-paths/register src/tests/loadTestData.ts",
"save:testEmployees": "ts-node -r tsconfig-paths/register src/tests/loadTestEmployees.ts",
"save:testData": "yarn prep:employees:bgd && yarn save:testLocations && yarn save:testEmployees",
"populate:bgd": "bash populateBgd.sh",
"build": "tsc",
"postbuild": "ef-tspm",
"build:clean": "rm -rf build"
"populate:bgd": "bash populateBgd.sh"
},
"devDependencies": {
"csv2json": "^1.4.2",
Expand Down
9 changes: 1 addition & 8 deletions packages/resources/src/bgd/features/languages/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@ export async function languagesHandler(
h: Hapi.ResponseToolkit
): Promise<ILanguageDataResponse> {
const application = request.params.application
let result
try {
result = await getLanguages(application)
} catch (err) {
throw Error(err)
}

return result
return getLanguages(application)
}

0 comments on commit 79c942c

Please sign in to comment.