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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Command implementations module for Node.js bindings.
//!
//! # What
//!
//! This module contains the implementations of all NAPI functions that are
//! exposed to JavaScript/TypeScript. Each submodule corresponds to a command
//! group and contains the actual async functions that execute CLI operations.
//!
//! # How
//!
//! The module is organized by command group:
//!
//! - **`status`**: Workspace status command
//! - **`init`**: Workspace initialization command
//! - **`config`**: Configuration commands (show, validate)
//! - **`changeset`**: Changeset workflow commands (add, update, list, show, remove, history, check)
//! - **`bump`**: Version bump commands (preview, apply, snapshot)
//! - **`upgrade`**: Dependency upgrade commands (check, apply, backup)
//! - **`audit`**: Workspace audit command
//! - **`changes`**: Change analysis command
//! - **`clone`**: Repository clone command
//! - **`execute`**: Command execution across packages
//!
//! Each command function:
//! 1. Validates input parameters using the `validation` module
//! 2. Calls the appropriate `execute_*` function from `sublime_cli_tools`
//! 3. Captures and parses the JSON output
//! 4. Returns a `JsonResponse<T>` with the result
//!
//! # Why
//!
//! Separating command implementations by group provides:
//! - Clear organization matching the CLI structure
//! - Easier maintenance and testing
//! - Logical grouping for related functionality
//!
//! # Examples
//!
//! ```typescript
//! import { status, changesetAdd, bumpPreview } from '@websublime/workspace-tools';
//!
//! // All functions return JsonResponse<T>
//! const statusResult = await status({ root: '.' });
//! const changesetResult = await changesetAdd({
//! root: '.',
//! packages: ['@scope/pkg'],
//! bumpType: 'minor',
//! message: 'Add feature'
//! });
//! const previewResult = await bumpPreview({ root: '.', showDiff: true });
//! ```
// TODO: will be implemented on story 3.2 (status command)
pub
// TODO: will be implemented on story 3.4 (init command)
pub
// TODO: will be implemented on story 7.2-7.3 (config commands)
pub
// TODO: will be implemented on story 4.2-4.8 (changeset commands)
pub
// TODO: will be implemented on story 5.2-5.4 (bump commands)
pub
// TODO: will be implemented on story 8.2-8.4 (upgrade commands)
pub
// TODO: will be implemented on story 9.1 (audit command)
pub
// TODO: will be implemented on story 9.2 (changes command)
pub
// TODO: will be implemented on story 9.3 (clone command)
pub
// TODO: will be implemented on story 6.3 (execute command)
pub