Gathering detailed insights and metrics for @lang/rollup-plugin-dts
Gathering detailed insights and metrics for @lang/rollup-plugin-dts
Gathering detailed insights and metrics for @lang/rollup-plugin-dts
Gathering detailed insights and metrics for @lang/rollup-plugin-dts
npm install @lang/rollup-plugin-dts
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
815 Stars
605 Commits
71 Forks
6 Watching
4 Branches
45 Contributors
Updated on 28 Nov 2024
Minified
Minified + Gzipped
TypeScript (95.28%)
JavaScript (4.72%)
Cumulative downloads
Total Downloads
Last day
-23.6%
204
Compared to previous day
Last week
-9.7%
1,163
Compared to previous week
Last month
10.1%
5,509
Compared to previous month
Last year
92.7%
55,820
Compared to previous year
2
2
16
1
This is a plugin that lets you roll-up your .d.ts
definition files.
Install the package from npm
:
$ npm install --save-dev rollup-plugin-dts
Add it to your rollup.config.js
:
1import { dts } from "rollup-plugin-dts"; 2 3const config = [ 4 // … 5 { 6 input: "./my-input/index.d.ts", 7 output: [{ file: "dist/my-library.d.ts", format: "es" }], 8 plugins: [dts()], 9 }, 10]; 11 12export default config;
NOTE A default import of the plugin using import dts from "rollup-plugin-dts";
is still supported for existing implementations of this package. However, a named import is suggested to avoid the error [!] TypeError: dts is not a function
12 in certain rollup config file implementations.
And then instruct typescript where to find your definitions inside your package.json
:
1 "types": "dist/my-library.d.ts",
NOTE that the plugin will automatically mark any external library
(@types
for example) as external
, so those will be excluded from bundling.
This project is in maintenance mode. That means there will be no more active feature development. There will still be occasional releases to maintain compatibility with future TypeScript releases. Pull Requests are always welcome, however reaction time on both Issues and PRs can be slow.
While this plugin is fairly complete, it does not support all imaginable use-cases.
In particular, the plugin works best with already existing .d.ts
files generated
by the typescript compiler from idiomatic code.
Working with .ts(x)
or even .js(x)
(when setting allowJs: true
) does work,
but is not recommended.
The plugin does its own import resolution through the typescript compiler, and
usage together with other resolution plugins, such as node-resolve
can lead
to errors and is not recommended.
All external dependencies from node_modules
are automatically excluded from
bundling. This can be overridden using the respectExternal
setting, but it is
generally not recommended. While rollup of external @types
generally works,
it is not recommended.
Well, ideally TypeScript should just do all this itself, and it even has a proposal to do that. But there hasn’t been any progress in ~3 years.
Some projects, like rollup itself go the route of completely separating their public interfaces in a separate file.
See some discussions about some of these projects and their tradeoffs.
The code is licensed under the copyleft LGPL-3.0. I have no intention to license this under any non-copyleft license.
StackOverflow thread of issue ↩
No vulnerabilities found.
Reason
19 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 4/29 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More