@module-federation/bridge-react-webpack-plugin 0.7.3 → 0.7.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/CHANGELOG.md +13 -0
- package/dist/index.cjs.js +19 -5
- package/dist/index.es.js +19 -5
- package/package.json +2 -2
- package/src/utis.ts +21 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @module-federation/bridge-react-webpack-plugin
|
|
2
2
|
|
|
3
|
+
## 0.7.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0309fb5: fix: wrap try catch with react-router-dom path resolve
|
|
8
|
+
- @module-federation/sdk@0.7.5
|
|
9
|
+
|
|
10
|
+
## 0.7.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- @module-federation/sdk@0.7.4
|
|
15
|
+
|
|
3
16
|
## 0.7.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -1695,11 +1695,25 @@ const setRouterAlias = (majorVersion, reactRouterDomPath) => {
|
|
|
1695
1695
|
};
|
|
1696
1696
|
const getBridgeRouterAlias = (originalAlias) => {
|
|
1697
1697
|
const userDependencies = getDependencies();
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1698
|
+
let reactRouterDomPath = "";
|
|
1699
|
+
if (originalAlias) {
|
|
1700
|
+
reactRouterDomPath = originalAlias;
|
|
1701
|
+
} else if (userDependencies["react-router-dom"]) {
|
|
1702
|
+
try {
|
|
1703
|
+
reactRouterDomPath = path.resolve(
|
|
1704
|
+
process.cwd(),
|
|
1705
|
+
"node_modules/react-router-dom"
|
|
1706
|
+
);
|
|
1707
|
+
} catch (error) {
|
|
1708
|
+
console.log(error);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
if (reactRouterDomPath) {
|
|
1712
|
+
const packageJsonPath = findPackageJson(reactRouterDomPath) || "";
|
|
1713
|
+
const packageJsonContent = JSON.parse(
|
|
1714
|
+
fs.readFileSync(packageJsonPath, "utf-8")
|
|
1715
|
+
);
|
|
1716
|
+
const majorVersion = checkVersion(packageJsonContent.version);
|
|
1703
1717
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
1704
1718
|
console.log(
|
|
1705
1719
|
"<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>",
|
package/dist/index.es.js
CHANGED
|
@@ -1673,11 +1673,25 @@ const setRouterAlias = (majorVersion, reactRouterDomPath) => {
|
|
|
1673
1673
|
};
|
|
1674
1674
|
const getBridgeRouterAlias = (originalAlias) => {
|
|
1675
1675
|
const userDependencies = getDependencies();
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1676
|
+
let reactRouterDomPath = "";
|
|
1677
|
+
if (originalAlias) {
|
|
1678
|
+
reactRouterDomPath = originalAlias;
|
|
1679
|
+
} else if (userDependencies["react-router-dom"]) {
|
|
1680
|
+
try {
|
|
1681
|
+
reactRouterDomPath = path.resolve(
|
|
1682
|
+
process.cwd(),
|
|
1683
|
+
"node_modules/react-router-dom"
|
|
1684
|
+
);
|
|
1685
|
+
} catch (error) {
|
|
1686
|
+
console.log(error);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
if (reactRouterDomPath) {
|
|
1690
|
+
const packageJsonPath = findPackageJson(reactRouterDomPath) || "";
|
|
1691
|
+
const packageJsonContent = JSON.parse(
|
|
1692
|
+
fs.readFileSync(packageJsonPath, "utf-8")
|
|
1693
|
+
);
|
|
1694
|
+
const majorVersion = checkVersion(packageJsonContent.version);
|
|
1681
1695
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
1682
1696
|
console.log(
|
|
1683
1697
|
"<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/bridge-react-webpack-plugin",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"semver": "7.6.3",
|
|
27
27
|
"@types/semver": "7.5.8",
|
|
28
|
-
"@module-federation/sdk": "0.7.
|
|
28
|
+
"@module-federation/sdk": "0.7.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.2.2",
|
package/src/utis.ts
CHANGED
|
@@ -87,18 +87,28 @@ export const getBridgeRouterAlias = (
|
|
|
87
87
|
originalAlias: string,
|
|
88
88
|
): Record<string, string> => {
|
|
89
89
|
const userDependencies = getDependencies();
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
let reactRouterDomPath = '';
|
|
91
|
+
|
|
92
|
+
if (originalAlias) {
|
|
93
|
+
reactRouterDomPath = originalAlias;
|
|
94
|
+
} else if (userDependencies['react-router-dom']) {
|
|
95
|
+
try {
|
|
96
|
+
reactRouterDomPath = path.resolve(
|
|
97
|
+
process.cwd(),
|
|
98
|
+
'node_modules/react-router-dom',
|
|
99
|
+
);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.log(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
98
105
|
// if find react-router-dom in package.json
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
const
|
|
106
|
+
if (reactRouterDomPath) {
|
|
107
|
+
const packageJsonPath = findPackageJson(reactRouterDomPath) || '';
|
|
108
|
+
const packageJsonContent = JSON.parse(
|
|
109
|
+
fs.readFileSync(packageJsonPath, 'utf-8'),
|
|
110
|
+
);
|
|
111
|
+
const majorVersion = checkVersion(packageJsonContent.version);
|
|
102
112
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
103
113
|
console.log(
|
|
104
114
|
'<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>',
|