@vercel/microfrontends 1.0.1-canary.5 → 1.1.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 +9 -27
- package/dist/experimental/sveltekit.cjs +8 -26
- package/dist/experimental/sveltekit.cjs.map +1 -1
- package/dist/experimental/sveltekit.js +8 -26
- package/dist/experimental/sveltekit.js.map +1 -1
- package/dist/experimental/vite.cjs +8 -26
- package/dist/experimental/vite.cjs.map +1 -1
- package/dist/experimental/vite.js +8 -26
- package/dist/experimental/vite.js.map +1 -1
- package/dist/microfrontends/server.cjs +8 -26
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.js +8 -26
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/next/config.cjs +8 -26
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +8 -26
- package/dist/next/config.js.map +1 -1
- package/dist/utils/mfe-port.cjs +8 -26
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +8 -26
- package/dist/utils/mfe-port.js.map +1 -1
- package/dist/validation.cjs +8 -26
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.js +8 -26
- package/dist/validation.js.map +1 -1
- package/package.json +1 -1
package/dist/validation.cjs
CHANGED
|
@@ -153,9 +153,7 @@ var schema_default = {
|
|
|
153
153
|
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"
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
-
required: [
|
|
157
|
-
"applications"
|
|
158
|
-
],
|
|
156
|
+
required: ["applications"],
|
|
159
157
|
additionalProperties: false
|
|
160
158
|
},
|
|
161
159
|
Options: {
|
|
@@ -250,9 +248,7 @@ var schema_default = {
|
|
|
250
248
|
description: "Vercel project ID"
|
|
251
249
|
}
|
|
252
250
|
},
|
|
253
|
-
required: [
|
|
254
|
-
"projectId"
|
|
255
|
-
],
|
|
251
|
+
required: ["projectId"],
|
|
256
252
|
additionalProperties: false
|
|
257
253
|
},
|
|
258
254
|
HostConfig: {
|
|
@@ -260,10 +256,7 @@ var schema_default = {
|
|
|
260
256
|
properties: {
|
|
261
257
|
protocol: {
|
|
262
258
|
type: "string",
|
|
263
|
-
enum: [
|
|
264
|
-
"http",
|
|
265
|
-
"https"
|
|
266
|
-
],
|
|
259
|
+
enum: ["http", "https"],
|
|
267
260
|
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
268
261
|
},
|
|
269
262
|
host: {
|
|
@@ -275,9 +268,7 @@ var schema_default = {
|
|
|
275
268
|
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
276
269
|
}
|
|
277
270
|
},
|
|
278
|
-
required: [
|
|
279
|
-
"host"
|
|
280
|
-
],
|
|
271
|
+
required: ["host"],
|
|
281
272
|
additionalProperties: false
|
|
282
273
|
},
|
|
283
274
|
Development: {
|
|
@@ -319,10 +310,7 @@ var schema_default = {
|
|
|
319
310
|
},
|
|
320
311
|
protocol: {
|
|
321
312
|
type: "string",
|
|
322
|
-
enum: [
|
|
323
|
-
"http",
|
|
324
|
-
"https"
|
|
325
|
-
],
|
|
313
|
+
enum: ["http", "https"],
|
|
326
314
|
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
327
315
|
},
|
|
328
316
|
port: {
|
|
@@ -354,9 +342,7 @@ var schema_default = {
|
|
|
354
342
|
description: "Groups of path expressions that are routed to this application."
|
|
355
343
|
}
|
|
356
344
|
},
|
|
357
|
-
required: [
|
|
358
|
-
"routing"
|
|
359
|
-
],
|
|
345
|
+
required: ["routing"],
|
|
360
346
|
additionalProperties: false
|
|
361
347
|
},
|
|
362
348
|
Routing: {
|
|
@@ -383,9 +369,7 @@ var schema_default = {
|
|
|
383
369
|
}
|
|
384
370
|
}
|
|
385
371
|
},
|
|
386
|
-
required: [
|
|
387
|
-
"paths"
|
|
388
|
-
],
|
|
372
|
+
required: ["paths"],
|
|
389
373
|
additionalProperties: false
|
|
390
374
|
},
|
|
391
375
|
ChildConfig: {
|
|
@@ -406,9 +390,7 @@ var schema_default = {
|
|
|
406
390
|
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."
|
|
407
391
|
}
|
|
408
392
|
},
|
|
409
|
-
required: [
|
|
410
|
-
"partOf"
|
|
411
|
-
],
|
|
393
|
+
required: ["partOf"],
|
|
412
394
|
additionalProperties: false
|
|
413
395
|
}
|
|
414
396
|
}
|
package/dist/validation.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schema/validation.ts","../src/config/microfrontends/server/validation.ts","../src/config/errors.ts","../schema/schema.json","../src/config/schema/utils/load.ts"],"sourcesContent":["export { validateSchema } from '../config/microfrontends/server/validation';\n","import { parse } from 'jsonc-parser';\nimport { Ajv, type ErrorObject } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\n// NOTE(mknichel): AJV returns very imprecise validation errors that include\n// multiple conflicting statements. We should improve this in the future.\nfunction filterAjvErrors(\n errors: ErrorObject[] | null | undefined,\n): ErrorObject[] {\n if (!errors) {\n return [];\n }\n return errors.filter((error) => {\n return (\n error.keyword === 'additionalProperties' || error.keyword === 'required'\n );\n });\n}\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 microfrontends config:\\n - ${ajv.errorsText(filterAjvErrors(validate.errors), { separator: '\\n - ' })}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\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 | 'depcrecated_field'\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 cause?: unknown;\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, { cause: opts?.cause });\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\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\": [\n \"applications\"\n ],\n \"additionalProperties\": false\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Microfrontends wide options for Vercel.\",\n \"deprecated\": \"This is being replaced by the `disableOverrides` field below.\"\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 \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\",\n \"deprecated\": \"This is being replaced by the `localProxyPort` field below.\"\n },\n \"localProxyPort\": {\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 \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\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 \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"propertyNames\": {\n \"description\": \"The unique identifier for a Microfrontend Application. Must match the `name` field of the application's `package.json`.\"\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 \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n }\n },\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\": [\n \"projectId\"\n ],\n \"additionalProperties\": false\n },\n \"HostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\n \"http\",\n \"https\"\n ],\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*\"\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\": [\n \"host\"\n ],\n \"additionalProperties\": false\n },\n \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\",\n \"deprecated\": \"This is being replaced by the `localPort` field below.\"\n },\n \"localPort\": {\n \"type\": \"number\",\n \"description\": \"The local port number that this application runs on when it is running locally. Common values include `80` for HTTP and `443` for HTTPS.\"\n },\n \"fallback\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n {\n \"type\": \"string\"\n }\n ],\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\\nIf passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTPS. If omitted, the port defaults to `80` for HTTP and `443` for HTTPS.\"\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\": [\n \"http\",\n \"https\"\n ],\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*\"\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 \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\",\n \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\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 },\n \"required\": [\n \"routing\"\n ],\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\": [\n \"paths\"\n ],\n \"additionalProperties\": false\n },\n \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\": [\n \"partOf\"\n ],\n \"additionalProperties\": false\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;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAsB;AACtB,iB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ACV;AAAA,QACA,QAAU;AAAA,UACR,MAAQ;AAAA,UACR,aAAe;AAAA,QACjB;AAAA,MACF;AAAA,MACA,UAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,sBAAwB;AAAA,IAC1B;AAAA,EACF;AACF;;;AChSO,IAAM,SAAS;;;AHKtB,SAAS,gBACP,QACe;AACf,MAAI,CAAC,QAAQ;AACX,WAAO,CAAC;AAAA,EACV;AACA,SAAO,OAAO,OAAO,CAAC,UAAU;AAC9B,WACE,MAAM,YAAY,0BAA0B,MAAM,YAAY;AAAA,EAElE,CAAC;AACH;AAEO,SAAS,eAAe,cAA8B;AAC3D,QAAM,mBAAe,2BAAM,YAAY;AACvC,QAAM,MAAM,IAAI,eAAI;AACpB,QAAM,WAAW,IAAI,QAAQ,MAAM;AACnC,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,KAAsC,IAAI,WAAW,gBAAgB,SAAS,MAAM,GAAG,EAAE,WAAW,QAAQ,CAAC;AAAA;AAAA;AAAA,MAC7G,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/schema/validation.ts","../src/config/microfrontends/server/validation.ts","../src/config/errors.ts","../schema/schema.json","../src/config/schema/utils/load.ts"],"sourcesContent":["export { validateSchema } from '../config/microfrontends/server/validation';\n","import { parse } from 'jsonc-parser';\nimport { Ajv, type ErrorObject } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\n// NOTE(mknichel): AJV returns very imprecise validation errors that include\n// multiple conflicting statements. We should improve this in the future.\nfunction filterAjvErrors(\n errors: ErrorObject[] | null | undefined,\n): ErrorObject[] {\n if (!errors) {\n return [];\n }\n return errors.filter((error) => {\n return (\n error.keyword === 'additionalProperties' || error.keyword === 'required'\n );\n });\n}\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 microfrontends config:\\n - ${ajv.errorsText(filterAjvErrors(validate.errors), { separator: '\\n - ' })}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\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 | 'depcrecated_field'\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 cause?: unknown;\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, { cause: opts?.cause });\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\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\"],\n \"additionalProperties\": false\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Microfrontends wide options for Vercel.\",\n \"deprecated\": \"This is being replaced by the `disableOverrides` field below.\"\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 \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\",\n \"deprecated\": \"This is being replaced by the `localProxyPort` field below.\"\n },\n \"localProxyPort\": {\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 \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\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 \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"propertyNames\": {\n \"description\": \"The unique identifier for a Microfrontend Application. Must match the `name` field of the application's `package.json`.\"\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 \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n }\n },\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 \"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*\"\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 \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\",\n \"deprecated\": \"This is being replaced by the `localPort` field below.\"\n },\n \"localPort\": {\n \"type\": \"number\",\n \"description\": \"The local port number that this application runs on when it is running locally. Common values include `80` for HTTP and `443` for HTTPS.\"\n },\n \"fallback\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n {\n \"type\": \"string\"\n }\n ],\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\\nIf passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTPS. If omitted, the port defaults to `80` for HTTP and `443` for HTTPS.\"\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*\"\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 \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\",\n \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\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 },\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 \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\"],\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;AAAA;AAAA;AAAA;AAAA;;;ACAA,0BAAsB;AACtB,iBAAsC;;;AC4E/B,IAAM,qBAAN,cAEG,MAAM;AAAA,EAKd,YAAY,SAAiB,MAAqC;AAChE,UAAM,SAAS,EAAE,OAAO,MAAM,MAAM,CAAC;AACrC,SAAK,OAAO;AACZ,SAAK,SAAS,MAAM,UAAU;AAC9B,SAAK,OAAO,MAAM,QAAS;AAC3B,SAAK,UAAU,MAAM;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,MAAM,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;AAAA,UACN,SAAS;AAAA,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MAAQ;AAAA,MACR,YAAc;AAAA,QACZ,SAAW;AAAA,UACT,MAAQ;AAAA,QACV;AAAA,QACA,SAAW;AAAA,UACT,MAAQ;AAAA,UACR,OAAS;AAAA,QACX;AAAA,QACA,SAAW;AAAA,UACT,MAAQ;AAAA,QACV;AAAA,QACA,QAAU;AAAA,UACR,MAAQ;AAAA,UACR,aAAe;AAAA,QACjB;AAAA,MACF;AAAA,MACA,UAAY,CAAC,QAAQ;AAAA,MACrB,sBAAwB;AAAA,IAC1B;AAAA,EACF;AACF;;;AC9QO,IAAM,SAAS;;;AHKtB,SAAS,gBACP,QACe;AACf,MAAI,CAAC,QAAQ;AACX,WAAO,CAAC;AAAA,EACV;AACA,SAAO,OAAO,OAAO,CAAC,UAAU;AAC9B,WACE,MAAM,YAAY,0BAA0B,MAAM,YAAY;AAAA,EAElE,CAAC;AACH;AAEO,SAAS,eAAe,cAA8B;AAC3D,QAAM,mBAAe,2BAAM,YAAY;AACvC,QAAM,MAAM,IAAI,eAAI;AACpB,QAAM,WAAW,IAAI,QAAQ,MAAM;AACnC,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,KAAsC,IAAI,WAAW,gBAAgB,SAAS,MAAM,GAAG,EAAE,WAAW,QAAQ,CAAC;AAAA;AAAA;AAAA,MAC7G,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
package/dist/validation.js
CHANGED
|
@@ -127,9 +127,7 @@ var schema_default = {
|
|
|
127
127
|
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"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
-
required: [
|
|
131
|
-
"applications"
|
|
132
|
-
],
|
|
130
|
+
required: ["applications"],
|
|
133
131
|
additionalProperties: false
|
|
134
132
|
},
|
|
135
133
|
Options: {
|
|
@@ -224,9 +222,7 @@ var schema_default = {
|
|
|
224
222
|
description: "Vercel project ID"
|
|
225
223
|
}
|
|
226
224
|
},
|
|
227
|
-
required: [
|
|
228
|
-
"projectId"
|
|
229
|
-
],
|
|
225
|
+
required: ["projectId"],
|
|
230
226
|
additionalProperties: false
|
|
231
227
|
},
|
|
232
228
|
HostConfig: {
|
|
@@ -234,10 +230,7 @@ var schema_default = {
|
|
|
234
230
|
properties: {
|
|
235
231
|
protocol: {
|
|
236
232
|
type: "string",
|
|
237
|
-
enum: [
|
|
238
|
-
"http",
|
|
239
|
-
"https"
|
|
240
|
-
],
|
|
233
|
+
enum: ["http", "https"],
|
|
241
234
|
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
242
235
|
},
|
|
243
236
|
host: {
|
|
@@ -249,9 +242,7 @@ var schema_default = {
|
|
|
249
242
|
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
250
243
|
}
|
|
251
244
|
},
|
|
252
|
-
required: [
|
|
253
|
-
"host"
|
|
254
|
-
],
|
|
245
|
+
required: ["host"],
|
|
255
246
|
additionalProperties: false
|
|
256
247
|
},
|
|
257
248
|
Development: {
|
|
@@ -293,10 +284,7 @@ var schema_default = {
|
|
|
293
284
|
},
|
|
294
285
|
protocol: {
|
|
295
286
|
type: "string",
|
|
296
|
-
enum: [
|
|
297
|
-
"http",
|
|
298
|
-
"https"
|
|
299
|
-
],
|
|
287
|
+
enum: ["http", "https"],
|
|
300
288
|
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
301
289
|
},
|
|
302
290
|
port: {
|
|
@@ -328,9 +316,7 @@ var schema_default = {
|
|
|
328
316
|
description: "Groups of path expressions that are routed to this application."
|
|
329
317
|
}
|
|
330
318
|
},
|
|
331
|
-
required: [
|
|
332
|
-
"routing"
|
|
333
|
-
],
|
|
319
|
+
required: ["routing"],
|
|
334
320
|
additionalProperties: false
|
|
335
321
|
},
|
|
336
322
|
Routing: {
|
|
@@ -357,9 +343,7 @@ var schema_default = {
|
|
|
357
343
|
}
|
|
358
344
|
}
|
|
359
345
|
},
|
|
360
|
-
required: [
|
|
361
|
-
"paths"
|
|
362
|
-
],
|
|
346
|
+
required: ["paths"],
|
|
363
347
|
additionalProperties: false
|
|
364
348
|
},
|
|
365
349
|
ChildConfig: {
|
|
@@ -380,9 +364,7 @@ var schema_default = {
|
|
|
380
364
|
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."
|
|
381
365
|
}
|
|
382
366
|
},
|
|
383
|
-
required: [
|
|
384
|
-
"partOf"
|
|
385
|
-
],
|
|
367
|
+
required: ["partOf"],
|
|
386
368
|
additionalProperties: false
|
|
387
369
|
}
|
|
388
370
|
}
|
package/dist/validation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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, type ErrorObject } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\n// NOTE(mknichel): AJV returns very imprecise validation errors that include\n// multiple conflicting statements. We should improve this in the future.\nfunction filterAjvErrors(\n errors: ErrorObject[] | null | undefined,\n): ErrorObject[] {\n if (!errors) {\n return [];\n }\n return errors.filter((error) => {\n return (\n error.keyword === 'additionalProperties' || error.keyword === 'required'\n );\n });\n}\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 microfrontends config:\\n - ${ajv.errorsText(filterAjvErrors(validate.errors), { separator: '\\n - ' })}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\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 | 'depcrecated_field'\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 cause?: unknown;\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, { cause: opts?.cause });\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\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\": [\n \"applications\"\n ],\n \"additionalProperties\": false\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Microfrontends wide options for Vercel.\",\n \"deprecated\": \"This is being replaced by the `disableOverrides` field below.\"\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 \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\",\n \"deprecated\": \"This is being replaced by the `localProxyPort` field below.\"\n },\n \"localProxyPort\": {\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 \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\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 \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"propertyNames\": {\n \"description\": \"The unique identifier for a Microfrontend Application. Must match the `name` field of the application's `package.json`.\"\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 \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n }\n },\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\": [\n \"projectId\"\n ],\n \"additionalProperties\": false\n },\n \"HostConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"protocol\": {\n \"type\": \"string\",\n \"enum\": [\n \"http\",\n \"https\"\n ],\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*\"\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\": [\n \"host\"\n ],\n \"additionalProperties\": false\n },\n \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\",\n \"deprecated\": \"This is being replaced by the `localPort` field below.\"\n },\n \"localPort\": {\n \"type\": \"number\",\n \"description\": \"The local port number that this application runs on when it is running locally. Common values include `80` for HTTP and `443` for HTTPS.\"\n },\n \"fallback\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n {\n \"type\": \"string\"\n }\n ],\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\\nIf passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTPS. If omitted, the port defaults to `80` for HTTP and `443` for HTTPS.\"\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\": [\n \"http\",\n \"https\"\n ],\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*\"\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 \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\",\n \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\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 },\n \"required\": [\n \"routing\"\n ],\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\": [\n \"paths\"\n ],\n \"additionalProperties\": false\n },\n \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\": [\n \"partOf\"\n ],\n \"additionalProperties\": false\n }\n }\n}","import type { JSONSchema7 } from 'json-schema';\nimport jsonSchema from '../../../../schema/schema.json';\n\nexport const SCHEMA = jsonSchema as JSONSchema7;\n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AAA,QACA,SAAW;AAAA,UACT,MAAQ;AAAA,QACV;AAAA,QACA,QAAU;AAAA,UACR,MAAQ;AAAA,UACR,aAAe;AAAA,QACjB;AAAA,MACF;AAAA,MACA,UAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,sBAAwB;AAAA,IAC1B;AAAA,EACF;AACF;;;AChSO,IAAM,SAAS;;;AHKtB,SAAS,gBACP,QACe;AACf,MAAI,CAAC,QAAQ;AACX,WAAO,CAAC;AAAA,EACV;AACA,SAAO,OAAO,OAAO,CAAC,UAAU;AAC9B,WACE,MAAM,YAAY,0BAA0B,MAAM,YAAY;AAAA,EAElE,CAAC;AACH;AAEO,SAAS,eAAe,cAA8B;AAC3D,QAAM,eAAe,MAAM,YAAY;AACvC,QAAM,MAAM,IAAI,IAAI;AACpB,QAAM,WAAW,IAAI,QAAQ,MAAM;AACnC,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,KAAsC,IAAI,WAAW,gBAAgB,SAAS,MAAM,GAAG,EAAE,WAAW,QAAQ,CAAC;AAAA;AAAA;AAAA,MAC7G,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
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, type ErrorObject } from 'ajv';\nimport type { Config } from '../../schema/types';\nimport { MicrofrontendError } from '../../errors';\nimport { SCHEMA } from '../../schema/utils/load';\n\n// NOTE(mknichel): AJV returns very imprecise validation errors that include\n// multiple conflicting statements. We should improve this in the future.\nfunction filterAjvErrors(\n errors: ErrorObject[] | null | undefined,\n): ErrorObject[] {\n if (!errors) {\n return [];\n }\n return errors.filter((error) => {\n return (\n error.keyword === 'additionalProperties' || error.keyword === 'required'\n );\n });\n}\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 microfrontends config:\\n - ${ajv.errorsText(filterAjvErrors(validate.errors), { separator: '\\n - ' })}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\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 | 'depcrecated_field'\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 cause?: unknown;\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, { cause: opts?.cause });\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\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\"],\n \"additionalProperties\": false\n },\n \"Options\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/VercelOptions\",\n \"description\": \"Microfrontends wide options for Vercel.\",\n \"deprecated\": \"This is being replaced by the `disableOverrides` field below.\"\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 \"localProxy\": {\n \"$ref\": \"#/definitions/LocalProxyOptions\",\n \"description\": \"Options for local proxy.\",\n \"deprecated\": \"This is being replaced by the `localProxyPort` field below.\"\n },\n \"localProxyPort\": {\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 \"VercelOptions\": {\n \"type\": \"object\",\n \"properties\": {\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 \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"propertyNames\": {\n \"description\": \"The unique identifier for a Microfrontend Application. Must match the `name` field of the application's `package.json`.\"\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 \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/Development\"\n }\n },\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 \"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*\"\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 \"Development\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"$ref\": \"#/definitions/LocalHostConfig\",\n \"deprecated\": \"This is being replaced by the `localPort` field below.\"\n },\n \"localPort\": {\n \"type\": \"number\",\n \"description\": \"The local port number that this application runs on when it is running locally. Common values include `80` for HTTP and `443` for HTTPS.\"\n },\n \"fallback\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n {\n \"type\": \"string\"\n }\n ],\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\\nIf passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTPS. If omitted, the port defaults to `80` for HTTP and `443` for HTTPS.\"\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*\"\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 \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"vercel\": {\n \"$ref\": \"#/definitions/Vercel\",\n \"deprecated\": \"This is being replaced by the `projectId` field below.\"\n },\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID\"\n },\n \"production\": {\n \"$ref\": \"#/definitions/HostConfig\",\n \"deprecated\": \"This is a duplicate of the `development.fallback` field and this will be removed soon.\"\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 },\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 \"ChildConfig\": {\n \"type\": \"object\",\n \"properties\": {\n \"$schema\": {\n \"type\": \"string\"\n },\n \"version\": {\n \"type\": \"string\",\n \"const\": \"1\"\n },\n \"options\": {\n \"$ref\": \"#/definitions/Options\"\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\"],\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,WAA6B;;;AC4E/B,IAAM,qBAAN,cAEG,MAAM;AAAA,EAKd,YAAY,SAAiB,MAAqC;AAChE,UAAM,SAAS,EAAE,OAAO,MAAM,MAAM,CAAC;AACrC,SAAK,OAAO;AACZ,SAAK,SAAS,MAAM,UAAU;AAC9B,SAAK,OAAO,MAAM,QAAS;AAC3B,SAAK,UAAU,MAAM;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,MAAM,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;AAAA,UACN,SAAS;AAAA,UACT,QAAQ;AAAA,QACV,CAAC;AAAA,MACH;AACA,UAAI,SAAS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