@vercel/microfrontends 1.0.1-canary.1 → 1.0.1-canary.2
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 +41 -27
- package/dist/config.cjs +39 -26
- package/dist/config.cjs.map +1 -1
- package/dist/config.js +39 -26
- package/dist/config.js.map +1 -1
- package/dist/experimental/sveltekit.cjs +39 -26
- package/dist/experimental/sveltekit.cjs.map +1 -1
- package/dist/experimental/sveltekit.js +39 -26
- package/dist/experimental/sveltekit.js.map +1 -1
- package/dist/experimental/vite.cjs +39 -26
- package/dist/experimental/vite.cjs.map +1 -1
- package/dist/experimental/vite.js +39 -26
- package/dist/experimental/vite.js.map +1 -1
- package/dist/microfrontends/server.cjs +39 -26
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.js +39 -26
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/microfrontends.cjs +39 -26
- package/dist/microfrontends.cjs.map +1 -1
- package/dist/microfrontends.js +39 -26
- package/dist/microfrontends.js.map +1 -1
- package/dist/next/config.cjs +203 -125
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.d.ts +7 -1
- package/dist/next/config.js +203 -125
- package/dist/next/config.js.map +1 -1
- package/dist/next/middleware.cjs +39 -26
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.js +39 -26
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/testing.cjs +39 -26
- package/dist/next/testing.cjs.map +1 -1
- package/dist/next/testing.d.ts +1 -1
- package/dist/next/testing.js +40 -27
- package/dist/next/testing.js.map +1 -1
- package/dist/utils/mfe-port.cjs +39 -26
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +39 -26
- package/dist/utils/mfe-port.js.map +1 -1
- package/package.json +2 -1
|
@@ -275,16 +275,17 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
275
275
|
const maybeError = validatePathExpression(path5);
|
|
276
276
|
if (maybeError) {
|
|
277
277
|
errors.push(maybeError);
|
|
278
|
-
}
|
|
279
|
-
const existing = pathsByApplicationId.get(path5);
|
|
280
|
-
if (existing) {
|
|
281
|
-
existing.applications.push(id);
|
|
282
278
|
} else {
|
|
283
|
-
pathsByApplicationId.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
279
|
+
const existing = pathsByApplicationId.get(path5);
|
|
280
|
+
if (existing) {
|
|
281
|
+
existing.applications.push(id);
|
|
282
|
+
} else {
|
|
283
|
+
pathsByApplicationId.set(path5, {
|
|
284
|
+
applications: [id],
|
|
285
|
+
matcher: (0, import_path_to_regexp2.pathToRegexp)(path5),
|
|
286
|
+
applicationId: id
|
|
287
|
+
});
|
|
288
|
+
}
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
}
|
|
@@ -324,26 +325,38 @@ var validateConfigPaths = (applicationConfigsById) => {
|
|
|
324
325
|
};
|
|
325
326
|
var PATH_DEFAULT_PATTERN = "[^\\/#\\?]+?";
|
|
326
327
|
function validatePathExpression(path5) {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
if (token
|
|
341
|
-
return `
|
|
328
|
+
try {
|
|
329
|
+
const tokens = (0, import_path_to_regexp2.parse)(path5);
|
|
330
|
+
if (/(?<!\\)\{/.test(path5)) {
|
|
331
|
+
return `Optional paths are not supported: ${path5}`;
|
|
332
|
+
}
|
|
333
|
+
if (/(?<!\\|\()\?/.test(path5)) {
|
|
334
|
+
return `Optional paths are not supported: ${path5}`;
|
|
335
|
+
}
|
|
336
|
+
if (/\/[^/]*(?<!\\):[^/]*(?<!\\):[^/]*/.test(path5)) {
|
|
337
|
+
return `Only one wildcard is allowed per path segment: ${path5}`;
|
|
338
|
+
}
|
|
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`;
|
|
342
343
|
}
|
|
343
|
-
if (token
|
|
344
|
-
|
|
344
|
+
if (typeof token !== "string") {
|
|
345
|
+
if (token.pattern !== PATH_DEFAULT_PATTERN && // Allows (a|b|c) and ((?!a|b|c).*) regex
|
|
346
|
+
// Only limited regex is supported for now, due to performance considerations
|
|
347
|
+
!/^(?<allowed>[\w]+(?:\|[^|()]+)+)$|^\(\?!(?<disallowed>[\w]+(?:\|[^|()]+)+)\)\.\*$/.test(
|
|
348
|
+
token.pattern
|
|
349
|
+
)) {
|
|
350
|
+
return `Path ${path5} cannot use unsupported regular expression wildcard`;
|
|
351
|
+
}
|
|
352
|
+
if (token.modifier && i !== tokens.length - 1) {
|
|
353
|
+
return `Modifier ${token.modifier} is not allowed on wildcard :${token.name} in ${path5}. Modifiers are only allowed in the last path component`;
|
|
354
|
+
}
|
|
345
355
|
}
|
|
346
356
|
}
|
|
357
|
+
} catch (e) {
|
|
358
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
359
|
+
return `Path ${path5} could not be parsed into regexp: ${message}`;
|
|
347
360
|
}
|
|
348
361
|
return void 0;
|
|
349
362
|
}
|