mirror of
https://github.com/pnpm/action-setup.git
synced 2026-09-10 03:03:23 +08:00
refactor: use pnpm 12 native bootstrap
Install the plain pnpm v12 package as the single native bootstrap, remove the legacy @pnpm/exe lockfile and runtime path, and retain the standalone input as a no-op for workflow compatibility.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Usage: node scripts/update-bootstrap.mjs [version]
|
||||
// If version is omitted, fetches the latest next-11 tag from npm.
|
||||
// If version is omitted, fetches the latest pnpm 12 tag from npm.
|
||||
// Regenerates the bootstrap lockfiles used by action-setup to install pnpm via npm.
|
||||
|
||||
import { execSync } from 'child_process'
|
||||
@@ -16,14 +16,13 @@ const version = process.argv[2] || resolveLatestVersion()
|
||||
console.log(`Updating bootstrap lockfiles to pnpm@${version} ...`)
|
||||
|
||||
generateLock('pnpm-lock.json', { pnpm: version }, 'bootstrap-pnpm')
|
||||
generateLock('exe-lock.json', { '@pnpm/exe': version }, 'bootstrap-exe')
|
||||
|
||||
console.log('Done!')
|
||||
|
||||
function resolveLatestVersion() {
|
||||
const json = execSync('npm view @pnpm/exe dist-tags --json', { encoding: 'utf8' })
|
||||
const json = execSync('npm view pnpm dist-tags --json', { encoding: 'utf8' })
|
||||
const tags = JSON.parse(json)
|
||||
const version = tags['next-11'] || tags['latest']
|
||||
const version = tags['next-12'] || tags['latest-12'] || tags['latest']
|
||||
if (!version) {
|
||||
console.error('Could not determine latest pnpm version from npm dist-tags')
|
||||
process.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user