Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Oct 22, 2024
2 parents 73dab2c + 19c466d commit 6965db5
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 252 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ tmp/**/*
.idea/**/*
coverage
dist/
types
*.d.ts
!podium.d.ts
.tap
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
save-exact=true
136 changes: 12 additions & 124 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,156 +1,44 @@
# [5.2.0-next.6](https://github.com/podium-lib/podlet/compare/v5.2.0-next.5...v5.2.0-next.6) (2024-10-11)


### Features

* replace early hints with link header ([815ea97](https://github.com/podium-lib/podlet/commit/815ea97df599676a6a1dd56dd6aeef4f91b27c95))

# [5.2.0-next.5](https://github.com/podium-lib/podlet/compare/v5.2.0-next.4...v5.2.0-next.5) (2024-09-29)
## [5.1.18](https://github.com/podium-lib/podlet/compare/v5.1.17...v5.1.18) (2024-10-11)


### Bug Fixes

* sharpen up shadow dom usage assertion ([a47c8bc](https://github.com/podium-lib/podlet/commit/a47c8bc7bb33bc6c685d882a7f922cd39914a874))
* include some app info as a default metric ([5c9fdcb](https://github.com/podium-lib/podlet/commit/5c9fdcb269f9b1867f8df127fcd412f150d3ca95))

# [5.2.0-next.4](https://github.com/podium-lib/podlet/compare/v5.2.0-next.3...v5.2.0-next.4) (2024-09-22)
## [5.1.17](https://github.com/podium-lib/podlet/compare/v5.1.16...v5.1.17) (2024-09-23)


### Bug Fixes

* tag asset type when sending hint headers ([56c8614](https://github.com/podium-lib/podlet/commit/56c86144207956c63c7ce1d1103efe4f8ff7d7bf))

# [5.2.0-next.3](https://github.com/podium-lib/podlet/compare/v5.2.0-next.2...v5.2.0-next.3) (2024-09-10)


### Features
* type the known context values in an extendable way ([#427](https://github.com/podium-lib/podlet/issues/427)) ([f90ef57](https://github.com/podium-lib/podlet/commit/f90ef577cf6f0fdeabb08edb121a8a0107e77c4d))

* add DSD shadow DOM encapsulation support ([02c9a64](https://github.com/podium-lib/podlet/commit/02c9a64a6bb2f460c035416e43405ae380cb6d1c))

# [5.2.0-next.2](https://github.com/podium-lib/podlet/compare/v5.2.0-next.1...v5.2.0-next.2) (2024-09-06)


### Bug Fixes

* force release 5.2.0-next.2 ([b2fc84c](https://github.com/podium-lib/podlet/commit/b2fc84cd6ced3716aa0964d76f55063db5c37fce))
* force release 5.2.0-next.2 ([84223e8](https://github.com/podium-lib/podlet/commit/84223e823125544eb40cbd50b2558bcb78ba9ce6))
* force release 5.2.0-next.2 ([4f5f19d](https://github.com/podium-lib/podlet/commit/4f5f19d9e486461b822dddf4bf278207927c63be))
* force release 5.2.0-next.2 ([a5a1953](https://github.com/podium-lib/podlet/commit/a5a19536aab17130e79f14b2a8d7e7f58e61d0f0))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)
## [5.1.16](https://github.com/podium-lib/podlet/compare/v5.1.15...v5.1.16) (2024-09-23)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* force release 5.2.0-next.2 ([84223e8](https://github.com/podium-lib/podlet/commit/84223e823125544eb40cbd50b2558bcb78ba9ce6))
* force release 5.2.0-next.2 ([4f5f19d](https://github.com/podium-lib/podlet/commit/4f5f19d9e486461b822dddf4bf278207927c63be))
* force release 5.2.0-next.2 ([a5a1953](https://github.com/podium-lib/podlet/commit/a5a19536aab17130e79f14b2a8d7e7f58e61d0f0))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))


### Features

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))
* **deps:** update all dependencies (non-major) ([b8eddfd](https://github.com/podium-lib/podlet/commit/b8eddfd676810607adc56cdc71d2622e73b25e0e))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)
## [5.1.15](https://github.com/podium-lib/podlet/compare/v5.1.14...v5.1.15) (2024-09-16)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* force release 5.2.0-next.2 ([4f5f19d](https://github.com/podium-lib/podlet/commit/4f5f19d9e486461b822dddf4bf278207927c63be))
* force release 5.2.0-next.2 ([a5a1953](https://github.com/podium-lib/podlet/commit/a5a19536aab17130e79f14b2a8d7e7f58e61d0f0))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))


### Features
* correct the JSDoc for fallback ([#423](https://github.com/podium-lib/podlet/issues/423)) ([7444897](https://github.com/podium-lib/podlet/commit/7444897b7cf45a9e2b9c310ce309f69f80fa91d1))

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)
## [5.1.14](https://github.com/podium-lib/podlet/compare/v5.1.13...v5.1.14) (2024-09-16)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* force release 5.2.0-next.2 ([a5a1953](https://github.com/podium-lib/podlet/commit/a5a19536aab17130e79f14b2a8d7e7f58e61d0f0))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))


### Features
* **deps:** update dependency @podium/proxy to v5.0.26 ([59699f0](https://github.com/podium-lib/podlet/commit/59699f029ee32ff4997c7e971bb543ee6a971251))

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)
## [5.1.13](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.1.13) (2024-09-09)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))


### Features

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))
* update @podium/utils ([719c1e0](https://github.com/podium-lib/podlet/commit/719c1e0ae4e06144e084e8b95bd04d94313b116e))


### Features

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-05)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))


### Features

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-09-03)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([f243d60](https://github.com/podium-lib/podlet/commit/f243d607356166cd77c83eb72ef7ea84f4b95d80))
* **types:** fix AssetJsLike type ([19494f5](https://github.com/podium-lib/podlet/commit/19494f51c338468c362668678654c119993795db))


### Features

* automatically send assets with content/fallback requests as 103 early hints ([c4c8c88](https://github.com/podium-lib/podlet/commit/c4c8c889bc491b8a3c4a896220d1205164e6fde4))

# [5.2.0-next.1](https://github.com/podium-lib/podlet/compare/v5.1.12...v5.2.0-next.1) (2024-08-19)


### Bug Fixes

* ensure both key/value and object conversion are supported for JS data attributes ([ccdfd1e](https://github.com/podium-lib/podlet/commit/ccdfd1e791c81b4c5aed045b47a316683911d929))
* **types:** fix AssetJsLike type ([1c29350](https://github.com/podium-lib/podlet/commit/1c29350a9f0682df675b44cf4c5e88468ab24043))


### Features

* add res.assets for request bound, early hinted asset sending ([caca302](https://github.com/podium-lib/podlet/commit/caca302a2d80144e24d2078c3ae8f7a8f423b1dd))
* **deps:** update all dependencies (non-major) ([81119fe](https://github.com/podium-lib/podlet/commit/81119feda716c226777751564ac9153c7c393096))

## [5.1.12](https://github.com/podium-lib/podlet/compare/v5.1.11...v5.1.12) (2024-08-19)

Expand Down
23 changes: 2 additions & 21 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
import prettierConfig from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import js from '@eslint/js';
import config from '@podium/eslint-config';

export default [
js.configs.recommended,
prettierConfig,
prettierPlugin,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
global: true,
},
},
},
{
ignores: ['coverage/*', 'dist/*'],
},
];
export default config;
29 changes: 2 additions & 27 deletions fixup.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,12 @@
import fs from 'node:fs';
import path from 'node:path';

let fixup = path.join(process.cwd(), 'types', 'podium.d.ts');
let module = path.join(process.cwd(), 'types', 'podlet.d.ts');

fs.writeFileSync(
module,
/* ts */ `
import type { HttpIncoming } from "@podium/utils";
declare global {
namespace Express {
export interface Locals {
podium: HttpIncoming;
}
export interface Response {
/**
* Calls the send / write method on the \`http.ServerResponse\` object.
*
* When in development mode this method will wrap the provided fragment in a
* default HTML document before dispatching. When not in development mode, this
* method will just dispatch the fragment.
*
* @example
* app.get(podlet.content(), (req, res) => {
* res.podiumSend('<h1>Hello World</h1>');
* });
*/
podiumSend(fragment: string, ...args: unknown[]): Response;
}
}
}
`${fs.readFileSync(fixup, 'utf-8')}
${fs.readFileSync(module, 'utf-8')}`,
'utf-8',
);
26 changes: 19 additions & 7 deletions lib/podlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ const { template } = utils;
* @property {string} name - (required) podlet name
* @property {string} version - (required) podlet version
* @property {string} pathname - (required) podlet pathname
* @property {string} [manifest='/manifest.json'] - 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 {string} [manifest="/manifest.json"] - 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=false] - a boolean flag that, when true, enables additional development setup (default false)
* @property {boolean} [useShadowDOM=false] - a boolean flag that, when true, enables the use of ShadowDOM (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 {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 {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 @@ -141,7 +141,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 @@ -155,7 +155,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 @@ -169,7 +169,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 @@ -407,6 +407,18 @@ export default class PodiumPodlet {
});

versionGauge.set(1);

const podletGauge = this.metrics.gauge({
name: 'podium_podlet_application_info',
description: '@podium/podlet application info',
labels: {
name: this.name,
version: this.version,
has_fallback: Boolean(fallback),
},
});

podletGauge.set(1);
});

// @ts-ignore
Expand Down
36 changes: 14 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,34 @@
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"test": "run-s test:*",
"test:unit": "tap --disable-coverage --allow-empty-coverage",
"test:types": "tsc --project tsconfig.test.json",
"types": "run-s types:tsc types:fixup",
"test": "tap --disable-coverage --allow-empty-coverage",
"types": "run-s types:tsc types:fixup types:test",
"types:tsc": "tsc --declaration --emitDeclarationOnly",
"types:test": "tsc --project tsconfig.test.json",
"types:fixup": "node ./fixup.js"
},
"dependencies": {
"@metrics/client": "2.5.3",
"@podium/proxy": "5.0.24",
"@podium/proxy": "5.0.28",
"@podium/schemas": "5.0.6",
"@podium/utils": "5.2.1",
"@podium/utils": "5.3.1",
"abslog": "2.4.4",
"ajv": "8.17.1",
"objobj": "1.0.0"
},
"devDependencies": {
"@babel/eslint-parser": "7.25.1",
"@podium/test-utils": "2.5.2",
"@semantic-release/changelog": "6.0.3",
"@semantic-release/commit-analyzer": "11.1.0",
"@semantic-release/git": "10.0.1",
"@semantic-release/github": "9.2.6",
"@semantic-release/npm": "11.0.3",
"@semantic-release/release-notes-generator": "12.1.0",
"@types/node": "^20.10.3",
"@podium/eslint-config": "1.0.0",
"@podium/semantic-release-config": "2.0.0",
"@podium/test-utils": "3.0.10",
"@podium/typescript-config": "1.0.0",
"@types/node": "20.16.10",
"@types/readable-stream": "4.0.15",
"eslint": "9.9.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-prettier": "5.2.1",
"express": "4.19.2",
"globals": "15.9.0",
"eslint": "9.11.1",
"express": "4.20.0",
"json-stringify-safe": "5.0.1",
"npm-run-all2": "5.0.2",
"npm-run-all2": "6.2.3",
"prettier": "3.3.3",
"semantic-release": "23.1.1",
"semantic-release": "24.1.2",
"tap": "18.8.0",
"typescript": "5.5.4",
"undici": "^6.19.7"
Expand Down
27 changes: 0 additions & 27 deletions release.config.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: '@podium/semantic-release-config',
};
Loading

0 comments on commit 6965db5

Please sign in to comment.