@appshell/config 1.0.0-alpha.56 → 1.0.0-alpha.58
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.
|
@@ -14,7 +14,7 @@ import { AppshellTemplate } from './types';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const manifestFrom: <TMetadata extends Record<string, unknown>>(template: AppshellTemplate) => {
|
|
16
16
|
vars: Record<string, Record<string, string | number | undefined>>;
|
|
17
|
-
remotes: Record<string, import("
|
|
17
|
+
remotes: Record<string, import("./types").PublishedRemote<TMetadata>>;
|
|
18
18
|
modules: Record<string, import("./types").ModuleFederationPluginOptions>;
|
|
19
19
|
tokens?: Record<string, import("./types").AppshellTokenUsage>;
|
|
20
20
|
overrides?: import("./types").AppshellOverrides;
|
|
@@ -26,7 +26,7 @@ export declare const manifestFrom: <TMetadata extends Record<string, unknown>>(t
|
|
|
26
26
|
*/
|
|
27
27
|
declare const _default: <TMetadata extends Record<string, unknown>>(templatePath: string) => Promise<{
|
|
28
28
|
vars: Record<string, Record<string, string | number | undefined>>;
|
|
29
|
-
remotes: Record<string, import("
|
|
29
|
+
remotes: Record<string, import("./types").PublishedRemote<TMetadata>>;
|
|
30
30
|
modules: Record<string, import("./types").ModuleFederationPluginOptions>;
|
|
31
31
|
tokens?: Record<string, import("./types").AppshellTokenUsage>;
|
|
32
32
|
overrides?: import("./types").AppshellOverrides;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppshellTemplate, ConfigMap, PublishedRemote } from '../types';
|
|
2
2
|
export declare const toAppshellManifest: <TMetadata extends Record<string, unknown>>(template: AppshellTemplate, args: ConfigMap) => {
|
|
3
3
|
vars: Record<string, Record<string, string | number | undefined>>;
|
|
4
|
-
remotes: Record<string,
|
|
4
|
+
remotes: Record<string, PublishedRemote<TMetadata>>;
|
|
5
5
|
modules: Record<string, import("../types").ModuleFederationPluginOptions>;
|
|
6
6
|
tokens?: Record<string, import("../types").AppshellTokenUsage>;
|
|
7
7
|
overrides?: import("../types").AppshellOverrides;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -53,10 +53,19 @@ export type CliConfig = Record<string, string> & {
|
|
|
53
53
|
authIssuer: string;
|
|
54
54
|
clientId: string;
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Neither `url` nor `filename`.
|
|
58
|
+
*
|
|
59
|
+
* `url` is an origin, and an origin belongs to a deployment: a package is published once
|
|
60
|
+
* and deployed many times, so a url here would freeze one environment's answer into an
|
|
61
|
+
* immutable version and make the artifact's digest depend on where it was built.
|
|
62
|
+
*
|
|
63
|
+
* `filename` was a hand-written copy of the Module Federation `filename`, which is what
|
|
64
|
+
* actually decides the file webpack emits. Two statements of one fact, and only one of
|
|
65
|
+
* them is enforced by anything.
|
|
66
|
+
*/
|
|
56
67
|
export type AppshellConfigRemote<TMetadata = Metadata> = {
|
|
57
68
|
id: string;
|
|
58
|
-
url: string;
|
|
59
|
-
filename: string;
|
|
60
69
|
metadata: TMetadata;
|
|
61
70
|
};
|
|
62
71
|
export type AppshellConfig<TMetadata = Metadata> = {
|
|
@@ -109,13 +118,30 @@ export type AppshellTokenUsage = {
|
|
|
109
118
|
optional: string[];
|
|
110
119
|
};
|
|
111
120
|
export type AppshellManifest<TMetadata = Metadata> = {
|
|
112
|
-
remotes: Record<string,
|
|
121
|
+
remotes: Record<string, PublishedRemote<TMetadata>>;
|
|
113
122
|
modules: Record<string, ModuleFederationPluginOptions>;
|
|
114
123
|
vars: Record<string, Record<string, string | number | undefined>>;
|
|
115
124
|
/** Keyed by federation scope, so a merged manifest still says which package needs what. */
|
|
116
125
|
tokens?: Record<string, AppshellTokenUsage>;
|
|
117
126
|
overrides?: AppshellOverrides;
|
|
118
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* A remote as a package publishes it: what the build knows about itself, and nothing
|
|
130
|
+
* about where it ends up.
|
|
131
|
+
*
|
|
132
|
+
* Distinct from `AppshellRemote`, which is the same remote after the registry has
|
|
133
|
+
* resolved it for the browser. They were one type, which is why the origin ended up in
|
|
134
|
+
* the artifact: the browser genuinely needs a url, so the published form appeared to as
|
|
135
|
+
* well. The registry supplies it at composition, from the address and its serving plane.
|
|
136
|
+
*/
|
|
137
|
+
export type PublishedRemote<TMetadata = Metadata> = {
|
|
138
|
+
id: string;
|
|
139
|
+
filename: string;
|
|
140
|
+
scope: string;
|
|
141
|
+
module: string;
|
|
142
|
+
shareScope?: string;
|
|
143
|
+
metadata: TMetadata;
|
|
144
|
+
};
|
|
119
145
|
/** An `AppshellRemote` the registry already resolved, so the browser needs no manifest fetch. */
|
|
120
146
|
export type ResolvedRemote<TMetadata = Metadata> = AppshellRemote<TMetadata>;
|
|
121
147
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appshell/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.58",
|
|
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",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"build:types": "tsc --emitDeclarationOnly",
|
|
19
19
|
"clean": "rm -rf dist",
|
|
20
20
|
"start": "webpack --watch --mode development && npm run build:types",
|
|
21
|
-
"stats": "webpack --json > stats.json"
|
|
21
|
+
"stats": "webpack --json > stats.json",
|
|
22
|
+
"typecheck": "tsc --noEmit -p tsconfig.typecheck.json"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"dist"
|
|
@@ -30,9 +31,9 @@
|
|
|
30
31
|
"appshell"
|
|
31
32
|
],
|
|
32
33
|
"license": "MIT",
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "a6fb96951292e9bf8752f4448caab4ee530f013e",
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@appshell/runtime": "^1.0.0-alpha.
|
|
36
|
+
"@appshell/runtime": "^1.0.0-alpha.58",
|
|
36
37
|
"yaml": "^2.8.0"
|
|
37
38
|
}
|
|
38
39
|
}
|