From ba9c5befb095879597aee54c9e77a9a939599249 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Sat, 23 Jul 2022 15:47:48 -0600 Subject: [PATCH] Only set version if includeVersion is specified Resolves #2010 --- CHANGELOG.md | 1 + src/lib/utils/entry-point.ts | 4 +++- src/test/slow/entry-point.test.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ce4f157..7d8269489 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ If using `"entryPointStrategy": "expand"`, this change may result in new pages being added to your documentation. If this is not desired, you can use the `exclude` option to filter them out. - Fixed missing comments on callable variable-functions constructed indirectly, #2008. +- Packages mode will now respect the `--includeVersion` flag, #2010. - Fixed multiple reflections mapping to the same file name on case insensitive file systems, #2012. ## v0.23.8 (2022-07-17) diff --git a/src/lib/utils/entry-point.ts b/src/lib/utils/entry-point.ts index 3df6c28a2..b2efcd215 100644 --- a/src/lib/utils/entry-point.ts +++ b/src/lib/utils/entry-point.ts @@ -407,7 +407,9 @@ function getEntryPointsForPackages( displayName: typedocPackageConfig?.displayName ?? (packageJson["name"] as string), - version: packageJson["version"] as string | undefined, + version: includeVersion + ? (packageJson["version"] as string | undefined) + : void 0, readmeFile: typedocPackageConfig?.readmeFile ? Path.resolve( Path.join( diff --git a/src/test/slow/entry-point.test.ts b/src/test/slow/entry-point.test.ts index 5c1256dcf..adc89454b 100644 --- a/src/test/slow/entry-point.test.ts +++ b/src/test/slow/entry-point.test.ts @@ -84,5 +84,6 @@ describe("Entry Points", () => { const entryPoints = app.getEntryPoints(); ok(entryPoints); equal(entryPoints.length, 1); + equal(entryPoints[0].version, void 0); }); });