Skip to content

Commit de92b06

Browse files
committed
refactor: tsdown
1 parent 4bce3ce commit de92b06

21 files changed

+641
-1414
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"eslint": "catalog:",
2020
"eslint-plugin-security": "catalog:",
2121
"eslint-plugin-vue-hook-optimizer": "workspace:*",
22+
"tsdown": "catalog:",
23+
"@rolldown/pluginutils": "catalog:",
2224
"typescript": "catalog:",
2325
"vitest": "catalog:"
2426
}

packages/core/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "vue-hook-optimizer",
33
"version": "0.0.77",
4+
"type": "module",
45
"description": "a tool that helps refactor and optimize hook abstractions in Vue components",
56
"author": "zcf0508 <zcf0508@live.com>",
67
"license": "MIT",
@@ -17,12 +18,12 @@
1718
"exports": {
1819
".": {
1920
"types": "./dist/index.d.ts",
20-
"import": "./dist/index.mjs",
21-
"require": "./dist/index.js"
21+
"import": "./dist/index.js",
22+
"require": "./dist/index.cjs"
2223
}
2324
},
24-
"main": "./dist/index.js",
25-
"module": "./dist/index.mjs",
25+
"main": "./dist/index.cjs",
26+
"module": "./dist/index.js",
2627
"types": "./dist/index.d.ts",
2728
"typesVersions": {
2829
"*": {
@@ -37,7 +38,7 @@
3738
],
3839
"scripts": {
3940
"dev": "nodemon",
40-
"build": "tsup",
41+
"build": "tsdown",
4142
"test": "vitest",
4243
"coverage": "vitest run --coverage",
4344
"typecheck": "tsc --noEmit",
@@ -63,7 +64,7 @@
6364
"lodash-es": "catalog:",
6465
"nodemon": "catalog:",
6566
"ts-node": "catalog:",
66-
"tsup": "catalog:",
67+
"tsdown": "catalog:",
6768
"typescript": "catalog:",
6869
"vis-network": "catalog:",
6970
"vitest": "catalog:"

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export * from './analyze';
22
export type { TypedNode } from './analyze/utils';
3-
export { NodeType, RelationType } from './analyze/utils';
3+
export type { NodeType, RelationType } from './analyze/utils';
44
export * from './mermaid';
55
export * from './suggest';
66
export { getVisData } from './vis';
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { defineConfig } from 'tsup';
1+
import { defineConfig } from 'tsdown';
22

33
export default defineConfig({
44
entry: ['src/index.ts'],
5-
splitting: false,
65
sourcemap: true,
76
clean: true,
87
dts: true,
8+
shims: true,
99
format: ['cjs', 'esm'],
1010
external: [
1111
'@babel/core',

packages/eslint/build.config.ts

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

packages/eslint/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,18 @@
2323
"exports": {
2424
".": {
2525
"types": "./dist/index.d.ts",
26-
"import": "./dist/index.mjs",
26+
"import": "./dist/index.js",
2727
"require": "./dist/index.cjs"
2828
}
2929
},
30-
"main": "./dist/index.mjs",
31-
"module": "./dist/index.mjs",
30+
"main": "./dist/index.js",
31+
"module": "./dist/index.js",
3232
"types": "./dist/index.d.ts",
3333
"files": [
3434
"dist"
3535
],
3636
"scripts": {
37-
"build": "unbuild",
38-
"dev": "unbuild --stub",
37+
"build": "tsdown",
3938
"prepublishOnly": "npm run build",
4039
"typecheck": "tsc --noEmit"
4140
},
@@ -46,6 +45,7 @@
4645
"@types/eslint": "catalog:",
4746
"@typescript-eslint/utils": "catalog:",
4847
"eslint-define-config": "catalog:",
49-
"unbuild": "catalog:"
48+
"eslint": "catalog:",
49+
"tsdown": "catalog:"
5050
}
5151
}

packages/eslint/src/rules/linear-path.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { TypedNode } from 'vue-hook-optimizer';
22
import { analyze, createEslintRule } from '../utils';
3+
import { PluginOptions } from '../types';
34

45
export const RULE_NAME = 'linear-path';
56
export type MessageIds = 'maybeCanRefactor';

packages/eslint/src/rules/loop-call.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { TypedNode } from 'vue-hook-optimizer';
22
import { analyze, createEslintRule } from '../utils';
3+
import { PluginOptions } from '../types';
34

45
export const RULE_NAME = 'loop-call';
56
export type MessageIds = 'maybeCanRefactor';

packages/eslint/src/rules/not-used.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { TypedNode } from 'vue-hook-optimizer';
22
import { analyze, createEslintRule } from '../utils';
3+
import { PluginOptions } from '../types';
34

45
export const RULE_NAME = 'not-used';
56
export type MessageIds = 'maybeCanRemove';

packages/eslint/src/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
type PluginOptions = [{
1+
export type PluginOptions = [{
22
framework: 'vue' | 'react'
33
}];

0 commit comments

Comments
 (0)