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
> 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.
11
+
> A blazing-fast TypeScript declaration file (.d.ts) generator with advanced features like incremental builds, watch mode, bundling, and IDE integration.
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.
75
80
76
81
```ts
77
82
// dts.config.ts (or dts.config.js)
83
+
import { defineConfig } from'@stacksjs/dtsx'
78
84
79
-
exportdefault {
85
+
exportdefaultdefineConfig({
80
86
cwd: './',
81
87
root: './src',
82
88
entrypoints: ['**/*.ts'],
83
89
outdir: './dist',
84
90
keepComments: true,
85
91
clean: true,
86
92
verbose: true,
87
-
}
93
+
94
+
// Advanced options
95
+
watch: false, // Enable watch mode
96
+
incremental: false, // Enable incremental builds
97
+
parallel: false, // Enable parallel processing
98
+
concurrency: 4, // Number of parallel workers
99
+
100
+
// Bundling
101
+
bundle: false, // Bundle all declarations into one file
102
+
bundleOutput: 'index.d.ts', // Output filename when bundling
103
+
104
+
// Output formatting
105
+
prettier: false, // Use Prettier for formatting
106
+
indentStyle: 'spaces', // 'spaces' or 'tabs'
107
+
indentSize: 2, // Number of spaces
108
+
109
+
// Plugins
110
+
plugins: [],
111
+
})
88
112
```
89
113
90
114
_You may also run:_
@@ -98,9 +122,11 @@ _You may also run:_
98
122
99
123
## CLI
100
124
101
-
The `dtsx` CLI provides a simple way to generate TypeScript declaration files from your project. Here's how to use it:
125
+
The `dtsx` CLI provides a comprehensive set of commands for generating and managing TypeScript declaration files.
102
126
103
-
### Usage
127
+
### Commands
128
+
129
+
#### Generate Declarations
104
130
105
131
Generate declaration files using the default options:
106
132
@@ -111,29 +137,228 @@ dtsx generate
111
137
_Or use custom options:_
112
138
113
139
```bash
114
-
# Generate declarations for specific entry points:
-[Architecture Guide](../../ARCHITECTURE.md) - How dtsx works internally
357
+
-[Contributing Guide](../../CONTRIBUTING.md) - How to contribute to dtsx
358
+
-[Performance Guide](../../PERFORMANCE.md) - Tips for optimizing large codebases
359
+
-[Migration Guide](../../MIGRATION.md) - Migrating from other tools
360
+
-[Troubleshooting](../../TROUBLESHOOTING.md) - Common issues and solutions
361
+
137
362
## Testing
138
363
139
364
```bash
@@ -160,7 +385,7 @@ For casual chit-chat with others using this package:
160
385
161
386
## Postcardware
162
387
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.
388
+
"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.
164
389
165
390
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
0 commit comments