Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Introduce Submission Review & Model Micro App, fix's #13

Merged
merged 7 commits into from
Jan 27, 2021
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This is a [single-spa](https://single-spa.js.org/) microapp which shows the main
## Config

There are 2 config file for production and development environment in the `config` folder.
Set environment variable `NODE_ENV=development` to use development config, or `NODE_ENV=production` to use production config.
Set environment variable `APPENV=dev` to use development config, or `APPENV=prod` to use production config.

## NPM Commands

Expand Down
59 changes: 59 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
let cssLocalIdent;
if (process.env.APPMODE == 'development') {
cssLocalIdent = 'navbar_[path][name]___[local]___[hash:base64:6]';
} else {
cssLocalIdent = '[hash:base64:6]';
}

const config = {
presets: ['@babel/preset-env', '@babel/preset-react'],
plugins: [
[
'@babel/plugin-transform-runtime',
{
useESModules: true,
regenerator: false
}
],
[
'module-resolver',
{
extensions: ['.js', '.jsx'],
root: [
'./src'
]
}
],
[
'inline-react-svg',
{
ignorePattern: '[/\/]assets[/\/]images'
}
],
[
'react-css-modules',
{
filetypes: {
'.scss': {
syntax: 'postcss-scss'
}
},
generateScopedName: cssLocalIdent
}
]
],
env: {
test: {
presets: [
[
'@babel/preset-env',
{
targets: 'current node'
}
]
]
}
}
}

module.exports = config;
24 changes: 0 additions & 24 deletions babel.config.json

This file was deleted.

9 changes: 6 additions & 3 deletions config/development.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module.exports = {
URL: {
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder-dev.com",
AUTH: "https://accounts-auth0.topcoder-dev.com",
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder-dev.com", // "http://localhost:5000"
AUTH: "https://accounts-auth0.topcoder-dev.com", // "http://localhost:5000"
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications',
CONNECT_DOMAIN: 'https://connect.topcoder-dev.com',
COMMUNITY_DOMAIN: 'https://www.topcoder-dev.com',
},
API: {
V3: "https://api.topcoder-dev.com/v3",
},
REAUTH_TIME: 55,
REAUTH_OFFSET: 55, // seconds
};
2 changes: 1 addition & 1 deletion config/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* global process */

module.exports = (() => {
const env = process.env.NODE_ENV || "development";
const env = process.env.APPENV || "development";

// for security reason don't let to require any arbitrary file defined in process.env
if (["production", "development"].indexOf(env) < 0) {
Expand Down
5 changes: 4 additions & 1 deletion config/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ module.exports = {
URL: {
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder.com",
AUTH: "https://accounts-auth0.topcoder.com",
TC_NOTIFICATION_URL: 'https://api.topcoder.com/v5/notifications',
CONNECT_DOMAIN: 'https://connect.topcoder.com',
COMMUNITY_DOMAIN: 'https://www.topcoder.com',
},
API: {
V3: "https://api.topcoder.com/v3",
},
REAUTH_TIME: 55,
REAUTH_OFFSET: 55, // seconds
};
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use the base image with Node.js
FROM node:latest
FROM node:10.22.1

ARG APPMODE
ARG APPENV
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
},
transformIgnorePatterns: ["node_modules/?!(tc-auth-lib)"],
moduleNameMapper: {
"\\.css$": "identity-obj-proxy",
"\\.(css|scss)$": "identity-obj-proxy",
"\\.svg$": "<rootDir>/__mocks__/fileMock.js",
},
setupFilesAfterEnv: [
Expand Down
Loading