From a80ca8baa56b6cf2ee9f67f6dc8d0c545f653050 Mon Sep 17 00:00:00 2001 From: Rakib Ansary Date: Wed, 29 Sep 2021 23:57:30 +0600 Subject: [PATCH 01/45] feat: add profile mfe config --- config/micro-frontends-config-local.json | 3 ++- config/micro-frontends-routes-local.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index e1314c6..48e7e86 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -9,6 +9,7 @@ "@topcoder/micro-frontends-earn-app": "http://localhost:8008/earn-app/topcoder-micro-frontends-earn-app.js", "@topcoder/micro-frontends-submission-review-app": "https://platform.topcoder-dev.com/submissionreview/topcoder-micro-frontends-submission-review-app.js", "@topcoder/micro-frontends-model-app": "https://platform.topcoder-dev.com/model-app/topcoder-micro-frontends-model-app.js", - "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js" + "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js", + "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js" } } diff --git a/config/micro-frontends-routes-local.txt b/config/micro-frontends-routes-local.txt index ea7b3e8..cce0c91 100644 --- a/config/micro-frontends-routes-local.txt +++ b/config/micro-frontends-routes-local.txt @@ -25,6 +25,9 @@ + + +
You are unauthorized From 8ee4fa7ea39da32ca2e19aeb8f9982d087b14855 Mon Sep 17 00:00:00 2001 From: Rakib Ansary Date: Thu, 28 Oct 2021 11:27:05 +0600 Subject: [PATCH 02/45] feat: add route to onboarding app --- config/micro-frontends-config-local.json | 3 ++- config/micro-frontends-routes-local.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index 48e7e86..2750b63 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -10,6 +10,7 @@ "@topcoder/micro-frontends-submission-review-app": "https://platform.topcoder-dev.com/submissionreview/topcoder-micro-frontends-submission-review-app.js", "@topcoder/micro-frontends-model-app": "https://platform.topcoder-dev.com/model-app/topcoder-micro-frontends-model-app.js", "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js", - "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js" + "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js", + "@topcoder/micro-frontends-onboarding-app": "http://localhost:8010/onboarding-app/topcoder-micro-frontends-onboarding-app.js" } } diff --git a/config/micro-frontends-routes-local.txt b/config/micro-frontends-routes-local.txt index cce0c91..cee8b1e 100644 --- a/config/micro-frontends-routes-local.txt +++ b/config/micro-frontends-routes-local.txt @@ -28,6 +28,9 @@ + + +
You are unauthorized From 56b824c269d2ea0d51042ca0242878cb11c97d84 Mon Sep 17 00:00:00 2001 From: Rakib Ansary Date: Thu, 28 Oct 2021 11:27:30 +0600 Subject: [PATCH 03/45] ci: test loading onboarding app --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 63c9bdf..aba7775 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,7 @@ workflows: branches: only: - dev - - challenge-listing-part-2 + - feat/onboarding-app # Production builds are exectuted only on tagged commits to the # master branch. From 5a889393be173024787d904e8c64d928ccdeec5f Mon Sep 17 00:00:00 2001 From: Rakib Ansary Date: Wed, 3 Nov 2021 00:53:09 +0600 Subject: [PATCH 04/45] chore: change onboarding app port --- config/micro-frontends-config-local.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index 2750b63..d152528 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -11,6 +11,6 @@ "@topcoder/micro-frontends-model-app": "https://platform.topcoder-dev.com/model-app/topcoder-micro-frontends-model-app.js", "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js", "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js", - "@topcoder/micro-frontends-onboarding-app": "http://localhost:8010/onboarding-app/topcoder-micro-frontends-onboarding-app.js" + "@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js" } } From beade366a72b9b0c8d6af2b4a37680dd59657f0c Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 22 Nov 2021 15:22:58 +0530 Subject: [PATCH 05/45] forums-app integration --- config/micro-frontends-config-local.json | 3 ++- config/micro-frontends-routes-local.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index d152528..3f55319 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -11,6 +11,7 @@ "@topcoder/micro-frontends-model-app": "https://platform.topcoder-dev.com/model-app/topcoder-micro-frontends-model-app.js", "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js", "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js", - "@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js" + "@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js", + "@topcoder/micro-frontends-forums-app": "http://localhost:8510/forums-app/topcoder-micro-frontends-forums-app.js" } } diff --git a/config/micro-frontends-routes-local.txt b/config/micro-frontends-routes-local.txt index cee8b1e..9f6777c 100644 --- a/config/micro-frontends-routes-local.txt +++ b/config/micro-frontends-routes-local.txt @@ -31,6 +31,9 @@ + + +
You are unauthorized From afe26ab97ed63131609b9b7a677ff29a960183f2 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Thu, 6 Jan 2022 16:08:32 +0200 Subject: [PATCH 06/45] Support self service app --- config/micro-frontends-config-local.json | 3 ++- config/micro-frontends-routes-local.txt | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index 3f55319..9dd88bf 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -12,6 +12,7 @@ "@topcoder/micro-frontends-community-admin-app": "https://tc-micro-community-admin.herokuapp.com/community-admin-app/topcoder-micro-frontends-community-admin-app.js", "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js", "@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js", - "@topcoder/micro-frontends-forums-app": "http://localhost:8510/forums-app/topcoder-micro-frontends-forums-app.js" + "@topcoder/micro-frontends-forums-app": "http://localhost:8510/forums-app/topcoder-micro-frontends-forums-app.js", + "@topcoder/micro-frontends-self-service-app": "http://localhost:8519/self-service-app/topcoder-micro-frontends-self-service-app.js" } } diff --git a/config/micro-frontends-routes-local.txt b/config/micro-frontends-routes-local.txt index 9f6777c..ad82a95 100644 --- a/config/micro-frontends-routes-local.txt +++ b/config/micro-frontends-routes-local.txt @@ -34,6 +34,9 @@ + + +
You are unauthorized From f9dc2b514d2072751aa029f47509f8a0750821b5 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Fri, 25 Feb 2022 17:25:55 +0200 Subject: [PATCH 07/45] when sending an error, return instead of executing the rest of the code --- server.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/server.js b/server.js index 0e567a1..ebb7254 100644 --- a/server.js +++ b/server.js @@ -29,8 +29,7 @@ app.get("/micro-frontends-config", async function (req, res) { mfeRoutes = await fsPromises.readFile(path.join(configPath + env_config.mfeConfigPath)) break; default : - res.send({'error': { message: "Check application environment", code: 500 }}) - break; + return res.send({'error': { message: "Check application environment", code: 500 }}) } res.send(mfeRoutes); }); @@ -52,8 +51,7 @@ app.get("*", async function (req, res) { mfeIndex = mfeIndex.data break; default : - res.send({'error': { message: "Check application environment", code: 500 }}) - break; + return res.send({'error': { message: "Check application environment", code: 500 }}) } let mfeRoutes switch (process.env.APPENV.toLowerCase()) { @@ -67,8 +65,7 @@ app.get("*", async function (req, res) { mfeRoutes = await fsPromises.readFile(path.join(configPath + env_config.mfeRoutesPath)) break; default : - res.send({'error': { message: "Check application environment", code: 500 }}) - break; + return res.send({'error': { message: "Check application environment", code: 500 }}) } let mfeIndexHtml = htmlParse.parse(mfeIndex) let singleSpaMain = mfeIndexHtml.querySelector('#single-spa-main') From 6f70ab85138ee7a0eba8b38519af87bbe3ee082b Mon Sep 17 00:00:00 2001 From: Chris McCann Date: Thu, 14 Apr 2022 15:51:18 -0700 Subject: [PATCH 08/45] Initial updates for requirements and dev setup --- README.md | 47 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6b93836..137df25 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,57 @@ # Topcoder Frame Single-Spa Application (micro-frontends-frame) -This is the micro-frontends-frame [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro applications. -It always loads **Topcoder Navbar Microapp** which show the top navigation and handles authorization and loads other microapps depend on the current URL. +This is the micro-frontends-frame [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro-frontend applications. +It always loads **Topcoder Navbar Microapp** which provides the top-level navigation, handles authorization, and loads other microapps depend on the current URL. ## Overview Topcoder Single Spa consist of 3 main components: - This frame application which is `micro-frontends-frame` [single-spa](https://single-spa.js.org/) application. The only function of this application is to register other micro applications to load. -- **Topcoder Navbar Microapp** - micro application which is always loaded by the frame application and shows top navigation bar and handles user authorization. +- **Topcoder Navbar Microapp** - micro application which is always loaded by the frame application and shows the top-level navigation bar and handles user authorization. - Any other micro application can be loaded as main content of the overall application. ## Requirements -| Command | Versions | +Use the node version manager [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) to easily and safely manage the required version of NodeJS (aka, node). Download and install it per the instructions for your development operating system. Installing a version of node via `nvm` will also install `npm`. + +You can configure your command shell to automatically use the correct version of node based on the existence of a `.nvmrc` file in the root of the project directory. See [the nvm Github README](https://github.com/nvm-sh/nvm/blob/master/README.md#deeper-shell-integration) for more information on setting this up. + +You can verify the versions of `nvm`, `node`, and `npm` using the commands below. +| Command | Version | | -------------------- | ---------------------- | -| `$ npm -v` | 6.14.6 | -| `$ node -v` | 0.33.11 | -| `$ nvm --version` | 0.33.11 | +| `$ npm -v` | 6.14.12 | +| `$ node -v` | v10.22.1 | +| `$ nvm --version` | 0.39.1 | | `$ nvm current` | v10.22.1 | -## Config +## Local Development Setup + +### IDE Configuration + +Use the [VS Code](https://code.visualstudio.com/download) IDE for MFE development. Once installed, install the `TSLint` extension to provide Typescript linting capability. The linter will use the settings and rules as defined in the `tslint.config` file in the project's root directory. + +Once the extension is installed you need to configure VS Code to use it correctly. #TODO + +Also, in order to use tslint from the command line, install it globally via `npm`: +``` +$ npm i -g tslint +``` +### Terminal Configuration + +The MFE Frame needs to run separate local server and client processes, each one in a separate terminal session. The navbar also needs to run its server in a terminal, along with the `local-ssl-proxy` server that will allow you to use *https* endpoints locally. Finally, each of the other micro front-end applications you want to run will also each run in their own terminal session. + +When developing one of the micro front-end applications you will therefore have 5 terminal sessions running at the same time: + +- `mfe-frame` server +- `mfe-frame` client +- `navbar` application +- `local-ssl-proxy` server +- the micro front-end app you're developing + +Given this complexity, it is recommended that you use a tool like [iTerm2](https://iterm2.com) (on Mac) or an equivalent terminal shell on Windows to make terminal management simpler. iTerm2 allows you to setup a pre-defined window layout of terminal sessions, including the directory in which the session starts. With this setup, along with simple shell scripts in each project that configure and start the environment (#TODO), will allow you to get your development environment up and running quickly and easily. + +## Application Configuration This `micro-frontends-frame` app has 2 types of configs: From 55eb008966adf1e68fbd58dd913c7baef3ad6cf8 Mon Sep 17 00:00:00 2001 From: Chris McCann Date: Fri, 15 Apr 2022 11:45:17 -0700 Subject: [PATCH 09/45] Replaces favicon with new graphic --- src/images/favicon.png | Bin 0 -> 814 bytes src/index.ejs | 69 +++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 src/images/favicon.png diff --git a/src/images/favicon.png b/src/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..e2eb7d1a3fa75119c8d8369a826ebd57767138f5 GIT binary patch literal 814 zcmV+}1JV46P)eo}K~#7F?N&*0 z+CUWj42$f7ZXi*xwm5DFyuYas>qIL zKq#qHrC(K-Q1ge^e`<*s7#J8B7#J8B7#RGoC`gW|)oRV{cH6?wYb+b9qW%gCg~D{V z+r1Wx#qoST_arCeasb=5J0RG@vQJbAAlqLo7T@JUTyy{scR}PEmMhs1AY(THAQ@4V zjHp(tU6jM~1>^}EHhkE6kc=ov2EbttkIz^iBp-aTEK63a)kMxjIr)N;sFX^j7MjgY zY_AaIA6Q}Bd`SBf9&E@aWUsSk0lHJ@PGE0}S1;bL*Xu6!T>SqLuU5RzL9p3urpb~k z#Kb{{QPrh#0HY(wy(A~fdcCG|PMaq7Z?T&4Yx=xL2t5yr0T^=w0b>xTd&R)PM;mrI z$$AYnlco-59MS6&zUb$Rm zbeXk?xW?CuF0=IK`+hq*0BU+C8o*FTl~rGkBanTBk|Q!iRJ(X~WPd*#1GDXMNN8k2 z9Mp=Y5Xc1@!2oqPflNnEgU!goIpssylka1%bs~9!hh>?18X4N&H!&j2XrMfKO$L1|$ACB0or~t56ng?XOh@Ub{1z%E{4}>h0O7{S9*7pFM zJvjsL$)I%OJ~?2wt>NV`P*Dl7oADT?7bIB{89-ELv*pTo4kEa<& zZHoFJ&hnd233UFmQjGDao?nu_;q*QWX&nxHPyObf2g1P{@%x)k38pOB(7a%HQK?sE ziPNExH+cd!MoULsh9dOhq213afj7VA8W5L^i`GGABSpoj&5FV s_o@$uf0KiOfq{X6fq{X6fx*9zpO^xYvFvXomH+?%07*qoM6N<$f*YD)uK)l5 literal 0 HcmV?d00001 diff --git a/src/index.ejs b/src/index.ejs index 75b1420..7772e4e 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -1,12 +1,13 @@ + Topcoder.com - + - + @@ -57,41 +59,46 @@ <% if (htmlWebpackPlugin.options.templateParameters.isLocal) { %> - - - - - <% } else { %> - - - - - <% } %> + + + + + <% } else { %> + + + + + <% } %> - + - <% if (htmlWebpackPlugin.options.templateParameters.SEGMENT_ANALYTICS_KEY != "NS") { %> - - - - <% } %> + <% if (htmlWebpackPlugin.options.templateParameters.SEGMENT_ANALYTICS_KEY !="NS" ) { %> + + + + <% } %> + - + + \ No newline at end of file From 0f7501a2f05c3df17ea87778dca8773b7076b7b0 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:03:19 +0530 Subject: [PATCH 10/45] App Name change --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aba7775..79c1c70 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ install_dependency: &install_dependency install_deploysuite: &install_deploysuite name: Installation of install_deploysuite. command: | - git clone --branch v1.4.2 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript + git clone --branch v1.4.8 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript cp ./../buildscript/master_deploy.sh . cp ./../buildscript/buildenv.sh . cp ./../buildscript/awsconfiguration.sh . @@ -53,7 +53,7 @@ jobs: environment: DEPLOY_ENV: "DEV" LOGICAL_ENV: "dev" - APPNAME: "micro-frontends-frame" + APPNAME: "mfe-core" steps: *builddeploy_steps "build-prod": @@ -61,7 +61,7 @@ jobs: environment: DEPLOY_ENV: "PROD" LOGICAL_ENV: "prod" - APPNAME: "micro-frontends-frame" + APPNAME: "mfe-core" steps: *builddeploy_steps workflows: From e8bc21ee9a4278ee8ef3351b59c054ce4196dcec Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:09:52 +0530 Subject: [PATCH 11/45] App name change --- docker/Dockerfile | 4 ++-- docker/docker-compose.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 71f2789..e38ee8a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,10 +10,10 @@ ENV APPENV=$APPENV ENV SEGMENT_ANALYTICS_KEY=$SEGMENT_ANALYTICS_KEY # Copy the current directory into the Docker image -COPY . /micro-frontends-frame +COPY . /mfe-core # Set working directory for future use -WORKDIR /micro-frontends-frame +WORKDIR /mfe-core # Install the dependencies from package.json RUN npm install diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index decf850..dac6e41 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: micro-frontends-frame: - image: micro-frontends-frame:latest + image: mfe-core:latest build: context: ../ dockerfile: docker/Dockerfile From b7d2f8af0cefe88b9b23bacc41ad7975457829f6 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:28:45 +0530 Subject: [PATCH 12/45] name change --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index dac6e41..0c00d77 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,6 @@ version: '3' services: - micro-frontends-frame: + mfe-core: image: mfe-core:latest build: context: ../ From add423a85518b011cf2f9997005b3fbdc653bc99 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:31:14 +0530 Subject: [PATCH 13/45] name change --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4f74539..06843c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@topcoder/micro-frontends-frame", + "name": "@topcoder/mfe-core", "requires": true, "lockfileVersion": 1, "dependencies": { diff --git a/package.json b/package.json index cf20eba..246d846 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@topcoder/micro-frontends-frame", + "name": "@topcoder/mfe-core", "scripts": { "start": "node server.js", "build": "webpack --mode=${APPMODE:-development} --env.APPENV=${APPENV:-dev} --env.SEGMENT_ANALYTICS_KEY=${SEGMENT_ANALYTICS_KEY:-NS}", From 65a1fa5be31fef76d7db2ffb73fa9337848ea3c0 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:33:10 +0530 Subject: [PATCH 14/45] name change --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 7283d30..0eddef5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,7 @@ module.exports = (webpackConfigEnv) => { const orgName = "topcoder"; const defaultConfig = singleSpaDefaults({ orgName, - projectName: "micro-frontends-frame", + projectName: "mfe-core", webpackConfigEnv, }); From d47b2d1381d56973f4bd96b5d4c02fdcb0c8c0e1 Mon Sep 17 00:00:00 2001 From: Gunasekar-K Date: Mon, 18 Apr 2022 16:52:52 +0530 Subject: [PATCH 15/45] name change --- src/{topcoder-micro-frontends-frame.js => topcoder-mfe-core.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{topcoder-micro-frontends-frame.js => topcoder-mfe-core.js} (100%) diff --git a/src/topcoder-micro-frontends-frame.js b/src/topcoder-mfe-core.js similarity index 100% rename from src/topcoder-micro-frontends-frame.js rename to src/topcoder-mfe-core.js From ffb95322237972dcfd9a7ac891489ecd07012816 Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Mon, 18 Apr 2022 17:12:04 +0300 Subject: [PATCH 16/45] rename repo --- README.md | 50 ++++++++++++------------ config/micro-frontends-config-local.json | 4 +- config/micro-frontends-routes-local.txt | 2 +- src/index.ejs | 8 ++-- src/topcoder-mfe-core.js | 2 +- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 6b93836..7d9739a 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# Topcoder Frame Single-Spa Application (micro-frontends-frame) +# Topcoder Frame Single-Spa Application (mfe-core) -This is the micro-frontends-frame [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro applications. +This is the mfe-core [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro applications. It always loads **Topcoder Navbar Microapp** which show the top navigation and handles authorization and loads other microapps depend on the current URL. ## Overview Topcoder Single Spa consist of 3 main components: -- This frame application which is `micro-frontends-frame` [single-spa](https://single-spa.js.org/) application. The only function of this application is to register other micro applications to load. +- This frame application which is `mfe-core` [single-spa](https://single-spa.js.org/) application. The only function of this application is to register other micro applications to load. - **Topcoder Navbar Microapp** - micro application which is always loaded by the frame application and shows top navigation bar and handles user authorization. - Any other micro application can be loaded as main content of the overall application. @@ -22,7 +22,7 @@ Topcoder Single Spa consist of 3 main components: ## Config -This `micro-frontends-frame` app has 2 types of configs: +This `mfe-core` app has 2 types of configs: 1. Import mapping for the frame, containg `micro app name` and `relative url path` for each micro app. The configuration files are available on TC AWS S3 and have public access. @@ -30,7 +30,7 @@ This `micro-frontends-frame` app has 2 types of configs: ```json { "imports": { - "@topcoder/micro-frontends-navbar-app": "https://mfe.topcoder-dev.com/navbar/topcoder-micro-frontends-navbar-app.js", + "@topcoder/mfe-header": "https://mfe.topcoder-dev.com/navbar/topcoder-mfe-header.js", "": "" } } @@ -39,7 +39,7 @@ This `micro-frontends-frame` app has 2 types of configs: ii. Location of the AWS S3 files: - Configure micro app names and relative URL to be used when deployed to production environment in file at location : `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-config-production.json` - Configure micro app names and relative URL to be used when deployed to development environment in file at location : `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-config-development.json` - - Configure micro app names and relative URL to be used when deployed to local environment in file at location : `./micro-frontends-frame/config/micro-frontends-config-local.json` + - Configure micro app names and relative URL to be used when deployed to local environment in file at location : `./mfe-core/config/micro-frontends-config-local.json` 2. Route mapping handled by the frame, containing `route path` and `micro app name` for each micro app. The configuration files are available on TC AWS S3 and have public access. @@ -53,7 +53,7 @@ This `micro-frontends-frame` app has 2 types of configs: ii. Location of the AWS S3 files: - Configure route path and micro app name to be used when deployed to production environment in file at location : `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-routes-production.txt` - Configure route path and micro app name to be used when deployed to development environment in file at location : `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-routes-development.txt` - - Configure route path and micro app name to be used when deployed to development environment in file at location : `./micro-frontends-frame/config/micro-frontends-routes-local.txt` + - Configure route path and micro app name to be used when deployed to development environment in file at location : `./mfe-core/config/micro-frontends-routes-local.txt` ⚠️ **NOTE** : When a configuration files is updated on TC AWS S3, make sure to give public access to the file. @@ -71,7 +71,7 @@ This `micro-frontends-frame` app has 2 types of configs: ## Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development -To deploy `micro-frontends-frame` app locally run inside the project root `./micro-frontends-frame`: +To deploy `mfe-core` app locally run inside the project root `./mfe-core`: | Command | Description | | -------------------- | ---------------------- | @@ -86,7 +86,7 @@ To deploy `micro-frontends-frame` app locally run inside the project root `./mic ## Local Deployment from web server (node) -To deploy `micro-frontends-frame` app locally run inside the project root `./micro-frontends-frame`: +To deploy `mfe-core` app locally run inside the project root `./mfe-core`: | Command | Description | | -------------------- | ---------------------- | @@ -158,7 +158,7 @@ For adding a child app to the root app make the following steps: 1. Add child app path to importmap. File underpath - `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-config-production.json` for production deployment - `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-config-development.json` for development deployment -- `./micro-frontends-frame/config/micro-frontends-config-local.json` for local deployment +- `./mfe-core/config/micro-frontends-config-local.json` for local deployment React example: @@ -175,7 +175,7 @@ For adding a child app to the root app make the following steps: 2. Add a route which should show the app. File underpath - `https://tc-platform-prod.s3.amazonaws.com/micro-frontends/micro-frontends-routes-production.txt` for production deployment - `https://tc-platform-dev.s3.amazonaws.com/micro-frontends/micro-frontends-routes-development.txt` for development deployment -- `./micro-frontends-frame/config/micro-frontends-routes-local.txt` for local deployment +- `./mfe-core/config/micro-frontends-routes-local.txt` for local deployment ```html @@ -185,7 +185,7 @@ For adding a child app to the root app make the following steps: ## Add-hoc child app replacement (import override) -To run a child app locally we always need to have frame (`micro-frontends-frame`) which would load a child app. But the cool thing is that we don't have to deploy the frame locally and we can use already deployed frame app. We can use a dev tool to override a child app URL so it would be loaded from the local machine by following the next steps: +To run a child app locally we always need to have frame (`mfe-core`) which would load a child app. But the cool thing is that we don't have to deploy the frame locally and we can use already deployed frame app. We can use a dev tool to override a child app URL so it would be loaded from the local machine by following the next steps: - Load already deployed frame app in the browser. - Open browser console and set `devtools` flag in the local storage by executing the next command: @@ -318,8 +318,8 @@ There is no universal approach to run any React app as child app in Single SPA. ### Checkout 4 repos and apply patches: -- git clone https://github.com/topcoder-platform/micro-frontends-frame.git -- git clone https://github.com/topcoder-platform/micro-frontends-navbar-app.git +- git clone https://github.com/topcoder-platform/mfe-core.git +- git clone https://github.com/topcoder-platform/mfe-header.git - git clone https://github.com/topcoder-platform/micro-frontends-react-app.git - git clone https://github.com/topcoder-platform/micro-frontends-angular-app.git and create a folder (ex: 'auth0-local-login'), and save the following file: 'https://accounts-auth0.topcoder-dev.com/setupAuth0WithRedirect.js' into that folder. After 'setupAuth0WithRedirect.js' file was saved, create an empty 'index.html' file with the following content: @@ -344,8 +344,8 @@ and create a folder (ex: 'auth0-local-login'), and save the following file: 'htt (1). root-config: open Terminal #1 change the current dir to the root-config folder and apply patch: -- cd micro-frontends-frame -- git apply ../micro-frontends-frame.diff --ignore-whitespace --whitespace=nowarn +- cd mfe-core +- git apply ../mfe-core.diff --ignore-whitespace --whitespace=nowarn install dependencies: - npm install build and run the app: @@ -354,8 +354,8 @@ build and run the app: (2). navbar-app: open Terminal #2 change the current dir to the navbar-app folder and apply patch: -- cd micro-frontends-navbar-app -- git apply ../micro-frontends-navbar-app.diff --ignore-whitespace --whitespace=nowarn +- cd mfe-header +- git apply ../mfe-header.diff --ignore-whitespace --whitespace=nowarn there is a config file: '{navbar-app-repo}/config/development.js'. To login locally, change 'ACCOUNTS_APP_CONNECTOR', and 'AUTH' to point to the server that will be served in folder 'auth0-local-login' which was setup in the previous step. ``` URL: { @@ -412,9 +412,9 @@ The app can be open at the browser url: 'http://localhost:5000/' (this page will ### Checkout 4 repos and apply patches: -- git clone https://github.com/topcoder-platform/micro-frontends-frame.git +- git clone https://github.com/topcoder-platform/mfe-core.git -- git clone https://github.com/topcoder-platform/micro-frontends-navbar-app.git +- git clone https://github.com/topcoder-platform/mfe-header.git - git clone https://github.com/topcoder-platform/micro-frontends-react-app.git @@ -464,9 +464,9 @@ open Terminal #1 change the current dir to the root-config folder and apply patch: -- cd micro-frontends-frame +- cd mfe-core -- git apply ../micro-frontends-frame.diff --ignore-whitespace --whitespace=nowarn +- git apply ../mfe-core.diff --ignore-whitespace --whitespace=nowarn install dependencies: @@ -484,9 +484,9 @@ open Terminal #2 change the current dir to the navbar-app folder and apply patch: -- cd micro-frontends-navbar-app +- cd mfe-header -- git apply ../micro-frontends-navbar-app.diff --ignore-whitespace --whitespace=nowarn +- git apply ../mfe-header.diff --ignore-whitespace --whitespace=nowarn there is a config file: '{navbar-app-repo}/config/development.js'. To login locally, change 'ACCOUNTS_APP_CONNECTOR', and 'AUTH' to point to the server that will be served in folder 'auth0-local-login' which was setup in the previous step. @@ -588,4 +588,4 @@ change the current dir to the 'auth0-local-login' folder and serve with the inde - npx http-server . -p 5000 -The app can be open at the browser url: 'http://localhost:5000/' (this page will redirect to the actual page: 'http://localhost:3000/') \ No newline at end of file +The app can be open at the browser url: 'http://localhost:5000/' (this page will redirect to the actual page: 'http://localhost:3000/') diff --git a/config/micro-frontends-config-local.json b/config/micro-frontends-config-local.json index 9dd88bf..1f4d5b6 100644 --- a/config/micro-frontends-config-local.json +++ b/config/micro-frontends-config-local.json @@ -1,6 +1,6 @@ { "imports": { - "@topcoder/micro-frontends-navbar-app": "http://localhost:3001/navbar/topcoder-micro-frontends-navbar-app.js", + "@topcoder/mfe-header": "http://localhost:3001/navbar/topcoder-mfe-header.js", "@topcoder/micro-frontends-taas-admin-app": "https://platform.topcoder-dev.com/taas-admin-app/topcoder-micro-frontends-taas-admin-app.js", "@topcoder/micro-frontends-react-app": "https://platform.topcoder-dev.com/react/topcoder-micro-frontends-react-app.js", "@topcoder/micro-frontends-angular-app": "https://platform.topcoder-dev.com/angular/main.js", @@ -13,6 +13,6 @@ "@topcoder/micro-frontends-profile-app": "http://localhost:8009/profile-app/topcoder-micro-frontends-profile-app.js", "@topcoder/micro-frontends-onboarding-app": "http://localhost:8510/onboarding-app/topcoder-micro-frontends-onboarding-app.js", "@topcoder/micro-frontends-forums-app": "http://localhost:8510/forums-app/topcoder-micro-frontends-forums-app.js", - "@topcoder/micro-frontends-self-service-app": "http://localhost:8519/self-service-app/topcoder-micro-frontends-self-service-app.js" + "@topcoder/mfe-customer-work": "http://localhost:8519/self-service-app/topcoder-mfe-customer-work.js" } } diff --git a/config/micro-frontends-routes-local.txt b/config/micro-frontends-routes-local.txt index ad82a95..ce66717 100644 --- a/config/micro-frontends-routes-local.txt +++ b/config/micro-frontends-routes-local.txt @@ -35,7 +35,7 @@ - +
diff --git a/src/index.ejs b/src/index.ejs index 7772e4e..edf1b04 100644 --- a/src/index.ejs +++ b/src/index.ejs @@ -43,7 +43,7 @@ "single-spa": "https://cdn.jsdelivr.net/npm/single-spa@5.5.5/lib/system/single-spa.min.js", "react": "https://cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js", "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js", - "@topcoder/micro-frontends-frame": "/topcoder-micro-frontends-frame.js" + "@topcoder/mfe-core": "/topcoder-mfe-core.js" } } @@ -73,7 +73,7 @@