8000 fix: add pnpm v4 support by B4rtware · Pull Request #4677 · vuejs/vue-cli · GitHub
[go: up one dir, main page]

Skip to content

fix: add pnpm v4 support #4677

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 16 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: export hasPnpmVersionOrLater and use this in favor of hasPn…
…pm4OrLater
  • Loading branch information
B4rtware committed Oct 14, 2019
commit bde6d3ba4fab272e2a85d59331406d92448f7b7b
8 changes: 2 additions & 6 deletions packages/@vue/cli-shared-utils/lib/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function getPnpmVersion () {
return _pnpmVersion || '0.0.0'
}

function hasPnpmVersionOrLater (version) {
exports.hasPnpmVersionOrLater = (version) => {
if (process.env.VUE_CLI_TEST) {
return true
}
Expand All @@ -109,11 +109,7 @@ function hasPnpmVersionOrLater (version) {
}

exports.hasPnpm3OrLater = () => {
return hasPnpmVersionOrLater('3.0.0')
}

exports.hasPnpm4OrLater = () => {
return hasPnpmVersionOrLater('4.0.0')
return this.hasPnpmVersionOrLater('3.0.0')
}

exports.hasProjectPnpm = (cwd) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/@vue/cli/lib/util/ProjectPackageManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
hasYarn,
hasProjectYarn,
hasPnpm3OrLater,
hasPnpm4OrLater,
hasPnpmVersionOrLater,
hasProjectPnpm
} = require('@vue/cli-shared-utils/lib/env')
const { isOfficialPlugin, resolvePluginId } = require('@vue/cli-shared-utils/lib/pluginResolution')
Expand Down Expand Up @@ -52,7 +52,7 @@ const PACKAGE_MANAGER_CONFIG = {
upgrade: ['update', '--loglevel', 'error'],
remove: ['uninstall', '--loglevel', 'error']
},
pnpm: hasPnpm4OrLater() ? PACKAGE_MANAGER_PNPM4_CONFIG : PACKAGE_MANAGER_PNPM3_CONFIG,
pnpm: hasPnpmVersionOrLater('4.0.0') ? PACKAGE_MANAGER_PNPM4_CONFIG : PACKAGE_MANAGER_PNPM3_CONFIG,
yarn: {
install: [],
add: ['add'],
Expand Down
0