@appshell/config 1.0.0-alpha.47 → 1.0.0-alpha.49

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.
@@ -8,8 +8,8 @@ export { clearCredential, credentialsPath, resolveToken, saveCredential } from '
8
8
  export type { Credential } from './credentials';
9
9
  export { default as generateManifest, manifestFrom } from './generate.manifest';
10
10
  export { default as outdated } from './outdated';
11
- export { activate, publish } from './publish';
12
- export type { PublishOptions, PublishResult } from './publish';
11
+ export { activate, openOverlay, publish } from './publish';
12
+ export type { OpenedOverlay, OverlayRemotePatch, PublishOptions, PublishResult } from './publish';
13
13
  export { default as sync } from './sync';
14
14
  export type { AppshellComposition, AppshellConfig, AppshellConfigRemote, AppshellIndex, AppshellManifest, AppshellRemote, AppshellTemplate, AppshellTokenUsage, ComparisonResult, ComparisonResults, ComparisonTarget, Metadata, ModuleFederationPluginOptions, PackageSpec, ResolvedRemote, Schema, SharedConfig, SharedModuleSpec, SharedObject, } from './types';
15
15
  export * as utils from './utils';
@@ -26,3 +26,47 @@ export declare const publish: ({ registry, token, name, version, manifest, visib
26
26
  * @param application `scope/name`
27
27
  */
28
28
  export declare const activate: (registry: string, application: string, packageId: string, token?: string) => Promise<void>;
29
+ /** What an overlay redirects a single remote to. */
30
+ export type OverlayRemotePatch = {
31
+ remoteEntryUrl: string;
32
+ manifestUrl?: string;
33
+ /**
34
+ * The remote's `metadata` as this build declares it.
35
+ *
36
+ * Sent because a developer iterating on `appshell.config.yaml` is editing metadata as
37
+ * much as code; without it an overlay serves their new bundle beside the published
38
+ * route, displayName and icon. The registry replaces rather than merges, so a key
39
+ * removed from the yaml disappears rather than standing.
40
+ */
41
+ metadata?: Metadata;
42
+ };
43
+ export type OpenedOverlay = {
44
+ id: string;
45
+ confirmUrl: string;
46
+ url: string;
47
+ remotes: string[];
48
+ expiresAt: string;
49
+ /**
50
+ * False when an overlay was already open for this developer and this one extended it.
51
+ * A browser carries a single overlay id, so an extended overlay is one some browser has
52
+ * already confirmed — nothing needs sending back to the confirmation page.
53
+ */
54
+ created: boolean;
55
+ };
56
+ /**
57
+ * Points some of an application's remotes at a developer's own machine, for that
58
+ * developer only.
59
+ *
60
+ * This is what a local dev loop does instead of republishing. A published version is
61
+ * immutable and content-addressed; overwriting one on every rebuild makes the digest
62
+ * describe whoever built last, and two developers sharing a registry overwrite each
63
+ * other. An overlay is per-developer, per-browser and expiring, so neither happens.
64
+ *
65
+ * Extending is the normal case rather than the exception: the registry merges remotes
66
+ * into whatever overlay this developer already holds, so serving two micro-frontends
67
+ * locally redirects both without minting a second overlay or asking for confirmation
68
+ * twice.
69
+ *
70
+ * @param application `scope/name`
71
+ */
72
+ export declare const openOverlay: (registry: string, application: string, remotes: Record<string, OverlayRemotePatch>, token?: string) => Promise<OpenedOverlay>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/config",
3
- "version": "1.0.0-alpha.47",
3
+ "version": "1.0.0-alpha.49",
4
4
  "description": "Utility for producing a global appshell manifest for module federation micro-frontends",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  "appshell"
31
31
  ],
32
32
  "license": "MIT",
33
- "gitHead": "9299f50b31ded495f5e846731a940fe69299f8fe",
33
+ "gitHead": "efd0f9c0156d747c1104edc34044a415999ab3c6",
34
34
  "dependencies": {
35
- "@appshell/runtime": "^1.0.0-alpha.47",
35
+ "@appshell/runtime": "^1.0.0-alpha.49",
36
36
  "yaml": "^2.8.0"
37
37
  }
38
38
  }