Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor backend stack to explicitly transpile code #11

Merged
merged 1 commit into from
Dec 20, 2023
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dist
files
**/e2e/videos
node_modules
sbin
# Ignore only top-level package-lock.json
/package-lock.json

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dist
files
**/e2e/videos
node_modules
sbin
# Ignore only top-level package-lock.json
/package-lock.json

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dist
files
**/e2e/videos
node_modules
sbin

# Ignore Helm subcharts
charts/**/charts
Expand Down
3 changes: 2 additions & 1 deletion app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,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);
Expand Down
6 changes: 3 additions & 3 deletions app/package-lock.json

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

9 changes: 6 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
"author": "NR Common Service Showcase <[email protected]>",
"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",
Expand Down
2 changes: 1 addition & 1 deletion app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
12 changes: 6 additions & 6 deletions frontend/package-lock.json

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