@ws-test-realm/admin-kit 0.6.6-ng20 → 0.6.7-ng20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ws-test-realm/admin-kit",
3
- "version": "0.6.6-ng20",
3
+ "version": "0.6.7-ng20",
4
4
  "description": "Workflow CLI + scaffolding for Wiresphere admin-modules workspaces (Angular 20 + native-federation line). Ships `ws-init-workspace`, `ws-modules` (build+deploy driver), `ws-generate-module`/`ws-drop-module`, `ws-wire-host`, `ws-wire-pom`, `ws-sync-paths`, and `ws-purge`. Depends on @ws-test-realm/devkit (toolchain BOM) + @ws-test-realm/shared (runtime BOM + native-federation share map).",
5
5
  "license": "Artistic-2.0",
6
6
  "publishConfig": {
@@ -28,7 +28,7 @@
28
28
  "dependencies": {
29
29
  "@angular-architects/native-federation": "^20.0.0",
30
30
  "@ws-test-realm/devkit": "^0.8.0-ng20",
31
- "@ws-test-realm/shared": "^0.8.1-ng20",
31
+ "@ws-test-realm/shared": "^0.8.2-ng20",
32
32
  "adm-zip": "^0.5.10",
33
33
  "fast-xml-parser": "^4.3.0"
34
34
  }
@@ -1,37 +1,39 @@
1
1
  const { withNativeFederation, share } = require('@angular-architects/native-federation/config');
2
- const { sharedDescriptors, WORKSPACE_LIBS } = require('@ws-test-realm/shared');
2
+ const { remoteShared, remoteExternals } = require('@ws-test-realm/shared');
3
+
4
+ // Consume-only federation. A new module bundles ONLY its own code by
5
+ // default. Everything else (BOM @angular/* etc., sibling remotes,
6
+ // contribution-owners' packages like tinymce or angular-jwt) is
7
+ // externalized — esbuild emits bare imports; the runtime federation
8
+ // import map (populated by host's initFederation before any module
9
+ // evaluates) resolves to the singleton chunk provided by host /
10
+ // contribution-owner. Missing share at runtime crashes explicitly.
11
+ // See PINNED.md "no module duplication".
12
+ //
13
+ // If THIS module brings in a peer dep that no other remote provides
14
+ // (e.g. db-login owns `@auth0/angular-jwt`), add it to `own` so this
15
+ // module becomes the contribution-owner — it gets bundled here and
16
+ // listed in remoteEntry.json as a share, then other remotes can
17
+ // externalize it.
18
+ const OWN = []; // e.g. ['@some/special-dep']
3
19
 
4
20
  module.exports = withNativeFederation({
5
21
  name: '__camelName__Module',
6
22
  exposes: {
7
23
  // Thin re-export shim so the exposed chunk delegates to the singleton
8
- // shared chunk for this package (declared in `shared` below). Without
9
- // the shim, esbuild would inline the whole library here and decorator
10
- // side effects would fire a second time on remote load.
24
+ // shared chunk for this package. Without the shim, esbuild would
25
+ // inline the whole library here and decorator side effects would
26
+ // fire a second time on remote load.
11
27
  './Module': './projects/__name__/src/exposed-module.ts',
12
28
  },
13
- // share() expands includeSecondaries against each package's exports field.
14
- // withNativeFederation's own share() invocation is commented out upstream.
15
- //
16
- // Three flavors of entries below the share() spread:
17
- //
18
- // 1. Self-share `'__name__': WORKSPACE_LIBS` — emits a chunk + import-map
19
- // entry for THIS module so siblings consuming it via bare specifiers
20
- // get the same instance at runtime.
21
- //
22
- // 2. Cross-workspace siblings (e.g. `'ws-framework': WORKSPACE_LIBS`) —
23
- // add when this module imports from another admin module that lives
24
- // in a different workspace. admin-kit symlinks `node_modules/<name>`
25
- // to the fiddle's `.federation/<name>/` so esbuild can resolve.
26
- //
27
- // 3. Module-carried federation contributions — runtime libs THIS module
28
- // introduces for the federation, that aren't in `sharedDescriptors()`'s
29
- // default slice. Example: db-login carries `@auth0/angular-jwt`. The
30
- // module's project package.json should list these as
31
- // `peerDependencies` (not `dependencies`); ng-packagr leaves them as
32
- // bare imports, native-federation emits the chunk + share entry, and
33
- // the runtime singleton mechanism dedupes if other consumers ever
34
- // import them.
35
- shared: { ...share(sharedDescriptors()), '__name__': WORKSPACE_LIBS },
36
- skip: ['rxjs/ajax', 'rxjs/fetch', 'rxjs/testing', 'rxjs/webSocket'],
29
+ shared: share(remoteShared({ self: '__name__', own: OWN })),
30
+ externals: remoteExternals({ self: '__name__', own: OWN }),
31
+ skip: [
32
+ 'rxjs/ajax',
33
+ 'rxjs/fetch',
34
+ 'rxjs/testing',
35
+ 'rxjs/webSocket',
36
+ '@angular/cdk/testing',
37
+ '@angular/material/testing',
38
+ ],
37
39
  });