Skip to content

Commit

Permalink
Merge pull request #2409 from terascope/update-deps
Browse files Browse the repository at this point in the history
v0.71.2 - Update deps and docker image
  • Loading branch information
peterdemartini authored Jan 8, 2021
2 parents a953050 + 9a2e251 commit 64693fc
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 419 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM terascope/node-base:12.19.0
FROM terascope/node-base:12.20.1

ENV NODE_ENV production

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "teraslice-workspace",
"displayName": "Teraslice",
"version": "0.71.1",
"version": "0.71.2",
"private": true,
"homepage": "https://github.com/terascope/teraslice",
"bugs": {
Expand Down 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
6 changes: 3 additions & 3 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/eslint-config",
"displayName": "Terascope ESLint Config",
"version": "0.5.0",
"version": "0.5.1",
"description": "A shared eslint config based on eslint-config-airbnb",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/eslint-config#readme",
"bugs": {
Expand All @@ -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
6 changes: 3 additions & 3 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/scripts",
"displayName": "Scripts",
"version": "0.29.2",
"version": "0.29.3",
"description": "A collection of terascope monorepo scripts",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/scripts#readme",
"bugs": {
Expand Down Expand Up @@ -47,8 +47,8 @@
"semver": "^7.3.4",
"signale": "^1.4.0",
"sort-package-json": "~1.48.0",
"typedoc": "^0.19.2",
"typedoc-plugin-markdown": "^3.0.11",
"typedoc": "^0.20.13",
"typedoc-plugin-markdown": "^3.3.0",
"yargs": "^16.2.0"
},
"devDependencies": {
Expand Down
60 changes: 34 additions & 26 deletions packages/scripts/src/helpers/docs/typedoc.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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';

const app = new Application();


function isOverview(filePath: string): boolean {
return path.basename(filePath, '.md') === 'overview';
Expand All @@ -23,7 +25,7 @@ async function writeDocFile(filePath: string, { title, sidebarLabel }: { title:

// fix paths
contents = contents
.replace(/(\]\([\w\.\/]*)index\.md/g, '$1overview.md');
.replace(/(\]\([\w\.\/]*)README\.md/g, '$1overview.md');
// build final content
contents = `---
title: ${title}
Expand Down Expand Up @@ -51,10 +53,10 @@ function getAPIName(overview: string, outputDir: string, filePath: string) {
}

async function fixDocs(outputDir: string, { displayName }: PackageInfo) {
const overviewFilePath = listMdFiles(outputDir).find((filePath) => path.basename(filePath, '.md') === 'index');
const overviewFilePath = listMdFiles(outputDir).find((filePath) => path.basename(filePath, '.md') === 'README');
if (!overviewFilePath) {
signale.error(
'Error: Package documentation was not generated correctly',
'Error: Package documentation was not generated correctly' +
", this means the package my not work with the typedoc's version of TypeScript."
);
return;
Expand Down Expand Up @@ -82,48 +84,54 @@ async function fixDocs(outputDir: string, { displayName }: PackageInfo) {
await Promise.all(promises);
}

export async function generateTSDocs(pkgInfo: PackageInfo, outputDir: string) {


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);
const app = new Application();
app.options.addReader(new TSConfigReader());
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("entryPoints", app.expandInputFiles(['src']));

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/teraslice/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "teraslice",
"displayName": "Teraslice",
"version": "0.71.1",
"version": "0.71.2",
"description": "Distributed computing platform for processing JSON data",
"homepage": "https://github.com/terascope/teraslice#readme",
"bugs": {
Expand Down
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 64693fc

Please sign in to comment.