Skip to content

Commit 08f2eaa

Browse files
committed
feat: migrate tsup to tsdown
- Created a new configuration file `tsdown.config.ts` - Set target to Node.js 14 and specified output formats as CommonJS and ESM - Included entry points for various source files - Defined external dependencies to exclude from the bundle - Enabled TypeScript declaration file generation
1 parent a7cd6bf commit 08f2eaa

File tree

5 files changed

+1269
-833
lines changed

5 files changed

+1269
-833
lines changed

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
shamefully-hoist=true
1+
# shamefully-hoist=true
22
strict-peer-dependencies=false
33
shell-emulator=true

package.json

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "lazy-js-utils",
3+
"type": "module",
34
"version": "0.1.41",
4-
"packageManager": "pnpm@10.6.2",
5+
"packageManager": "pnpm@10.9.0",
56
"description": "A collection of lazy-loaded JavaScript utilities for efficient development",
67
"author": "Simon He",
78
"license": "MIT",
@@ -23,54 +24,30 @@
2324
],
2425
"exports": {
2526
".": {
26-
"import": {
27-
"types": "./dist/index.d.ts",
28-
"default": "./dist/index.mjs"
29-
},
30-
"require": {
31-
"types": "./dist/index.d.ts",
32-
"default": "./dist/index.js"
33-
}
27+
"import": "./dist/index.js",
28+
"require": "./dist/index.cjs"
3429
},
3530
"./node": {
36-
"import": {
37-
"types": "./dist/node/index.d.ts",
38-
"default": "./dist/node/index.mjs"
39-
},
40-
"require": {
41-
"types": "./dist/node/index.d.ts",
42-
"default": "./dist/node/index.js"
43-
}
31+
"import": "./dist/node/index.js",
32+
"require": "./dist/node/index.cjs"
4433
},
4534
"./vite": {
46-
"import": {
47-
"types": "./dist/vite/index.d.ts",
48-
"default": "./dist/vite/index.mjs"
49-
},
50-
"require": {
51-
"types": "./dist/vite/index.d.ts",
52-
"default": "./dist/vite/index.js"
53-
}
35+
"import": "./dist/vite/index.js",
36+
"require": "./dist/vite/index.cjs"
5437
},
5538
"./webComponents": {
56-
"import": {
57-
"types": "./dist/webComponents/index.d.ts",
58-
"default": "./dist/webComponents/index.mjs"
59-
},
60-
"require": {
61-
"types": "./dist/webComponents/index.d.ts",
62-
"default": "./dist/webComponents/index.js"
63-
}
39+
"import": "./dist/webComponents/index.js",
40+
"require": "./dist/webComponents/index.cjs"
6441
}
6542
},
6643
"main": "./dist/index.js",
67-
"module": "./dist/index.mjs",
44+
"module": "./dist/index.js",
6845
"types": "./dist/index.d.ts",
6946
"files": [
7047
"dist"
7148
],
7249
"scripts": {
73-
"build": "tsup",
50+
"build": "tsdown",
7451
"build-fast": "npm run build -- --no-dts",
7552
"dev": "npm run build-fast -- --watch",
7653
"play": "pnpm run -C playground dev",
@@ -88,7 +65,6 @@
8865
},
8966
"dependencies": {
9067
"htmlparser2": "^8.0.2",
91-
"lazy-js-utils": "workspace:^",
9268
"qrcode": "^1.5.4",
9369
"spark-md5": "^3.0.2"
9470
},
@@ -97,17 +73,17 @@
9773
"@types/node": "^17.0.45",
9874
"@types/qrcode": "^1.5.5",
9975
"@types/spark-md5": "^3.0.5",
100-
"@vitejs/plugin-vue": "^2.3.4",
10176
"bumpp": "^8.2.1",
10277
"eslint": "9.1.1",
78+
"lazy-js-utils": "workspace:^",
10379
"lint-staged": "^13.3.0",
10480
"p-limit": "^4.0.0",
10581
"prettier": "^2.8.8",
10682
"simple-git-hooks": "^2.12.1",
107-
"tsup": "^8.4.0",
83+
"tsdown": "^0.9.5",
10884
"tsx": "^3.14.0",
109-
"typescript": "^4.9.5",
110-
"vitest": "^0.28.5"
85+
"typescript": "^5.8.3",
86+
"vitest": "^3.1.2"
11187
},
11288
"simple-git-hooks": {
11389
"pre-commit": "pnpm exec lint-staged --concurrent false",
@@ -117,6 +93,6 @@
11793
"*": [
11894
"prettier --write --cache --ignore-unknown"
11995
],
120-
"*.{vue,js,ts,jsx,tsx,md,json}": "eslint --fix"
96+
"*.{vue,js,ts,jsx,tsx,md,json}": "eslint . --fix"
12197
}
12298
}

playground/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,21 @@
2020
},
2121
"devDependencies": {
2222
"@antfu/eslint-config": "^0.18.9",
23-
"@iconify-json/carbon": "^1.2.4",
23+
"@iconify-json/carbon": "^1.2.8",
2424
"@types/node": "^17.0.45",
2525
"@unocss/reset": "^0.61.9",
2626
"@vitejs/plugin-vue": "^2.3.4",
2727
"@vue/test-utils": "^2.4.6",
2828
"eslint": "^8.57.1",
2929
"jsdom": "^19.0.0",
30+
"picocolors": "^1.1.1",
3031
"typescript": "^4.9.5",
3132
"unocss": "^0.61.9",
3233
"unplugin-auto-import": "^0.6.9",
3334
"unplugin-vue-components": "^0.18.5",
34-
"vite": "^5.4.11",
35+
"vite": "^6.3.2",
3536
"vite-plugin-pages": "^0.22.0",
36-
"vitest": "^0.7.13",
37+
"vitest": "^3.1.2",
3738
"vue-tsc": "^0.33.9"
3839
},
3940
"eslintConfig": {

0 commit comments

Comments
 (0)