@vercel/microfrontends 1.1.1-canary.6 → 1.2.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 +405 -204
- package/dist/config.cjs +25 -68
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.ts +5 -5
- package/dist/config.js +25 -68
- package/dist/config.js.map +1 -1
- package/dist/experimental/sveltekit.cjs +64 -193
- package/dist/experimental/sveltekit.cjs.map +1 -1
- package/dist/experimental/sveltekit.js +64 -193
- package/dist/experimental/sveltekit.js.map +1 -1
- package/dist/experimental/vite.cjs +64 -193
- package/dist/experimental/vite.cjs.map +1 -1
- package/dist/experimental/vite.js +64 -193
- package/dist/experimental/vite.js.map +1 -1
- package/dist/microfrontends/server.cjs +64 -193
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.d.ts +3 -3
- package/dist/microfrontends/server.js +64 -193
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/next/config.cjs +69 -358
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.d.ts +1 -1
- package/dist/next/config.js +69 -358
- package/dist/next/config.js.map +1 -1
- package/dist/next/endpoints.d.ts +2 -2
- package/dist/next/middleware.cjs +25 -68
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.js +25 -68
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/testing.cjs +123 -144
- package/dist/next/testing.cjs.map +1 -1
- package/dist/next/testing.d.ts +36 -5
- package/dist/next/testing.js +122 -143
- package/dist/next/testing.js.map +1 -1
- package/dist/overrides.d.ts +3 -3
- package/dist/schema.d.ts +2 -2
- package/dist/{types-f1260e44.d.ts → types-b970b583.d.ts} +1 -1
- package/dist/{types-a4add5ab.d.ts → types-bee19651.d.ts} +11 -2
- package/dist/{types-54064641.d.ts → types-c9f15465.d.ts} +31 -85
- package/dist/utils/mfe-port.cjs +64 -193
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +64 -193
- package/dist/utils/mfe-port.js.map +1 -1
- package/dist/validation.cjs +39 -125
- package/dist/validation.cjs.map +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js +39 -125
- package/dist/validation.js.map +1 -1
- package/package.json +2 -8
- package/schema/schema.json +45 -131
- package/dist/routing.cjs +0 -19
- package/dist/routing.cjs.map +0 -1
- package/dist/routing.d.ts +0 -26
- package/dist/routing.js +0 -1
- package/dist/routing.js.map +0 -1
package/dist/validation.cjs
CHANGED
|
@@ -149,20 +149,10 @@ var schema_default = {
|
|
|
149
149
|
Options: {
|
|
150
150
|
type: "object",
|
|
151
151
|
properties: {
|
|
152
|
-
vercel: {
|
|
153
|
-
$ref: "#/definitions/VercelOptions",
|
|
154
|
-
description: "Microfrontends wide options for Vercel.",
|
|
155
|
-
deprecated: "This is being replaced by the `disableOverrides` field below."
|
|
156
|
-
},
|
|
157
152
|
disableOverrides: {
|
|
158
153
|
type: "boolean",
|
|
159
154
|
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."
|
|
160
155
|
},
|
|
161
|
-
localProxy: {
|
|
162
|
-
$ref: "#/definitions/LocalProxyOptions",
|
|
163
|
-
description: "Options for local proxy.",
|
|
164
|
-
deprecated: "This is being replaced by the `localProxyPort` field below."
|
|
165
|
-
},
|
|
166
156
|
localProxyPort: {
|
|
167
157
|
type: "number",
|
|
168
158
|
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
@@ -170,26 +160,6 @@ var schema_default = {
|
|
|
170
160
|
},
|
|
171
161
|
additionalProperties: false
|
|
172
162
|
},
|
|
173
|
-
VercelOptions: {
|
|
174
|
-
type: "object",
|
|
175
|
-
properties: {
|
|
176
|
-
disableOverrides: {
|
|
177
|
-
type: "boolean",
|
|
178
|
-
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."
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
additionalProperties: false
|
|
182
|
-
},
|
|
183
|
-
LocalProxyOptions: {
|
|
184
|
-
type: "object",
|
|
185
|
-
properties: {
|
|
186
|
-
port: {
|
|
187
|
-
type: "number",
|
|
188
|
-
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
additionalProperties: false
|
|
192
|
-
},
|
|
193
163
|
ApplicationRouting: {
|
|
194
164
|
type: "object",
|
|
195
165
|
additionalProperties: {
|
|
@@ -212,141 +182,62 @@ var schema_default = {
|
|
|
212
182
|
DefaultApplication: {
|
|
213
183
|
type: "object",
|
|
214
184
|
properties: {
|
|
215
|
-
vercel: {
|
|
216
|
-
$ref: "#/definitions/Vercel",
|
|
217
|
-
deprecated: "This is being replaced by the `projectId` field below."
|
|
218
|
-
},
|
|
219
185
|
projectId: {
|
|
220
186
|
type: "string",
|
|
221
187
|
description: "Vercel project ID, only required if the application name / id is different to the Vercel project name.",
|
|
222
|
-
deprecated: "Instead, the application id should match the Vercel project name."
|
|
188
|
+
deprecated: "Instead, the application id should match the Vercel project name. `packageName` can optionally\nbe set to the name of the package.json (if it is different from the project name)."
|
|
223
189
|
},
|
|
224
190
|
packageName: {
|
|
225
191
|
type: "string",
|
|
226
192
|
description: "The name used to run the application, e.g. the `name` field in the `package.json`.\n\nThis is used by the local proxy to map the application config to the locally running app.\n\nThis is only necessary when the application name does not match the `name` used in `package.json`."
|
|
227
193
|
},
|
|
228
|
-
production: {
|
|
229
|
-
$ref: "#/definitions/HostConfig",
|
|
230
|
-
deprecated: "This is a duplicate of the `development.fallback` field and this will be removed soon."
|
|
231
|
-
},
|
|
232
194
|
development: {
|
|
233
|
-
$ref: "#/definitions/
|
|
234
|
-
|
|
235
|
-
},
|
|
236
|
-
additionalProperties: false
|
|
237
|
-
},
|
|
238
|
-
Vercel: {
|
|
239
|
-
type: "object",
|
|
240
|
-
properties: {
|
|
241
|
-
projectId: {
|
|
242
|
-
type: "string",
|
|
243
|
-
description: "Vercel project ID"
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
required: ["projectId"],
|
|
247
|
-
additionalProperties: false
|
|
248
|
-
},
|
|
249
|
-
HostConfig: {
|
|
250
|
-
type: "object",
|
|
251
|
-
properties: {
|
|
252
|
-
protocol: {
|
|
253
|
-
type: "string",
|
|
254
|
-
enum: ["http", "https"],
|
|
255
|
-
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
256
|
-
},
|
|
257
|
-
host: {
|
|
258
|
-
type: "string",
|
|
259
|
-
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`)."
|
|
260
|
-
},
|
|
261
|
-
port: {
|
|
262
|
-
type: "number",
|
|
263
|
-
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
195
|
+
$ref: "#/definitions/DefaultDevelopment",
|
|
196
|
+
description: "Development configuration for the default application."
|
|
264
197
|
}
|
|
265
198
|
},
|
|
266
|
-
required: ["
|
|
199
|
+
required: ["development"],
|
|
267
200
|
additionalProperties: false
|
|
268
201
|
},
|
|
269
|
-
|
|
202
|
+
DefaultDevelopment: {
|
|
270
203
|
type: "object",
|
|
271
204
|
properties: {
|
|
272
205
|
local: {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
type: "number"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
type: "string"
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
$ref: "#/definitions/LocalHostConfig"
|
|
282
|
-
}
|
|
283
|
-
],
|
|
284
|
-
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080\n\nPassing a LocalHostConfig is deprecated and will go away soon, please pass a number or string."
|
|
206
|
+
type: ["number", "string"],
|
|
207
|
+
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080"
|
|
285
208
|
},
|
|
286
209
|
localPort: {
|
|
287
210
|
type: "number",
|
|
288
211
|
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. If omitted, the port defaults to a unique, but stable (based on the application name) number.",
|
|
289
212
|
deprecated: "Please set the port with the 'local' field instead."
|
|
290
213
|
},
|
|
291
|
-
fallback: {
|
|
292
|
-
anyOf: [
|
|
293
|
-
{
|
|
294
|
-
$ref: "#/definitions/HostConfig"
|
|
295
|
-
},
|
|
296
|
-
{
|
|
297
|
-
type: "string"
|
|
298
|
-
}
|
|
299
|
-
],
|
|
300
|
-
description: "Fallback for local development, could point 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\nPassing a HostConfig is deprecated and will go away soon, please pass a string."
|
|
301
|
-
},
|
|
302
214
|
task: {
|
|
303
215
|
type: "string",
|
|
304
216
|
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
additionalProperties: false
|
|
308
|
-
},
|
|
309
|
-
LocalHostConfig: {
|
|
310
|
-
type: "object",
|
|
311
|
-
additionalProperties: false,
|
|
312
|
-
properties: {
|
|
313
|
-
host: {
|
|
314
|
-
type: "string",
|
|
315
|
-
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`)."
|
|
316
217
|
},
|
|
317
|
-
|
|
218
|
+
fallback: {
|
|
318
219
|
type: "string",
|
|
319
|
-
|
|
320
|
-
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
321
|
-
},
|
|
322
|
-
port: {
|
|
323
|
-
type: "number",
|
|
324
|
-
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
220
|
+
description: "Fallback for local development, could point to any environment. This is required for the default app. This value is used as the fallback for child apps as well if they do not have a fallback.\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."
|
|
325
221
|
}
|
|
326
|
-
}
|
|
222
|
+
},
|
|
223
|
+
required: ["fallback"],
|
|
224
|
+
additionalProperties: false
|
|
327
225
|
},
|
|
328
226
|
ChildApplication: {
|
|
329
227
|
type: "object",
|
|
330
228
|
properties: {
|
|
331
|
-
vercel: {
|
|
332
|
-
$ref: "#/definitions/Vercel",
|
|
333
|
-
deprecated: "This is being replaced by the `projectId` field below."
|
|
334
|
-
},
|
|
335
229
|
projectId: {
|
|
336
230
|
type: "string",
|
|
337
231
|
description: "Vercel project ID, only required if the application name / id is different to the Vercel project name.",
|
|
338
|
-
deprecated: "Instead, the application id should match the Vercel project name."
|
|
232
|
+
deprecated: "Instead, the application id should match the Vercel project name. `packageName` can optionally\nbe set to the name of the package.json (if it is different from the project name)."
|
|
339
233
|
},
|
|
340
234
|
packageName: {
|
|
341
235
|
type: "string",
|
|
342
236
|
description: "The name used to run the application, e.g. the `name` field in the `package.json`.\n\nThis is used by the local proxy to map the application config to the locally running app.\n\nThis is only necessary when the application name does not match the `name` used in `package.json`."
|
|
343
237
|
},
|
|
344
|
-
production: {
|
|
345
|
-
$ref: "#/definitions/HostConfig",
|
|
346
|
-
deprecated: "This is a duplicate of the `development.fallback` field and this will be removed soon."
|
|
347
|
-
},
|
|
348
238
|
development: {
|
|
349
|
-
$ref: "#/definitions/
|
|
239
|
+
$ref: "#/definitions/ChildDevelopment",
|
|
240
|
+
description: "Development configuration for the child application."
|
|
350
241
|
},
|
|
351
242
|
routing: {
|
|
352
243
|
$ref: "#/definitions/Routing",
|
|
@@ -356,6 +247,29 @@ var schema_default = {
|
|
|
356
247
|
required: ["routing"],
|
|
357
248
|
additionalProperties: false
|
|
358
249
|
},
|
|
250
|
+
ChildDevelopment: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: {
|
|
253
|
+
local: {
|
|
254
|
+
type: ["number", "string"],
|
|
255
|
+
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080"
|
|
256
|
+
},
|
|
257
|
+
localPort: {
|
|
258
|
+
type: "number",
|
|
259
|
+
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. If omitted, the port defaults to a unique, but stable (based on the application name) number.",
|
|
260
|
+
deprecated: "Please set the port with the 'local' field instead."
|
|
261
|
+
},
|
|
262
|
+
task: {
|
|
263
|
+
type: "string",
|
|
264
|
+
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
265
|
+
},
|
|
266
|
+
fallback: {
|
|
267
|
+
type: "string",
|
|
268
|
+
description: "Fallback for local development, could point to any environment. This is optional for child apps. If not provided, the fallback of the default app will be used.\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."
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
additionalProperties: false
|
|
272
|
+
},
|
|
359
273
|
Routing: {
|
|
360
274
|
type: "array",
|
|
361
275
|
items: {
|
|
@@ -441,7 +355,7 @@ function formatAjvErrors(errors) {
|
|
|
441
355
|
}
|
|
442
356
|
function validateSchema(configString) {
|
|
443
357
|
const parsedConfig = (0, import_jsonc_parser.parse)(configString);
|
|
444
|
-
const ajv = new import_ajv.Ajv();
|
|
358
|
+
const ajv = new import_ajv.Ajv({ allowUnionTypes: true });
|
|
445
359
|
const validate = ajv.compile(SCHEMA);
|
|
446
360
|
const isValid = validate(parsedConfig);
|
|
447
361
|
if (!isValid) {
|
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\nconst LIST_FORMATTER = new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n});\n\nfunction formatAjvErrors(errors: ErrorObject[] | null | undefined): string[] {\n if (!errors) {\n return [];\n }\n const errorMessages: string[] = [];\n for (const error of errors) {\n // Ignore root errors that arise because AJV can't infer whether the config is a main config or a child config.\n // These errors are confusing for the user.\n if (\n error.instancePath === '' &&\n (error.keyword === 'anyOf' ||\n (error.keyword === 'required' &&\n error.params.missingProperty === 'partOf'))\n ) {\n continue;\n }\n\n // Ignore the first leading slash in the instance path to make the path more readable.\n const instancePath = error.instancePath.slice(1);\n const formattedInstancePath =\n instancePath === '' ? 'at the root' : `in field ${instancePath}`;\n\n // AJV errors are really cryptic, so this logic transforms them to nicer ones.\n // It is based on heuristics from introducing errors and observing what AJV produces.\n if (\n error.keyword === 'required' &&\n error.params.missingProperty === 'routing' &&\n instancePath.split('/').length === 2\n ) {\n errorMessages.push(\n `Unable to infer if ${instancePath} is the default app or a child app. This usually means that there is another error in the configuration.`,\n );\n } else if (\n error.keyword === 'anyOf' &&\n instancePath.split('/').length > 2\n ) {\n const anyOfErrors = errors.filter(\n (e) => e.instancePath === error.instancePath && e.keyword !== 'anyOf',\n );\n if (anyOfErrors.every((e) => e.keyword === 'type')) {\n const allowedTypes = LIST_FORMATTER.format(\n anyOfErrors.map((e) => {\n return e.keyword === 'type' ? String(e.params.type) : 'unknown';\n }),\n );\n errorMessages.push(\n `Incorrect type for ${instancePath}. Must be one of ${allowedTypes}`,\n );\n } else {\n errorMessages.push(\n `Invalid field for ${instancePath}. Possible error messages are ${LIST_FORMATTER.format(anyOfErrors.map((e) => e.message ?? ''))}`,\n );\n }\n } else if (\n error.keyword === 'additionalProperties' &&\n !(\n error.params.additionalProperty === 'routing' &&\n instancePath.split('/').length === 2\n )\n ) {\n errorMessages.push(\n `Property '${error.params.additionalProperty}' is not allowed ${formattedInstancePath}`,\n );\n } else if (error.keyword === 'required') {\n errorMessages.push(\n `Property '${error.params.missingProperty}' is required ${formattedInstancePath}`,\n );\n }\n }\n return errorMessages;\n}\n\nexport function validateSchema(configString: string): Config {\n const parsedConfig = parse(configString) as Config;\n\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:${formatAjvErrors(validate.errors)\n .map((error) => `\\n - ${error}`)\n .join(\n '',\n )}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\n { type: 'config', subtype: 'does_not_match_schema' },\n );\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 \"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.\\n\\nMust match the Vercel project name.\\n\\nNote: If this name does not also match the name used to run the application, (e.g. the `name` from the `package.json`), then the `packageName` field should be set.\"\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, only required if the application name / id is different to the Vercel project name.\",\n \"deprecated\": \"Instead, the application id should match the Vercel project name.\"\n },\n \"packageName\": {\n \"type\": \"string\",\n \"description\": \"The name used to run the application, e.g. the `name` field in the `package.json`.\\n\\nThis is used by the local proxy to map the application config to the locally running app.\\n\\nThis is only necessary when the application name does not match the `name` used in `package.json`.\"\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 \"anyOf\": [\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"string\"\n },\n {\n \"$ref\": \"#/definitions/LocalHostConfig\"\n }\n ],\n \"description\": \"A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\\n\\nExamples of valid values:\\n- 8080\\n- my.localhost.me\\n- my.localhost.me:8080\\n- https://my.localhost.me\\n- https://my.localhost.me:8080\\n\\nPassing a LocalHostConfig is deprecated and will go away soon, please pass a number or string.\"\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. If omitted, the port defaults to a unique, but stable (based on the application name) number.\",\n \"deprecated\": \"Please set the port with the 'local' field instead.\"\n },\n \"fallback\": {\n \"anyOf\": [\n {\n \"$ref\": \"#/definitions/HostConfig\"\n },\n {\n \"type\": \"string\"\n }\n ],\n \"description\": \"Fallback for local development, could point 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\\nPassing a HostConfig is deprecated and will go away soon, please pass a string.\"\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, only required if the application name / id is different to the Vercel project name.\",\n \"deprecated\": \"Instead, the application id should match the Vercel project name.\"\n },\n \"packageName\": {\n \"type\": \"string\",\n \"description\": \"The name used to run the application, e.g. the `name` field in the `package.json`.\\n\\nThis is used by the local proxy to map the application config to the locally running app.\\n\\nThis is only necessary when the application name does not match the `name` used in `package.json`.\"\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 }\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,mBAA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AA,MACF,OAAO;AACL,sBAAc;AAAA,UACZ,qBAAqB,6CAA6C,eAAe,OAAO,YAAY,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,CAAC;AAAA,QACjI;AAAA,MACF;AAAA,IACF,WACE,MAAM,YAAY,0BAClB,EACE,MAAM,OAAO,uBAAuB,aACpC,aAAa,MAAM,GAAG,EAAE,WAAW,IAErC;AACA,oBAAc;AAAA,QACZ,aAAa,MAAM,OAAO,sCAAsC;AAAA,MAClE;AAAA,IACF,WAAW,MAAM,YAAY,YAAY;AACvC,oBAAc;AAAA,QACZ,aAAa,MAAM,OAAO,gCAAgC;AAAA,MAC5D;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,eAAe,cAA8B;AAC3D,QAAM,mBAAe,2BAAM,YAAY;AAEvC,QAAM,MAAM,IAAI,eAAI;AACpB,QAAM,WAAW,IAAI,QAAQ,MAAM;AACnC,QAAM,UAAU,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR,iCAAiC,gBAAgB,SAAS,MAAM,EAC7D,IAAI,CAAC,UAAU;AAAA,KAAQ,OAAO,EAC9B;AAAA,QACC;AAAA,MACF;AAAA;AAAA;AAAA,MACF,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AAEA,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\nconst LIST_FORMATTER = new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n});\n\nfunction formatAjvErrors(errors: ErrorObject[] | null | undefined): string[] {\n if (!errors) {\n return [];\n }\n const errorMessages: string[] = [];\n for (const error of errors) {\n // Ignore root errors that arise because AJV can't infer whether the config is a main config or a child config.\n // These errors are confusing for the user.\n if (\n error.instancePath === '' &&\n (error.keyword === 'anyOf' ||\n (error.keyword === 'required' &&\n error.params.missingProperty === 'partOf'))\n ) {\n continue;\n }\n\n // Ignore the first leading slash in the instance path to make the path more readable.\n const instancePath = error.instancePath.slice(1);\n const formattedInstancePath =\n instancePath === '' ? 'at the root' : `in field ${instancePath}`;\n\n // AJV errors are really cryptic, so this logic transforms them to nicer ones.\n // It is based on heuristics from introducing errors and observing what AJV produces.\n if (\n error.keyword === 'required' &&\n error.params.missingProperty === 'routing' &&\n instancePath.split('/').length === 2\n ) {\n errorMessages.push(\n `Unable to infer if ${instancePath} is the default app or a child app. This usually means that there is another error in the configuration.`,\n );\n } else if (\n error.keyword === 'anyOf' &&\n instancePath.split('/').length > 2\n ) {\n const anyOfErrors = errors.filter(\n (e) => e.instancePath === error.instancePath && e.keyword !== 'anyOf',\n );\n if (anyOfErrors.every((e) => e.keyword === 'type')) {\n const allowedTypes = LIST_FORMATTER.format(\n anyOfErrors.map((e) => {\n return e.keyword === 'type' ? String(e.params.type) : 'unknown';\n }),\n );\n errorMessages.push(\n `Incorrect type for ${instancePath}. Must be one of ${allowedTypes}`,\n );\n } else {\n errorMessages.push(\n `Invalid field for ${instancePath}. Possible error messages are ${LIST_FORMATTER.format(anyOfErrors.map((e) => e.message ?? ''))}`,\n );\n }\n } else if (\n error.keyword === 'additionalProperties' &&\n !(\n error.params.additionalProperty === 'routing' &&\n instancePath.split('/').length === 2\n )\n ) {\n errorMessages.push(\n `Property '${error.params.additionalProperty}' is not allowed ${formattedInstancePath}`,\n );\n } else if (error.keyword === 'required') {\n errorMessages.push(\n `Property '${error.params.missingProperty}' is required ${formattedInstancePath}`,\n );\n }\n }\n return errorMessages;\n}\n\nexport function validateSchema(configString: string): Config {\n const parsedConfig = parse(configString) as Config;\n\n const ajv = new Ajv({ allowUnionTypes: true });\n const validate = ajv.compile(SCHEMA);\n const isValid = validate(parsedConfig);\n if (!isValid) {\n throw new MicrofrontendError(\n `Invalid microfrontends config:${formatAjvErrors(validate.errors)\n .map((error) => `\\n - ${error}`)\n .join(\n '',\n )}\\n\\nSee https://openapi.vercel.sh/microfrontends.json for the schema.`,\n { type: 'config', subtype: 'does_not_match_schema' },\n );\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 \"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 \"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 \"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 \"ApplicationRouting\": {\n \"type\": \"object\",\n \"additionalProperties\": {\n \"$ref\": \"#/definitions/Application\"\n },\n \"propertyNames\": {\n \"description\": \"The unique identifier for a Microfrontend Application.\\n\\nMust match the Vercel project name.\\n\\nNote: If this name does not also match the name used to run the application, (e.g. the `name` from the `package.json`), then the `packageName` field should be set.\"\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 \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID, only required if the application name / id is different to the Vercel project name.\",\n \"deprecated\": \"Instead, the application id should match the Vercel project name. `packageName` can optionally\\nbe set to the name of the package.json (if it is different from the project name).\"\n },\n \"packageName\": {\n \"type\": \"string\",\n \"description\": \"The name used to run the application, e.g. the `name` field in the `package.json`.\\n\\nThis is used by the local proxy to map the application config to the locally running app.\\n\\nThis is only necessary when the application name does not match the `name` used in `package.json`.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/DefaultDevelopment\",\n \"description\": \"Development configuration for the default application.\"\n }\n },\n \"required\": [\"development\"],\n \"additionalProperties\": false\n },\n \"DefaultDevelopment\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"type\": [\"number\", \"string\"],\n \"description\": \"A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\\n\\nExamples of valid values:\\n- 8080\\n- my.localhost.me\\n- my.localhost.me:8080\\n- https://my.localhost.me\\n- https://my.localhost.me:8080\"\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. If omitted, the port defaults to a unique, but stable (based on the application name) number.\",\n \"deprecated\": \"Please set the port with the 'local' field instead.\"\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 \"fallback\": {\n \"type\": \"string\",\n \"description\": \"Fallback for local development, could point to any environment. This is required for the default app. This value is used as the fallback for child apps as well if they do not have a fallback.\\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 },\n \"required\": [\"fallback\"],\n \"additionalProperties\": false\n },\n \"ChildApplication\": {\n \"type\": \"object\",\n \"properties\": {\n \"projectId\": {\n \"type\": \"string\",\n \"description\": \"Vercel project ID, only required if the application name / id is different to the Vercel project name.\",\n \"deprecated\": \"Instead, the application id should match the Vercel project name. `packageName` can optionally\\nbe set to the name of the package.json (if it is different from the project name).\"\n },\n \"packageName\": {\n \"type\": \"string\",\n \"description\": \"The name used to run the application, e.g. the `name` field in the `package.json`.\\n\\nThis is used by the local proxy to map the application config to the locally running app.\\n\\nThis is only necessary when the application name does not match the `name` used in `package.json`.\"\n },\n \"development\": {\n \"$ref\": \"#/definitions/ChildDevelopment\",\n \"description\": \"Development configuration for the child application.\"\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 \"ChildDevelopment\": {\n \"type\": \"object\",\n \"properties\": {\n \"local\": {\n \"type\": [\"number\", \"string\"],\n \"description\": \"A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\\n\\nExamples of valid values:\\n- 8080\\n- my.localhost.me\\n- my.localhost.me:8080\\n- https://my.localhost.me\\n- https://my.localhost.me:8080\"\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. If omitted, the port defaults to a unique, but stable (based on the application name) number.\",\n \"deprecated\": \"Please set the port with the 'local' field instead.\"\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 \"fallback\": {\n \"type\": \"string\",\n \"description\": \"Fallback for local development, could point to any environment. This is optional for child apps. If not provided, the fallback of the default app will be used.\\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 },\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 }\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;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AA,MACF,EAAE,MAAM,UAAU,SAAS,wBAAwB;AAAA,IACrD;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
package/dist/validation.d.ts
CHANGED
package/dist/validation.js
CHANGED
|
@@ -123,20 +123,10 @@ var schema_default = {
|
|
|
123
123
|
Options: {
|
|
124
124
|
type: "object",
|
|
125
125
|
properties: {
|
|
126
|
-
vercel: {
|
|
127
|
-
$ref: "#/definitions/VercelOptions",
|
|
128
|
-
description: "Microfrontends wide options for Vercel.",
|
|
129
|
-
deprecated: "This is being replaced by the `disableOverrides` field below."
|
|
130
|
-
},
|
|
131
126
|
disableOverrides: {
|
|
132
127
|
type: "boolean",
|
|
133
128
|
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."
|
|
134
129
|
},
|
|
135
|
-
localProxy: {
|
|
136
|
-
$ref: "#/definitions/LocalProxyOptions",
|
|
137
|
-
description: "Options for local proxy.",
|
|
138
|
-
deprecated: "This is being replaced by the `localProxyPort` field below."
|
|
139
|
-
},
|
|
140
130
|
localProxyPort: {
|
|
141
131
|
type: "number",
|
|
142
132
|
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
@@ -144,26 +134,6 @@ var schema_default = {
|
|
|
144
134
|
},
|
|
145
135
|
additionalProperties: false
|
|
146
136
|
},
|
|
147
|
-
VercelOptions: {
|
|
148
|
-
type: "object",
|
|
149
|
-
properties: {
|
|
150
|
-
disableOverrides: {
|
|
151
|
-
type: "boolean",
|
|
152
|
-
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."
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
additionalProperties: false
|
|
156
|
-
},
|
|
157
|
-
LocalProxyOptions: {
|
|
158
|
-
type: "object",
|
|
159
|
-
properties: {
|
|
160
|
-
port: {
|
|
161
|
-
type: "number",
|
|
162
|
-
description: "The port number used by the local proxy server.\n\nThe default is `3024`."
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
additionalProperties: false
|
|
166
|
-
},
|
|
167
137
|
ApplicationRouting: {
|
|
168
138
|
type: "object",
|
|
169
139
|
additionalProperties: {
|
|
@@ -186,141 +156,62 @@ var schema_default = {
|
|
|
186
156
|
DefaultApplication: {
|
|
187
157
|
type: "object",
|
|
188
158
|
properties: {
|
|
189
|
-
vercel: {
|
|
190
|
-
$ref: "#/definitions/Vercel",
|
|
191
|
-
deprecated: "This is being replaced by the `projectId` field below."
|
|
192
|
-
},
|
|
193
159
|
projectId: {
|
|
194
160
|
type: "string",
|
|
195
161
|
description: "Vercel project ID, only required if the application name / id is different to the Vercel project name.",
|
|
196
|
-
deprecated: "Instead, the application id should match the Vercel project name."
|
|
162
|
+
deprecated: "Instead, the application id should match the Vercel project name. `packageName` can optionally\nbe set to the name of the package.json (if it is different from the project name)."
|
|
197
163
|
},
|
|
198
164
|
packageName: {
|
|
199
165
|
type: "string",
|
|
200
166
|
description: "The name used to run the application, e.g. the `name` field in the `package.json`.\n\nThis is used by the local proxy to map the application config to the locally running app.\n\nThis is only necessary when the application name does not match the `name` used in `package.json`."
|
|
201
167
|
},
|
|
202
|
-
production: {
|
|
203
|
-
$ref: "#/definitions/HostConfig",
|
|
204
|
-
deprecated: "This is a duplicate of the `development.fallback` field and this will be removed soon."
|
|
205
|
-
},
|
|
206
168
|
development: {
|
|
207
|
-
$ref: "#/definitions/
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
additionalProperties: false
|
|
211
|
-
},
|
|
212
|
-
Vercel: {
|
|
213
|
-
type: "object",
|
|
214
|
-
properties: {
|
|
215
|
-
projectId: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "Vercel project ID"
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
required: ["projectId"],
|
|
221
|
-
additionalProperties: false
|
|
222
|
-
},
|
|
223
|
-
HostConfig: {
|
|
224
|
-
type: "object",
|
|
225
|
-
properties: {
|
|
226
|
-
protocol: {
|
|
227
|
-
type: "string",
|
|
228
|
-
enum: ["http", "https"],
|
|
229
|
-
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
230
|
-
},
|
|
231
|
-
host: {
|
|
232
|
-
type: "string",
|
|
233
|
-
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`)."
|
|
234
|
-
},
|
|
235
|
-
port: {
|
|
236
|
-
type: "number",
|
|
237
|
-
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
169
|
+
$ref: "#/definitions/DefaultDevelopment",
|
|
170
|
+
description: "Development configuration for the default application."
|
|
238
171
|
}
|
|
239
172
|
},
|
|
240
|
-
required: ["
|
|
173
|
+
required: ["development"],
|
|
241
174
|
additionalProperties: false
|
|
242
175
|
},
|
|
243
|
-
|
|
176
|
+
DefaultDevelopment: {
|
|
244
177
|
type: "object",
|
|
245
178
|
properties: {
|
|
246
179
|
local: {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
type: "number"
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
type: "string"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
$ref: "#/definitions/LocalHostConfig"
|
|
256
|
-
}
|
|
257
|
-
],
|
|
258
|
-
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080\n\nPassing a LocalHostConfig is deprecated and will go away soon, please pass a number or string."
|
|
180
|
+
type: ["number", "string"],
|
|
181
|
+
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080"
|
|
259
182
|
},
|
|
260
183
|
localPort: {
|
|
261
184
|
type: "number",
|
|
262
185
|
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. If omitted, the port defaults to a unique, but stable (based on the application name) number.",
|
|
263
186
|
deprecated: "Please set the port with the 'local' field instead."
|
|
264
187
|
},
|
|
265
|
-
fallback: {
|
|
266
|
-
anyOf: [
|
|
267
|
-
{
|
|
268
|
-
$ref: "#/definitions/HostConfig"
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
type: "string"
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
description: "Fallback for local development, could point 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\nPassing a HostConfig is deprecated and will go away soon, please pass a string."
|
|
275
|
-
},
|
|
276
188
|
task: {
|
|
277
189
|
type: "string",
|
|
278
190
|
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
additionalProperties: false
|
|
282
|
-
},
|
|
283
|
-
LocalHostConfig: {
|
|
284
|
-
type: "object",
|
|
285
|
-
additionalProperties: false,
|
|
286
|
-
properties: {
|
|
287
|
-
host: {
|
|
288
|
-
type: "string",
|
|
289
|
-
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`)."
|
|
290
191
|
},
|
|
291
|
-
|
|
192
|
+
fallback: {
|
|
292
193
|
type: "string",
|
|
293
|
-
|
|
294
|
-
description: "The protocol to be used for the connection.\n- `http`: Hypertext Transfer Protocol (HTTP).\n- `https`: Secure Hypertext Transfer Protocol (HTTPS).\n\n*"
|
|
295
|
-
},
|
|
296
|
-
port: {
|
|
297
|
-
type: "number",
|
|
298
|
-
description: "The port number to be used for the connection. Common values include `80` for HTTP and `443` for HTTPS."
|
|
194
|
+
description: "Fallback for local development, could point to any environment. This is required for the default app. This value is used as the fallback for child apps as well if they do not have a fallback.\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."
|
|
299
195
|
}
|
|
300
|
-
}
|
|
196
|
+
},
|
|
197
|
+
required: ["fallback"],
|
|
198
|
+
additionalProperties: false
|
|
301
199
|
},
|
|
302
200
|
ChildApplication: {
|
|
303
201
|
type: "object",
|
|
304
202
|
properties: {
|
|
305
|
-
vercel: {
|
|
306
|
-
$ref: "#/definitions/Vercel",
|
|
307
|
-
deprecated: "This is being replaced by the `projectId` field below."
|
|
308
|
-
},
|
|
309
203
|
projectId: {
|
|
310
204
|
type: "string",
|
|
311
205
|
description: "Vercel project ID, only required if the application name / id is different to the Vercel project name.",
|
|
312
|
-
deprecated: "Instead, the application id should match the Vercel project name."
|
|
206
|
+
deprecated: "Instead, the application id should match the Vercel project name. `packageName` can optionally\nbe set to the name of the package.json (if it is different from the project name)."
|
|
313
207
|
},
|
|
314
208
|
packageName: {
|
|
315
209
|
type: "string",
|
|
316
210
|
description: "The name used to run the application, e.g. the `name` field in the `package.json`.\n\nThis is used by the local proxy to map the application config to the locally running app.\n\nThis is only necessary when the application name does not match the `name` used in `package.json`."
|
|
317
211
|
},
|
|
318
|
-
production: {
|
|
319
|
-
$ref: "#/definitions/HostConfig",
|
|
320
|
-
deprecated: "This is a duplicate of the `development.fallback` field and this will be removed soon."
|
|
321
|
-
},
|
|
322
212
|
development: {
|
|
323
|
-
$ref: "#/definitions/
|
|
213
|
+
$ref: "#/definitions/ChildDevelopment",
|
|
214
|
+
description: "Development configuration for the child application."
|
|
324
215
|
},
|
|
325
216
|
routing: {
|
|
326
217
|
$ref: "#/definitions/Routing",
|
|
@@ -330,6 +221,29 @@ var schema_default = {
|
|
|
330
221
|
required: ["routing"],
|
|
331
222
|
additionalProperties: false
|
|
332
223
|
},
|
|
224
|
+
ChildDevelopment: {
|
|
225
|
+
type: "object",
|
|
226
|
+
properties: {
|
|
227
|
+
local: {
|
|
228
|
+
type: ["number", "string"],
|
|
229
|
+
description: "A local port number or host string that this application runs on when it is running locally. If passing a string, include the protocol (optional), host (required) and port (optional). For example: `https://this.ismyhost:8080`. If omitted, the protocol defaults to HTTP. If omitted, the port defaults to a unique, but stable (based on the application name) number.\n\nExamples of valid values:\n- 8080\n- my.localhost.me\n- my.localhost.me:8080\n- https://my.localhost.me\n- https://my.localhost.me:8080"
|
|
230
|
+
},
|
|
231
|
+
localPort: {
|
|
232
|
+
type: "number",
|
|
233
|
+
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. If omitted, the port defaults to a unique, but stable (based on the application name) number.",
|
|
234
|
+
deprecated: "Please set the port with the 'local' field instead."
|
|
235
|
+
},
|
|
236
|
+
task: {
|
|
237
|
+
type: "string",
|
|
238
|
+
description: "Optional task to run when starting the development server. Should reference a script in the package.json of the application."
|
|
239
|
+
},
|
|
240
|
+
fallback: {
|
|
241
|
+
type: "string",
|
|
242
|
+
description: "Fallback for local development, could point to any environment. This is optional for child apps. If not provided, the fallback of the default app will be used.\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."
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
additionalProperties: false
|
|
246
|
+
},
|
|
333
247
|
Routing: {
|
|
334
248
|
type: "array",
|
|
335
249
|
items: {
|
|
@@ -415,7 +329,7 @@ function formatAjvErrors(errors) {
|
|
|
415
329
|
}
|
|
416
330
|
function validateSchema(configString) {
|
|
417
331
|
const parsedConfig = parse(configString);
|
|
418
|
-
const ajv = new Ajv();
|
|
332
|
+
const ajv = new Ajv({ allowUnionTypes: true });
|
|
419
333
|
const validate = ajv.compile(SCHEMA);
|
|
420
334
|
const isValid = validate(parsedConfig);
|
|
421
335
|
if (!isValid) {
|