Skip to content

Commit

Permalink
Merge pull request #1004 from finos/dev
Browse files Browse the repository at this point in the history
Update main from dev
  • Loading branch information
aaronreed708 authored Aug 17, 2024
2 parents 0f3e393 + 3d101bf commit 70b7b94
Show file tree
Hide file tree
Showing 444 changed files with 66,496 additions and 22,377 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker-practice/actions-setup-docker@321477a1e481dd60b05f9b489cf4b9be467aa15c
- uses: docker-practice/actions-setup-docker@ccc771627519a0dc44b99c63f3ccf5fab1b1b9b8
- name: Build
run: docker build -f Dockerfile -t user/app:latest .
working-directory: code
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
format: 'HTML'
out: '${{ matrix.module-folder }}-reports'
args: >
# --suppression .github/node-cve-ignore-list.xml
--suppression .github/node-cve-ignore-list.xml
--nodeAuditSkipDevDependencies
--nodePackageSkipDevDependencies
--failOnCVSS 5
Expand All @@ -57,11 +57,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker-practice/actions-setup-docker@321477a1e481dd60b05f9b489cf4b9be467aa15c
- uses: docker-practice/actions-setup-docker@ccc771627519a0dc44b99c63f3ccf5fab1b1b9b8
- name: Build
run: docker build -f Dockerfile -t user/app:latest .
working-directory: code
- name: Scan for vulnerabilities
uses: crazy-max/ghaction-container-scan@dfa7e54dc32045120f06d0bc8d7724860f5db0ad
uses: crazy-max/ghaction-container-scan@f17494a3e47d86fb17c2c1f89b25049492a82d1d
with:
image: user/app:latest
10 changes: 5 additions & 5 deletions code/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
"rules": {
"header/header": [2, "block", [
"*",
" * Copyright (c) 2023 Discover Financial Services",
" * Licensed under Apache-2.0 License. See License.txt in the project root for license information",
{"pattern": " * Copyright \\(c\\) \\d{4} Discover Financial Services| * SPDX-License-Identifier: Apache-2.0"},
{"pattern": " * Licensed under Apache-2.0 License. See License.txt in the project root for license information| * Copyright \\d{4} FINOS A11y Theme Builder contributors - see NOTICE file"},
" "
]],
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars-experimental": "error"
"@typescript-eslint/no-explicit-any": "off",
"no-unused-vars": "off"
},
"ignorePatterns": ["dist/", "node_modules/", "build/"]
}


4 changes: 4 additions & 0 deletions code/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
build/
dist/
coverage/
12 changes: 12 additions & 0 deletions code/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"endOfLine": "lf"
}
2 changes: 1 addition & 1 deletion code/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.19-bookworm-slim
FROM node:20.16.0-bullseye-slim
RUN node -v
# Copy source
RUN mkdir $HOME/code
Expand Down
80 changes: 52 additions & 28 deletions code/package-lock.json

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

11 changes: 7 additions & 4 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"docker-stop": "docker stop a11y-theme-builder",
"docker-start": "docker start a11y-theme-builder",
"docker-rm": "docker rm a11y-theme-builder",
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,css,scss,json,md}\"",
"format:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx,css,scss,json,md}\"",
"lint": "npx eslint .",
"lint:fix": "npx eslint . --fix"
},
Expand All @@ -30,9 +32,9 @@
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/jsonwebtoken": "^9.0.2",
"@types/node": "^20.12.7",
"@types/nodemailer": "^6.4.14",
"axios": "^1.6.8",
"@types/node": "^20.14.15",
"@types/nodemailer": "^6.4.15",
"axios": "^1.7.4",
"axios-debug-log": "^1.0.0",
"body-parser": "^1.20.2",
"cookie-parser": "^1.4.6",
Expand All @@ -50,6 +52,7 @@
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^8.57.0",
"eslint-plugin-header": "^3.1.1",
"nodemon": "^3.1.0"
"nodemon": "^3.1.4",
"prettier": "^3.3.2"
}
}
33 changes: 19 additions & 14 deletions code/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*
/**
* Copyright (c) 2023 Discover Financial Services
* Licensed under Apache-2.0 License. See License.txt in the project root for license information
*/
import express, { Request, Response, NextFunction } from "express";
import bodyParser from "body-parser";
import cookieParser from "cookie-parser";
import * as path from "path";
import { Config } from "./config";
import { addAuthMiddleware } from "./auth";
import { registerThemesEndpoint } from "./themesEndpoint";
import express, { Request, Response, NextFunction } from 'express';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import * as path from 'path';
import { Config } from './config';
import { addAuthMiddleware } from './auth';
import { registerThemesEndpoint } from './themesEndpoint';

const cfg = new Config();

Expand All @@ -19,14 +19,19 @@ function allowCrossDomain(req: Request, res: Response, next: NextFunction) {
res.header('Access-Control-Allow-Headers', 'Content-Type');
if (req.method == 'OPTIONS') {
//console.log("OPTIONS headers=",req.headers)
res.header('Access-Control-Max-Age', ""+60 * 60 * 24 * 365);
res.header('Access-Control-Max-Age', '' + 60 * 60 * 24 * 365);
return res.sendStatus(200);
}
next();
};
}

// Error handling middleware
function handleError(err: any, req: Request, res: Response, next: NextFunction) {
// Error handling middleware
function handleError(
err: any,
req: Request,
res: Response,
next: NextFunction
) {
if (err) {
const code = err.scode || 500;
const message = err.msg || err.message;
Expand All @@ -48,7 +53,7 @@ async function createApp(cfg: Config): Promise<express.Application> {
registerThemesEndpoint(app);
app.use(handleError);
app.use(express.static(path.join(__dirname, '../src/ui/build')));
app.get('/*', function(req: Request, res: Response) {
app.get('/*', function (req: Request, res: Response) {
res.sendFile(path.join(__dirname, '../src/ui/build', 'index.html'));
});
return app;
Expand All @@ -63,4 +68,4 @@ async function main() {
});
}

main();
main();
Loading

0 comments on commit 70b7b94

Please sign in to comment.