Skip to content

refactor(init)!: disable zero-installs by default #4698

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

Merged
merged 3 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .yarn/versions/98ca843d.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
releases:
"@yarnpkg/cli": major
"@yarnpkg/plugin-init": major

declined:
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-interactive-tools"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- "@yarnpkg/builder"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https:
- `yarn workspaces foreach` now automatically enables the `-v,--verbose` flag in interactive terminal environments.
- `yarn npm audit` no longer takes into account publish registries. Use [`npmAuditRegistry`](https://yarnpkg.com/configuration/yarnrc#npmAuditRegistry) instead.
- The `--assume-fresh-project` flag of `yarn init` has been removed. Should only affect people initializing Yarn 4+ projects using a Yarn 2 binary.
- `yarn init` no longer enables zero-installs by default.
- Yarn will no longer remove the old Yarn 2.x `.pnp.js` file when migrating.
- The `pnpDataPath` option has been removed to adhere to our new [PnP specification](https://yarnpkg.com/advanced/pnp-spec). For consistency, all PnP files will now be hardcoded to a single value so that third-party tools can implement the PnP specification without relying on the Yarn configuration.

Expand Down
8 changes: 5 additions & 3 deletions packages/plugin-init/sources/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,12 @@ export default class InitCommand extends BaseCommand {
`!.yarn/sdks`,
`!.yarn/versions`,
``,
`# Swap the comments on the following lines if you don't wish to use zero-installs`,
`# Swap the comments on the following lines if you wish to use zero-installs`,
`# Also don't forget to run \`yarn config set enableGlobalCache false\`!`,
`# Documentation here: https://yarnpkg.com/features/zero-installs`,
`!.yarn/cache`,
`#.pnp.*`,
``,
`#!.yarn/cache`,
`.pnp.*`,
];

const gitignoreBody = gitignoreLines.map(line => {
Expand Down