@vercel/microfrontends 0.9.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 (100) hide show
  1. package/README.md +202 -0
  2. package/cli/index.cjs +21 -0
  3. package/dist/bin/cli.cjs +1604 -0
  4. package/dist/config/client.cjs +54 -0
  5. package/dist/config/client.cjs.map +1 -0
  6. package/dist/config/client.d.ts +23 -0
  7. package/dist/config/client.js +28 -0
  8. package/dist/config/client.js.map +1 -0
  9. package/dist/config/edge.cjs +508 -0
  10. package/dist/config/edge.cjs.map +1 -0
  11. package/dist/config/edge.d.ts +20 -0
  12. package/dist/config/edge.js +481 -0
  13. package/dist/config/edge.js.map +1 -0
  14. package/dist/config.cjs +1254 -0
  15. package/dist/config.cjs.map +1 -0
  16. package/dist/config.d.ts +25 -0
  17. package/dist/config.js +1212 -0
  18. package/dist/config.js.map +1 -0
  19. package/dist/index-eff254d8.d.ts +175 -0
  20. package/dist/micro-frontend-config-42886104.d.ts +154 -0
  21. package/dist/next/client.cjs +3 -0
  22. package/dist/next/client.cjs.map +1 -0
  23. package/dist/next/client.d.ts +45 -0
  24. package/dist/next/client.js +3 -0
  25. package/dist/next/client.js.map +1 -0
  26. package/dist/next/config.cjs +1793 -0
  27. package/dist/next/config.cjs.map +1 -0
  28. package/dist/next/config.d.ts +22 -0
  29. package/dist/next/config.js +1758 -0
  30. package/dist/next/config.js.map +1 -0
  31. package/dist/next/endpoints.cjs +82 -0
  32. package/dist/next/endpoints.cjs.map +1 -0
  33. package/dist/next/endpoints.d.ts +15 -0
  34. package/dist/next/endpoints.js +57 -0
  35. package/dist/next/endpoints.js.map +1 -0
  36. package/dist/next/middleware.cjs +763 -0
  37. package/dist/next/middleware.cjs.map +1 -0
  38. package/dist/next/middleware.d.ts +29 -0
  39. package/dist/next/middleware.js +735 -0
  40. package/dist/next/middleware.js.map +1 -0
  41. package/dist/next/testing.cjs +1430 -0
  42. package/dist/next/testing.cjs.map +1 -0
  43. package/dist/next/testing.d.ts +53 -0
  44. package/dist/next/testing.js +1389 -0
  45. package/dist/next/testing.js.map +1 -0
  46. package/dist/overrides.cjs +143 -0
  47. package/dist/overrides.cjs.map +1 -0
  48. package/dist/overrides.d.ts +2 -0
  49. package/dist/overrides.js +115 -0
  50. package/dist/overrides.js.map +1 -0
  51. package/dist/schema-83a75e61.d.ts +188 -0
  52. package/dist/types-4fd1c7c6.d.ts +157 -0
  53. package/dist/v2/config.cjs +720 -0
  54. package/dist/v2/config.cjs.map +1 -0
  55. package/dist/v2/config.d.ts +2 -0
  56. package/dist/v2/config.js +695 -0
  57. package/dist/v2/config.js.map +1 -0
  58. package/dist/v2/microfrontends/server.cjs +1312 -0
  59. package/dist/v2/microfrontends/server.cjs.map +1 -0
  60. package/dist/v2/microfrontends/server.d.ts +48 -0
  61. package/dist/v2/microfrontends/server.js +1277 -0
  62. package/dist/v2/microfrontends/server.js.map +1 -0
  63. package/dist/v2/microfrontends.cjs +803 -0
  64. package/dist/v2/microfrontends.cjs.map +1 -0
  65. package/dist/v2/microfrontends.d.ts +44 -0
  66. package/dist/v2/microfrontends.js +776 -0
  67. package/dist/v2/microfrontends.js.map +1 -0
  68. package/dist/v2/next/client.cjs +3 -0
  69. package/dist/v2/next/client.cjs.map +1 -0
  70. package/dist/v2/next/client.d.ts +45 -0
  71. package/dist/v2/next/client.js +3 -0
  72. package/dist/v2/next/client.js.map +1 -0
  73. package/dist/v2/next/config.cjs +1829 -0
  74. package/dist/v2/next/config.cjs.map +1 -0
  75. package/dist/v2/next/config.d.ts +22 -0
  76. package/dist/v2/next/config.js +1794 -0
  77. package/dist/v2/next/config.js.map +1 -0
  78. package/dist/v2/next/endpoints.cjs +138 -0
  79. package/dist/v2/next/endpoints.cjs.map +1 -0
  80. package/dist/v2/next/endpoints.d.ts +15 -0
  81. package/dist/v2/next/endpoints.js +113 -0
  82. package/dist/v2/next/endpoints.js.map +1 -0
  83. package/dist/v2/next/middleware.cjs +1110 -0
  84. package/dist/v2/next/middleware.cjs.map +1 -0
  85. package/dist/v2/next/middleware.d.ts +29 -0
  86. package/dist/v2/next/middleware.js +1082 -0
  87. package/dist/v2/next/middleware.js.map +1 -0
  88. package/dist/v2/schema.cjs +19 -0
  89. package/dist/v2/schema.cjs.map +1 -0
  90. package/dist/v2/schema.d.ts +1 -0
  91. package/dist/v2/schema.js +1 -0
  92. package/dist/v2/schema.js.map +1 -0
  93. package/dist/validation.cjs +754 -0
  94. package/dist/validation.cjs.map +1 -0
  95. package/dist/validation.d.ts +163 -0
  96. package/dist/validation.js +726 -0
  97. package/dist/validation.js.map +1 -0
  98. package/package.json +204 -0
  99. package/schema/schema-v2.json +288 -0
  100. package/schema/schema.json +352 -0
