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

Commit e221d29

Browse files
committed
merge available code base from taas app
1 parent 63ceef6 commit e221d29

File tree

116 files changed

+9675
-2140
lines changed

Some content is hidden

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

116 files changed

+9675
-2140
lines changed

.circleci/config.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": false
3+
}

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"javascript.preferences.quoteStyle": "double",
3+
"typescript.preferences.quoteStyle": "double",
4+
"prettier.jsxSingleQuote": false
5+
}
File renamed without changes.

babel.config.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = function (api) {
2+
const isProd = process.env.APPMODE === "production";
3+
api.cache(!isProd);
4+
5+
const generateScopedName = isProd
6+
? "[hash:base64:6]"
7+
: "community_admin_[path][name]___[local]___[hash:base64:6]";
8+
return {
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+
"react-css-modules",
20+
{
21+
filetypes: {
22+
".scss": {
23+
syntax: "postcss-scss",
24+
},
25+
},
26+
generateScopedName,
27+
},
28+
],
29+
"inline-react-svg",
30+
],
31+
env: {
32+
test: {
33+
presets: [
34+
[
35+
"@babel/preset-env",
36+
{
37+
targets: "current node",
38+
},
39+
],
40+
],
41+
plugins: [
42+
[
43+
"module-resolver",
44+
{
45+
alias: {
46+
styles: "./src/styles",
47+
components: "./src/components",
48+
hooks: "./src/hooks",
49+
utils: "./src/utils",
50+
constants: "./src/constants",
51+
services: "./src/services",
52+
},
53+
},
54+
],
55+
],
56+
},
57+
},
58+
};
59+
};

babel.config.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

build.sh

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ set -eo pipefail
33
APP_NAME=$1
44
UPDATE_CACHE=""
55

6-
docker build -f docker/Dockerfile -t $APP_NAME:latest .
6+
docker build -f docker/Dockerfile -t $APP_NAME:latest \
7+
--build-arg APPMODE=$APPMODE \
8+
--build-arg APPENV=$APPENV .
79

8-
docker create --name app $APP_NAME:latest
10+
docker build -f docker/mockDockerfile -t mock-$APP_NAME:latest .
911

10-
if [ -d node_modules ]
11-
then
12-
mv package-lock.json old-package-lock.json
13-
docker cp app:/$APP_NAME/package-lock.json package-lock.json
14-
set +eo pipefail
15-
UPDATE_CACHE=$(cmp package-lock.json old-package-lock.json)
16-
set -eo pipefail
17-
else
18-
UPDATE_CACHE=1
19-
fi
12+
#docker create --name app $APP_NAME:latest
2013

21-
if [ "$UPDATE_CACHE" == 1 ]
22-
then
23-
docker cp app:/$APP_NAME/node_modules .
24-
fi
14+
#if [ -d node_modules ]
15+
#then
16+
# mv package-lock.json old-package-lock.json
17+
# docker cp app:/$APP_NAME/package-lock.json package-lock.json
18+
# set +eo pipefail
19+
# UPDATE_CACHE=$(cmp package-lock.json old-package-lock.json)
20+
# set -eo pipefail
21+
#else
22+
# UPDATE_CACHE=1
23+
#fi
24+
25+
#if [ "$UPDATE_CACHE" == 1 ]
26+
#then
27+
# docker cp app:/$APP_NAME/node_modules .
28+
#fi

config/dev.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
/**
3+
* URL of Topcoder Community Website
4+
*/
5+
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder-dev.com",
6+
7+
/**
8+
* URL of Topcoder Connect Website
9+
*/
10+
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",
11+
12+
API: {
13+
V5: "https://api.topcoder-dev.com/v5",
14+
V3: "https://api.topcoder-dev.com/v3",
15+
},
16+
};

config/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* global process */
2+
3+
module.exports = (() => {
4+
const env = process.env.APPENV || "dev";
5+
6+
console.info(`APPENV: "${env}"`);
7+
8+
// for security reason don't let to require any arbitrary file defined in process.env
9+
if (["prod", "dev"].indexOf(env) < 0) {
10+
return require("./dev");
11+
}
12+
13+
return require("./" + env);
14+
})();

config/prod.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
/**
3+
* URL of Topcoder Community Website
4+
*/
5+
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder.com",
6+
7+
/**
8+
* URL of Topcoder Connect Website
9+
*/
10+
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",
11+
12+
API: {
13+
V5: "https://api.topcoder.com/v5",
14+
V3: "https://api.topcoder.com/v3",
15+
},
16+
};

docker/Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

docker/docker-compose.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

docker/sample.api.env

Lines changed: 0 additions & 2 deletions
This file was deleted.

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ module.exports = {
33
transform: {
44
"^.+\\.(j|t)sx?$": "babel-jest",
55
},
6+
transformIgnorePatterns: ["node_modules/?!(react-avatar)"],
67
moduleNameMapper: {
7-
"\\.(css)$": "identity-obj-proxy",
8+
"\\.(s?css)$": "identity-obj-proxy",
89
"\\.svg$": "<rootDir>/__mocks__/fileMock.js",
910
},
1011
setupFilesAfterEnv: [

jsconfig.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es2017",
4+
"baseUrl": ".",
5+
"moduleResolution": "node",
6+
"paths": {
7+
"styles/*": ["./src/styles/*"],
8+
"components/*": ["./src/components/*"],
9+
"hooks/*": ["./src/hooks/*"],
10+
"utils/*": ["./src/utils/*"],
11+
"constants/*": ["./src/constants/*"],
12+
"services/*": ["./src/services/*"]
13+
}
14+
},
15+
"exclude": ["node_modules", "dist"]
16+
}

0 commit comments

Comments
 (0)