@appshell/config 1.0.0-alpha.1 → 1.0.0-alpha.8

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.
@@ -0,0 +1,23 @@
1
+ export type AppshellContext = {
2
+ registry?: string;
3
+ /** Activation target as `scope/name`. */
4
+ environment?: string;
5
+ scopeId: string;
6
+ token?: string;
7
+ };
8
+ /**
9
+ * The registry, environment, and token a developer is working against, resolved
10
+ * the way the CLI resolves them: env var, then `~/.appshell/config`, then a
11
+ * default. This lets the webpack plugin defer to `appshell config set` and
12
+ * `appshell login` instead of requiring per-project configuration.
13
+ */
14
+ export declare const resolveContext: () => AppshellContext;
15
+ /**
16
+ * What `~/.appshell/config` alone declares, so a caller can warn when an env var
17
+ * or an explicit option points somewhere other than the developer's CLI context.
18
+ */
19
+ export declare const persistedContext: () => {
20
+ registry?: string;
21
+ environment?: string;
22
+ };
23
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAaF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAAO,eAQjC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAO;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAK5E,CAAC"}
@@ -0,0 +1,16 @@
1
+ export type Credential = {
2
+ accessToken: string;
3
+ refreshToken?: string;
4
+ /** Epoch milliseconds. */
5
+ expiresAt?: number;
6
+ };
7
+ export declare const credentialsPath: () => string;
8
+ export declare const saveCredential: (registry: string, credential: Credential) => void;
9
+ export declare const clearCredential: (registry: string) => void;
10
+ /**
11
+ * APPSHELL_TOKEN wins so CI never depends on a writable home directory.
12
+ * Expired tokens are treated as absent; refresh is the caller's concern.
13
+ */
14
+ export declare const resolveToken: (registry: string) => string | undefined;
15
+ export declare const requireToken: (registry: string) => string;
16
+ //# sourceMappingURL=credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../src/credentials.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAKF,eAAO,MAAM,eAAe,cAC6D,CAAC;AAqB1F,eAAO,MAAM,cAAc,aAAc,MAAM,cAAc,UAAU,SAEtE,CAAC;AAEF,eAAO,MAAM,eAAe,aAAc,MAAM,SAI/C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,MAAM,GAAG,SAexD,CAAC;AAEF,eAAO,MAAM,YAAY,aAAc,MAAM,KAAG,MAO/C,CAAC"}
@@ -2,6 +2,10 @@
2
2
  * @appshell/config package API
3
3
  */
4
4
  export { default as configmap } from './configmap';
5
+ export { persistedContext, resolveContext } from './context';
6
+ export type { AppshellContext } from './context';
7
+ export { clearCredential, credentialsPath, requireToken, resolveToken, saveCredential, } from './credentials';
8
+ export type { Credential } from './credentials';
5
9
  export { default as deregister } from './deregister';
6
10
  export { default as generateEnv } from './generate.env';
7
11
  export { default as generateGlobalConfig } from './generate.global-config';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,UAAU,E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U,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,EACR,6BAA6B,EAC7B,WAAW,EACX,cAAc,EACd,MAAM,EACN,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC"}
@@ -7,6 +7,8 @@ export type PublishOptions = {
7
7
  manifest: AppshellManifest;
8
8
  visibility?: 'public' | 'private';
9
9
  metadata?: Metadata;
10
+ /** Ask the registry to overwrite an existing version whose content differs. */
11
+ force?: boolean;
10
12
  };
11
13
  export type PublishResult = {
12
14
  /** `scope/name@version`. The scope comes from the token, not the caller. */
@@ -15,9 +17,10 @@ export type PublishResult = {
15
17
  };
16
18
  /**
17
19
  * Publishing the same content twice is a no-op; publishing different content
18
- * under a version that already exists is rejected by the registry.
20
+ * under a version that already exists is rejected by the registry, unless
21
+ * `force` is set and the registry is configured to honor it (dev registries).
19
22
  */
20
- export declare const publish: ({ registry, token, name, version, manifest, visibility, metadata, }: PublishOptions) => Promise<PublishResult>;
23
+ export declare const publish: ({ registry, token, name, version, manifest, visibility, metadata, force, }: PublishOptions) => Promise<PublishResult>;
21
24
  /**
22
25
  * Activating a newer version of an already active app upgrades it in place.
23
26
  * @param environment `scope/name`
@@ -1 +1 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/publish.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAmBF;;;GAGG;AACH,eAAO,MAAM,OAAO,wEAQjB,cAAc,KAAG,OAAO,CAAC,aAAa,CAYxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,aACT,MAAM,eACH,MAAM,SACZ,MAAM,UACL,MAAM,KACb,OAAO,CAAC,IAAI,CAgBd,CAAC"}
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/publish.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAErD,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAmBF;;;;GAIG;AACH,eAAO,MAAM,OAAO,+EASjB,cAAc,KAAG,OAAO,CAAC,aAAa,CAYxC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,aACT,MAAM,eACH,MAAM,SACZ,MAAM,UACL,MAAM,KACb,OAAO,CAAC,IAAI,CAgBd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appshell/config",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.8",
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",
@@ -27,5 +27,5 @@
27
27
  "appshell"
28
28
  ],
29
29
  "license": "MIT",
30
- "gitHead": "73ffe7324c186ab10cee941fa7c22f79bfc5df9c"
30
+ "gitHead": "ced8839a7c8423ad723fb32f9388e0e3d15951eb"
31
31
  }