Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
70 changes: 70 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
module.exports = function (api) {
const isProd = process.env.APPMODE === "production";
api.cache(!isProd);

const generateScopedName = isProd
? "[hash:base64:6]"
: "self_service_[path][name]___[local]___[hash:base64:6]";
return {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
regenerator: false,
},
],
[
"react-css-modules",
{
filetypes: {
".scss": {
syntax: "postcss-scss",
},
},
generateScopedName,
},
],
[
"inline-react-svg",
{
"svgo": {
"plugins": [
{
"cleanupIDs": false
}
]
}
}
],
],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: "current node",
},
],
],
plugins: [
[
"module-resolver",
{
alias: {
styles: "./src/styles",
components: "./src/components",
hooks: "./src/hooks",
utils: "./src/utils",
constants: "./src/constants",
services: "./src/services",
},
},
],
],
},
},
};
};
38 changes: 38 additions & 0 deletions config/dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder-dev.com",
TERMS_URL:
"https://www.topcoder-dev.com/challenges/terms/detail/317cd8f9-d66c-4f2a-8774-63c612d99cd4",
PRIVACY_POLICY_URL: "https://www.topcoder-dev.com/policy",
SIGN_IN_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService`,
SIGN_UP_URL: `https://accounts-auth0.topcoder-dev.com/?retUrl=https%3A%2F%2Fplatform.topcoder-dev.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,
/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder-dev.com",
VANILLA_EMBED_JS: "https://vanilla.topcoder-dev.com/js/embed.js",
VANILLA_EMBED_TYPE: "mfe",
VANILLA_FORUM_API: "https://vanilla.topcoder-dev.com/api/v2",
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",

API: {
V5: "https://api.topcoder-dev.com/v5",
V3: "https://api.topcoder-dev.com/v3",
},

STRIPE: {
API_KEY: "pk_test_rfcS49MHRVUKomQ9JgSH7Xqz",
API_VERSION: "2020-08-27",
CUSTOMER_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
ADMIN_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
},
/**
* Expire time period of auto saved intake form: 24 hours
*/
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
TIME_ZONE: "Europe/London",
};
14 changes: 14 additions & 0 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* global process */

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

console.info(`APPENV: "${env}"`);

// for security reason don't let to require any arbitrary file defined in process.env
if (["prod", "dev"].indexOf(env) < 0) {
return require("./dev");
}

return require("./" + env);
})();
3 changes: 3 additions & 0 deletions config/local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
COMMUNITY_ADMIN_URL: "",
};
39 changes: 39 additions & 0 deletions config/prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
/**
* URL of Topcoder Community Website
*/
TOPCODER_COMMUNITY_WEBSITE_URL: "https://topcoder.com",
TERMS_URL:
"https://www.topcoder.com/challenges/terms/detail/564a981e-6840-4a5c-894e-d5ad22e9cd6f",
PRIVACY_POLICY_URL: "https://www.topcoder.com/policy",
SIGN_IN_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService`,
SIGN_UP_URL: `https://accounts-auth0.topcoder.com/?retUrl=https%3A%2F%2Fplatform.topcoder.com%2Fself-service%2Fwizard&regSource=selfService&mode=signUp`,

/**
* URL of Topcoder Connect Website
*/
CONNECT_WEBSITE_URL: "https://connect.topcoder.com",
VANILLA_EMBED_JS: "https://discussions.topcoder.com/js/embed.js",
VANILLA_EMBED_TYPE: "standard",
VANILLA_FORUM_API: "https://vanilla.topcoder.com/api/v2",
VANILLA_ACCESS_TOKEN: "va.JApNvUOx3549h20I6tnl1kOQDc75NDIp.0jG3dA.EE3gZgV",

API: {
V5: "https://api.topcoder.com/v5",
V3: "https://api.topcoder.com/v3",
},

