claude-code-kr 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cc-kr.js CHANGED
@@ -8,13 +8,13 @@ const mappings = require('../lib/mappings');
8
8
  const hooks = require('../lib/hooks');
9
9
  const pkg = require('../package.json');
10
10
 
11
- // npm global 설치 sudo 필요 여부 체크
11
+ // 실제로 설치된 cckr 디렉토리가 쓰기 가능한지 체크
12
+ // __dirname = .../node_modules/claude-code-kr/bin
13
+ // 부모(.../node_modules/claude-code-kr)가 쓰기 가능하면 sudo 불필요
12
14
  function needsSudo() {
13
15
  try {
14
- const prefix = execSync('npm prefix -g', { encoding: 'utf8' }).trim();
15
- const globalNodeModules = path.join(prefix, 'lib', 'node_modules');
16
- // 디렉토리가 존재하고 쓰기 가능한지 확인
17
- fs.accessSync(globalNodeModules, fs.constants.W_OK);
16
+ const installDir = path.dirname(__dirname); // bin/ 부모
17
+ fs.accessSync(installDir, fs.constants.W_OK);
18
18
  return false;
19
19
  } catch {
20
20
  return true;
@@ -105,6 +105,11 @@ const patches = [
105
105
  [/return`\$\{([\w$]+)\}d`;if\(([\w$]+)>0\)return`\$\{\2\}h`;if\(([\w$]+)>0\)return`\$\{\3\}m`;return`\$\{([\w$]+)\}s`/,
106
106
  'return`${$1}일`;if($2>0)return`${$2}시간`;if($3>0)return`${$3}분`;return`${$4}초`'],
107
107
 
108
+ // formatDuration — 인라인 짧은 버전 (spinner용)
109
+ // function fn(q){if(q<60000)return`${Math.round(q/1000)}s`;let K=...,_=...;return _>0?`${K}m ${_}s`:`${K}m`}
110
+ [/if\((\w+)<60000\)return`\$\{Math\.round\(\1\/1000\)\}s`;let (\w+)=Math\.floor\(\1\/60000\),(\w+)=Math\.round\(\1%60000\/1000\);return \3>0\?`\$\{\2\}m \$\{\3\}s`:`\$\{\2\}m`/,
111
+ 'if($1<60000)return`${Math.round($1/1000)}초`;let $2=Math.floor($1/60000),$3=Math.round($1%60000/1000);return $3>0?`${$2}분 ${$3}초`:`${$2}분`'],
112
+
108
113
  // formatNumber compact — "1.3k" → "1.3천", "1.3M" → "130만", "1B" → "10억"
109
114
  // Intl.NumberFormat의 locale을 ko로 바꿈
110
115
  ['new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1,minimumFractionDigits:1})',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-kr",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Claude Code 한글 패치 CLI — /btw → /근데, /help → /도움, /compact → /압축",
5
5
  "main": "./index.js",
6
6
  "bin": {