| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
appendFile concatenated content without checking for a trailing newline, causing malformed output when multiple add-ons append to the same file (e.g. .env.local with sentry + posthog). Add newline guard in both fs and memfs appendFile implementations. Fix 4 .append files missing trailing newlines (sentry, strapi, mcp).
There was a problem hiding this comment.
This PR fixes a content concatenation issue where multiple add-ons appending to the same file (e.g., .env.local) would have their content directly concatenated without proper separation. The fix ensures proper formatting by automatically inserting blank line separators between appended sections.
Changes:
Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.
Show a summary per file| File | Description |
|---|---|
| packages/create/src/environment.ts | Added logic to automatically insert blank line separators (1 or 2 newlines depending on existing content) when appending to files in both real fs and memfs implementations |
| packages/create/src/frameworks/react/add-ons/sentry/assets/_dot_env.local.append | Added missing trailing newline to Sentry environment config |
| packages/create/src/frameworks/react/add-ons/strapi/assets/_dot_env.local.append | Added missing trailing newline to Strapi environment config for React |
| packages/create/src/frameworks/solid/add-ons/strapi/assets/_dot_env.local.append | Added missing trailing newline to Strapi environment config for Solid |
| packages/create/src/frameworks/react/add-ons/mcp/assets/_dot_gitignore.append | Added missing trailing newline to MCP gitignore |
| packages/create/tests/template-file.test.ts | Updated test assertion to expect blank line separator between appended content |
| packages/create/tests/filename-processing.test.ts | Updated test assertion to account for the blank line separator behavior |
| packages/create/tests/environment.test.ts | Updated test assertion to verify blank line separator in appendFile operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
|
Heads up: #501 removes memfs from the published runtime and routes the Node memory environment through edge-environment.ts. If #501 lands first, the append separator change here should move to packages/create/src/edge-environment.ts; environment.ts will only adapt Node path resolution. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
the second add-on gets concatenated directly onto the last line of the first add-on's
content if it doesn't end with a newline. For example, selecting both Sentry and PostHog
produces SENTRY_AUTH_TOKEN=# PostHog configuration... instead of two separate lines.
ensures a blank line between appended sections for readability.
and MCP gitignore (react).
Test plan
add-on's variables separated by a blank line