@vercel/microfrontends 0.17.4 → 0.19.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.
Files changed (53) hide show
  1. package/README.md +7 -159
  2. package/dist/bin/cli.cjs +202 -139
  3. package/dist/config.cjs +103 -57
  4. package/dist/config.cjs.map +1 -1
  5. package/dist/config.d.ts +4 -4
  6. package/dist/config.js +103 -57
  7. package/dist/config.js.map +1 -1
  8. package/dist/{index-f094deb1.d.ts → index-09b1ddf9.d.ts} +16 -19
  9. package/dist/{index-5fcf0863.d.ts → index-2f78c0ca.d.ts} +44 -17
  10. package/dist/microfrontends/server.cjs +180 -133
  11. package/dist/microfrontends/server.cjs.map +1 -1
  12. package/dist/microfrontends/server.d.ts +4 -4
  13. package/dist/microfrontends/server.js +180 -133
  14. package/dist/microfrontends/server.js.map +1 -1
  15. package/dist/microfrontends.cjs +104 -58
  16. package/dist/microfrontends.cjs.map +1 -1
  17. package/dist/microfrontends.d.ts +4 -4
  18. package/dist/microfrontends.js +104 -58
  19. package/dist/microfrontends.js.map +1 -1
  20. package/dist/next/client.cjs +1 -1
  21. package/dist/next/client.cjs.map +1 -1
  22. package/dist/next/client.d.ts +1 -1
  23. package/dist/next/client.js +1 -1
  24. package/dist/next/client.js.map +1 -1
  25. package/dist/next/config.cjs +197 -145
  26. package/dist/next/config.cjs.map +1 -1
  27. package/dist/next/config.js +197 -145
  28. package/dist/next/config.js.map +1 -1
  29. package/dist/next/endpoints.d.ts +2 -2
  30. package/dist/next/middleware.cjs +121 -80
  31. package/dist/next/middleware.cjs.map +1 -1
  32. package/dist/next/middleware.js +121 -80
  33. package/dist/next/middleware.js.map +1 -1
  34. package/dist/next/testing.cjs +110 -63
  35. package/dist/next/testing.cjs.map +1 -1
  36. package/dist/next/testing.d.ts +4 -4
  37. package/dist/next/testing.js +110 -63
  38. package/dist/next/testing.js.map +1 -1
  39. package/dist/overrides.d.ts +3 -3
  40. package/dist/schema.d.ts +1 -1
  41. package/dist/{types-5900be7c.d.ts → types-4ef2bddb.d.ts} +1 -1
  42. package/dist/{types-ecd7b91b.d.ts → types-b6d38aea.d.ts} +1 -1
  43. package/dist/utils/mfe-port.cjs +181 -134
  44. package/dist/utils/mfe-port.cjs.map +1 -1
  45. package/dist/utils/mfe-port.js +181 -134
  46. package/dist/utils/mfe-port.js.map +1 -1
  47. package/dist/validation.cjs +74 -73
  48. package/dist/validation.cjs.map +1 -1
  49. package/dist/validation.d.ts +1 -1
  50. package/dist/validation.js +74 -73
  51. package/dist/validation.js.map +1 -1
  52. package/package.json +19 -3
  53. package/schema/schema.json +80 -73
@@ -3,12 +3,6 @@ interface CommonConfig {
3
3
  $schema?: string;
4
4
  version?: '1';
5
5
  options?: Options;
6
- /**
7
- * Applications that only serve a subset of the microfrontend routes
8
- * only need to reference the name of the primary application that owns the
9
- * full microfrontends configuration.
10
- */
11
- remotes?: Record<ApplicationId, Application>;
12
6
  }
13
7
  interface MainConfig extends CommonConfig {
14
8
  /**
@@ -61,7 +55,6 @@ interface HostConfig {
61
55
  /**
62
56
  * The port number to be used for the connection.
63
57
  * Common values include `80` for HTTP and `443` for HTTPS.
64
- *
65
58
  */
66
59
  port?: number;
67
60
  }
@@ -73,13 +66,25 @@ type LocalHostConfig = Omit<HostConfig, 'host'> & {
73
66
  host?: string;
74
67
  };
