@podium/podlet 4.4.71 → 4.4.73

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/index.d.ts +50 -46
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [4.4.73](https://github.com/podium-lib/podlet/compare/v4.4.72...v4.4.73) (2023-10-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * CJS-shaped export in type definition ([fd96046](https://github.com/podium-lib/podlet/commit/fd96046ca16b89d02526453ff3cbf6d3ace694bd))
7
+
8
+ ## [4.4.72](https://github.com/podium-lib/podlet/compare/v4.4.71...v4.4.72) (2023-09-25)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update all dependencies (non-major) ([0a47c72](https://github.com/podium-lib/podlet/commit/0a47c7289869c023235d32d301e83fd5de77f7f2))
14
+
1
15
  ## [4.4.71](https://github.com/podium-lib/podlet/compare/v4.4.70...v4.4.71) (2023-09-18)
2
16
 
3
17
 
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import {HttpIncoming, AssetJs, AssetCss} from '@podium/utils';
2
- import * as Proxy from '@podium/proxy';
1
+ import { HttpIncoming, AssetJs, AssetCss } from '@podium/utils';
2
+ import PodiumProxy from '@podium/proxy';
3
3
  import MetricsClient from '@metrics/client';
4
4
 
5
5
  // Use declaration merging to extend Express.
@@ -11,40 +11,8 @@ declare global {
11
11
  }
12
12
  }
13
13
 
14
- type AbsLogger = {
15
- trace: LogFunction;
16
- debug: LogFunction;
17
- info: LogFunction;
18
- warn: LogFunction;
19
- error: LogFunction;
20
- fatal: LogFunction;
21
- }
22
-
23
- type LogFunction = (...args: any) => void
24
-
25
- type PodletContext = {
26
- debug: 'true' | 'false';
27
- locale: string;
28
- deviceType: string;
29
- requestedBy: string;
30
- mountOrigin: string;
31
- mountPathname: string;
32
- publicPathname: string;
33
- }
34
-
35
- export interface PodletOptions {
36
- name: string;
37
- pathname: string;
38
- version: string;
39
- manifest?: string;
40
- content?: string;
41
- fallback?: string;
42
- logger?: Console | AbsLogger;
43
- development?: boolean;
44
- }
45
-
46
- export default class Podlet {
47
- constructor(options: PodletOptions);
14
+ declare class Podlet {
15
+ constructor(options: Podlet.PodletOptions);
48
16
 
49
17
  name: string;
50
18
 
@@ -56,21 +24,21 @@ export default class Podlet {
56
24
 
57
25
  fallbackRoute: string;
58
26
 
59
- cssRoute: [];
27
+ cssRoute: AssetCss[];
60
28
 
61
- jsRoute: [];
29
+ jsRoute: AssetJs[];
62
30
 
63
31
  proxyRoutes: Record<string, string>;
64
32
 
65
- log: AbsLogger;
33
+ log: Podlet.AbsLogger;
66
34
 
67
35
  development: boolean;
68
36
 
69
- httpProxy: Proxy;
37
+ httpProxy: PodiumProxy;
70
38
 
71
- baseContext: PodletContext;
39
+ baseContext: Podlet.PodletContext;
72
40
 
73
- defaultContext: PodletContext;
41
+ defaultContext: Podlet.PodletContext;
74
42
 
75
43
  metrics: MetricsClient;
76
44
 
@@ -92,19 +60,55 @@ export default class Podlet {
92
60
 
93
61
  defaults(context: any): any;
94
62
 
95
- view(
63
+ view<T = { [key: string]: unknown }>(
96
64
  template: (
97
- incoming: HttpIncoming,
65
+ incoming: HttpIncoming<T>,
98
66
  fragment: string,
99
67
  ...args: unknown[]
100
68
  ) => string,
101
69
  ): void;
102
70
 
103
- render(
104
- incoming: HttpIncoming,
71
+ render<T = { [key: string]: unknown }>(
72
+ incoming: HttpIncoming<T>,
105
73
  fragment: string,
106
74
  ...args: unknown[]
107
75
  ): string;
108
76
 
109
77
  process(incoming: HttpIncoming): Promise<HttpIncoming>;
110
78
  }
79
+
80
+ declare namespace Podlet {
81
+ export type AbsLogger = {
82
+ trace: LogFunction;
83
+ debug: LogFunction;
84
+ info: LogFunction;
85
+ warn: LogFunction;
86
+ error: LogFunction;
87
+ fatal: LogFunction;
88
+ };
89
+
90
+ type LogFunction = (...args: any) => void;
91
+
92
+ export type PodletContext = {
93
+ debug: 'true' | 'false';
94
+ locale: string;
95
+ deviceType: string;
96
+ requestedBy: string;
97
+ mountOrigin: string;
98
+ mountPathname: string;
99
+ publicPathname: string;
100
+ };
101
+
102
+ export interface PodletOptions {
103
+ name: string;
104
+ pathname: string;
105
+ version: string;
106
+ manifest?: string;
107
+ content?: string;
108
+ fallback?: string;
109
+ logger?: Console | AbsLogger;
110
+ development?: boolean;
111
+ }
112
+ }
113
+
114
+ export = Podlet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podium/podlet",
3
- "version": "4.4.71",
3
+ "version": "4.4.73",
4
4
  "description": "Module for building page fragment servers in a micro frontend architecture.",
5
5
  "main": "lib/podlet.js",
6
6
  "license": "MIT",
@@ -27,10 +27,10 @@
27
27
  "test": "tap --no-check-coverage"
28
28
  },
29
29
  "dependencies": {
30
- "@metrics/client": "2.5.1",
31
- "@podium/proxy": "4.2.81",
30
+ "@metrics/client": "2.5.2",
31
+ "@podium/proxy": "4.2.83",
32
32
  "@podium/schemas": "4.1.34",
33
- "@podium/utils": "4.4.39",
33
+ "@podium/utils": "4.4.40",
34
34
  "abslog": "2.4.0",
35
35
  "ajv": "8.12.0",
36
36
  "objobj": "1.0.0"
@@ -51,6 +51,6 @@
51
51
  "eslint-plugin-prettier": "3.4.1",
52
52
  "express": "4.18.2",
53
53
  "prettier": "2.8.8",
54
- "tap": "16.3.8"
54
+ "tap": "16.3.9"
55
55
  }
56
56
  }