chore: add logging templates script and fix engines for pnpm v10 (#12021)
- Fixes issues with using pnpm v10 in some templates by allowing `^10` in engines as well - Added logging to the template generation script so we can debug the latest version being pulled by CI
This commit is contained in:
@@ -39,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.20.2 || >=20.9.0",
|
"node": "^18.20.2 || >=20.9.0",
|
||||||
"pnpm": "^9"
|
"pnpm": "^9 || ^10"
|
||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"onlyBuiltDependencies": [
|
"onlyBuiltDependencies": [
|
||||||
|
|||||||
@@ -435,9 +435,10 @@ function header(message: string) {
|
|||||||
function log(message: string) {
|
function log(message: string) {
|
||||||
console.log(chalk.dim(message))
|
console.log(chalk.dim(message))
|
||||||
}
|
}
|
||||||
|
|
||||||
function execSyncSafe(command: string, options?: Parameters<typeof execSync>[1]) {
|
function execSyncSafe(command: string, options?: Parameters<typeof execSync>[1]) {
|
||||||
try {
|
try {
|
||||||
console.log(`Executing: ${command}`)
|
log(`Executing: ${command}`)
|
||||||
execSync(command, { stdio: 'inherit', ...options })
|
execSync(command, { stdio: 'inherit', ...options })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof Error) {
|
if (error instanceof Error) {
|
||||||
@@ -492,6 +493,11 @@ async function bumpPackageJson({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches the latest version of a package from the NPM registry.
|
||||||
|
*
|
||||||
|
* Used in determining the latest version of Payload to use in the generated templates.
|
||||||
|
*/
|
||||||
async function getLatestPackageVersion({
|
async function getLatestPackageVersion({
|
||||||
packageName = 'payload',
|
packageName = 'payload',
|
||||||
}: {
|
}: {
|
||||||
@@ -509,6 +515,8 @@ async function getLatestPackageVersion({
|
|||||||
const data = await response.json()
|
const data = await response.json()
|
||||||
const latestVersion = data['dist-tags'].latest
|
const latestVersion = data['dist-tags'].latest
|
||||||
|
|
||||||
|
log(`Found latest version of ${packageName}: ${latestVersion}`)
|
||||||
|
|
||||||
return latestVersion
|
return latestVersion
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching Payload version:', error)
|
console.error('Error fetching Payload version:', error)
|
||||||
|
|||||||
Reference in New Issue
Block a user