Skip to content

Commit

Permalink
chore: rename publishList
Browse files Browse the repository at this point in the history
  • Loading branch information
denolfe committed May 9, 2024
1 parent b651580 commit 1467bc6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions scripts/lib/getPackageRegistryVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import chalk from 'chalk'
import pLimit from 'p-limit'

import { getPackageDetails } from './getPackageDetails.js'
import { packageWhitelist } from './whitelist.js'
import { packagePublishList } from './publishList.js'

const npmRequestLimit = pLimit(40)

export const getPackageRegistryVersions = async (): Promise<void> => {
const packageDetails = await getPackageDetails(packageWhitelist)
const packageDetails = await getPackageDetails(packagePublishList)

const results = await Promise.all(
packageDetails.map(async (pkg) =>
Expand Down
12 changes: 6 additions & 6 deletions scripts/lib/getWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from 'path'
import semver from 'semver'

import { getPackageDetails } from './getPackageDetails.js'
import { packageWhitelist } from './whitelist.js'
import { packagePublishList } from './publishList.js'

const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
Expand Down Expand Up @@ -69,7 +69,7 @@ export const getWorkspace = async () => {

// Publish one package at a time
const publishSync: Workspace['publishSync'] = async ({ dryRun, tag = 'canary' }) => {
const packageDetails = await getPackageDetails(packageWhitelist)
const packageDetails = await getPackageDetails(packagePublishList)
const results: PublishResult[] = []
for (const pkg of packageDetails) {
// TODO: Remove hard-coded dry-run
Expand All @@ -93,7 +93,7 @@ export const getWorkspace = async () => {
}

const publish = async () => {
const packageDetails = await getPackageDetails(packageWhitelist)
const packageDetails = await getPackageDetails(packagePublishList)
const results = await Promise.allSettled(
packageDetails.map((pkg) => publishPackageThrottled(pkg, { dryRun: true })),
)
Expand Down Expand Up @@ -122,7 +122,7 @@ export const getWorkspace = async () => {
packages: PackageDetails[]
version: string
}> => {
const packageDetails = await getPackageDetails(packageWhitelist)
const packageDetails = await getPackageDetails(packagePublishList)
const rootPackageJson = await fse.readJSON(rootPackageJsonPath)
return { packages: packageDetails, version: rootPackageJson.version }
}
Expand All @@ -139,7 +139,7 @@ export const getWorkspace = async () => {
rootPackageJson.version = version
await fse.writeJSON(rootPackageJsonPath, rootPackageJson, { spaces: 2 })

const packageJsons = await getPackageDetails(packageWhitelist)
const packageJsons = await getPackageDetails(packagePublishList)
await Promise.all(
packageJsons.map(async (pkg) => {
const packageJson = await fse.readJSON(`${pkg.packagePath}/package.json`)
Expand Down Expand Up @@ -173,7 +173,7 @@ export const getWorkspace = async () => {
const workspace: Workspace = {
version: async () => (await fse.readJSON(rootPackageJsonPath)).version,
tag: 'latest',
packages: await getPackageDetails(packageWhitelist),
packages: await getPackageDetails(packagePublishList),
showVersions,
bumpVersion,
build,
Expand Down
8 changes: 6 additions & 2 deletions scripts/lib/whitelist.ts → scripts/lib/publishList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
// Update this list with any packages to publish
export const packageWhitelist = [
/**
* Packages that should be published to NPM
*
* Note that this does not include all packages in the monorepo
*/
export const packagePublishList = [
'payload',
'translations',
'ui',
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish-canary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type { PackageDetails } from './lib/getPackageDetails.js'
import { getPackageDetails } from './lib/getPackageDetails.js'
import { getPackageRegistryVersions } from './lib/getPackageRegistryVersions.js'
import { getWorkspace } from './lib/getWorkspace.js'
import { packageWhitelist } from './lib/whitelist.js'
import { packagePublishList } from './lib/publishList.js'
import { getRecommendedBump } from './utils/getRecommendedBump.js'
import { updateChangelog } from './utils/updateChangelog.js'

Expand Down
4 changes: 2 additions & 2 deletions scripts/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { PackageDetails } from './lib/getPackageDetails.js'

import { getPackageDetails } from './lib/getPackageDetails.js'
import { getPackageRegistryVersions } from './lib/getPackageRegistryVersions.js'
import { packageWhitelist } from './lib/whitelist.js'
import { packagePublishList } from './lib/publishList.js'
import { getRecommendedBump } from './utils/getRecommendedBump.js'
import { updateChangelog } from './utils/updateChangelog.js'

Expand Down Expand Up @@ -143,7 +143,7 @@ async function main() {
console.log(chalk.gray(changelogContent) + '\n\n')
console.log(`Release URL: ${chalk.dim(releaseUrl)}`)

let packageDetails = await getPackageDetails(packageWhitelist)
let packageDetails = await getPackageDetails(packagePublishList)

console.log(chalk.bold(`\n Version: ${monorepoVersion} => ${chalk.green(nextReleaseVersion)}\n`))
console.log(chalk.bold.yellow(` Bump: ${bump}`))
Expand Down

0 comments on commit 1467bc6

Please sign in to comment.