cut a v2.1.0 release (#2354)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gh-badges",
|
||||
"version": "2.0.0",
|
||||
"version": "2.1.0",
|
||||
"description": "Shields.io badge library",
|
||||
"keywords": [
|
||||
"GitHub",
|
||||
|
||||
Reference in New Issue
Block a user