Skip to content

Commit

Permalink
feat: Include package version in documentation
Browse files Browse the repository at this point in the history
Closes #544
  • Loading branch information
Gerrit0 committed Dec 26, 2019
1 parent 78d8e2f commit fb2aaca
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions scripts/rebuild_specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const app = new TypeDoc.Application({
"lib.es2015.iterable.d.ts",
"lib.es2015.collection.d.ts"
],
name: 'typedoc'
});

// Note that this uses the test files in dist, not in src, this is important since
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/plugins/PackagePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class PackagePlugin extends ConverterComponent {
if (this.packageFile) {
project.packageInfo = JSON.parse(FS.readFileSync(this.packageFile, 'utf-8'));
if (!project.name) {
project.name = project.packageInfo.name;
project.name = `${project.packageInfo.name} - v${project.packageInfo.version}`;
}
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/test/converter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ describe('Converter', function() {
target: 'ES5',
module: 'CommonJS',
experimentalDecorators: true,
jsx: 'react'
jsx: 'react',
name: 'typedoc'
});
});

Expand Down Expand Up @@ -106,13 +107,14 @@ describe('Converter with categorizeByGroup=false', function() {

before('constructs', function() {
app = new Application({
mode: 'Modules',
mode: 'Modules',
logger: 'none',
target: 'ES5',
module: 'CommonJS',
experimentalDecorators: true,
categorizeByGroup: false,
jsx: 'react'
jsx: 'react',
name: 'typedoc'
});
});

Expand Down Expand Up @@ -160,13 +162,14 @@ describe('Converter with excludeNotExported=true', function() {

before('constructs', function() {
app = new Application({
mode: 'Modules',
mode: 'Modules',
logger: 'none',
target: 'ES5',
module: 'CommonJS',
experimentalDecorators: true,
excludeNotExported: true,
jsx: 'react'
jsx: 'react',
name: 'typedoc'
});
});

Expand Down
3 changes: 2 additions & 1 deletion src/test/renderer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ describe('Renderer', function() {
target: 'ES5',
readme: Path.join(src, '..', 'README.md'),
module: 'CommonJS',
gaSite: 'foo.com' // verify theme option without modifying output
gaSite: 'foo.com', // verify theme option without modifying output
name: 'typedoc'
});
});

Expand Down

0 comments on commit fb2aaca

Please sign in to comment.