@module-federation/bridge-react-webpack-plugin 0.0.0-next-20241118092546 → 0.0.0-next-20241118095355
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 +2 -3
- package/dist/index.cjs.js +5 -19
- package/dist/index.es.js +5 -19
- package/package.json +2 -2
- package/src/utis.ts +11 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# @module-federation/bridge-react-webpack-plugin
|
|
2
2
|
|
|
3
|
-
## 0.0.0-next-
|
|
3
|
+
## 0.0.0-next-20241118095355
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- @module-federation/sdk@0.0.0-next-20241118092546
|
|
7
|
+
- @module-federation/sdk@0.0.0-next-20241118095355
|
|
9
8
|
|
|
10
9
|
## 0.7.4
|
|
11
10
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -1695,25 +1695,11 @@ const setRouterAlias = (majorVersion, reactRouterDomPath) => {
|
|
|
1695
1695
|
};
|
|
1696
1696
|
const getBridgeRouterAlias = (originalAlias) => {
|
|
1697
1697
|
const userDependencies = getDependencies();
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
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);
|
|
1698
|
+
const reactRouterDomPath = originalAlias ? originalAlias : userDependencies["react-router-dom"] ? require.resolve("react-router-dom") : "";
|
|
1699
|
+
const packageJsonPath = reactRouterDomPath ? findPackageJson(reactRouterDomPath) : "";
|
|
1700
|
+
if (packageJsonPath) {
|
|
1701
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
1702
|
+
const majorVersion = checkVersion(packageJson.version);
|
|
1717
1703
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
1718
1704
|
console.log(
|
|
1719
1705
|
"<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>",
|
package/dist/index.es.js
CHANGED
|
@@ -1673,25 +1673,11 @@ const setRouterAlias = (majorVersion, reactRouterDomPath) => {
|
|
|
1673
1673
|
};
|
|
1674
1674
|
const getBridgeRouterAlias = (originalAlias) => {
|
|
1675
1675
|
const userDependencies = getDependencies();
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
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);
|
|
1676
|
+
const reactRouterDomPath = originalAlias ? originalAlias : userDependencies["react-router-dom"] ? require.resolve("react-router-dom") : "";
|
|
1677
|
+
const packageJsonPath = reactRouterDomPath ? findPackageJson(reactRouterDomPath) : "";
|
|
1678
|
+
if (packageJsonPath) {
|
|
1679
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
1680
|
+
const majorVersion = checkVersion(packageJson.version);
|
|
1695
1681
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
1696
1682
|
console.log(
|
|
1697
1683
|
"<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@module-federation/bridge-react-webpack-plugin",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20241118095355",
|
|
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.0.0-next-
|
|
28
|
+
"@module-federation/sdk": "0.0.0-next-20241118095355"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.2.2",
|
package/src/utis.ts
CHANGED
|
@@ -87,28 +87,18 @@ 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
|
-
|
|
98
|
-
'node_modules/react-router-dom',
|
|
99
|
-
);
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.log(error);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
90
|
+
const reactRouterDomPath = originalAlias
|
|
91
|
+
? originalAlias
|
|
92
|
+
: userDependencies['react-router-dom']
|
|
93
|
+
? require.resolve('react-router-dom')
|
|
94
|
+
: '';
|
|
95
|
+
const packageJsonPath = reactRouterDomPath
|
|
96
|
+
? findPackageJson(reactRouterDomPath)
|
|
97
|
+
: '';
|
|
105
98
|
// if find react-router-dom in package.json
|
|
106
|
-
if (
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
fs.readFileSync(packageJsonPath, 'utf-8'),
|
|
110
|
-
);
|
|
111
|
-
const majorVersion = checkVersion(packageJsonContent.version);
|
|
99
|
+
if (packageJsonPath) {
|
|
100
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
101
|
+
const majorVersion = checkVersion(packageJson.version);
|
|
112
102
|
const bridgeRouterAlias = setRouterAlias(majorVersion, reactRouterDomPath);
|
|
113
103
|
console.log(
|
|
114
104
|
'<<<<<<<<<<<<< bridgeRouterAlias >>>>>>>>>>>>>',
|