@squide/msw 2.0.1 → 2.0.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @squide/msw
2
2
 
3
+ ## 2.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#108](https://github.com/gsoft-inc/wl-squide/pull/108) [`58097a2`](https://github.com/gsoft-inc/wl-squide/commit/58097a2fbaa7e5942cbe6f9b765fe471d52758d8) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated types in the function signatures for MSW 2.0
8
+
9
+ ## 2.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#103](https://github.com/gsoft-inc/wl-squide/pull/103) [`b72fca3`](https://github.com/gsoft-inc/wl-squide/commit/b72fca38385ddacbcd80376c9afd0c9485658d90) Thanks [@patricklafrance](https://github.com/patricklafrance)! - The `msw` dependency is now an optional `peerDependency`.
14
+
15
+ - Updated dependencies [[`b72fca3`](https://github.com/gsoft-inc/wl-squide/commit/b72fca38385ddacbcd80376c9afd0c9485658d90)]:
16
+ - @squide/core@2.2.0
17
+
3
18
  ## 2.0.1
4
19
 
5
20
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { isMswStarted } from './chunk-JZCWIFHV.js';
1
+ import { isMswStarted } from './chunk-JLS7DBDX.js';
2
2
 
3
3
  // src/requestHandlerRegistry.ts
4
4
  var RequestHandlerRegistry = class {
@@ -9,8 +9,8 @@ var RequestHandlerRegistry = class {
9
9
  }
10
10
  this.#handlers.push(...handlers);
11
11
  }
12
- // Must specify the return type, otherwise we get the following error:
13
- // TS2742: The inferred type of 'handlers' cannot be named without a reference to X. This is likely not portable. A type annotation is necessary.
12
+ // Must specify the return type, otherwise we get a TS2742: The inferred type cannot be named without a reference to X. This is likely not portable.
13
+ // A type annotation is necessary.
14
14
  get handlers() {
15
15
  return this.#handlers;
16
16
  }
@@ -1,4 +1,4 @@
1
- import { RequestHandlerRegistry } from './chunk-2T6CVU4B.js';
1
+ import { RequestHandlerRegistry } from './chunk-2J7GQPWR.js';
2
2
  import { Plugin } from '@squide/core';
3
3
 
4
4
  var MswPlugin = class _MswPlugin extends Plugin {
@@ -6,5 +6,8 @@ function setMswAsStarted() {
6
6
  function isMswStarted() {
7
7
  return isStarted;
8
8
  }
9
+ function __resetMswStatus() {
10
+ isStarted = false;
11
+ }
9
12
 
10
- export { isMswStarted, setMswAsStarted };
13
+ export { __resetMswStatus, isMswStarted, setMswAsStarted };
@@ -1,4 +1,4 @@
1
- import { isMswStarted } from './chunk-JZCWIFHV.js';
1
+ import { isMswStarted } from './chunk-JLS7DBDX.js';
2
2
  import { useLogger } from '@squide/core';
3
3
  import { useState, useEffect } from 'react';
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { MswPlugin, getMswPlugin } from './mswPlugin.js';
2
2
  export { RequestHandlerRegistry } from './requestHandlerRegistry.js';
3
- export { isMswStarted, setMswAsStarted } from './setMswAsStarted.js';
4
- export { UseIsMswStartedOptions, useIsMswStarted } from './useIsMswReady.js';
3
+ export { __resetMswStatus, isMswStarted, setMswAsStarted } from './setMswAsStarted.js';
4
+ export { UseIsMswStartedOptions, useIsMswStarted } from './useIsMswStarted.js';
5
5
  import '@squide/core';
6
6
  import 'msw';
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { MswPlugin, getMswPlugin } from './chunk-UYITHRH3.js';
2
- export { RequestHandlerRegistry } from './chunk-2T6CVU4B.js';
3
- export { useIsMswStarted } from './chunk-KIQ5XSM7.js';
4
- export { isMswStarted, setMswAsStarted } from './chunk-JZCWIFHV.js';
1
+ export { MswPlugin, getMswPlugin } from './chunk-D2TOUDBN.js';
2
+ export { RequestHandlerRegistry } from './chunk-2J7GQPWR.js';
3
+ export { useIsMswStarted } from './chunk-P5ONHQEP.js';
4
+ export { __resetMswStatus, isMswStarted, setMswAsStarted } from './chunk-JLS7DBDX.js';
@@ -1,11 +1,11 @@
1
1
  import { Plugin, AbstractRuntime } from '@squide/core';
2
- import { RestHandler } from 'msw';
2
+ import { RequestHandler } from 'msw';
3
3
 
4
4
  declare class MswPlugin extends Plugin {
5
5
  #private;
6
6
  constructor();
7
- registerRequestHandlers(handlers: RestHandler[]): void;
8
- get requestHandlers(): RestHandler[];
7
+ registerRequestHandlers(handlers: RequestHandler[]): void;
8
+ get requestHandlers(): RequestHandler[];
9
9
  }
10
10
  declare function getMswPlugin(runtime: AbstractRuntime): MswPlugin;
11
11
 
package/dist/mswPlugin.js CHANGED
@@ -1,3 +1,3 @@
1
- export { MswPlugin, getMswPlugin } from './chunk-UYITHRH3.js';
2
- import './chunk-2T6CVU4B.js';
3
- import './chunk-JZCWIFHV.js';
1
+ export { MswPlugin, getMswPlugin } from './chunk-D2TOUDBN.js';
2
+ import './chunk-2J7GQPWR.js';
3
+ import './chunk-JLS7DBDX.js';
@@ -1,9 +1,9 @@
1
- import { RestHandler } from 'msw';
1
+ import { RequestHandler } from 'msw';
2
2
 
3
3
  declare class RequestHandlerRegistry {
4
4
  #private;
5
- add(handlers: RestHandler[]): void;
6
- get handlers(): RestHandler[];
5
+ add(handlers: RequestHandler[]): void;
6
+ get handlers(): RequestHandler[];
7
7
  }
8
8
 
9
9
  export { RequestHandlerRegistry };
@@ -1,2 +1,2 @@
1
- export { RequestHandlerRegistry } from './chunk-2T6CVU4B.js';
2
- import './chunk-JZCWIFHV.js';
1
+ export { RequestHandlerRegistry } from './chunk-2J7GQPWR.js';
2
+ import './chunk-JLS7DBDX.js';
@@ -1,4 +1,5 @@
1
1
  declare function setMswAsStarted(): void;
2
2
  declare function isMswStarted(): boolean;
3
+ declare function __resetMswStatus(): void;
3
4
 
4
- export { isMswStarted, setMswAsStarted };
5
+ export { __resetMswStatus, isMswStarted, setMswAsStarted };
@@ -1 +1 @@
1
- export { isMswStarted, setMswAsStarted } from './chunk-JZCWIFHV.js';
1
+ export { __resetMswStatus, isMswStarted, setMswAsStarted } from './chunk-JLS7DBDX.js';
@@ -0,0 +1,2 @@
1
+ export { useIsMswStarted } from './chunk-P5ONHQEP.js';
2
+ import './chunk-JLS7DBDX.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@squide/msw",
3
3
  "author": "Workleap",
4
- "version": "2.0.1",
4
+ "version": "2.0.3",
5
5
  "description": "Add support for MSW to @squide federated application shell.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -31,22 +31,27 @@
31
31
  "react": "*",
32
32
  "react-dom": "*"
33
33
  },
34
+ "peerDependenciesMeta": {
35
+ "msw": {
36
+ "optional": true
37
+ }
38
+ },
34
39
  "devDependencies": {
35
- "@types/jest": "29.5.5",
36
- "@types/react": "18.2.28",
37
- "@types/react-dom": "18.2.13",
40
+ "@types/jest": "29.5.7",
41
+ "@types/react": "18.2.36",
42
+ "@types/react-dom": "18.2.14",
38
43
  "@workleap/eslint-plugin": "3.0.0",
39
44
  "@workleap/tsup-configs": "3.0.1",
40
45
  "@workleap/typescript-configs": "3.0.2",
41
46
  "jest": "29.7.0",
42
- "msw": "1.3.2",
47
+ "msw": "2.0.3",
43
48
  "react": "18.2.0",
44
49
  "react-dom": "18.2.0",
45
50
  "tsup": "7.2.0",
46
51
  "typescript": "5.2.2"
47
52
  },
48
53
  "dependencies": {
49
- "@squide/core": "2.1.0"
54
+ "@squide/core": "2.2.0"
50
55
  },
51
56
  "sideEffects": false,
52
57
  "engines": {
@@ -1,2 +0,0 @@
1
- export { useIsMswStarted } from './chunk-KIQ5XSM7.js';
2
- import './chunk-JZCWIFHV.js';