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

Default .gitignore content generated using yarn 2+ is missing recommended lines by yarn #1152

Closed
jenkin opened this issue Jun 23, 2023 · 3 comments · Fixed by #1321
Closed
Labels
bug Something isn't working good first issue Good for newcomers help wanted Accepting PRs

Comments

@jenkin
Copy link

jenkin commented Jun 23, 2023

Do you want to request a feature or report a bug?

A bug.

What is the current behavior?

OS Version: Ubuntu 22.04.2 LTS.

Node version: v18.16.0 (npm v9.5.1, yarn v3.6.0).

Oclif version: v3.9.1.

Generate a new project using npx oclif generate <project-name> with yarn as package manager. Yarn configuration shipped with oclif doesn't support zero-installs (it uses node_modules local folder). The default .gitignore shipped with oclif doesn't follow the recommended settings by yarn (see the second code block).

.gitignore default content

**/.DS_Store
*-debug.log
*-error.log
/.idea
/.nyc_output
/dist
/lib
/package-lock.json
/tmp
node_modules
oclif.manifest.json

What is the expected behavior?

The .gitignore file generated when using yarn 2+ should contains all recommended lines from yarn.

.gitignore proposed content

**/.DS_Store
*-debug.log
*-error.log
/.idea
/.nyc_output
/dist
/lib
/package-lock.json
/tmp
node_modules
oclif.manifest.json
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
@capsulecorplab
Copy link

Any particular reason package-lock.json is in the .gitignore? My understanding was that it shouldn't be ignored as to ensure a "known-to-work" state with the exact same dependency tree https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore

@mdonnalley mdonnalley added the bug Something isn't working label Mar 1, 2024
Copy link

git2gus bot commented Mar 1, 2024

This issue has been linked to a new work item: W-15161957

@mdonnalley
Copy link
Contributor

Any particular reason package-lock.json is in the .gitignore? My understanding was that it shouldn't be ignored as to ensure a "known-to-work" state with the exact same dependency tree https://stackoverflow.com/questions/48524417/should-the-package-lock-json-file-be-added-to-gitignore

It's only added if you selected yarn as the package manager. If you select npm, it won't be added

@mdonnalley mdonnalley added help wanted Accepting PRs good first issue Good for newcomers labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Accepting PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants