Skip to content

Commit

Permalink
Add support for "tsconfig" in monorepo config
Browse files Browse the repository at this point in the history
Resolves #2061
  • Loading branch information
Gerrit0 committed Oct 10, 2022
1 parent 0312504 commit 9aece44
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Unreleased

### Features

- Added support for specifying the tsconfig.json file in packages mode with `{ "typedoc": { "tsconfig": "tsconfig.lib.json" }}` in package.json, #2061.

### Bug Fixes

- Private parameter properties will no longer be ignored, #2064.
Expand Down
4 changes: 2 additions & 2 deletions scripts/create_release.js
Expand Up @@ -65,7 +65,7 @@ async function main() {
const currentVersion = `v${
require(join(__dirname, "..", "package.json")).version
}`;
const [_major, _minor, patch] = currentVersion.substr(1).split(".");
const [_major, _minor, patch] = currentVersion.substring(1).split(".");

if (lastTag == currentVersion) {
console.log("No version change, not publishing.");
Expand Down Expand Up @@ -98,7 +98,7 @@ async function main() {
fullChangelog =
"# Unreleased\n\n" +
`${heading} ${currentVersion} (${dateStr})` +
fullChangelog.substr(start);
fullChangelog.substring(start);
start = fullChangelog.indexOf(`${heading} ${currentVersion}`);

await writeFile(CHANGELOG_MD, fullChangelog);
Expand Down
3 changes: 2 additions & 1 deletion src/lib/utils/entry-point.ts
Expand Up @@ -364,7 +364,8 @@ function getEntryPointsForPackages(
}
const tsconfigFile = ts.findConfigFile(
packageEntryPoint,
ts.sys.fileExists
ts.sys.fileExists,
typedocPackageConfig?.tsconfig
);
if (tsconfigFile === undefined) {
logger.error(
Expand Down
1 change: 1 addition & 0 deletions src/lib/utils/package-manifest.ts
Expand Up @@ -41,6 +41,7 @@ const typedocPackageManifestConfigSchema = {
displayName: optional(String),
entryPoint: optional(String),
readmeFile: optional(String),
tsconfig: optional(String),

[additionalProperties]: false,
};
Expand Down
27 changes: 27 additions & 0 deletions src/test/slow/entry-point.test.ts
Expand Up @@ -111,4 +111,31 @@ describe("Entry Points", () => {
equal(entryPoints.length, 1);
equal(entryPoints[0].version, void 0);
});

it("Supports custom tsconfig files #2061", () => {
const fixture = tempdirProject({ rootDir: tmpdir() });
fixture.addJsonFile("tsconfig.lib.json", {
include: ["."],
});
fixture.addJsonFile("package.json", {
main: "index.ts",
typedoc: {
tsconfig: "tsconfig.lib.json",
},
});
fixture.addFile("index.ts", "export function fromIndex() {}");
fixture.write();

app.bootstrap({
tsconfig: tsconfig,
entryPoints: [fixture.cwd],
entryPointStrategy: EntryPointStrategy.Packages,
});

const entryPoints = app.getEntryPoints();
fixture.rm();
ok(entryPoints);
equal(entryPoints.length, 1);
equal(entryPoints[0].version, void 0);
});
});

0 comments on commit 9aece44

Please sign in to comment.