@module-federation/storybook-addon 0.0.0-next-20241029093536 → 0.0.0-next-20241030095049
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/README.md +34 -0
- package/dist/package.json +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -43,6 +43,40 @@ module.exports = storybookConfig;
|
|
|
43
43
|
|
|
44
44
|
---
|
|
45
45
|
|
|
46
|
+
### Rsbuild App or Rslib Module
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
import { dirname, join } from 'node:path';
|
|
50
|
+
import type { StorybookConfig } from 'storybook-react-rsbuild';
|
|
51
|
+
|
|
52
|
+
function getAbsolutePath(value: string): any {
|
|
53
|
+
return dirname(require.resolve(join(value, 'package.json')));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const config: StorybookConfig = {
|
|
57
|
+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
|
58
|
+
framework: {
|
|
59
|
+
name: getAbsolutePath('storybook-react-rsbuild'),
|
|
60
|
+
options: {},
|
|
61
|
+
},
|
|
62
|
+
addons: [
|
|
63
|
+
{
|
|
64
|
+
name: '@module-federation/storybook-addon/preset.js',
|
|
65
|
+
options: {
|
|
66
|
+
// add remote here and then you can load remote in your story
|
|
67
|
+
remotes: {
|
|
68
|
+
'rslib-module':
|
|
69
|
+
'rslib-module@http://localhost:3000/mf/mf-manifest.json',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default config;
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
|
|
46
80
|
### For the [NX](https://nx.dev/getting-started/intro) projects:
|
|
47
81
|
|
|
48
82
|
Replace NX utils `withModuleFederation` in `webpack.config.js` with our utils `withModuleFederation`.
|
package/dist/package.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@rsbuild/core": "^1.0.18"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@module-federation/utilities": "^3.1.
|
|
47
|
+
"@module-federation/utilities": "^3.1.20",
|
|
48
48
|
"@nx/react": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
49
49
|
"@nx/webpack": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
50
50
|
"@storybook/core-common": "^6.5.16 || ^7.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/storybook-addon",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20241030095049",
|
|
4
4
|
"description": "Storybook addon to consume remote module federated apps/components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/module-federation/core/tree/main/packages/storybook-addon",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"webpack": "5.93.0",
|
|
40
40
|
"webpack-virtual-modules": "0.6.2",
|
|
41
41
|
"@rsbuild/core": "^1.0.18",
|
|
42
|
-
"@module-federation/utilities": "0.0.0-next-
|
|
43
|
-
"@module-federation/
|
|
44
|
-
"@module-federation/
|
|
42
|
+
"@module-federation/utilities": "0.0.0-next-20241030095049",
|
|
43
|
+
"@module-federation/enhanced": "0.0.0-next-20241030095049",
|
|
44
|
+
"@module-federation/sdk": "0.0.0-next-20241030095049"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@module-federation/utilities": "0.0.0-next-
|
|
47
|
+
"@module-federation/utilities": "0.0.0-next-20241030095049",
|
|
48
48
|
"@nx/react": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
49
49
|
"@nx/webpack": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
50
50
|
"@storybook/core-common": "^6.5.16 || ^7.0.0",
|