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
description: General information based on the latest ./README.md content
3
+
globs:
4
+
---
5
+
Update it if APIs change:
6
+
7
+
# dtsx
8
+
9
+
> A library that helps you generate TypeScript declaration files from your project. Given we do not know the user's input ever, we need to never hardcode based results based from our examples, always create a dynamic solution.
10
+
11
+
## Features
12
+
13
+
- ⚡ Extremely fast .d.ts generation
14
+
- ⚙️ Highly configurable
15
+
- 🪶 Lightweight library
16
+
- 🤖 Cross-platform binary
17
+
18
+
## Install
19
+
20
+
```bash
21
+
bun install -d @stacksjs/dtsx
22
+
```
23
+
24
+
<[email protected]>, please allow us to use the `dtsx` package name 🙏_
25
+
26
+
<!-- _Alternatively, you can install:_
27
+
28
+
```bash
29
+
brew install dtsx # wip
30
+
pkgx install dtsx # wip
31
+
``` -->
32
+
33
+
## Get Started
34
+
35
+
There are two ways of using this ".d.ts generation" tool: _as a library or as a CLI._
36
+
37
+
_But before you get started, please ensure you enabled `isolatedDeclarations` in your `tsconfig.json` file._
38
+
39
+
```json
40
+
{
41
+
"compilerOptions": {
42
+
"isolatedDeclarations": true
43
+
}
44
+
}
45
+
```
46
+
47
+
## Library
48
+
49
+
Given the npm package is installed, you can use the `generate` function to generate TypeScript declaration files from your project.
50
+
51
+
### Usage
52
+
53
+
```ts
54
+
import type { DtsGenerationOptions } from '@stacksjs/dtsx'
55
+
import { generate } from '@stacksjs/dtsx'
56
+
57
+
const options: DtsGenerationOptions = {
58
+
cwd: './', // default: process.cwd()
59
+
root: './src', // default: './src'
60
+
entrypoints: ['**/*.ts'], // default: ['**/*.ts']
61
+
outdir: './dist', // default: './dist'
62
+
clean: true, // default: false
63
+
verbose: true, // default: false
64
+
// keepComments: true, // coming soon
65
+
}
66
+
67
+
await generate(options)
68
+
```
69
+
70
+
_Available options:_
71
+
72
+
Library usage can also be configured using a `dts.config.ts` _(or `dts.config.js`)_ file which is automatically loaded when running the `./dtsx` _(or `bunx dtsx`)_ command. It is also loaded when the `generate` function is called, unless custom options are provided.
73
+
74
+
```ts
75
+
// dts.config.ts (or dts.config.js)
76
+
77
+
export default {
78
+
cwd: './',
79
+
root: './src',
80
+
entrypoints: ['**/*.ts'],
81
+
outdir: './dist',
82
+
keepComments: true,
83
+
clean: true,
84
+
verbose: true,
85
+
}
86
+
```
87
+
88
+
_You may also run:_
89
+
90
+
```bash
91
+
./dtsx generate
92
+
93
+
# if the package is installed, you can also run:
94
+
# bunx dtsx generate
95
+
```
96
+
97
+
## CLI
98
+
99
+
The `dtsx` CLI provides a simple way to generate TypeScript declaration files from your project. Here's how to use it:
100
+
101
+
### Usage
102
+
103
+
Generate declaration files using the default options:
104
+
105
+
```bash
106
+
dtsx generate
107
+
```
108
+
109
+
_Or use custom options:_
110
+
111
+
```bash
112
+
# Generate declarations for specific entry points:
> A library that helps you generate TypeScript declaration files from your project. Given we do not know the user's input ever, we need to never hardcode based results based from our examples, always create a dynamic solution.
12
+
9
13
## Features
10
14
11
15
- ⚡ Extremely fast .d.ts generation
@@ -19,7 +23,7 @@
19
23
bun install -d @stacksjs/dtsx
20
24
```
21
25
22
-
_@npmjs.com, please allow us to use the `dtsx` package name 🙏_
26
+
<[email protected]>, please allow us to use the `dtsx` package name 🙏_
23
27
24
28
<!-- _Alternatively, you can install:_
25
29
@@ -156,9 +160,9 @@ For casual chit-chat with others using this package:
156
160
157
161
## Postcardware
158
162
159
-
Two things are true: Stacks OSS will always stay open-source, and we do love to receive postcards from wherever Stacks is used! 🌍 _We also publish them on our website. And thank you, Spatie_
163
+
“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `dtsx` is being used! We showcase them on our website too.
160
164
161
-
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094
165
+
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
0 commit comments