Skip to content

fix(build-cli): Use correct line endings #24594

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tylerbutler
Copy link
Member

Fixes the generate:packlist and check:layers --md commands to output files using LF line endings regardless of platform.

@Copilot Copilot AI review requested due to automatic review settings May 12, 2025 23:14
@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels May 12, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the CLI build commands to enforce consistent LF line endings across generated files regardless of the platform.

  • Introduces a new helper function writeFileWithLineFeeds in text.ts to normalize CRLF to LF.
  • Updates generate:packlist and check:layers --md commands to utilize writeFileWithLineFeeds.
  • Removes reliance on OS-specific EOL defaults by hardcoding LF.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
build-tools/packages/build-cli/src/library/text.ts Adds a helper to write files with LF line endings
build-tools/packages/build-cli/src/library/layerGraph.ts Replaces OS EOL with LF as the repo standard
build-tools/packages/build-cli/src/commands/generate/packlist.ts Updates packlist command to write consistent LF output
build-tools/packages/build-cli/src/commands/check/layers.ts Updates layers command to use writeFileWithLineFeeds for LF output

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@tylerbutler tylerbutler requested a review from a team May 12, 2025 23:21
@steffenloesch
Copy link
Contributor

I've tried running a build off the branch locally on my machine, and I seem to be getting even more touched files than before:

image

I did pnpm clean before running the build, and I had reverted all local changes.

@tylerbutler
Copy link
Member Author

I've tried running a build off the branch locally on my machine, and I seem to be getting even more touched files than before:
...
I did pnpm clean before running the build, and I had reverted all local changes.

When you tested, did you link the local copy of build-tools to the root workspace? See https://github.com/microsoft/FluidFramework/tree/main/build-tools#testing-build-tools-changes-in-the-client-release-group. That step is needed to test since we pin the version of build-tools used in the client release group to a specific version.

@steffenloesch
Copy link
Contributor

I've tried running a build off the branch locally on my machine, and I seem to be getting even more touched files than before:
...
I did pnpm clean before running the build, and I had reverted all local changes.

When you tested, did you link the local copy of build-tools to the root workspace? See https://github.com/microsoft/FluidFramework/tree/main/build-tools#testing-build-tools-changes-in-the-client-release-group. That step is needed to test since we pin the version of build-tools used in the client release group to a specific version.

No I did not. Will try. Thanks for the context!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants