@squide/msw 2.0.3 → 2.0.5
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 +16 -0
- package/dist/{chunk-D2TOUDBN.js → chunk-OKIK46QG.js} +11 -2
- package/dist/index.js +1 -1
- package/dist/mswPlugin.d.ts +3 -2
- package/dist/mswPlugin.js +1 -1
- package/package.json +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @squide/msw
|
|
2
2
|
|
|
3
|
+
## 2.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#115](https://github.com/gsoft-inc/wl-squide/pull/115) [`568255a`](https://github.com/gsoft-inc/wl-squide/commit/568255a50a519e7d19c8c2b03909559686cd24c4) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Request handlers registeration are now printed to the debug logs.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`568255a`](https://github.com/gsoft-inc/wl-squide/commit/568255a50a519e7d19c8c2b03909559686cd24c4)]:
|
|
10
|
+
- @squide/core@3.1.0
|
|
11
|
+
|
|
12
|
+
## 2.0.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11)]:
|
|
17
|
+
- @squide/core@3.0.0
|
|
18
|
+
|
|
3
19
|
## 2.0.3
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
import { RequestHandlerRegistry } from './chunk-2J7GQPWR.js';
|
|
2
|
-
import { Plugin } from '@squide/core';
|
|
2
|
+
import { Plugin, isNil } from '@squide/core';
|
|
3
3
|
|
|
4
4
|
var MswPlugin = class _MswPlugin extends Plugin {
|
|
5
|
+
#runtime;
|
|
5
6
|
#requestHandlerRegistry = new RequestHandlerRegistry();
|
|
6
7
|
constructor() {
|
|
7
8
|
super(_MswPlugin.name);
|
|
8
9
|
}
|
|
10
|
+
_setRuntime(runtime) {
|
|
11
|
+
this.#runtime = runtime;
|
|
12
|
+
}
|
|
9
13
|
registerRequestHandlers(handlers) {
|
|
10
14
|
this.#requestHandlerRegistry.add(handlers);
|
|
15
|
+
this.#runtime?.logger.debug("[squide] The following MSW request handlers has been registered: ", handlers);
|
|
11
16
|
}
|
|
12
17
|
get requestHandlers() {
|
|
13
18
|
return this.#requestHandlerRegistry.handlers;
|
|
14
19
|
}
|
|
15
20
|
};
|
|
16
21
|
function getMswPlugin(runtime) {
|
|
17
|
-
|
|
22
|
+
const plugin = runtime.getPlugin(MswPlugin.name);
|
|
23
|
+
if (isNil(plugin)) {
|
|
24
|
+
throw new Error("[squide] The getMswPlugin function is called but no MswPlugin instance has been registered with the runtime.");
|
|
25
|
+
}
|
|
26
|
+
return plugin;
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
export { MswPlugin, getMswPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MswPlugin, getMswPlugin } from './chunk-
|
|
1
|
+
export { MswPlugin, getMswPlugin } from './chunk-OKIK46QG.js';
|
|
2
2
|
export { RequestHandlerRegistry } from './chunk-2J7GQPWR.js';
|
|
3
3
|
export { useIsMswStarted } from './chunk-P5ONHQEP.js';
|
|
4
4
|
export { __resetMswStatus, isMswStarted, setMswAsStarted } from './chunk-JLS7DBDX.js';
|
package/dist/mswPlugin.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Plugin,
|
|
1
|
+
import { Plugin, Runtime } from '@squide/core';
|
|
2
2
|
import { RequestHandler } from 'msw';
|
|
3
3
|
|
|
4
4
|
declare class MswPlugin extends Plugin {
|
|
5
5
|
#private;
|
|
6
6
|
constructor();
|
|
7
|
+
_setRuntime(runtime: Runtime): void;
|
|
7
8
|
registerRequestHandlers(handlers: RequestHandler[]): void;
|
|
8
9
|
get requestHandlers(): RequestHandler[];
|
|
9
10
|
}
|
|
10
|
-
declare function getMswPlugin(runtime:
|
|
11
|
+
declare function getMswPlugin(runtime: Runtime): MswPlugin;
|
|
11
12
|
|
|
12
13
|
export { MswPlugin, getMswPlugin };
|
package/dist/mswPlugin.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/msw",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"description": "Add support for MSW to @squide federated application shell.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -37,13 +37,11 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/jest": "29.5.7",
|
|
41
40
|
"@types/react": "18.2.36",
|
|
42
41
|
"@types/react-dom": "18.2.14",
|
|
43
42
|
"@workleap/eslint-plugin": "3.0.0",
|
|
44
43
|
"@workleap/tsup-configs": "3.0.1",
|
|
45
44
|
"@workleap/typescript-configs": "3.0.2",
|
|
46
|
-
"jest": "29.7.0",
|
|
47
45
|
"msw": "2.0.3",
|
|
48
46
|
"react": "18.2.0",
|
|
49
47
|
"react-dom": "18.2.0",
|
|
@@ -51,7 +49,7 @@
|
|
|
51
49
|
"typescript": "5.2.2"
|
|
52
50
|
},
|
|
53
51
|
"dependencies": {
|
|
54
|
-
"@squide/core": "
|
|
52
|
+
"@squide/core": "3.1.0"
|
|
55
53
|
},
|
|
56
54
|
"sideEffects": false,
|
|
57
55
|
"engines": {
|