Skip to content

Commit 1e84ac2

Browse files
ll
1 parent 0817945 commit 1e84ac2

Some content is hidden

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

62 files changed

+2759
-910
lines changed

bi-directional/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Bi-Directional Hosts Example
2+
3+
This example demos bi-directional hosts each with their own remote `Button` components.
4+
5+
- `app1` exposes a red `<button>App 1 Button</button>` component.
6+
- `app2` exposes a blue `<button>App 2 Button</button>` component.
7+
8+
# Running Demo
9+
10+
Run `pnpm run start`. This will build and serve both `app1` and `app2` on ports 3001 and 3002 respectively.
11+
12+
- [localhost:3001](http://localhost:3001/)
13+
- [localhost:3002](http://localhost:3002/)
14+
15+
Notice that `app1` will asynchronously load `app2`'s button and vice versa.
16+
<img src="https://ssl.google-analytics.com/collect?v=1&t=event&ec=email&ea=open&t=event&tid=UA-120967034-1&z=1589682154&cid=ae045149-9d17-0367-bbb0-11c41d92b411&dt=ModuleFederationExamples&dp=/email/BiDirectional">
17+
18+
# Running Cypress E2E Tests
19+
20+
To run tests in interactive mode, run `npm run cypress:debug` from the root directory of the project. It will open Cypress Test Runner and allow to run tests in interactive mode. [More info about "How to run tests"](../../cypress/README.md#how-to-run-tests)
21+
22+
To build app and run test in headless mode, run `yarn e2e:ci`. It will build app and run tests for this workspace in headless mode. If tets failed cypress will create `cypress` directory in sample root folder with screenshots and videos.
23+
24+
["Best Practices, Rules amd more interesting information here](../../cypress/README.md)

bi-directional/app1/.browserslistrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
chrome >= 51
2+
edge >= 15
3+
firefox >= 54
4+
safari >= 10
5+
ios_saf >= 10

bi-directional/app1/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@modern-js'],
4+
};

bi-directional/app1/.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.DS_Store
2+
3+
.pnp
4+
.pnp.js
5+
.env.local
6+
.env.*.local
7+
.history
8+
*.log*
9+
10+
node_modules/
11+
.yarn-integrity
12+
.pnpm-store/
13+
*.tsbuildinfo
14+
.eslintcache
15+
.changeset/pre.json
16+
17+
dist/
18+
doc_build/
19+
coverage/
20+
release/
21+
output/
22+
output_resource/
23+
log/
24+
25+
.vscode/**/*
26+
!.vscode/settings.json
27+
!.vscode/extensions.json
28+
.idea/
29+
30+
**/*/typings/auto-generated
31+
32+
modern.config.local.*

bi-directional/app1/.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
cd bi-directional/app1
3+
. "$(dirname -- "$0")/_/husky.sh"
4+
5+
npx --no-install lint-staged

bi-directional/app1/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
strict-peer-dependencies=false

bi-directional/app1/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lts/hydrogen
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"recommendations": [
3+
"styled-components.vscode-styled-components",
4+
"cpylua.language-postcss",
5+
"EditorConfig.editorconfig",
6+
"dbaeumer.vscode-eslint",
7+
"esbenp.prettier-vscode",
8+
"drKnoxy.eslint-disable-snippets",
9+
"mkaufman.htmlhint",
10+
"streetsidesoftware.code-spell-checker",
11+
"codezombiech.gitignore",
12+
"aaron-bond.better-comments",
13+
"jasonnutter.search-node-modules",
14+
"jock.svg",
15+
"mikestead.dotenv",
16+
"vscode-icons-team.vscode-icons"
17+
]
18+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"files.associations": {
3+
".code-workspace": "jsonc",
4+
".babelrc": "json",
5+
".eslintrc": "jsonc",
6+
".eslintrc*.json": "jsonc",
7+
".stylelintrc": "jsonc",
8+
"stylelintrc": "jsonc",
9+
".htmlhintrc": "jsonc",
10+
"htmlhintrc": "jsonc",
11+
"Procfile*": "shellscript",
12+
"README": "markdown"
13+
},
14+
"search.useIgnoreFiles": true,
15+
"search.exclude": {
16+
"**/dist": true,
17+
"**/*.log": true,
18+
"**/*.pid": true,
19+
"**/.git": true,
20+
"**/node_modules": true,
21+
"**/bower_components": true
22+
},
23+
//
24+
"editor.rulers": [80, 120],
25+
"files.eol": "\n",
26+
"files.trimTrailingWhitespace": true,
27+
"files.insertFinalNewline": true,
28+
//
29+
"cSpell.diagnosticLevel": "Hint",
30+
"eslint.alwaysShowStatus": true,
31+
"eslint.run": "onType",
32+
"eslint.probe": [
33+
"javascript",
34+
"javascriptreact",
35+
"typescript",
36+
"typescriptreact",
37+
"vue"
38+
],
39+
"eslint.format.enable": true,
40+
"eslint.lintTask.enable": true,
41+
"javascript.validate.enable": false,
42+
"typescript.validate.enable": true,
43+
"css.validate": false,
44+
"scss.validate": false,
45+
"less.validate": false,
46+
"[css]": {
47+
"editor.formatOnType": true,
48+
"editor.formatOnPaste": true,
49+
"editor.formatOnSave": true
50+
},
51+
"[scss]": {
52+
"editor.formatOnType": true,
53+
"editor.formatOnPaste": true,
54+
"editor.formatOnSave": true
55+
},
56+
"[less]": {
57+
"editor.formatOnType": true,
58+
"editor.formatOnPaste": true,
59+
"editor.formatOnSave": true
60+
},
61+
"editor.codeActionsOnSave": {
62+
"source.fixAll.eslint": true
63+
},
64+
"editor.defaultFormatter": "esbenp.prettier-vscode",
65+
"javascript.format.enable": false,
66+
"typescript.format.enable": false,
67+
//
68+
"json.format.enable": false,
69+
"[json]": {
70+
"editor.tabSize": 2,
71+
"editor.formatOnType": true,
72+
"editor.formatOnPaste": true,
73+
"editor.formatOnSave": true
74+
},
75+
"[jsonc]": {
76+
"editor.tabSize": 2,
77+
"editor.formatOnType": true,
78+
"editor.formatOnPaste": true,
79+
"editor.formatOnSave": true
80+
},
81+
"emmet.triggerExpansionOnTab": true,
82+
"typescript.tsdk": "node_modules/typescript/lib"
83+
}

bi-directional/app1/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Modern.js App
2+
3+
## Setup
4+
5+
Install the dependencies:
6+
7+
```bash
8+
yarn install
9+
```
10+
11+
## Get Started
12+
13+
Start the dev server:
14+
15+
```
16+
yarn dev
17+
```
18+
19+
Enable optional features or add a new entry:
20+
21+
```
22+
yarn new
23+
```
24+
25+
Build the app for production:
26+
27+
```
28+
yarn build
29+
```
30+
31+
Preview the production build locally:
32+
33+
```
34+
yarn serve
35+
```
36+
37+
For more information, see the [Modern.js documentation](https://modernjs.dev/en).

0 commit comments

Comments
 (0)