Skip to content

Commit ad06acb

Browse files
authored
Migrate to tsup (#48)
1 parent eb11ac0 commit ad06acb

File tree

8 files changed

+1206
-3465
lines changed

8 files changed

+1206
-3465
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ example/
44
docs/
55

66
vite.config.mts
7+
tsup.config.ts
78
vitest-setup.ts
89
.eslintrc.js

example/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
"@swan-io/chicane": "link:../",
1111
"react": "^18.2.0",
1212
"react-dom": "^18.2.0",
13-
"ts-pattern": "^5.0.8"
13+
"ts-pattern": "^5.1.0"
1414
},
1515
"devDependencies": {
16-
"@types/react": "^18.2.65",
17-
"@types/react-dom": "^18.2.21",
16+
"@types/react": "^18.2.74",
17+
"@types/react-dom": "^18.2.24",
1818
"@vitejs/plugin-react-swc": "^3.6.0",
19-
"typescript": "^5.4.2",
20-
"vite": "^5.1.6"
19+
"typescript": "^5.4.3",
20+
"vite": "^5.2.8"
2121
}
2222
}

example/yarn.lock

Lines changed: 340 additions & 332 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@swan-io/chicane",
3-
"version": "2.0.0-rc.2",
3+
"version": "2.0.0",
44
"license": "MIT",
55
"description": "A simple and safe router for React and TypeScript",
66
"author": "Mathieu Acthernoene <[email protected]>",
@@ -33,14 +33,9 @@
3333
"test": "vitest --run",
3434
"test:watch": "vitest --watch",
3535
"typecheck": "tsc --noEmit",
36-
"build": "yarn clean && microbundle -f cjs,es --tsconfig tsconfig.build.json",
36+
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
3737
"prepack": "yarn typecheck && yarn lint && yarn test && yarn build"
3838
},
39-
"browserslist": [
40-
">0.2%",
41-
"not op_mini all",
42-
"not dead"
43-
],
4439
"prettier": {
4540
"plugins": [
4641
"prettier-plugin-organize-imports"
@@ -54,21 +49,22 @@
5449
"use-sync-external-store": "^1.2.0"
5550
},
5651
"devDependencies": {
57-
"@testing-library/react": "^14.2.1",
58-
"@types/react": "^18.2.65",
59-
"@types/react-dom": "^18.2.21",
52+
"@testing-library/react": "^14.2.2",
53+
"@types/node": "^20.12.4",
54+
"@types/react": "^18.2.74",
55+
"@types/react-dom": "^18.2.24",
6056
"@types/use-sync-external-store": "^0.0.6",
61-
"@typescript-eslint/eslint-plugin": "^7.2.0",
62-
"@typescript-eslint/parser": "^7.2.0",
57+
"@typescript-eslint/eslint-plugin": "^7.5.0",
58+
"@typescript-eslint/parser": "^7.5.0",
6359
"eslint": "^8.57.0",
6460
"eslint-plugin-react-hooks": "^4.6.0",
6561
"jsdom": "^24.0.0",
66-
"microbundle": "^0.15.1",
6762
"prettier": "^3.2.5",
6863
"prettier-plugin-organize-imports": "^3.2.4",
6964
"react": "^18.2.0",
7065
"react-dom": "^18.2.0",
71-
"typescript": "^5.4.2",
72-
"vitest": "^1.3.1"
66+
"tsup": "^8.0.2",
67+
"typescript": "^5.4.3",
68+
"vitest": "^1.4.0"
7369
}
7470
}

tsconfig.build.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"extends": "./tsconfig.json",
33
"include": ["src"],
4-
"exclude": ["__tests__"]
4+
"exclude": ["__tests__"],
5+
"compilerOptions": { "noEmit": false }
56
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"include": ["src", "__tests__"],
33
"compilerOptions": {
44
"module": "ESNext",
5-
"target": "ES2018",
6-
"lib": ["DOM", "DOM.Iterable", "ES2018"],
5+
"target": "ES2019",
6+
"lib": ["DOM", "DOM.Iterable", "ES2019"],
77
"jsx": "react",
88
"moduleResolution": "Node",
99
"outDir": "dist/",

tsup.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { defineConfig } from "tsup";
2+
3+
export default defineConfig({
4+
entry: { index: "src/index.ts" },
5+
format: ["cjs", "esm"],
6+
target: "es2019",
7+
tsconfig: "./tsconfig.build.json",
8+
clean: true,
9+
dts: false,
10+
sourcemap: true,
11+
treeshake: true,
12+
});

yarn.lock

Lines changed: 833 additions & 3110 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)