diff --git a/package.json b/package.json index d3fc92b..b3d82a1 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "license": "MIT", "main": "./lib/CLI.js", "typings": "./lib/index.d.ts", - "version": "2.0.0-alpha-9", + "version": "2.0.0-alpha-10", "dependencies": { "chalk": "^2.3.0" }, diff --git a/src/Core/Actions/Typings.ts b/src/Core/Actions/Typings.ts index db07445..78d705c 100644 --- a/src/Core/Actions/Typings.ts +++ b/src/Core/Actions/Typings.ts @@ -43,16 +43,16 @@ class Script extends UpdateScript { await Promise.all(project.children.map(async child => { const dependencies = await this.gatherTypeDefinitions(project) dependencies.forEach(dependency => declarations.push(dependency)) - })) - - tsconfig.compilerOptions.types = declarations.sort() - - if (this.testing) { - this.log.task('tsconfig', JSON.stringify(tsconfig, null, 2)) - } else { - await project.save('tsconfig.json', tsconfig) - this.log.task('tsconfig') - } + })).then(async () => { + tsconfig.compilerOptions.types = declarations.sort() + + if (this.testing) { + this.log.task('tsconfig', JSON.stringify(tsconfig, null, 2)) + } else { + await project.save('tsconfig.json', tsconfig) + this.log.task('tsconfig') + } + }) } catch (error) { this.log.error(error) } @@ -74,9 +74,11 @@ class Script extends UpdateScript { return Promise.all(dependencies.map(async dependency => { const dependencyPath = Files.join(modulesPath, dependency, 'package.json') + this.log.debug('dependencies', dependencyPath) if (await Files.exists(dependencyPath)) { const npm = await Files.json(dependencyPath) if (npm.types || npm.typings) { + this.log.debug('found dependency', dependency) return dependency } }