Skip to content

Commit

Permalink
fix: correct the JSDoc for fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
wkillerud committed Sep 16, 2024
1 parent 4b93e99 commit abd26eb
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions lib/podlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ const { template } = utils;

/**
* @typedef {Object} PodletOptions
* @property {string} name - (required) podlet name
* @property {string} version - (required) podlet version
* @property {string} pathname - (required) podlet pathname
* @property {string} [manifest] - path where the podlet manifest file is served from (default '/manifest.json')
* @property {string} [content] - path where the podlet content HTML markup is served from (default '/')
* @property {string} [fallback] - path where the podlet fallback HTML markup is served from (default '/fallback')
* @property {boolean} [development] - a boolean flag that, when true, enables additional development setup (default false)
* @property {import('abslog').AbstractLoggerOptions} [logger] - a logger to use when provided. Can be the console object if console logging is desired but can also be any Log4j compatible logging object as well. Nothing is logged if no logger is provided. (default null)
* @property {string} name - Podlet name
* @property {string} version - Podlet version
* @property {string} pathname - Podlet pathname
* @property {string} [manifest="/manifest.json"] - Path where the podlet manifest file is served from.
* @property {string} [content="/"] - Path where the podlet content HTML markup is served from.
* @property {string} [fallback=""] - Path where the podlet fallback HTML markup is served from. By default there is no fallback. Set this to for instance `"/fallback"` to serve a cacheable version of the contents in case the podlet goes down.
* @property {boolean} [development=false] - a boolean flag that, when true, enables additional development setup
* @property {import('abslog').AbstractLoggerOptions} [logger] - a logger to use when provided. Can be the console object if console logging is desired but can also be any Log4j compatible logging object as well. Nothing is logged if no logger is provided.
* @property {import("@podium/proxy").PodiumProxyOptions} [proxy] - options that can be provided to configure the @podium/proxy instance used by the podlet. See that module for details.
*
* @typedef {{ debug: 'true' | 'false', locale: string, deviceType: string, requestedBy: string, mountOrigin: string, mountPathname: string, publicPathname: string }} PodletContext
Expand Down Expand Up @@ -134,7 +134,7 @@ export default class PodiumPodlet {
httpProxy;

/**
* The pathname for the manifest of the podlet. Defaults to /manifest.json. (set in the constructor)
* The pathname for the manifest of the podlet. Defaults to "/manifest.json".
* The value should be relative to the value set on the pathname argument.
* In other words if a podlet is mounted into an HTTP server at /foo and the manifest is at /foo/component.json, pathname will be /foo and manifestRoute will be /component.json
*
Expand All @@ -148,7 +148,7 @@ export default class PodiumPodlet {
manifestRoute = '/manifest.json';

/**
* The pathname for the content route of the podlet. Defaults to /. (set in the constructor)
* The pathname for the content route of the podlet. Defaults to "/".
* The value should be relative to the value set on the pathname argument.
* In other words if a podlet is mounted into an HTTP server at /foo and the content is at /foo/content, pathname will be /foo and contentRoute will be /content
*
Expand All @@ -162,7 +162,7 @@ export default class PodiumPodlet {
contentRoute = '/';

/**
* The pathname for the fallback route of the podlet. Defaults to /fallback. (set in the constructor)
* The pathname for the fallback route of the podlet. Defaults to no fallback.
* The value should be relative to the value set on the pathname argument.
* In other words if a podlet is mounted into an HTTP server at /foo and the fallback is at /foo/fallback, pathname will be /foo and fallbackRoute will be /fallback
*
Expand Down Expand Up @@ -285,16 +285,6 @@ export default class PodiumPodlet {
* Creates a new instance of a Podium podlet which can be used in conjunction with your framework of choice to build podlet server apps.
* `name`, `version` and `pathname` constructor arguments are required. All other options are optional.
*
* * `name` - podlet name (**required**)
* * `version` - podlet version (**required**)
* * `pathname` - podlet pathname (**required**)
* * `manifest` - path where the podlet manifest file is served from (**default** `'/manifest.json'`)
* * `content` - path where the podlet content HTML markup is served from (**default** `'/'`)
* * `fallback` - path where the podlet fallback HTML markup is served from (**default** `'/fallback'`)
* * `development` - a boolean flag that, when true, enables additional development setup (**default** `false`)
* * `logger` - a logger to use when provided. Can be the console object if console logging is desired but can also be any Log4j compatible logging object as well. Nothing is logged if no logger is provided. (**default** `null`)
* * `proxy` - options that can be provided to configure the @podium/proxy instance used by the podlet. See that module for details. (**default**: `{}`)
*
* @see https://podium-lib.io/docs/api/podlet/#constructor
* @see https://podium-lib.io/docs/podlet/getting_started
*
Expand Down

0 comments on commit abd26eb

Please sign in to comment.