Skip to content

Commit bc1b54b

Browse files
committed
prettier to avoid diffs on merge
1 parent 29ccd6b commit bc1b54b

File tree

143 files changed

+1559
-1586
lines changed

Some content is hidden

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

143 files changed

+1559
-1586
lines changed

.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module.exports = {
33
browser: true,
44
es2020: true,
55
},
6-
extends: ["standard", "plugin:prettier/recommended"],
6+
extends: ['standard', 'plugin:prettier/recommended'],
77
parserOptions: {
88
ecmaVersion: 11,
9-
sourceType: "module",
9+
sourceType: 'module',
1010
},
1111
rules: {},
12-
};
12+
}

.vscode/c_cpp_properties.json

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
{
2-
"configurations": [
3-
{
4-
"name": "Mac",
5-
"includePath": [
6-
"${workspaceFolder}/**"
7-
],
8-
"defines": [],
9-
"macFrameworkPath": [
10-
"/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks"
11-
],
12-
"compilerPath": "/usr/bin/clang",
13-
"cStandard": "c17",
14-
"cppStandard": "c++98",
15-
"intelliSenseMode": "macos-clang-arm64"
16-
}
17-
],
18-
"version": 4
19-
}
2+
"configurations": [
3+
{
4+
"name": "Mac",
5+
"includePath": ["${workspaceFolder}/**"],
6+
"defines": [],
7+
"macFrameworkPath": [
8+
"/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks"
9+
],
10+
"compilerPath": "/usr/bin/clang",
11+
"cStandard": "c17",
12+
"cppStandard": "c++98",
13+
"intelliSenseMode": "macos-clang-arm64"
14+
}
15+
],
16+
"version": 4
17+
}

.vscode/extensions.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"recommendations": [
3-
"GitHub.copilot"
4-
]
5-
}
2+
"recommendations": ["GitHub.copilot"]
3+
}

.vscode/settings.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
{
2-
"yaml.customTags": [
3-
"!And",
4-
"!And sequence",
5-
"!If",
6-
"!If sequence",
7-
"!Not",
8-
"!Not sequence",
9-
"!Equals",
10-
"!Equals sequence",
11-
"!Or",
12-
"!Or sequence",
13-
"!FindInMap",
14-
"!FindInMap sequence",
15-
"!Base64",
16-
"!Join",
17-
"!Join sequence",
18-
"!Cidr",
19-
"!Ref",
20-
"!Sub",
21-
"!Sub sequence",
22-
"!GetAtt",
23-
"!GetAZs",
24-
"!ImportValue",
25-
"!ImportValue sequence",
26-
"!Select",
27-
"!Select sequence",
28-
"!Split",
29-
"!Split sequence"
30-
]
31-
}
2+
"yaml.customTags": [
3+
"!And",
4+
"!And sequence",
5+
"!If",
6+
"!If sequence",
7+
"!Not",
8+
"!Not sequence",
9+
"!Equals",
10+
"!Equals sequence",
11+
"!Or",
12+
"!Or sequence",
13+
"!FindInMap",
14+
"!FindInMap sequence",
15+
"!Base64",
16+
"!Join",
17+
"!Join sequence",
18+
"!Cidr",
19+
"!Ref",
20+
"!Sub",
21+
"!Sub sequence",
22+
"!GetAtt",
23+
"!GetAZs",
24+
"!ImportValue",
25+
"!ImportValue sequence",
26+
"!Select",
27+
"!Select sequence",
28+
"!Split",
29+
"!Split sequence"
30+
]
31+
}

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ See the [aegis-host](https://github.com/module-federation/aegis-host) repo for d
1313
</a>
1414
</div>
1515

16-
## Consolidate your microservices
16+
## Consolidate your microservices
17+
1718
(by running them together in a single process)
1819

1920
- for decreased footprint,
@@ -27,6 +28,7 @@ _without loosing_
2728
- or component independence (i.e. components remain decoupled)
2829

2930
## Or distribute your components
31+
3032
(across a self-forming service mesh)
3133

3234
- dynamically and adaptively
@@ -67,7 +69,7 @@ npm i @module-federation/aegis
6769

6870
### Contribute
6971

70-
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/github.com/module-federation/aegis)
72+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/github.com/module-federation/aegis)
7173

