@vercel/microfrontends 2.0.0-canary.2 → 2.0.1

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.
Files changed (40) hide show
  1. package/CHANGELOG.md +16 -11
  2. package/dist/bin/cli.cjs +180 -63
  3. package/dist/config.cjs +5 -4
  4. package/dist/config.cjs.map +1 -1
  5. package/dist/config.js +5 -4
  6. package/dist/config.js.map +1 -1
  7. package/dist/experimental/sveltekit.cjs +5 -4
  8. package/dist/experimental/sveltekit.cjs.map +1 -1
  9. package/dist/experimental/sveltekit.js +5 -4
  10. package/dist/experimental/sveltekit.js.map +1 -1
  11. package/dist/experimental/vite.cjs +5 -4
  12. package/dist/experimental/vite.cjs.map +1 -1
  13. package/dist/experimental/vite.js +5 -4
  14. package/dist/experimental/vite.js.map +1 -1
  15. package/dist/microfrontends/server.cjs +5 -4
  16. package/dist/microfrontends/server.cjs.map +1 -1
  17. package/dist/microfrontends/server.js +5 -4
  18. package/dist/microfrontends/server.js.map +1 -1
  19. package/dist/next/client.cjs +1 -1
  20. package/dist/next/client.cjs.map +1 -1
  21. package/dist/next/client.d.ts +15 -1
  22. package/dist/next/client.js +1 -1
  23. package/dist/next/client.js.map +1 -1
  24. package/dist/next/config.cjs +5 -4
  25. package/dist/next/config.cjs.map +1 -1
  26. package/dist/next/config.js +5 -4
  27. package/dist/next/config.js.map +1 -1
  28. package/dist/next/middleware.cjs +5 -4
  29. package/dist/next/middleware.cjs.map +1 -1
  30. package/dist/next/middleware.js +5 -4
  31. package/dist/next/middleware.js.map +1 -1
  32. package/dist/next/testing.cjs +5 -4
  33. package/dist/next/testing.cjs.map +1 -1
  34. package/dist/next/testing.js +5 -4
  35. package/dist/next/testing.js.map +1 -1
  36. package/dist/utils/mfe-port.cjs +20 -24
  37. package/dist/utils/mfe-port.cjs.map +1 -1
  38. package/dist/utils/mfe-port.js +20 -24
  39. package/dist/utils/mfe-port.js.map +1 -1
  40. package/package.json +4 -4
@@ -423,7 +423,7 @@ var MicrofrontendConfigClient = class {
423
423
  static fromEnv(config) {
424
424
  if (!config) {
425
425
  throw new Error(
426
- "Could not construct MicrofrontendConfigClient: configuration is empty or undefined. Did you set up your application with `withMicrofrontends`?"
426
+ "Could not construct MicrofrontendConfigClient: configuration is empty or undefined. Did you set up your application with `withMicrofrontends`? Is the local proxy running and this application is being accessed via the proxy port? See https://vercel.com/docs/microfrontends/local-development#setting-up-microfrontends-proxy"
427
427
  );
428
428
  }
429
429
  return new MicrofrontendConfigClient(JSON.parse(config));
@@ -563,10 +563,11 @@ function validatePathExpression(path6) {
563
563
  }
564
564
  if (token.pattern !== PATH_DEFAULT_PATTERN && // Allows (a|b|c) and ((?!a|b|c).*) regex
565
565
  // Only limited regex is supported for now, due to performance considerations
566
- !/^(?<allowed>[\w]+(?:\|[^:|()]+)+)$|^\(\?!(?<disallowed>[\w]+(?:\|[^:|()]+)*)\)\.\*$/.test(
567
- token.pattern
566
+ // Allows all letters, numbers, and hyphens. Other characters must be escaped.
567
+ !/^(?<allowed>[\w-~]+(?:\|[^:|()]+)+)$|^\(\?!(?<disallowed>[\w-~]+(?:\|[^:|()]+)*)\)\.\*$/.test(
568
+ token.pattern.replace(/\\./g, "")
568
569
  )) {
569
- return `Path ${path6} cannot use unsupported regular expression wildcard`;
570
+ return `Path ${path6} cannot use unsupported regular expression wildcard. If the path includes special characters, they must be escaped with backslash (e.g. '\\(')`;
570
571
  }
571
572
  if (token.modifier && i !== tokens.length - 1) {
572
573
  return `Modifier ${token.modifier} is not allowed on wildcard :${token.name} in ${path6}. Modifiers are only allowed in the last path component`;