0.0.1 • Published 15 days ago

semantic-release-pnpm-deps v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
15 days ago

semantic-release-pnpm-deps

It's a semantic-release plugin to analyze dependencies updates in pnpm workspace and auto publish a new version if necessary.

Feature

  • Support analyze dependencies / devDependencies / peerDependencies types.
  • Update the changelog.md the dependenices / devDependencies / peerDependencies updates.
  • Can skip some packgaes or skip some dependenices;

How it works

The plugin will run the semantic-release life cycle steps:

StepDescription
verifyConditionsVerify the pnpm environment. Verify the plug-in configuration.
analyzeCommitsAnalyze whether the internal dependencies of the current package have been updated and decide whether to release a new version.
generateNotesGenerate notes related to dependent updates.
successRecord the successful release of the current package version to provide information for subsequent dependency analysis of other packages.

Install

$ npm install semantic-release-pnpm-deps -D
$ npm install semantic-release-monorepo -D  # peerDependencies
$ npm install semantic-release-plugin-pnpm -D # peerDependencies

Config

The plugin can be configured in the semantic-release configuration file:

{
  branches: ['master', { name: 'alpha', prerelease: true }, { name: 'beta', prerelease: true }],
  dryRun: true,
  extends: 'semantic-release-monorepo', // [peerDependencies] support monorepo of semantic-release
  plugins: [
    '@semantic-release/commit-analyzer',
    '@semantic-release/release-notes-generator',
    'semantic-release-plugin-pnpm', // [peerDependencies] replace `@semantic-release/npm`, support pnpm public
    [
      '@semantic-release/changelog',
      {
        changelogFile: 'CHANGELOG.md'
      }
    ],
    [
      '@semantic-release/git',
      {
        assets: ['CHANGELOG.md', 'package.json'], 
        message: 'chore(release): ${nextRelease.version} [skip ci] [CI SKIP] \n\n${nextRelease.notes}'
      }
    ],
    [
      'semantic-release-pnpm-deps',  // [Usage] support pnpm worspace dependenices analyze, auto release new version
      {
        analyzeDepTypes: ['dependencies', 'devDependencies', 'peerDependencies'],
        depsAutoReleaseType: 'patch', // inherit | major | minor | patch(default)
        ignorePackages: [], // e.g: ['@test/pkg1']
        ignoreDeps: {} // e.g {'@test/pkg5' : ['@test/pkg1', '@test/pkg2']}
      }
    ],
    [
      '@semantic-release/exec',
      {
        verifyReleaseCmd: 'pnpm build'
      }
    ]
  ],
}

Usage

in workspace package.json :

{
  "scripts": {
    "semantic-release-mono": "pnpm -r --workspace-concurrency=1 exec -- npx --no-install semantic-release -e semantic-release-monorepo"
  }
}