microfleet/core

View on GitHub
ci/aggregate-npm.js

Summary

Maintainability
A
0 mins
Test Coverage
/* eslint-disable @typescript-eslint/no-var-requires */
const NPM = require('release-it/lib/plugin/npm/npm')

class AggregateNPM extends NPM {
  static disablePlugin() {
    return ['npm']
  }

  getInitialOptions(options, namespace) {
    options[namespace] = options.npm
    return options[namespace]
  }

  async bump(version) {
    if (version === this.getContext('latestVersion') || !version) {
      this.debug('skipping npm version')
      return false
    }

    const tag = this.options.tag || (await this.resolveTag(version))
    this.setContext({ version, tag })

    return false
  }
}

module.exports = AggregateNPM