@mf-toolkit/shared-inspector 0.5.0 → 0.5.1
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 +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
[](https://github.com/zvitaly7/mf-toolkit/blob/main/LICENSE)
|
|
5
5
|
[](https://nodejs.org)
|
|
6
6
|
|
|
7
|
-
**
|
|
7
|
+
**Validate Module Federation `shared` config at build time.**
|
|
8
8
|
|
|
9
|
-
`shared` config
|
|
9
|
+
`shared` config errors are silent — mismatched versions, broken singleton negotiation, duplicate instances in the bundle. `shared-inspector` surfaces these issues before they reach production. Every finding includes a risk score and a ready-to-paste fix.
|
|
10
10
|
|
|
11
11
|
## The problem
|
|
12
12
|
|
|
@@ -556,6 +556,24 @@ Extends all `buildProjectManifest` options (except `name`, auto-resolved from co
|
|
|
556
556
|
| `hostGaps` | 🟠 MEDIUM | Package used by 2+ MFs but not declared in `shared` by anyone |
|
|
557
557
|
| `ghostShares` | 🟡 LOW | Package in `shared` of one MF, unused/unshared by all others |
|
|
558
558
|
|
|
559
|
+
## How it works
|
|
560
|
+
|
|
561
|
+
Four steps, no magic:
|
|
562
|
+
|
|
563
|
+
1. **Scan** — statically extracts import/require statements from source files
|
|
564
|
+
2. **Normalize** — reads your declared `shared` config (explicit or auto-extracted from `ModuleFederationPlugin`)
|
|
565
|
+
3. **Resolve** — reads installed versions from `node_modules` to detect `requiredVersion` drift
|
|
566
|
+
4. **Cross-reference** — produces findings, a risk score, and optionally a `project-manifest.json` for federation analysis
|
|
567
|
+
|
|
568
|
+
No webpack build required. Runs in seconds on the source tree directly.
|
|
569
|
+
|
|
570
|
+
## When not to use this tool
|
|
571
|
+
|
|
572
|
+
- You are not using Module Federation (webpack or rspack)
|
|
573
|
+
- Your `shared` config is intentionally empty or minimal by design
|
|
574
|
+
- You only need bundle size analysis — use [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer) instead
|
|
575
|
+
- Your MF setup uses dynamic runtime sharing with non-standard orchestration that doesn't rely on the `shared` config
|
|
576
|
+
|
|
559
577
|
## Known limitations
|
|
560
578
|
|
|
561
579
|
- **TypeScript path aliases without `tsconfigPath`**: aliased imports are treated as external package names.
|
package/package.json
CHANGED