diff --git a/bun.lockb b/bun.lockb index 6743235..1f38014 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 9eaa4bd..a872158 100644 --- a/package.json +++ b/package.json @@ -1,35 +1,34 @@ { "name": "radix-colors-tailwind", - "version": "1.0.1", - "main": "dist/index.ts", + "version": "1.0.5", + "main": "dist/index.js", + "type": "module", "files": [ "dist/**/*", "!**/*.tsbuildinfo", "LICENSE", "README.md" ], + "repository": "https://github.com/lilingxi01/radix-colors-tailwind", "scripts": { - "prod": "bun clean && bun generate && bun prod:tsc", - "prod:tsc": "tsc --project tsconfig.prod.json", - "generate": "bun src/scripts/generator.ts", - "lint": "eslint src/scripts/*", + "prod": "bun clean && bun prod:tsc && bun generate", + "prod:tsc": "tsup src", + "generate": "bun scripts/generator.ts", + "lint": "eslint scripts/*", "clean": "rm -f -R tsconfig.tsbuildinfo dist" }, "devDependencies": { - "@taci-tech/eslint-config": "^0.0.3", "@radix-ui/colors": "^3.0.0", + "@taci-tech/eslint-config": "^0.0.3", "@typescript-eslint/eslint-plugin": "^5.48.1", "@typescript-eslint/parser": "^5.48.1", - "eslint": "^8.32.0", "bun-types": "latest", + "eslint": "^8.32.0", + "tsup": "^8.0.1", "typescript": "^5.0.0" }, - "sideEffects": false, "publishConfig": { "access": "public" }, - "license": "MIT", - "exports": { - ".": "./dist" - } + "license": "MIT" } diff --git a/src/scripts/generator.ts b/scripts/generator.ts similarity index 99% rename from src/scripts/generator.ts rename to scripts/generator.ts index 3ed3565..c93bef5 100644 --- a/src/scripts/generator.ts +++ b/scripts/generator.ts @@ -112,7 +112,7 @@ async function main() { } const newFilePath = path.join(outputDirPath, currentFilename); - await Bun.write(newFilePath, headerComment + '\n\n' + newLines.join('\n')); + await Bun.write(newFilePath, headerComment + '\n\n' + newLines.join('\n') + '\n'); } } diff --git a/src/scripts/header-comment.ts b/scripts/header-comment.ts similarity index 85% rename from src/scripts/header-comment.ts rename to scripts/header-comment.ts index 863092d..871018d 100644 --- a/src/scripts/header-comment.ts +++ b/scripts/header-comment.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires -const packageJson = require('../../package.json'); +const packageJson = require('../package.json'); export const headerComment = `/** Radix Colors for Tailwind CSS diff --git a/tsconfig.json b/tsconfig.json index c463080..3fa6e88 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,12 +8,11 @@ "allowImportingTsExtensions": false, "composite": true, "strict": true, + "noEmit": true, "declaration": true, "declarationDir": "dist", "downlevelIteration": true, - "incremental": true, "skipLibCheck": true, - "rootDir": "src", "outDir": "dist", "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, @@ -21,6 +20,5 @@ "types": [ "bun-types" // add Bun global ] - }, - "include": ["src/**/*"] + } } diff --git a/tsconfig.prod.json b/tsconfig.prod.json deleted file mode 100644 index 5b7749c..0000000 --- a/tsconfig.prod.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["./tsconfig"], - "exclude": ["src/scripts/**/*"] -} diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..4dae1b1 --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + sourcemap: false, + minify: true, + dts: true, + format: ['esm', 'cjs'], + clean: true, +});