Coder Social home page Coder Social logo

stacksjs / bun-plugin-dts-auto Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 0.0 1.66 MB

Automatically generate your TypeScript dts types (and sourcemaps), using Bun's bundler.

License: MIT License

TypeScript 57.35% JavaScript 42.65%
bun dts generation types bun-plugin sourcemaps

bun-plugin-dts-auto's Introduction

Social Card of Bun Plugin DTS Auto

bun-plugin-dts-auto

npm version GitHub Actions Commitizen friendly npm downloads

This Bun plugin generates dts files for your TypeScript project.

Features

  • Automatic dts generation based on your entrypoints
  • Support for source map generations
  • Honors & inherits your tsconfig.json settings

Usage

bun install -d bun-plugin-dts-auto

You may now use the plugin:

import dts from 'bun-plugin-dts-auto'

await Bun.build({
  root: './src', // optional

  entrypoints: [
    'src/index.ts',
  ],

  outdir: './dist',

  plugins: [
    dts({
      cwd: import.meta.dir, // optional
      rootDir: `${import.meta.dir}/src`, // optional
      withSourceMap: true, // optional
      outdir: 'dist/types', // optional
    }),
  ],
})

console.log('Build complete ✅')

Note

Please note, this plugin honors your tsconfig.json compilerOptions.outDir setting. If you want to override this, you can do so by setting the outdir, rootDir, and cwd option in the build object.

Testing

bun test

Changelog

Please see our releases page for more information on what has changed recently.

Contributing

Please review the Contributing Guide for details.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discussions on GitHub

For casual chit-chat with others using this package:

Join the Stacks Discord Server

Postcardware

You will always be free to use any of the Stacks OSS software. We would also love to see which parts of the world Stacks ends up in. Receiving postcards makes us happy—and we will publish them on our website.

Our address: Stacks.js, 5710 Crescent Park #107, Playa Vista 90094, CA.

Sponsors

We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.

Credits

Many thanks to the following core technologies & people who have contributed to this package:

License

The MIT License (MIT). Please see LICENSE for more information.

Made with 💙

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.