Skip to content

Commit

Permalink
add the utils package
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Jun 3, 2024
1 parent 84f76fa commit f92ea29
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 35 deletions.
21 changes: 21 additions & 0 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@asyncapi/studio-utils",
"version": "0.0.0",
"description": "Shared utilities for studio.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"private": true,
"scripts": {
"build": "tsup"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"clsx": "^2.1.1",
"tailwind-merge": "^2.3.0"
},
"devDependencies": {
"tsup": "^8.0.2"
}
}
6 changes: 6 additions & 0 deletions packages/utils/src/class-names.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
1 change: 1 addition & 0 deletions packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { cn } from './class-names'
6 changes: 6 additions & 0 deletions packages/utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"exclude": ["dist", "node_modules"],
"compilerOptions": {
"moduleResolution": "Node"
}
}
11 changes: 11 additions & 0 deletions packages/utils/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig, Options } from 'tsup'

export default defineConfig((options: Options) => ({
treeshake: true,
splitting: true,
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
minify: true,
...options,
}))
64 changes: 29 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f92ea29

Please sign in to comment.