@squide/firefly 1.0.1 → 2.0.0
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 +18 -0
- package/dist/AppRouter.js +1 -1
- package/dist/chunk-6R4K3V6F.js +26 -0
- package/dist/{chunk-KR6KTAOB.js → chunk-GSHD4LQA.js} +2 -1
- package/dist/defineConfig.d.ts +11 -0
- package/dist/defineConfig.js +42 -0
- package/dist/fireflyRuntime.d.ts +12 -0
- package/dist/fireflyRuntime.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -1
- package/package.json +23 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @squide/firefly
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#112](https://github.com/gsoft-inc/wl-squide/pull/112) [`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Added a new `FireflyRuntime` class. This class should be used by all consumer applications rather than the previous `Runtime` class from `@squide/react-router`.
|
|
8
|
+
- The `FireflyRuntime` class has a `registerRequestHandlers` function and a `requestHandlers` getter. Consumer applications should use these instead of the `MSwPlugin`.
|
|
9
|
+
- Added a new layer of define functions (`defineDevHostConfig`, `defineBuildHostConfig`, `defineDevRemoteModuleConfig`, `defineBuildRemoteModuleConfig`). These functions should be used by all consumer applications rather than the previous define functions from `@squide/wbepack-module-federation`.
|
|
10
|
+
- Forward every exports from `@squide/core`, `@squide/react-router`, `@squide/webpack-module-federation`, `@squide/webpack-configs` and `@squide/msw`. Consumer applications should now import everything from `@squide/firefly` except the fakes implementations that should still be imported from `@squide/fakes`.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [[`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11), [`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11), [`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11), [`a9dda1c`](https://github.com/gsoft-inc/wl-squide/commit/a9dda1c3b010f616556fc3313c1934e20a26bc11)]:
|
|
15
|
+
- @squide/webpack-configs@1.0.0
|
|
16
|
+
- @squide/webpack-module-federation@3.0.0
|
|
17
|
+
- @squide/core@3.0.0
|
|
18
|
+
- @squide/react-router@3.0.0
|
|
19
|
+
- @squide/msw@2.0.4
|
|
20
|
+
|
|
3
21
|
## 1.0.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/AppRouter.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { AppRouter, BootstrappingRoute } from './chunk-
|
|
1
|
+
export { AppRouter, BootstrappingRoute } from './chunk-GSHD4LQA.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MswPlugin } from '@squide/msw';
|
|
2
|
+
import { ReactRouterRuntime } from '@squide/react-router';
|
|
3
|
+
|
|
4
|
+
// src/fireflyRuntime.tsx
|
|
5
|
+
var FireflyRuntime = class extends ReactRouterRuntime {
|
|
6
|
+
#mswPlugin;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
const mswPlugin = new MswPlugin();
|
|
9
|
+
super({
|
|
10
|
+
...options,
|
|
11
|
+
plugins: [
|
|
12
|
+
...options.plugins ?? [],
|
|
13
|
+
mswPlugin
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
this.#mswPlugin = mswPlugin;
|
|
17
|
+
}
|
|
18
|
+
registerRequestHandlers(handlers) {
|
|
19
|
+
this.#mswPlugin.registerRequestHandlers(handlers);
|
|
20
|
+
}
|
|
21
|
+
get requestHandlers() {
|
|
22
|
+
return this.#mswPlugin.requestHandlers;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { FireflyRuntime };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useLogger } from '@squide/core';
|
|
1
2
|
import { useIsMswStarted } from '@squide/msw';
|
|
2
|
-
import {
|
|
3
|
+
import { useIsRouteMatchProtected, useRoutes } from '@squide/react-router';
|
|
3
4
|
import { useAreModulesRegistered, useAreModulesReady } from '@squide/webpack-module-federation';
|
|
4
5
|
import { useState, useEffect, useCallback, cloneElement, useMemo } from 'react';
|
|
5
6
|
import { useErrorBoundary, ErrorBoundary } from 'react-error-boundary';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DefineDevHostConfigOptions, DefineBuildHostConfigOptions, DefineDevRemoteModuleConfigOptions, DefineBuildRemoteModuleConfigOptions } from '@squide/webpack-configs';
|
|
2
|
+
export { DefineBuildHostConfigOptions, DefineBuildRemoteModuleConfigOptions, DefineDevHostConfigOptions, DefineDevRemoteModuleConfigOptions, DefineHostModuleFederationPluginOptions, DefineRemoteModuleFederationPluginOptions, Features, ModuleFederationPluginOptions, Router, defineRemoteModuleFederationPluginOptions } from '@squide/webpack-configs';
|
|
3
|
+
import { SwcConfig } from '@workleap/swc-configs';
|
|
4
|
+
import webpack from 'webpack';
|
|
5
|
+
|
|
6
|
+
declare function defineDevHostConfig(swcConfig: SwcConfig, applicationName: string, port: number, options?: Omit<DefineDevHostConfigOptions, "features">): webpack.Configuration;
|
|
7
|
+
declare function defineBuildHostConfig(swcConfig: SwcConfig, applicationName: string, options?: Omit<DefineBuildHostConfigOptions, "features">): webpack.Configuration;
|
|
8
|
+
declare function defineDevRemoteModuleConfig(swcConfig: SwcConfig, applicationName: string, port: number, options?: Omit<DefineDevRemoteModuleConfigOptions, "features">): webpack.Configuration;
|
|
9
|
+
declare function defineBuildRemoteModuleConfig(swcConfig: SwcConfig, applicationName: string, options?: Omit<DefineBuildRemoteModuleConfigOptions, "features">): webpack.Configuration;
|
|
10
|
+
|
|
11
|
+
export { defineBuildHostConfig, defineBuildRemoteModuleConfig, defineDevHostConfig, defineDevRemoteModuleConfig };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineDevHostConfig as defineDevHostConfig$1, defineBuildHostConfig as defineBuildHostConfig$1, defineDevRemoteModuleConfig as defineDevRemoteModuleConfig$1, defineBuildRemoteModuleConfig as defineBuildRemoteModuleConfig$1 } from '@squide/webpack-configs';
|
|
2
|
+
export { defineRemoteModuleFederationPluginOptions } from '@squide/webpack-configs';
|
|
3
|
+
|
|
4
|
+
// src/defineConfig.ts
|
|
5
|
+
function defineDevHostConfig(swcConfig, applicationName, port, options = {}) {
|
|
6
|
+
return defineDevHostConfig$1(swcConfig, applicationName, port, {
|
|
7
|
+
...options,
|
|
8
|
+
features: {
|
|
9
|
+
router: "react-router",
|
|
10
|
+
msw: true
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function defineBuildHostConfig(swcConfig, applicationName, options = {}) {
|
|
15
|
+
return defineBuildHostConfig$1(swcConfig, applicationName, {
|
|
16
|
+
...options,
|
|
17
|
+
features: {
|
|
18
|
+
router: "react-router",
|
|
19
|
+
msw: true
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function defineDevRemoteModuleConfig(swcConfig, applicationName, port, options = {}) {
|
|
24
|
+
return defineDevRemoteModuleConfig$1(swcConfig, applicationName, port, {
|
|
25
|
+
...options,
|
|
26
|
+
features: {
|
|
27
|
+
router: "react-router",
|
|
28
|
+
msw: true
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function defineBuildRemoteModuleConfig(swcConfig, applicationName, options = {}) {
|
|
33
|
+
return defineBuildRemoteModuleConfig$1(swcConfig, applicationName, {
|
|
34
|
+
...options,
|
|
35
|
+
features: {
|
|
36
|
+
router: "react-router",
|
|
37
|
+
msw: true
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { defineBuildHostConfig, defineBuildRemoteModuleConfig, defineDevHostConfig, defineDevRemoteModuleConfig };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RuntimeOptions } from '@squide/core';
|
|
2
|
+
import { ReactRouterRuntime } from '@squide/react-router';
|
|
3
|
+
import { RequestHandler } from 'msw';
|
|
4
|
+
|
|
5
|
+
declare class FireflyRuntime extends ReactRouterRuntime {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(options?: RuntimeOptions);
|
|
8
|
+
registerRequestHandlers(handlers: RequestHandler[]): void;
|
|
9
|
+
get requestHandlers(): RequestHandler[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { FireflyRuntime };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FireflyRuntime } from './chunk-6R4K3V6F.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
export * from '@squide/core';
|
|
2
|
+
export * from '@squide/msw';
|
|
3
|
+
export * from '@squide/react-router';
|
|
4
|
+
export * from '@squide/webpack-module-federation';
|
|
1
5
|
export { AppRouter, AppRouterProps, BootstrappingRoute, OnCompleteRegistrationsFunction, OnLoadProtectedDataFunction, OnLoadPublicDataFunction } from './AppRouter.js';
|
|
6
|
+
export { FireflyRuntime } from './fireflyRuntime.js';
|
|
2
7
|
import 'react/jsx-runtime';
|
|
3
8
|
import 'react';
|
|
4
9
|
import 'react-router-dom';
|
|
10
|
+
import 'msw';
|
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
export { AppRouter, BootstrappingRoute } from './chunk-
|
|
1
|
+
export { AppRouter, BootstrappingRoute } from './chunk-GSHD4LQA.js';
|
|
2
|
+
export { FireflyRuntime } from './chunk-6R4K3V6F.js';
|
|
3
|
+
export * from '@squide/core';
|
|
4
|
+
export * from '@squide/msw';
|
|
5
|
+
export * from '@squide/react-router';
|
|
6
|
+
export * from '@squide/webpack-module-federation';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@squide/firefly",
|
|
3
3
|
"author": "Workleap",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"description": "Helpers to facilitate the creation of a shell package with Squide firefly technology stack.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./dist/index.js",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./defineConfig.js": {
|
|
24
|
+
"import": "./dist/defineConfig.js",
|
|
25
|
+
"types": "./dist/defineConfig.d.ts",
|
|
26
|
+
"default": "./dist/defineConfig.js"
|
|
22
27
|
}
|
|
23
28
|
},
|
|
24
29
|
"files": [
|
|
@@ -27,15 +32,23 @@
|
|
|
27
32
|
"README.md"
|
|
28
33
|
],
|
|
29
34
|
"peerDependencies": {
|
|
35
|
+
"@squide/webpack-configs": "*",
|
|
30
36
|
"msw": "*",
|
|
31
37
|
"react": "*",
|
|
32
38
|
"react-dom": "*",
|
|
33
39
|
"react-error-boundary": "*",
|
|
34
|
-
"react-router-dom": "*"
|
|
40
|
+
"react-router-dom": "*",
|
|
41
|
+
"webpack": ">=5.0.0"
|
|
35
42
|
},
|
|
36
43
|
"peerDependenciesMeta": {
|
|
44
|
+
"@squide/webpack-configs": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
37
47
|
"msw": {
|
|
38
48
|
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"webpack": {
|
|
51
|
+
"optional": true
|
|
39
52
|
}
|
|
40
53
|
},
|
|
41
54
|
"devDependencies": {
|
|
@@ -51,6 +64,7 @@
|
|
|
51
64
|
"@workleap/swc-configs": "2.1.2",
|
|
52
65
|
"@workleap/tsup-configs": "3.0.1",
|
|
53
66
|
"@workleap/typescript-configs": "3.0.2",
|
|
67
|
+
"@workleap/webpack-configs": "1.2.1",
|
|
54
68
|
"jest": "29.7.0",
|
|
55
69
|
"jest-environment-jsdom": "29.7.0",
|
|
56
70
|
"msw": "2.0.3",
|
|
@@ -60,12 +74,15 @@
|
|
|
60
74
|
"react-router-dom": "6.18.0",
|
|
61
75
|
"ts-jest": "29.1.1",
|
|
62
76
|
"tsup": "7.2.0",
|
|
63
|
-
"typescript": "5.2.2"
|
|
77
|
+
"typescript": "5.2.2",
|
|
78
|
+
"webpack": "5.89.0",
|
|
79
|
+
"@squide/webpack-configs": "1.0.0"
|
|
64
80
|
},
|
|
65
81
|
"dependencies": {
|
|
66
|
-
"@squide/
|
|
67
|
-
"@squide/
|
|
68
|
-
"@squide/
|
|
82
|
+
"@squide/core": "3.0.0",
|
|
83
|
+
"@squide/msw": "2.0.4",
|
|
84
|
+
"@squide/react-router": "3.0.0",
|
|
85
|
+
"@squide/webpack-module-federation": "3.0.0"
|
|
69
86
|
},
|
|
70
87
|
"sideEffects": false,
|
|
71
88
|
"engines": {
|