From 5b86a8d7c9bbb189f0bf5b97ff5140a83b9756ad Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Mon, 4 Mar 2024 09:51:22 -0500 Subject: [PATCH] ci: adjust whitelist of release script --- scripts/lib/getPackageDetails.ts | 15 ++------------- scripts/release.ts | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/lib/getPackageDetails.ts b/scripts/lib/getPackageDetails.ts index 5e40824eb..29c3ad723 100644 --- a/scripts/lib/getPackageDetails.ts +++ b/scripts/lib/getPackageDetails.ts @@ -10,19 +10,8 @@ export type PackageDetails = { version: string } -const whitelist3_0 = [ - 'payload', - 'translations', - 'ui', - 'next', - 'graphql', - - 'db-mongodb', - 'richtext-slate', -] - -export const getPackageDetails = async (): Promise => { - const packageDirs = fse.readdirSync(packagesDir).filter((d) => whitelist3_0.includes(d)) +export const getPackageDetails = async (packages: string[]): Promise => { + const packageDirs = fse.readdirSync(packagesDir).filter((d) => packages.includes(d)) const packageDetails = await Promise.all( packageDirs.map(async (dirName) => { diff --git a/scripts/release.ts b/scripts/release.ts index 81368323e..eaa44eee3 100755 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -13,6 +13,18 @@ import simpleGit from 'simple-git' import { getPackageDetails } from './lib/getPackageDetails' import { updateChangelog } from './utils/updateChangelog' +// Update this list with any packages to publish +const packageWhitelist = [ + 'payload', + 'translations', + 'ui', + 'next', + 'graphql', + + 'db-mongodb', + 'richtext-slate', +] + const rootPath = path.resolve(__dirname, '..') const git = simpleGit(rootPath) @@ -21,10 +33,10 @@ const execOpts: ExecSyncOptions = { stdio: 'inherit' } const args = minimist(process.argv.slice(2)) const { - bump = 'patch', - changelog = false, + bump = 'patch', // Semver release type + changelog = false, // Whether to update the changelog. WARNING: This gets throttled on too many commits 'dry-run': dryRun, - 'git-tag': gitTag = false, + 'git-tag': gitTag = false, // Whether to run git tag and commit operations tag = 'latest', } = args @@ -90,7 +102,7 @@ async function main() { return // For TS type checking } - const packageDetails = await getPackageDetails() + const packageDetails = await getPackageDetails(packageWhitelist) console.log(chalk.bold(`\n Version: ${monorepoVersion} => ${chalk.green(nextReleaseVersion)}\n`)) console.log(chalk.bold.yellow(` Bump: ${bump}`))