How to use the @auto-it/core.SEMVER.minor function in @auto-it/core

To help you get started, we’ve selected a few @auto-it/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intuit / auto / plugins / twitter / src / index.ts View on Github external
import { Auto, IPlugin, SEMVER } from '@auto-it/core';
import endent from 'endent';
import { diff, ReleaseType } from 'semver';
import twitter from 'tweet-tweet';
import tweetValidation from 'twitter-text';
import { promisify } from 'util';

interface ITwitterPluginOptions {
  /** The message template to use to post to Twitter */
  message: string;
  /** A threshold the semver has to pass to be posted to Twitter */
  threshold: SEMVER;
}

const defaults: ITwitterPluginOptions = {
  threshold: SEMVER.minor,
  message: endent`
    A new %release version of %package was released!

    %notes

    %link
  `
};

const RELEASE_PRECEDENCE: ReleaseType[] = ['patch', 'minor', 'major'];

/** Determine the release with the biggest semver change */
const isGreaterThan = (a: ReleaseType, b: ReleaseType) =>
  RELEASE_PRECEDENCE.indexOf(a) > RELEASE_PRECEDENCE.indexOf(b);

/** Remove the last line of text from a multiline string */