@podium/layout
Advanced tools
Comparing version 3.0.0-beta.10 to 3.0.0
{ | ||
"name": "@podium/layout", | ||
"version": "3.0.0-beta.10", | ||
"version": "3.0.0", | ||
"description": "Module for composing full page layouts out of page fragments in a micro frontend architecture.", | ||
@@ -35,8 +35,8 @@ "main": "lib/layout.js", | ||
"@metrics/client": "2.3.1", | ||
"@podium/client": "3.0.0-beta.4", | ||
"@podium/context": "3.0.0-beta.6", | ||
"@podium/proxy": "3.0.0-beta.5", | ||
"@podium/client": "3.0.1", | ||
"@podium/context": "3.0.0", | ||
"@podium/proxy": "3.0.0", | ||
"@podium/schemas": "3.0.0", | ||
"@podium/utils": "3.1.1", | ||
"abslog": "2.2.3", | ||
"abslog": "2.4.0", | ||
"joi": "^14.3.1", | ||
@@ -47,3 +47,3 @@ "lodash.merge": "^4.6.1", | ||
"devDependencies": { | ||
"eslint": "^5.12.0", | ||
"eslint": "^5.14.1", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
@@ -54,6 +54,6 @@ "eslint-config-prettier": "^4.0.0", | ||
"express": "^4.16.4", | ||
"hbs": "^4.0.1", | ||
"hbs": "^4.0.2", | ||
"husky": "^1.3.1", | ||
"jest": "^24.1.0", | ||
"lint-staged": "^8.1.0", | ||
"lint-staged": "^8.1.4", | ||
"prettier": "^1.16.3", | ||
@@ -60,0 +60,0 @@ "stoppable": "^1.1.0", |
138
README.md
# @podium/layout | ||
Module for composing full page layouts out of page fragments in a micro frontend architecture. | ||
Module for composing full page layouts out of page fragments in a micro frontend | ||
architecture. | ||
[![Build Status](https://travis-ci.org/podium-lib/layout.svg?branch=master)](https://travis-ci.org/podium-lib/layout) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/podium-lib/layout.svg)](https://greenkeeper.io/) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/podium-lib/layout/badge.svg)](https://snyk.io/test/github/podium-lib/layout) | ||
[![Dependencies](https://img.shields.io/david/podium-lib/layout.svg?style=flat-square)](https://david-dm.org/podium-lib/layout) | ||
[![Build Status](https://travis-ci.org/podium-lib/layout.svg?branch=master&style=flat-square)](https://travis-ci.org/podium-lib/layout) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/podium-lib/layout.svg?style=flat-square)](https://greenkeeper.io/) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/podium-lib/layout/badge.svg?style=flat-square)](https://snyk.io/test/github/podium-lib/layout) | ||
Module for building a Layout server. A Layout server is mainly responsible for fetching HTML content | ||
from podlets and stitching these fragments into an full HTML page (called a layout in Podium speak). | ||
Module for building a layout server. A layout server is mainly responsible for | ||
fetching HTML fragments and stitching these fragments into an full HTML page. | ||
To do this, a Layout instance provides three core features: | ||
To do this, a layout instance provides three core features: | ||
@@ -18,9 +20,12 @@ - `@podium/client` used to fetch content from podlets | ||
A Layout can be used together with a plain node.js http server or any http framework and any templating | ||
language of your choosing (or none if you prefer). Though; Connect compatible middleware based frameworks | ||
(such as express.js) is first class in Podium so this module comes with a `.middleware()` method for convenience. | ||
This module can be used together with a plain node.js HTTP server or any HTTP | ||
framework and any templating language of your choosing (or none if you prefer). | ||
Though; Connect compatible middleware based frameworks (such as [Express]) is | ||
first class in Podium so this module comes with a `.middleware()` method for | ||
convenience. | ||
For writing layout servers with other http frameworks the following modules exist: | ||
For writing layout servers with other http frameworks the following modules | ||
exist: | ||
- [Hapi Layout Plugin](https://github.com/podium-lib/hapi-layout) | ||
- [Hapi Layout Plugin] | ||
@@ -35,3 +40,3 @@ ## Installation | ||
Build a simple Layout server with a single podlet using Express.js: | ||
Build a simple layout server including a single podlet using [Express]: | ||
@@ -103,4 +108,6 @@ ```js | ||
The Pathname of where the Layout is mounted into the HTTP server. It is important that this value matches where the entry point of a route is in the HTTP server | ||
since this value is used to mount the proxy and tell podlets (through the context) where they are mounted and where the proxy is mounted. | ||
The Pathname of where the Layout is mounted into the HTTP server. It is | ||
important that this value matches where the entry point of a route is in the | ||
HTTP server since this value is used to mount the proxy and tell podlets | ||
(through the context) where they are mounted and where the proxy is mounted. | ||
@@ -123,3 +130,3 @@ If the layout is mounted at the server "root", set `pathname` to `/`: | ||
If the layout is mouned at `/foo`, set pathname to `/foo`: | ||
If the layout is mounted at `/foo`, set pathname to `/foo`: | ||
@@ -144,4 +151,4 @@ ```js | ||
There is also a helper method for retrieving the set `pathname` which can | ||
be used to get the pathname from the Layout object when defining routes. | ||
There is also a helper method for retrieving the set `pathname` which can be | ||
used to get the pathname from the Layout object when defining routes. | ||
See [`.pathname()`](#pathname-1) for further details. | ||
@@ -164,12 +171,10 @@ | ||
Under the hood [abslog](https://github.com/trygve-lie/abslog) is used to | ||
abstract out logging. Please see [abslog](https://github.com/trygve-lie/abslog) | ||
for further details. | ||
Under the hood [abslog] is used to abstract out logging. Please see [abslog] for | ||
further details. | ||
#### context | ||
Options to be passed on to the internal @podium/context constructor. | ||
Options to be passed on to the internal [@podium/context constructor]. | ||
Please see the [@podium/context constructor](https://github.com/podium-lib/context#constructor) | ||
for which options can be set. | ||
Please see the [@podium/context constructor] for which options can be set. | ||
@@ -192,6 +197,5 @@ Example of setting the `debug` context to default `true`: | ||
Options to be passed on to the internal @podium/client constructor. | ||
Options to be passed on to the internal [@podium/client constructor]. | ||
Please see [@podium/client constructor](https://github.com/podium-lib/client#constructor) | ||
for which options which can be set. | ||
Please see [@podium/client constructor] for which options which can be set. | ||
@@ -212,6 +216,5 @@ Example of setting the `retries` on the client to `6`: | ||
Options to be passed on to the internal @podium/proxy constructor. | ||
Options to be passed on to the internal [@podium/proxy constructor]. | ||
Please see [@podium/proxy constructor](https://github.com/podium-lib/proxy#constructor) | ||
for which options which can be set. | ||
Please see [@podium/proxy constructor] for which options which can be set. | ||
@@ -236,14 +239,15 @@ Example of setting the `timeout` on the proxy to 30 seconds: | ||
Metod for processing a incomming http request. This method is intended to be used | ||
to implement support for multiple http frameworks and should not really be used | ||
directly in a layout server. | ||
Metod for processing an incoming HTTP request. This method is intended to be | ||
used to implement support for multiple HTTP frameworks and should not really be | ||
used directly in a layout server. | ||
What it does: | ||
- Runs [context parsers](https://github.com/podium-lib/context) on the incomming request and sets an object with the context at `HttpIncoming.context` which can be passed on to the client when requesting content from podlets. | ||
- Mounts the [proxy](https://github.com/podium-lib/proxy) so each podlet can do transparent proxy requests if needed. | ||
- Runs [@podium/context] parsers on the incoming request and sets an object with the context at `HttpIncoming.context` which can be passed on to the client when requesting content from podlets. | ||
- Mounts the [@podium/proxy] so each podlet can do transparent proxy requests if needed. | ||
Returns a Promise. If the inbound request does match a proxy endpoint the returned Promise will resolve with | ||
`undefined`. If the inbound request does not match a proxy endpoint the returned Promise will resolve with the | ||
passed in `HttpIncoming` object. | ||
Returns a Promise. If the inbound request matches a proxy endpoint the returned | ||
Promise will resolve with `undefined`. If the inbound request does not match a | ||
proxy endpoint the returned Promise will resolve with the passed in | ||
[HttpIncoming] object. | ||
@@ -254,3 +258,3 @@ The method take the following arguments: | ||
An instance of a [HttpIncoming object](https://github.com/podium-lib/utils/blob/master/lib/http-incoming.js). | ||
An instance of an [HttpIncoming] class. | ||
@@ -283,4 +287,6 @@ ```js | ||
A Connect compatible middleware which takes care of the operations needed for | ||
a Layout to fully work. It is more or less a wrapper for the `.process()` method. | ||
a layout to fully work. It is more or less a wrapper for the `.process()` method. | ||
**Important:** This middleware must be mounted before defining any routes. | ||
Example | ||
@@ -293,3 +299,4 @@ | ||
The context generated by the middleware will be stored at `res.locals.podium.context`. | ||
The context generated by the middleware will be stored at | ||
`res.locals.podium.context`. | ||
@@ -327,3 +334,3 @@ Returns an Array of internal middleware performing the tasks described above. | ||
A property that exposes an instance of the @podium/client for fetching content | ||
A property that exposes an instance of the [@podium/client] for fetching content | ||
from podlets. | ||
@@ -349,4 +356,3 @@ | ||
Please see the [@podium/client module](https://github.com/podium-lib/client) | ||
for full documentation. | ||
Please see [@podium/client] for full documentation. | ||
@@ -371,11 +377,43 @@ ### .context | ||
Please see the [@podium/context module](https://github.com/podium-lib/context) | ||
for full documentation. | ||
Please see [@podium/context] for full documentation. | ||
### .metrics | ||
Property that exposes a metric stream. This stream joins all internal metrics streams into one stream resulting in all metrics | ||
from all sub modules being exposed here. | ||
Property that exposes a metric stream. This stream joins all internal metrics | ||
streams into one stream resulting in all metrics from all sub modules being | ||
exposed here. | ||
Please see the [@podium/metrics module](https://github.com/podium-lib/metrics) | ||
for full documentation. | ||
Please see [@metrics/metric] for full documentation. | ||
## License | ||
Copyright (c) 2019 FINN.no | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
[express]: https://expressjs.com/ 'Express' | ||
[hapi layout plugin]: https://github.com/podium-lib/hapi-layout 'Hapi Layout Plugin' | ||
[@podium/client constructor]: https://github.com/podium-lib/client#constructor '@podium/client constructor' | ||
[@podium/proxy constructor]: https://github.com/podium-lib/proxy#constructor '@podium/proxy constructor' | ||
[@podium/context]: https://github.com/podium-lib/context '@podium/context' | ||
[@podium/client]: https://github.com/podium-lib/client '@podium/client' | ||
[@podium/proxy]: https://github.com/podium-lib/proxy '@podium/proxy' | ||
[httpincoming]: https://github.com/podium-lib/utils/blob/master/lib/http-incoming.js 'HttpIncoming' | ||
[@metrics/metric]: https://github.com/metrics-js/metric '@metrics/metric' | ||
[abslog]: https://github.com/trygve-lie/abslog 'abslog' |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
20715
0
405
+ Added@podium/client@3.0.1(transitive)
+ Added@podium/context@3.0.0(transitive)
+ Added@podium/proxy@3.0.0(transitive)
+ Addedabslog@2.4.0(transitive)
- Removed@podium/client@3.0.0-beta.4(transitive)
- Removed@podium/context@3.0.0-beta.6(transitive)
- Removed@podium/proxy@3.0.0-beta.5(transitive)
- Removedabslog@2.2.3(transitive)
- Removedttl-mem-cache@4.1.0(transitive)
Updated@podium/client@3.0.1
Updated@podium/context@3.0.0
Updated@podium/proxy@3.0.0
Updatedabslog@2.4.0