7274
or
7375

@@ -90,9 +92,11 @@ yarn start
9092
yarn demo
9193
```
9294

93-
----
95+
---
96+
9497
### Learn
95-
[![Aegis Overview](https://res.cloudinary.com/marcomontalbano/image/upload/v1632364889/video_to_markdown/images/youtube--n2qqgi3fTto-c05b58ac6eb4c4700831b2b3070cd403.jpg)](https://youtu.be/jddhfLA_2k0 "Aegis Overview")
98+
99+
[![Aegis Overview](https://res.cloudinary.com/marcomontalbano/image/upload/v1632364889/video_to_markdown/images/youtube--n2qqgi3fTto-c05b58ac6eb4c4700831b2b3070cd403.jpg)](https://youtu.be/jddhfLA_2k0 'Aegis Overview')
96100

97101
# Roadmap
98102

@@ -121,5 +125,3 @@ yarn demo
121125
[downloads-url]: https://npmjs.org/package/@module-federation/aegis
122126
[gitpod-image]: https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod
123127
[gitpod-url]: https://gitpod.io/github.com/module-federation/aegis-app
124-
125-

__test__/controllers/lrm.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
const ModelFactory = {
2-
getModelSpecs (model) {
2+
getModelSpecs(model) {
33
model = [
44
{
55
relations: {
6-
rel1: { modelName: 'm1', type: 'inbound', foreignKey: 'customerId' }
7-
}
8-
}
6+
rel1: { modelName: 'm1', type: 'inbound', foreignKey: 'customerId' },
7+
},
8+
},
99
]
1010
return model
1111
},
12-
getModelSpec (model) {
12+
getModelSpec(model) {
1313
model = {
1414
relations: {
15-
rel1: { modelName: 'm1', type: 'inbound', foreignKey: 'customerId' }
16-
}
15+
rel1: { modelName: 'm1', type: 'inbound', foreignKey: 'customerId' },
16+
},
1717
}
1818
return model
19-
}
19+
},
2020
}
2121

22-
function findLocalRelatedModels (modelName) {
22+
function findLocalRelatedModels(modelName) {
2323
const relations = ModelFactory.getModelSpec(modelName).relations
2424
const localModels = ModelFactory.getModelSpecs().map(spec => spec.modelName)
2525
const localRelatedModels = Object.keys(relations)

__test__/controllers/post-model.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Controllers', function () {
1616
modelName: 'ABC',
1717
factory: ({ a }) => ({ a, b: 'c' }),
1818
endpoint: 'abcs',
19-
dependencies: {}
19+
dependencies: {},
2020
})
2121
ModelFactory.registerEvent(
2222
ModelFactory.EventTypes.CREATE,
@@ -27,13 +27,13 @@ describe('Controllers', function () {
2727
modelName: 'ABC',
2828
models: ModelFactory,
2929
repository: DataSourceFactory.getDataSource('ABC'),
30-
broker: EventBrokerFactory.getInstance()
30+
broker: EventBrokerFactory.getInstance(),
3131
})
3232
const resp = await postModelFactory(createModel)({
3333
body: { a: 'a' },
3434
headers: { 'User-Agent': 'test' },
3535
ip: '127.0.0.1',
36-
log: () => 1
36+
log: () => 1,
3737
})
3838
console.log('resp.status', resp.statusCode)
3939
assert.strictEqual(resp.statusCode, 201)

__test__/controllers/route-map.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ const { assert } = require('console')
22
const { pathToRegexp } = require('path-to-regexp')
33

44
class RouteMap extends Map {
5-
find (path) {
5+
find(path) {
66
return [...super.keys()].find(
77
regex => regex instanceof RegExp && regex.test(path)
88
)
99
}
1010

11-
set (path, method) {
11+
set(path, method) {
1212
super.set(pathToRegexp(path), method)
1313
}
1414

15-
has (path) {
15+
has(path) {
1616
return this.find(path) ? true : false
1717
}
1818

19-
get (path) {
19+
get(path) {
2020
return this.find(path)
2121
}
2222
}

__test__/controllers/server.js

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const {
1010
deleteModels,
1111
initCache,
1212
getConfig,
13-
http
13+
http,
1414
} = controllers
1515

1616
const { close, find, save } = storageAdapter
@@ -22,22 +22,13 @@ import ModelFactory from '../../src/domain'
2222
const apiRoot = process.env.API_ROOT || '/aegis/api'
2323
const modelPath = `${apiRoot}/models`
2424

25-
const idRoute = route =>
26-
route
27-
.split('/')
28-
.splice(0, 5)
29-
.concat([':id'])
30-
.join('/')
25+
const idRoute = route => route.split('/').splice(0, 5).concat([':id']).join('/')
3126

3227
const cmdRoute = route =>
33-
route
34-
.split('/')
35-
.splice(0, 6)
36-
.concat([':id', ':command'])
37-
.join('/')
28+
route.split('/').splice(0, 6).concat([':id', ':command']).join('/')
3829

3930
class RouteMap extends Map {
40-
has (route) {
31+
has(route) {
4132
if (!route) {
4233
console.warn('route is ', typeof route)
4334
return false
@@ -62,7 +53,7 @@ class RouteMap extends Map {
6253
return false
6354
}
6455

65-
get (route) {
56+
get(route) {
6657
return this.route ? this.route : super.get(route)
6758
}
6859
}
@@ -93,7 +84,7 @@ const Server = (() => {
9384
* @param {*} method
9485
* @param {*} controllers
9586
*/
96-
webserver (path, method, controllers, app) {
87+
webserver(path, method, controllers, app) {
9788
controllers().forEach(ctlr => {
9889
console.info(ctlr)
9990
app[method](path(ctlr.endpoint), http(ctlr.fn))
@@ -106,22 +97,22 @@ const Server = (() => {
10697
* @param {*} method
10798
* @param {*} controllers
10899
*/
109-
serverless (path, method, controllers) {
100+
serverless(path, method, controllers) {
110101
controllers().forEach(ctlr => {
111102
const route = path(ctlr.endpoint)
112103
if (routes.has(route)) {
113104
routes.set(route, {
114105
...routes.get(route),
115-
[method]: http(ctlr.fn)
106+
[method]: http(ctlr.fn),
116107
})
117108
return
118109
}
119110
routes.set(route, { [method]: http(ctlr.fn) })
120111
})
121-
}
112+
},
122113
}
123114

124-
function makeAdmin (app, adapter, serverMode) {
115+
function makeAdmin(app, adapter, serverMode) {
125116
if (serverMode === make.webserver.name) {
126117
app.get(`${apiRoot}/config`, adapter(getConfig()))
127118
} else if (serverMode === make.serverless.name) {
@@ -132,7 +123,7 @@ const Server = (() => {
132123
/**
133124
* Call controllers directly in serverless mode.
134125
*/
135-
async function invoke (path, method, req, res) {
126+
async function invoke(path, method, req, res) {
136127
if (routes.has(path)) {
137128
try {
138129
console.debug('path match: ', path)
@@ -149,7 +140,7 @@ const Server = (() => {
149140
console.warn('potential config issue', path, method)
150141
}
151142

152-
function shutdown (shutdownTasks) {
143+
function shutdown(shutdownTasks) {
153144
console.warn('Received SIGTERM - system shutdown in progress')
154145
shutdownTasks()
155146
}
@@ -161,7 +152,7 @@ const Server = (() => {
161152
* user code downloaded from the remote. This is
162153
* the code that needs to be disposed of & reimported.
163154
*/
164-
function clear () {
155+
function clear() {
165156
try {
166157
close()
167158
routes.clear()
@@ -186,7 +177,7 @@ const Server = (() => {
186177
* @param {boolean} serverless - set to true if running as a servless function
187178
* @returns
188179
*/
189-
async function start (router, serverless = false) {
180+
async function start(router, serverless = false) {
190181
const serverMode = serverless ? make.serverless.name : make.webserver.name
191182
const overrides = { save, find, Persistence }
192183

@@ -222,7 +213,7 @@ const Server = (() => {
222213
return {
223214
clear,
224215
start,
225-
invoke
216+
invoke,
226217
}
227218
})()
228219

0 commit comments

Comments
 (0)