diff --git a/.dockerignore b/.dockerignore index d95ee2a1..7914ac96 100644 --- a/.dockerignore +++ b/.dockerignore @@ -9,6 +9,7 @@ dist files **/e2e/videos node_modules +sbin # Ignore only top-level package-lock.json /package-lock.json diff --git a/.gitignore b/.gitignore index c40cb0fd..466a7cfd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ dist files **/e2e/videos node_modules +sbin # Ignore only top-level package-lock.json /package-lock.json diff --git a/Dockerfile b/Dockerfile index 8fa39423..b20c00f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ WORKDIR ${APP_ROOT} # Install Application RUN chown -R 1001:0 ${APP_ROOT} USER 1001 -RUN npm ci --omit=dev +RUN npm ci --omit=dev && npm run build EXPOSE ${APP_PORT} -CMD ["node", "-r", "ts-node/register", "./bin/www"] +CMD ["node", "./sbin/bin/www"] diff --git a/app/.gitignore b/app/.gitignore index af47744e..77282ca1 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -9,6 +9,7 @@ dist files **/e2e/videos node_modules +sbin # Ignore Helm subcharts charts/**/charts diff --git a/app/app.ts b/app/app.ts index 01bdf824..1edecbc3 100644 --- a/app/app.ts +++ b/app/app.ts @@ -84,7 +84,8 @@ appRouter.get('/config', (_req: Request, res: Response, next: (err: unknown) => appRouter.use(config.get('server.apiPath'), v1Router); // Host the static frontend assets -appRouter.use('/', express.static(join(__dirname, 'dist'))); +// This route assumes being executed from '/sbin' +appRouter.use('/', express.static(join(__dirname, '../dist'))); // Root level Router app.use('/', appRouter); diff --git a/app/package.json b/app/package.json index e0044921..be3cc849 100644 --- a/app/package.json +++ b/app/package.json @@ -6,9 +6,12 @@ "author": "NR Common Service Showcase ", "license": "Apache-2.0", "scripts": { - "build": "ts-node ./deploy-utils.ts", - "clean": "rimraf coverage dist", - "clean:all": "npm run clean && ts-node ./deploy-utils.ts clean", + "build": "tsc", + "build:all": "ts-node ./deploy-utils.ts", + "postbuild:all": "npm run build", + "clean": "rimraf coverage dist sbin", + "clean:all": "ts-node ./deploy-utils.ts clean", + "postclean:all": "npm run clean", "debug": "ts-node-dev --debug --respawn --transpile-only --rs --watch bin,config,dist ./bin/www", "format": "prettier ./src --write", "lint": "eslint . **/www* --no-fix --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", diff --git a/app/src/types/ChefsSubmissionForm.ts b/app/src/types/ChefsSubmissionForm.ts index f784c2a0..be44c291 100644 --- a/app/src/types/ChefsSubmissionForm.ts +++ b/app/src/types/ChefsSubmissionForm.ts @@ -1,3 +1,4 @@ +import { YRN } from './YRN'; import { IStamps } from '../interfaces/IStamps'; export type ChefsSubmissionForm = { @@ -14,11 +15,11 @@ export type ChefsSubmissionForm = { singleFamilyUnits?: string; streetAddress?: string; atsClientNumber?: string; - addedToATS?: string; - financiallySupported?: string; + addedToATS: YRN; + financiallySupported: YRN; applicationStatus?: string; relatedPermits?: string; - updatedAai?: string; + updatedAai: YRN; waitingOn?: string; submittedAt: string; submittedBy: string; diff --git a/app/tsconfig.json b/app/tsconfig.json index e5ca9a50..10706550 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -44,7 +44,7 @@ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./dist" /* Specify an output folder for all emitted files. */, + "outDir": "./sbin" /* Specify an output folder for all emitted files. */, // "removeComments": true, /* Disable emitting comments. */ // "noEmit": true, /* Disable emitting files from a compilation. */ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */