Skip to content

Commit

Permalink
feat!: follow private option, remove disablePublish option
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Feb 25, 2024
1 parent 8b9c944 commit e9ea7c7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class ReleaseItPnpmPlugin extends Plugin {
}

async init() {
const { name, version } = readJSON(path.resolve(MANIFEST_PATH))
const { name, version, private: isPrivate } = readJSON(path.resolve(MANIFEST_PATH))
this.setContext({ name, latestVersion: version })

const updates = [{ entry: MANIFEST_PATH, name, version, isRoot: true }]
const updates = [{ entry: MANIFEST_PATH, name, version, isPrivate: !!isPrivate }]

if (hasAccess(MANIFEST_WORKSPACE_PATH)) {
const content = fs.readFileSync(path.resolve(MANIFEST_WORKSPACE_PATH), 'utf8')
Expand All @@ -82,8 +82,8 @@ class ReleaseItPnpmPlugin extends Plugin {
)

for (const entry of entries) {
const { name, version } = readJSON(entry)
updates.push({ entry, name, version })
const { name, version, private: isPrivate } = readJSON(entry)
updates.push({ entry, name, version, isPrivate: !!isPrivate })
}
}

Expand Down Expand Up @@ -190,7 +190,7 @@ class ReleaseItPnpmPlugin extends Plugin {
const tag = this.options.preRelease || DEFAULT_TAG
this.setContext({ tag })

if (!this.options?.disablePublish)
if (updates.some(update => !update.isPrivate))
await this.step({
task: async () => {
await this.exec(`pnpm -r publish --access public --no-git-checks --tag ${tag}`)
Expand Down

0 comments on commit e9ea7c7

Please sign in to comment.