Skip to content

Commit 9aece44

Browse files
committed
Add support for "tsconfig" in monorepo config
Resolves #2061
1 parent 0312504 commit 9aece44

File tree

5 files changed

+36
-3
lines changed

5 files changed

+36
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Unreleased
22

3+
### Features
4+
5+
- Added support for specifying the tsconfig.json file in packages mode with `{ "typedoc": { "tsconfig": "tsconfig.lib.json" }}` in package.json, #2061.
6+
37
### Bug Fixes
48

59
- Private parameter properties will no longer be ignored, #2064.

scripts/create_release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async function main() {
6565
const currentVersion = `v${
6666
require(join(__dirname, "..", "package.json")).version
6767
}`;
68-
const [_major, _minor, patch] = currentVersion.substr(1).split(".");
68+
const [_major, _minor, patch] = currentVersion.substring(1).split(".");
6969

7070
if (lastTag == currentVersion) {
7171
console.log("No version change, not publishing.");
@@ -98,7 +98,7 @@ async function main() {
9898
fullChangelog =
9999
"# Unreleased\n\n" +
100100
`${heading} ${currentVersion} (${dateStr})` +
101-
fullChangelog.substr(start);
101+
fullChangelog.substring(start);
102102
start = fullChangelog.indexOf(`${heading} ${currentVersion}`);
103103

104104
await writeFile(CHANGELOG_MD, fullChangelog);

src/lib/utils/entry-point.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,8 @@ function getEntryPointsForPackages(
364364
}
365365
const tsconfigFile = ts.findConfigFile(
366366
packageEntryPoint,
367-
ts.sys.fileExists
367+
ts.sys.fileExists,
368+
typedocPackageConfig?.tsconfig
368369
);
369370
if (tsconfigFile === undefined) {
370371
logger.error(

src/lib/utils/package-manifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const typedocPackageManifestConfigSchema = {
4141
displayName: optional(String),
4242
entryPoint: optional(String),
4343
readmeFile: optional(String),
44+
tsconfig: optional(String),
4445

4546
[additionalProperties]: false,
4647
};

src/test/slow/entry-point.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,31 @@ describe("Entry Points", () => {
111111
equal(entryPoints.length, 1);
112112
equal(entryPoints[0].version, void 0);
113113
});
114+
115+
it("Supports custom tsconfig files #2061", () => {
116+
const fixture = tempdirProject({ rootDir: tmpdir() });
117+
fixture.addJsonFile("tsconfig.lib.json", {
118+
include: ["."],
119+
});
120+
fixture.addJsonFile("package.json", {
121+
main: "index.ts",
122+
typedoc: {
123+
tsconfig: "tsconfig.lib.json",
124+
},
125+
});
126+
fixture.addFile("index.ts", "export function fromIndex() {}");
127+
fixture.write();
128+
129+
app.bootstrap({
130+
tsconfig: tsconfig,
131+
entryPoints: [fixture.cwd],
132+
entryPointStrategy: EntryPointStrategy.Packages,
133+
});
134+
135+
const entryPoints = app.getEntryPoints();
136+
fixture.rm();
137+
ok(entryPoints);
138+
equal(entryPoints.length, 1);
139+
equal(entryPoints[0].version, void 0);
140+
});
114141
});

0 commit comments

Comments
 (0)