Skip to content

Commit

Permalink
Add version information
Browse files Browse the repository at this point in the history
  • Loading branch information
infojunkie committed Jan 28, 2024
1 parent 78ccee6 commit bca24ad
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [12, 14, 16]
node-version: [14, 16, 18, 20]

steps:
- name: Install dependencies
Expand Down
22 changes: 22 additions & 0 deletions lib/ireal-musicxml.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,28 @@ export class MusicXML {
convert(): string;
}

/**
* Package information.
*/
export class Version {
/**
* Package name.
*/
static name: string;
/**
* Package version.
*/
static version: string;
/**
* Package author.
*/
static author: string;
/**
* Package description.
*/
static description: string;
}

/**
* Convert an iReal Pro playlist synchronously.
* @param ireal iReal Pro playlist as HTML file contents or URI encoding
Expand Down
2 changes: 1 addition & 1 deletion lib/ireal-musicxml.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ireal-musicxml",
"version": "1.12.2",
"version": "1.13.0",
"description": "iReal Pro to MusicXML converter",
"author": "Karim Ratib <[email protected]> (https://github.com/infojunkie)",
"license": "GPL-3.0-only",
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Promise from 'promise';
import {Playlist, Song, Cell, Chord} from './parser';
import {MusicXML, LogLevel} from './musicxml';
import {Version} from './version';
import 'regenerator-runtime/runtime';

export function convertSync(ireal, options = {}) {
Expand All @@ -15,4 +16,4 @@ export async function convert(ireal, options = {}) {
return new Promise(resolve => resolve(convertSync(ireal, options)));
}

export {Playlist, Song, Cell, Chord, MusicXML, LogLevel};
export {Playlist, Song, Cell, Chord, MusicXML, LogLevel, Version};
8 changes: 8 additions & 0 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pkg from '../package.json';

export class Version {
static name = pkg.name;
static version = pkg.version;
static author = pkg.author;
static description = pkg.description;
}
4 changes: 4 additions & 0 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ import * as fs from 'fs';
import * as iReal2MusicXML from '../lib/ireal-musicxml';

describe('iReal2MusicXML using TypeScript', function() {
it('accesses the library version', function() {
assert.strictEqual(iReal2MusicXML.Version.name, 'ireal-musicxml');
});

it('converts an iReal Pro song to MusicXML synchronously', function() {
const result: iReal2MusicXML.Playlist = iReal2MusicXML.convertSync(fs.readFileSync('test/data/playlist.html', 'utf-8'), {
notation: "rhythmic",
Expand Down

0 comments on commit bca24ad

Please sign in to comment.