0.2.2 • Published 2 years ago

changelogd v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Features

  • 🌳 Opportunistic API, multiple providers: filesystem, NPM, Github
  • 🦭 Provide a diff of CHANGELOG's between versions, if found
  • 🐱 Otherwise, fetch release notes straight from Github
  • 📦 Minimal network requests with caching enabled

Programmatic Usage

import { createChangelogd } from 'changelogd'

const changelogd = await createChangelogd({
  // options
})

const res = await changelogd.fetchChangelog('nuxt-windicss', '2.3.0', '2.4.0')

Types

export interface Config {
  force?: boolean
  ttl?: number
  storage?: Storage
  cacheDir?: number
}
export interface ChangelogdCtx {
  config: Config

  resolveLocalChangelog: (id: string, opts?: ResolveOptions) => Promise<string>
  resolvePackageJSON: (id: string) => Promise<PackageJson>
  resolveChangelogFile: (name: string, version: string, options?: GithubFetchOptions) => Promise<Changelog>

  fetchChangelogFileDiff: (name: string, currentVersion: string, targetVersion: string, options?: GithubFetchOptions) => Promise<FetchChangelogDiffResult>
  fetchGithubReleases: (name: string, currentVersion: string, targetVersion: string, options?: GithubFetchOptions) => Promise<GithubReleasesResult>

  fetchChangelog: (name: string, currentVersion: string, targetVersion: string, options?: GithubFetchOptions) => Promise<
    { provider: 'github-releases'; changelog: GithubReleasesResult } |
    { provider: 'changelog-diff'; changelog: FetchChangelogDiffResult }
  >
}

CLI Usage

npx changelogd@latest <package> --from=<version> --to=<version>

Arguments:

  • package: Package name to use. Should be the same as the package.json's name (NPM).
  • from: The release tag to read from.
  • to: The release tag to read to. Default: latest

Example

Fetching CHANGELOG.md from Github

npx changelogd@latest ohmyfetch --from 0.4.0 --to 0.4.19

Fetching CHANGELOG.md from NPM

npx changelogd@latest consola --from 2.13.0 --to 2.15.0

Fetching Github Releases

npx changelogd@latest nuxt-windicss --from 2.3.0 --to 2.4.0

Sponsors

License

MIT License © 2022 Harlan Wilton

0.2.1

2 years ago

0.2.0

2 years ago

0.1.4

2 years ago

0.2.2

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.7

2 years ago

0.0.3

2 years ago