@vercel/microfrontends 0.14.0 → 0.15.0
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.
- package/dist/bin/cli.cjs +377 -1626
- package/dist/config.cjs +460 -1004
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.ts +4 -25
- package/dist/config.js +456 -983
- package/dist/config.js.map +1 -1
- package/dist/{v2/microfrontends → microfrontends}/server.cjs +63 -143
- package/dist/microfrontends/server.cjs.map +1 -0
- package/dist/{v2/microfrontends → microfrontends}/server.d.ts +4 -4
- package/dist/{v2/microfrontends → microfrontends}/server.js +63 -143
- package/dist/microfrontends/server.js.map +1 -0
- package/dist/{v2/microfrontends.cjs → microfrontends.cjs} +21 -21
- package/dist/microfrontends.cjs.map +1 -0
- package/dist/{v2/microfrontends.d.ts → microfrontends.d.ts} +4 -4
- package/dist/{v2/microfrontends.js → microfrontends.js} +20 -20
- package/dist/microfrontends.js.map +1 -0
- package/dist/next/client.cjs +1 -1
- package/dist/next/client.cjs.map +1 -1
- package/dist/next/client.js +1 -1
- package/dist/next/client.js.map +1 -1
- package/dist/next/config.cjs +1323 -1024
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.d.ts +1 -1
- package/dist/next/config.js +1327 -1028
- package/dist/next/config.js.map +1 -1
- package/dist/next/endpoints.cjs +77 -18
- package/dist/next/endpoints.cjs.map +1 -1
- package/dist/next/endpoints.d.ts +13 -2
- package/dist/next/endpoints.js +77 -18
- package/dist/next/endpoints.js.map +1 -1
- package/dist/next/middleware.cjs +745 -396
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.ts +10 -5
- package/dist/next/middleware.js +745 -396
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/testing.cjs +595 -1032
- package/dist/next/testing.cjs.map +1 -1
- package/dist/next/testing.d.ts +14 -12
- package/dist/next/testing.js +589 -1016
- package/dist/next/testing.js.map +1 -1
- package/dist/overrides.cjs +40 -108
- package/dist/overrides.cjs.map +1 -1
- package/dist/overrides.d.ts +24 -2
- package/dist/overrides.js +36 -106
- package/dist/overrides.js.map +1 -1
- package/dist/{v2/routing.cjs → routing.cjs} +3 -3
- package/dist/routing.cjs.map +1 -0
- package/dist/{v2/schema.cjs → schema.cjs} +1 -1
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/utils/mfe-port.cjs +211 -1333
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +204 -1326
- package/dist/utils/mfe-port.js.map +1 -1
- package/dist/validation.cjs +31 -361
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.d.ts +3 -146
- package/dist/validation.js +30 -359
- package/dist/validation.js.map +1 -1
- package/package.json +29 -92
- package/schema/schema.json +174 -244
- package/dist/config/client.cjs +0 -54
- package/dist/config/client.cjs.map +0 -1
- package/dist/config/client.d.ts +0 -23
- package/dist/config/client.js +0 -28
- package/dist/config/client.js.map +0 -1
- package/dist/config/edge.cjs +0 -508
- package/dist/config/edge.cjs.map +0 -1
- package/dist/config/edge.d.ts +0 -20
- package/dist/config/edge.js +0 -481
- package/dist/config/edge.js.map +0 -1
- package/dist/microfrontend-config-983a5139.d.ts +0 -154
- package/dist/schema-2922d49e.d.ts +0 -182
- package/dist/v2/config.cjs +0 -709
- package/dist/v2/config.cjs.map +0 -1
- package/dist/v2/config.d.ts +0 -4
- package/dist/v2/config.js +0 -684
- package/dist/v2/config.js.map +0 -1
- package/dist/v2/microfrontends/server.cjs.map +0 -1
- package/dist/v2/microfrontends/server.js.map +0 -1
- package/dist/v2/microfrontends.cjs.map +0 -1
- package/dist/v2/microfrontends.js.map +0 -1
- package/dist/v2/next/client.cjs +0 -3
- package/dist/v2/next/client.cjs.map +0 -1
- package/dist/v2/next/client.d.ts +0 -45
- package/dist/v2/next/client.js +0 -3
- package/dist/v2/next/client.js.map +0 -1
- package/dist/v2/next/config.cjs +0 -2178
- package/dist/v2/next/config.cjs.map +0 -1
- package/dist/v2/next/config.d.ts +0 -22
- package/dist/v2/next/config.js +0 -2143
- package/dist/v2/next/config.js.map +0 -1
- package/dist/v2/next/endpoints.cjs +0 -141
- package/dist/v2/next/endpoints.cjs.map +0 -1
- package/dist/v2/next/endpoints.d.ts +0 -26
- package/dist/v2/next/endpoints.js +0 -116
- package/dist/v2/next/endpoints.js.map +0 -1
- package/dist/v2/next/middleware.cjs +0 -1099
- package/dist/v2/next/middleware.cjs.map +0 -1
- package/dist/v2/next/middleware.d.ts +0 -34
- package/dist/v2/next/middleware.js +0 -1071
- package/dist/v2/next/middleware.js.map +0 -1
- package/dist/v2/next/testing.cjs +0 -992
- package/dist/v2/next/testing.cjs.map +0 -1
- package/dist/v2/next/testing.d.ts +0 -55
- package/dist/v2/next/testing.js +0 -961
- package/dist/v2/next/testing.js.map +0 -1
- package/dist/v2/overrides.cjs +0 -75
- package/dist/v2/overrides.cjs.map +0 -1
- package/dist/v2/overrides.d.ts +0 -24
- package/dist/v2/overrides.js +0 -45
- package/dist/v2/overrides.js.map +0 -1
- package/dist/v2/routing.cjs.map +0 -1
- package/dist/v2/schema.cjs.map +0 -1
- package/dist/v2/schema.d.ts +0 -1
- package/schema/schema-v2.json +0 -266
- /package/dist/{v2/routing.d.ts → routing.d.ts} +0 -0
- /package/dist/{v2/routing.js → routing.js} +0 -0
- /package/dist/{v2/routing.js.map → routing.js.map} +0 -0
- /package/dist/{v2/schema.js → schema.js} +0 -0
- /package/dist/{v2/schema.js.map → schema.js.map} +0 -0
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { H as HostConfig, C as Config, R as Routing, V as Vercel, A as ApplicationConfig, O as Options } from './schema-2922d49e.js';
|
|
2
|
-
|
|
3
|
-
interface ApplicationOverrideConfig {
|
|
4
|
-
environment?: HostConfig;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Used to override the configuration for the application zone at runtime.
|
|
8
|
-
* The configuration is used by the `vercel-micro-frontends-overrides` cookie set by the Vercel Toolbar.
|
|
9
|
-
* The overrides config has the same shape as the `Config` type.
|
|
10
|
-
*/
|
|
11
|
-
interface OverridesConfig {
|
|
12
|
-
applications: Record<keyof Config['applications'], ApplicationOverrideConfig>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare const OVERRIDES_COOKIE_PREFIX = "vercel-micro-frontends-override";
|
|
16
|
-
declare class Overrides {
|
|
17
|
-
config: OverridesConfig;
|
|
18
|
-
constructor(config: OverridesConfig);
|
|
19
|
-
static overrideEnvCookiePrefix: string;
|
|
20
|
-
static getAppEnvOverrideCookieName(zone: string): string;
|
|
21
|
-
static isOverrideCookie(cookie: {
|
|
22
|
-
name?: string;
|
|
23
|
-
}): boolean;
|
|
24
|
-
static getOverrideFromCookie(cookie: {
|
|
25
|
-
name: string;
|
|
26
|
-
value?: string | null;
|
|
27
|
-
}): {
|
|
28
|
-
zone: string;
|
|
29
|
-
host: string;
|
|
30
|
-
} | undefined;
|
|
31
|
-
static parseOverrides(cookies: {
|
|
32
|
-
name: string;
|
|
33
|
-
value?: string | null;
|
|
34
|
-
}[]): OverridesConfig;
|
|
35
|
-
static validOverrideDomainsForZone(microfrontendConfig: MicrofrontendConfig, zone: string): string[];
|
|
36
|
-
static validateOverrideDomain(microfrontendConfig: MicrofrontendConfig, zone: string, domain: string): boolean;
|
|
37
|
-
serialize(): OverridesConfig;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface HostDisplayOptions {
|
|
41
|
-
includeDefaultPort?: boolean;
|
|
42
|
-
}
|
|
43
|
-
declare class Host {
|
|
44
|
-
protocol: 'http' | 'https';
|
|
45
|
-
host: HostConfig['host'];
|
|
46
|
-
port: number;
|
|
47
|
-
serialized: HostConfig;
|
|
48
|
-
constructor({ protocol, host, port }: HostConfig);
|
|
49
|
-
isLocal(): boolean;
|
|
50
|
-
static getPort({ protocol, port, }: {
|
|
51
|
-
protocol: HostConfig['protocol'];
|
|
52
|
-
port?: HostConfig['port'];
|
|
53
|
-
}): number;
|
|
54
|
-
isDefaultPort(): boolean;
|
|
55
|
-
toString(opts?: HostDisplayOptions): string;
|
|
56
|
-
toUrl(opts?: HostDisplayOptions): URL;
|
|
57
|
-
serialize(): HostConfig;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
declare class Application {
|
|
61
|
-
default: boolean;
|
|
62
|
-
routing?: Routing;
|
|
63
|
-
name: string;
|
|
64
|
-
development: {
|
|
65
|
-
local: Host;
|
|
66
|
-
fallback?: Host;
|
|
67
|
-
};
|
|
68
|
-
production: Host;
|
|
69
|
-
vercel?: Vercel;
|
|
70
|
-
overrides?: {
|
|
71
|
-
environment?: Host;
|
|
72
|
-
};
|
|
73
|
-
constructor(name: string, { app, overrides, }: {
|
|
74
|
-
app: ApplicationConfig;
|
|
75
|
-
overrides?: ApplicationOverrideConfig;
|
|
76
|
-
});
|
|
77
|
-
isDefault(): boolean;
|
|
78
|
-
static validate(name: string, app: ApplicationConfig): void;
|
|
79
|
-
serialize(): ApplicationConfig;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* A class to manage the microfrontends configuration.
|
|
84
|
-
*
|
|
85
|
-
* This class should not be used directly. Instead, use the `MicrofrontendConfig` or `MicrofrontendConfigEdgeRuntime` classes.
|
|
86
|
-
*/
|
|
87
|
-
declare class MicrofrontendConfigCommon {
|
|
88
|
-
config: Config;
|
|
89
|
-
name?: string;
|
|
90
|
-
zones: Record<string, Application>;
|
|
91
|
-
version: string;
|
|
92
|
-
overrides?: Overrides;
|
|
93
|
-
options?: Options;
|
|
94
|
-
$schema: string | undefined;
|
|
95
|
-
constructor({ config, overrides, }: {
|
|
96
|
-
config: Config;
|
|
97
|
-
overrides?: OverridesConfig;
|
|
98
|
-
});
|
|
99
|
-
isOverridesDisabled(): boolean;
|
|
100
|
-
protected static getConfigFromEnv(): string;
|
|
101
|
-
static fromEnv(_: {
|
|
102
|
-
cookies: {
|
|
103
|
-
name: string;
|
|
104
|
-
value: string;
|
|
105
|
-
}[];
|
|
106
|
-
}): MicrofrontendConfigCommon | Promise<MicrofrontendConfigCommon>;
|
|
107
|
-
getConfig(): Config;
|
|
108
|
-
getAllApplications(): Application[];
|
|
109
|
-
getZone(name: string): Application;
|
|
110
|
-
getApplicationByProjectId(projectId: string): Application | undefined;
|
|
111
|
-
getDefaultZone(): Application;
|
|
112
|
-
/**
|
|
113
|
-
* Returns the configured port for the local proxy
|
|
114
|
-
*/
|
|
115
|
-
getLocalProxyPort(): number;
|
|
116
|
-
/**
|
|
117
|
-
* Serializes the class back to the Schema type.
|
|
118
|
-
*
|
|
119
|
-
* NOTE: This is used when writing the config to disk and must always match the input Schema
|
|
120
|
-
*/
|
|
121
|
-
toSchemaJson(): Config;
|
|
122
|
-
serialize(): {
|
|
123
|
-
config: Config;
|
|
124
|
-
overrides?: OverridesConfig;
|
|
125
|
-
};
|
|
126
|
-
write(_: string): void;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* A class to manage the microfrontends configuration with config validation.
|
|
131
|
-
*
|
|
132
|
-
* Cannot be used by the middleware which runs in the Edge Runtime. For middleware use `MicrofrontendConfigEdgeRuntime`.
|
|
133
|
-
*/
|
|
134
|
-
declare class MicrofrontendConfig extends MicrofrontendConfigCommon {
|
|
135
|
-
static validate(configString: string): Config;
|
|
136
|
-
static fromEnv({ cookies, }: {
|
|
137
|
-
cookies: {
|
|
138
|
-
name: string;
|
|
139
|
-
value: string;
|
|
140
|
-
}[];
|
|
141
|
-
}): MicrofrontendConfig;
|
|
142
|
-
static fromFile({ filePath, }: {
|
|
143
|
-
filePath: string;
|
|
144
|
-
}): MicrofrontendConfig;
|
|
145
|
-
/**
|
|
146
|
-
* Writes the configuration to a file.
|
|
147
|
-
*/
|
|
148
|
-
write(fromApp: string, opts?: {
|
|
149
|
-
pretty?: boolean;
|
|
150
|
-
versions?: ('v1' | 'v2')[];
|
|
151
|
-
}): void;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export { ApplicationOverrideConfig as A, MicrofrontendConfig as M, OverridesConfig as O, MicrofrontendConfigCommon as a, OVERRIDES_COOKIE_PREFIX as b, Overrides as c };
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The unique identifier for a Microfrontend Application.
|
|
3
|
-
* Must match the `name` field of the application's `package.json`.
|
|
4
|
-
*/
|
|
5
|
-
type ApplicationId = string;
|
|
6
|
-
interface PathConfigurationOptions {
|
|
7
|
-
/**
|
|
8
|
-
* flag name that can be used to enable/disable all paths in the group
|
|
9
|
-
*/
|
|
10
|
-
flag?: string;
|
|
11
|
-
}
|
|
12
|
-
interface PathGroup {
|
|
13
|
-
/**
|
|
14
|
-
* Optional group name for the paths
|
|
15
|
-
*/
|
|
16
|
-
group?: string;
|
|
17
|
-
options?: PathConfigurationOptions;
|
|
18
|
-
paths: string[];
|
|
19
|
-
}
|
|
20
|
-
interface HostConfig {
|
|
21
|
-
/**
|
|
22
|
-
* The protocol to be used for the connection.
|
|
23
|
-
* - `http`: Hypertext Transfer Protocol (HTTP).
|
|
24
|
-
* - `https`: Secure Hypertext Transfer Protocol (HTTPS).
|
|
25
|
-
*
|
|
26
|
-
* * @defaultValue "https"
|
|
27
|
-
*/
|
|
28
|
-
protocol?: 'http' | 'https';
|
|
29
|
-
/**
|
|
30
|
-
* The hostname or IP address of the server.
|
|
31
|
-
* This can be a domain name (e.g., `example.com`) or an IP address (e.g., `192.168.1.1`).
|
|
32
|
-
*/
|
|
33
|
-
host: string;
|
|
34
|
-
/**
|
|
35
|
-
* The port number to be used for the connection.
|
|
36
|
-
* Common values include `80` for HTTP and `443` for HTTPS.
|
|
37
|
-
*
|
|
38
|
-
* This field is optional and can be omitted if the default ports for the specified protocol are used
|
|
39
|
-
*/
|
|
40
|
-
port?: number;
|
|
41
|
-
}
|
|
42
|
-
interface Development {
|
|
43
|
-
local: HostConfig;
|
|
44
|
-
/**
|
|
45
|
-
* Fallback for local development, could be a host config that points to any environment.
|
|
46
|
-
* If this is not provided, or the application is not running - requests to the application
|
|
47
|
-
* in local development will error.
|
|
48
|
-
*/
|
|
49
|
-
fallback?: HostConfig;
|
|
50
|
-
/**
|
|
51
|
-
* Optional task to run when starting the development server. Should reference a script in the package.json of the application.
|
|
52
|
-
*
|
|
53
|
-
* @defaultValue "dev"
|
|
54
|
-
*/
|
|
55
|
-
task?: string;
|
|
56
|
-
}
|
|
57
|
-
interface Vercel {
|
|
58
|
-
/**
|
|
59
|
-
* Vercel project ID
|
|
60
|
-
*/
|
|
61
|
-
projectId: string;
|
|
62
|
-
/**
|
|
63
|
-
* Vercel project name (temporary until we can use project ID)
|
|
64
|
-
*/
|
|
65
|
-
projectName?: string;
|
|
66
|
-
/**
|
|
67
|
-
* The default route for the application. Used to render screenshots, favicons, and provide direct zone links
|
|
68
|
-
*/
|
|
69
|
-
defaultRoute?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Whether to route Speed Insights to the default zone or each individual microfrontend.
|
|
72
|
-
*/
|
|
73
|
-
routeSpeedInsightsToDefaultZone?: boolean;
|
|
74
|
-
}
|
|
75
|
-
interface Routing {
|
|
76
|
-
/**
|
|
77
|
-
* [assetPrefix] for the application
|
|
78
|
-
*/
|
|
79
|
-
assetPrefix?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Path expressions that are routed to this application.
|
|
82
|
-
*/
|
|
83
|
-
matches: PathGroup[];
|
|
84
|
-
}
|
|
85
|
-
interface Module {
|
|
86
|
-
/**
|
|
87
|
-
* The name of the module - should be used when importing the module from another application
|
|
88
|
-
*/
|
|
89
|
-
name: string;
|
|
90
|
-
/**
|
|
91
|
-
* Relative path to the module within its `application`
|
|
92
|
-
*/
|
|
93
|
-
path: string;
|
|
94
|
-
}
|
|
95
|
-
interface Federation {
|
|
96
|
-
/**
|
|
97
|
-
* Modules that are exposed by this application
|
|
98
|
-
*/
|
|
99
|
-
exposes?: Module[];
|
|
100
|
-
/**
|
|
101
|
-
* Modules that are used by this application. Only the name of the module is required.
|
|
102
|
-
*/
|
|
103
|
-
uses?: string[];
|
|
104
|
-
}
|
|
105
|
-
interface ApplicationConfigCommon {
|
|
106
|
-
/**
|
|
107
|
-
* The default application is used no other application is matched via the routing config
|
|
108
|
-
*/
|
|
109
|
-
default: boolean;
|
|
110
|
-
routing?: Routing;
|
|
111
|
-
development: Development;
|
|
112
|
-
production: HostConfig;
|
|
113
|
-
metadata?: Record<string, string>;
|
|
114
|
-
federation?: Federation;
|
|
115
|
-
vercel?: Vercel;
|
|
116
|
-
}
|
|
117
|
-
interface DefaultApplicationConfig extends ApplicationConfigCommon {
|
|
118
|
-
default: true;
|
|
119
|
-
}
|
|
120
|
-
interface CommonApplicationConfig extends ApplicationConfigCommon {
|
|
121
|
-
default: false;
|
|
122
|
-
routing: Routing;
|
|
123
|
-
}
|
|
124
|
-
/** A Micro-Frontend Deployment Target */
|
|
125
|
-
type ApplicationConfig = DefaultApplicationConfig | CommonApplicationConfig;
|
|
126
|
-
type ApplicationConfigsById = Record<ApplicationId, ApplicationConfig>;
|
|
127
|
-
interface VercelOptions {
|
|
128
|
-
/**
|
|
129
|
-
* If your team uses a custom Preview Deployment Suffix, please specify it here.
|
|
130
|
-
* See https://vercel.com/docs/deployments/preview-deployment-suffix.
|
|
131
|
-
* The default is `vercel.app`.
|
|
132
|
-
*/
|
|
133
|
-
previewDeploymentSuffix?: string;
|
|
134
|
-
/**
|
|
135
|
-
* Team slug for the Vercel team
|
|
136
|
-
*/
|
|
137
|
-
teamSlug?: string;
|
|
138
|
-
/**
|
|
139
|
-
* If you want to disable the overrides for the site. For example, if you are managing rewrites
|
|
140
|
-
* between applications externally, you may wish to disable the overrides on the toolbar as
|
|
141
|
-
* they will have no effect.
|
|
142
|
-
*/
|
|
143
|
-
disableOverrides?: boolean;
|
|
144
|
-
}
|
|
145
|
-
interface Options {
|
|
146
|
-
/**
|
|
147
|
-
* Micro-Frontends wide options for Vercel.
|
|
148
|
-
*/
|
|
149
|
-
vercel?: VercelOptions;
|
|
150
|
-
/**
|
|
151
|
-
* Options for local proxy.
|
|
152
|
-
*/
|
|
153
|
-
localProxy?: LocalProxyOptions;
|
|
154
|
-
}
|
|
155
|
-
interface LocalProxyOptions {
|
|
156
|
-
/**
|
|
157
|
-
* The port number used by the local proxy server.
|
|
158
|
-
*
|
|
159
|
-
* The default is `3024`.
|
|
160
|
-
*/
|
|
161
|
-
port?: number;
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Configuration for micro-frontend applications
|
|
165
|
-
*
|
|
166
|
-
* TODO: Add proxy configuration
|
|
167
|
-
*/
|
|
168
|
-
interface Config {
|
|
169
|
-
version: string;
|
|
170
|
-
$schema?: string;
|
|
171
|
-
/**
|
|
172
|
-
* Name for the micro-frontend site (eg. "vercel.com", "vercel-site" etc.).
|
|
173
|
-
*/
|
|
174
|
-
name?: string;
|
|
175
|
-
applications: ApplicationConfigsById;
|
|
176
|
-
/**
|
|
177
|
-
* Optional configuration for the entire micro-frontends setup.
|
|
178
|
-
*/
|
|
179
|
-
options?: Options;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
export { ApplicationConfig as A, Config as C, DefaultApplicationConfig as D, HostConfig as H, Options as O, Routing as R, Vercel as V, CommonApplicationConfig as a };
|