kcachat 0.1.3 → 0.1.4
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/README.md +5 -9
- package/cli.mjs +40 -20
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,16 +7,12 @@ npx kcachat@latest "./KakaoTalk_Chat_....csv" --local
|
|
|
7
7
|
npx kcachat@latest "./KakaoTalk_Chat_....csv"
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
### `npx
|
|
10
|
+
### `npx`·버전
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
- `
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
npx --yes --prefer-online kcachat@latest --version
|
|
17
|
-
npx --yes --prefer-online kakaotalk-chat-analyzer@latest "./파일.csv" --local
|
|
18
|
-
```
|
|
19
|
-
- 설치된 버전 확인: `npx kcachat@latest --version` → `kcachat` / `kakaotalk-chat-analyzer` 두 줄이 출력됩니다.
|
|
12
|
+
- **0.1.4부터** `kcachat`는 실행할 때마다 `npx kakaotalk-chat-analyzer@latest`로 **본체 최신**을 받아 실행합니다(네트워크 필요).
|
|
13
|
+
- 오프라인·고정 버전만 쓰려면 `--bundled` 또는 환경 변수 `KCA_BUNDLED=1` (설치 시 함께 깔린 본체 사용).
|
|
14
|
+
- 설치 확인 문구가 안 뜨는 것은 `~/.npm/_npx` 캐시 때문일 수 있습니다.
|
|
15
|
+
- 버전 확인: `npx kcachat@latest --version` → `kcachat` 줄 + registry 최신 본체 버전.
|
|
20
16
|
|
|
21
17
|
- 전체 패키지명: [kakaotalk-chat-analyzer](https://www.npmjs.com/package/kakaotalk-chat-analyzer)
|
|
22
18
|
- 소개·시작 가이드(랜딩): [GitHub Pages](https://claudianus.github.io/kakaotalk-chat-analyzer/)
|
package/cli.mjs
CHANGED
|
@@ -7,8 +7,14 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
|
|
8
8
|
const require = createRequire(import.meta.url);
|
|
9
9
|
const kcachatRoot = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const wrapperVersion = JSON.parse(readFileSync(join(kcachatRoot, "package.json"), "utf8")).version;
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
const rawArgs = process.argv.slice(2);
|
|
13
|
+
const useBundled =
|
|
14
|
+
process.env.KCA_BUNDLED === "1" || rawArgs.includes("--bundled");
|
|
15
|
+
const args = rawArgs.filter((a) => a !== "--bundled");
|
|
16
|
+
|
|
17
|
+
function resolveBundled() {
|
|
12
18
|
const pkgPath = require.resolve("kakaotalk-chat-analyzer/package.json");
|
|
13
19
|
const root = dirname(pkgPath);
|
|
14
20
|
return {
|
|
@@ -17,31 +23,45 @@ function resolveMain() {
|
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
function spawnNpxLatest(forwardArgs) {
|
|
27
|
+
const npx = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
28
|
+
return spawnSync(npx, ["--yes", "--prefer-online", "kakaotalk-chat-analyzer@latest", ...forwardArgs], {
|
|
29
|
+
stdio: "inherit",
|
|
30
|
+
env: process.env,
|
|
31
|
+
shell: process.platform === "win32",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function runBundled(forwardArgs) {
|
|
36
|
+
let target;
|
|
23
37
|
try {
|
|
24
|
-
|
|
38
|
+
target = resolveBundled().cli;
|
|
25
39
|
} catch {
|
|
26
|
-
console.error(
|
|
40
|
+
console.error(
|
|
41
|
+
'[kcachat] 번들된 "kakaotalk-chat-analyzer"를 찾지 못했습니다. npm i kcachat 후 다시 시도하거나 --bundled 없이 실행해 주세요.',
|
|
42
|
+
);
|
|
27
43
|
process.exit(1);
|
|
28
44
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
45
|
+
return spawnSync(process.execPath, [target, ...forwardArgs], {
|
|
46
|
+
stdio: "inherit",
|
|
47
|
+
env: process.env,
|
|
48
|
+
});
|
|
33
49
|
}
|
|
34
50
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
51
|
+
if (args.includes("--version") || args.includes("-V")) {
|
|
52
|
+
console.log(`kcachat ${wrapperVersion}`);
|
|
53
|
+
if (useBundled) {
|
|
54
|
+
try {
|
|
55
|
+
console.log(`kakaotalk-chat-analyzer ${resolveBundled().version} (bundled)`);
|
|
56
|
+
} catch {
|
|
57
|
+
console.error('[kcachat] bundled 본체를 찾지 못했습니다.');
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
const result = spawnNpxLatest(["--version"]);
|
|
63
|
+
process.exit(result.status ?? 1);
|
|
41
64
|
}
|
|
42
65
|
|
|
43
|
-
const result =
|
|
44
|
-
stdio: "inherit",
|
|
45
|
-
env: process.env,
|
|
46
|
-
});
|
|
66
|
+
const result = useBundled ? runBundled(args) : spawnNpxLatest(args);
|
|
47
67
|
process.exit(result.status ?? 1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kcachat",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "짧은 npx 이름으로 kakaotalk-chat-analyzer(kca) CLI를 실행합니다.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"kakaotalk-chat-analyzer": "
|
|
15
|
+
"kakaotalk-chat-analyzer": "0.2.9"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"kakaotalk",
|