@module-federation/storybook-addon 0.1.0 → 0.2.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
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [0.2.0](https://github.com/module-federation/nextjs-mf/compare/storybook-addon-0.1.0...storybook-addon-0.2.0) (2023-05-03)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `utils` updated to version `1.7.0`
|
|
10
|
+
* `utils` updated to version `1.7.0`
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **storybook-addon:** upgrade nx and refactor util `withModuleFederation` ([#829](https://github.com/module-federation/nextjs-mf/issues/829)) ([5eeab46](https://github.com/module-federation/nextjs-mf/commit/5eeab46861fa1e444b772cdd15ba5472414e5dd8))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
5
18
|
# 0.1.0 (2023-04-27)
|
|
6
19
|
|
|
7
20
|
### Dependency Updates
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/storybook-addon",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Storybook addon to consume remote module federated apps/components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/module-federation/universe/tree/main/packages/storybook-addon",
|
|
@@ -15,22 +15,23 @@
|
|
|
15
15
|
],
|
|
16
16
|
"author": "Fiodorov Andrei <hello@fyodorovandrei.com> (https://github.com/fyodorovandrei)",
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@module-federation/utilities": "1.
|
|
19
|
-
"@storybook/core-common": "^
|
|
20
|
-
"@storybook/node-logger": "^
|
|
18
|
+
"@module-federation/utilities": "1.7.0",
|
|
19
|
+
"@storybook/core-common": "^7.0.0",
|
|
20
|
+
"@storybook/node-logger": "^7.0.0",
|
|
21
21
|
"webpack": "^5.75.0",
|
|
22
22
|
"webpack-virtual-modules": "^0.5.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@module-federation/utilities": "1.
|
|
25
|
+
"@module-federation/utilities": "1.7.0",
|
|
26
26
|
"@storybook/core-common": "^6.5.16",
|
|
27
27
|
"@storybook/node-logger": "^6.5.16",
|
|
28
28
|
"webpack": "^5.75.0",
|
|
29
29
|
"webpack-virtual-modules": "^0.5.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nrwl/devkit": "
|
|
33
|
-
"
|
|
32
|
+
"@nrwl/devkit": "16.0.0",
|
|
33
|
+
"@nx/react": "16.0.0",
|
|
34
|
+
"next": "13.3.1",
|
|
34
35
|
"process": "0.11.10",
|
|
35
36
|
"react": "18.2.0",
|
|
36
37
|
"react-dom": "18.2.0"
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("@
|
|
4
|
-
const project_graph_1 = require("nx/src/project-graph/project-graph");
|
|
3
|
+
const utils_1 = require("@nx/react/src/module-federation/utils");
|
|
5
4
|
const webpack_1 = require("webpack");
|
|
6
5
|
const { ModuleFederationPlugin } = webpack_1.container;
|
|
7
|
-
function determineRemoteUrl(remote) {
|
|
8
|
-
const remoteConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(remote);
|
|
9
|
-
const serveTarget = remoteConfiguration?.targets?.['serve'];
|
|
10
|
-
if (!serveTarget) {
|
|
11
|
-
throw new Error(`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "serve" target.\n
|
|
12
|
-
You can also use the tuple syntax in your webpack config to configure your remotes. e.g. \`remotes: [['remote1', 'http://localhost:4201']]\``);
|
|
13
|
-
}
|
|
14
|
-
const host = serveTarget.options?.host ?? 'http://localhost';
|
|
15
|
-
const port = serveTarget.options?.port ?? 4201;
|
|
16
|
-
return `${host.endsWith('/') ? host.slice(0, -1) : host}:${port}/remoteEntry.js`;
|
|
17
|
-
}
|
|
18
6
|
const updateMappedRemotes = (remotes) => {
|
|
19
7
|
const newRemotes = {};
|
|
20
8
|
Object.keys(remotes).forEach((key) => {
|
|
@@ -23,7 +11,7 @@ const updateMappedRemotes = (remotes) => {
|
|
|
23
11
|
return newRemotes;
|
|
24
12
|
};
|
|
25
13
|
const withModuleFederation = async (options) => {
|
|
26
|
-
const { mappedRemotes, sharedDependencies } = await (0, utils_1.getModuleFederationConfig)(options
|
|
14
|
+
const { mappedRemotes, sharedDependencies } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
27
15
|
return (config) => {
|
|
28
16
|
config.experiments = { outputModule: false };
|
|
29
17
|
config.optimization = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation.js","sourceRoot":"","sources":["../../../../../packages/storybook-addon/src/utils/with-module-federation.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"with-module-federation.js","sourceRoot":"","sources":["../../../../../packages/storybook-addon/src/utils/with-module-federation.ts"],"names":[],"mappings":";;AAAA,iEAAkF;AAClF,qCAAmD;AAGnD,MAAM,EAAE,sBAAsB,EAAE,GAAG,mBAAS,CAAC;AAE7C,MAAM,mBAAmB,GAAG,CAAC,OAA+B,EAAE,EAAE;IAC9D,MAAM,UAAU,GAA2B,EAAE,CAAC;IAE9C,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnC,UAAU,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC;AAEF,MAAM,oB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