261117_01_ENH: ui cn을 npm cn 패키지로 교체(clsx·tailwind-merge 제거) 및 Node 22 이상 명시

This commit is contained in:
2026-11-17 08:53:32 +09:00
parent ea25f47fce
commit 8ac215c667
5 changed files with 32 additions and 32 deletions

View File

@@ -17,6 +17,12 @@ Before each related task, read the current contents of every matching reference,
If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead. If a task spans multiple scopes, read every matching reference. Generated files under `.agent-harness/references/` are read-only copies; edit KriFrontCommon's `.agent/consumer.md` or `.agent/consumer-references/` and recompose instead.
## Class Name Helper
- `@kri/common/ui` exports `cn` and `ClassValue` from the npm `cn` package (pinned exactly). It replaces `clsx` + `tailwind-merge` with the same public signature and merge results; consumers keep importing `cn` through their `@/lib/utils` re-export.
- `@kri/common` now declares `engines.node >=22` because `cn` requires Node.js 22 or later.
- shadcn CLI may add `cn` to a consumer's own dependencies when installing components; that is expected and harmless.
## Noti-hub SMS Types ## Noti-hub SMS Types
- `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three. - `MessageType.SMS = 21`, `LMS = 22`, `MMS = 23`; `ChannelType.SMS = 2` is unchanged. `SMS_TYPE_ARRAY` and `SmsType` include all three.

View File

@@ -229,6 +229,7 @@ When implementation is complete, report in Korean:
- Treat the current React version, component style, state management, routing, styling, and test approach as authoritative. - Treat the current React version, component style, state management, routing, styling, and test approach as authoritative.
- Do not perform unrelated class-to-hook, JavaScript-to-TypeScript, state-library, styling-system, or React-to-Next.js migrations. - Do not perform unrelated class-to-hook, JavaScript-to-TypeScript, state-library, styling-system, or React-to-Next.js migrations.
- Keep components focused and follow the repository's established split between presentation, state, data access, and side effects. - Keep components focused and follow the repository's established split between presentation, state, data access, and side effects.
- Do not use nested ternary expressions. Use clear `if`/`else` branches, early returns, or well-named intermediate variables instead; a single, non-nested ternary is acceptable only when it remains immediately readable.
- Keep effects dependency-correct and clean up subscriptions, timers, listeners, and in-flight work where applicable. - Keep effects dependency-correct and clean up subscriptions, timers, listeners, and in-flight work where applicable.
- Use stable semantic keys and preserve accessibility, loading, empty, error, disabled, and success states. - Use stable semantic keys and preserve accessibility, loading, empty, error, disabled, and success states.
- Preserve public component props and shared UI contracts unless a coordinated breaking change is explicitly approved. - Preserve public component props and shared UI contracts unless a coordinated breaking change is explicitly approved.

35
package-lock.json generated
View File

@@ -1,17 +1,16 @@
{ {
"name": "@kri/common", "name": "@kri/common",
"version": "0.19.5", "version": "0.20.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@kri/common", "name": "@kri/common",
"version": "0.19.5", "version": "0.20.0",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"clsx": "^2.1.1", "cn": "0.5.2",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0"
"tailwind-merge": "^3.4.0"
}, },
"devDependencies": { "devDependencies": {
"@tanstack/react-query": "^5.90.21", "@tanstack/react-query": "^5.90.21",
@@ -21,6 +20,9 @@
"react": "^19.2.7", "react": "^19.2.7",
"typescript": "^6.0.3" "typescript": "^6.0.3"
}, },
"engines": {
"node": ">=22"
},
"peerDependencies": { "peerDependencies": {
"@tanstack/react-query": ">=5 <6", "@tanstack/react-query": ">=5 <6",
"jotai": ">=2", "jotai": ">=2",
@@ -83,13 +85,16 @@
"csstype": "^3.2.2" "csstype": "^3.2.2"
} }
}, },
"node_modules/clsx": { "node_modules/cn": {
"version": "2.1.1", "version": "0.5.2",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "resolved": "https://registry.npmjs.org/cn/-/cn-0.5.2.tgz",
"integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", "integrity": "sha512-wm10E6iuJ37rALOw3D+3cfaXXZSLNMh2uxpQn3dNICqfJM59yXqgbA9/9Iiz155j5kYNLdK6WreNdW3NQtx3OQ==",
"license": "MIT", "license": "MIT",
"bin": {
"cn": "bin/cn.mjs"
},
"engines": { "engines": {
"node": ">=6" "node": ">=22"
} }
}, },
"node_modules/crypto-js": { "node_modules/crypto-js": {
@@ -145,16 +150,6 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/tailwind-merge": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.4.0.tgz",
"integrity": "sha512-uSaO4gnW+b3Y2aWoWfFpX62vn2sR3skfhbjsEnaBI81WD1wBLlHZe5sWf0AqjksNdYTbGBEd0UasQMT3SNV15g==",
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/dcastil"
}
},
"node_modules/typescript": { "node_modules/typescript": {
"version": "6.0.3", "version": "6.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@kri/common", "name": "@kri/common",
"version": "0.19.5", "version": "0.20.0",
"description": "KRI 프런트엔드 공통 유틸리티", "description": "KRI 프런트엔드 공통 유틸리티",
"type": "module", "type": "module",
"main": "./dist/index.js", "main": "./dist/index.js",
@@ -75,6 +75,9 @@
"common", "common",
"typescript" "typescript"
], ],
"engines": {
"node": ">=22"
},
"author": "KRI", "author": "KRI",
"license": "UNLICENSED", "license": "UNLICENSED",
"private": false, "private": false,
@@ -106,8 +109,7 @@
} }
}, },
"dependencies": { "dependencies": {
"clsx": "^2.1.1", "cn": "0.5.2",
"crypto-js": "^4.2.0", "crypto-js": "^4.2.0"
"tailwind-merge": "^3.4.0"
} }
} }

View File

@@ -1,13 +1,9 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
/** /**
* 조건부 className을 결합하고 * 조건부 className을 결합하고
* 충돌하는 Tailwind CSS 클래스를 정리한다. * 충돌하는 Tailwind CSS 클래스를 정리한다.
*
* npm `cn` 패키지(clsx + tailwind-merge 대체, 동일 결과)를 그대로 내보낸다.
*/ */
export const cn = (...inputs: ClassValue[]): string => { export { cn } from "cn";
return twMerge(clsx(inputs));
};
export type { ClassValue }; export type { ClassValue } from "cn";