cc-cream 0.1.16 → 0.1.17
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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/cc-cream.js +5 -20
- package/src/install.js +5 -2
- package/src/utils.js +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to cc-cream are documented here. Format follows
|
|
|
4
4
|
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
|
|
5
5
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.1.17] — 2026-05-29
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **`cc-cream-setup` and the `/cc-cream:*` slash commands silently did nothing when `~/.claude` is a symlink.** `install.js` had the same symlink-fragile entrypoint guard fixed in the renderer for 0.1.16 (`import.meta.url` is canonicalized by Node's ESM loader; `process.argv[1]` is not), so running it from a symlinked path skipped `main()` entirely — exit 0, no output, settings.json untouched. The "am-I-the-entrypoint?" check is now a single symlink-robust helper (`isEntrypoint` in `src/utils.js`) shared by both `cc-cream.js` and `install.js`. Caught by the new install-journey smoke tests.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **End-to-end install/uninstall journey smoke tests** (`features/27-install-journey.feature`, CREAM-fxsusmgd). They stage a real plugin cache the way `/plugin install` lays it out, run the actual `SessionStart` hook and `install.js` as child processes, and execute the baked statusLine command through `sh -c` exactly as Claude Code does — guarding the *seams* unit specs can't: cache layout, the settings.json lifecycle, command order, the empty-cache guard (0.1.15), and symlinked config dirs (0.1.16). CI-safe; no live `claude` CLI needed.
|
|
14
|
+
|
|
7
15
|
## [0.1.16] — 2026-05-29
|
|
8
16
|
|
|
9
17
|
### Fixed
|
|
@@ -134,6 +142,7 @@ line and prints a colored ≤3-row bar — zero tokens, the model never sees it.
|
|
|
134
142
|
- Supports **macOS and Linux**; Windows is a planned fast-follow.
|
|
135
143
|
- Requires Claude Code **2.1.132+** (`effort` / `thinking` need 2.1.145+).
|
|
136
144
|
|
|
145
|
+
[0.1.17]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.16...v0.1.17
|
|
137
146
|
[0.1.16]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.15...v0.1.16
|
|
138
147
|
[0.1.15]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.14...v0.1.15
|
|
139
148
|
[0.1.6]: https://github.com/bart-turczynski/cc-cream/compare/v0.1.5...v0.1.6
|
package/package.json
CHANGED
package/src/cc-cream.js
CHANGED
|
@@ -3,11 +3,9 @@
|
|
|
3
3
|
// Reads the session JSON Claude Code pipes on stdin and prints a colored
|
|
4
4
|
// <=3-row bar. Hard rule: degrade, never crash.
|
|
5
5
|
|
|
6
|
-
import { realpathSync } from 'node:fs';
|
|
7
6
|
import os from 'node:os';
|
|
8
7
|
import path from 'node:path';
|
|
9
8
|
import process from 'node:process';
|
|
10
|
-
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
11
9
|
import { loadConfig, readConfigFile } from './config.js';
|
|
12
10
|
import { render } from './render.js';
|
|
13
11
|
import {
|
|
@@ -17,6 +15,7 @@ import {
|
|
|
17
15
|
readState,
|
|
18
16
|
writeState,
|
|
19
17
|
} from './state.js';
|
|
18
|
+
import { isEntrypoint } from './utils.js';
|
|
20
19
|
|
|
21
20
|
export { DEFAULTS } from './defaults.js';
|
|
22
21
|
export { loadConfig } from './config.js';
|
|
@@ -73,23 +72,9 @@ async function main() {
|
|
|
73
72
|
process.exit(0);
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
//
|
|
77
|
-
// import.meta.url (
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
// or synced via iCloud/Dropbox — skipping main() so the bar renders NOTHING with no
|
|
81
|
-
// error. Comparing realpaths makes the symlinked and canonical paths match. Falls
|
|
82
|
-
// back to the href comparison if realpath fails (e.g. a path that no longer exists).
|
|
83
|
-
function isEntrypoint() {
|
|
84
|
-
const arg = process.argv[1];
|
|
85
|
-
if (!arg) return false;
|
|
86
|
-
try {
|
|
87
|
-
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(arg);
|
|
88
|
-
} catch {
|
|
89
|
-
return import.meta.url === pathToFileURL(arg).href;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isEntrypoint()) {
|
|
75
|
+
// isEntrypoint (src/utils.js) is symlink-robust — see its comment. A plain
|
|
76
|
+
// import.meta.url === pathToFileURL(argv[1]) check fails under a symlinked path and
|
|
77
|
+
// renders nothing with no error.
|
|
78
|
+
if (isEntrypoint(import.meta.url)) {
|
|
94
79
|
main();
|
|
95
80
|
}
|
package/src/install.js
CHANGED
|
@@ -14,7 +14,7 @@ import os from 'node:os';
|
|
|
14
14
|
import path from 'node:path';
|
|
15
15
|
import process from 'node:process';
|
|
16
16
|
import readline from 'node:readline';
|
|
17
|
-
import {
|
|
17
|
+
import { isEntrypoint } from './utils.js';
|
|
18
18
|
|
|
19
19
|
const TRUST_NOTE =
|
|
20
20
|
'Claude Code must be trusted and possibly restarted for the status line to appear.';
|
|
@@ -328,6 +328,9 @@ async function main() {
|
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
330
|
|
|
331
|
-
|
|
331
|
+
// isEntrypoint (src/utils.js) is symlink-robust: a plain href comparison fails when
|
|
332
|
+
// install.js runs from a symlinked path (e.g. a dotfile-managed ~/.claude), which
|
|
333
|
+
// would make `cc-cream-setup` / the slash commands silently do nothing.
|
|
334
|
+
if (isEntrypoint(import.meta.url)) {
|
|
332
335
|
main();
|
|
333
336
|
}
|
package/src/utils.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
1
4
|
import { ANSI } from './defaults.js';
|
|
2
5
|
|
|
6
|
+
// Robust "is this module the process entrypoint?" check, shared by every module
|
|
7
|
+
// that may run both as a script and as an import (cc-cream.js, install.js). Node's
|
|
8
|
+
// ESM loader canonicalizes import.meta.url (symlinks resolved) but leaves
|
|
9
|
+
// process.argv[1] as-invoked, so a plain href comparison fails when the module runs
|
|
10
|
+
// from a symlinked path — e.g. a ~/.claude managed by a dotfile manager
|
|
11
|
+
// (stow/chezmoi/yadm) or synced via iCloud/Dropbox — silently skipping main().
|
|
12
|
+
// Comparing realpaths fixes it; falls back to the href compare if realpath throws
|
|
13
|
+
// (e.g. a path that no longer exists). Pass the caller's import.meta.url.
|
|
14
|
+
export function isEntrypoint(metaUrl, arg = process.argv[1]) {
|
|
15
|
+
if (!arg) return false;
|
|
16
|
+
try {
|
|
17
|
+
return realpathSync(fileURLToPath(metaUrl)) === realpathSync(arg);
|
|
18
|
+
} catch {
|
|
19
|
+
return metaUrl === pathToFileURL(arg).href;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
3
23
|
export const clone = (o) => JSON.parse(JSON.stringify(o));
|
|
4
24
|
export const isNum = (v) => typeof v === 'number' && Number.isFinite(v);
|
|
5
25
|
export const numOr = (v, d) => (isNum(v) ? v : d);
|