Skip to content

Commit

Permalink
Migrate to tsup (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Apr 4, 2024
1 parent eb11ac0 commit ad06acb
Show file tree
Hide file tree
Showing 8 changed files with 1,206 additions and 3,465 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ example/
docs/

vite.config.mts
tsup.config.ts
vitest-setup.ts
.eslintrc.js
10 changes: 5 additions & 5 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"@swan-io/chicane": "link:../",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"ts-pattern": "^5.0.8"
"ts-pattern": "^5.1.0"
},
"devDependencies": {
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.21",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@vitejs/plugin-react-swc": "^3.6.0",
"typescript": "^5.4.2",
"vite": "^5.1.6"
"typescript": "^5.4.3",
"vite": "^5.2.8"
}
}
672 changes: 340 additions & 332 deletions example/yarn.lock

Large diffs are not rendered by default.

26 changes: 11 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@swan-io/chicane",
"version": "2.0.0-rc.2",
"version": "2.0.0",
"license": "MIT",
"description": "A simple and safe router for React and TypeScript",
"author": "Mathieu Acthernoene <[email protected]>",
Expand Down Expand Up @@ -33,14 +33,9 @@
"test": "vitest --run",
"test:watch": "vitest --watch",
"typecheck": "tsc --noEmit",
"build": "yarn clean && microbundle -f cjs,es --tsconfig tsconfig.build.json",
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
"prepack": "yarn typecheck && yarn lint && yarn test && yarn build"
},
"browserslist": [
">0.2%",
"not op_mini all",
"not dead"
],
"prettier": {
"plugins": [
"prettier-plugin-organize-imports"
Expand All @@ -54,21 +49,22 @@
"use-sync-external-store": "^1.2.0"
},
"devDependencies": {
"@testing-library/react": "^14.2.1",
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.21",
"@testing-library/react": "^14.2.2",
"@types/node": "^20.12.4",
"@types/react": "^18.2.74",
"@types/react-dom": "^18.2.24",
"@types/use-sync-external-store": "^0.0.6",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"jsdom": "^24.0.0",
"microbundle": "^0.15.1",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
"tsup": "^8.0.2",
"typescript": "^5.4.3",
"vitest": "^1.4.0"
}
}
3 changes: 2 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extends": "./tsconfig.json",
"include": ["src"],
"exclude": ["__tests__"]
"exclude": ["__tests__"],
"compilerOptions": { "noEmit": false }
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"include": ["src", "__tests__"],
"compilerOptions": {
"module": "ESNext",
"target": "ES2018",
"lib": ["DOM", "DOM.Iterable", "ES2018"],
"target": "ES2019",
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"jsx": "react",
"moduleResolution": "Node",
"outDir": "dist/",
Expand Down
12 changes: 12 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: { index: "src/index.ts" },
format: ["cjs", "esm"],
target: "es2019",
tsconfig: "./tsconfig.build.json",
clean: true,
dts: false,
sourcemap: true,
treeshake: true,
});
3,943 changes: 833 additions & 3,110 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit ad06acb

Please sign in to comment.