Skip to content

Commit b43e8f6

Browse files
authored
fix types (#1200)
1 parent 208dc39 commit b43e8f6

File tree

952 files changed

+5406
-5718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

952 files changed

+5406
-5718
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { spawn } from 'child_process';
2+
import { platform } from 'process';
3+
import path from 'path';
4+
import fs from 'fs';
5+
6+
import { listWorkspaces } from "../list-workspaces/list-workspaces.mjs";
7+
8+
const workspaces = await listWorkspaces();
9+
10+
for (const workspace of workspaces) {
11+
await runApiDocumenter(workspace);
12+
}
13+
14+
async function runApiDocumenter(workspace) {
15+
await new Promise((resolve, reject) => {
16+
if (workspace.private) {
17+
resolve(true);
18+
19+
return;
20+
}
21+
22+
const docsExist = fs.existsSync(path.join(workspace.path, 'docs', workspace.unscopedName + '.api.json'));
23+
if (!docsExist) {
24+
resolve(true);
25+
26+
return;
27+
}
28+
29+
const publishCmd = spawn(
30+
'npm',
31+
[
32+
'exec',
33+
'--',
34+
'api-documenter',
35+
'markdown',
36+
'--input-folder',
37+
path.join(workspace.path, 'docs'),
38+
'--output-folder',
39+
path.join(workspace.path, 'api-reference'),
40+
],
41+
{
42+
stdio: 'inherit',
43+
shell: platform === 'win32'
44+
}
45+
);
46+
47+
publishCmd.on('close', (code) => {
48+
if (0 !== code) {
49+
reject(new Error(`'npm publish' exited with code ${code} for ${packageName}`));
50+
return;
51+
}
52+
53+
resolve(true);
54+
});
55+
});
56+
}

.github/bin/list-workspaces/list-workspaces.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export async function listWorkspaces() {
3939
result.push({
4040
path: packagePath,
4141
name: packageJSON.name,
42+
unscopedName: packageJSON.name.replace(/^@[^/]+\//, ''),
4243
private: packageJSON.private,
4344
dependencies: [
4445
...Object.keys(Object(packageJSON.dependencies)),

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ reports
1010
!e2e/package-lock.json
1111
!sites/package-lock.json
1212
.cached-commit
13+
_types

0 commit comments

Comments
 (0)