bun-plugin-dtsx 0.21.9 → 0.21.12
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/README.md +1 -1
- package/dist/index.d.ts +13 -1
- package/dist/index.js +22 -16
- package/package.json +17 -15
package/README.md
CHANGED
|
@@ -84,7 +84,7 @@ For casual chit-chat with others using this package:
|
|
|
84
84
|
|
|
85
85
|
## Postcardware
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
“Software that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where `bun-plugin-dtsx` is being used! We showcase them on our website too.
|
|
88
88
|
|
|
89
89
|
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
|
|
90
90
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,18 @@ import type { BunPlugin } from 'bun';
|
|
|
2
2
|
import type { DtsGenerationOption } from '@stacksjs/dtsx';
|
|
3
3
|
|
|
4
4
|
export type { DtsGenerationOption }
|
|
5
|
-
|
|
5
|
+
declare interface PluginConfig extends DtsGenerationOption {
|
|
6
|
+
build?: {
|
|
7
|
+
config: {
|
|
8
|
+
root?: string
|
|
9
|
+
outdir?: string
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export declare function dts(options: PluginConfig = {
|
|
14
|
+
root: './src',
|
|
15
|
+
outdir: './dist',
|
|
16
|
+
}): BunPlugin;
|
|
17
|
+
declare function normalizeConfig(options: PluginConfig, build: PluginConfig['build']): DtsGenerationOption;
|
|
6
18
|
|
|
7
19
|
export default dts;
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/index.ts
|
|
3
3
|
import { generate } from "@stacksjs/dtsx";
|
|
4
|
-
function dts(options
|
|
4
|
+
function dts(options = {
|
|
5
|
+
root: "./src",
|
|
6
|
+
outdir: "./dist"
|
|
7
|
+
}) {
|
|
5
8
|
return {
|
|
6
9
|
name: "bun-plugin-dtsx",
|
|
7
10
|
async setup(build) {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const entrypoints = options?.entrypoints;
|
|
11
|
-
const outdir = options?.outdir || build.config.outdir;
|
|
12
|
-
const clean = options?.clean;
|
|
13
|
-
const tsconfigPath = options?.tsconfigPath;
|
|
14
|
-
await generate({
|
|
15
|
-
...options,
|
|
16
|
-
cwd,
|
|
17
|
-
root,
|
|
18
|
-
entrypoints,
|
|
19
|
-
outdir,
|
|
20
|
-
clean,
|
|
21
|
-
tsconfigPath
|
|
22
|
-
});
|
|
11
|
+
const config = normalizeConfig(options, build);
|
|
12
|
+
await generate(config);
|
|
23
13
|
}
|
|
24
14
|
};
|
|
25
15
|
}
|
|
16
|
+
function normalizeConfig(options, build) {
|
|
17
|
+
const root = options.root || build?.config.root;
|
|
18
|
+
const outdir = options.outdir || build?.config.outdir;
|
|
19
|
+
if (!root) {
|
|
20
|
+
throw new Error("[bun-plugin-dtsx] Root directory is required");
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
...options,
|
|
24
|
+
cwd: options.cwd,
|
|
25
|
+
root,
|
|
26
|
+
entrypoints: options.entrypoints,
|
|
27
|
+
outdir,
|
|
28
|
+
clean: options.clean,
|
|
29
|
+
tsconfigPath: options.tsconfigPath
|
|
30
|
+
};
|
|
31
|
+
}
|
|
26
32
|
var src_default = dts;
|
|
27
33
|
export {
|
|
28
34
|
dts,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-plugin-dtsx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.21.
|
|
5
|
-
"description": "A Bun Bundler plugin that auto generates your
|
|
4
|
+
"version": "0.21.12",
|
|
5
|
+
"description": "A Bun Bundler plugin that auto generates your DTS types extremely fast.",
|
|
6
6
|
"author": "Chris Breuer <chris@ow3.org>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"homepage": "https://github.com/stacksjs/bun-plugin-dtsx#readme",
|
|
@@ -50,21 +50,23 @@
|
|
|
50
50
|
"typecheck": "bun tsc --noEmit"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@stacksjs/dtsx": "^0.8.
|
|
53
|
+
"@stacksjs/dtsx": "^0.8.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@stacksjs/
|
|
57
|
-
"@
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
56
|
+
"@stacksjs/docs": "^0.70.23",
|
|
57
|
+
"@stacksjs/eslint-config": "^4.10.2-beta.3",
|
|
58
|
+
"@stacksjs/gitlint": "^0.1.3",
|
|
59
|
+
"@types/bun": "^1.2.11",
|
|
60
|
+
"bumpp": "^10.1.0",
|
|
61
|
+
"bun-git-hooks": "^0.2.15",
|
|
62
|
+
"changelogen": "^0.6.1",
|
|
63
|
+
"typescript": "^5.8.3"
|
|
63
64
|
},
|
|
64
|
-
"
|
|
65
|
-
"pre-commit":
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
"git-hooks": {
|
|
66
|
+
"pre-commit": {
|
|
67
|
+
"staged-lint": {
|
|
68
|
+
"*.{js,ts}": "gitlint && bunx --bun eslint . --fix"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
69
71
|
}
|
|
70
72
|
}
|