Skip to content

Commit fb2aaca

Browse files
committed
feat: Include package version in documentation
Closes #544
1 parent 78d8e2f commit fb2aaca

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

scripts/rebuild_specs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const app = new TypeDoc.Application({
1717
"lib.es2015.iterable.d.ts",
1818
"lib.es2015.collection.d.ts"
1919
],
20+
name: 'typedoc'
2021
});
2122

2223
// Note that this uses the test files in dist, not in src, this is important since

src/lib/converter/plugins/PackagePlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class PackagePlugin extends ConverterComponent {
124124
if (this.packageFile) {
125125
project.packageInfo = JSON.parse(FS.readFileSync(this.packageFile, 'utf-8'));
126126
if (!project.name) {
127-
project.name = project.packageInfo.name;
127+
project.name = `${project.packageInfo.name} - v${project.packageInfo.version}`;
128128
}
129129
}
130130
}

src/test/converter.test.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ describe('Converter', function() {
6868
target: 'ES5',
6969
module: 'CommonJS',
7070
experimentalDecorators: true,
71-
jsx: 'react'
71+
jsx: 'react',
72+
name: 'typedoc'
7273
});
7374
});
7475

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

107108
before('constructs', function() {
108109
app = new Application({
109-
mode: 'Modules',
110+
mode: 'Modules',
110111
logger: 'none',
111112
target: 'ES5',
112113
module: 'CommonJS',
113114
experimentalDecorators: true,
114115
categorizeByGroup: false,
115-
jsx: 'react'
116+
jsx: 'react',
117+
name: 'typedoc'
116118
});
117119
});
118120

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

161163
before('constructs', function() {
162164
app = new Application({
163-
mode: 'Modules',
165+
mode: 'Modules',
164166
logger: 'none',
165167
target: 'ES5',
166168
module: 'CommonJS',
167169
experimentalDecorators: true,
168170
excludeNotExported: true,
169-
jsx: 'react'
171+
jsx: 'react',
172+
name: 'typedoc'
170173
});
171174
});
172175

src/test/renderer.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ describe('Renderer', function() {
6161
target: 'ES5',
6262
readme: Path.join(src, '..', 'README.md'),
6363
module: 'CommonJS',
64-
gaSite: 'foo.com' // verify theme option without modifying output
64+
gaSite: 'foo.com', // verify theme option without modifying output
65+
name: 'typedoc'
6566
});
6667
});
6768

0 commit comments

Comments
 (0)