@appshell/loader 1.0.0-alpha.100 → 1.0.0-alpha.101

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.
@@ -12,7 +12,7 @@ export { default as outdated } from './outdated';
12
12
  export { parsePackageName } from './package-name';
13
13
  export type { PackageName } from './package-name';
14
14
  export { activate, openOverlay, publish } from './publish';
15
- export type { OpenedOverlay, OverlayRemotePatch, PublishOptions, PublishResult } from './publish';
15
+ export type { Advise, OpenedOverlay, OverlayRemotePatch, PublishError, PublishOptions, PublishResult, } from './publish';
16
16
  export { default as sync } from './sync';
17
17
  export { caFile, httpsAgent } from './tls';
18
18
  export type { AppshellComposition, AppshellConfig, AppshellConfigRemote, AppshellIndex, AppshellManifest, AppshellRemote, AppshellTemplate, AppshellTokenUsage, ComparisonResult, ComparisonResults, ComparisonTarget, Metadata, ModuleFederationPluginOptions, PackageSpec, ResolvedRemote, Schema, SharedConfig, SharedModuleSpec, SharedObject, } from './types';
@@ -17,6 +17,26 @@ export type PublishOptions = {
17
17
  metadata?: Metadata;
18
18
  /** Ask the registry to overwrite an existing version whose content differs. */
19
19
  force?: boolean;
20
+ /**
21
+ * What a refusal goes on to say, in place of the default advice to log in.
22
+ *
23
+ * That advice is right for a person and wrong for a CI workflow publishing as itself
24
+ * with trusted publishing: it cannot log in, and what refused it is a trust record on
25
+ * the scope or the registry's own settings. Given the status and the registry's reason;
26
+ * returning nothing keeps the default.
27
+ */
28
+ advise?: Advise;
29
+ };
30
+ /** Advice to follow a refusal with. Nothing keeps the default. */
31
+ export type Advise = (status: number, reason: string) => string | undefined;
32
+ /**
33
+ * A refused publish, carrying the status the registry answered with when it answered.
34
+ *
35
+ * The message is still the whole story for a person reading it; the status is for a
36
+ * caller that decides what to do next by it, rather than by matching the message.
37
+ */
38
+ export type PublishError = Error & {
39
+ status?: number;
20
40
  };
21
41
  export type PublishResult = {
22
42
  /** `scope/name@version`. From the package name where it declares one, else the token. */
@@ -30,7 +50,7 @@ export type PublishResult = {
30
50
  * under a version that already exists is rejected by the registry, unless
31
51
  * `force` is set and the registry is configured to honor it (dev registries).
32
52
  */
33
- export declare const publish: ({ registry, token, scopeId, name, version, manifest, visibility, metadata, force, }: PublishOptions) => Promise<PublishResult>;
53
+ export declare const publish: ({ registry, token, scopeId, name, version, manifest, visibility, metadata, force, advise, }: PublishOptions) => Promise<PublishResult>;
34
54
  /**
35
55
  * Activating a newer version of an already active package upgrades it in place.
36
56
  * @param application `scope/name`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/loader",
3
- "version": "1.0.0-alpha.100",
3
+ "version": "1.0.0-alpha.101",
4
4
  "description": "Utility for loading Appshell components",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/loader/src/index.d.ts",
@@ -32,8 +32,8 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "dependencies": {
35
- "@appshell/runtime": "^1.0.0-alpha.100",
35
+ "@appshell/runtime": "^1.0.0-alpha.101",
36
36
  "@module-federation/enhanced": "^2.8.2"
37
37
  },
38
- "gitHead": "2df8eb5b605b036d36af7e8d3ee2990bc2b63e5e"
38
+ "gitHead": "7a0f5ce018f35276830999b97891ccaf2114ee1e"
39
39
  }