From 6f9dd95a18cd231f95760d24f6e43ad34028fa05 Mon Sep 17 00:00:00 2001 From: chris48s Date: Sun, 18 Nov 2018 17:53:08 +0000 Subject: [PATCH] cut a v2.1.0 release (#2354) --- gh-badges/CHANGELOG.md | 66 ++++++++++++++++++++++++++++++++++++++++++ gh-badges/package.json | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) diff --git a/gh-badges/CHANGELOG.md b/gh-badges/CHANGELOG.md index 26d639ad36..225564e06e 100644 --- a/gh-badges/CHANGELOG.md +++ b/gh-badges/CHANGELOG.md @@ -1,5 +1,71 @@ # Changelog +## 2.1.0 + +gh-badges v2.1.0 implements a new text width measurer which uses a lookup table, removing the dependency +on PDFKit. It is no longer necessary to provide a local copy of Verdana for accurate text width computation. + +As such, the `fontPath` and `precomputeWidths` parameters are now deprecated. The recommended call to create an instance of `BadgeFactory` is now + +```js +const bf = new BadgeFactory() +``` + +For backwards compatibility you can still construct an instance of `BadgeFactory` with a call like + +```js +const bf = new BadgeFactory({ fontPath: '/path/to/Verdana.ttf', precomputeWidths: true }) +``` + +However, the function will issue a warning. + +To clear the warning, change the code to: + +```js +const bf = new BadgeFactory() +``` + +These arguments will be removed in a future release. + +To upgrade from v1.3.0, change your code from: + +```js +const badge = require('gh-badges') + +const format = { + text: ['build', 'passed'], + colorscheme: 'green', + template: 'flat', +} + +badge.loadFont('/path/to/Verdana.ttf', err => { + badge(format, (svg, err) => { + // svg is a string containing your badge + }) +}) +``` + +to: + +```js +const { BadgeFactory } = require('gh-badges') + +const bf = new BadgeFactory() + +const format = { + text: ['build', 'passed'], + colorscheme: 'green', + template: 'flat', +} + +const svg = bf.create(format) +``` + +### Other changes in this release: + +* Remove unnecessary dependencies +* Documentation improvements + ## 2.0.0 - 2018-11-09 gh-badges v2.0.0 declares a new public interface which is synchronous. diff --git a/gh-badges/package.json b/gh-badges/package.json index 8a48d82f2f..645f1b1801 100644 --- a/gh-badges/package.json +++ b/gh-badges/package.json @@ -1,6 +1,6 @@ { "name": "gh-badges", - "version": "2.0.0", + "version": "2.1.0", "description": "Shields.io badge library", "keywords": [ "GitHub",