-
Notifications
You must be signed in to change notification settings - Fork 1
Rename microfrontends.json to microfrontends-custom.jsonc #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments:
examples/nextjs-app/marketing/tests/microfrontends.test.ts (line 8):
The test is trying to load ./microfrontends.jsonc, but this file was renamed to microfrontends-custom.jsonc in the changeset. The test will fail when executed because the file no longer exists.
View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
describe('microfrontends', () => {
test('routing', () => {
expect(() =>
- validateRouting('./microfrontends.jsonc', {
+ validateRouting('./microfrontends-custom.jsonc', {
'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
'nextjs-app-docs': [
'/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
describe('middleware', () => {
test('matches microfrontends paths', () => {
expect(() =>
- validateMiddlewareConfig(config, './microfrontends.jsonc'),
+ validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
).not.toThrow();
});
test('rewrites for flagged paths', async () => {
await expect(
- validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+ validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
).resolves.not.toThrow();
});
});
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
const mfeConfig = loadMicrofrontendConfigForEdge(
- './microfrontends.jsonc',
+ './microfrontends-custom.jsonc',
);
const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
const errors = [];
Analysis
Test references non-existent microfrontends config file
What fails: Tests in examples/nextjs-app/marketing/tests/ reference ./microfrontends.jsonc which no longer exists, causing file not found errors during test execution.
How to reproduce:
cd examples/nextjs-app/marketing
VC_MICROFRONTENDS_CONFIG_FILE_NAME=microfrontends-custom.jsonc pnpm exec jest tests/microfrontends.test.tsResult before fix:
Error: "ENOENT: no such file or directory, open './microfrontends.jsonc'"
at loadMicrofrontendConfigForEdge (packages/microfrontends/dist/next/testing.cjs:883:87)
at validateRouting (packages/microfrontends/dist/next/testing.cjs:1033:79)
at tests/microfrontends.test.ts:8:49
Expected behavior: The file reference should match the actual filename after the renaming. The file examples/nextjs-app/marketing/microfrontends.jsonc was renamed to examples/nextjs-app/marketing/microfrontends-custom.jsonc in a prior changeset, but test file references were not updated. Updated test files to use the correct filename ./microfrontends-custom.jsonc.
Files modified:
examples/nextjs-app/marketing/tests/microfrontends.test.tsexamples/nextjs-app/marketing/tests/middleware.test.tsexamples/nextjs-app/marketing/tests/next-config.test.ts
All tests now pass successfully.
examples/nextjs-app/marketing/tests/middleware.test.ts (line 16):
The test is trying to load ./microfrontends.jsonc in two places, but this file was renamed to microfrontends-custom.jsonc. The tests will fail when executed because the file no longer exists.
View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
describe('microfrontends', () => {
test('routing', () => {
expect(() =>
- validateRouting('./microfrontends.jsonc', {
+ validateRouting('./microfrontends-custom.jsonc', {
'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
'nextjs-app-docs': [
'/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
describe('middleware', () => {
test('matches microfrontends paths', () => {
expect(() =>
- validateMiddlewareConfig(config, './microfrontends.jsonc'),
+ validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
).not.toThrow();
});
test('rewrites for flagged paths', async () => {
await expect(
- validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+ validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
).resolves.not.toThrow();
});
});
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
const mfeConfig = loadMicrofrontendConfigForEdge(
- './microfrontends.jsonc',
+ './microfrontends-custom.jsonc',
);
const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
const errors = [];
Analysis
Test files reference non-existent microfrontends.jsonc file
What fails: Three test files reference ./microfrontends.jsonc which no longer exists. The functions validateMiddlewareConfig(), validateMiddlewareOnFlaggedPaths(), validateRouting(), and loadMicrofrontendConfigForEdge() attempt to read the file directly using readFileSync() with no environment variable substitution.
How to reproduce:
cd examples/nextjs-app/marketing
npm testResult: Tests fail with ENOENT: no such file or directory, open './microfrontends.jsonc' because the file was renamed to microfrontends-custom.jsonc
Expected: Tests should pass by reading the correct file ./microfrontends-custom.jsonc that exists in the directory.
Files affected:
examples/nextjs-app/marketing/tests/middleware.test.ts(lines 16, 22)examples/nextjs-app/marketing/tests/microfrontends.test.ts(line 7)examples/nextjs-app/marketing/tests/next-config.test.ts(line 37)
All references updated to use ./microfrontends-custom.jsonc.
examples/nextjs-app/marketing/tests/next-config.test.ts (line 37):
The test is trying to load ./microfrontends.jsonc, but this file was renamed to microfrontends-custom.jsonc. The test will fail when executed because the file no longer exists.
View Details
📝 Patch Details
diff --git a/examples/nextjs-app/marketing/tests/microfrontends.test.ts b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
index e18a3a2..fa47352 100644
--- a/examples/nextjs-app/marketing/tests/microfrontends.test.ts
+++ b/examples/nextjs-app/marketing/tests/microfrontends.test.ts
@@ -5,7 +5,7 @@ import { validateRouting } from '@vercel/microfrontends/next/testing';
describe('microfrontends', () => {
test('routing', () => {
expect(() =>
- validateRouting('./microfrontends.jsonc', {
+ validateRouting('./microfrontends-custom.jsonc', {
'nextjs-app-marketing': ['/', '/city/amsterdam', '/flagged/docs'],
'nextjs-app-docs': [
'/docs',
diff --git a/examples/nextjs-app/marketing/tests/middleware.test.ts b/examples/nextjs-app/marketing/tests/middleware.test.ts
index bf989cb..3ccf1eb 100644
--- a/examples/nextjs-app/marketing/tests/middleware.test.ts
+++ b/examples/nextjs-app/marketing/tests/middleware.test.ts
@@ -13,13 +13,13 @@ jest.mock('flags/next', () => ({
describe('middleware', () => {
test('matches microfrontends paths', () => {
expect(() =>
- validateMiddlewareConfig(config, './microfrontends.jsonc'),
+ validateMiddlewareConfig(config, './microfrontends-custom.jsonc'),
).not.toThrow();
});
test('rewrites for flagged paths', async () => {
await expect(
- validateMiddlewareOnFlaggedPaths('./microfrontends.jsonc', middleware),
+ validateMiddlewareOnFlaggedPaths('./microfrontends-custom.jsonc', middleware),
).resolves.not.toThrow();
});
});
diff --git a/examples/nextjs-app/marketing/tests/next-config.test.ts b/examples/nextjs-app/marketing/tests/next-config.test.ts
index 3799ac9..e479186 100644
--- a/examples/nextjs-app/marketing/tests/next-config.test.ts
+++ b/examples/nextjs-app/marketing/tests/next-config.test.ts
@@ -34,7 +34,7 @@ describe('next.config.ts', () => {
it('next.config.js redirects and rewrites should not match any microfrontend path', async () => {
const mfeConfig = loadMicrofrontendConfigForEdge(
- './microfrontends.jsonc',
+ './microfrontends-custom.jsonc',
);
const allPaths = [...getAllMicrofrontendPaths(mfeConfig)];
const errors = [];
Analysis
Test files reference non-existent microfrontends.jsonc file
What fails: Three test files in examples/nextjs-app/marketing/tests/ call loadMicrofrontendConfigForEdge() and validateRouting()/validateMiddlewareConfig() with hardcoded path './microfrontends.jsonc', but this file does not exist.
How to reproduce:
cd examples/nextjs-app/marketing
node -e "
const { loadMicrofrontendConfigForEdge } = require('@vercel/microfrontends/next/testing');
loadMicrofrontendConfigForEdge('./microfrontends.jsonc');
"Result: Throws Error: ENOENT: no such file or directory, open './microfrontends.jsonc'
Expected: All test files should reference the actual configuration file './microfrontends-custom.jsonc' which exists in the directory. The configuration file was renamed from microfrontends.jsonc to microfrontends-custom.jsonc, but the test calls were not updated.
Affected files:
examples/nextjs-app/marketing/tests/next-config.test.ts(line 37)examples/nextjs-app/marketing/tests/microfrontends.test.ts(line 8)examples/nextjs-app/marketing/tests/middleware.test.ts(lines 16, 22)
Note: The VC_MICROFRONTENDS_CONFIG_FILE_NAME environment variable set in package.json is used for server-side config loading via next.config.ts, not for these test utility functions which directly read the file path provided as an argument.
|
Tests are failing as the change is not yet supported by turborepo |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Follow up to
microfrontends.jsonfile names #1Now the vercel build container supports custom microfrontends.json