@module-federation/storybook-addon 3.0.3 → 3.0.5
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/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/storybook-addon",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"webpack-virtual-modules": "0.6.2"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@module-federation/utilities": "^3.1.
|
|
57
|
+
"@module-federation/utilities": "^3.1.25",
|
|
58
58
|
"@nx/react": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
59
59
|
"@nx/webpack": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
60
60
|
"@storybook/core-common": "^6.5.16 || ^7.0.0",
|
|
@@ -8,25 +8,27 @@ const node_fs_1 = __importDefault(require("node:fs"));
|
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
9
|
const rspack_1 = require("@module-federation/enhanced/rspack");
|
|
10
10
|
const sdk_1 = require("@module-federation/sdk");
|
|
11
|
+
const correctImportPath_1 = require("./correctImportPath");
|
|
11
12
|
// add bootstrap for host project
|
|
12
13
|
const bootstrapPath = node_path_1.default.resolve(process.cwd(), `node_modules/${sdk_1.TEMP_DIR}/storybook-bootstrap.js`);
|
|
13
|
-
const generateBootstrap = (entryPath) => {
|
|
14
|
-
return `import('${entryPath}')
|
|
14
|
+
const generateBootstrap = (context, entryPath) => {
|
|
15
|
+
return `import('${(0, correctImportPath_1.correctImportPath)(context, entryPath)}');`;
|
|
15
16
|
};
|
|
16
|
-
const writeBootstrap = (entryPath) => {
|
|
17
|
+
const writeBootstrap = (context, entryPath) => {
|
|
17
18
|
if (node_fs_1.default.existsSync(bootstrapPath)) {
|
|
18
19
|
node_fs_1.default.unlinkSync(bootstrapPath);
|
|
19
20
|
}
|
|
20
|
-
node_fs_1.default.writeFileSync(bootstrapPath, generateBootstrap(entryPath));
|
|
21
|
+
node_fs_1.default.writeFileSync(bootstrapPath, generateBootstrap(context, entryPath));
|
|
21
22
|
};
|
|
22
23
|
const withModuleFederation = async (rsbuildConfig, options) => {
|
|
23
24
|
rsbuildConfig.plugins ??= [];
|
|
24
25
|
rsbuildConfig.source ??= {};
|
|
25
26
|
rsbuildConfig.source.entry ??= {};
|
|
26
27
|
const entry = rsbuildConfig.source.entry;
|
|
28
|
+
const context = rsbuildConfig.root || process.cwd();
|
|
27
29
|
for (const entryName in entry) {
|
|
28
30
|
if (Array.isArray(entry[entryName])) {
|
|
29
|
-
writeBootstrap(entry[entryName][0]);
|
|
31
|
+
writeBootstrap(context, entry[entryName][0]);
|
|
30
32
|
entry[entryName] = [bootstrapPath];
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-module-federation-enhanced-rsbuild.js","sourceRoot":"","sources":["../../../src/utils/with-module-federation-enhanced-rsbuild.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,+DAA4E;AAC5E,gDAAkD;
|
|
1
|
+
{"version":3,"file":"with-module-federation-enhanced-rsbuild.js","sourceRoot":"","sources":["../../../src/utils/with-module-federation-enhanced-rsbuild.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAyB;AACzB,0DAA6B;AAC7B,+DAA4E;AAC5E,gDAAkD;AAElD,2DAAwD;AAKxD,iCAAiC;AACjC,MAAM,aAAa,GAAG,mBAAI,CAAC,OAAO,CAChC,OAAO,CAAC,GAAG,EAAE,EACb,gBAAgB,cAAQ,yBAAyB,CAClD,CAAC;AACF,MAAM,iBAAiB,GAAG,CAAC,OA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BACzD,MAAM,QAAQ,GAAkB;oBAC9B,GAAG,EAAE;wBACH,wFAAwF;wBACxF,GAAG,EAAE,KAAK;qBACX;oBACD,KAAK,EAAE;wBACL,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;4BACjB,MAAM,CAAC,MAAM,KAAK,EAAE,CAAC;4BACrB,MAAM,CAAC,MAAM,CAAC,kBAAkB;gCAC9B,mCAAmC,CAAC;4BACtC,MAAM,CAAC,OAAO,EAAE,IAAI,CAClB,IAAI,+BAAsB,CAAC;gCACzB,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,mCAAmC;gCACzD,MAAM,EAAE;oCACN,KAAK,EAAE;wCACL,SAAS,EAAE,IAAI;qCAChB;oCACD,WAAW,EAAE;wCACX,SAAS,EAAE,IAAI;qCAChB;oCACD,GAAG,OAAO,CAAC,MAAM;iCAClB;gCACD,OAAO,EAAE;oCACP,GAAG,OAAO,CAAC,OAAO;iCACnB;gCACD,aAAa,EAAE,OAAO,CAAC,aAAa;6BACrC,CAAC,CACH,CAAC;4BACF,OAAO,MAAM,CAAC;wBAChB,CAAC;qBACF;iBACF,CAAC;gBAEF,OAAO,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAC9C,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;IAEF,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC1C,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AA5DW,QAAA,oBAAoB,wBA4D/B;AAEF,kBAAe,4BAAoB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/storybook-addon",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
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",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@module-federation/enhanced": "0.7.
|
|
46
|
-
"@module-federation/sdk": "0.7.
|
|
45
|
+
"@module-federation/enhanced": "0.7.2",
|
|
46
|
+
"@module-federation/sdk": "0.7.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@rsbuild/core": "^1.0.19",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@storybook/node-logger": "7.6.20",
|
|
52
52
|
"webpack": "5.93.0",
|
|
53
53
|
"webpack-virtual-modules": "0.6.2",
|
|
54
|
-
"@module-federation/utilities": "3.1.
|
|
54
|
+
"@module-federation/utilities": "3.1.25"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@module-federation/utilities": "^3.1.
|
|
57
|
+
"@module-federation/utilities": "^3.1.25",
|
|
58
58
|
"@nx/react": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
59
59
|
"@nx/webpack": "~16.0.0 || ~17.0.0 || ~17.2.0",
|
|
60
60
|
"@storybook/core-common": "^6.5.16 || ^7.0.0",
|