Skip to content

Commit 928ab66

Browse files
committed
Add api-extractor
1 parent 3a93e7a commit 928ab66

File tree

10 files changed

+1064
-119
lines changed

10 files changed

+1064
-119
lines changed

Gulpfile.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ const buildAll = () => buildProject("src");
9898

9999
task("moduleBuild", parallel(generateLibs, series(buildScripts, localize, buildAll)));
100100

101+
const apiExtractor = async () => {
102+
async function runApiExtractor(configPath) {
103+
await exec(process.execPath, [
104+
"node_modules/@microsoft/api-extractor/bin/api-extractor",
105+
"run",
106+
"--local",
107+
"--config",
108+
configPath,
109+
]);
110+
}
111+
112+
// TODO(jakebailey): prepend copyright notice, replace const enums with regular enums
113+
await runApiExtractor("./src/typescript/api-extractor.json");
114+
await runApiExtractor("./src/tsserverlibrary/api-extractor.json");
115+
};
116+
117+
task("api-extractor", series(task("moduleBuild"), apiExtractor));
118+
101119
const buildDebugTools = () => buildProject("src/debug");
102120
const cleanDebugTools = () => cleanProject("src/debug");
103121
cleanTasks.push(cleanDebugTools);

package-lock.json

Lines changed: 559 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"!**/.gitattributes"
4040
],
4141
"devDependencies": {
42+
"@microsoft/api-extractor": "^7.31.0",
4243
"@octokit/rest": "latest",
4344
"@types/async": "latest",
4445
"@types/chai": "latest",
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
"use strict";
2-
Object.defineProperty(exports, "__esModule", { value: true });
3-
const path = require("path");
4-
const packageRoot = path.resolve(__dirname, "..");
5-
// TODO(jakebailey): call api extractor for:
6-
// - src/typescript
7-
// - src/typescriptServices
8-
// - src/tsserverlibrary
9-
// Then in the output, replace const enum with "enum".
10-
// Also apply copyright header, as api-extractor won't.
11-
//# sourceMappingURL=apiExtractor.js.map
1+
import * as path from "path";
2+
import {
3+
Extractor,
4+
ExtractorConfig,
5+
ExtractorResult
6+
} from "@microsoft/api-extractor";
7+
8+
const packageRoot = path.resolve(__dirname, "..");
9+
10+
// TODO(jakebailey): call api extractor for:
11+
// - src/typescript
12+
// - src/typescriptServices
13+
// - src/tsserverlibrary
14+
// Then in the output, replace const enum with "enum".
15+
// Also apply copyright header, as api-extractor won't.

0 commit comments

Comments
 (0)