1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! The crate-internal `npm-utils:` warning channel. Library code calls [`warn`] instead of
//! `eprintln!("npm-utils: …")` so a renderer (the CLI's live progress region) can reroute the
//! line above its display instead of having it torn mid-redraw; with no sink installed the
//! behavior is byte-identical to the old eprintln. Same once-per-process [`OnceLock`] pattern
//! as [`crate::download::set_timeouts`].
use OnceLock;
type Sink = ;
static SINK: = new;
/// Install the process-wide warning sink; the first caller wins and later calls are ignored, so
/// in-process tests tolerate an already-installed sink. The sink receives the message *without*
/// the `npm-utils: ` prefix and must expect calls from worker threads (download retries fire on
/// the resolver's prefetch pool).
pub
/// Emit one `npm-utils:` warning: through the installed sink, else the default
/// `eprintln!("npm-utils: {msg}")`.
pub