aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/utils
diff options
context:
space:
mode:
authorKadinsky <kandinsky454@protonmail.ch>2018-10-16 21:21:46 +0800
committerGitHub <noreply@github.com>2018-10-16 21:21:46 +0800
commite62458705039f6a187ff23e4e4ee1737476eb431 (patch)
tree27497ebaf0e7da27561620b28b28cc30833261fc /packages/monorepo-scripts/src/utils
parent05bf7a8280bcb46144dfef9b30bb7c0e2e4a15aa (diff)
parent5938e8a52daa913668593977e44ca25e38a29e41 (diff)
downloaddexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar.gz
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar.bz2
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar.lz
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar.xz
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.tar.zst
dexon-0x-contracts-e62458705039f6a187ff23e4e4ee1737476eb431.zip
Merge pull request #1105 from 0xProject/feature/contracts-artifacts-re-org
Reorganize and modularize generated contract wrappers and artifacts
Diffstat (limited to 'packages/monorepo-scripts/src/utils')
-rw-r--r--packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
index de52b3a47..4fea94414 100644
--- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
+++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts
@@ -1,4 +1,4 @@
-import { readFileSync, writeFileSync } from 'fs';
+import { existsSync, readFileSync, writeFileSync } from 'fs';
import * as _ from 'lodash';
import * as path from 'path';
import { exec as execAsync } from 'promisify-child-process';
@@ -103,6 +103,9 @@ export class DocGenerateAndUploadUtils {
switch (node.kind) {
case ts.SyntaxKind.ExportDeclaration: {
const exportClause = (node as any).exportClause;
+ if (_.isUndefined(exportClause)) {
+ return;
+ }
const exportPath = exportClause.parent.moduleSpecifier.text;
_.each(exportClause.elements, element => {
const exportItem = element.name.escapedText;
@@ -187,7 +190,11 @@ export class DocGenerateAndUploadUtils {
const typeDocExtraFileIncludes: string[] = this._getTypeDocFileIncludesForPackage();
// In order to avoid TS errors, we need to pass TypeDoc the package's global.d.ts file
- typeDocExtraFileIncludes.push(path.join(this._packagePath, 'src', 'globals.d.ts'));
+ // if it exists.
+ const globalTypeDefinitionsPath = path.join(this._packagePath, 'src', 'globals.d.ts');
+ if (existsSync(globalTypeDefinitionsPath)) {
+ typeDocExtraFileIncludes.push(globalTypeDefinitionsPath);
+ }
utils.log(`GENERATE_UPLOAD_DOCS: Generating Typedoc JSON for ${this._packageName}...`);
const jsonFilePath = path.join(this._packagePath, 'generated_docs', 'index.json');