Socket
Socket
Sign inDemoInstall

dts-bundle-generator

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dts-bundle-generator - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

19

compile-dts.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc