@mashroom/mashroom
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -10,4 +10,6 @@ "use strict"; | ||
var _ip_utils = require("@mashroom/mashroom-utils/lib/ip_utils"); | ||
var _default = req => { | ||
const clientIP = req.headers['x-forwarded-for'] || req.connection && req.connection.remoteAddress; | ||
const clientIP = (0, _ip_utils.getClientIP)(req); | ||
const ua = (0, _user_agent_utils.determineUserAgent)(req); | ||
@@ -14,0 +16,0 @@ return { |
@@ -11,2 +11,3 @@ "use strict"; | ||
<head> | ||
<meta http-equiv="refresh" content="5"> | ||
<title>Mashroom Administration</title> | ||
@@ -182,7 +183,7 @@ <style type="text/css"> | ||
<ul> | ||
<li class="menu-item ${req.path === '/mashroom/admin' ? 'active' : ''}"><a href="/mashroom/admin">Overview</a></li> | ||
<li class="menu-item ${req.path === '/mashroom/admin/plugins' ? 'active' : ''}"><a href="/mashroom/admin/plugins">Plugins</a></li> | ||
<li class="menu-item ${req.path === '/mashroom/admin/middleware' ? 'active' : ''}"><a href="/mashroom/admin/middleware">Middleware</a></li> | ||
<li class="menu-item ${req.path === '/mashroom/admin/services' ? 'active' : ''}"><a href="/mashroom/admin/services">Services</a></li> | ||
<li class="menu-item ${req.path === '/mashroom/admin/webapps' ? 'active' : ''}"><a href="/mashroom/admin/webapps">Webapps</a></li> | ||
<li class="menu-item ${req.path === '/' ? 'active' : ''}"><a href="/mashroom/admin">Overview</a></li> | ||
<li class="menu-item ${req.path === '/plugins' ? 'active' : ''}"><a href="/mashroom/admin/plugins">Plugins</a></li> | ||
<li class="menu-item ${req.path === '/middleware' ? 'active' : ''}"><a href="/mashroom/admin/middleware">Middleware</a></li> | ||
<li class="menu-item ${req.path === '/services' ? 'active' : ''}"><a href="/mashroom/admin/services">Services</a></li> | ||
<li class="menu-item ${req.path === '/webapps' ? 'active' : ''}"><a href="/mashroom/admin/webapps">Webapps</a></li> | ||
<li class="menu-item external"><a href="/mashroom/docs" target="_blank">Documentation</a></li> | ||
@@ -189,0 +190,0 @@ </ul> |
@@ -7,3 +7,3 @@ { | ||
"license": "MIT", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"main": "dist", | ||
@@ -15,3 +15,3 @@ "files": [ | ||
"engines": { | ||
"node": ">=8.0.0" | ||
"node": ">=10.0.0" | ||
}, | ||
@@ -22,16 +22,16 @@ "bin": { | ||
"dependencies": { | ||
"@mashroom/mashroom-utils": "1.3.2", | ||
"@mashroom/mashroom-utils": "1.4.0", | ||
"chokidar": "^3.3.1", | ||
"express": "^4.17.1", | ||
"fs-extra": "^8.1.0", | ||
"log4js": "^5.3.0", | ||
"minimist": "^1.2.0", | ||
"strip-ansi": "^5.2.0" | ||
"fs-extra": "^9.0.0", | ||
"log4js": "^6.1.2", | ||
"minimist": "^1.2.5", | ||
"strip-ansi": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.8.3", | ||
"@types/express": "^4.17.1", | ||
"@types/node": "^10.17.13", | ||
"@babel/cli": "^7.8.4", | ||
"@types/express": "^4.17.3", | ||
"@types/node": "^10.17.17", | ||
"eslint": "^6.8.0", | ||
"jest": "^24.9.0" | ||
"jest": "^25.1.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "jest": { |
### Mashroom Server | ||
# Mashroom Server | ||
[Mashroom Server](https://www.mashroom-server.com) is a *Node.js* based **Integration Platform for Microfrontends**. | ||
[Mashroom Server](https://www.mashroom-server.com) is a *Node.js* based **Integration Platform for Microfrontends**. | ||
This package contains the core of _Mashroom Server_. It contains core services for managing plugins and default plugin loaders | ||
for *Express* middleware, *Express* webapps and shared code as _services_. It also provides a common logging infrastructure. | ||
From a technical point of view this is s a plugin loader that scans npm packages (_package.json_) for plugin definitions and loads them at runtime. | ||
Such a plugin could be an *Express* webapp or a *SPA* or more generally all kind of code it knows how to load, | ||
From a technical point of view this is s a plugin loader that scans npm packages (_package.json_) for plugin definitions and loads them at runtime. | ||
Such a plugin could be an *Express* webapp or a *SPA* or more generally all kind of code it knows how to load, | ||
which is determined by the available plugin loaders. Plugin loaders itself are also just plugins so it is possible to extend the list of known plugin types. | ||
#### Usage | ||
## Usage | ||
The easiest way to start is to clone one of the quickstart repositories: | ||
The easiest way to start is to clone one of the quickstart repositories: | ||
* [mashroom-quickstart](https://github.com/nonblocking/mashroom-quickstart) | ||
@@ -21,5 +21,5 @@ * [mashroom-portal-quickstart](https://github.com/nonblocking/mashroom-portal-quickstart) | ||
#### Services | ||
## Services | ||
##### MashroomPluginService | ||
### MashroomPluginService | ||
@@ -55,6 +55,6 @@ Accessible through _pluginContext.services.core.pluginService_ | ||
onUnloadOnce(pluginName: string, listener: () => void): void; | ||
} | ||
} | ||
``` | ||
##### MashroomMiddlewareStackService | ||
### MashroomMiddlewareStackService | ||
@@ -83,8 +83,8 @@ Accessible through _pluginContext.services.core.middlewareStackService_ | ||
getStack(): Array<{ pluginName: string, order: number }>; | ||
} | ||
} | ||
``` | ||
#### Plugin Types | ||
## Plugin Types | ||
##### plugin-loader | ||
### plugin-loader | ||
@@ -97,3 +97,3 @@ A _plugin-loader_ plugin adds support for a custom plugin type. | ||
{ | ||
"mashroom": { | ||
"mashroom": { | ||
"plugins": [ | ||
@@ -122,3 +122,3 @@ { | ||
import type { | ||
MashroomPluginLoader, MashroomPlugin, MashroomPluginConfig, MashroomPluginContext, | ||
MashroomPluginLoader, MashroomPlugin, MashroomPluginConfig, MashroomPluginContext, | ||
MashroomPluginLoaderPluginBootstrapFunction | ||
@@ -154,3 +154,3 @@ } from 'mashroom/type-definitions'; | ||
##### web-app | ||
### web-app | ||
@@ -201,5 +201,5 @@ Registers a *Express* webapp that will be available at a given path. | ||
* _upgradeHandler_: Handle HTTP Upgrades (e.g. upgrade to WebSocket) | ||
Example: | ||
Example: | ||
```js | ||
@@ -217,3 +217,3 @@ const bootstrap: MashroomWebAppPluginBootstrapFunction = async () => { | ||
##### api | ||
### api | ||
@@ -266,3 +266,3 @@ Registers a *Express* _Router_ (a REST API) and makes it available at a given path. | ||
##### middleware | ||
### middleware | ||
@@ -309,3 +309,3 @@ Registers a *Express* middleware and adds it to the global middleware stack. | ||
##### static | ||
### static | ||
@@ -334,3 +334,3 @@ Registers some static resources and exposes it at a given path (via *Express* static). | ||
##### services | ||
### services | ||
@@ -337,0 +337,0 @@ Used to load arbitrary shared code that can be loaded via _pluginContext_. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4240
165790
+ Added@mashroom/mashroom-utils@1.4.0(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedarr-map@2.0.2(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addeddate-format@4.0.14(transitive)
+ Addedflatted@3.3.2(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedip-filter@3.0.5(transitive)
+ Addedip-regex@4.3.0(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedis_js@0.9.0(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedkind-of@6.0.3(transitive)
+ Addedlog4js@6.9.1(transitive)
+ Addedmake-iterator@1.0.1(transitive)
+ Addedmicromatch@4.0.8(transitive)
+ Addedrequest-ip@2.2.0(transitive)
+ Addedstreamroller@3.1.5(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedto-file-path@2.0.4(transitive)
+ Addeduniversalify@2.0.1(transitive)
- Removed@mashroom/mashroom-utils@1.3.2(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removeddate-format@2.1.0(transitive)
- Removedflatted@2.0.2(transitive)
- Removedlog4js@5.3.0(transitive)
- Removedstreamroller@2.2.4(transitive)
- Removedstrip-ansi@5.2.0(transitive)
Updatedfs-extra@^9.0.0
Updatedlog4js@^6.1.2
Updatedminimist@^1.2.5
Updatedstrip-ansi@^6.0.0