Skip to content

Commit

Permalink
feat: tsup config add (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
XionWCFM authored Jan 4, 2025
1 parent b9a2453 commit 3cb77fe
Show file tree
Hide file tree
Showing 61 changed files with 259 additions and 136,008 deletions.
4 changes: 2 additions & 2 deletions configs/tailwind/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@xionwcfm/tailwindcss-config",
"name": "@repo/tailwindcss-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
Expand All @@ -12,7 +12,7 @@
}
},
"devDependencies": {
"@xionwcfm/typescript-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"tailwindcss": "^3.4.1",
"tailwindcss-animate": "^1.0.7",
"typescript": "latest",
Expand Down
2 changes: 1 addition & 1 deletion configs/tailwind/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@xionwcfm/typescript-config/base.json",
"extends": "@repo/typescript-config/base.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
Expand Down
31 changes: 31 additions & 0 deletions configs/tsup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "@repo/tsup-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "tsup",
"ci:type": "tsc --noEmit"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"devDependencies": {
"@repo/typescript-config": "workspace:*",
"tsup": "^8.3.5"
},
"publishConfig": {
"access": "public"
}
}
18 changes: 18 additions & 0 deletions configs/tsup/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import type { Options } from "tsup";

export const options: Options = {
format: ["cjs", "esm"],
entry: [
"./src/*.(ts|tsx)",
"./src/exposes/*.(ts|tsx)",
"!./src/**/*.stories.(ts|tsx)",
"!./src/**/*.test.(ts|tsx)",
"!./stories/*",
],
sourcemap: false,
dts: true,
clean: true,
minify: true,
treeshake: true,
splitting: false,
};
7 changes: 7 additions & 0 deletions configs/tsup/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "@repo/typescript-config/nextjs.json",
"exclude": ["dist", "node_modules"],
"compilerOptions": {
"outDir": "dist"
}
}
4 changes: 4 additions & 0 deletions configs/tsup/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { defineConfig } from "tsup";
import { options } from "./src/index";

export default defineConfig(options);
2 changes: 1 addition & 1 deletion configs/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@xionwcfm/typescript-config",
"name": "@repo/typescript-config",
"version": "0.0.0",
"private": true,
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@vitest/coverage-v8": "^2.1.5",
"@xionwcfm/typescript-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"broken-link-checker": "^0.7.8",
"knip": "^5.37.1",
"lefthook": "^1.8.2",
Expand Down
3 changes: 2 additions & 1 deletion packages/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"devDependencies": {
"@types/react": "catalog:react18",
"@xionwcfm/typescript-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@repo/tsup-config": "workspace:*",
"tsup": "catalog:",
"typescript": "catalog:"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/icon/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@xionwcfm/typescript-config/react-library.json",
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src"
Expand Down
6 changes: 2 additions & 4 deletions packages/icon/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import config from "@repo/tsup-config";
import { defineConfig } from "tsup";

export default defineConfig({
format: ["cjs", "esm"],
entry: ["./src/*.(ts|tsx)"],
sourcemap: true,
dts: true,
...config,
clean: true,
});
6 changes: 2 additions & 4 deletions packages/jotai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@
"publishConfig": {
"access": "public"
},
"files": [
"dist"
],
"files": ["dist"],
"devDependencies": {
"@testing-library/jest-dom": "catalog:",
"@testing-library/react": "catalog:",
"@testing-library/user-event": "catalog:",
"@vitejs/plugin-react": "catalog:",
"@types/node": "^20.14.9",
"@types/react": "catalog:react18",
"@xionwcfm/typescript-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"happy-dom": "^15.11.6",
"jotai": "^2.9.3",
"tsup": "catalog:",
Expand Down
2 changes: 1 addition & 1 deletion packages/jotai/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@xionwcfm/typescript-config/react-library.json",
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"outDir": "dist",
"strict": true,
Expand Down
98 changes: 0 additions & 98 deletions packages/lotties/package.json

This file was deleted.

Loading

0 comments on commit 3cb77fe

Please sign in to comment.