bun-plugin-dtsx 0.21.9 → 0.21.11

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 CHANGED
@@ -84,7 +84,7 @@ For casual chit-chat with others using this package:
84
84
 
85
85
  ## Postcardware
86
86
 
87
- You will always be free to use any of the Stacks OSS software. We would also love to see which parts of the world Stacks ends up in. _Receiving postcards makes us happy—and we will publish them on our website._
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,15 @@ import type { BunPlugin } from 'bun';
2
2
  import type { DtsGenerationOption } from '@stacksjs/dtsx';
3
3
 
4
4
  export type { DtsGenerationOption }
5
- export declare function dts(options?: DtsGenerationOption): BunPlugin;
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 = {}): BunPlugin;
14
+ declare function normalizeConfig(options: PluginConfig, build: PluginConfig['build']): DtsGenerationOption;
6
15
 
7
16
  export default dts;
package/dist/index.js CHANGED
@@ -1,28 +1,31 @@
1
1
  // @bun
2
2
  // src/index.ts
3
3
  import { generate } from "@stacksjs/dtsx";
4
- function dts(options) {
4
+ function dts(options = {}) {
5
5
  return {
6
6
  name: "bun-plugin-dtsx",
7
7
  async setup(build) {
8
- const cwd = options?.cwd;
9
- const root = options?.root || build.config.root;
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
- });
8
+ const config = normalizeConfig(options, build);
9
+ await generate(config);
23
10
  }
24
11
  };
25
12
  }
13
+ function normalizeConfig(options, build) {
14
+ const root = options.root || build?.config.root;
15
+ const outdir = options.outdir || build?.config.outdir;
16
+ if (!root) {
17
+ throw new Error("[bun-plugin-dtsx] Root directory is required");
18
+ }
19
+ return {
20
+ ...options,
21
+ cwd: options.cwd,
22
+ root,
23
+ entrypoints: options.entrypoints,
24
+ outdir,
25
+ clean: options.clean,
26
+ tsconfigPath: options.tsconfigPath
27
+ };
28
+ }
26
29
  var src_default = dts;
27
30
  export {
28
31
  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.9",
5
- "description": "A Bun Bundler plugin that auto generates your d.ts types extremely fast.",
4
+ "version": "0.21.11",
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.0"
53
+ "@stacksjs/dtsx": "^0.8.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@stacksjs/eslint-config": "^3.8.1-beta.2",
57
- "@types/bun": "^1.1.14",
58
- "bumpp": "^9.8.1",
59
- "changelogen": "^0.5.7",
60
- "lint-staged": "^15.2.10",
61
- "simple-git-hooks": "^2.11.1",
62
- "typescript": "^5.7.2"
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
- "simple-git-hooks": {
65
- "pre-commit": "bun lint-staged"
66
- },
67
- "lint-staged": {
68
- "*.{js,ts}": "bunx eslint . --fix"
65
+ "git-hooks": {
66
+ "pre-commit": {
67
+ "staged-lint": {
68
+ "*.{js,ts}": "gitlint && bunx --bun eslint . --fix"
69
+ }
70
+ }
69
71
  }
70
72
  }