Skip to content

Commit 3067289

Browse files
committed
refactor: migrate to tsdown
1 parent 58b00c4 commit 3067289

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+771
-549
lines changed

.cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"tanstack",
5353
"tsbuildinfo",
5454
"tsdoc",
55-
"tsup",
55+
"tsdown",
5656
"typecheck",
5757
"vercel"
5858
],

.vscode/settings.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,5 @@
2020
"editor.codeActionsOnSave": {
2121
"source.fixAll.eslint": "explicit",
2222
"source.organizeImports": "never"
23-
},
24-
"json.schemas": [
25-
{
26-
"url": "https://cdn.jsdelivr.net/npm/tsup/schema.json",
27-
"fileMatch": ["package.json", "tsup.config.json"]
28-
}
29-
]
23+
}
3024
}

knip.jsonc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66
"apps/cli-playground",
77
"apps/docs-website",
88
],
9-
"ignoreDependencies": [
10-
"@turbo/gen",
11-
"eslint-import-resolver-typescript",
12-
"eslint-config-sheriff",
13-
"@typescript-eslint/parser",
14-
],
9+
"ignore": ["**/tsdown.config.ts"],
10+
"ignoreDependencies": ["@turbo/gen"],
11+
"workspaces": {
12+
"./packages/eslint-config-sheriff": {
13+
"ignoreDependencies": [
14+
"eslint-import-resolver-typescript",
15+
"@typescript-eslint/parser",
16+
],
17+
},
18+
},
1519
}

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
"format": "prettier . --write --cache --cache-location=node_modules/.cache/.prettiercache --log-level=warn",
1313
"format:check": "prettier . --check --cache --cache-location=node_modules/.cache/.prettiercache",
1414
"lint": "turbo run lint",
15-
"publint": "turbo run publint --concurrency=1",
1615
"are-the-types-wrong": "turbo run are-the-types-wrong",
1716
"manypkg": "manypkg check",
1817
"typesync": "typesync --dry=fail",
1918
"typecheck": "turbo run typecheck",
2019
"knip": "knip",
2120
"validate-config": "turbo run validate-config",
22-
"merge-checks": "pnpm build && turbo run publint manypkg typesync knip typecheck lint validate-config are-the-types-wrong && pnpm check-deduped-deps",
21+
"merge-checks": "turbo run manypkg typesync knip typecheck lint validate-config are-the-types-wrong && pnpm check-deduped-deps",
2322
"check-deduped-deps": "pnpm dedupe --check",
2423
"clean": "turbo run clean && rm -rf .turbo",
2524
"delete-node-modules": "pnpm exec rm -rf node_modules && pnpm -r exec rm -rf node_modules",
@@ -56,10 +55,13 @@
5655
},
5756
"onlyBuiltDependencies": [
5857
"@swc/core",
59-
"core-js",
6058
"esbuild",
59+
"rolldown",
6160
"sharp",
6261
"unrs-resolver"
62+
],
63+
"ignoredBuiltDependencies": [
64+
"core-js"
6365
]
6466
}
6567
}

packages/eslint-config-sheriff/dts-config.json

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

packages/eslint-config-sheriff/eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ export default tseslint.config(
2424
},
2525
},
2626
{
27-
ignores: ['tsup.config.js'],
27+
ignores: ['tsdown.config.ts'],
2828
},
2929
);

packages/eslint-config-sheriff/package.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@
4545
"bug": "https://github.com/AndreaPontrandolfo/sheriff/labels/bug",
4646
"scripts": {
4747
"clean": "rm -rf .turbo dist node_modules/.cache",
48-
"re-bundle-types": "dts-bundle-generator --config dts-config.json",
4948
"are-the-types-wrong": "attw --pack --profile=esm-only",
50-
"build": "tsup && pnpm re-bundle-types",
51-
"build:watch": "tsup --watch",
49+
"build": "tsdown",
50+
"build:watch": "tsdown --watch",
5251
"typecheck": "tsc",
53-
"lint": "eslint src --max-warnings=0",
54-
"publint": "publint"
52+
"lint": "eslint src --max-warnings=0"
5553
},
5654
"dependencies": {
5755
"@eslint-react/eslint-plugin": "^1.10.1",
@@ -106,12 +104,11 @@
106104
"@types/node": "^22.10.3",
107105
"@typescript-eslint/parser": "^8.31.0",
108106
"@typescript-eslint/utils": "^8.31.0",
109-
"dts-bundle-generator": "^9.5.1",
110107
"eslint": "^9.25.1",
111108
"jiti": "^2.4.2",
112-
"publint": "^0.3.11",
109+
"publint": "^0.3.12",
113110
"tsconfig": "workspace:*",
114-
"tsup": "^8.3.0",
111+
"tsdown": "^0.9.7",
115112
"typescript": "^5.8.3"
116113
},
117114
"publishConfig": {

packages/eslint-config-sheriff/src/getBaseConfig.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ export const getBaseConfig = (
9999
},
100100
{
101101
files: [supportedFileTypes],
102-
// @ts-expect-error
103102
rules: {
104103
...typescriptHandPickedRules,
105104
...getTsNamingConventionRule({ isTsx: false }),

packages/eslint-config-sheriff/src/handpickedRules/getBaseEslintHandPickedRules.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2-
31
import confusingBrowserGlobals from 'confusing-browser-globals';
42
import type { TSESLint } from '@typescript-eslint/utils';
53

6-
export const getBaseEslintHandPickedRules = () => {
4+
export const getBaseEslintHandPickedRules = (): TSESLint.FlatConfig.Rules => {
75
return {
86
'func-style': 2,
97
'no-promise-executor-return': 2,
@@ -99,5 +97,5 @@ export const getBaseEslintHandPickedRules = () => {
9997
'no-shadow': 0, // we are using the @typescript/eslint version
10098
'default-param-last': 0, // we are using the @typescript/eslint version
10199
'arrow-body-style': 0, // we are using the eslint-plugin-arrow-return-style version
102-
} as const satisfies TSESLint.FlatConfig.Rules;
100+
};
103101
};

packages/eslint-config-sheriff/src/handpickedRules/importHandPickedRules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { TSESLint } from '@typescript-eslint/utils';
22

3-
export const importHandPickedRules = {
3+
export const importHandPickedRules: TSESLint.FlatConfig.Rules = {
44
// https://github.com/import-js/eslint-plugin-import/issues/2913
55
// https://github.com/import-js/eslint-plugin-import/issues/2673
66
'import/newline-after-import': 2,
@@ -11,4 +11,4 @@ export const importHandPickedRules = {
1111
'import/no-duplicates': [2, { 'prefer-inline': true }],
1212
'import/no-useless-path-segments': [2, { noUselessIndex: true }],
1313
// 'import/consistent-type-specifier-style': [2, 'prefer-inline'], // this is not actually needed when "@typescript-eslint/no-import-type-side-effects is set. Explanation here: https://github.com/import-js/eslint-plugin-import/issues/2676#issuecomment-1407107260
14-
} as const satisfies TSESLint.FlatConfig.Rules;
14+
};

0 commit comments

Comments
 (0)