STRIPE: {
API_KEY: "pk_live_m3bCBVSfkfMOEp3unZFRsHXi",
API_VERSION: "2020-08-27",
CUSTOMER_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIl0sImlzcyI6Imh0dHBzOi8vYXBpLnRvcGNvZGVyLWRldi5jb20iLCJoYW5kbGUiOiJ0ZXN0MSIsImV4cCI6MjU2MzA3NjY4OSwidXNlcklkIjoiNDAwNTEzMzMiLCJpYXQiOjE0NjMwNzYwODksImVtYWlsIjoidGVzdEB0b3Bjb2Rlci5jb20iLCJqdGkiOiJiMzNiNzdjZC1iNTJlLTQwZmUtODM3ZS1iZWI4ZTBhZTZhNGEifQ.jl6Lp_friVNwEP8nfsfmL-vrQFzOFp2IfM_HC7AwGcg",
ADMIN_TOKEN:
"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb2xlcyI6WyJUb3Bjb2RlciBVc2VyIiwiYWRtaW5pc3RyYXRvciJdLCJpc3MiOiJodHRwczovL2FwaS50b3Bjb2Rlci1kZXYuY29tIiwiaGFuZGxlIjoidGVzdDEiLCJleHAiOjI1NjMwNzY2ODksInVzZXJJZCI6IjQwMDUxMzMzIiwiaWF0IjoxNDYzMDc2MDg5LCJlbWFpbCI6InRlc3RAdG9wY29kZXIuY29tIiwianRpIjoiYjMzYjc3Y2QtYjUyZS00MGZlLTgzN2UtYmViOGUwYWU2YTRhIn0.wKWUe0-SaiFVN-VR_-GwgFlvWaDkSbc8H55ktb9LAVw",
},
/**
* Expire time period of auto saved intake form: 24 hours
*/
AUTO_SAVED_COOKIE_EXPIRED_IN: 24 * 60,
TIME_ZONE: "Europe/London",
};
71 changes: 69 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"scripts": {
"start": "sh start-ssl.sh",
"start:bsouza": "sh start-ssl-bsouza.sh",
"start:mfe": "cross-env webpack-dev-server --port 8519 --host 0.0.0.0",
"build": "react-scripts build",
"build:dev": "sh build-dev.sh",
"build:prod": "sh build-prod.sh",
Expand All @@ -17,32 +18,98 @@
"dependencies": {
"@datadog/browser-logs": "^4.5.0",
"@heroicons/react": "^1.0.6",
"@reach/router": "^1.3.4",
"apexcharts": "^3.35.3",
"axios": "^0.26.1",
"browser-cookies": "^1.2.0",
"classnames": "^2.3.1",
"crypto-js": "^4.1.1",
"lodash": "^4.17.21",
"moment": "^2.29.3",
"moment-timezone": "^0.5.34",
"prop-types": "^15.8.1",
"rc-checkbox": "^2.3.2",
"react": "^17.0.2",
"react-apexcharts": "^1.4.0",
"react-dom": "^17.0.2",
"react-elastic-carousel": "^0.11.5",
"react-gtm-module": "^2.0.11",
"react-redux": "^8.0.2",
"react-redux-toastr": "^7.6.8",
"react-responsive-modal": "^6.2.0",
"react-router-dom": "^6.2.1",
"react-scripts": "5.0.0",
"react-select": "^5.3.2",
"react-spinners": "^0.13.1",
"react-toastify": "^8.2.0",
"react-tooltip": "^4.2.21",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"redux-promise-middleware": "^6.1.2",
"redux-thunk": "^2.4.1",
"sass": "^1.49.8",
"styled-components": "^5.3.5",
"tc-auth-lib": "topcoder-platform/tc-auth-lib#1.0.3",
"typescript": "^4.4.2",
"uuid": "^8.3.2",
"web-vitals": "^2.1.0"
},
"devDependencies": {
"@babel/core": "^7.7.5",
"@babel/plugin-syntax-jsx": "^7.17.12",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.8.7",
"@stripe/react-stripe-js": "1.7.2",
"@stripe/stripe-js": "1.29.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/axios": "^0.14.0",
"@types/jest": "^27.0.1",
"@types/lodash": "^4.14.182",
"@types/node": "^16.7.13",
"@types/reach__router": "^1.3.10",
"@types/react": "^17.0.20",
"@types/react-dom": "^17.0.9",
"@types/react-gtm-module": "^2.0.1",
"@types/react-router-dom": "^5.3.3"
"@types/react-redux-toastr": "^7.6.2",
"@types/react-router-dom": "^5.3.3",
"@types/systemjs": "^6.1.0",
"autoprefixer": "^9.8.6",
"babel-eslint": "^11.0.0-beta.2",
"babel-jest": "^24.9.0",
"babel-plugin-inline-react-svg": "^1.1.2",
"babel-plugin-module-resolver": "^4.0.0",
"babel-plugin-react-css-modules": "^5.2.6",
"concurrently": "^5.0.1",
"config": "^3.3.6",
"cross-env": "^7.0.2",
"eslint": "^6.7.2",
"eslint-config-prettier": "^6.7.0",
"eslint-config-react-important-stuff": "^2.0.0",
"eslint-plugin-prettier": "^3.1.1",
"file-loader": "^6.2.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.2.7",
"jest-cli": "^25.2.7",
"postcss-loader": "^4.0.4",
"postcss-scss": "^3.0.2",
"prettier": "^2.0.4",
"pretty-quick": "^2.0.1",
"resolve-url-loader": "^3.1.2",
"sass": "^1.48.0",
"sass-loader": "^10.0.5",
"single-spa-react": "^2.14.0",
"style-loader": "^2.0.0",
"systemjs-webpack-interop": "^2.1.2",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-config-single-spa-react": "^1.0.3",
"webpack-dev-server": "^3.9.0",
"webpack-merge": "^4.2.2"
},
"eslintConfig": {
"extends": [
Expand All @@ -66,4 +133,4 @@
]
},
"types": "./types/index.d.ts"
}
}
4 changes: 0 additions & 4 deletions src-ts/App.test.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions src-ts/header/Header.test.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions src-ts/header/logo/Logo.test.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions src-ts/header/tool-selectors/ToolSelectors.test.tsx

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading