dts-bundle-generator
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -12,6 +12,8 @@ "use strict"; | ||
var compilerOptions = get_compiler_options_1.getCompilerOptions(rootFiles, preferredConfigPath); | ||
if (compilerOptions.outDir !== undefined) { | ||
logger_1.normalLog('Compiler option `outDir` is not supported and will be removed while generating dts'); | ||
compilerOptions.outDir = undefined; | ||
} | ||
// currently we don't support these compiler options | ||
// and removing them shouldn't affect generated code | ||
// so let's just remove them for this run | ||
compilerOptions.outDir = undefined; | ||
compilerOptions.incremental = undefined; | ||
compilerOptions.tsBuildInfoFile = undefined; | ||
var dtsFiles = getDeclarationFiles(rootFiles, compilerOptions); | ||
@@ -70,4 +72,11 @@ logger_1.verboseLog("dts cache:\n " + Object.keys(dtsFiles).join('\n ') + "\n"); | ||
var program = ts.createProgram(rootFiles, compilerOptions); | ||
var allFilesAreDeclarations = program.getSourceFiles().every(function (s) { return s.isDeclarationFile; }); | ||
var declarations = new Map(); | ||
if (allFilesAreDeclarations) { | ||
// if all files are declarations we don't need to compile the project twice | ||
// so let's just return empty map to speed up | ||
logger_1.verboseLog('Skipping compiling the project to generate d.ts because all files in it are d.ts already'); | ||
return declarations; | ||
} | ||
check_diagnostics_errors_1.checkProgramDiagnosticsErrors(program); | ||
var declarations = new Map(); | ||
var emitResult = program.emit(undefined, function (fileName, data) { return declarations.set(get_absolute_path_1.getAbsolutePath(fileName), data); }, undefined, true); | ||
@@ -74,0 +83,0 @@ check_diagnostics_errors_1.checkDiagnosticsErrors(emitResult.diagnostics, 'Errors while emitting declarations'); |
@@ -5,2 +5,3 @@ "use strict"; | ||
var path = require("path"); | ||
var get_absolute_path_1 = require("./helpers/get-absolute-path"); | ||
var fix_path_1 = require("./helpers/fix-path"); | ||
@@ -20,3 +21,3 @@ var check_diagnostics_errors_1 = require("./helpers/check-diagnostics-errors"); | ||
check_diagnostics_errors_1.checkDiagnosticsErrors(configParseResult.error !== undefined ? [configParseResult.error] : [], 'Error while processing tsconfig file'); | ||
var compilerOptionsParseResult = ts.parseJsonConfigFileContent(configParseResult.config, parseConfigHost, path.resolve(path.dirname(configFileName))); | ||
var compilerOptionsParseResult = ts.parseJsonConfigFileContent(configParseResult.config, parseConfigHost, path.resolve(path.dirname(configFileName)), undefined, get_absolute_path_1.getAbsolutePath(configFileName)); | ||
check_diagnostics_errors_1.checkDiagnosticsErrors(compilerOptionsParseResult.errors, 'Error while processing tsconfig compiler options'); | ||
@@ -23,0 +24,0 @@ return compilerOptionsParseResult.options; |
{ | ||
"name": "dts-bundle-generator", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "DTS Bundle Generator", | ||
@@ -15,3 +15,3 @@ "main": "bundle-generator.js", | ||
"typescript": ">=2.6.1", | ||
"yargs": "~13.2.2" | ||
"yargs": "~13.3.0" | ||
}, | ||
@@ -27,2 +27,2 @@ "license": "MIT", | ||
} | ||
} | ||
} |
@@ -5,3 +5,3 @@ <!-- markdownlint-disable MD033 --> | ||
<a href="https://github.com/timocov/dts-bundle-generator"> | ||
<img width="250px" height="250px" src=".github/logo.svg"> | ||
<img width="250px" height="250px" src="https://github.com/timocov/dts-bundle-generator/raw/master/.github/logo.svg?sanitize=true"> | ||
</a> | ||
@@ -12,4 +12,5 @@ </div> | ||
[![npm version](https://badge.fury.io/js/dts-bundle-generator.svg)](https://badge.fury.io/js/dts-bundle-generator) | ||
[![Build Status](https://travis-ci.org/timocov/dts-bundle-generator.svg?branch=master)](https://travis-ci.org/timocov/dts-bundle-generator) | ||
[![CircleCI][ci-img]][ci-link] | ||
[![npm version][npm-version-img]][npm-link] | ||
[![Downloads][npm-downloads-img]][npm-link] | ||
@@ -53,2 +54,3 @@ Small tool to generate a dts bundle from your ts code. | ||
1. Install the package from `npm`: | ||
```bash | ||
@@ -222,1 +224,8 @@ npm install --save-dev dts-bundle-generator | ||
``` | ||
[ci-img]: https://img.shields.io/circleci/build/github/timocov/dts-bundle-generator.svg | ||
[ci-link]: https://circleci.com/gh/timocov/dts-bundle-generator | ||
[npm-version-img]: https://badge.fury.io/js/dts-bundle-generator.svg | ||
[npm-downloads-img]: https://img.shields.io/npm/dm/dts-bundle-generator.svg | ||
[npm-link]: https://www.npmjs.com/package/dts-bundle-generator |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
76408
1471
228
+ Addedyargs@13.3.2(transitive)
- Removedcross-spawn@6.0.5(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedexeca@1.0.0(transitive)
- Removedget-stream@4.1.0(transitive)
- Removedinvert-kv@2.0.0(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedlcid@2.0.0(transitive)
- Removedmap-age-cleaner@0.1.3(transitive)
- Removedmem@4.3.0(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removednice-try@1.0.5(transitive)
- Removednpm-run-path@2.0.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-locale@3.1.0(transitive)
- Removedp-defer@1.0.0(transitive)
- Removedp-finally@1.0.0(transitive)
- Removedp-is-promise@2.1.0(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpump@3.0.2(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstrip-eof@1.0.0(transitive)
- Removedwhich@1.3.1(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyargs@13.2.4(transitive)
Updatedyargs@~13.3.0