bun-plugin-dtsx 0.9.4
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/dist/index.d.ts +21 -0
- package/dist/index.js +37 -0
- package/package.json +54 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BunPlugin } from 'bun';
|
|
2
|
+
import type { DtsGenerationOption } from '@stacksjs/dtsx';
|
|
3
|
+
export type { DtsGenerationOption };
|
|
4
|
+
/**
|
|
5
|
+
* Creates a Bun plugin for generating TypeScript declaration files
|
|
6
|
+
* @param options - Configuration options for DTS generation
|
|
7
|
+
* @returns BunPlugin instance
|
|
8
|
+
*/
|
|
9
|
+
export declare function dts(options?: PluginConfig): BunPlugin;
|
|
10
|
+
/**
|
|
11
|
+
* Configuration interface extending DtsGenerationOption with build-specific properties
|
|
12
|
+
*/
|
|
13
|
+
declare interface PluginConfig extends DtsGenerationOption {
|
|
14
|
+
build?: {
|
|
15
|
+
config: {
|
|
16
|
+
root?: string
|
|
17
|
+
outdir?: string
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export default dts;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/index.ts
|
|
3
|
+
import process from "process";
|
|
4
|
+
import { generate } from "@stacksjs/dtsx";
|
|
5
|
+
function dts(options = {
|
|
6
|
+
root: "./src",
|
|
7
|
+
outdir: "./dist"
|
|
8
|
+
}) {
|
|
9
|
+
return {
|
|
10
|
+
name: "bun-plugin-dtsx",
|
|
11
|
+
async setup(build) {
|
|
12
|
+
const config = normalizeConfig(options, build);
|
|
13
|
+
await generate(config);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function normalizeConfig(options, build) {
|
|
18
|
+
const root = options.root || build?.config.root;
|
|
19
|
+
const outdir = options.outdir || build?.config.outdir;
|
|
20
|
+
if (!root) {
|
|
21
|
+
throw new Error("[bun-plugin-dtsx] Root directory is required");
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
...options,
|
|
25
|
+
cwd: options.cwd || process.cwd(),
|
|
26
|
+
root,
|
|
27
|
+
entrypoints: options.entrypoints || ["**/*.ts"],
|
|
28
|
+
outdir,
|
|
29
|
+
clean: options.clean,
|
|
30
|
+
tsconfigPath: options.tsconfigPath
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
var src_default = dts;
|
|
34
|
+
export {
|
|
35
|
+
dts,
|
|
36
|
+
src_default as default
|
|
37
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "bun-plugin-dtsx",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.9.4",
|
|
5
|
+
"description": "A Bun Bundler plugin that auto generates your DTS types extremely fast.",
|
|
6
|
+
"author": "Chris Breuer <chris@ow3.org>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/stacksjs/dtsx/tree/main/packages/bun-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/bun-plugin-dtsx/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dts",
|
|
18
|
+
"dtsx",
|
|
19
|
+
"emit",
|
|
20
|
+
"generation",
|
|
21
|
+
"typescript",
|
|
22
|
+
"types",
|
|
23
|
+
"auto",
|
|
24
|
+
"stacks",
|
|
25
|
+
"bun",
|
|
26
|
+
"plugin",
|
|
27
|
+
"package"
|
|
28
|
+
],
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./*": {
|
|
35
|
+
"import": "./dist/*"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"module": "./dist/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"files": [
|
|
41
|
+
"LICENSE.md",
|
|
42
|
+
"README.md",
|
|
43
|
+
"dist"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "bun build.ts",
|
|
47
|
+
"prepublishOnly": "bun run build",
|
|
48
|
+
"test": "bun test",
|
|
49
|
+
"typecheck": "bun tsc --noEmit"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@stacksjs/dtsx": "0.8.3"
|
|
53
|
+
}
|
|
54
|
+
}
|