Skip to content

Commit

Permalink
fix: update dependency typings
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed May 13, 2024
1 parent 1aeb7a8 commit 3b7e988
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
21 changes: 6 additions & 15 deletions lib/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

import {
HttpIncoming,
// @ts-ignore
template,
// @ts-ignore
isFunction,
// @ts-ignore
pathnameBuilder,
// @ts-ignore
uriIsRelative,
AssetCss,
AssetJs,
Expand Down Expand Up @@ -147,7 +143,7 @@ export default class PodiumLayout {
* @see https://podium-lib.io/docs/layout/context
* @see https://podium-lib.io/docs/podlet/context
*
* @type {LayoutContext}
* @type {Context}
*/
context;

Expand Down Expand Up @@ -294,14 +290,12 @@ export default class PodiumLayout {

// Join metric streams
this.httpProxy.metrics.pipe(this.metrics);
// @ts-ignore
this.context.metrics.pipe(this.metrics);
this.client.metrics.pipe(this.metrics);

// Register proxy endpoints
// @ts-ignore
// @ts-expect-error Not typed yet. Coming in a future TypeScript Tuesday™
this.client.registry.on('set', (key, item) => {
// @ts-ignore
this.httpProxy.register(key, item.newVal);
});
}
Expand Down Expand Up @@ -561,8 +555,9 @@ export default class PodiumLayout {
incoming.css = [...this.cssRoute];
incoming.js = [...this.jsRoute];

// @ts-ignore
// @ts-expect-error Context hasn't been updated yet with the new typings for HttpIncoming.
if (context) await this.context.process(incoming);
// @ts-expect-error Proxy hasn't been updated yet with the new typings for HttpIncoming.
if (proxy) await this.httpProxy.process(incoming);

return incoming;
Expand All @@ -587,7 +582,7 @@ export default class PodiumLayout {
middleware() {
return async (req, res, next) => {
const incoming = new HttpIncoming(req, res, res.locals);
// @ts-ignore
// @ts-expect-error The API here is a bit odd. You assign a string, but the `set` constructs a URL from it.
incoming.url = `${req.protocol}://${req.get('host')}${
req.originalUrl
}`;
Expand Down Expand Up @@ -660,11 +655,7 @@ export default class PodiumLayout {
#sanitize(uri, prefix = false) {
const pathname = prefix ? this.#pathname : '';
if (uri) {
// @ts-ignore
return uriIsRelative(uri)
? // @ts-ignore
pathnameBuilder(pathname, uri)
: uri;
return uriIsRelative(uri) ? pathnameBuilder(pathname, uri) : uri;
}
return uri;
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
"dependencies": {
"@metrics/client": "2.5.2",
"@podium/client": "5.0.10",
"@podium/context": "5.0.4",
"@podium/context": "5.0.11",
"@podium/proxy": "5.0.8",
"@podium/schemas": "5.0.0",
"@podium/utils": "5.0.3",
"@podium/utils": "5.0.6",
"abslog": "2.4.2",
"ajv": "8.12.0",
"lodash.merge": "4.6.2",
Expand Down

0 comments on commit 3b7e988

Please sign in to comment.