From 24673be1cd2ec0b86ecb9b8b5eb8f69197e763d1 Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Fri, 12 Oct 2018 14:59:47 -0700 Subject: Add resolveJsonModule: true to test_installation.ts --- packages/monorepo-scripts/src/test_installation.ts | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/monorepo-scripts') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index be39b1878..f272c9292 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -132,6 +132,7 @@ async function testInstallPackageAsync( noImplicitReturns: true, pretty: true, strict: true, + resolveJsonModule: true, }, include: ['index.ts'], }; -- cgit v1.2.3 From f0e483798339b24b599c408949265cca54d7e58b Mon Sep 17 00:00:00 2001 From: Alex Browne Date: Mon, 15 Oct 2018 13:30:12 -0700 Subject: Fix failing doc generation tests --- .../src/utils/doc_generate_and_upload_utils.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'packages/monorepo-scripts') 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'); -- cgit v1.2.3 From 8cffe65047ed193b52ccacc346ce8ad1983f02f4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 16 Oct 2018 13:22:15 +0100 Subject: fix(monorepo-scripts): Move the creation of the `.installation-test` directory OUTSIDE of the monorepo root, so that the installed packages can't reference the hoisted node_modules folder --- packages/monorepo-scripts/src/test_installation.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'packages/monorepo-scripts') diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index f272c9292..9ef9e829b 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -104,13 +104,7 @@ async function testInstallPackageAsync( const packageName = installablePackage.packageJson.name; utils.log(`Testing ${packageName}@${lastChangelogVersion}`); const packageDirName = path.join(...(packageName + '-test').split('/')); - const testDirectory = path.join( - monorepoRootPath, - 'packages', - 'monorepo-scripts', - '.installation-test', - packageDirName, - ); + const testDirectory = path.join(monorepoRootPath, '..', '.installation-test', packageDirName); await rimrafAsync(testDirectory); await mkdirpAsync(testDirectory); await execAsync('yarn init --yes', { cwd: testDirectory }); -- cgit v1.2.3