@mf-toolkit/shared-inspector 0.3.0 → 0.3.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 +18 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# `@mf-toolkit/shared-inspector`
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@mf-toolkit/shared-inspector)
|
|
4
|
-
[](https://github.com/zvitaly7/mf-toolkit)
|
|
5
4
|
[](https://github.com/zvitaly7/mf-toolkit/blob/main/LICENSE)
|
|
6
5
|
[](https://nodejs.org)
|
|
7
6
|
|
|
8
|
-
>
|
|
7
|
+
> **v0.3.0** — published to npm. 252 tests. API is stable; minor changes possible before v1.0.
|
|
9
8
|
|
|
10
9
|
Build-time analyser for Module Federation `shared` dependencies. Two-phase architecture: **collect facts → analyse facts**.
|
|
11
10
|
|
|
@@ -268,6 +267,22 @@ Accepts N `ProjectManifest` objects (one per microfrontend) and returns a `Feder
|
|
|
268
267
|
|
|
269
268
|
Formats a `FederationReport` as a human-readable terminal string.
|
|
270
269
|
|
|
270
|
+
### `MfSharedInspectorPlugin` options
|
|
271
|
+
|
|
272
|
+
Extends all `buildProjectManifest` options (except `name`, auto-resolved from compiler) plus:
|
|
273
|
+
|
|
274
|
+
| Option | Type | Default | Description |
|
|
275
|
+
|--------|------|---------|-------------|
|
|
276
|
+
| `sourceDirs` | `string[]` | — | Directories to scan |
|
|
277
|
+
| `sharedConfig` | `Record<string, SharedDepConfig>` | auto-extracted | Override auto-extraction from `ModuleFederationPlugin` |
|
|
278
|
+
| `tsconfigPath` | `string` | `undefined` | tsconfig.json for path alias resolution |
|
|
279
|
+
| `workspacePackages` | `string[]` | `[]` | Local monorepo packages to exclude |
|
|
280
|
+
| `warn` | `boolean` | `true` | Print findings to console |
|
|
281
|
+
| `failOn` | `'mismatch' \| 'unused' \| 'any'` | `undefined` | Fail the build when findings match |
|
|
282
|
+
| `writeManifest` | `boolean` | `false` | Write `project-manifest.json` to `outputDir` |
|
|
283
|
+
| `outputDir` | `string` | `'.'` | Directory for manifest output |
|
|
284
|
+
| `analysis` | `AnalysisOptions` | `{}` | Options forwarded to `analyzeProject` |
|
|
285
|
+
|
|
271
286
|
## Detection categories
|
|
272
287
|
|
|
273
288
|
### Per-project (`analyzeProject`)
|
|
@@ -296,6 +311,7 @@ Formats a `FederationReport` as a human-readable terminal string.
|
|
|
296
311
|
- **TypeScript path aliases without `tsconfigPath`**: aliased imports are treated as external package names. Pass `tsconfigPath` to resolve them correctly.
|
|
297
312
|
- **Dynamic imports with variables** (`import(moduleName)`): not analysed — requires runtime information.
|
|
298
313
|
- **Exact tsconfig alias patterns** (non-wildcard, e.g. `"@root": ["."]`): not supported, only `"@alias/*"` wildcard form.
|
|
314
|
+
- **Subclassed `ModuleFederationPlugin`**: auto-extraction matches by constructor name. A custom subclass (`class MyMFP extends ModuleFederationPlugin`) won't be detected — pass `sharedConfig` explicitly in that case.
|
|
299
315
|
|
|
300
316
|
## Demo
|
|
301
317
|
|