@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.js
CHANGED
|
@@ -247,13 +247,9 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
247
247
|
}
|
|
248
248
|
for (const pathMatch of app.routing) {
|
|
249
249
|
for (const path5 of pathMatch.paths) {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
errors.push(
|
|
254
|
-
`Path ${path5} may only have a :wildcard in the last path component`
|
|
255
|
-
);
|
|
256
|
-
}
|
|
250
|
+
const maybeError = validatePathExpression(path5);
|
|
251
|
+
if (maybeError) {
|
|
252
|
+
errors.push(maybeError);
|
|
257
253
|
}
|
|
258
254
|
const existing = pathsByApplicationId.get(path5);
|
|
259
255
|
if (existing) {
|
|
@@ -303,6 +299,31 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
303
299
|
});
|
|
304
300
|
}
|
|
305
301
|
};
|
|
302
|
+
var PATH_DEFAULT_PATTERN = "[^\\/#\\?]+?";
|
|
303
|
+
function validatePathExpression(path5) {
|
|
304
|
+
const tokens = parsePathRegexp(path5);
|
|
305
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
306
|
+
const token = tokens[i];
|
|
307
|
+
if (token === void 0) {
|
|
308
|
+
return `token ${i} in ${path5} is undefined, this shouldn't happen`;
|
|
309
|
+
}
|
|
310
|
+
if (typeof token !== "string") {
|
|
311
|
+
if (token.pattern !== PATH_DEFAULT_PATTERN) {
|
|
312
|
+
return `Path ${path5} cannot use a regular expression wildcard`;
|
|
313
|
+
}
|
|
314
|
+
if (token.prefix !== "/") {
|
|
315
|
+
return `Wildcard :${token.name} must be immediately after a / in ${path5}`;
|
|
316
|
+
}
|
|
317
|
+
if (token.suffix) {
|
|
318
|
+
return `Wildcard suffix on :${token.name} is not allowed. Suffixes are not supported`;
|
|
319
|
+
}
|
|
320
|
+
if (token.modifier && i !== tokens.length - 1) {
|
|
321
|
+
return `Modifier ${token.modifier} is not allowed on wildcard :${token.name} in ${path5}. Modifiers are only allowed in the last path component`;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return void 0;
|
|
326
|
+
}
|
|
306
327
|
var validateAppPaths = (name, app) => {
|
|
307
328
|
for (const group of app.routing) {
|
|
308
329
|
for (const p of group.paths) {
|