@squide/msw 3.2.8 → 3.2.9
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,14 @@
|
|
|
1
1
|
# @squide/msw
|
|
2
2
|
|
|
3
|
+
## 3.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#289](https://github.com/workleap/wl-squide/pull/289) [`ee6f7d5`](https://github.com/workleap/wl-squide/commit/ee6f7d52ff6afa8ac757770c89b39978c40a70bc) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fixed Honeycomb telemetry traces when data fetching fails and bumped dependencies versions.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`ee6f7d5`](https://github.com/workleap/wl-squide/commit/ee6f7d52ff6afa8ac757770c89b39978c40a70bc)]:
|
|
10
|
+
- @squide/core@5.4.9
|
|
11
|
+
|
|
3
12
|
## 3.2.8
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/mswPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Plugin, isNil } from "@squide/core";
|
|
2
|
+
import { RequestHandlerRegistry } from "./requestHandlerRegistry.js";
|
|
3
3
|
|
|
4
4
|
;// CONCATENATED MODULE: external "@squide/core"
|
|
5
5
|
|
|
@@ -9,8 +9,8 @@ import * as __WEBPACK_EXTERNAL_MODULE__requestHandlerRegistry_js_564606de__ from
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
const MswPluginName = "msw-plugin";
|
|
12
|
-
class MswPlugin extends
|
|
13
|
-
#requestHandlerRegistry = new
|
|
12
|
+
class MswPlugin extends Plugin {
|
|
13
|
+
#requestHandlerRegistry = new RequestHandlerRegistry();
|
|
14
14
|
constructor(runtime){
|
|
15
15
|
super(MswPluginName, runtime);
|
|
16
16
|
}
|
|
@@ -24,7 +24,7 @@ class MswPlugin extends __WEBPACK_EXTERNAL_MODULE__squide_core_7a405b8f__.Plugin
|
|
|
24
24
|
}
|
|
25
25
|
function getMswPlugin(runtime) {
|
|
26
26
|
const plugin = runtime.getPlugin(MswPluginName);
|
|
27
|
-
if (
|
|
27
|
+
if (isNil(plugin)) {
|
|
28
28
|
throw new Error("[squide] The getMswPlugin function is called but no MswPlugin instance has been registered with the runtime.");
|
|
29
29
|
}
|
|
30
30
|
return plugin;
|
package/dist/mswPlugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mswPlugin.js","sources":["webpack://@squide/msw/./src/mswPlugin.ts"],"sourcesContent":["import { Plugin, isNil, type Runtime } from \"@squide/core\";\nimport type { RequestHandler } from \"msw\";\nimport { RequestHandlerRegistry } from \"./requestHandlerRegistry.ts\";\n\nexport const MswPluginName = \"msw-plugin\";\n\nexport class MswPlugin extends Plugin {\n readonly #requestHandlerRegistry = new RequestHandlerRegistry();\n\n constructor(runtime: Runtime) {\n super(MswPluginName, runtime);\n }\n\n registerRequestHandlers(handlers: RequestHandler[]) {\n this.#requestHandlerRegistry.add(handlers);\n\n this._runtime.logger.debug(\"[squide] The following MSW request handlers has been registered: \", handlers);\n }\n\n get requestHandlers(): RequestHandler[] {\n return this.#requestHandlerRegistry.handlers;\n }\n}\n\nexport function getMswPlugin(runtime: Runtime) {\n const plugin = runtime.getPlugin(MswPluginName);\n\n if (isNil(plugin)) {\n throw new Error(\"[squide] The getMswPlugin function is called but no MswPlugin instance has been registered with the runtime.\");\n }\n\n return plugin as MswPlugin;\n}\n"],"names":["Plugin","isNil","RequestHandlerRegistry","MswPluginName","MswPlugin","runtime","handlers","getMswPlugin","plugin","Error"],"mappings":";;;;;;;;AAA2D;AAEU;AAE9D,MAAMG,gBAAgB,aAAa;AAEnC,MAAMC,kBAAkBJ,
|
|
1
|
+
{"version":3,"file":"mswPlugin.js","sources":["webpack://@squide/msw/./src/mswPlugin.ts"],"sourcesContent":["import { Plugin, isNil, type Runtime } from \"@squide/core\";\nimport type { RequestHandler } from \"msw\";\nimport { RequestHandlerRegistry } from \"./requestHandlerRegistry.ts\";\n\nexport const MswPluginName = \"msw-plugin\";\n\nexport class MswPlugin extends Plugin {\n readonly #requestHandlerRegistry = new RequestHandlerRegistry();\n\n constructor(runtime: Runtime) {\n super(MswPluginName, runtime);\n }\n\n registerRequestHandlers(handlers: RequestHandler[]) {\n this.#requestHandlerRegistry.add(handlers);\n\n this._runtime.logger.debug(\"[squide] The following MSW request handlers has been registered: \", handlers);\n }\n\n get requestHandlers(): RequestHandler[] {\n return this.#requestHandlerRegistry.handlers;\n }\n}\n\nexport function getMswPlugin(runtime: Runtime) {\n const plugin = runtime.getPlugin(MswPluginName);\n\n if (isNil(plugin)) {\n throw new Error(\"[squide] The getMswPlugin function is called but no MswPlugin instance has been registered with the runtime.\");\n }\n\n return plugin as MswPlugin;\n}\n"],"names":["Plugin","isNil","RequestHandlerRegistry","MswPluginName","MswPlugin","runtime","handlers","getMswPlugin","plugin","Error"],"mappings":";;;;;;;;AAA2D;AAEU;AAE9D,MAAMG,gBAAgB,aAAa;AAEnC,MAAMC,kBAAkBJ,MAAMA;IACxB,uBAAuB,GAAG,IAAIE,sBAAsBA,GAAG;IAEhE,YAAYG,OAAgB,CAAE;QAC1B,KAAK,CAACF,eAAeE;IACzB;IAEA,wBAAwBC,QAA0B,EAAE;QAChD,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAACA;QAEjC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,qEAAqEA;IACpG;IAEA,IAAI,kBAAoC;QACpC,OAAO,IAAI,CAAC,uBAAuB,CAAC,QAAQ;IAChD;AACJ;AAEO,SAASC,aAAaF,OAAgB;IACzC,MAAMG,SAASH,QAAQ,SAAS,CAACF;IAEjC,IAAIF,KAAKA,CAACO,SAAS;QACf,MAAM,IAAIC,MAAM;IACpB;IAEA,OAAOD;AACX"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isMswReady } from "./mswState.js";
|
|
2
2
|
|
|
3
3
|
;// CONCATENATED MODULE: external "./mswState.js"
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__mswState_js_15009c7d__ from "./mswState.j
|
|
|
7
7
|
class RequestHandlerRegistry {
|
|
8
8
|
#handlers = [];
|
|
9
9
|
add(handlers) {
|
|
10
|
-
if (
|
|
10
|
+
if (isMswReady()) {
|
|
11
11
|
throw new Error("[squide] MSW request handlers cannot be registered once MSW is started. Did you defer the registration of a MSW request handler?");
|
|
12
12
|
}
|
|
13
13
|
this.#handlers.push(...handlers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestHandlerRegistry.js","sources":["webpack://@squide/msw/./src/requestHandlerRegistry.ts"],"sourcesContent":["import type { RequestHandler } from \"msw\";\nimport { isMswReady } from \"./mswState.ts\";\n\nexport class RequestHandlerRegistry {\n readonly #handlers: RequestHandler[] = [];\n\n add(handlers: RequestHandler[]) {\n if (isMswReady()) {\n throw new Error(\"[squide] MSW request handlers cannot be registered once MSW is started. Did you defer the registration of a MSW request handler?\");\n }\n\n this.#handlers.push(...handlers);\n }\n\n // 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.\n // A type annotation is necessary.\n get handlers(): RequestHandler[] {\n return this.#handlers;\n }\n}\n\n"],"names":["isMswReady","RequestHandlerRegistry","handlers","Error"],"mappings":";;;;;AAC2C;AAEpC,MAAMC;IACA,SAAS,GAAqB,EAAE,CAAC;IAE1C,IAAIC,QAA0B,EAAE;QAC5B,IAAIF,
|
|
1
|
+
{"version":3,"file":"requestHandlerRegistry.js","sources":["webpack://@squide/msw/./src/requestHandlerRegistry.ts"],"sourcesContent":["import type { RequestHandler } from \"msw\";\nimport { isMswReady } from \"./mswState.ts\";\n\nexport class RequestHandlerRegistry {\n readonly #handlers: RequestHandler[] = [];\n\n add(handlers: RequestHandler[]) {\n if (isMswReady()) {\n throw new Error(\"[squide] MSW request handlers cannot be registered once MSW is started. Did you defer the registration of a MSW request handler?\");\n }\n\n this.#handlers.push(...handlers);\n }\n\n // 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.\n // A type annotation is necessary.\n get handlers(): RequestHandler[] {\n return this.#handlers;\n }\n}\n\n"],"names":["isMswReady","RequestHandlerRegistry","handlers","Error"],"mappings":";;;;;AAC2C;AAEpC,MAAMC;IACA,SAAS,GAAqB,EAAE,CAAC;IAE1C,IAAIC,QAA0B,EAAE;QAC5B,IAAIF,UAAUA,IAAI;YACd,MAAM,IAAIG,MAAM;QACpB;QAEA,IAAI,CAAC,SAAS,CAAC,IAAI,IAAID;IAC3B;IAEA,oJAAoJ;IACpJ,kCAAkC;IAClC,IAAI,WAA6B;QAC7B,OAAO,IAAI,CAAC,SAAS;IACzB;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/msw",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "3.2.
|
|
4
|
+
"version": "3.2.9",
|
|
5
5
|
"description": "Add support for MSW to @squide application shell.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -28,15 +28,15 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"msw": "^2.
|
|
31
|
+
"msw": "^2.10.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@squide/core": "5.4.
|
|
34
|
+
"@squide/core": "5.4.9"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@rsbuild/core": "1.
|
|
38
|
-
"@rslib/core": "0.
|
|
39
|
-
"@typescript-eslint/parser": "8.
|
|
37
|
+
"@rsbuild/core": "1.4.0",
|
|
38
|
+
"@rslib/core": "0.10.3",
|
|
39
|
+
"@typescript-eslint/parser": "8.35.0",
|
|
40
40
|
"@workleap/eslint-plugin": "3.4.2",
|
|
41
41
|
"@workleap/rslib-configs": "1.0.6",
|
|
42
42
|
"@workleap/typescript-configs": "3.0.4",
|