Skip to content

Commit 366078e

Browse files
committed
refactor: tsup
1 parent 05a6487 commit 366078e

File tree

9 files changed

+648
-797
lines changed

9 files changed

+648
-797
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.16.0
1+
v22.19.0

package-lock.json

Lines changed: 617 additions & 750 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434
},
3535
"scripts": {
36-
"build": "tsc --noEmit && tsdown",
36+
"build": "tsup-node",
3737
"docs:dev": "vitepress dev docs --port 5177",
3838
"docs:build": "vitepress build docs",
3939
"docs:preview": "vitepress preview docs --port 4177",
@@ -84,6 +84,7 @@
8484
"dist/**"
8585
],
8686
"dependencies": {
87+
"@feathersjs/adapter-commons": "^5.0.34",
8788
"@feathersjs/errors": "^5.0.34",
8889
"fast-copy": "^3.0.2",
8990
"fast-equals": "^5.2.2",
@@ -117,9 +118,8 @@
117118
"shx": "^0.4.0",
118119
"sift": "^17.1.3",
119120
"tailwindcss": "^4.1.13",
120-
"tsdown": "^0.14.2",
121+
"tsup": "^8.5.0",
121122
"typescript": "^5.9.2",
122-
"unplugin-unused": "^0.5.2",
123123
"vitepress": "^2.0.0-alpha.8",
124124
"vitest": "^3.2.4"
125125
},

src/hooks/set-data/set-data.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { FeathersError } from '@feathersjs/errors'
66
import { Forbidden } from '@feathersjs/errors'
77

88
import type { HookContext, NextFunction } from '@feathersjs/feathers'
9-
import { type PropertyPath } from 'lodash'
9+
import type { PropertyPath } from 'lodash'
1010
import { contextToJson } from '../../utils/context-to-json/context-to-json.util.js'
1111
import { getDataIsArray } from '../../utils/index.js'
1212
import type { PredicateItemWithContext } from '../../types.js'

src/hooks/set-result/set-result.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { FeathersError } from '@feathersjs/errors'
66
import { Forbidden } from '@feathersjs/errors'
77

88
import type { HookContext, NextFunction } from '@feathersjs/feathers'
9-
import { type PropertyPath } from 'lodash'
9+
import type { PropertyPath } from 'lodash'
1010
import { contextToJson } from '../../utils/context-to-json/context-to-json.util.js'
1111
import { getResultIsArray } from '../../utils/index.js'
1212
import type { DispatchOption, PredicateItemWithContext } from '../../types.js'

src/hooks/throw-if-is-provider/throw-if-is-provider.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { HookContext } from '@feathersjs/feathers'
22
import type { PredicateFn, TransportName } from '../../types.js'
33
import { throwIf } from '../throw-if/throw-if.hook.js'
4-
import { toArray } from 'lodash'
54
import { every, isProvider } from '../../predicates/index.js'
65
import type { FeathersError } from '@feathersjs/errors'
76
import { MethodNotAllowed } from '@feathersjs/errors'
7+
import { toArray } from '../../internal.utils.js'
88

99
const defaultError = (context: HookContext) =>
1010
new MethodNotAllowed(

tsconfig.eslint.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": [
4-
"src/**/*",
5-
"test/**/*",
6-
"tsdown.config.ts",
4+
"src/**/*",
5+
"test/**/*",
6+
"tsdown.config.ts",
7+
"tsup.config.ts",
78
"vite.config.ts",
89
"docs/**/*",
910
"docs/.vitepress/**/*",
1011
],
1112
}
12-

tsdown.config.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

tsup.config.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { defineConfig } from 'tsup'
2+
3+
export default defineConfig({
4+
treeshake: true,
5+
define: {
6+
'import.meta.vitest': 'false',
7+
},
8+
dts: true,
9+
clean: true,
10+
sourcemap: true,
11+
format: ['esm'],
12+
entry: {
13+
index: 'src/index.ts',
14+
hooks: 'src/hooks/index.ts',
15+
utils: 'src/utils/index.ts',
16+
predicates: 'src/predicates/index.ts',
17+
resolvers: 'src/resolvers/index.ts',
18+
transformers: 'src/transformers/index.ts',
19+
},
20+
})

0 commit comments

Comments
 (0)