Skip to content
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

.gitignore shouldn't ignore composer.lock #186

Open
joachim-n opened this issue Jan 7, 2025 · 4 comments
Open

.gitignore shouldn't ignore composer.lock #186

joachim-n opened this issue Jan 7, 2025 · 4 comments

Comments

@joachim-n
Copy link

# Ignore composer.lock as this is template project
/composer.lock

The problem here is that after a developer uses this template to create a project, they can't commit the composer.lock file -- which is now part of their project -- until they change this.

@andybroomfield
Copy link
Contributor

We want to be careful though that those developing on this repo doesn't commit composer.lock.
(Or have the dependencies always updated, or locked to specific initial versions).

@joachim-n
Copy link
Author

True, but making commits to this repo is something that's going to happen much less than people starting a project with this repo as a template. Also, people making commits to this repo -- more specifically, people merging PRs to this repo -- are going to be more knowledgeable about what to do than people starting a project with it.

Composer's official documentation doesn't have much on project templates unfortunately!

@andybroomfield
Copy link
Contributor

Historical discussion is on #8

Just checking and drupal recommend project does have a composer.lock file (but not a .gitignore)

@stephen-cox
Copy link
Member

Might be overkill, but we could add a Composer script that removes those lines when composer create-project is run using the post-create-project-cmd event, which would leave it in place for those who clone the repo directly.

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

No branches or pull requests

3 participants