Skip to content

Commit 915fc6f

Browse files
committed
chore: improve the readme
chore: wip
1 parent 6ba94b5 commit 915fc6f

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

README.md

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,56 @@ There are two ways of using this dts generation tool: _as a library or as a CLI.
3737

3838
Given the npm package is installed:
3939

40-
```js
41-
import { generate } from 'dts-generation'
40+
```ts
41+
import { generate } from '@stacksjs/dtsx'
42+
43+
interface Options {
44+
cwd?: string // default: process.cwd()
45+
root?: string // default: './src'
46+
entrypoints?: string[] // default: ['**/*.ts']
47+
outdir?: string // default: './dist'
48+
keepComments?: boolean // default: true
49+
clean?: boolean // default: false
50+
tsconfigPath?: string // default: './tsconfig.json'
51+
}
4252

43-
generate()
53+
await generate(options?: Options)
4454
```
4555

4656
### CLI
4757

58+
The `dtsx` CLI provides a simple way to generate TypeScript declaration files from your project. Here's how to use it:
59+
60+
#### Usage
61+
62+
Generate declaration files using default options:
63+
4864
```bash
49-
dts-generation ...
50-
dts-generation --help
51-
dts-generation --version
65+
dtsx generate
66+
67+
# Generate declarations for specific entry points:
68+
dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types
69+
70+
# Generate declarations with custom configuration:
71+
dtsx generate --root ./lib --outdir ./types --clean
72+
73+
dtsx --help
74+
dtsx --version
5275
```
5376

77+
_Available options:_
78+
79+
- `--cwd <path>`: Set the current working directory _(default: current directory)_
80+
- `--root <path>`: Specify the root directory of the project _(default: './src')_
81+
- `--entrypoints <files>`: Define entry point files _(comma-separated, default: '**/*.ts')_
82+
- `--outdir <path>`: Set the output directory for generated .d.ts files _(default: './dist')_
83+
- `--keep-comments`: Keep comments in generated .d.ts files _(default: true)_
84+
- `--clean`: Clean output directory before generation _(default: false)_
85+
- `--tsconfig <path>`: Specify the path to tsconfig.json _(default: 'tsconfig.json')_
86+
5487
## Configuration
5588

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.
89+
`dtsx` can be configured using a `dts.config.ts` _(or `dts.config.js`)_ file and it will be automatically loaded when running the `dtsx` command.
5790

5891
```ts
5992
// dts.config.ts (or dts.config.js)

0 commit comments

Comments
 (0)