@appshell/config 1.0.0-alpha.46 → 1.0.0-alpha.48

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,38 @@ 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
+ export type OpenedOverlay = {
35
+ id: string;
36
+ confirmUrl: string;
37
+ url: string;
38
+ remotes: string[];
39
+ expiresAt: string;
40
+ /**
41
+ * False when an overlay was already open for this developer and this one extended it.
42
+ * A browser carries a single overlay id, so an extended overlay is one some browser has
43
+ * already confirmed — nothing needs sending back to the confirmation page.
44
+ */
45
+ created: boolean;
46
+ };
47
+ /**
48
+ * Points some of an application's remotes at a developer's own machine, for that
49
+ * developer only.
50
+ *
51
+ * This is what a local dev loop does instead of republishing. A published version is
52
+ * immutable and content-addressed; overwriting one on every rebuild makes the digest
53
+ * describe whoever built last, and two developers sharing a registry overwrite each
54
+ * other. An overlay is per-developer, per-browser and expiring, so neither happens.
55
+ *
56
+ * Extending is the normal case rather than the exception: the registry merges remotes
57
+ * into whatever overlay this developer already holds, so serving two micro-frontends
58
+ * locally redirects both without minting a second overlay or asking for confirmation
59
+ * twice.
60
+ *
61
+ * @param application `scope/name`
62
+ */
63
+ 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.46",
3
+ "version": "1.0.0-alpha.48",
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": "8ef63d50e61a09ee1205cac64548b5331e7b8472",
33
+ "gitHead": "382664357b20402a8eca22efe6ec24149d26f1a4",
34
34
  "dependencies": {
35
- "@appshell/runtime": "^1.0.0-alpha.46",
35
+ "@appshell/runtime": "^1.0.0-alpha.48",
36
36
  "yaml": "^2.8.0"
37
37
  }
38
38
  }