75
68
  interface Development {
69
+ /**
70
+ * @deprecated This is being replaced by the `localPort` field below.
71
+ */
76
72
  local?: LocalHostConfig;
73
+ /**
74
+ * The local port number that this application runs on when it is running locally.
75
+ * Common values include `80` for HTTP and `443` for HTTPS.
76
+ */
77
+ localPort?: number;
77
78
  /**
78
79
  * Fallback for local development, could be a host config that points to any environment.
79
80
  * If this is not provided, or the application is not running - requests to the application
80
81
  * in local development will error.
82
+ *
83
+ * If passing a string, include the protocol (optional), host (required) and port (optional).
84
+ * For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTPS. If
85
+ * omitted, the port defaults to `80` for HTTP and `443` for HTTPS.
81
86
  */
82
- fallback?: HostConfig;
87
+ fallback?: HostConfig | string;
83
88
  /**
84
89
  * Optional task to run when starting the development server. Should reference a script in the package.json of the application.
85
90
  *
@@ -89,18 +94,28 @@ interface Development {
89
94
  }
90
95
  type Application = DefaultApplication | ChildApplication;
91
96
  interface CommonApplication {
97
+ /**
98
+ * @deprecated This is being replaced by the `projectId` field below.
99
+ */
92
100
  vercel?: Vercel;
93
- development?: Development;
101
+ /**
102
+ * Vercel project ID
103
+ */
104
+ projectId?: string;
105
+ /**
106
+ * @deprecated This is a duplicate of the `development.fallback` field and this will be removed soon.
107
+ */
108
+ production?: HostConfig;
94
109
  }
95
110
  interface DefaultApplication extends CommonApplication {
96
- production: HostConfig;
111
+ development?: Development;
97
112
  }
98
113
  interface ChildApplication extends CommonApplication {
114
+ development?: Development;
99
115
  /**
100
116
  * Groups of path expressions that are routed to this application.
101
117
  */
102
118
  routing: Routing;
103
- production?: HostConfig;
104
119
  }
105
120
  interface Vercel {
106
121
  /**
@@ -109,10 +124,6 @@ interface Vercel {
109
124
  projectId: string;
110
125
  }
111
126
  interface VercelOptions {
112
- /**
113
- * Team slug for the Vercel team
114
- */
115
- teamSlug?: string;
116
127
  /**
117
128
  * If you want to disable the overrides for the site. For example, if you are managing rewrites
118
129
  * between applications externally, you may wish to disable the overrides on the toolbar as
@@ -122,13 +133,29 @@ interface VercelOptions {
122
133
  }
123
134
  interface Options {
124
135
  /**
125
- * Micro-Frontends wide options for Vercel.
136
+ * Microfrontends wide options for Vercel.
137
+ *
138
+ * @deprecated This is being replaced by the `disableOverrides` field below.
126
139
  */
127
140
  vercel?: VercelOptions;
141
+ /**
142
+ * If you want to disable the overrides for the site. For example, if you are managing rewrites
143
+ * between applications externally, you may wish to disable the overrides on the toolbar as
144
+ * they will have no effect.
145
+ */
146
+ disableOverrides?: boolean;
128
147
  /**
129
148
  * Options for local proxy.
149
+ *
150
+ * @deprecated This is being replaced by the `localProxyPort` field below.
130
151
  */
131
152
  localProxy?: LocalProxyOptions;
153
+ /**
154
+ * The port number used by the local proxy server.
155
+ *
156
+ * The default is `3024`.
157
+ */
158
+ localProxyPort?: number;
132
159
  }
133
160
  interface LocalProxyOptions {
134
161
  /**
@@ -139,4 +166,4 @@ interface LocalProxyOptions {
139
166
  port?: number;
140
167
  }
141
168
 
142
- export { ApplicationId as A, Config as C, DefaultApplication as D, HostConfig as H, LocalHostConfig as L, MainConfig as M, PathGroup as P, Vercel as V, ChildConfig as a, ChildApplication as b, Application as c };
169
+ export { ApplicationId as A, Config as C, DefaultApplication as D, HostConfig as H, LocalHostConfig as L, MainConfig as M, PathGroup as P, ChildConfig as a, ChildApplication as b, Application as c };