bun-plugin-dtsx 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +121 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1750 -0
- package/package.json +80 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Open Web Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![GitHub Actions][github-actions-src]][github-actions-href]
|
|
5
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
6
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
7
|
+
<!-- [![Codecov][codecov-src]][codecov-href] -->
|
|
8
|
+
|
|
9
|
+
This Bun plugin generates dts files for your TypeScript projects.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Automatic & fast dts generation
|
|
14
|
+
- Powered by Bun & isolatedDeclarations
|
|
15
|
+
- Monorepo support
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bun install -d bun-plugin-dtsx
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
You may now use the plugin:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import dts from 'bun-plugin-dtsx'
|
|
27
|
+
// if you prefer named imports
|
|
28
|
+
// import { dts } from 'bun-plugin-dtsx'
|
|
29
|
+
|
|
30
|
+
await Bun.build({
|
|
31
|
+
root: './src',
|
|
32
|
+
entrypoints: [
|
|
33
|
+
'src/index.ts',
|
|
34
|
+
],
|
|
35
|
+
outdir: './dist',
|
|
36
|
+
plugins: [
|
|
37
|
+
dts({
|
|
38
|
+
cwd: './', // optional, default: process.cwd()
|
|
39
|
+
root: './src', // optional, default: './src'
|
|
40
|
+
outdir: './dist/types', // optional, default: './dist'
|
|
41
|
+
keepComments: true, // optional, default: true
|
|
42
|
+
tsconfigPath: './tsconfig.json', // optional, default: './tsconfig.json'
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
console.log('Build complete ✅')
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
The `dts` plugin accepts an options object with the following properties:
|
|
53
|
+
|
|
54
|
+
- `cwd`: The current working directory _(optional, default: `process.cwd()`)_
|
|
55
|
+
- `root`: The root directory of your TypeScript files _(optional, default: `'src'`)_
|
|
56
|
+
- `outdir`: The output directory for generated declaration files _(optional, default: `'./dist'`)_
|
|
57
|
+
- `entrypoints`: An array or glob of file paths, or a single file path, to process _(optional, if not specified, defaults to build entrypoints)_
|
|
58
|
+
- `keepComments`: Whether to keep comments in the generated dts files _(optional, default: `true`)_
|
|
59
|
+
- `tsconfigPath`: The path to your tsconfig file _(optional, default: `'./tsconfig.json'`)_
|
|
60
|
+
|
|
61
|
+
## Testing
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
bun test
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Changelog
|
|
68
|
+
|
|
69
|
+
Please see our [releases](https://github.com/stacksjs/bun-plugin-dtsx/releases) page for more information on what has changed recently.
|
|
70
|
+
|
|
71
|
+
## Contributing
|
|
72
|
+
|
|
73
|
+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
|
|
74
|
+
|
|
75
|
+
## Community
|
|
76
|
+
|
|
77
|
+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
|
|
78
|
+
|
|
79
|
+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
|
|
80
|
+
|
|
81
|
+
For casual chit-chat with others using this package:
|
|
82
|
+
|
|
83
|
+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
|
|
84
|
+
|
|
85
|
+
## Postcardware
|
|
86
|
+
|
|
87
|
+
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._
|
|
88
|
+
|
|
89
|
+
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
|
|
90
|
+
|
|
91
|
+
## Sponsors
|
|
92
|
+
|
|
93
|
+
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.
|
|
94
|
+
|
|
95
|
+
- [JetBrains](https://www.jetbrains.com/)
|
|
96
|
+
- [The Solana Foundation](https://solana.com/)
|
|
97
|
+
|
|
98
|
+
## Credits
|
|
99
|
+
|
|
100
|
+
Many thanks to the following core technologies & people who have contributed to this package:
|
|
101
|
+
|
|
102
|
+
- [Oxc](https://oxc.rs/)
|
|
103
|
+
- [Chris Breuer](https://github.com/chrisbbreuer)
|
|
104
|
+
- [All Contributors](../../contributors)
|
|
105
|
+
|
|
106
|
+
## License
|
|
107
|
+
|
|
108
|
+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/bun-plugin-dtsx/tree/main/LICENSE.md) for more information.
|
|
109
|
+
|
|
110
|
+
Made with 💙
|
|
111
|
+
|
|
112
|
+
<!-- Badges -->
|
|
113
|
+
[npm-version-src]: <https://img.shields.io/npm/v/bun-plugin-dtsx?style=flat-square>
|
|
114
|
+
[npm-version-href]: <https://npmjs.com/package/bun-plugin-dtsx>
|
|
115
|
+
[npm-downloads-src]: <https://img.shields.io/npm/dm/bun-plugin-dtsx?style=flat-square>
|
|
116
|
+
[npm-downloads-href]: <https://npmjs.com/package/bun-plugin-dtsx>
|
|
117
|
+
[github-actions-src]: <https://img.shields.io/github/actions/workflow/status/stacksjs/bun-plugin-dtsx/ci.yml?style=flat-square&branch=main>
|
|
118
|
+
[github-actions-href]: <https://github.com/stacksjs/bun-plugin-dtsx/actions?query=workflow%3Aci>
|
|
119
|
+
|
|
120
|
+
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/bun-plugin-dtsx/main?style=flat-square
|
|
121
|
+
[codecov-href]: https://codecov.io/gh/stacksjs/bun-plugin-dtsx -->
|