Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BTE-Trusted-Entity/socialkyc.io
Browse files Browse the repository at this point in the history
  • Loading branch information
ggera committed Jan 3, 2023
2 parents 4b4405c + 7178d00 commit e05618f
Show file tree
Hide file tree
Showing 176 changed files with 7,816 additions and 8,278 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"react/react-in-jsx-scope": "off",
"react-hooks/exhaustive-deps": "error",
"import/no-extraneous-dependencies": "error",
"import/no-unresolved": ["error", { "ignore": ["\\.js$"] }],
"import/order": ["error", {
"newlines-between": "always-and-inside-groups",
"groups": ["builtin", "type", "external", "internal", "parent", "sibling", "index", "object"],
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
uses: actions/checkout@v3

- name: Configure Node and package manager
uses: actions/setup-node@v3.2.0
uses: actions/setup-node@v3.5.1
with:
node-version: '16'
node-version-file: 'package.json'
cache: 'yarn'

- name: Install dependencies
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
/yarn-error.log
/.parcel-cache
/coverage
/.vscode
/scripts/loadTest/build
40 changes: 0 additions & 40 deletions .storybook/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,6 @@ module.exports = {
const cssLoaderOptions = cssRule.use[1].options;
cssLoaderOptions.modules = { namedExport: true };

workaroundRequireNotDefined(config);

return config;
},
};

/** Workaround for https://github.com/storybookjs/storybook/issues/14877 */
function workaroundRequireNotDefined(config) {
function replaceFileExtension(filePath, newExtension) {
const { name, root, dir } = path.parse(filePath);
return path.format({
name,
root,
dir,
ext: newExtension,
});
}

// Find the plugin instance that needs to be mutated
const virtualModulesPlugin = config.plugins.find(
(plugin) => plugin.constructor.name === "VirtualModulesPlugin"
);

// Change the file extension to .cjs for all files that end with "generated-stories-entry.js"
virtualModulesPlugin._staticModules = Object.fromEntries(
Object.entries(virtualModulesPlugin._staticModules).map(
([key, value]) => {
if (key.endsWith("generated-stories-entry.js")) {
return [replaceFileExtension(key, ".cjs"), value];
}
return [key, value];
}
)
);

// Change the entry points to point to the appropriate .cjs files
config.entry = config.entry.map((entry) => {
if (entry.endsWith("generated-stories-entry.js")) {
return replaceFileExtension(entry, ".cjs");
}
return entry;
});
}
17 changes: 11 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine AS base
FROM node:18.12.1-alpine AS base

WORKDIR /app

Expand All @@ -7,14 +7,15 @@ FROM base AS builder
# one of dependencies uses node-gyp which requires build tools
RUN apk add --update --no-cache python3 g++ make && ln -sf python3 /usr/bin/python

# get the dependencies and sources
# install build dependencies
# @parcel/css-linux-x64-musl is not optional but marked so
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --ignore-optional && yarn add --ignore-optional --dev @parcel/css-linux-x64-musl && yarn cache clean --all

# get the sources and build the app
COPY src ./src
COPY tsconfig.json ./

# install build dependencies, build the app
# @parcel/css-linux-x64-musl is not optional but marked so
RUN yarn install --frozen-lockfile --ignore-optional && yarn add --ignore-optional --dev @parcel/css-linux-x64-musl && yarn cache clean --all && yarn build
RUN yarn build

FROM base AS release

Expand All @@ -31,6 +32,10 @@ COPY package.json yarn.lock ./
# install the production dependencies only (depends on NODE_ENV)
RUN yarn install --frozen-lockfile --ignore-optional && yarn cache clean --all

# FIXME: a workaround for missing import type assertion
COPY scripts/patchVCExport.js .
RUN node /app/patchVCExport.js

# carry over the built code
COPY --from=builder /app/dist dist

Expand Down
16 changes: 15 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
Copyright (c) 2021-2022, B.T.E. BOTLabs Trusted Entity GmbH. All rights reserved.
Copyright (c) 2021-2022, built on KILT. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product is built on KILT.

4. Neither the name of KILT nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

Disclaimer: The Liability of the BOTLabs GmbH (hereinafter referred to as "BOTLabs") is limited according to the Terms and Conditions for SocialKYC available under https://socialkyc.io/terms.html.

(BSD 4-Clause)
147 changes: 76 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,110 +3,114 @@
"license": "UNLICENSED",
"type": "module",
"engines": {
"node": ">= v16.15.0"
"node": ">= v18.12.1"
},
"scripts": {
"prettify": "prettier --write \"src/**/*.ts*\"",
"lint": "yarn run lint-css && yarn run lint-js",
"lint-js": "eslint --max-warnings 0 --config ./.eslintrc.json \"src/**/*.ts*\"",
"lint-css": "stylelint --fix \"src/**/*.css\"",
"lint-css": "stylelint \"src/**/*.css\"",
"fix-css": "stylelint --fix \"src/**/*.css\"",
"css": "tcm --namedExports --pattern 'src/frontend/**/*.module.css' && eslint --fix --config ./.eslintrc.json \"src/**/*.css.d.ts\"",
"test": "tsc --noEmit && LC_ALL=en_US.UTF-8 jest",
"storybook": "start-storybook --port 6007 --modern",
"dev": "yarn parcel watch",
"build": "yarn parcel build",
"build": "NODE_OPTIONS=--no-experimental-fetch yarn parcel build",
"start": "node --enable-source-maps dist/backend/server.js",
"dev-start": "echo '{\"type\":\"commonjs\"}' > dist/package.json && supervisor --watch dist/backend/ -- --enable-source-maps dist/backend/server.js"
},
"dependencies": {
"@aws-sdk/client-ses": "^3.95.0",
"@hapi/basic": "^6.0.0",
"@aws-sdk/client-ses": "^3.229.0",
"@hapi/basic": "^7.0.0",
"@hapi/boom": "^10.0.0",
"@hapi/hapi": "^20.2.2",
"@hapi/inert": "^6.0.5",
"@kiltprotocol/chain-helpers": "0.27.0",
"@kiltprotocol/core": "0.27.0",
"@kiltprotocol/did": "0.27.0",
"@kiltprotocol/messaging": "0.27.0",
"@kiltprotocol/types": "0.27.0",
"@kiltprotocol/utils": "0.27.0",
"@kiltprotocol/vc-export": "0.27.0",
"@polkadot/keyring": "^8.4.1",
"@polkadot/util": "^8.4.1",
"@polkadot/util-crypto": "^8.4.1",
"@hapi/hapi": "^21.1.0",
"@hapi/inert": "^7.0.0",
"@kiltprotocol/chain-helpers": "0.30.0",
"@kiltprotocol/config": "0.30.0",
"@kiltprotocol/core": "0.30.0",
"@kiltprotocol/did": "0.30.0",
"@kiltprotocol/messaging": "0.30.0",
"@kiltprotocol/types": "0.30.0",
"@kiltprotocol/utils": "0.30.0",
"@kiltprotocol/vc-export": "0.30.0",
"@polkadot/keyring": "^10.1.14",
"@polkadot/util": "^10.1.14",
"@polkadot/util-crypto": "^10.1.14",
"classnames": "^2.3.1",
"detect-browser": "^5.3.0",
"dotenv": "^16.0.1",
"dotenv": "^16.0.3",
"exiting": "^6.1.0",
"got": "^11.8.3",
"got": "^11.8.6",
"hapi-dev-errors": "^4.0.0",
"hapi-gate": "^2.1.0",
"hapi-pino": "^9.3.0",
"hapi-pino": "^11.0.1",
"http-status-codes": "^2.2.0",
"ky": "^0.30.0",
"ky": "^0.33.0",
"lodash-es": "^4.17.21",
"node-cache": "^5.1.2",
"pino": "^7.11.0",
"rate-limiter-flexible": "^2.3.7",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^5.3.3",
"twitter-api-v2": "^1.12.2",
"zod": "^3.17.3"
"pino": "^8.7.0",
"prom-client": "^14.1.0",
"rate-limiter-flexible": "^2.4.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.4",
"twitter-api-v2": "^1.12.9",
"zod": "^3.20.2"
},
"devDependencies": {
"@babel/core": "^7.18.0",
"@babel/preset-env": "^7.18.0",
"@jest/globals": "^28.1.0",
"@parcel/optimizer-data-url": "^2.5.0",
"@parcel/transformer-inline-string": "^2.5.0",
"@storybook/addon-actions": "^6.5.4",
"@babel/core": "^7.20.5",
"@babel/preset-env": "^7.20.2",
"@jest/globals": "^29.3.1",
"@parcel/optimizer-data-url": "^2.7.0",
"@parcel/transformer-inline-string": "^2.7.0",
"@storybook/addon-actions": "^6.5.14",
"@storybook/addon-console": "^1.2.3",
"@storybook/addon-controls": "^6.5.4",
"@storybook/addon-links": "^6.5.4",
"@storybook/addon-toolbars": "^6.5.4",
"@storybook/addon-viewport": "^6.5.4",
"@storybook/addons": "^6.5.4",
"@storybook/builder-webpack5": "^6.5.4",
"@storybook/manager-webpack5": "^6.5.4",
"@storybook/react": "^6.5.4",
"@testing-library/dom": "^8.13.0",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.2.0",
"@testing-library/react-hooks": "^8.0.0",
"@testing-library/user-event": "^14.2.0",
"@storybook/addon-controls": "^6.5.14",
"@storybook/addon-links": "^6.5.14",
"@storybook/addon-toolbars": "^6.5.14",
"@storybook/addon-viewport": "^6.5.14",
"@storybook/addons": "^6.5.14",
"@storybook/builder-webpack5": "^6.5.14",
"@storybook/manager-webpack5": "^6.5.14",
"@storybook/react": "^6.5.14",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@types/hapi__basic": "^5.1.2",
"@types/hapi__hapi": "^20.0.10",
"@types/hapi__hapi": "^20.0.13",
"@types/hapi__inert": "^5.2.3",
"@types/jest": "^27.5.1",
"@types/jest": "^29.2.4",
"@types/lodash-es": "^4.17.6",
"@types/react": "^18.0.9",
"@types/react-dom": "^18.0.5",
"@types/node": "^18.11.14",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"eslint": "^8.16.0",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.2.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"parcel": "^2.5.0",
"pino-pretty": "^7.6.1",
"postcss": "^8.4.14",
"postcss-modules": "^4.3.1",
"prettier": "^2.6.2",
"react-router": "^5.3.3",
"stylelint": "^14.8.3",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.11",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"parcel": "^2.7.0",
"pino-pretty": "^9.1.1",
"postcss": "^8.4.20",
"postcss-modules": "^6.0.0",
"prettier": "^2.8.1",
"react-router": "^5.3.4",
"stylelint": "^14.16.0",
"stylelint-config-css-modules": "^4.1.0",
"stylelint-config-standard": "^25.0.0",
"stylelint-config-standard": "^29.0.0",
"supervisor": "^0.12.0",
"ts-jest": "^28.0.3",
"ts-jest": "^29.0.3",
"typed-css-modules": "^0.7.2",
"typescript": "^4.5.5"
"typescript": "^4.9.4"
},
"targets": {
"frontend": {
Expand All @@ -122,7 +126,8 @@
"src/frontend/privacy.html",
"src/frontend/verifier.html",
"src/frontend/sign.html",
"src/frontend/404.html"
"src/frontend/404.html",
"src/frontend/maintenance.html"
],
"distDir": "dist/frontend"
},
Expand Down
Loading

0 comments on commit e05618f

Please sign in to comment.