@jeremyy_prt/cc-config 1.1.2 → 1.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jeremyy_prt/cc-config",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Configuration personnalisée pour Claude Code avec commandes et agents en français",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -11,6 +11,9 @@
11
11
  "lint": "biome check --write .",
12
12
  "format": "biome format --write ."
13
13
  },
14
+ "dependencies": {
15
+ "tsx": "^4.19.2"
16
+ },
14
17
  "devDependencies": {
15
18
  "@biomejs/biome": "^2.3.2",
16
19
  "@types/bun": "latest"
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
2
 
3
3
  import type { StatuslineConfig } from "../statusline.config";
4
4
  import { defaultConfig } from "../statusline.config";
@@ -18,6 +18,21 @@ import { saveSession } from "./lib/spend";
18
18
  import type { HookInput } from "./lib/types";
19
19
  import { getUsageLimits } from "./lib/usage-limits";
20
20
 
21
+ // Fonction pour lire stdin de manière compatible Node.js et Bun
22
+ async function getStdin(): Promise<string> {
23
+ // Si Bun est disponible, utiliser Bun.stdin
24
+ if (typeof Bun !== "undefined") {
25
+ return await Bun.stdin.text();
26
+ }
27
+
28
+ // Sinon, utiliser process.stdin (Node.js)
29
+ const chunks: Buffer[] = [];
30
+ for await (const chunk of process.stdin) {
31
+ chunks.push(chunk as Buffer);
32
+ }
33
+ return Buffer.concat(chunks).toString("utf-8");
34
+ }
35
+
21
36
  function buildFirstLine(
22
37
  branch: string,
23
38
  dirPath: string,
@@ -122,7 +137,8 @@ function buildThirdLine(
122
137
 
123
138
  async function main() {
124
139
  try {
125
- const input: HookInput = await Bun.stdin.json();
140
+ const stdinData = await getStdin();
141
+ const input: HookInput = JSON.parse(stdinData);
126
142
 
127
143
  await saveSession(input);
128
144
 
package/settings.json CHANGED
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "statusLine": {
16
16
  "type": "command",
17
- "command": "node ${CLAUDE_CONFIG_DIR}/scripts/statusline/src/index.ts",
17
+ "command": "npx tsx ${CLAUDE_CONFIG_DIR}/scripts/statusline/src/index.ts",
18
18
  "padding": 0
19
19
  }
20
20
  }