diff --git a/.github/workflows/test_coverage.yml b/.github/workflows/test_coverage.yml index cdbcb0f..c9fcad1 100644 --- a/.github/workflows/test_coverage.yml +++ b/.github/workflows/test_coverage.yml @@ -19,14 +19,7 @@ jobs: - name: pnpm 설치 run: npm install -g pnpm - run: pnpm install - - run: pnpm test -- --reporter=junit --outputFile=vitest-report.xml - run: pnpm coverage -- package/**/*.test.ts - - name: 테스트 결과 PR에 코멘트 추가하기 - uses: test-summary/action@v2 - with: - paths: /home/runner/work/utils/utils/vitest-report.xml - github-token: ${{ secrets.PR_WRITE_TOKEN }} - if: always() - name: 테스트 커버리지 결과 PR에 코멘트 추가하기 uses: davelosert/vitest-coverage-report-action@v2 with: diff --git a/README.md b/README.md index 9952f6e..4948765 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# @dori/utils +# corekit A comprehensive collection of TypeScript utility functions for modern web development. ## Features -- 🛠️ **Comprehensive**: String, object, cookie, number, and validation utilities +- 🛠️ **Comprehensive**: String, object, cookie, number, validation, and common utilities - 📦 **Tree-shakable**: Import only what you need - 🔒 **Type-safe**: Full TypeScript support with type definitions - ⚡ **Lightweight**: Minimal dependencies and optimized for performance @@ -13,11 +13,11 @@ A comprehensive collection of TypeScript utility functions for modern web develo ## Installation ```bash -npm install @dori/utils +npm install corekit # or -pnpm add @dori/utils +pnpm add corekit # or -yarn add @dori/utils +yarn add corekit ``` ## Usage @@ -29,7 +29,8 @@ import { cookieUtil, numberUtil, validationUtil, -} from "@dori/utils"; + commonUtil, +} from "corekit"; // String utilities const escaped = stringUtil.escapeHtml("
Hello
"); @@ -47,6 +48,10 @@ const difference = numberUtil.subtract(10, 3); // 7 const isValid = validationUtil.checkEmail("user@example.com"); // true const isHttpUrl = validationUtil.checkHttpUrl("https://example.com"); // true +// Common utilities +const empty = commonUtil.isEmpty(""); // true +const notEmpty = commonUtil.isEmpty("hello"); // false + // Cookie utilities cookieUtil.setCookie("theme", "dark"); const theme = cookieUtil.getCookie("theme"); @@ -74,6 +79,10 @@ const theme = cookieUtil.getCookie("theme"); - `checkEmail(email: string): boolean` - Validates email format - `checkHttpUrl(url: string): boolean` - Validates HTTP/HTTPS URL format +### CommonUtil + +- `isEmpty(value: unknown): boolean` - Checks if a value is empty (null, undefined, "", 0, [], {}, empty Set/Map, NaN, or invalid Date) + ### CookieUtil - `setCookie(name: string, value: string, options?: object): void` - Sets a cookie diff --git a/dori-utils-0.0.1.tgz b/dori-utils-0.0.1.tgz deleted file mode 100644 index 287c8ce..0000000 Binary files a/dori-utils-0.0.1.tgz and /dev/null differ diff --git a/package.json b/package.json index 64ee9c1..d443318 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,53 @@ { - "name": "@dori/utils", + "name": "corekit", "version": "0.0.1", - "main": "dist/bundle/dori-utils.js", + "description": "A lightweight and modern utility toolkit for JavaScript and TypeScript. CoreKit provides essential functions for strings, arrays, objects, and more, designed for simplicity and productivity.", + "keywords": [ + "javascript", + "typescript", + "utilities", + "utility-functions", + "toolkit", + "helper", + "lodash", + "es-toolkit", + "string-utils", + "array-utils", + "object-utils", + "functional", + "corekit", + "esm", + "cjs" + ], + "license": "MIT", + "type": "module", + "main": "dist/bundle/corekit.js", "exports": { ".": { "types": "./dist/types/index.d.ts", - "require": "./dist/bundle/dori-utils.cjs", - "import": "./dist/bundle/dori-utils.js" + "require": "./dist/bundle/corekit.cjs", + "import": "./dist/bundle/corekit.js" } }, - "license": "MIT", - "type": "module", "scripts": { "build": "tsc && vite build", "preview": "vite preview", "test": "vitest", "coverage": "vitest run --coverage" }, + "repository": { + "type": "git", + "url": "https://github.com/klmhyeonwoo/corekit" + }, + "bugs": { + "url": "https://github.com/klmhyeonwoo/corekit/issues" + }, + "homepage": "https://github.com/klmhyeonwoo/corekit#readme", "devDependencies": { "@types/node": "^24.3.0", + "@vitest/coverage-v8": "^3.2.4", "typescript": "~5.8.3", "vite": "^7.1.2", "vitest": "^3.2.4" - }, - "dependencies": { - "@dori/utils": "file:dori-utils-0.0.1.tgz", - "@vitest/coverage-v8": "^3.2.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90c7a78..77205f0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,17 +7,13 @@ settings: importers: .: - dependencies: - '@dori/utils': - specifier: file:dori-utils-0.0.1.tgz - version: file:dori-utils-0.0.1.tgz - '@vitest/coverage-v8': - specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@24.3.0)) devDependencies: '@types/node': specifier: ^24.3.0 version: 24.3.0 + '@vitest/coverage-v8': + specifier: ^3.2.4 + version: 3.2.4(vitest@3.2.4(@types/node@24.3.0)) typescript: specifier: ~5.8.3 version: 5.8.3 @@ -55,10 +51,6 @@ packages: resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@dori/utils@file:dori-utils-0.0.1.tgz': - resolution: {integrity: sha512-g/tJ39NM0Apm8eEXtbknLmZeNYdSTc/W5YbhY3/mnIFvxuVJQMFVmhYMQPzU0W3qNHV1sU8Nc1mG3TEphN4heA==, tarball: file:dori-utils-0.0.1.tgz} - version: 0.0.1 - '@esbuild/aix-ppc64@0.25.9': resolution: {integrity: sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==} engines: {node: '>=18'} @@ -803,8 +795,6 @@ snapshots: '@bcoe/v8-coverage@1.0.2': {} - '@dori/utils@file:dori-utils-0.0.1.tgz': {} - '@esbuild/aix-ppc64@0.25.9': optional: true diff --git a/vite.config.ts b/vite.config.ts index 24a7047..cd15813 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,8 +13,8 @@ export default defineConfig({ outDir: "dist/bundle", lib: { entry: "package/index.ts", - name: "DoriUtils", - fileName: "dori-utils", + name: "corekit", + fileName: "corekit", }, }, }); diff --git a/vitest-report.xml b/vitest-report.xml deleted file mode 100644 index 8f2c647..0000000 --- a/vitest-report.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -