Skip to content

Commit

Permalink
fix: re-export types from podium/utils as well
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Aug 19, 2024
1 parent fa5afb1 commit 2ce9dd8
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions lib/layout.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
HttpIncoming,
HttpIncoming as HttpIncomingImpl,
template,
isFunction,
pathnameBuilder,
uriIsRelative,
AssetCss,
AssetJs,
AssetCss as AssetCssImpl,
AssetJs as AssetJsImpl,
} from '@podium/utils';
import * as schema from '@podium/schemas';
import Context from '@podium/context';
Expand All @@ -29,6 +29,18 @@ import fs from 'fs';
* @typedef {import('@podium/client').PodiumRedirect} PodiumRedirect
* @typedef {import('@podium/client').PodletManifest} PodletManifest
* @typedef {import('@podium/client').RegisterOptions} RegisterOptions
* @typedef {import('@podium/utils').AssetCss} AssetCss
* @typedef {import('@podium/utils').AssetJs} AssetJs
* @typedef {import('@podium/utils').PodiumHttpIncoming} PodiumHttpIncoming
* @typedef {import('@podium/utils').PodiumCssAsset} PodiumCssAsset
* @typedef {import('@podium/utils').PodiumJavaScriptAsset} PodiumJavaScriptAsset
*/

/**
* @template {Record<string, unknown>} [T=Record<string, unknown>]
* @template {Record<string, unknown>} [U=Record<string, unknown>]
* @template {Record<string, unknown>} [V=Record<string, unknown>]
* @typedef {import('@podium/utils').HttpIncoming<T, U, V>} HttpIncoming
*/

const currentDirectory = dirname(fileURLToPath(import.meta.url));
Expand Down Expand Up @@ -328,7 +340,7 @@ export default class PodiumLayout {
...clonedOptions,
pathname: this.#pathname,
};
this.cssRoute.push(new AssetCss(args));
this.cssRoute.push(new AssetCssImpl(args));
}
/**
* Set relative or absolute URLs to Cascading Style Sheets (CSS) assets for the layout.
Expand Down Expand Up @@ -396,7 +408,7 @@ export default class PodiumLayout {
args.data = data;
}

this.jsRoute.push(new AssetJs(args));
this.jsRoute.push(new AssetJsImpl(args));
}

/**
Expand Down Expand Up @@ -586,7 +598,7 @@ export default class PodiumLayout {
*/
middleware() {
return async (req, res, next) => {
const incoming = new HttpIncoming(req, res, res.locals);
const incoming = new HttpIncomingImpl(req, res, res.locals);
// @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

0 comments on commit 2ce9dd8

Please sign in to comment.