Skip to content

Commit

Permalink
Fix: Semantic Release
Browse files Browse the repository at this point in the history
  • Loading branch information
1aron committed Aug 5, 2023
1 parent 3180376 commit fde5702
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/semantic-release-config/configure.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const releaseRules = require('./rules')
const extend = require('@techor/extend').default
const { readWorkspaces, queryWorkspaces } = require('@techor/npm')
const { explorePackageManager, readPNPMWorkspaces, readWorkspaces, queryWorkspaces } = require('@techor/npm')

const defaultConfig = {
branches: [
Expand Down Expand Up @@ -41,11 +41,19 @@ module.exports = (config) => {
}
})
.filter((eachPlugin) => eachPlugin)
let workspaces = readWorkspaces()
console.log('Found workspaces:', workspaces)
let workspaces
const packageManager = explorePackageManager()
switch (packageManager) {
case 'pnpm':
workspaces = readPNPMWorkspaces()
break
case 'npm':
workspaces = readWorkspaces()
break
}
if (workspaces?.length) {
const resolvedWorkspaces = queryWorkspaces(workspaces)
console.log('Resolved workspaces:', resolvedWorkspaces)
console.log('Workspaces found:', resolvedWorkspaces)
newConfig.plugins.push(...resolvedWorkspaces.map((eachWorkspace) => ['@semantic-release/npm', { pkgRoot: eachWorkspace }]))
}
return newConfig
Expand Down

0 comments on commit fde5702

Please sign in to comment.