@suds-cli/timer 0.0.0
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 +70 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +37 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +41 -0
- package/dist/messages.js.map +1 -0
- package/dist/model.d.ts +43 -0
- package/dist/model.d.ts.map +1 -0
- package/dist/model.js +129 -0
- package/dist/model.js.map +1 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @suds-cli/timer
|
|
2
|
+
|
|
3
|
+
Countdown timer component for Suds terminal UIs. Port of Charmbracelet Bubbles timer.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @suds-cli/timer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quickstart
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { TimerModel, TickMsg, TimeoutMsg } from "@suds-cli/timer";
|
|
15
|
+
import type { Cmd, Msg, Model } from "@suds-cli/tea";
|
|
16
|
+
|
|
17
|
+
const timer = TimerModel.new({ timeout: 30_000 }); // 30 seconds
|
|
18
|
+
|
|
19
|
+
function init(): Cmd<Msg> {
|
|
20
|
+
return timer.init();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function update(msg: Msg): [Model, Cmd<Msg>] {
|
|
24
|
+
if (msg instanceof TickMsg || msg instanceof TimeoutMsg) {
|
|
25
|
+
const [nextTimer, cmd] = timer.update(msg);
|
|
26
|
+
return [{ ...model, timer: nextTimer }, cmd];
|
|
27
|
+
}
|
|
28
|
+
return [model, null];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function view(): string {
|
|
32
|
+
return `Remaining ${timer.view()}`;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## API
|
|
37
|
+
|
|
38
|
+
| Export | Description |
|
|
39
|
+
|--------|-------------|
|
|
40
|
+
| `TimerModel` | Countdown timer model |
|
|
41
|
+
| `TimerOptions` | Options for creating a timer |
|
|
42
|
+
| `TickMsg` | Tick message carrying ID/tag/timeout flag |
|
|
43
|
+
| `TimeoutMsg` | Message emitted when timer expires |
|
|
44
|
+
| `StartStopMsg` | Message to start/stop the timer |
|
|
45
|
+
|
|
46
|
+
### TimerModel methods
|
|
47
|
+
|
|
48
|
+
| Method | Description |
|
|
49
|
+
|--------|-------------|
|
|
50
|
+
| `id()` | Unique ID for message routing |
|
|
51
|
+
| `running()` | Whether the timer is active |
|
|
52
|
+
| `timedOut()` | Whether the timer has expired |
|
|
53
|
+
| `init()` | Start ticking on init |
|
|
54
|
+
| `update(msg)` | Handle messages, returns `[model, cmd]` |
|
|
55
|
+
| `view()` | Render remaining time |
|
|
56
|
+
| `start()/stop()/toggle()` | Control commands |
|
|
57
|
+
|
|
58
|
+
## Scripts
|
|
59
|
+
|
|
60
|
+
- `pnpm -C packages/timer build`
|
|
61
|
+
- `pnpm -C packages/timer test`
|
|
62
|
+
- `pnpm -C packages/timer lint`
|
|
63
|
+
- `pnpm -C packages/timer generate:api-report`
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,UAAU,EAAoC,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Tick message for timer countdown. @public */
|
|
2
|
+
export declare class TickMsg {
|
|
3
|
+
/** Unique timer ID */
|
|
4
|
+
readonly id: number;
|
|
5
|
+
/** Internal tag for deduplication */
|
|
6
|
+
readonly tag: number;
|
|
7
|
+
/** Whether this tick indicates the timer expired */
|
|
8
|
+
readonly timeout: boolean;
|
|
9
|
+
readonly _tag = "timer-tick";
|
|
10
|
+
constructor(
|
|
11
|
+
/** Unique timer ID */
|
|
12
|
+
id: number,
|
|
13
|
+
/** Internal tag for deduplication */
|
|
14
|
+
tag: number,
|
|
15
|
+
/** Whether this tick indicates the timer expired */
|
|
16
|
+
timeout: boolean);
|
|
17
|
+
}
|
|
18
|
+
/** Message emitted once when the timer times out. @public */
|
|
19
|
+
export declare class TimeoutMsg {
|
|
20
|
+
readonly id: number;
|
|
21
|
+
readonly _tag = "timer-timeout";
|
|
22
|
+
constructor(id: number);
|
|
23
|
+
}
|
|
24
|
+
/** Message that starts or stops the timer. @public */
|
|
25
|
+
export declare class StartStopMsg {
|
|
26
|
+
/** Unique timer ID */
|
|
27
|
+
readonly id: number;
|
|
28
|
+
/** True to run, false to pause */
|
|
29
|
+
readonly running: boolean;
|
|
30
|
+
readonly _tag = "timer-start-stop";
|
|
31
|
+
constructor(
|
|
32
|
+
/** Unique timer ID */
|
|
33
|
+
id: number,
|
|
34
|
+
/** True to run, false to pause */
|
|
35
|
+
running: boolean);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,qBAAa,OAAO;IAIhB,sBAAsB;aACN,EAAE,EAAE,MAAM;IAC1B,qCAAqC;aACrB,GAAG,EAAE,MAAM;IAC3B,oDAAoD;aACpC,OAAO,EAAE,OAAO;IARlC,QAAQ,CAAC,IAAI,gBAAgB;;IAG3B,sBAAsB;IACN,EAAE,EAAE,MAAM;IAC1B,qCAAqC;IACrB,GAAG,EAAE,MAAM;IAC3B,oDAAoD;IACpC,OAAO,EAAE,OAAO;CAEnC;AAED,6DAA6D;AAC7D,qBAAa,UAAU;aAGO,EAAE,EAAE,MAAM;IAFtC,QAAQ,CAAC,IAAI,mBAAmB;gBAEJ,EAAE,EAAE,MAAM;CACvC;AAED,sDAAsD;AACtD,qBAAa,YAAY;IAIrB,sBAAsB;aACN,EAAE,EAAE,MAAM;IAC1B,kCAAkC;aAClB,OAAO,EAAE,OAAO;IANlC,QAAQ,CAAC,IAAI,sBAAsB;;IAGjC,sBAAsB;IACN,EAAE,EAAE,MAAM;IAC1B,kCAAkC;IAClB,OAAO,EAAE,OAAO;CAEnC"}
|
package/dist/messages.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** Tick message for timer countdown. @public */
|
|
2
|
+
export class TickMsg {
|
|
3
|
+
id;
|
|
4
|
+
tag;
|
|
5
|
+
timeout;
|
|
6
|
+
_tag = "timer-tick";
|
|
7
|
+
constructor(
|
|
8
|
+
/** Unique timer ID */
|
|
9
|
+
id,
|
|
10
|
+
/** Internal tag for deduplication */
|
|
11
|
+
tag,
|
|
12
|
+
/** Whether this tick indicates the timer expired */
|
|
13
|
+
timeout) {
|
|
14
|
+
this.id = id;
|
|
15
|
+
this.tag = tag;
|
|
16
|
+
this.timeout = timeout;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** Message emitted once when the timer times out. @public */
|
|
20
|
+
export class TimeoutMsg {
|
|
21
|
+
id;
|
|
22
|
+
_tag = "timer-timeout";
|
|
23
|
+
constructor(id) {
|
|
24
|
+
this.id = id;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** Message that starts or stops the timer. @public */
|
|
28
|
+
export class StartStopMsg {
|
|
29
|
+
id;
|
|
30
|
+
running;
|
|
31
|
+
_tag = "timer-start-stop";
|
|
32
|
+
constructor(
|
|
33
|
+
/** Unique timer ID */
|
|
34
|
+
id,
|
|
35
|
+
/** True to run, false to pause */
|
|
36
|
+
running) {
|
|
37
|
+
this.id = id;
|
|
38
|
+
this.running = running;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,OAAO,OAAO;IAKA;IAEA;IAEA;IART,IAAI,GAAG,YAAY,CAAC;IAE7B;IACE,sBAAsB;IACN,EAAU;IAC1B,qCAAqC;IACrB,GAAW;IAC3B,oDAAoD;IACpC,OAAgB;QAJhB,OAAE,GAAF,EAAE,CAAQ;QAEV,QAAG,GAAH,GAAG,CAAQ;QAEX,YAAO,GAAP,OAAO,CAAS;IAC/B,CAAC;CACL;AAED,6DAA6D;AAC7D,MAAM,OAAO,UAAU;IAGO;IAFnB,IAAI,GAAG,eAAe,CAAC;IAEhC,YAA4B,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;IAAG,CAAC;CAC3C;AAED,sDAAsD;AACtD,MAAM,OAAO,YAAY;IAKL;IAEA;IANT,IAAI,GAAG,kBAAkB,CAAC;IAEnC;IACE,sBAAsB;IACN,EAAU;IAC1B,kCAAkC;IAClB,OAAgB;QAFhB,OAAE,GAAF,EAAE,CAAQ;QAEV,YAAO,GAAP,OAAO,CAAS;IAC/B,CAAC;CACL"}
|
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Cmd, type Msg as TeaMsg, type Model as TeaModel } from "@suds-cli/tea";
|
|
2
|
+
import { StartStopMsg, TickMsg, TimeoutMsg } from "./messages.js";
|
|
3
|
+
/** Options for creating a timer. @public */
|
|
4
|
+
export interface TimerOptions {
|
|
5
|
+
/** Milliseconds until the timer expires. */
|
|
6
|
+
timeout: number;
|
|
7
|
+
/** Tick interval in milliseconds (default: 1000). */
|
|
8
|
+
interval?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Timer messages. @public */
|
|
11
|
+
export type TimerMsg = TickMsg | TimeoutMsg | StartStopMsg;
|
|
12
|
+
/** Countdown timer model. @public */
|
|
13
|
+
export declare class TimerModel implements TeaModel<TimerMsg, TimerModel> {
|
|
14
|
+
#private;
|
|
15
|
+
readonly timeout: number;
|
|
16
|
+
readonly interval: number;
|
|
17
|
+
private constructor();
|
|
18
|
+
/** Create a new timer with the given options. */
|
|
19
|
+
static new(options: TimerOptions): TimerModel;
|
|
20
|
+
/** Create a new timer with explicit timeout and interval. */
|
|
21
|
+
static withInterval(timeout: number, interval: number): TimerModel;
|
|
22
|
+
/** Unique ID for message routing. */
|
|
23
|
+
id(): number;
|
|
24
|
+
/** Whether the timer is currently running (false once timed out). */
|
|
25
|
+
running(): boolean;
|
|
26
|
+
/** Whether the timer has expired. */
|
|
27
|
+
timedOut(): boolean;
|
|
28
|
+
/** Start ticking. */
|
|
29
|
+
init(): Cmd<TimerMsg>;
|
|
30
|
+
/** Update the timer in response to a message. */
|
|
31
|
+
update(msg: TeaMsg): [TimerModel, Cmd<TimerMsg>];
|
|
32
|
+
/** Render remaining time as a human-readable string. */
|
|
33
|
+
view(): string;
|
|
34
|
+
/** Command to start the timer. */
|
|
35
|
+
start(): Cmd<TimerMsg>;
|
|
36
|
+
/** Command to stop/pause the timer. */
|
|
37
|
+
stop(): Cmd<TimerMsg>;
|
|
38
|
+
/** Command to toggle running state. */
|
|
39
|
+
toggle(): Cmd<TimerMsg>;
|
|
40
|
+
private tick;
|
|
41
|
+
private startStop;
|
|
42
|
+
}
|
|
43
|
+
//# sourceM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ClC,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC;IAItB,uCAAuC;IACvC,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAC;IAIrB,uCAAuC;IACvC,MAAM,IAAI,GAAG,CAAC,QAAQ,CAAC;IAIvB,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,SAAS;CAGlB"}
|
package/dist/model.js
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { batch, msg as lift, tick } from "@suds-cli/tea";
|
|
2
|
+
import { StartStopMsg, TickMsg, TimeoutMsg } from "./messages.js";
|
|
3
|
+
// Module-level ID counter for unique timers
|
|
4
|
+
let lastId = 0;
|
|
5
|
+
function nextId() {
|
|
6
|
+
return ++lastId;
|
|
7
|
+
}
|
|
8
|
+
/** Countdown timer model. @public */
|
|
9
|
+
export class TimerModel {
|
|
10
|
+
timeout;
|
|
11
|
+
interval;
|
|
12
|
+
#id;
|
|
13
|
+
#tag;
|
|
14
|
+
#running;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.timeout = options.timeout;
|
|
17
|
+
this.interval = options.interval;
|
|
18
|
+
this.#running = options.running;
|
|
19
|
+
this.#id = options.id;
|
|
20
|
+
this.#tag = options.tag;
|
|
21
|
+
}
|
|
22
|
+
/** Create a new timer with the given options. */
|
|
23
|
+
static new(options) {
|
|
24
|
+
const interval = options.interval ?? 1000;
|
|
25
|
+
return new TimerModel({
|
|
26
|
+
timeout: options.timeout,
|
|
27
|
+
interval,
|
|
28
|
+
running: true,
|
|
29
|
+
id: nextId(),
|
|
30
|
+
tag: 0,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Create a new timer with explicit timeout and interval. */
|
|
34
|
+
static withInterval(timeout, interval) {
|
|
35
|
+
return TimerModel.new({ timeout, interval });
|
|
36
|
+
}
|
|
37
|
+
/** Unique ID for message routing. */
|
|
38
|
+
id() {
|
|
39
|
+
return this.#id;
|
|
40
|
+
}
|
|
41
|
+
/** Whether the timer is currently running (false once timed out). */
|
|
42
|
+
running() {
|
|
43
|
+
if (this.timedOut()) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
return this.#running;
|
|
47
|
+
}
|
|
48
|
+
/** Whether the timer has expired. */
|
|
49
|
+
timedOut() {
|
|
50
|
+
return this.timeout <= 0;
|
|
51
|
+
}
|
|
52
|
+
/** Start ticking. */
|
|
53
|
+
init() {
|
|
54
|
+
return this.tick();
|
|
55
|
+
}
|
|
56
|
+
/** Update the timer in response to a message. */
|
|
57
|
+
update(msg) {
|
|
58
|
+
if (msg instanceof StartStopMsg) {
|
|
59
|
+
if (msg.id !== 0 && msg.id !== this.#id) {
|
|
60
|
+
return [this, null];
|
|
61
|
+
}
|
|
62
|
+
const next = new TimerModel({
|
|
63
|
+
timeout: this.timeout,
|
|
64
|
+
interval: this.interval,
|
|
65
|
+
running: msg.running,
|
|
66
|
+
id: this.#id,
|
|
67
|
+
tag: this.#tag,
|
|
68
|
+
});
|
|
69
|
+
return [next, next.tick()];
|
|
70
|
+
}
|
|
71
|
+
if (msg instanceof TickMsg) {
|
|
72
|
+
if (!this.running() || (msg.id !== 0 && msg.id !== this.#id)) {
|
|
73
|
+
return [this, null];
|
|
74
|
+
}
|
|
75
|
+
if (msg.tag > 0 && msg.tag !== this.#tag) {
|
|
76
|
+
return [this, null];
|
|
77
|
+
}
|
|
78
|
+
const nextTimeout = this.timeout - this.interval;
|
|
79
|
+
const nextTag = this.#tag + 1;
|
|
80
|
+
const next = new TimerModel({
|
|
81
|
+
timeout: nextTimeout,
|
|
82
|
+
interval: this.interval,
|
|
83
|
+
running: this.#running,
|
|
84
|
+
id: this.#id,
|
|
85
|
+
tag: nextTag,
|
|
86
|
+
});
|
|
87
|
+
const timeoutCmd = next.timedOut() ? lift(new TimeoutMsg(this.#id)) : null;
|
|
88
|
+
const tickCmd = next.timedOut() ? null : next.tick();
|
|
89
|
+
return [next, batch(tickCmd, timeoutCmd)];
|
|
90
|
+
}
|
|
91
|
+
return [this, null];
|
|
92
|
+
}
|
|
93
|
+
/** Render remaining time as a human-readable string. */
|
|
94
|
+
view() {
|
|
95
|
+
return formatDuration(Math.max(0, this.timeout));
|
|
96
|
+
}
|
|
97
|
+
/** Command to start the timer. */
|
|
98
|
+
start() {
|
|
99
|
+
return this.startStop(true);
|
|
100
|
+
}
|
|
101
|
+
/** Command to stop/pause the timer. */
|
|
102
|
+
stop() {
|
|
103
|
+
return this.startStop(false);
|
|
104
|
+
}
|
|
105
|
+
/** Command to toggle running state. */
|
|
106
|
+
toggle() {
|
|
107
|
+
return this.startStop(!this.running());
|
|
108
|
+
}
|
|
109
|
+
tick() {
|
|
110
|
+
const id = this.#id;
|
|
111
|
+
const tag = this.#tag;
|
|
112
|
+
return tick(this.interval, () => new TickMsg(id, tag, this.timedOut()));
|
|
113
|
+
}
|
|
114
|
+
startStop(running) {
|
|
115
|
+
return lift(new StartStopMsg(this.#id, running));
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Simple duration formatter (e.g., 1h2m3s)
|
|
119
|
+
function formatDuration(ms) {
|
|
120
|
+
const seconds = Math.floor(ms / 1000) % 60;
|
|
121
|
+
const minutes = Math.floor(ms / 60000) % 60;
|
|
122
|
+
const hours = Math.floor(ms / 3600000);
|
|
123
|
+
if (hours > 0)
|
|
124
|
+
return `${hours}h${minutes}m${seconds}s`;
|
|
125
|
+
if (minutes > 0)
|
|
126
|
+
return `${minutes}m${seconds}s`;
|
|
127
|
+
return `${seconds}s`;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,IAAI,EAAwD,MAAM,eAAe,CAAC;AAC/G,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAElE,4CAA4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AC;QACtB,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEO,SAAS,CAAC,OAAgB;QAChC,OAAO,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC;CACF;AAED,2CAA2C;AAC3C,SAAS,cAAc,CAAC,EAAU;IAChC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC;IAEvC,IAAI,KAAK,GAAG,CAAC;QAAE,OAAO,GAAG,KAAK,IAAI,OAAO,IAAI,OAAO,GAAG,CAAC;IACxD,IAAI,OAAO,GAAG,CAAC;QAAE,OAAO,GAAG,OAAO,IAAI,OAAO,GAAG,CAAC;IACjD,OAAO,GAAG,OAAO,GAAG,CAAC;AACvB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@suds-cli/timer",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Countdown timer component for Suds terminal UIs",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@suds-cli/tea": "0.0.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"typescript": "5.8.2",
|
|
16
|
+
"vitest": "^4.0.15"
|
|
17
|
+
},
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=20.0.0"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"build": "pnpm run clean && tsc -p ./tsconfig.json",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"generate:api-report": "api-extractor run --local",
|
|
26
|
+
"check:api-report": "pnpm run generate:api-report",
|
|
27
|
+
"check:eslint": "pnpm run lint",
|
|
28
|
+
"lint": "eslint \"{src,test}/**/*.{ts,tsx}\""
|
|
29
|
+
}
|
|
30
|
+
}
|