mirror of
https://github.com/pnpm/action-setup.git
synced 2026-03-17 07:46:13 +08:00
fix: always use pnpm (not @pnpm/exe) for bootstrap and update lockfile
The bootstrap only needs regular pnpm to install the target package. @pnpm/exe requires install scripts which we skip with --ignore-scripts. Also regenerate pnpm-lock.yaml to match current package.json. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,147 +0,0 @@
|
||||
{
|
||||
"name": "bootstrap-exe",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"@pnpm/exe": "latest"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/exe": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/exe/-/exe-10.32.1.tgz",
|
||||
"integrity": "sha512-baEtwHeZwmZAdBuuDDL6tbdGg5KpxhPxr3QFfYTGXvY6ws+Z1bN0mQ7ZjcaXBSC1HuLpVXnZ6NsBiaZ2DMv4vg==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"pnpm": "pnpm"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@pnpm/linux-arm64": "10.32.1",
|
||||
"@pnpm/linux-x64": "10.32.1",
|
||||
"@pnpm/macos-arm64": "10.32.1",
|
||||
"@pnpm/macos-x64": "10.32.1",
|
||||
"@pnpm/win-arm64": "10.32.1",
|
||||
"@pnpm/win-x64": "10.32.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/linux-arm64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/linux-arm64/-/linux-arm64-10.32.1.tgz",
|
||||
"integrity": "sha512-6uB0B+XvunQwHGzIMk2JCkl4Ur6BtM4XbJSwB/mgpWmXDoX/KTJmgx2lodcTjgJSGSySCHfIVuTR9sj/F2D4EA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/linux-x64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/linux-x64/-/linux-x64-10.32.1.tgz",
|
||||
"integrity": "sha512-AM2tv23Fg7h+nV+adqA/SkZKUysSIEetHfBwYFl8ArgdgkqbGoQy0rAOdKYQBb920CqfexXfI8OA8kPCzRxYng==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/macos-arm64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/macos-arm64/-/macos-arm64-10.32.1.tgz",
|
||||
"integrity": "sha512-Zr4JkhRbtGVsYgbuGZO0dq/6FPOn072Pdo0ubmqWtc14cUATKgAJD7efG03yqr3MLgtwFHgdtUzZ1WsaYAtUTA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/macos-x64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/macos-x64/-/macos-x64-10.32.1.tgz",
|
||||
"integrity": "sha512-Yk6q3oFDu//OniXJxfTSHo+aew1LX81FcbzJAtEkcCeTQ0SLbQT6J3QiOMNikp8n8IjNhsy+bn2bdkUxaw+akA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/win-arm64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/win-arm64/-/win-arm64-10.32.1.tgz",
|
||||
"integrity": "sha512-P8rsP5IUetpYjr2iwggoswL2qUukYrJoToXWuMyo8immn58CsYxaXsHVQ1Oq1R3XMfmGGWTXLsiJuQ7H991MRg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm.exe"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
},
|
||||
"node_modules/@pnpm/win-x64": {
|
||||
"version": "10.32.1",
|
||||
"resolved": "https://registry.npmjs.org/@pnpm/win-x64/-/win-x64-10.32.1.tgz",
|
||||
"integrity": "sha512-i24GwbtBO8ojrhp8WWimX7NgZs0UKH1171oRt6qcRL+a+FxE0Eggv2y0KP7ZI7F3+LZMarwr3tnYsZryfciUOg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"bin": {
|
||||
"pnpm": "pnpm.exe"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/pnpm"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,10 +7,8 @@ import util from 'util'
|
||||
import { Inputs } from '../inputs'
|
||||
import { parse as parseYaml } from 'yaml'
|
||||
import pnpmLock from './bootstrap/pnpm-lock.json'
|
||||
import exeLock from './bootstrap/exe-lock.json'
|
||||
|
||||
const BOOTSTRAP_PNPM_PACKAGE_JSON = JSON.stringify({ private: true, dependencies: { pnpm: pnpmLock.packages['node_modules/pnpm'].version } })
|
||||
const BOOTSTRAP_EXE_PACKAGE_JSON = JSON.stringify({ private: true, dependencies: { '@pnpm/exe': exeLock.packages['node_modules/@pnpm/exe'].version } })
|
||||
const BOOTSTRAP_PACKAGE_JSON = JSON.stringify({ private: true, dependencies: { pnpm: pnpmLock.packages['node_modules/pnpm'].version } })
|
||||
|
||||
export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
const { version, dest, packageJsonFile, standalone } = inputs
|
||||
@@ -21,10 +19,8 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
await rm(bootstrapDir, { recursive: true, force: true })
|
||||
await mkdir(bootstrapDir, { recursive: true })
|
||||
|
||||
const lockfile = standalone ? exeLock : pnpmLock
|
||||
const packageJson = standalone ? BOOTSTRAP_EXE_PACKAGE_JSON : BOOTSTRAP_PNPM_PACKAGE_JSON
|
||||
await writeFile(path.join(bootstrapDir, 'package.json'), packageJson)
|
||||
await writeFile(path.join(bootstrapDir, 'package-lock.json'), JSON.stringify(lockfile))
|
||||
await writeFile(path.join(bootstrapDir, 'package.json'), BOOTSTRAP_PACKAGE_JSON)
|
||||
await writeFile(path.join(bootstrapDir, 'package-lock.json'), JSON.stringify(pnpmLock))
|
||||
|
||||
const npmExitCode = await runCommand('npm', ['ci', '--ignore-scripts'], { cwd: bootstrapDir })
|
||||
if (npmExitCode !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user