@appshell/react 1.0.0-alpha.88 → 1.0.0-alpha.89

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.
@@ -9,6 +9,8 @@ export type { Credential } from './credentials';
9
9
  export { default as generateManifest, manifestFrom } from './generate.manifest';
10
10
  export { loaderOf } from './loader';
11
11
  export { default as outdated } from './outdated';
12
+ export { parsePackageName } from './package-name';
13
+ export type { PackageName } from './package-name';
12
14
  export { activate, openOverlay, publish } from './publish';
13
15
  export type { OpenedOverlay, OverlayRemotePatch, PublishOptions, PublishResult } from './publish';
14
16
  export { default as sync } from './sync';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * An npm package name split into where it belongs and what it is called.
3
+ *
4
+ * `@acme/checkout` is scope `acme`, name `checkout`. A bare `checkout` declares no scope
5
+ * and belongs wherever the publisher does.
6
+ *
7
+ * One definition because three places used to strip the scope with their own copy of the
8
+ * same regular expression — the cli's `identify`, its workspace scan, and the webpack
9
+ * plugin. Three copies of a rule about identity is three chances for a package to publish
10
+ * to a different place than the tooling thinks it does.
11
+ *
12
+ * Scope is worth declaring for the reason it is worth checking in: `@acme/checkout` says
13
+ * where it belongs in a file under review, identically for everyone, rather than landing
14
+ * in whichever namespace the person running the publish happens to carry.
15
+ */
16
+ export type PackageName = {
17
+ scopeId?: string;
18
+ name: string;
19
+ };
20
+ export declare const parsePackageName: (raw: string) => PackageName;
@@ -2,6 +2,14 @@ import { AppshellManifest, Metadata, ModuleFederationLoader } from './types';
2
2
  export type PublishOptions = {
3
3
  registry: string;
4
4
  token?: string;
5
+ /**
6
+ * Where this package belongs, when the package name declares it.
7
+ *
8
+ * Omitted means the publisher's own namespace, which is how every publish worked before
9
+ * this existed. The registry refuses a scope the caller does not own, so declaring one
10
+ * is a statement of fact rather than a request.
11
+ */
12
+ scopeId?: string;
5
13
  name: string;
6
14
  version: string;
7
15
  manifest: AppshellManifest;
@@ -11,7 +19,7 @@ export type PublishOptions = {
11
19
  force?: boolean;
12
20
  };
13
21
  export type PublishResult = {
14
- /** `scope/name@version`. The scope comes from the token, not the caller. */
22
+ /** `scope/name@version`. From the package name where it declares one, else the token. */
15
23
  id: string;
16
24
  created: boolean;
17
25
  /** Empty unless a shared block was sent. See `openOverlay`. */
@@ -22,7 +30,7 @@ export type PublishResult = {
22
30
  * under a version that already exists is rejected by the registry, unless
23
31
  * `force` is set and the registry is configured to honor it (dev registries).
24
32
  */
25
- export declare const publish: ({ registry, token, name, version, manifest, visibility, metadata, force, }: PublishOptions) => Promise<PublishResult>;
33
+ export declare const publish: ({ registry, token, scopeId, name, version, manifest, visibility, metadata, force, }: PublishOptions) => Promise<PublishResult>;
26
34
  /**
27
35
  * Activating a newer version of an already active package upgrades it in place.
28
36
  * @param application `scope/name`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/react",
3
- "version": "1.0.0-alpha.88",
3
+ "version": "1.0.0-alpha.89",
4
4
  "description": "React utilities for building micro-frontends with Appshell and Module Federation",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/types/react/src/index.d.ts",
@@ -34,8 +34,8 @@
34
34
  "react": "^18.2.0",
35
35
  "react-dom": "^18.2.0"
36
36
  },
37
- "gitHead": "cd4b3e29225192856a96df47661031e65928f322",
37
+ "gitHead": "e2b69e42e63fc753f4d400ef957dcc233223fcee",
38
38
  "dependencies": {
39
- "@appshell/runtime": "^1.0.0-alpha.88"
39
+ "@appshell/runtime": "^1.0.0-alpha.89"
40
40
  }
41
41
  }