Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
22 changes: 12 additions & 10 deletions src/Core/Actions/Typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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<NPM>(dependencyPath)
if (npm.types || npm.typings) {
this.log.debug('found dependency', dependency)
return dependency
}
}
Expand Down