Skip to content

fix(plugin-bff): preserve package manifest trailing newline#8671

Open
omarshibli wants to merge 1 commit into
web-infra-dev:mainfrom
omarshibli:fix/bff-package-json-newline
Open

fix(plugin-bff): preserve package manifest trailing newline#8671
omarshibli wants to merge 1 commit into
web-infra-dev:mainfrom
omarshibli:fix/bff-package-json-newline

Conversation

@omarshibli

Copy link
Copy Markdown

Summary

Preserve a trailing newline when the BFF client generator rewrites package.json.

Also await the package manifest update so callers do not race the generated manifest write.

Problem

plugin-bff rewrites package.json with JSON.stringify(packageJson, null, 2) and no trailing newline. In repositories that normalize manifests during dependency install, this makes framework generation and package manager normalization fight each other.

Changes

  • Append \n when writing the generated package manifest.
  • Await setPackage from clientGenerator.
  • Add regression coverage for generated package manifests.

Validation

  • pnpm --filter @modern-js/plugin-bff test
  • pnpm exec biome check packages/cli/plugin-bff/src/utils/clientGenerator.ts packages/cli/plugin-bff/tests/clientGenerator.test.ts

@netlify

netlify Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploy Preview for modernjs-byted ready!

Name Link
🔨 Latest commit a643d30
🔍 Latest deploy log https://app.netlify.com/projects/modernjs-byted/deploys/6a3131e2d1a80c0008fe8e03
😎 Deploy Preview https://deploy-preview-8671--modernjs-byted.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a643d30

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@omarshibli omarshibli marked this pull request as ready for review June 8, 2026 09:01
@omarshibli omarshibli force-pushed the fix/bff-package-json-newline branch from 09ed1bd to a643d30 Compare June 16, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant