You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-28
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
<palign="center"><imgsrc="https://github.com/stacksjs/dts-generation/blob/main/.github/art/cover.png?raw=true"alt="Social Card of this repo"></p>
1
+
<palign="center"><imgsrc="https://github.com/stacksjs/dtsx/blob/main/.github/art/cover.png?raw=true"alt="Social Card of this repo"></p>
- Fast .d.ts generation _(via isolatedDeclaration)_
12
12
- Highly configurable
13
13
- Cross-platform binary
14
-
- Dependency-free
15
-
- Bun-powered
14
+
- Lightweight & dependency-free library
16
15
17
16
## Install
18
17
@@ -25,35 +24,39 @@ [email protected], please allow us to use the `dtsx` package name 🙏_,
25
24
<!-- _Alternatively, you can install:_
26
25
27
26
```bash
28
-
brew install dts-generation # wip
29
-
pkgx install dts-generation # wip
27
+
brew install dtsx # wip
28
+
pkgx install dtsx # wip
30
29
``` -->
31
30
32
31
## Get Started
33
32
34
-
There are two ways of using this dts generation tool: _as a library or as a CLI._
33
+
There are two ways of using this ".d.ts generation" tool: _as a library or as a CLI._
35
34
36
35
### Library
37
36
38
-
Given the npm package is installed:
37
+
Given the npm package is installed, you can use the `generate` function to generate TypeScript declaration files from your project.
39
38
40
-
```js
41
-
import { generate } from'dts-generation'
39
+
#### Usage
42
40
43
-
generate()
44
-
```
45
-
46
-
### CLI
41
+
```ts
42
+
import { generate } from'@stacksjs/dtsx'
43
+
44
+
interfaceOptions {
45
+
cwd?:string// default: process.cwd()
46
+
root?:string// default: './src'
47
+
entrypoints?:string[] // default: ['**/*.ts']
48
+
outdir?:string// default: './dist'
49
+
keepComments?:boolean// default: true
50
+
clean?:boolean// default: false
51
+
tsconfigPath?:string// default: './tsconfig.json'
52
+
}
47
53
48
-
```bash
49
-
dts-generation ...
50
-
dts-generation --help
51
-
dts-generation --version
54
+
awaitgenerate(options?:Options)
52
55
```
53
56
54
-
## Configuration
57
+
_Available options:_
55
58
56
-
The Reverse Proxy can be configured using a `dts.config.ts`_(or `dts.config.js`)_ file and it will be automatically loaded when running the `dts-generation` command.
59
+
The library can configured using a `dts.config.ts`_(or `dts.config.js`)_ file and it will be automatically loaded when running the `./dtsx`_(or `bunx dtsx`)_ command.
57
60
58
61
```ts
59
62
// dts.config.ts (or dts.config.js)
@@ -70,10 +73,48 @@ export default {
70
73
_Then run:_
71
74
72
75
```bash
73
-
dts-generation generate
76
+
./dtsx generate
77
+
78
+
# or, you may use
79
+
# bunx dtsx generate
74
80
```
75
81
76
-
To learn more, head over to the [documentation](https://dts-generation.sh/).
82
+
### CLI
83
+
84
+
The `dtsx` CLI provides a simple way to generate TypeScript declaration files from your project. Here's how to use it:
85
+
86
+
#### Usage
87
+
88
+
Generate declaration files using the default options:
89
+
90
+
```bash
91
+
dtsx generate
92
+
```
93
+
94
+
_Or use custom options:_
95
+
96
+
```bash
97
+
# Generate declarations for specific entry points:
0 commit comments