Skip to content

Commit e078e29

Browse files
committed
fix(*): use src files to prevent dts bundling
fix #1
1 parent b89c2e3 commit e078e29

File tree

7 files changed

+11
-74
lines changed

7 files changed

+11
-74
lines changed

bun.lockb

78.2 KB
Binary file not shown.

packages/core/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
"main": "dist/index.js",
77
"module": "dist/index.js",
8-
"files": ["dist"],
9-
"types": "dist/index.d.ts",
8+
"files": ["dist", "src"],
9+
"types": "src/index.ts",
1010

1111
"devDependencies": {
1212
"@sirutils/builder": "workspace:*"

packages/seql/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22
"name": "@sirutils/seql",
33
"version": "0.0.1",
44
"type": "module",
5+
56
"main": "dist/index.js",
67
"module": "dist/index.js",
7-
"files": ["dist", "definitions"],
8-
"types": "dist/index.d.ts",
8+
"files": ["dist", "src"],
9+
"types": "src/index.ts",
10+
911
"devDependencies": {
1012
"@sirutils/builder": "workspace:*"
1113
},

tools/builder/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"name": "@sirutils/builder",
33
"type": "module",
44
"version": "0.0.1",
5+
56
"bin": {
67
"builder": "./command.js"
78
},
89

910
"main": "dist/index.js",
1011
"module": "dist/index.js",
11-
"types": "dist/index.d.ts",
12-
"files": ["dist", "./command.js"],
12+
"types": "src/index.ts",
13+
"files": ["dist", "./command.js", "src"],
1314

1415
"devDependencies": {},
1516
"dependencies": {

tools/builder/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ program
2626
if (options.watch) {
2727
watch(options.cwd, { recursive: true }, async (event, filename) => {
2828
if (typeof filename === 'string' && !filename.includes('dist')) {
29-
await build(paths, options.cwd, externals, !options.watch)
29+
await build(paths, options.cwd, externals)
3030
}
3131
})
3232
}

tools/builder/src/plugins.ts

-49
This file was deleted.

tools/builder/src/utils.ts

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { join } from 'path'
22
import type { BunPlugin } from 'bun'
33

4-
import { dts } from './plugins'
5-
64
export const dependencies = async (cwd = process.cwd()): Promise<string[]> => {
75
const pkg = await Bun.file(join(cwd, './package.json')).json()
86

@@ -21,27 +19,12 @@ export const build = async (
2119
paths: string[],
2220
cwd: string = process.cwd(),
2321
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
24-
external = [] as any[],
25-
buildDts = true
22+
external = [] as any[]
2623
) => {
2724
const entryPoints = paths.map(p => join(cwd, p))
2825
const outDir = join(cwd, './dist')
2926
const plugins: BunPlugin[] = []
3027

31-
if (buildDts) {
32-
plugins.push(
33-
dts({
34-
output: {
35-
inlineDeclareGlobals: true,
36-
noBanner: true,
37-
},
38-
compilationOptions: {
39-
preferredConfigPath: join(cwd, 'tsconfig.json'),
40-
},
41-
})
42-
)
43-
}
44-
4528
await Bun.build({
4629
entrypoints: entryPoints,
4730
outdir: outDir,

0 commit comments

Comments
 (0)