Skip to content

Commit 0b293b3

Browse files
committed
Build package with tsdown
1 parent dd3b768 commit 0b293b3

File tree

7 files changed

+22
-6
lines changed

7 files changed

+22
-6
lines changed

.github/dependabot.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ updates:
1111
schedule:
1212
interval: 'weekly'
1313
versioning-strategy: 'increase-if-necessary'
14+
ignore:
15+
- dependency-name: 'tsdown'

.github/workflows/test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ jobs:
2828
node-version: ${{ matrix.node-version }}
2929
- uses: pnpm/action-setup@v4
3030
- run: pnpm install
31-
- run: pnpm test
3231
- run: pnpm typecheck
32+
- run: pnpm test
33+
- run: pnpm build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
22
coverage
3+
dist
34
node_modules
45
package-lock.json
56
pnpm-lock.yaml

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
"typescript"
2222
],
2323
"files": [
24-
"src/**/*.ts",
25-
"!**/*.test.ts"
24+
"dist/**"
2625
],
2726
"type": "module",
2827
"sideEffects": false,
29-
"exports": "./src/index.ts",
28+
"exports": "./dist/index.mjs",
29+
"types": "./dist/index.d.mts",
3030
"engines": {
3131
"node": ">=24"
3232
},
@@ -46,15 +46,18 @@
4646
"oxlint": "~1.38.0",
4747
"oxlint-tsgolint": "~0.10.1",
4848
"prettier": "^3.7.4",
49+
"publint": "^0.3.16",
50+
"tsdown": "0.18.4",
4951
"typescript": "^5.9.3",
5052
"vitest": "~4.0.16"
5153
},
5254
"scripts": {
55+
"build": "tsdown --publint",
5356
"format": "prettier --write --ignore-unknown .",
5457
"format:ci": "prettier --check --ignore-unknown .",
5558
"lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives",
5659
"lint:ci": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives",
57-
"prepack": "pnpm run '/^(format:ci|lint:ci|test|typecheck)$/'",
60+
"prepack": "pnpm run '/^(format:ci|lint:ci|test|typecheck)$/' && pnpm run build",
5861
"test": "vitest run",
5962
"typecheck": "tsc --noEmit"
6063
}

src/types/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'prettier';
12
import './vendor.d.ts';
23

34
declare module 'prettier' {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "@standard-config/tsconfig",
33
"include": ["**/*"],
4-
"exclude": ["node_modules"]
4+
"exclude": ["dist", "node_modules"]
55
}

tsdown.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'tsdown';
2+
3+
export default defineConfig({
4+
entry: './src/index.ts',
5+
dts: {
6+
sideEffects: true,
7+
},
8+
});

0 commit comments

Comments
 (0)