Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(publish): add option to skip publish of a package #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions src/publish/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,17 @@ export const publish = async (options) => {
console.info(`Publishing all packages to npm with tag "${npmTag}"`)

// Publish each package
changedPackages.forEach((pkg) => {
const packageDir = path.join(rootDir, pkg.packageDir)

const cmd = `cd ${packageDir} && pnpm publish --tag ${npmTag} --access=public --no-git-checks`
console.info(` Publishing ${pkg.name}@${version} to npm...`)
execSync(cmd, {
stdio: [process.stdin, process.stdout, process.stderr],
changedPackages
.filter((pkg) => pkg.skipPublish !== true)
.forEach((pkg) => {
const packageDir = path.join(rootDir, pkg.packageDir)

const cmd = `cd ${packageDir} && pnpm publish --tag ${npmTag} --access=public --no-git-checks`
console.info(` Publishing ${pkg.name}@${version} to npm...`)
execSync(cmd, {
stdio: [process.stdin, process.stdout, process.stderr],
})
})
})

console.info()

Expand Down
1 change: 1 addition & 0 deletions src/publish/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type Parsed = {
export type Package = {
name: string
packageDir: string
skipPublish?: boolean
}

export type BranchConfig = {
Expand Down