Skip to content

Commit bf60806

Browse files
committed
Use package.json version field for EARL reports.
1 parent 5341442 commit bf60806

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- Don't set `@base` in initial context and don't resolve a relative IRI
1313
when setting `@base` in a context, so that the document location can
1414
be kept separate from the context itself.
15+
- Use `package.json` `version` field for EARL reports.
1516

1617
## 3.0.1 - 2020-03-10
1718

tests/earl-report.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ function EarlReport(options) {
7070
'subjectOf': []
7171
};
7272
/* eslint-enable quote-props */
73-
// FIXME: read this from somewhere
74-
version = 'v3.0.1'
73+
const version = require('../package.json').version;
7574
this._report['@id'] += '#' + this.id;
7675
this._report['doap:name'] += ' ' + this.id;
7776
this._report['dc:title'] += ' ' + this.id;
78-
this._report['doap:release']['doap:name'] = this._report['doap:name'] + ' ' + version;
77+
this._report['doap:release']['doap:name'] =
78+
this._report['doap:name'] + ' ' + version;
7979
this._report['doap:release']['doap:revision'] = version;
8080
}
8181

0 commit comments

Comments
 (0)