Skip to content

Commit

Permalink
feat: add 'SRM_DEBUG' env variable for debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Nov 29, 2022
1 parent c072c31 commit 1f96ff0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: pnpm run build

- name: Release
run: node ./packages/cli/index.js --debug --gpr --combine-commits
run: node ./packages/cli/index.js --gpr --combine-commits
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function release(
stderr: process.stderr,
},
) {
enableDebugger(srmOptions.debug)
enableDebugger(srmOptions.debug || context.env.SRM_DEBUG)
const logger = getLogger(context)
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
Expand All @@ -30,7 +30,7 @@ async function release(
logger.info(`Running srm version ${srmPkgJSON.version}`)
logger.info(`Load packages from: ${context.cwd}`)

debug(`srm options: ${JSON.stringify(srmOptions, null, 2)}`)
debug(JSON.stringify(srmOptions, null, 2))

const paths = getManifestPaths(context.cwd, srmOptions.ignorePackages)
await releasePackages(paths, srOptions, srmOptions, context, logger)
Expand Down
9 changes: 5 additions & 4 deletions packages/core/src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function getInlinePluginsCreator(
await plugins.verifyConditions(context)
}

debug('verified conditions: %s', pkg.name)
// debug('verified conditions: %s', pkg.name)
}

/**
Expand Down Expand Up @@ -129,8 +129,9 @@ export function getInlinePluginsCreator(
await updateNextReleaseType(pkg, packages, synchronizer, srmOptions)

debug('commits analyzed: %s', pkg.name)
debug('next release type [deps]: %s', pkg.rawNextType || '')
debug('next release type [raw]: %s', pkg.nextType || '')
const noRelease = 'no new version'
debug('next release type [deps]: %s', pkg.rawNextType || noRelease)
debug('next release type [raw]: %s', pkg.nextType || noRelease)

return pkg.nextType
}
Expand Down Expand Up @@ -427,7 +428,7 @@ export function getInlinePluginsCreator(
}),
)

debug('inlinePlugin created: %s', pkg.name)
// debug('inlinePlugin created: %s', pkg.name)

return inlinePlugin
}
Expand Down

0 comments on commit 1f96ff0

Please sign in to comment.