@podium/client 5.2.5-beta.1 → 5.2.5-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -2
- package/README.md +0 -2
- package/lib/resolver.content.js +4 -1
- package/lib/resolver.fallback.js +4 -1
- package/lib/utils.js +6 -3
- package/package.json +8 -8
- package/types/utils.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
## [5.2.5-beta.
|
|
1
|
+
## [5.2.5-beta.3](https://github.com/podium-lib/client/compare/v5.2.5-beta.2...v5.2.5-beta.3) (2025-01-13)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* correctly build asset urls from link headers ([#446](https://github.com/podium-lib/client/issues/446)) ([89f9e0b](https://github.com/podium-lib/client/commit/89f9e0b44f87c45c1459dce7e53db4fa7fc85d17))
|
|
7
|
+
|
|
8
|
+
## [5.2.5](https://github.com/podium-lib/client/compare/v5.2.4...v5.2.5) (2024-11-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* correctly build asset urls from link headers ([#446](https://github.com/podium-lib/client/issues/446)) ([5a30079](https://github.com/podium-lib/client/commit/5a30079fb47ee15a49ae6ff77348c400df3fe99a))
|
|
7
14
|
|
|
8
15
|
## [5.2.4](https://github.com/podium-lib/client/compare/v5.2.3...v5.2.4) (2024-11-21)
|
|
9
16
|
|
package/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Client for fetching podium component fragments over HTTP.
|
|
4
4
|
|
|
5
|
-
[](https://david-dm.org/podium-lib/client)
|
|
6
5
|
[](https://github.com/podium-lib/client/actions?query=workflow%3A%22Run+Lint+and+Tests%22)
|
|
7
|
-
[](https://snyk.io/test/github/podium-lib/client?targetFile=package.json)
|
|
8
6
|
|
|
9
7
|
This module is intended for internal use in Podium and is not a module an end
|
|
10
8
|
user would use directly. End users will typically interact with this module
|
package/lib/resolver.content.js
CHANGED
|
@@ -165,7 +165,10 @@ export default class PodletClientContentResolver {
|
|
|
165
165
|
...reqOptions,
|
|
166
166
|
});
|
|
167
167
|
|
|
168
|
-
const parsedAssetObjects = parseLinkHeaders(
|
|
168
|
+
const parsedAssetObjects = parseLinkHeaders(
|
|
169
|
+
hdrs.link,
|
|
170
|
+
outgoing.manifestUri,
|
|
171
|
+
);
|
|
169
172
|
|
|
170
173
|
const scriptObjects = parsedAssetObjects.filter(
|
|
171
174
|
(asset) => asset instanceof AssetJs,
|
package/lib/resolver.fallback.js
CHANGED
|
@@ -126,7 +126,10 @@ export default class PodletClientFallbackResolver {
|
|
|
126
126
|
...reqOptions,
|
|
127
127
|
});
|
|
128
128
|
|
|
129
|
-
const parsedAssetObjects = parseLinkHeaders(
|
|
129
|
+
const parsedAssetObjects = parseLinkHeaders(
|
|
130
|
+
resHeaders.link,
|
|
131
|
+
outgoing.manifestUri,
|
|
132
|
+
);
|
|
130
133
|
|
|
131
134
|
const scriptObjects = parsedAssetObjects.filter(
|
|
132
135
|
(asset) => asset instanceof AssetJs,
|
package/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetJs, AssetCss } from '@podium/utils';
|
|
1
|
+
import { AssetJs, AssetCss, uriRelativeToAbsolute } from '@podium/utils';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Checks if a header object has a header.
|
|
@@ -75,14 +75,17 @@ export const filterAssets = (scope, assets) => {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
// parse link headers in AssetCss and AssetJs objects
|
|
78
|
-
export const parseLinkHeaders = (headers) => {
|
|
78
|
+
export const parseLinkHeaders = (headers, manifestUri) => {
|
|
79
79
|
const links = [];
|
|
80
80
|
|
|
81
81
|
if (!headers) return links;
|
|
82
82
|
headers.split(',').forEach((link) => {
|
|
83
83
|
const parts = link.split(';');
|
|
84
84
|
const [href, ...rest] = parts;
|
|
85
|
-
const value =
|
|
85
|
+
const value = uriRelativeToAbsolute(
|
|
86
|
+
href.replace(/<|>|"/g, '').trim(),
|
|
87
|
+
manifestUri,
|
|
88
|
+
);
|
|
86
89
|
|
|
87
90
|
const asset = { value };
|
|
88
91
|
for (const key of rest) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@podium/client",
|
|
3
|
-
"version": "5.2.5-beta.
|
|
3
|
+
"version": "5.2.5-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@hapi/boom": "10.0.1",
|
|
41
41
|
"@metrics/client": "2.5.4",
|
|
42
|
-
"@podium/http-client": "1.0.0-beta.
|
|
42
|
+
"@podium/http-client": "1.0.0-beta.9",
|
|
43
43
|
"@podium/schemas": "5.1.0",
|
|
44
44
|
"@podium/utils": "5.4.0",
|
|
45
45
|
"abslog": "2.4.4",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"undici": "6.21.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@podium/eslint-config": "1.0.
|
|
53
|
+
"@podium/eslint-config": "1.0.5",
|
|
54
54
|
"@podium/semantic-release-config": "2.0.0",
|
|
55
55
|
"@podium/test-utils": "3.1.0-next.5",
|
|
56
56
|
"@podium/typescript-config": "1.0.0",
|
|
@@ -62,15 +62,15 @@
|
|
|
62
62
|
"@sinonjs/fake-timers": "11.3.1",
|
|
63
63
|
"@types/readable-stream": "4.0.18",
|
|
64
64
|
"benchmark": "2.1.4",
|
|
65
|
-
"eslint": "9.
|
|
65
|
+
"eslint": "9.17.0",
|
|
66
66
|
"eslint-config-prettier": "9.1.0",
|
|
67
|
-
"eslint-plugin-prettier": "5.1
|
|
68
|
-
"express": "4.21.
|
|
67
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
68
|
+
"express": "4.21.2",
|
|
69
69
|
"get-stream": "9.0.1",
|
|
70
70
|
"http-proxy": "1.18.1",
|
|
71
71
|
"is-stream": "4.0.1",
|
|
72
|
-
"npm-run-all2": "6.2.
|
|
73
|
-
"prettier": "3.
|
|
72
|
+
"npm-run-all2": "6.2.6",
|
|
73
|
+
"prettier": "3.4.2",
|
|
74
74
|
"semantic-release": "24.1.2",
|
|
75
75
|
"tap": "18.7.2",
|
|
76
76
|
"typescript": "5.6.3",
|
package/types/utils.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export function isHeaderDefined(headers: object, header: string): boolean;
|
|
|
2
2
|
export function hasManifestChange(item: object): boolean;
|
|
3
3
|
export function validateIncoming(incoming?: object): boolean;
|
|
4
4
|
export function filterAssets<T extends import("@podium/utils").AssetCss | import("@podium/utils").AssetJs>(scope: "content" | "fallback" | "all", assets: T[]): T[];
|
|
5
|
-
export function parseLinkHeaders(headers: any): any[];
|
|
5
|
+
export function parseLinkHeaders(headers: any, manifestUri: any): any[];
|
|
6
6
|
export function toPreloadAssetObjects(assetObjects: any): any;
|