syncify icon indicating copy to clipboard operation
syncify copied to clipboard

`dist/` folder causes conflicts in pull requests

Open WolfGreyDev opened this issue 9 months ago • 1 comments

The dist folder appears to contain built/compiled files that shouldn't be tracked in version control. This folder should be:

  • Added to .gitignore
  • Removed from the repository
  • Built during the deployment process instead

This change would:

  • Reduce repository size
  • Avoid conflicts in built files between different contributors

I'd be happy to create a PR to address this.

WolfGreyDev avatar Apr 16 '25 13:04 WolfGreyDev

I’ve learned that the dist folder is included in the repo because pnpm allows users to install directly from Git (pnpm add [git_repo]), and having pre-built files in dist makes the package usable immediately.

While this is convenient, it creates issues for contributors:

  • PR conflicts: Different PRs generate different dist files, leading to inconsistencies.
  • Maintenance overhead: Contributors must manually rebuild and commit dist, which is error-prone.

Proposed Solution: Compile Locally Instead

We can shift compilation to the user’s machine by:

  1. Removing dist from Git (add it to .gitignore) (see #44) .
  2. Automating builds on install via a postinstall script in package.json
  3. Now, users can install and compile in one go (at the cost of a little time):
pnpm add https://github.com/panoply/syncify
cd syncify
pnpm install  # Triggers `postinstall` -> `pnpm build`

In my opinion, the convenience of installing via pnpm add doesn't outweigh the benefits of a smoother contributor experience, though this is subjective.

WolfGreyDev avatar Apr 16 '25 18:04 WolfGreyDev