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

Commit 387cd35

Browse files
rename repo
1 parent 47e06aa commit 387cd35

10 files changed

+21
-21
lines changed

.circleci/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252
environment:
5353
DEPLOY_ENV: "DEV"
5454
LOGICAL_ENV: "dev"
55-
APPNAME: "micro-frontends-navbar-app"
55+
APPNAME: "mfe-header"
5656
steps: *builddeploy_steps
5757

5858
"build-prod":
5959
<<: *defaults
6060
environment:
6161
DEPLOY_ENV: "PROD"
6262
LOGICAL_ENV: "prod"
63-
APPNAME: "micro-frontends-navbar-app"
63+
APPNAME: "mfe-header"
6464
steps: *builddeploy_steps
6565

6666
workflows:

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Inside the project folder run:
3535

3636
- `npm i` - install dependencies
3737
- `npm run dev` - run app in development mode
38-
- As this app can be loaded only inside a frame single-spa, you have to run a `micro-frontends-frame` frame app and configure it to use the URL `http://localhost:8080/topcoder-micro-frontends-navbar-app.js`.
38+
- As this app can be loaded only inside a frame single-spa, you have to run a `mfe-core` frame app and configure it to use the URL `http://localhost:8080/topcoder-mfe-header.js`.
3939

4040
## Deployment to Production
4141

@@ -53,7 +53,7 @@ Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli
5353
- `git commit -m'inital commit'`
5454
- `heroku apps:create` - create Heroku app
5555
- `git push heroku master` - push changes to Heroku and trigger deploying
56-
- Now you have to configure frame app to use the URL provided by Heroku like `https://<APP-NAME>.herokuapp.com/topcoder-micro-frontends-navbar-app.js` to load this microapp.
56+
- Now you have to configure frame app to use the URL provided by Heroku like `https://<APP-NAME>.herokuapp.com/topcoder-mfe-header.js` to load this microapp.
5757
- NOTE: Authorization would not work because only predefined list of domain allowed by `accounts-app`.
5858

5959
### Cross microfrontend imports
@@ -73,7 +73,7 @@ This app exports functions to be imported by other microapps.
7373

7474
#### How to export
7575

76-
- To export any function we have to `export` in file [src/topcoder-micro-frontends-navbar-app.js](src/topcoder-micro-frontends-navbar-app.js).
76+
- To export any function we have to `export` in file [src/topcoder-mfe-header.js](src/topcoder-mfe-header.js).
7777
- If we want to prepare some function for exporting, the good place to do so is inside [src/utils/exports.js](src/utils/exports.js).
7878
- We have to bind actions before exporting.
7979
- It's not recommended to export the whole Redux Store to keep only navbar responsible for updating it. It's better to create promises which would return some particular value from the store.
@@ -86,15 +86,15 @@ When we want to use methods exported in the navbar microapp in other apps we hav
8686

8787
For example see https://github.com/topcoder-platform/micro-frontends-react-app
8888

89-
1. Add `@topcoder/micro-frontends-navbar-app` to `externals` in webpack config:
89+
1. Add `@topcoder/mfe-header` to `externals` in webpack config:
9090

9191
```js
9292
externals: {
93-
"@topcoder/micro-frontends-navbar-app": "@topcoder/micro-frontends-navbar-app",
93+
"@topcoder/mfe-header": "@topcoder/mfe-header",
9494
},
9595
```
9696

97-
2. As `importmaps` only work in browser and don't work in unit test, we have to mock this module in unit tests. For example by creating a file `src/__mocks__/@topcoder/micro-frontends-navbar-app.js` with the content like:
97+
2. As `importmaps` only work in browser and don't work in unit test, we have to mock this module in unit tests. For example by creating a file `src/__mocks__/@topcoder/mfe-header.js` with the content like:
9898
```js
9999
module.exports = {
100100
login: () => {},
@@ -112,18 +112,18 @@ For example see https://github.com/topcoder-platform/micro-frontends-react-app
112112

113113
For example see https://github.com/topcoder-platform/micro-frontends-angular-app
114114

115-
1. Add `@topcoder/micro-frontends-navbar-app` to `externals` in webpack config:
115+
1. Add `@topcoder/mfe-header` to `externals` in webpack config:
116116

117117
```js
118118
externals: {
119-
"@topcoder/micro-frontends-navbar-app": "@topcoder/micro-frontends-navbar-app",
119+
"@topcoder/mfe-header": "@topcoder/mfe-header",
120120
},
121121
```
122122

123123
2. Add type definition in `src/typings.d.ts`:
124124

125125
```js
126-
declare module '@topcoder/micro-frontends-navbar-app' {
126+
declare module '@topcoder/mfe-header' {
127127
export const login: any;
128128
export const businessLogin: any;
129129
export const logout: any;
@@ -135,4 +135,4 @@ For example see https://github.com/topcoder-platform/micro-frontends-angular-app
135135
}
136136
```
137137

138-
3. TODO: How to make e2e tests work for Angular? So far they fail with error `Module not found: Error: Can't resolve '@topcoder/micro-frontends-navbar-app'`
138+
3. TODO: How to make e2e tests work for Angular? So far they fail with error `Module not found: Error: Can't resolve '@topcoder/mfe-header'`

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ENV APPMODE=$APPMODE
88
ENV APPENV=$APPENV
99

1010
# Copy the current directory into the Docker image
11-
COPY . /micro-frontends-navbar-app
11+
COPY . /mfe-header
1212

1313
# Set working directory for future use
14-
WORKDIR /micro-frontends-navbar-app
14+
WORKDIR /mfe-header
1515

1616
# Install the dependencies from package.json
1717
RUN npm install

docker/docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3"
22
services:
3-
micro-frontends-navbar-app:
4-
image: micro-frontends-navbar-app:latest
3+
mfe-header:
4+
image: mfe-header:latest
55
build:
66
context: ../
77
dockerfile: docker/Dockerfile

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@topcoder/micro-frontends-navbar-app",
2+
"name": "@topcoder/mfe-header",
33
"scripts": {
44
"start": "node server.js",
55
"dev": "cross-env APPMODE=development webpack-dev-server",

src/set-public-path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ import { setPublicPath } from "systemjs-webpack-interop";
55
* https://single-spa.js.org/docs/faq/#code-splits
66
*/
77

8-
setPublicPath("@topcoder/micro-frontends-navbar-app");
8+
setPublicPath("@topcoder/mfe-header");

src/utils/exports.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Prepare all the methods to be ready for exporting to be used in other micoapps in this file.
33
*
4-
* Additionally, we need to export them in `topcoder-micro-frontends-navbar-app.js`.
4+
* Additionally, we need to export them in `topcoder-mfe-header.js`.
55
*/
66
import _ from "lodash";
77
import { bindActionCreators } from "redux";

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const webpack = require("webpack");
99
module.exports = (webpackConfigEnv, options) => {
1010
const defaultConfig = singleSpaDefaults({
1111
orgName: "topcoder",
12-
projectName: "micro-frontends-navbar-app",
12+
projectName: "mfe-header",
1313
webpackConfigEnv,
1414
disableHtmlGeneration: true,
1515
});

0 commit comments

Comments
 (0)