syncify
syncify copied to clipboard
`dist/` folder causes conflicts in pull requests
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.
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:
- Removing dist from Git (add it to .gitignore) (see #44) .
- Automating builds on install via a
postinstallscript inpackage.json - 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.