Options
All
  • Public
  • Public/Protected
  • All
Menu

External module utils/project

Various helpers around package.json, versions and tags.

Index

Functions

assertUnusedTag

  • assertUnusedTag(tag: string): Promise<void>
  • Throws an error if the provided git tag is already defined.

    Parameters

    • tag: string

      Tag to check

    Returns Promise<void>

    Void promise if the tag is unused, otherwise rejected promise.

bumpVersion

  • bumpVersion(bumpKind: "major" | "minor" | "patch", locations: ResolvedProject): Promise<void>

commitVersion

  • commitVersion(version: string, projectRoot: Furi): Promise<void>
  • Commit and tag the current changes as a version release.

    Parameters

    • version: string

      Semver version for the release.

    • projectRoot: Furi

      Root of the project, must be inside a git repo. Default: process.cwd().

    Returns Promise<void>

    Promise resolved once the commit is done.

getNextVersion

  • getNextVersion(bumpKind: "major" | "minor" | "patch", locations: Project): Promise<string>

getVersionMessage

  • getVersionMessage(version: string): string
  • Get the commit or tag message corresponding to the release of the provided version.

    Parameters

    • version: string

      Semver version used to create the tag.

    Returns string

    Corresponding message.

getVersionTag

  • getVersionTag(version: string): string
  • Get the Git tag corresponding to the provided semver version.

    It prefixes the version with v.

    Parameters

    • version: string

      Semver version used to create the tag.

    Returns string

    Corresponding tag.

readJsonFile

  • readJsonFile(filePath: string | URL): Promise<any>
  • Reads a JSON file and returns its parsed content.

    Parameters

    • filePath: string | URL

      Path of the file to read.

    Returns Promise<any>

    Promise for the content of the file.

readPackage

release

  • Updates the version in package.json and creates a release commit.

    Ensures that the master Git branch is active without uncommited changes.

    Parameters

    • version: string

      The new version (semver string)

    • locations: ResolvedProject

      Project locations object.

    Returns Promise<void>

    Promise resolved once the release commit is created.

setPackageVersion

  • setPackageVersion(version: string, locations: Project): Promise<void>

writeJsonFile

  • writeJsonFile(filePath: string | URL, data: any): Promise<void>
  • Writes an object to a JSON file.

    The JSON file is pretty printed using 2-spaces indentation, new lines at separators and a trailing new line.

    Parameters

    • filePath: string | URL

      Path of the file to write the object in.

    • data: any

      Data to write.

    Returns Promise<void>

    Promise resolved once the data is written.

writePackage

Generated using TypeDoc