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

Commit abeaab7

Browse files
authored
Merge pull request #13 from topcoder-platform/dev
Introduce Submission Review & Model Micro App, fix's
2 parents 3cde9bc + 497ef28 commit abeaab7

File tree

100 files changed

+18300
-1510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+18300
-1510
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is a [single-spa](https://single-spa.js.org/) microapp which shows the main
1212
## Config
1313

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

1717
## NPM Commands
1818

babel.config.js

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
let cssLocalIdent;
2+
if (process.env.APPMODE == 'development') {
3+
cssLocalIdent = 'navbar_[path][name]___[local]___[hash:base64:6]';
4+
} else {
5+
cssLocalIdent = '[hash:base64:6]';
6+
}
7+
8+
const config = {
9+
presets: ['@babel/preset-env', '@babel/preset-react'],
10+
plugins: [
11+
[
12+
'@babel/plugin-transform-runtime',
13+
{
14+
useESModules: true,
15+
regenerator: false
16+
}
17+
],
18+
[
19+
'module-resolver',
20+
{
21+
extensions: ['.js', '.jsx'],
22+
root: [
23+
'./src'
24+
]
25+
}
26+
],
27+
[
28+
'inline-react-svg',
29+
{
30+
ignorePattern: '[/\/]assets[/\/]images'
31+
}
32+
],
33+
[
34+
'react-css-modules',
35+
{
36+
filetypes: {
37+
'.scss': {
38+
syntax: 'postcss-scss'
39+
}
40+
},
41+
generateScopedName: cssLocalIdent
42+
}
43+
]
44+
],
45+
env: {
46+
test: {
47+
presets: [
48+
[
49+
'@babel/preset-env',
50+
{
51+
targets: 'current node'
52+
}
53+
]
54+
]
55+
}
56+
}
57+
}
58+
59+
module.exports = config;

babel.config.json

-24
This file was deleted.

config/development.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
module.exports = {
22
URL: {
3-
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder-dev.com",
4-
AUTH: "https://accounts-auth0.topcoder-dev.com",
3+
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder-dev.com", // "http://localhost:5000"
4+
AUTH: "https://accounts-auth0.topcoder-dev.com", // "http://localhost:5000"
5+
TC_NOTIFICATION_URL: 'https://api.topcoder-dev.com/v5/notifications',
6+
CONNECT_DOMAIN: 'https://connect.topcoder-dev.com',
7+
COMMUNITY_DOMAIN: 'https://www.topcoder-dev.com',
58
},
69
API: {
710
V3: "https://api.topcoder-dev.com/v3",
811
},
9-
REAUTH_TIME: 55,
12+
REAUTH_OFFSET: 55, // seconds
1013
};

config/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global process */
22

33
module.exports = (() => {
4-
const env = process.env.NODE_ENV || "development";
4+
const env = process.env.APPENV || "development";
55

66
// for security reason don't let to require any arbitrary file defined in process.env
77
if (["production", "development"].indexOf(env) < 0) {

config/production.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ module.exports = {
22
URL: {
33
ACCOUNTS_APP_CONNECTOR: "https://accounts-auth0.topcoder.com",
44
AUTH: "https://accounts-auth0.topcoder.com",
5+
TC_NOTIFICATION_URL: 'https://api.topcoder.com/v5/notifications',
6+
CONNECT_DOMAIN: 'https://connect.topcoder.com',
7+
COMMUNITY_DOMAIN: 'https://www.topcoder.com',
58
},
69
API: {
710
V3: "https://api.topcoder.com/v3",
811
},
9-
REAUTH_TIME: 55,
12+
REAUTH_OFFSET: 55, // seconds
1013
};

docker/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use the base image with Node.js
2-
FROM node:latest
2+
FROM node:10.22.1
33

44
ARG APPMODE
55
ARG APPENV

jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
},
66
transformIgnorePatterns: ["node_modules/?!(tc-auth-lib)"],
77
moduleNameMapper: {
8-
"\\.css$": "identity-obj-proxy",
8+
"\\.(css|scss)$": "identity-obj-proxy",
99
"\\.svg$": "<rootDir>/__mocks__/fileMock.js",
1010
},
1111
setupFilesAfterEnv: [

0 commit comments

Comments
 (0)