chore(config): allow a system's package manager to override pnpm's default settings (#3896)

https://github.com/Homebrew/homebrew-core/pull/85890
This commit is contained in:
Kaito Udagawa
2021-10-21 00:43:54 +09:00
committed by GitHub
parent aa69c9bd25
commit b6d74c5458
12 changed files with 58 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
---
"@pnpm-private/updater": minor
"@pnpm/config": minor
"@pnpm/exe": minor
"pnpm": minor
---
Allow a system's package manager to override pnpm's default settings

View File

@@ -172,7 +172,8 @@ async function updateManifest (workspaceDir: string, manifest: ProjectManifest,
scripts.compile += ' && rimraf dist bin/nodes && pnpm run bundle \
&& shx cp -r node-gyp-bin dist/node-gyp-bin \
&& shx cp -r node_modules/@pnpm/tabtab/lib/scripts dist/scripts \
&& shx cp -r node_modules/ps-list/vendor dist/vendor'
&& shx cp -r node_modules/ps-list/vendor dist/vendor \
&& shx cp pnpmrc dist/pnpmrc'
} else {
scripts.prepublishOnly = 'pnpm run compile'
homepage = `https://github.com/pnpm/pnpm/blob/master/${relative}#readme`

View File

@@ -214,6 +214,8 @@ export default async (
'workspace-prefix': opts.workspaceDir,
})
npmConfig.addFile(path.resolve(path.join(__dirname, 'pnpmrc')), 'pnpm-builtin')
delete cliOptions.prefix
process.execPath = originalExecPath

View File

@@ -2,7 +2,7 @@ import * as execa from 'execa'
import path from 'path'
function build (target: string) {
execa.sync('pkg', ['../pnpm/dist/pnpm.cjs', `--out-path=../artifacts/${target}`, `--targets=node14-${target}`], {
execa.sync('pkg', ['../pnpm/dist/pnpm.cjs', `--config=../pnpm/package-${target}.json`], {
cwd: path.join(__dirname, '..'),
stdio: 'inherit',
})

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-macos-arm64"],
"outputPath": "../artifacts/macos-x64"
}
}

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-linux-x64"],
"outputPath": "../artifacts/linux-x64"
}
}

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-linuxstatic-x64"],
"outputPath": "../artifacts/linuxstatic-x64"
}
}

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-macos-arm64"],
"outputPath": "../artifacts/macos-x64"
}
}

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-macos-x64"],
"outputPath": "../artifacts/macos-x64"
}
}

View File

@@ -0,0 +1,7 @@
{
"pkg": {
"assets": "dist/pnpmrc",
"targets": ["node14-win-x64"],
"outputPath": "../artifacts/win-x64"
}
}

View File

@@ -161,7 +161,7 @@
"test": "pnpm run compile && pnpm run _test",
"prepublishOnly": "pnpm compile && npm cache clear --force && publish-packed --prune --npm-client yarn --dest dist",
"postpublish": "publish-packed",
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix && rimraf dist bin/nodes && pnpm run bundle && shx cp -r node-gyp-bin dist/node-gyp-bin && shx cp -r node_modules/@pnpm/tabtab/lib/scripts dist/scripts && shx cp -r node_modules/ps-list/vendor dist/vendor"
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix && rimraf dist bin/nodes && pnpm run bundle && shx cp -r node-gyp-bin dist/node-gyp-bin && shx cp -r node_modules/@pnpm/tabtab/lib/scripts dist/scripts && shx cp -r node_modules/ps-list/vendor dist/vendor && shx cp pnpmrc dist/pnpmrc"
},
"publishConfig": {
"tag": "next",

2
packages/pnpm/pnpmrc Normal file
View File

@@ -0,0 +1,2 @@
# DO NOT MODIFY THIS FILE UNLESS YOU KNOW WHAT WILL HAPPEN
# This file is intended for changing pnpm's default settings by the package manager that install pnpm