@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
package/dist/validation.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/config
|
|
1
|
+
// src/config/microfrontends/server/validation.ts
|
|
2
2
|
import { parse } from "jsonc-parser";
|
|
3
3
|
import { Ajv } from "ajv";
|
|
4
4
|
|
|
@@ -94,8 +94,8 @@ var MicrofrontendError = class extends Error {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
// schema/schema
|
|
98
|
-
var
|
|
97
|
+
// schema/schema.json
|
|
98
|
+
var schema_default = {
|
|
99
99
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
100
100
|
$ref: "#/definitions/Config",
|
|
101
101
|
definitions: {
|
|
@@ -134,7 +134,8 @@ var schema_v2_default = {
|
|
|
134
134
|
description: "Mapping of application names to the routes that they host. Only needs to be defined in the application that owns the primary microfrontend domain"
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
|
-
required: ["applications", "version"]
|
|
137
|
+
required: ["applications", "version"],
|
|
138
|
+
additionalProperties: false
|
|
138
139
|
},
|
|
139
140
|
Options: {
|
|
140
141
|
type: "object",
|
|
@@ -147,7 +148,8 @@ var schema_v2_default = {
|
|
|
147
148
|
$ref: "#/definitions/LocalProxyOptions",
|
|
148
149
|
description: "Options for local proxy."
|
|
149
150
|
}
|
|
150
|
-
}
|
|
151
|
+
},
|
|
152
|
+
additionalProperties: false
|
|
151
153
|
},
|
|
152
154
|
VercelOptions: {
|
|
153
155
|
type: "object",
|
|
@@ -160,7 +162,8 @@ var schema_v2_default = {
|
|
|
160
162
|
type: "boolean",
|
|
161
163
|
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."
|
|
162
164
|
}
|
|
163
|
-
}
|
|
165
|
+
},
|
|
166
|
+
additionalProperties: false
|
|
164
167
|
},
|
|
165
168
|
LocalProxyOptions: {
|
|
166
169
|
type: "object",
|
|
@@ -169,7 +172,8 @@ var schema_v2_default = {
|
|
|
169
172
|
type: "number",
|
|
170
173
|
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
171
174
|
}
|
|
172
|
-
}
|
|
175
|
+
},
|
|
176
|
+
additionalProperties: false
|
|
173
177
|
},
|
|
174
178
|
Application: {
|
|
175
179
|
anyOf: [
|
|
@@ -194,7 +198,8 @@ var schema_v2_default = {
|
|
|
194
198
|
$ref: "#/definitions/HostConfig"
|
|
195
199
|
}
|
|
196
200
|
},
|
|
197
|
-
required: ["production"]
|
|
201
|
+
required: ["production"],
|
|
202
|
+
additionalProperties: false
|
|
198
203
|
},
|
|
199
204
|
Vercel: {
|
|
200
205
|
type: "object",
|
|
@@ -204,7 +209,8 @@ var schema_v2_default = {
|
|
|
204
209
|
description: "Vercel project ID"
|
|
205
210
|
}
|
|
206
211
|
},
|
|
207
|
-
required: ["projectId"]
|
|
212
|
+
required: ["projectId"],
|
|
213
|
+
additionalProperties: false
|
|
208
214
|
},
|
|
209
215
|
Development: {
|
|
210
216
|
type: "object",
|
|
@@ -220,10 +226,12 @@ var schema_v2_default = {
|
|
|
220
226
|
type: "string",
|
|
221
227
|
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
222
228
|
}
|
|
223
|
-
}
|
|
229
|
+
},
|
|
230
|
+
additionalProperties: false
|
|
224
231
|
},
|
|
225
232
|
LocalHostConfig: {
|
|
226
233
|
type: "object",
|
|
234
|
+
additionalProperties: false,
|
|
227
235
|
properties: {
|
|
228
236
|
host: {
|
|
229
237
|
type: "string",
|
|
@@ -257,7 +265,8 @@ var schema_v2_default = {
|
|
|
257
265
|
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
258
266
|
}
|
|
259
267
|
},
|
|
260
|
-
required: ["host"]
|
|
268
|
+
required: ["host"],
|
|
269
|
+
additionalProperties: false
|
|
261
270
|
},
|
|
262
271
|
ChildApplication: {
|
|
263
272
|
type: "object",
|
|
@@ -276,7 +285,8 @@ var schema_v2_default = {
|
|
|
276
285
|
$ref: "#/definitions/HostConfig"
|
|
277
286
|
}
|
|
278
287
|
},
|
|
279
|
-
required: ["routing"]
|
|
288
|
+
required: ["routing"],
|
|
289
|
+
additionalProperties: false
|
|
280
290
|
},
|
|
281
291
|
Routing: {
|
|
282
292
|
type: "array",
|
|
@@ -302,7 +312,8 @@ var schema_v2_default = {
|
|
|
302
312
|
}
|
|
303
313
|
}
|
|
304
314
|
},
|
|
305
|
-
required: ["paths"]
|
|
315
|
+
required: ["paths"],
|
|
316
|
+
additionalProperties: false
|
|
306
317
|
},
|
|
307
318
|
ApplicationRouting: {
|
|
308
319
|
type: "object",
|
|
@@ -335,15 +346,16 @@ var schema_v2_default = {
|
|
|
335
346
|
description: "Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration."
|
|
336
347
|
}
|
|
337
348
|
},
|
|
338
|
-
required: ["partOf", "version"]
|
|
349
|
+
required: ["partOf", "version"],
|
|
350
|
+
additionalProperties: false
|
|
339
351
|
}
|
|
340
352
|
}
|
|
341
353
|
};
|
|
342
354
|
|
|
343
|
-
// src/config
|
|
344
|
-
var SCHEMA =
|
|
355
|
+
// src/config/schema/utils/load.ts
|
|
356
|
+
var SCHEMA = schema_default;
|
|
345
357
|
|
|
346
|
-
// src/config
|
|
358
|
+
// src/config/microfrontends/server/validation.ts
|
|
347
359
|
function validateSchema(configString) {
|
|
348
360
|
const parsedConfig = parse(configString);
|
|
349
361
|
const ajv = new Ajv();
|
|
@@ -357,348 +369,7 @@ function validateSchema(configString) {
|
|
|
357
369
|
}
|
|
358
370
|
return parsedConfig;
|
|
359
371
|
}
|
|
360
|
-
|
|
361
|
-
// src/config/validation.ts
|
|
362
|
-
import { parse as parse2 } from "jsonc-parser";
|
|
363
|
-
import { pathToRegexp, parse as parsePathRegexp } from "path-to-regexp";
|
|
364
|
-
import { Ajv as Ajv2 } from "ajv";
|
|
365
|
-
|
|
366
|
-
// schema/schema.json
|
|
367
|
-
var schema_default = {
|
|
368
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
369
|
-
$ref: "#/definitions/Config",
|
|
370
|
-
definitions: {
|
|
371
|
-
Config: {
|
|
372
|
-
type: "object",
|
|
373
|
-
properties: {
|
|
374
|
-
version: {
|
|
375
|
-
type: "string"
|
|
376
|
-
},
|
|
377
|
-
$schema: {
|
|
378
|
-
type: "string"
|
|
379
|
-
},
|
|
380
|
-
name: {
|
|
381
|
-
type: "string",
|
|
382
|
-
description: 'Name for the micro-frontend site (eg. "vercel.com", "vercel-site" etc.).'
|
|
383
|
-
},
|
|
384
|
-
applications: {
|
|
385
|
-
$ref: "#/definitions/ApplicationConfigsById"
|
|
386
|
-
},
|
|
387
|
-
options: {
|
|
388
|
-
$ref: "#/definitions/Options",
|
|
389
|
-
description: "Optional configuration for the entire micro-frontends setup."
|
|
390
|
-
}
|
|
391
|
-
},
|
|
392
|
-
required: ["version", "applications"],
|
|
393
|
-
description: "Configuration for micro-frontend applications\n\nTODO: Add proxy configuration"
|
|
394
|
-
},
|
|
395
|
-
ApplicationConfigsById: {
|
|
396
|
-
type: "object",
|
|
397
|
-
additionalProperties: {
|
|
398
|
-
$ref: "#/definitions/ApplicationConfig"
|
|
399
|
-
}
|
|
400
|
-
},
|
|
401
|
-
ApplicationConfig: {
|
|
402
|
-
anyOf: [
|
|
403
|
-
{
|
|
404
|
-
$ref: "#/definitions/DefaultApplicationConfig"
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
$ref: "#/definitions/CommonApplicationConfig"
|
|
408
|
-
}
|
|
409
|
-
],
|
|
410
|
-
description: "A Micro-Frontend Deployment Target"
|
|
411
|
-
},
|
|
412
|
-
DefaultApplicationConfig: {
|
|
413
|
-
type: "object",
|
|
414
|
-
properties: {
|
|
415
|
-
default: {
|
|
416
|
-
type: "boolean",
|
|
417
|
-
const: true,
|
|
418
|
-
description: "The default application is used no other application is matched via the routing config"
|
|
419
|
-
},
|
|
420
|
-
routing: {
|
|
421
|
-
$ref: "#/definitions/Routing"
|
|
422
|
-
},
|
|
423
|
-
development: {
|
|
424
|
-
type: "object",
|
|
425
|
-
properties: {
|
|
426
|
-
local: {
|
|
427
|
-
$ref: "#/definitions/HostConfig"
|
|
428
|
-
},
|
|
429
|
-
fallback: {
|
|
430
|
-
$ref: "#/definitions/HostConfig",
|
|
431
|
-
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."
|
|
432
|
-
},
|
|
433
|
-
task: {
|
|
434
|
-
type: "string",
|
|
435
|
-
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
436
|
-
}
|
|
437
|
-
},
|
|
438
|
-
required: ["local"]
|
|
439
|
-
},
|
|
440
|
-
production: {
|
|
441
|
-
$ref: "#/definitions/HostConfig"
|
|
442
|
-
},
|
|
443
|
-
metadata: {
|
|
444
|
-
type: "object",
|
|
445
|
-
additionalProperties: {
|
|
446
|
-
type: "string"
|
|
447
|
-
}
|
|
448
|
-
},
|
|
449
|
-
federation: {
|
|
450
|
-
type: "object",
|
|
451
|
-
properties: {
|
|
452
|
-
exposes: {
|
|
453
|
-
type: "array",
|
|
454
|
-
items: {
|
|
455
|
-
type: "object",
|
|
456
|
-
properties: {
|
|
457
|
-
name: {
|
|
458
|
-
type: "string",
|
|
459
|
-
description: "The name of the module - should be used when importing the module from another application"
|
|
460
|
-
},
|
|
461
|
-
path: {
|
|
462
|
-
type: "string",
|
|
463
|
-
description: "Relative path to the module within its `application`"
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
required: ["name", "path"]
|
|
467
|
-
},
|
|
468
|
-
description: "Modules that are exposed by this application"
|
|
469
|
-
},
|
|
470
|
-
uses: {
|
|
471
|
-
type: "array",
|
|
472
|
-
items: {
|
|
473
|
-
type: "string"
|
|
474
|
-
},
|
|
475
|
-
description: "Modules that are used by this application. Only the name of the module is required."
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
},
|
|
479
|
-
vercel: {
|
|
480
|
-
$ref: "#/definitions/Vercel"
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
required: ["default", "development", "production"]
|
|
484
|
-
},
|
|
485
|
-
Routing: {
|
|
486
|
-
type: "object",
|
|
487
|
-
properties: {
|
|
488
|
-
assetPrefix: {
|
|
489
|
-
type: "string",
|
|
490
|
-
description: "[assetPrefix] for the application"
|
|
491
|
-
},
|
|
492
|
-
matches: {
|
|
493
|
-
type: "array",
|
|
494
|
-
items: {
|
|
495
|
-
$ref: "#/definitions/PathGroup"
|
|
496
|
-
},
|
|
497
|
-
description: "Path expressions that are routed to this application."
|
|
498
|
-
}
|
|
499
|
-
},
|
|
500
|
-
required: ["matches"]
|
|
501
|
-
},
|
|
502
|
-
PathGroup: {
|
|
503
|
-
type: "object",
|
|
504
|
-
properties: {
|
|
505
|
-
group: {
|
|
506
|
-
type: "string",
|
|
507
|
-
description: "Optional group name for the paths"
|
|
508
|
-
},
|
|
509
|
-
options: {
|
|
510
|
-
type: "object",
|
|
511
|
-
properties: {
|
|
512
|
-
flag: {
|
|
513
|
-
type: "string",
|
|
514
|
-
description: "flag name that can be used to enable/disable all paths in the group"
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
},
|
|
518
|
-
paths: {
|
|
519
|
-
type: "array",
|
|
520
|
-
items: {
|
|
521
|
-
type: "string"
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
},
|
|
525
|
-
required: ["paths"]
|
|
526
|
-
},
|
|
527
|
-
HostConfig: {
|
|
528
|
-
type: "object",
|
|
529
|
-
properties: {
|
|
530
|
-
protocol: {
|
|
531
|
-
type: "string",
|
|
532
|
-
enum: ["http", "https"],
|
|
533
|
-
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"'
|
|
534
|
-
},
|
|
535
|
-
host: {
|
|
536
|
-
type: "string",
|
|
537
|
-
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`)."
|
|
538
|
-
},
|
|
539
|
-
port: {
|
|
540
|
-
type: "number",
|
|
541
|
-
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"
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
required: ["host"]
|
|
545
|
-
},
|
|
546
|
-
Vercel: {
|
|
547
|
-
type: "object",
|
|
548
|
-
properties: {
|
|
549
|
-
projectId: {
|
|
550
|
-
type: "string",
|
|
551
|
-
description: "Vercel project ID"
|
|
552
|
-
},
|
|
553
|
-
projectName: {
|
|
554
|
-
type: "string",
|
|
555
|
-
description: "Vercel project name (temporary until we can use project ID)"
|
|
556
|
-
},
|
|
557
|
-
defaultRoute: {
|
|
558
|
-
type: "string",
|
|
559
|
-
description: "The default route for the application. Used to render screenshots, favicons, and provide direct zone links"
|
|
560
|
-
},
|
|
561
|
-
routeSpeedInsightsToDefaultZone: {
|
|
562
|
-
type: "boolean",
|
|
563
|
-
description: "Whether to route Speed Insights to the default zone or each individual microfrontend."
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
required: ["projectId"]
|
|
567
|
-
},
|
|
568
|
-
CommonApplicationConfig: {
|
|
569
|
-
type: "object",
|
|
570
|
-
properties: {
|
|
571
|
-
default: {
|
|
572
|
-
type: "boolean",
|
|
573
|
-
const: false,
|
|
574
|
-
description: "The default application is used no other application is matched via the routing config"
|
|
575
|
-
},
|
|
576
|
-
routing: {
|
|
577
|
-
$ref: "#/definitions/Routing"
|
|
578
|
-
},
|
|
579
|
-
development: {
|
|
580
|
-
type: "object",
|
|
581
|
-
properties: {
|
|
582
|
-
local: {
|
|
583
|
-
$ref: "#/definitions/HostConfig"
|
|
584
|
-
},
|
|
585
|
-
fallback: {
|
|
586
|
-
$ref: "#/definitions/HostConfig",
|
|
587
|
-
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."
|
|
588
|
-
},
|
|
589
|
-
task: {
|
|
590
|
-
type: "string",
|
|
591
|
-
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
592
|
-
}
|
|
593
|
-
},
|
|
594
|
-
required: ["local"]
|
|
595
|
-
},
|
|
596
|
-
production: {
|
|
597
|
-
$ref: "#/definitions/HostConfig"
|
|
598
|
-
},
|
|
599
|
-
metadata: {
|
|
600
|
-
type: "object",
|
|
601
|
-
additionalProperties: {
|
|
602
|
-
type: "string"
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
federation: {
|
|
606
|
-
type: "object",
|
|
607
|
-
properties: {
|
|
608
|
-
exposes: {
|
|
609
|
-
type: "array",
|
|
610
|
-
items: {
|
|
611
|
-
type: "object",
|
|
612
|
-
properties: {
|
|
613
|
-
name: {
|
|
614
|
-
type: "string",
|
|
615
|
-
description: "The name of the module - should be used when importing the module from another application"
|
|
616
|
-
},
|
|
617
|
-
path: {
|
|
618
|
-
type: "string",
|
|
619
|
-
description: "Relative path to the module within its `application`"
|
|
620
|
-
}
|
|
621
|
-
},
|
|
622
|
-
required: ["name", "path"]
|
|
623
|
-
},
|
|
624
|
-
description: "Modules that are exposed by this application"
|
|
625
|
-
},
|
|
626
|
-
uses: {
|
|
627
|
-
type: "array",
|
|
628
|
-
items: {
|
|
629
|
-
type: "string"
|
|
630
|
-
},
|
|
631
|
-
description: "Modules that are used by this application. Only the name of the module is required."
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
},
|
|
635
|
-
vercel: {
|
|
636
|
-
$ref: "#/definitions/Vercel"
|
|
637
|
-
}
|
|
638
|
-
},
|
|
639
|
-
required: ["default", "development", "production", "routing"]
|
|
640
|
-
},
|
|
641
|
-
Options: {
|
|
642
|
-
type: "object",
|
|
643
|
-
properties: {
|
|
644
|
-
vercel: {
|
|
645
|
-
$ref: "#/definitions/VercelOptions",
|
|
646
|
-
description: "Micro-Frontends wide options for Vercel."
|
|
647
|
-
},
|
|
648
|
-
localProxy: {
|
|
649
|
-
$ref: "#/definitions/LocalProxyOptions",
|
|
650
|
-
description: "Options for local proxy."
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
VercelOptions: {
|
|
655
|
-
type: "object",
|
|
656
|
-
properties: {
|
|
657
|
-
previewDeploymentSuffix: {
|
|
658
|
-
type: "string",
|
|
659
|
-
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`."
|
|
660
|
-
},
|
|
661
|
-
teamSlug: {
|
|
662
|
-
type: "string",
|
|
663
|
-
description: "Team slug for the Vercel team"
|
|
664
|
-
},
|
|
665
|
-
disableOverrides: {
|
|
666
|
-
type: "boolean",
|
|
667
|
-
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."
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
},
|
|
671
|
-
LocalProxyOptions: {
|
|
672
|
-
type: "object",
|
|
673
|
-
properties: {
|
|
674
|
-
port: {
|
|
675
|
-
type: "number",
|
|
676
|
-
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
|
|
683
|
-
// src/config/utils/load-schema.ts
|
|
684
|
-
var SCHEMA2 = schema_default;
|
|
685
|
-
|
|
686
|
-
// src/config/validation.ts
|
|
687
|
-
var validateSchema2 = (configString) => {
|
|
688
|
-
const parsedConfig = parse2(configString);
|
|
689
|
-
const ajv = new Ajv2();
|
|
690
|
-
const validate = ajv.compile(SCHEMA2);
|
|
691
|
-
const isValid = validate(parsedConfig);
|
|
692
|
-
if (!isValid) {
|
|
693
|
-
throw new MicrofrontendError(
|
|
694
|
-
`Invalid config: ${ajv.errorsText(validate.errors)}`,
|
|
695
|
-
{ type: "config", subtype: "does_not_match_schema" }
|
|
696
|
-
);
|
|
697
|
-
}
|
|
698
|
-
return parsedConfig;
|
|
699
|
-
};
|
|
700
372
|
export {
|
|
701
|
-
|
|
702
|
-
validateSchema as validateV2Schema
|
|
373
|
+
validateSchema
|
|
703
374
|
};
|
|
704
375
|
//# sourceMappingURL=validation.js.map
|
package/dist/validation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config-v2/microfrontends/server/validation.ts","../src/config/errors.ts","../schema/schema-v2.json","../src/config-v2/schema/utils/load.ts","../src/config/validation.ts","../schema/schema.json","../src/config/utils/load-schema.ts"],"sourcesContent":["import { parse } from 'jsonc-parser';\nimport { Ajv } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../../config/errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\nexport function validateSchema(configString: string): Config {\n const parsedConfig = parse(configString) as Config;\n const ajv = new Ajv();\n const validate = ajv.compile(SCHEMA);\n const isValid = validate(parsedConfig);\n if (!isValid) {\n throw new MicrofrontendError(\n `Invalid config: ${ajv.errorsText(validate.errors)}`,\n { type: 'config', subtype: 'does_not_match_schema' },\n );\n }\n return parsedConfig;\n}\n","export type MicrofrontendErrorType =\n | 'config'\n | 'packageJson'\n | 'vercelJson'\n | 'zone'\n | 'unknown';\n\nexport type MicrofrontendErrorSubtype =\n | 'not_found'\n | 'not_found_in_env'\n | 'invalid_asset_prefix'\n | 'invalid_main_path'\n | 'does_not_match_schema'\n | 'unable_to_read_file'\n | 'unsupported_validation_env'\n | 'unsupported_version'\n | 'invalid_path'\n | 'invalid_permissions'\n | 'invalid_syntax'\n | 'missing_microfrontend_config_path'\n | 'unsupported_operation';\n\n// A mapping of error types to their subtypes.\ninterface TypeToSubtype {\n zone:\n | 'invalid_asset_prefix'\n | 'invalid_path'\n | 'multiple_package_managers'\n | 'not_found';\n config:\n | 'conflicting_paths'\n | 'does_not_match_schema'\n | 'invalid_main_path'\n | 'invalid_preview_deployment_suffix'\n | 'multiple_default_applications'\n | 'no_default_application'\n | 'not_found_in_env'\n | 'not_found'\n | 'unable_to_read_file'\n | 'invalid_syntax'\n | 'invalid_permissions'\n | 'unsupported_operation'\n | 'unsupported_validation_env'\n | 'unsupported_version';\n packageJson:\n | 'missing_field_name'\n | 'unable_to_read_file'\n | 'invalid_permissions'\n | 'invalid_syntax';\n vercelJson:\n | 'missing_field_microFrontend_config_path'\n | 'unable_to_read_file'\n | 'invalid_permissions'\n | 'invalid_syntax';\n unknown: never;\n}\n\nexport type MicrofrontendErrorSource =\n | '@vercel/microfrontends'\n | '@vercel/microfrontends/next'\n | 'fs'\n | 'ajv';\n\nexport interface MicrofrontendErrorOptions<T extends MicrofrontendErrorType> {\n source?: MicrofrontendErrorSource;\n type?: T;\n subtype?: TypeToSubtype[T];\n}\n\ninterface HandleOptions {\n fileName?: string;\n}\n\nexport class MicrofrontendError<\n T extends MicrofrontendErrorType = 'unknown',\n> extends Error {\n public source: MicrofrontendErrorSource;\n public type: T;\n public subtype?: TypeToSubtype[T];\n\n constructor(message: string, opts?: MicrofrontendErrorOptions<T>) {\n super(message);\n this.name = 'MicrofrontendsError';\n this.source = opts?.source ?? '@vercel/microfrontends';\n this.type = opts?.type ?? ('unknown' as T);\n this.subtype = opts?.subtype;\n Error.captureStackTrace(this, MicrofrontendError);\n }\n\n isKnown(): boolean {\n return this.type !== 'unknown';\n }\n\n isUnknown(): boolean {\n return !this.isKnown();\n }\n\n /**\n * Converts an error to a MicrofrontendsError.\n * @param original - The original error to convert.\n * @returns The converted MicrofrontendsError.\n */\n static convert(\n original: Error,\n opts?: HandleOptions,\n ): MicrofrontendError<MicrofrontendErrorType> {\n if (opts?.fileName) {\n const err = MicrofrontendError.convertFSError(original, opts.fileName);\n if (err) {\n return err;\n }\n }\n\n if (\n original.message.includes(\n 'Code generation from strings disallowed for this context',\n )\n ) {\n return new MicrofrontendError(original.message, {\n type: 'config',\n subtype: 'unsupported_validation_env',\n source: 'ajv',\n });\n }\n\n // unknown catch-all\n return new MicrofrontendError(original.message);\n }\n\n static convertFSError(\n original: Error,\n fileName: string,\n ): MicrofrontendError<MicrofrontendErrorType> | null {\n if (original instanceof Error && 'code' in original) {\n if (original.code === 'ENOENT') {\n return new MicrofrontendError(`Could not find \"${fileName}\"`, {\n type: 'config',\n subtype: 'unable_to_read_file',\n source: 'fs',\n });\n }\n if (original.code === 'EACCES') {\n return new MicrofrontendError(\n `Permission denied while accessing \"${fileName}\"`,\n {\n type: 'config',\n subtype: 'invalid_permissions',\n source: 'fs',\n },\n );\n }\n }\n\n if (original instanceof SyntaxError) {\n return new MicrofrontendError(\n `Failed to parse \"${fileName}\": Invalid JSON format.`,\n {\n type: 'config',\n subtype: 'invalid_syntax',\n source: 'fs',\n },\n );\n }\n\n return null;\n }\n\n /**\n * Handles an unknown error and returns a MicrofrontendsError instance.\n * @param err - The error to handle.\n * @returns A MicrofrontendsError instance.\n */\n static handle(\n err: unknown,\n opts?: HandleOptions,\n ): MicrofrontendError<MicrofrontendErrorType> {\n if (err instanceof MicrofrontendError) {\n return err as MicrofrontendError<MicrofrontendErrorType>;\n }\n\n // handle Error instances\n if (err instanceof Error) {\n return MicrofrontendError.convert(err, opts);\n }\n\n // handle object errors\n if (typeof err === 'object' && err !== null) {\n if ('message' in err && typeof err.message === 'string') {\n return MicrofrontendError.convert(new Error(err.message), opts);\n }\n }\n\n return new MicrofrontendError('An unknown error occurred');\n }\n}\n","{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$ref\": \"#/definitions/Config\",\n \"definitions\": {\n \"Config\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/MainConfig\"\n },\n {\n \"$ref\": \"#/definitions/ChildConfig\"\n }\n ]\n },\n \"MainConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"2\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\n },\n \"remotes\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n },\n \"applications\": {\n \"$ref\": \"#/definitions/ApplicationRouting\",\n \"description\": \"Mapping of application names to the routes that they host. Only needs to be defined in the application that owns the primary microfrontend domain\"\n }\n },\n \"required\": [\"applications\", \"version\"]\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Micro-Frontends wide options for Vercel.\"\n },\n \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\"\n }\n }\n },\n \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"teamSlug\": {\n \"type\": \"string\",\n \"description\": \"Team slug for the Vercel team\"\n },\n \"disableOverrides\": {\n \"type\": \"boolean\",\n \"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.\"\n }\n }\n },\n \"LocalProxyOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number used by the local proxy server.\\n\\nThe default is `3024`.\"\n }\n }\n },\n \"Application\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/DefaultApplication\"\n },\n {\n \"$ref\": \"#/definitions/ChildApplication\"\n }\n ]\n },\n \"DefaultApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n }\n },\n \"required\": [\"production\"]\n },\n \"Vercel\": {\n \"type\": \"object\",\n \"properties\": {\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n }\n },\n \"required\": [\"projectId\"]\n },\n \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\"\n },\n \"fallback\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"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.\"\n },\n \"task\": {\n \"type\": \"string\",\n \"description\": \"Optional task to run when starting the development server. Should reference a script in the package.json of the application.\"\n }\n }\n },\n \"LocalHostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"host\": {\n \"type\": \"string\",\n \"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`).\"\n },\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\"http\", \"https\"],\n \"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 \\\"http\\\" for local development, \\\"https\\\" for otherwise\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS.\"\n }\n }\n },\n \"HostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\"http\", \"https\"],\n \"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 \\\"http\\\" for local development, \\\"https\\\" for otherwise\"\n },\n \"host\": {\n \"type\": \"string\",\n \"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`).\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS.\"\n }\n },\n \"required\": [\"host\"]\n },\n \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n },\n \"routing\": {\n \"$ref\": \"#/definitions/Routing\",\n \"description\": \"Groups of path expressions that are routed to this application.\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n }\n },\n \"required\": [\"routing\"]\n },\n \"Routing\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/PathGroup\"\n }\n },\n \"PathGroup\": {\n \"type\": \"object\",\n \"properties\": {\n \"group\": {\n \"type\": \"string\",\n \"description\": \"Optional group name for the paths\"\n },\n \"flag\": {\n \"type\": \"string\",\n \"description\": \"flag name that can be used to enable/disable all paths in the group\"\n },\n \"paths\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"paths\"]\n },\n \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n }\n },\n \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"2\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\n },\n \"remotes\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n },\n \"partOf\": {\n \"type\": \"string\",\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n }\n },\n \"required\": [\"partOf\", \"version\"]\n }\n }\n}\n","import type { JSONSchema7 } from 'json-schema';\nimport jsonSchema from '../../../../schema/schema-v2.json';\n\nexport const SCHEMA = jsonSchema as JSONSchema7;\n","import { parse } from 'jsonc-parser';\nimport { pathToRegexp, parse as parsePathRegexp } from 'path-to-regexp';\nimport { Ajv } from 'ajv';\nimport type {\n Config,\n ApplicationId,\n PathGroup,\n ApplicationConfigsById,\n Options,\n} from './schema';\nimport { isDefaultApplicationConfig } from './types';\nimport { MicrofrontendError } from './errors';\nimport { SCHEMA } from './utils/load-schema';\n\nexport const validateSchema = (configString: string): Config => {\n const parsedConfig = parse(configString) as Config;\n const ajv = new Ajv();\n const validate = ajv.compile(SCHEMA);\n const isValid = validate(parsedConfig);\n if (!isValid) {\n throw new MicrofrontendError(\n `Invalid config: ${ajv.errorsText(validate.errors)}`,\n { type: 'config', subtype: 'does_not_match_schema' },\n );\n }\n return parsedConfig;\n};\n\nconst SUPPORTED_VERSIONS = ['1'];\n\nexport const validateVersion = (version: string): void => {\n if (!SUPPORTED_VERSIONS.includes(version)) {\n throw new MicrofrontendError(\n `Unsupported version: ${version}. Supported versions are: ${SUPPORTED_VERSIONS.join(\n ', ',\n )}`,\n { type: 'config', subtype: 'unsupported_version' },\n );\n }\n};\n\nexport function validateMainPath(\n applicationConfigsById: ApplicationConfigsById,\n): void {\n for (const [id, app] of Object.entries(applicationConfigsById)) {\n const { defaultRoute } = app.vercel ?? {};\n if (!defaultRoute) {\n continue;\n }\n\n if (isDefaultApplicationConfig(app)) {\n // the defaultRoute for the default application can't match any other applications routes\n const pathsWithApp = [];\n for (const [otherId, otherApp] of Object.entries(\n applicationConfigsById,\n )) {\n if (isDefaultApplicationConfig(otherApp)) {\n continue;\n }\n pathsWithApp.push({\n id: otherId,\n paths: otherApp.routing.matches.flatMap((match) => match.paths),\n });\n }\n\n for (const { id: otherId, paths } of pathsWithApp) {\n const isValid = paths.every((path) => {\n const matcher = pathToRegexp(path);\n return !matcher.test(defaultRoute);\n });\n\n if (!isValid) {\n throw new MicrofrontendError(\n `default route \"${defaultRoute}\" cannot be used for \"${id}\" because it is matched by \"${otherId}\"`,\n { type: 'config', subtype: 'invalid_main_path' },\n );\n }\n }\n // the defaultRoute for a non-default application has to match one of its own paths\n } else {\n const allPaths = app.routing.matches.flatMap((match) => match.paths);\n const isValid = allPaths.some((path) => {\n const matcher = pathToRegexp(path);\n return matcher.test(defaultRoute);\n });\n\n if (!isValid) {\n throw new MicrofrontendError(\n `default route \"${defaultRoute}\" is not included by the routing config for application \"${id}\"`,\n { type: 'config', subtype: 'invalid_main_path' },\n );\n }\n }\n }\n}\n\nexport const validatePaths = (\n applicationConfigsById: ApplicationConfigsById,\n): void => {\n const pathsByApplicationId = new Map<\n PathGroup['paths'][number],\n {\n applications: ApplicationId[];\n matcher: RegExp;\n applicationId?: ApplicationId;\n }\n >();\n const errors: string[] = [];\n\n for (const [id, app] of Object.entries(applicationConfigsById)) {\n if (isDefaultApplicationConfig(app)) {\n // default applications do not have routing\n continue;\n }\n\n for (const pathMatch of app.routing.matches) {\n for (const path of pathMatch.paths) {\n const maybeError = validatePathExpression(path);\n if (maybeError) {\n errors.push(maybeError);\n }\n\n const existing = pathsByApplicationId.get(path);\n if (existing) {\n existing.applications.push(id);\n } else {\n pathsByApplicationId.set(path, {\n applications: [id],\n matcher: pathToRegexp(path),\n applicationId: id,\n });\n }\n }\n }\n }\n const entries = Array.from(pathsByApplicationId.entries());\n\n entries.forEach(([path, { applications: ids, matcher, applicationId }]) => {\n if (ids.length > 1) {\n errors.push(\n `Duplicate path \"${path}\" for applications \"${ids.join(', ')}\"`,\n );\n }\n\n entries.forEach(\n ([\n matchPath,\n { applications: matchIds, applicationId: matchApplicationId },\n ]) => {\n if (path === matchPath) {\n // we're comparing to ourselves, so skip\n return;\n }\n\n if (applicationId === matchApplicationId) {\n // we're comparing to paths within our own application, which are allowed to overlap, so skip\n return;\n }\n\n if (matcher.test(matchPath)) {\n const source = `\"${path}\" of application${ids.length > 0 ? 's' : ''} ${ids.join(', ')}`;\n const destination = `\"${matchPath}\" of application${matchIds.length > 0 ? 's' : ''} ${matchIds.join(', ')}`;\n\n errors.push(\n `Overlapping path detected between ${source} and ${destination}`,\n );\n }\n },\n );\n });\n\n if (errors.length) {\n throw new MicrofrontendError(`Invalid paths: ${errors.join(', ')}`, {\n type: 'config',\n subtype: 'conflicting_paths',\n });\n }\n};\n\n// From https://github.com/pillarjs/path-to-regexp/blob/b0778f5e8e6c6e9ee4e2f5b34e877cc5229f8036/src/index.ts#L143\nconst PATH_DEFAULT_PATTERN = '[^\\\\/#\\\\?]+?';\n\n// This is a copy of https://github.com/vercel/api/blob/main/scripts/build-container/src/utils/upload-micro-frontend-configuration.ts\n// and should be kept in sync.\nfunction validatePathExpression(path: string): string | undefined {\n const tokens = parsePathRegexp(path);\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (token === undefined) {\n return `token ${i} in ${path} is undefined, this shouldn't happen`;\n }\n if (typeof token !== 'string') {\n if (token.pattern !== PATH_DEFAULT_PATTERN) {\n return `Path ${path} cannot use a regular expression wildcard`;\n }\n if (token.prefix !== '/') {\n return `Wildcard :${token.name} must be immediately after a / in ${path}`;\n }\n if (token.suffix) {\n return `Wildcard suffix on :${token.name} is not allowed. Suffixes are not supported`;\n }\n if (token.modifier && i !== tokens.length - 1) {\n return `Modifier ${token.modifier} is not allowed on wildcard :${token.name} in ${path}. Modifiers are only allowed in the last path component`;\n }\n }\n }\n return undefined;\n}\n\n/** make sure there is exactly one default `Application` */\nexport const validateDefaults = (\n applicationConfigsById: ApplicationConfigsById,\n): void => {\n const defaultApplicationIds = Object.entries(applicationConfigsById).reduce<\n string[]\n // biome-ignore lint/performance/noAccumulatingSpread: Ignored using `--suppress`\n >((acc, [id, app]) => (app.default ? [...acc, id] : acc), []);\n\n if (defaultApplicationIds.length === 0) {\n throw new MicrofrontendError(\n `No default application found. At least one application must be marked as default.`,\n { type: 'config', subtype: 'no_default_application' },\n );\n }\n\n if (defaultApplicationIds.length > 1) {\n throw new MicrofrontendError(\n `Only one default application is allowed. Found ${defaultApplicationIds.join(', ')}.`,\n { type: 'config', subtype: 'multiple_default_applications' },\n );\n }\n};\n\nexport const validateOptions = (options?: Options): void => {\n if (options?.vercel?.previewDeploymentSuffix) {\n if (\n !/^[a-zA-Z]{2,}\\.[a-zA-Z]{2,}$/.test(\n options.vercel.previewDeploymentSuffix,\n )\n ) {\n throw new MicrofrontendError(\n `Invalid preview deployment suffix: ${options.vercel.previewDeploymentSuffix}. Should have be formatted like \"vercel.app\".`,\n { type: 'config', subtype: 'invalid_preview_deployment_suffix' },\n );\n }\n }\n};\n","{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$ref\": \"#/definitions/Config\",\n \"definitions\": {\n \"Config\": {\n \"type\": \"object\",\n \"properties\": {\n \"version\": {\n \"type\": \"string\"\n },\n \"$schema\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\",\n \"description\": \"Name for the micro-frontend site (eg. \\\"vercel.com\\\", \\\"vercel-site\\\" etc.).\"\n },\n \"applications\": {\n \"$ref\": \"#/definitions/ApplicationConfigsById\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\",\n \"description\": \"Optional configuration for the entire micro-frontends setup.\"\n }\n },\n \"required\": [\"version\", \"applications\"],\n \"description\": \"Configuration for micro-frontend applications\\n\\nTODO: Add proxy configuration\"\n },\n \"ApplicationConfigsById\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/ApplicationConfig\"\n }\n },\n \"ApplicationConfig\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/DefaultApplicationConfig\"\n },\n {\n \"$ref\": \"#/definitions/CommonApplicationConfig\"\n }\n ],\n \"description\": \"A Micro-Frontend Deployment Target\"\n },\n \"DefaultApplicationConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"default\": {\n \"type\": \"boolean\",\n \"const\": true,\n \"description\": \"The default application is used no other application is matched via the routing config\"\n },\n \"routing\": {\n \"$ref\": \"#/definitions/Routing\"\n },\n \"development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n \"fallback\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"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.\"\n },\n \"task\": {\n \"type\": \"string\",\n \"description\": \"Optional task to run when starting the development server. Should reference a script in the package.json of the application.\"\n }\n },\n \"required\": [\"local\"]\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n \"metadata\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"federation\": {\n \"type\": \"object\",\n \"properties\": {\n \"exposes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the module - should be used when importing the module from another application\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"Relative path to the module within its `application`\"\n }\n },\n \"required\": [\"name\", \"path\"]\n },\n \"description\": \"Modules that are exposed by this application\"\n },\n \"uses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Modules that are used by this application. Only the name of the module is required.\"\n }\n }\n },\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n }\n },\n \"required\": [\"default\", \"development\", \"production\"]\n },\n \"Routing\": {\n \"type\": \"object\",\n \"properties\": {\n \"assetPrefix\": {\n \"type\": \"string\",\n \"description\": \"[assetPrefix] for the application\"\n },\n \"matches\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/PathGroup\"\n },\n \"description\": \"Path expressions that are routed to this application.\"\n }\n },\n \"required\": [\"matches\"]\n },\n \"PathGroup\": {\n \"type\": \"object\",\n \"properties\": {\n \"group\": {\n \"type\": \"string\",\n \"description\": \"Optional group name for the paths\"\n },\n \"options\": {\n \"type\": \"object\",\n \"properties\": {\n \"flag\": {\n \"type\": \"string\",\n \"description\": \"flag name that can be used to enable/disable all paths in the group\"\n }\n }\n },\n \"paths\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"paths\"]\n },\n \"HostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\"http\", \"https\"],\n \"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\\\"\"\n },\n \"host\": {\n \"type\": \"string\",\n \"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`).\"\n },\n \"port\": {\n \"type\": \"number\",\n \"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\"\n }\n },\n \"required\": [\"host\"]\n },\n \"Vercel\": {\n \"type\": \"object\",\n \"properties\": {\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"projectName\": {\n \"type\": \"string\",\n \"description\": \"Vercel project name (temporary until we can use project ID)\"\n },\n \"defaultRoute\": {\n \"type\": \"string\",\n \"description\": \"The default route for the application. Used to render screenshots, favicons, and provide direct zone links\"\n },\n \"routeSpeedInsightsToDefaultZone\": {\n \"type\": \"boolean\",\n \"description\": \"Whether to route Speed Insights to the default zone or each individual microfrontend.\"\n }\n },\n \"required\": [\"projectId\"]\n },\n \"CommonApplicationConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"default\": {\n \"type\": \"boolean\",\n \"const\": false,\n \"description\": \"The default application is used no other application is matched via the routing config\"\n },\n \"routing\": {\n \"$ref\": \"#/definitions/Routing\"\n },\n \"development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n \"fallback\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"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.\"\n },\n \"task\": {\n \"type\": \"string\",\n \"description\": \"Optional task to run when starting the development server. Should reference a script in the package.json of the application.\"\n }\n },\n \"required\": [\"local\"]\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n \"metadata\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"type\": \"string\"\n }\n },\n \"federation\": {\n \"type\": \"object\",\n \"properties\": {\n \"exposes\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\",\n \"description\": \"The name of the module - should be used when importing the module from another application\"\n },\n \"path\": {\n \"type\": \"string\",\n \"description\": \"Relative path to the module within its `application`\"\n }\n },\n \"required\": [\"name\", \"path\"]\n },\n \"description\": \"Modules that are exposed by this application\"\n },\n \"uses\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Modules that are used by this application. Only the name of the module is required.\"\n }\n }\n },\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n }\n },\n \"required\": [\"default\", \"development\", \"production\", \"routing\"]\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Micro-Frontends wide options for Vercel.\"\n },\n \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\"\n }\n }\n },\n \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"previewDeploymentSuffix\": {\n \"type\": \"string\",\n \"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`.\"\n },\n \"teamSlug\": {\n \"type\": \"string\",\n \"description\": \"Team slug for the Vercel team\"\n },\n \"disableOverrides\": {\n \"type\": \"boolean\",\n \"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.\"\n }\n }\n },\n \"LocalProxyOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number used by the local proxy server.\\n\\nThe default is `3024`.\"\n }\n }\n }\n }\n}\n","import type { JSONSchema7 } from 'json-schema';\nimport jsonSchema from '../../../schema/schema.json';\n\nexport const SCHEMA = jsonSchema as JSONSchema7;\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,WAAW;;;ACwEb,IAAM,qBAAN,cAEG,MAAM;AAAA,EAKd,YAAY,SAAiB,MAAqC;AAChE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,UAAS,6BAAM,WAAU;AAC9B,SAAK,QAAO,6BAAM,SAAS;AAC3B,SAAK,UAAU,6B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A,QACjB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;ACvTO,IAAMC,UAAS;;;AFWf,IAAMC,kBAAiB,CAAC,iBAAiC;AAC9D,QAAM,eAAeC,OAAM,YAAY;AACvC,QAAM,MAAM,IAAIC,KAAI;AACpB,QAAM,WAAW,IAAI,QAAQC,OAAM;AACnC,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,mBAAmB,IAAI,WAAW,SAAS,MAAM;AAAA,MACjD,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AACA,SAAO;AACT;","names":["parse","Ajv","SCHEMA","validateSchema","parse","Ajv","SCHEMA"]}
|
|
1
|
+
{"version":3,"sources":["../src/config/microfrontends/server/validation.ts","../src/config/errors.ts","../schema/schema.json","../src/config/schema/utils/load.ts"],"sourcesContent":["import { parse } from 'jsonc-parser';\nimport { Ajv } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\nexport function validateSchema(configString: string): Config {\n const parsedConfig = parse(configString) as Config;\n const ajv = new Ajv();\n const validate = ajv.compile(SCHEMA);\n const isValid = validate(parsedConfig);\n if (!isValid) {\n throw new MicrofrontendError(\n `Invalid config: ${ajv.errorsText(validate.errors)}`,\n { type: 'config', subtype: 'does_not_match_schema' },\n );\n }\n return parsedConfig;\n}\n","export type MicrofrontendErrorType =\n | 'config'\n | 'packageJson'\n | 'vercelJson'\n | 'application'\n | 'unknown';\n\nexport type MicrofrontendErrorSubtype =\n | 'not_found'\n | 'inference_failed'\n | 'not_found_in_env'\n | 'invalid_asset_prefix'\n | 'invalid_main_path'\n | 'does_not_match_schema'\n | 'unable_to_read_file'\n | 'unsupported_validation_env'\n | 'unsupported_version'\n | 'invalid_path'\n | 'invalid_permissions'\n | 'invalid_syntax'\n | 'missing_microfrontend_config_path'\n | 'unsupported_operation';\n\n// A mapping of error types to their subtypes.\ninterface TypeToSubtype {\n application:\n | 'invalid_asset_prefix'\n | 'invalid_path'\n | 'multiple_package_managers'\n | 'not_found';\n config:\n | 'conflicting_paths'\n | 'does_not_match_schema'\n | 'invalid_main_path'\n | 'invalid_preview_deployment_suffix'\n | 'multiple_default_applications'\n | 'no_default_application'\n | 'not_found_in_env'\n | 'not_found'\n | 'inference_failed'\n | 'unable_to_read_file'\n | 'invalid_syntax'\n | 'invalid_permissions'\n | 'unsupported_operation'\n | 'unsupported_validation_env'\n | 'unsupported_version';\n packageJson:\n | 'missing_field_name'\n | 'unable_to_read_file'\n | 'invalid_permissions'\n | 'invalid_syntax';\n vercelJson:\n | 'missing_field_microfrontend_config_path'\n | 'unable_to_read_file'\n | 'invalid_permissions'\n | 'invalid_syntax';\n unknown: never;\n}\n\nexport type MicrofrontendErrorSource =\n | '@vercel/microfrontends'\n | '@vercel/microfrontends/next'\n | 'fs'\n | 'ajv';\n\nexport interface MicrofrontendErrorOptions<T extends MicrofrontendErrorType> {\n source?: MicrofrontendErrorSource;\n type?: T;\n subtype?: TypeToSubtype[T];\n}\n\ninterface HandleOptions {\n fileName?: string;\n}\n\nexport class MicrofrontendError<\n T extends MicrofrontendErrorType = 'unknown',\n> extends Error {\n public source: MicrofrontendErrorSource;\n public type: T;\n public subtype?: TypeToSubtype[T];\n\n constructor(message: string, opts?: MicrofrontendErrorOptions<T>) {\n super(message);\n this.name = 'MicrofrontendsError';\n this.source = opts?.source ?? '@vercel/microfrontends';\n this.type = opts?.type ?? ('unknown' as T);\n this.subtype = opts?.subtype;\n Error.captureStackTrace(this, MicrofrontendError);\n }\n\n isKnown(): boolean {\n return this.type !== 'unknown';\n }\n\n isUnknown(): boolean {\n return !this.isKnown();\n }\n\n /**\n * Converts an error to a MicrofrontendsError.\n * @param original - The original error to convert.\n * @returns The converted MicrofrontendsError.\n */\n static convert(\n original: Error,\n opts?: HandleOptions,\n ): MicrofrontendError<MicrofrontendErrorType> {\n if (opts?.fileName) {\n const err = MicrofrontendError.convertFSError(original, opts.fileName);\n if (err) {\n return err;\n }\n }\n\n if (\n original.message.includes(\n 'Code generation from strings disallowed for this context',\n )\n ) {\n return new MicrofrontendError(original.message, {\n type: 'config',\n subtype: 'unsupported_validation_env',\n source: 'ajv',\n });\n }\n\n // unknown catch-all\n return new MicrofrontendError(original.message);\n }\n\n static convertFSError(\n original: Error,\n fileName: string,\n ): MicrofrontendError<MicrofrontendErrorType> | null {\n if (original instanceof Error && 'code' in original) {\n if (original.code === 'ENOENT') {\n return new MicrofrontendError(`Could not find \"${fileName}\"`, {\n type: 'config',\n subtype: 'unable_to_read_file',\n source: 'fs',\n });\n }\n if (original.code === 'EACCES') {\n return new MicrofrontendError(\n `Permission denied while accessing \"${fileName}\"`,\n {\n type: 'config',\n subtype: 'invalid_permissions',\n source: 'fs',\n },\n );\n }\n }\n\n if (original instanceof SyntaxError) {\n return new MicrofrontendError(\n `Failed to parse \"${fileName}\": Invalid JSON format.`,\n {\n type: 'config',\n subtype: 'invalid_syntax',\n source: 'fs',\n },\n );\n }\n\n return null;\n }\n\n /**\n * Handles an unknown error and returns a MicrofrontendsError instance.\n * @param err - The error to handle.\n * @returns A MicrofrontendsError instance.\n */\n static handle(\n err: unknown,\n opts?: HandleOptions,\n ): MicrofrontendError<MicrofrontendErrorType> {\n if (err instanceof MicrofrontendError) {\n return err as MicrofrontendError<MicrofrontendErrorType>;\n }\n\n // handle Error instances\n if (err instanceof Error) {\n return MicrofrontendError.convert(err, opts);\n }\n\n // handle object errors\n if (typeof err === 'object' && err !== null) {\n if ('message' in err && typeof err.message === 'string') {\n return MicrofrontendError.convert(new Error(err.message), opts);\n }\n }\n\n return new MicrofrontendError('An unknown error occurred');\n }\n}\n","{\n \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n \"$ref\": \"#/definitions/Config\",\n \"definitions\": {\n \"Config\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/MainConfig\"\n },\n {\n \"$ref\": \"#/definitions/ChildConfig\"\n }\n ]\n },\n \"MainConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"2\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\n },\n \"remotes\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n },\n \"applications\": {\n \"$ref\": \"#/definitions/ApplicationRouting\",\n \"description\": \"Mapping of application names to the routes that they host. Only needs to be defined in the application that owns the primary microfrontend domain\"\n }\n },\n \"required\": [\"applications\", \"version\"],\n \"additionalProperties\": false\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Micro-Frontends wide options for Vercel.\"\n },\n \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\"\n }\n },\n \"additionalProperties\": false\n },\n \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"teamSlug\": {\n \"type\": \"string\",\n \"description\": \"Team slug for the Vercel team\"\n },\n \"disableOverrides\": {\n \"type\": \"boolean\",\n \"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.\"\n }\n },\n \"additionalProperties\": false\n },\n \"LocalProxyOptions\": {\n \"type\": \"object\",\n \"properties\": {\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number used by the local proxy server.\\n\\nThe default is `3024`.\"\n }\n },\n \"additionalProperties\": false\n },\n \"Application\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/DefaultApplication\"\n },\n {\n \"$ref\": \"#/definitions/ChildApplication\"\n }\n ]\n },\n \"DefaultApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n }\n },\n \"required\": [\"production\"],\n \"additionalProperties\": false\n },\n \"Vercel\": {\n \"type\": \"object\",\n \"properties\": {\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n }\n },\n \"required\": [\"projectId\"],\n \"additionalProperties\": false\n },\n \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\"\n },\n \"fallback\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"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.\"\n },\n \"task\": {\n \"type\": \"string\",\n \"description\": \"Optional task to run when starting the development server. Should reference a script in the package.json of the application.\"\n }\n },\n \"additionalProperties\": false\n },\n \"LocalHostConfig\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"host\": {\n \"type\": \"string\",\n \"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`).\"\n },\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\"http\", \"https\"],\n \"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 \\\"http\\\" for local development, \\\"https\\\" for otherwise\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS.\"\n }\n }\n },\n \"HostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\"http\", \"https\"],\n \"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 \\\"http\\\" for local development, \\\"https\\\" for otherwise\"\n },\n \"host\": {\n \"type\": \"string\",\n \"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`).\"\n },\n \"port\": {\n \"type\": \"number\",\n \"description\": \"The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS.\"\n }\n },\n \"required\": [\"host\"],\n \"additionalProperties\": false\n },\n \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n },\n \"routing\": {\n \"$ref\": \"#/definitions/Routing\",\n \"description\": \"Groups of path expressions that are routed to this application.\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\"\n }\n },\n \"required\": [\"routing\"],\n \"additionalProperties\": false\n },\n \"Routing\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/definitions/PathGroup\"\n }\n },\n \"PathGroup\": {\n \"type\": \"object\",\n \"properties\": {\n \"group\": {\n \"type\": \"string\",\n \"description\": \"Optional group name for the paths\"\n },\n \"flag\": {\n \"type\": \"string\",\n \"description\": \"flag name that can be used to enable/disable all paths in the group\"\n },\n \"paths\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"required\": [\"paths\"],\n \"additionalProperties\": false\n },\n \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n }\n },\n \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"2\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\n },\n \"remotes\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n },\n \"partOf\": {\n \"type\": \"string\",\n \"description\": \"Applications that only serve a subset of the microfrontend routes only need to reference the name of the primary application that owns the full microfrontends configuration.\"\n }\n },\n \"required\": [\"partOf\", \"version\"],\n \"additionalProperties\": false\n }\n }\n}\n","import type { JSONSchema7 } from 'json-schema';\nimport jsonSchema from '../../../../schema/schema.json';\n\nexport const SCHEMA = jsonSchema as JSONSchema7;\n"],"mappings":";AAAA,SAAS,aAAa;AACtB,SAAS,WAAW;;;AC0Eb,IAAM,qBAAN,cAEG,MAAM;AAAA,EAKd,YAAY,SAAiB,MAAqC;AAChE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,UAAS,6BAAM,WAAU;AAC9B,SAAK,QAAO,6BAAM,SAAS;AAC3B,SAAK,UAAU,6BAAM;AACrB,UAAM,kBAAkB,MAAM,kBAAkB;AAAA,EAClD;AAAA,EAEA,UAAmB;AACjB,WAAO,KAAK,SAAS;AAAA,EACvB;AAAA,EAEA,YAAqB;AACnB,WAAO,CAAC,KAAK,QAAQ;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,OAAO,QACL,UACA,MAC4C;AAC5C,QAAI,6BAAM,UAAU;AAClB,YAAM,MAAM,mBAAmB,eAAe,UAAU,KAAK,QAAQ;AACrE,UAAI,KAAK;AACP,eAAO;AAAA,MACT;AAAA,IACF;AAEA,QACE,SAAS,QAAQ;AAAA,MACf;AAAA,IACF,GACA;AACA,aAAO,IAAI,mBAAmB,SAAS,SAAS;AAAA,QAC9C,MAAM;AAAA,QACN,SAAS;AAAA,QACT,QAAQ;AAAA,MACV,CAAC;AAAA,IACH;AAGA,WAAO,IAAI,mBAAmB,SAAS,OAAO;AAAA,EAChD;AAAA,EAEA,OAAO,eACL,UACA,UACmD;AACnD,QAAI,oBAAoB,SAAS,UAAU,UAAU;AACnD,UAAI,SAAS,SAAS,UAAU;AAC9B,eAAO,IAAI,mBAAmB,mBAAmB,aAAa;AAAA,UAC5D,MAAM;AAA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