bun-plugin-dtsx 0.21.11 → 0.21.13
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 +0 -1
- package/dist/index.js +25 -5
- package/package.json +24 -16
- package/dist/index.d.ts +0 -16
package/README.md
CHANGED
|
@@ -99,7 +99,6 @@ We would like to extend our thanks to the following sponsors for funding Stacks
|
|
|
99
99
|
|
|
100
100
|
Many thanks to the following core technologies & people who have contributed to this package:
|
|
101
101
|
|
|
102
|
-
- [Oxc](https://oxc.rs/)
|
|
103
102
|
- [Chris Breuer](https://github.com/chrisbbreuer)
|
|
104
103
|
- [All Contributors](../../contributors)
|
|
105
104
|
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/index.ts
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import path from "path";
|
|
3
5
|
import { generate } from "@stacksjs/dtsx";
|
|
4
|
-
function dts(options = {
|
|
6
|
+
function dts(options = {
|
|
7
|
+
root: "./src",
|
|
8
|
+
outdir: "./dist"
|
|
9
|
+
}) {
|
|
5
10
|
return {
|
|
6
11
|
name: "bun-plugin-dtsx",
|
|
7
12
|
async setup(build) {
|
|
8
13
|
const config = normalizeConfig(options, build);
|
|
14
|
+
if (config.clean && config.outdir) {
|
|
15
|
+
try {
|
|
16
|
+
fs.rmSync(config.outdir, { recursive: true, force: true });
|
|
17
|
+
} catch {}
|
|
18
|
+
fs.mkdirSync(config.outdir, { recursive: true });
|
|
19
|
+
}
|
|
9
20
|
await generate(config);
|
|
10
21
|
}
|
|
11
22
|
};
|
|
@@ -16,14 +27,23 @@ function normalizeConfig(options, build) {
|
|
|
16
27
|
if (!root) {
|
|
17
28
|
throw new Error("[bun-plugin-dtsx] Root directory is required");
|
|
18
29
|
}
|
|
30
|
+
const normalizedEntrypoints = options.entrypoints ?? build?.config?.entrypoints?.map((ep) => {
|
|
31
|
+
if (!ep)
|
|
32
|
+
return ep;
|
|
33
|
+
if (!path.isAbsolute(ep))
|
|
34
|
+
return ep;
|
|
35
|
+
return path.relative(root, ep);
|
|
36
|
+
});
|
|
19
37
|
return {
|
|
20
|
-
|
|
21
|
-
cwd: options.cwd,
|
|
38
|
+
cwd: options.cwd ?? root,
|
|
22
39
|
root,
|
|
23
|
-
entrypoints:
|
|
40
|
+
entrypoints: normalizedEntrypoints,
|
|
24
41
|
outdir,
|
|
42
|
+
keepComments: options.keepComments,
|
|
25
43
|
clean: options.clean,
|
|
26
|
-
tsconfigPath: options.tsconfigPath
|
|
44
|
+
tsconfigPath: options.tsconfigPath,
|
|
45
|
+
verbose: options.verbose,
|
|
46
|
+
outputStructure: options.outputStructure
|
|
27
47
|
};
|
|
28
48
|
}
|
|
29
49
|
var src_default = dts;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-plugin-dtsx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.21.
|
|
4
|
+
"version": "0.21.13",
|
|
5
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",
|
|
@@ -37,36 +37,44 @@
|
|
|
37
37
|
},
|
|
38
38
|
"module": "./dist/index.js",
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"files": [
|
|
40
|
+
"files": [
|
|
41
|
+
"LICENSE.md",
|
|
42
|
+
"README.md",
|
|
43
|
+
"dist"
|
|
44
|
+
],
|
|
41
45
|
"scripts": {
|
|
42
46
|
"build": "bun build.ts",
|
|
43
|
-
"lint": "bunx eslint .",
|
|
44
|
-
"lint:fix": "bunx eslint . --fix",
|
|
45
47
|
"fresh": "bunx rimraf node_modules/ bun.lock && bun i",
|
|
46
|
-
"
|
|
48
|
+
"lint": "bunx --bun eslint .",
|
|
49
|
+
"lint:fix": "bunx --bun eslint . --fix",
|
|
50
|
+
"changelog": "bunx logsmith --verbose",
|
|
51
|
+
"changelog:generate": "bunx logsmith --output CHANGELOG.md",
|
|
52
|
+
"release": "bun run changelog:generate && bunx --bun bumpx prompt --recursive",
|
|
53
|
+
"postinstall": "bunx git-hooks",
|
|
47
54
|
"prepublishOnly": "bun run build",
|
|
48
|
-
"release": "bun run changelog && bunx bumpp package.json --all",
|
|
49
55
|
"test": "bun test",
|
|
50
56
|
"typecheck": "bun tsc --noEmit"
|
|
51
57
|
},
|
|
52
58
|
"dependencies": {
|
|
53
|
-
"@stacksjs/dtsx": "^0.
|
|
59
|
+
"@stacksjs/dtsx": "^0.9.6"
|
|
54
60
|
},
|
|
55
61
|
"devDependencies": {
|
|
62
|
+
"@stacksjs/bumpx": "^0.2.2",
|
|
56
63
|
"@stacksjs/docs": "^0.70.23",
|
|
57
|
-
"@stacksjs/eslint-config": "^4.
|
|
58
|
-
"@stacksjs/gitlint": "^0.1.
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"typescript": "^5.
|
|
64
|
+
"@stacksjs/eslint-config": "^4.14.0-beta.3",
|
|
65
|
+
"@stacksjs/gitlint": "^0.1.5",
|
|
66
|
+
"@stacksjs/logsmith": "^0.2.1",
|
|
67
|
+
"@types/bun": "^1.3.1",
|
|
68
|
+
"buddy-bot": "^0.9.9",
|
|
69
|
+
"bun-git-hooks": "^0.3.1",
|
|
70
|
+
"typescript": "^5.9.3"
|
|
64
71
|
},
|
|
65
72
|
"git-hooks": {
|
|
66
73
|
"pre-commit": {
|
|
67
74
|
"staged-lint": {
|
|
68
|
-
"*.{js,ts}": "
|
|
75
|
+
"*.{js,ts,json,yaml,yml,md}": "bunx --bun eslint --fix"
|
|
69
76
|
}
|
|
70
|
-
}
|
|
77
|
+
},
|
|
78
|
+
"commit-msg": "bunx gitlint --edit .git/COMMIT_EDITMSG"
|
|
71
79
|
}
|
|
72
80
|
}
|
package/dist/index.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { BunPlugin } from 'bun';
|
|
2
|
-
import type { DtsGenerationOption } from '@stacksjs/dtsx';
|
|
3
|
-
|
|
4
|
-
export type { DtsGenerationOption }
|
|
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;
|
|
15
|
-
|
|
16
|
-
export default dts;
|