@dtsx/tsdown 0.0.0-stage → 0.11.39
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 +41 -2
- package/dist/index.d.ts +17 -0
- package/dist/index.js +8 -0
- package/package.json +54 -4
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
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dtsx/tsdown
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A [tsdown](https://tsdown.dev) plugin that generates your declarations with dtsx: narrow inferred types, `@defaultValue` docs, and no `isolatedDeclarations` requirement.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @dtsx/tsdown -d
|
|
9
|
+
# or
|
|
10
|
+
npm install @dtsx/tsdown --save-dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// tsdown.config.ts
|
|
17
|
+
import { defineConfig } from 'tsdown'
|
|
18
|
+
import { dts } from '@dtsx/tsdown'
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
entry: ['src/index.ts'],
|
|
22
|
+
plugins: [dts()],
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The plugin turns off tsdown's own `dts` step and writes one declaration file next to each entry chunk, with the same name and format extension (`index.d.mts` beside `index.mjs`). tsdown keeps ownership of entries, output names and cleaning.
|
|
27
|
+
|
|
28
|
+
## Options
|
|
29
|
+
|
|
30
|
+
`dts()` takes the dtsx generation options except the ones tsdown owns (`entrypoints`, `outdir`, `bundle`, `bundleOutput`, `clean`, `dryRun`, `outputStructure`, `declarationMap`):
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
dts({
|
|
34
|
+
root: './src',
|
|
35
|
+
keepComments: true,
|
|
36
|
+
moduleSpecifierMode: 'node',
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## License
|
|
41
|
+
|
|
42
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { dts } from '@dtsx/dtsx/tsdown';
|
|
2
|
+
export type { DtsGenerationOption } from '@dtsx/dtsx';
|
|
3
|
+
export type { TsdownDeclarationPlugin, TsdownDtsOptions } from '@dtsx/dtsx/tsdown';
|
|
4
|
+
/**
|
|
5
|
+
* A tsdown plugin that writes declarations with dtsx instead of tsdown's own
|
|
6
|
+
* `dts` step. tsdown keeps ownership of entries, output names and cleaning.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { defineConfig } from 'tsdown'
|
|
11
|
+
* import { dts } from '@dtsx/tsdown'
|
|
12
|
+
*
|
|
13
|
+
* export default defineConfig({ entry: ['src/index.ts'], plugins: [dts()] })
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export { dts };
|
|
17
|
+
export default dts;
|
package/dist/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtsx/tsdown",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.11.39",
|
|
5
|
+
"description": "A tsdown plugin that generates your declarations with dtsx.",
|
|
6
|
+
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/stacksjs/dtsx/tree/main/packages/tsdown-plugin#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/stacksjs/dtsx.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/stacksjs/dtsx/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dts",
|
|
18
|
+
"dtsx",
|
|
19
|
+
"declarations",
|
|
20
|
+
"typescript",
|
|
21
|
+
"types",
|
|
22
|
+
"tsdown",
|
|
23
|
+
"plugin"
|
|
24
|
+
],
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"module": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"LICENSE.md",
|
|
35
|
+
"README.md",
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "bun build.ts",
|
|
40
|
+
"lint": "bunx --bun pickier run . --mode lint",
|
|
41
|
+
"lint:fix": "bunx --bun pickier run . --mode lint --fix",
|
|
42
|
+
"fresh": "bunx rimraf node_modules/ bun.lock && bun i",
|
|
43
|
+
"changelog": "bunx changelogen --output CHANGELOG.md",
|
|
44
|
+
"prepublishOnly": "bun --bun run build",
|
|
45
|
+
"release": "bun run changelog && bunx bumpp package.json --all",
|
|
46
|
+
"test": "bun test",
|
|
47
|
+
"typecheck": "bunx tsc --noEmit"
|
|
48
|
+
},
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@dtsx/dtsx": "0.11.39"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"tsdown": ">=0.23.0"
|
|
55
|
+
}
|
|
56
|
+
}
|