@@ -0,0 +1,352 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$ref": "#/definitions/Config",
4
+ "definitions": {
5
+ "Config": {
6
+ "type": "object",
7
+ "properties": {
8
+ "version": {
9
+ "type": "string"
10
+ },
11
+ "$schema": {
12
+ "type": "string"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "description": "Name for the micro-frontend site (eg. \"vercel.com\", \"vercel-site\" etc.)."
17
+ },
18
+ "applications": {
19
+ "$ref": "#/definitions/ApplicationConfigsById"
20
+ },
21
+ "options": {
22
+ "$ref": "#/definitions/Options",
23
+ "description": "Optional configuration for the entire micro-frontends setup."
24
+ }
25
+ },
26
+ "required": [
27
+ "version",
28
+ "applications"
29
+ ],
30
+ "description": "Configuration for micro-frontend applications\n\nTODO: Add proxy configuration"
31
+ },
32
+ "ApplicationConfigsById": {
33
+ "type": "object",
34
+ "additionalProperties": {
35
+ "$ref": "#/definitions/ApplicationConfig"
36
+ }
37
+ },
38
+ "ApplicationConfig": {
39
+ "anyOf": [
40
+ {
41
+ "$ref": "#/definitions/DefaultApplicationConfig"
42
+ },
43
+ {
44
+ "$ref": "#/definitions/CommonApplicationConfig"
45
+ }
46
+ ],
47
+ "description": "A Micro-Frontend Deployment Target"
48
+ },
49
+ "DefaultApplicationConfig": {
50
+ "type": "object",
51
+ "properties": {
52
+ "default": {
53
+ "type": "boolean",
54
+ "const": true,
55
+ "description": "The default application is used no other application is matched via the routing config"
56
+ },
57
+ "routing": {
58
+ "$ref": "#/definitions/Routing"
59
+ },
60
+ "development": {
61
+ "type": "object",
62
+ "properties": {
63
+ "local": {
64
+ "$ref": "#/definitions/HostConfig"
65
+ },
66
+ "fallback": {
67
+ "$ref": "#/definitions/HostConfig",
68
+ "description": "Fallback for local development, could be a host config that points to any environment. If this is not provided, or the application is not running - requests to the application in local development will error."
69
+ },
70
+ "task": {
71
+ "type": "string",
72
+ "description": "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
73
+ }
74
+ },
75
+ "required": [
76
+ "local"
77
+ ]
78
+ },
79
+ "production": {
80
+ "$ref": "#/definitions/HostConfig"
81
+ },
82
+ "metadata": {
83
+ "type": "object",
84
+ "additionalProperties": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ "federation": {
89
+ "type": "object",
90
+ "properties": {
91
+ "exposes": {
92
+ "type": "array",
93
+ "items": {
94
+ "type": "object",
95
+ "properties": {
96
+ "name": {
97
+ "type": "string",
98
+ "description": "The name of the module - should be used when importing the module from another application"
99
+ },
100
+ "path": {
101
+ "type": "string",
102
+ "description": "Relative path to the module within its `application`"
103
+ }
104
+ },
105
+ "required": [
106
+ "name",
107
+ "path"
108
+ ]
109
+ },
110
+ "description": "Modules that are exposed by this application"
111
+ },
112
+ "uses": {
113
+ "type": "array",
114
+ "items": {
115
+ "type": "string"
116
+ },
117
+ "description": "Modules that are used by this application. Only the name of the module is required."
118
+ }
119
+ }
120
+ },
121
+ "vercel": {
122
+ "$ref": "#/definitions/Vercel"
123
+ }
124
+ },
125
+ "required": [
126
+ "default",
127
+ "development",
128
+ "production"
129
+ ]
130
+ },
131
+ "Routing": {
132
+ "type": "object",
133
+ "properties": {
134
+ "assetPrefix": {
135
+ "type": "string",
136
+ "description": "[assetPrefix] for the application"
137
+ },
138
+ "matches": {
139
+ "type": "array",
140
+ "items": {
141
+ "$ref": "#/definitions/PathGroup"
142
+ },
143
+ "description": "Path expressions that are routed to this application."
144
+ }
145
+ },
146
+ "required": [
147
+ "matches"
148
+ ]
149
+ },
150
+ "PathGroup": {
151
+ "type": "object",
152
+ "properties": {
153
+ "group": {
154
+ "type": "string",
155
+ "description": "Optional group name for the paths"
156
+ },
157
+ "options": {
158
+ "type": "object",
159
+ "properties": {
160
+ "flag": {
161
+ "type": "string",
162
+ "description": "flag name that can be used to enable/disable all paths in the group"
163
+ },
164
+ "routeToDefaultApplication": {
165
+ "type": "boolean",
166
+ "description": "True to route the request to the default application for this micro-frontends set-up. This must be `true` when using `flag` or when you want to use custom logic to make the routing decision for this group of paths."
167
+ }
168
+ }
169
+ },
170
+ "paths": {
171
+ "type": "array",
172
+ "items": {
173
+ "type": "string"
174
+ }
175
+ }
176
+ },
177
+ "required": [
178
+ "paths"
179
+ ]
180
+ },
181
+ "HostConfig": {
182
+ "type": "object",
183
+ "properties": {
184
+ "protocol": {
185
+ "type": "string",
186
+ "enum": [
187
+ "http",
188
+ "https"
189
+ ],
190
+ "description": "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n* @defaultValue \"https\""
191
+ },
192
+ "host": {
193
+ "type": "string",
194
+ "description": "The hostname or IP address of the server. This can be a domain name (e.g., `example.com`) or an IP address (e.g., `192.168.1.1`)."
195
+ },
196
+ "port": {
197
+ "type": "number",
198
+ "description": "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS.\n\nThis field is optional and can be omitted if the default ports for the specified protocol are used"
199
+ }
200
+ },
201
+ "required": [
202
+ "host"
203
+ ]
204
+ },
205
+ "Vercel": {
206
+ "type": "object",
207
+ "properties": {
208
+ "projectId": {
209
+ "type": "string",
210
+ "description": "Vercel project ID"
211
+ },
212
+ "projectName": {
213
+ "type": "string",
214
+ "description": "Vercel project name (temporary until we can use project ID)"
215
+ },
216
+ "defaultRoute": {
217
+ "type": "string",
218
+ "description": "The default route for the application. Used to render screenshots, favicons, and provide direct zone links"
219
+ },
220
+ "routeSpeedInsightsToDefaultZone": {
221
+ "type": "boolean",
222
+ "description": "Whether to route Speed Insights to the default zone or each individual microfrontend."
223
+ }
224
+ },
225
+ "required": [
226
+ "projectId"
227
+ ]
228
+ },
229
+ "CommonApplicationConfig": {
230
+ "type": "object",
231
+ "properties": {
232
+ "default": {
233
+ "type": "boolean",
234
+ "const": false,
235
+ "description": "The default application is used no other application is matched via the routing config"
236
+ },
237
+ "routing": {
238
+ "$ref": "#/definitions/Routing"
239
+ },
240
+ "development": {
241
+ "type": "object",
242
+ "properties": {
243
+ "local": {
244
+ "$ref": "#/definitions/HostConfig"
245
+ },
246
+ "fallback": {
247
+ "$ref": "#/definitions/HostConfig",
248
+ "description": "Fallback for local development, could be a host config that points to any environment. If this is not provided, or the application is not running - requests to the application in local development will error."
249
+ },
250
+ "task": {
251
+ "type": "string",
252
+ "description": "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
253
+ }
254
+ },
255
+ "required": [
256
+ "local"
257
+ ]
258
+ },
259
+ "production": {
260
+ "$ref": "#/definitions/HostConfig"
261
+ },
262
+ "metadata": {
263
+ "type": "object",
264
+ "additionalProperties": {
265
+ "type": "string"
266
+ }
267
+ },
268
+ "federation": {
269
+ "type": "object",
270
+ "properties": {
271
+ "exposes": {
272
+ "type": "array",
273
+ "items": {
274
+ "type": "object",
275
+ "properties": {
276
+ "name": {
277
+ "type": "string",
278
+ "description": "The name of the module - should be used when importing the module from another application"
279
+ },
280
+ "path": {
281
+ "type": "string",
282
+ "description": "Relative path to the module within its `application`"
283
+ }
284
+ },
285
+ "required": [
286
+ "name",
287
+ "path"
288
+ ]
289
+ },
290
+ "description": "Modules that are exposed by this application"
291
+ },
292
+ "uses": {
293
+ "type": "array",
294
+ "items": {
295
+ "type": "string"
296
+ },
297
+ "description": "Modules that are used by this application. Only the name of the module is required."
298
+ }
299
+ }
300
+ },
301
+ "vercel": {
302
+ "$ref": "#/definitions/Vercel"
303
+ }
304
+ },
305
+ "required": [
306
+ "default",
307
+ "development",
308
+ "production",
309
+ "routing"
310
+ ]
311
+ },
312
+ "Options": {
313
+ "type": "object",
314
+ "properties": {
315
+ "vercel": {
316
+ "$ref": "#/definitions/VercelOptions",
317
+ "description": "Micro-Frontends wide options for Vercel."
318
+ },
319
+ "localProxy": {
320
+ "$ref": "#/definitions/LocalProxyOptions",
321
+ "description": "Options for local proxy."
322
+ }
323
+ }
324
+ },
325
+ "VercelOptions": {
326
+ "type": "object",
327
+ "properties": {
328
+ "previewDeploymentSuffix": {
329
+ "type": "string",
330
+ "description": "If your team uses a custom Preview Deployment Suffix, please specify it here. See https://vercel.com/docs/deployments/preview-deployment-suffix. The default is `vercel.app`."
331
+ },
332
+ "teamSlug": {
333
+ "type": "string",
334
+ "description": "Team slug for the Vercel team"
335
+ },
336
+ "disableOverrides": {
337
+ "type": "boolean",
338
+ "description": "If you want to disable the overrides for the site. For example, if you are managing rewrites between applications externally, you may wish to disable the overrides on the toolbar as they will have no effect."
339
+ }
340
+ }
341
+ },
342
+ "LocalProxyOptions": {
343
+ "type": "object",
344
+ "properties": {
345
+ "port": {
346
+ "type": "number",
347
+ "description": "The port number used by the local proxy server.\n\nThe default is `3024`."
348
+ }
349
+ }
350
+ }
351
+ }
352
+ }