Skip to content

Releases: flex-development/dist-tag

[email protected]

07 Aug 02:10
88234b5
Compare
Choose a tag to compare

[email protected] (2022-08-07)

⚠ BREAKING CHANGES

  • node: reimplement tag lookup given new Options
  • options: Options.prefix? -> Options.delimiter?
  • options: Options.version? -> Options.target?
  • options: drop Options.map
  • options: drop Options.skip

📦 Build

  • cli: distribute cli as bundle (504dc86)

📝 Documentation

✨ Features

⚡ Refactors

  • node: reimplement tag lookup given new Options (2c935e6)
  • options: improve option names (aac302b)
  • options: DistTagOptions -> Options (63f05d6)

[email protected]

06 Aug 00:48
0f2061a
Compare
Choose a tag to compare
[email protected] Pre-release
Pre-release

[email protected] (2022-08-05)

⚠ BREAKING CHANGES

  • node: reimplement tag lookup given new Options
  • options: tagPrefix? -> prefix?
  • options: version? -> target?
  • options: drop delimiter
  • options: drop map
  • options: drop skip

🤖 Continuous Integration

📝 Documentation

✨ Features

🏡 Housekeeping

⚡ Refactors

  • node: reimplement tag lookup given new Options (2c935e6)
  • options: DistTagOptions -> Options (63f05d6)

[email protected] (🎂 First Release)

26 Aug 17:18
91500a5
Compare
Choose a tag to compare

Overview

Assuming a distribution (dist) tag is included in package version or release tag (e.g 3.13.98-dev.640, [email protected]), dtag helps maintainers lookup and interpolate distribution tags.

Lookups

Basic

import dtag from '@flex-development/dtag'

/**
 * @file Examples - Lookup
 * @module dtag/docs/examples/lookup
 */

dtag({ version: '3.13.98-dev.640' }) // => 'dev'

Interpolation

import dtag from '@flex-development/dtag'

/**
 * @file Examples - Interpolated Lookup
 * @module dtag/docs/examples/lookup-map
 */

dtag({ map: { rc: 'next' }, version: 'v3.0.0-rc' }) // => 'next'

Monorepos

import dtag from '@flex-development/dtag'

/**
 * @file Examples - Lookup Monorepo
 * @module dtag/docs/examples/lookup-monorepo
 */

const tagPrefix: string = 'foo@'

dtag({ tagPrefix, version: '[email protected]' }) // => 'beta'
dtag({
  map: { rc: 'next' },
  tagPrefix,
  version: '[email protected]'
}) // => 'beta'

Options

/**
 * `dtag` options.
 */
export interface DistTagOptions {
  /**
   * Prerelease delimiter (e.g `-` before `alpha` in `[email protected]`).
   *
   * @default '-'
   */
  delimiter?: string

  /**
   * Distribution (dist) tag map. If a dist tag is found in `version` and `map`
   * is a non-empty object, the tag returned will be plucked from `map`.
   *
   * @default {}
   */
  map?: Record<string, string>

  /**
   * Skip distribution tag lookup.
   */
  skip?: boolean

  /**
   * Git tag prefix.
   *
   * @default 'v'
   */
  tagPrefix?: string

  /**
   * Package version (with or without `tagPrefix`).
   *
   * @default null
   */
  version?: any
}