@vercel/microfrontends 0.15.0 → 0.17.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 +36 -10
- package/dist/config.cjs +28 -7
- package/dist/config.cjs.map +1 -1
- package/dist/config.js +28 -7
- package/dist/config.js.map +1 -1
- package/dist/microfrontends/server.cjs +28 -7
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.js +28 -7
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/microfrontends/utils.cjs +61 -0
- package/dist/microfrontends/utils.cjs.map +1 -0
- package/dist/microfrontends/utils.d.ts +5 -0
- package/dist/microfrontends/utils.js +24 -0
- package/dist/microfrontends/utils.js.map +1 -0
- package/dist/microfrontends.cjs +28 -7
- package/dist/microfrontends.cjs.map +1 -1
- package/dist/microfrontends.js +28 -7
- package/dist/microfrontends.js.map +1 -1
- package/dist/next/config.cjs +28 -7
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +28 -7
- package/dist/next/config.js.map +1 -1
- package/dist/next/middleware.cjs +28 -7
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.js +28 -7
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/testing.cjs +28 -7
- package/dist/next/testing.cjs.map +1 -1
- package/dist/next/testing.js +28 -7
- package/dist/next/testing.js.map +1 -1
- package/dist/utils/mfe-port.cjs +28 -7
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +28 -7
- package/dist/utils/mfe-port.js.map +1 -1
- package/package.json +10 -3
package/dist/next/config.cjs
CHANGED
|
@@ -281,13 +281,9 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
281
281
|
}
|
|
282
282
|
for (const pathMatch of app.routing) {
|
|
283
283
|
for (const path5 of pathMatch.paths) {
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
errors.push(
|
|
288
|
-
`Path ${path5} may only have a :wildcard in the last path component`
|
|
289
|
-
);
|
|
290
|
-
}
|
|
284
|
+
const maybeError = validatePathExpression(path5);
|
|
285
|
+
if (maybeError) {
|
|
286
|
+
errors.push(maybeError);
|
|
291
287
|
}
|
|
292
288
|
const existing = pathsByApplicationId.get(path5);
|
|
293
289
|
if (existing) {
|
|
@@ -337,6 +333,31 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
337
333
|
});
|
|
338
334
|
}
|
|
339
335
|
};
|
|
336
|
+
var PATH_DEFAULT_PATTERN = "[^\\/#\\?]+?";
|
|
337
|
+
function validatePathExpression(path5) {
|
|
338
|
+
const tokens = (0, import_path_to_regexp2.parse)(path5);
|
|
339
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
340
|
+
const token = tokens[i];
|
|
341
|
+
if (token === void 0) {
|
|
342
|
+
return `token ${i} in ${path5} is undefined, this shouldn't happen`;
|
|
343
|
+
}
|
|
344
|
+
if (typeof token !== "string") {
|
|
345
|
+
if (token.pattern !== PATH_DEFAULT_PATTERN) {
|
|
346
|
+
return `Path ${path5} cannot use a regular expression wildcard`;
|
|
347
|
+
}
|
|
348
|
+
if (token.prefix !== "/") {
|
|
349
|
+
return `Wildcard :${token.name} must be immediately after a / in ${path5}`;
|
|
350
|
+
}
|
|
351
|
+
if (token.suffix) {
|
|
352
|
+
return `Wildcard suffix on :${token.name} is not allowed. Suffixes are not supported`;
|
|
353
|
+
}
|
|
354
|
+
if (token.modifier && i !== tokens.length - 1) {
|
|
355
|
+
return `Modifier ${token.modifier} is not allowed on wildcard :${token.name} in ${path5}. Modifiers are only allowed in the last path component`;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return void 0;
|
|
360
|
+
}
|
|
340
361
|
var validateAppPaths = (name, app) => {
|
|
341
362
|
for (const group of app.routing) {
|
|
342
363
|
for (const p of group.paths) {
|