Skip to content

Commit

Permalink
WIP update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdemartini committed Jan 5, 2021
1 parent a953050 commit df0978e
Show file tree
Hide file tree
Showing 6 changed files with 508 additions and 417 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/fs-extra": "^9.0.5",
"@types/jest": "^26.0.19",
"@types/lodash": "^4.14.165",
"@types/node": "^14.14.9",
"@types/node": "^14.14.20",
"@types/uuid": "^8.3.0",
"eslint": "^7.17.0",
"jest": "^26.6.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"test:watch": "ts-scripts test --watch . --"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^4.10.0",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-plugin-import": "~2.22.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"semver": "^7.3.4",
"signale": "^1.4.0",
"sort-package-json": "~1.48.0",
"typedoc": "^0.19.2",
"typedoc": "^0.20.11",
"typedoc-plugin-markdown": "^3.0.11",
"yargs": "^16.2.0"
},
Expand Down
68 changes: 37 additions & 31 deletions packages/scripts/src/helpers/docs/typedoc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import path from 'path';
import fse from 'fs-extra';
import { Application } from 'typedoc';
import { JsxEmit, ModuleKind, ModuleResolutionKind, ScriptTarget } from 'typescript';
import { Application, TSConfigReader } from 'typedoc';
import {
JsxEmit, ModuleKind, ModuleResolutionKind, ScriptTarget
} from 'typescript';
import { PackageInfo } from '../interfaces';
import { listMdFiles, getName, writeIfChanged } from '../misc';
import signale from '../signale';
Expand Down Expand Up @@ -82,48 +84,52 @@ async function fixDocs(outputDir: string, { displayName }: PackageInfo) {
await Promise.all(promises);
}

export async function generateTSDocs(pkgInfo: PackageInfo, outputDir: string) {
app.options.addReader(new TSConfigReader());
app.bootstrap({
theme: 'markdown',
exclude: ['test', 'node_modules'],
excludePrivate: true,
excludeExternals: true,
hideGenerator: true,
readme: 'none',
});

export async function generateTSDocs(pkgInfo: PackageInfo, outputDir: string): Promise<void> {
signale.await(`building typedocs for package ${pkgInfo.name}`);

const cwd = process.cwd();
try {
process.chdir(pkgInfo.dir);
app.bootstrap({
name: pkgInfo.name,
target: ScriptTarget.ESNext,
tsconfig: path.join(pkgInfo.dir, 'tsconfig.json'),
// @ts-expect-error
platform: 'docusaurus' as any,
mode: 'file',
theme: 'markdown',
exclude: ['test', 'node_modules'],
excludePrivate: true,
excludeExternals: true,
excludeNotExported: true,
experimentalDecorators: true,
skipLibCheck: true,
esModuleInterop: true,
ignoreCompilerErrors: true,
strict: false,
jsx: JsxEmit.React,
moduleResolution: ModuleResolutionKind.NodeJs,
module: ModuleKind.CommonJS,
hideGenerator: true,
readme: 'none',
})
const inputFiles = [...app.expandInputFiles(['src'])];

app.options.setValue('name', pkgInfo.name);
app.options.setValue('tsconfig', path.join(pkgInfo.dir, 'tsconfig.json'));

if (app.logger.hasErrors()) {
signale.error(`found errors typedocs for package ${pkgInfo.name}`);
return;
}
const project = app.convert();
if (!project) {
signale.error(`invalid typedocs for package ${pkgInfo.name}`);
return;
}

if (fse.existsSync(outputDir)) {
await fse.emptyDir(outputDir);
}
await fse.ensureDir(outputDir);
// Project may not have converted correctly
// Rendered docs
app.generateDocs(inputFiles, outputDir);

await app.generateDocs(project, outputDir);

if (app.logger.hasErrors()) {
signale.error(`found errors when generating typedocs for package ${pkgInfo.name}`);
return;
}

await fixDocs(outputDir, pkgInfo);
} finally {

signale.success(`generated docs for package ${pkgInfo.name}`);
} finally {
process.chdir(cwd);
}
}
2 changes: 1 addition & 1 deletion packages/xlucene-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"devDependencies": {
"@types/netmask": "^1.0.30",
"pegjs": "^0.10.0",
"ts-pegjs": "^0.2.7"
"ts-pegjs": "^0.3.0"
},
"engines": {
"node": ">=10.16.0"
Expand Down
Loading

0 comments on commit df0978e

Please sign in to comment.