Skip to content

Commit

Permalink
fix: use tsup for bundling.
Browse files Browse the repository at this point in the history
  • Loading branch information
lilingxi01 committed Dec 20, 2023
1 parent 1309c5f commit b8ab6a3
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
Binary file modified bun.lockb
Binary file not shown.
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion src/scripts/generator.ts → scripts/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
"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,
"allowJs": true,
"types": [
"bun-types" // add Bun global
]
},
"include": ["src/**/*"]
}
}
4 changes: 0 additions & 4 deletions tsconfig.prod.json

This file was deleted.

9 changes: 9 additions & 0 deletions tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { defineConfig } from 'tsup';

export default defineConfig({
sourcemap: false,
minify: true,
dts: true,
format: ['esm', 'cjs'],
clean: true,
});

0 comments on commit b8ab6a3

Please sign in to comment.