@softarc/native-federation 4.2.0 → 4.3.0

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.
@@ -1,11 +1,14 @@
1
1
  export interface FederationInfo {
2
2
  name: string;
3
3
  exposes: ExposesInfo[];
4
- shared: SharedInfo[];
4
+ shared: Array<SharedInfo | DenseSharedInfo>;
5
5
  chunks?: Record<string, string[]>;
6
6
  integrity?: IntegrityMap;
7
7
  buildNotificationsEndpoint?: string;
8
8
  }
9
+ export type DenseSharedInfo = Omit<SharedInfo, 'outFileName'> & {
10
+ entries: Record<string, string>;
11
+ };
9
12
  export type SharedInfo = {
10
13
  singleton: boolean;
11
14
  strictVersion: boolean;
@@ -13,6 +16,7 @@ export type SharedInfo = {
13
16
  version?: string;
14
17
  packageName: string;
15
18
  shareScope?: string;
19
+ pool?: string;
16
20
  bundle?: string;
17
21
  outFileName: string;
18
22
  dev?: {
@@ -1,4 +1,4 @@
1
- export type { SharedInfo, FederationInfo, ExposesInfo, ArtifactInfo, ChunkInfo, IntegrityMap, } from './federation-info.contract.js';
1
+ export type { SharedInfo, DenseSharedInfo, FederationInfo, ExposesInfo, ArtifactInfo, ChunkInfo, IntegrityMap, } from './federation-info.contract.js';
2
2
  export { type BuildNotificationOptions, BuildNotificationType, } from './build-notification-options.contract.js';
3
3
  export type { FederationOptions, NormalizedFederationOptions, } from './federation-options.contract.js';
4
4
  export type { EntryPoint, NFBuildAdapterOptions, NFBuildAdapter, NFBuildAdapterResult, NFBuildAdapterContext, } from './build-adapter.contract.js';
@@ -1,2 +1,3 @@
1
1
  export declare function normalize(path: string, trailingSlash?: boolean): string;
2
2
  export declare function normalizePackageName(fileName: string): string;
3
+ export declare function inferPackageFromSecondary(secondary: string): string;
@@ -16,7 +16,15 @@ function normalizePackageName(fileName) {
16
16
  const sanitized = fileName.replace(/[^A-Za-z0-9]/g, "_");
17
17
  return sanitized.startsWith("_") ? sanitized.slice(1) : sanitized;
18
18
  }
19
+ function inferPackageFromSecondary(secondary) {
20
+ const parts = secondary.split("/");
21
+ if (secondary.startsWith("@") && parts.length >= 2) {
22
+ return parts[0] + "/" + parts[1];
23
+ }
24
+ return parts[0];
25
+ }
19
26
  export {
27
+ inferPackageFromSecondary,
20
28
  normalize,
21
29
  normalizePackageName
22
30
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softarc/native-federation",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "globals": "^17.3.0",
27
27
  "jiti": "^2.6.1",
28
28
  "jsdom": "^29.0.0",
29
- "knip": "^6.16.1",
29
+ "knip": "^6.20.0",
30
30
  "prettier": "^3.8.1",
31
31
  "tslib": "^2.3.0",
32
32
  "typescript": "~6.0.0",