@braingrid/cli 0.0.9 → 0.1.1
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 +53 -0
- package/README.md +27 -19
- package/dist/build-config.d.ts +4 -8
- package/dist/build-config.d.ts.map +1 -1
- package/dist/build-config.js +21 -8
- package/dist/build-config.js.map +1 -1
- package/dist/cli.js +318 -276
- package/dist/cli.js.map +1 -1
- package/dist/handlers/agent.handlers.d.ts +12 -0
- package/dist/handlers/agent.handlers.d.ts.map +1 -0
- package/dist/handlers/agent.handlers.js +130 -0
- package/dist/handlers/agent.handlers.js.map +1 -0
- package/dist/handlers/auth.handlers.d.ts +7 -1
- package/dist/handlers/auth.handlers.d.ts.map +1 -1
- package/dist/handlers/auth.handlers.js +80 -21
- package/dist/handlers/auth.handlers.js.map +1 -1
- package/dist/handlers/index.d.ts +1 -0
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +1 -0
- package/dist/handlers/index.js.map +1 -1
- package/dist/handlers/init.handlers.js +4 -4
- package/dist/handlers/init.handlers.js.map +1 -1
- package/dist/handlers/project.handlers.d.ts +2 -3
- package/dist/handlers/project.handlers.d.ts.map +1 -1
- package/dist/handlers/project.handlers.js +81 -71
- package/dist/handlers/project.handlers.js.map +1 -1
- package/dist/handlers/requirement.handlers.d.ts.map +1 -1
- package/dist/handlers/requirement.handlers.js +21 -20
- package/dist/handlers/requirement.handlers.js.map +1 -1
- package/dist/handlers/status.handlers.d.ts.map +1 -1
- package/dist/handlers/status.handlers.js +5 -2
- package/dist/handlers/status.handlers.js.map +1 -1
- package/dist/handlers/task.handlers.d.ts.map +1 -1
- package/dist/handlers/task.handlers.js +45 -26
- package/dist/handlers/task.handlers.js.map +1 -1
- package/dist/rpc/registry.d.ts +97 -0
- package/dist/rpc/registry.d.ts.map +1 -0
- package/dist/rpc/registry.js +119 -0
- package/dist/rpc/registry.js.map +1 -0
- package/dist/rpc/server.d.ts +78 -0
- package/dist/rpc/server.d.ts.map +1 -0
- package/dist/rpc/server.js +437 -0
- package/dist/rpc/server.js.map +1 -0
- package/dist/rpc/transport.d.ts +84 -0
- package/dist/rpc/transport.d.ts.map +1 -0
- package/dist/rpc/transport.js +296 -0
- package/dist/rpc/transport.js.map +1 -0
- package/dist/services/__mocks__/utils.d.ts +16 -0
- package/dist/services/__mocks__/utils.d.ts.map +1 -0
- package/dist/services/__mocks__/utils.js +21 -0
- package/dist/services/__mocks__/utils.js.map +1 -0
- package/dist/services/agent-service.d.ts +29 -0
- package/dist/services/agent-service.d.ts.map +1 -0
- package/dist/services/agent-service.js +273 -0
- package/dist/services/agent-service.js.map +1 -0
- package/dist/services/auth.d.ts +18 -0
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +92 -42
- package/dist/services/auth.js.map +1 -1
- package/dist/services/credential-store.d.ts.map +1 -1
- package/dist/services/credential-store.js +1 -0
- package/dist/services/credential-store.js.map +1 -1
- package/dist/services/internal/github-service.d.ts +67 -0
- package/dist/services/internal/github-service.d.ts.map +1 -0
- package/dist/services/internal/github-service.js +81 -0
- package/dist/services/internal/github-service.js.map +1 -0
- package/dist/services/internal/repository-service.d.ts +79 -0
- package/dist/services/internal/repository-service.d.ts.map +1 -0
- package/dist/services/internal/repository-service.js +88 -0
- package/dist/services/internal/repository-service.js.map +1 -0
- package/dist/services/oauth2-auth.d.ts +16 -0
- package/dist/services/oauth2-auth.d.ts.map +1 -1
- package/dist/services/oauth2-auth.js +74 -0
- package/dist/services/oauth2-auth.js.map +1 -1
- package/dist/types/github.d.ts +105 -0
- package/dist/types/github.d.ts.map +1 -0
- package/dist/types/github.js +6 -0
- package/dist/types/github.js.map +1 -0
- package/dist/utils/cli-tools.d.ts.map +1 -1
- package/dist/utils/cli-tools.js +0 -1
- package/dist/utils/cli-tools.js.map +1 -1
- package/dist/utils/git.d.ts +5 -0
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +13 -0
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/id-normalization.d.ts +26 -0
- package/dist/utils/id-normalization.d.ts.map +1 -0
- package/dist/utils/id-normalization.js +45 -0
- package/dist/utils/id-normalization.js.map +1 -0
- package/dist/utils/local-store.d.ts +7 -7
- package/dist/utils/local-store.d.ts.map +1 -1
- package/dist/utils/local-store.js +29 -17
- package/dist/utils/local-store.js.map +1 -1
- package/dist/utils/projects.d.ts +23 -0
- package/dist/utils/projects.d.ts.map +1 -0
- package/dist/utils/projects.js +36 -0
- package/dist/utils/projects.js.map +1 -0
- package/dist/utils/requirements.d.ts +15 -0
- package/dist/utils/requirements.d.ts.map +1 -1
- package/dist/utils/requirements.js +32 -7
- package/dist/utils/requirements.js.map +1 -1
- package/dist/utils/tasks.d.ts +12 -0
- package/dist/utils/tasks.d.ts.map +1 -1
- package/dist/utils/tasks.js +31 -6
- package/dist/utils/tasks.js.map +1 -1
- package/dist/utils/workspace-manager.d.ts +65 -0
- package/dist/utils/workspace-manager.d.ts.map +1 -0
- package/dist/utils/workspace-manager.js +98 -0
- package/dist/utils/workspace-manager.js.map +1 -0
- package/package.json +14 -29
- package/dist/.build-info.json +0 -9
- package/dist/services/context-manager.d.ts +0 -170
- package/dist/services/context-manager.d.ts.map +0 -1
- package/dist/services/context-manager.js +0 -261
- package/dist/services/context-manager.js.map +0 -1
- package/dist/test/setup.d.ts +0 -2
- package/dist/test/setup.d.ts.map +0 -1
- package/dist/test/setup.js +0 -40
- package/dist/test/setup.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,12 +5,50 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.1] - 2025-10-07
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Consistent resource ID normalization across projects, requirements, and tasks
|
|
13
|
+
- Supports multiple input formats: `PROJ-123`, `proj-123`, `PROJ 123`, `123`, or UUID
|
|
14
|
+
- Generic `normalizeId()` utility eliminates code duplication
|
|
15
|
+
- Git repository root detection for `.braingrid` folder placement
|
|
16
|
+
- `.braingrid/project.json` now created at git repository root instead of current directory
|
|
17
|
+
- Ensures consistent project configuration across entire repository
|
|
18
|
+
- Workspace manager for centralized project resolution
|
|
19
|
+
- Simplifies project auto-detection from local configuration
|
|
20
|
+
- Reduces redundant workspace lookups in task commands
|
|
21
|
+
- Configuration path display in `braingrid status` command
|
|
22
|
+
- Shows where user-level credentials are stored (`~/.config/BrainGrid/config.json`)
|
|
23
|
+
- Internal API services pattern for GitHub and repository operations
|
|
24
|
+
- Prepares foundation for future repository integration features
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- Command structure improvements with consistent ID handling
|
|
29
|
+
- Project, requirement, and task commands now accept flexible ID formats
|
|
30
|
+
- `braingrid task list -r REQ-456` and `braingrid task list -r 456` both work
|
|
31
|
+
- Improved error messages with better workspace context
|
|
32
|
+
- Task commands provide clearer guidance when project isn't initialized
|
|
33
|
+
- Fixed credential storage directory from `BrainGrid-nodejs` to `BrainGrid`
|
|
34
|
+
- **Breaking change**: Users need to re-authenticate after upgrade
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Test script now properly tracks and reports API 500 errors
|
|
39
|
+
- Enhanced error tracking during integration tests
|
|
40
|
+
- No longer exits on first error, displays summary table
|
|
41
|
+
- Authentication integration tests handle both logged-in and logged-out states
|
|
42
|
+
- More robust RPC integration test suite
|
|
43
|
+
|
|
8
44
|
## [0.0.9] - 2025-10-04
|
|
9
45
|
|
|
10
46
|
### Added
|
|
47
|
+
|
|
11
48
|
- `-v` shorthand flag for `--version` command
|
|
12
49
|
|
|
13
50
|
### Fixed
|
|
51
|
+
|
|
14
52
|
- API response handling for `project show --repo` and `project show --repo --limit` commands
|
|
15
53
|
- Now correctly handles `ListProjectsWithRepositoryResponse` (with `total_count`) vs `ListProjectsResponse` (with `pagination`)
|
|
16
54
|
- Fixed bug where optional `total_count` check could cause pagination info to not display
|
|
@@ -20,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
20
58
|
## [0.0.8] - 2025-10-03
|
|
21
59
|
|
|
22
60
|
### Fixed
|
|
61
|
+
|
|
23
62
|
- Claude Code detection in `braingrid status` command with 3-tier detection strategy
|
|
24
63
|
- Priority 1: Check `~/.claude/local/claude` (after `claude migrate-installer`)
|
|
25
64
|
- Priority 2: Try executing `claude --version` (shell alias detection)
|
|
@@ -28,11 +67,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
28
67
|
- Added comprehensive test coverage for all detection methods
|
|
29
68
|
|
|
30
69
|
### Changed
|
|
70
|
+
|
|
31
71
|
- README comment alignment in usage sections for better readability
|
|
32
72
|
|
|
33
73
|
## [0.0.7] - 2025-10-03
|
|
34
74
|
|
|
35
75
|
### Added
|
|
76
|
+
|
|
36
77
|
- `braingrid init` command to initialize repositories with BrainGrid projects
|
|
37
78
|
- Auto-detects project from git remote (owner/name)
|
|
38
79
|
- Manual mode with `--project <id>` to specify project by ID
|
|
@@ -54,30 +95,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
54
95
|
- 36 new tests for init, update, and auto-detection features
|
|
55
96
|
|
|
56
97
|
### Changed
|
|
98
|
+
|
|
57
99
|
- Updated `--repository` as primary alias for `--repo` in project show command (both still work)
|
|
58
100
|
- Project configuration now stores API repository data instead of git-derived data
|
|
59
101
|
- Simplified QuickStart workflow with auto-detection examples
|
|
60
102
|
- Enhanced error messages to guide users to run `braingrid init` when needed
|
|
61
103
|
|
|
62
104
|
### Fixed
|
|
105
|
+
|
|
63
106
|
- Terminal crash issue in status command by removing interactive shell flag
|
|
64
107
|
- Data consistency by using API repository values instead of mixing git-derived data
|
|
65
108
|
|
|
66
109
|
## [0.0.6] - 2025-10-02
|
|
67
110
|
|
|
68
111
|
### Added
|
|
112
|
+
|
|
69
113
|
- `/cut-release` slash command for streamlined release workflow
|
|
70
114
|
- `pnpm docs:sync` command to sync CLI documentation to main BrainGrid repository
|
|
71
115
|
- Repository-aware project commands with automatic git context detection
|
|
72
116
|
- Collapsible installation and update command tabs in documentation
|
|
73
117
|
|
|
74
118
|
### Changed
|
|
119
|
+
|
|
75
120
|
- Enhanced project commands to automatically detect and include git repository context
|
|
76
121
|
- Improved README with spec-driven development explanation
|
|
77
122
|
|
|
78
123
|
## [0.0.5] - 2025-10-02
|
|
79
124
|
|
|
80
125
|
### Added
|
|
126
|
+
|
|
81
127
|
- IDEA and REVIEW requirement statuses for enhanced workflow management
|
|
82
128
|
- Emoji mappings: 💡 for IDEA, 👀 for REVIEW
|
|
83
129
|
- Natural language keyword parsing for new statuses
|
|
@@ -86,6 +132,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
86
132
|
- Updated CLI help text to include new statuses
|
|
87
133
|
|
|
88
134
|
### Changed
|
|
135
|
+
|
|
89
136
|
- RequirementStatus type now supports 6 statuses: IDEA, PLANNED, IN_PROGRESS, REVIEW, COMPLETED, CANCELLED
|
|
90
137
|
- Status workflow: IDEA → PLANNED → IN_PROGRESS → REVIEW → COMPLETED/CANCELLED
|
|
91
138
|
- Updated README badges to use @braingrid organization
|
|
@@ -94,6 +141,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
94
141
|
## [0.0.4] - 2025-10-02
|
|
95
142
|
|
|
96
143
|
### Added
|
|
144
|
+
|
|
97
145
|
- Comprehensive test coverage improvement from 26.15% to 64.9%
|
|
98
146
|
- 529 passing tests covering utils, services, and handlers
|
|
99
147
|
- Handler layer tests achieving 96.28% coverage (all core handlers 92-100%)
|
|
@@ -103,6 +151,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
103
151
|
- CLI tools detection (Claude Code, Cursor, git)
|
|
104
152
|
|
|
105
153
|
### Changed
|
|
154
|
+
|
|
106
155
|
- Renamed package from `@braingridai/cli` to `@braingrid/cli`
|
|
107
156
|
- Updated repository URL to main braingrid repo
|
|
108
157
|
- Refactored from React-based CLI to Commander.js pattern
|
|
@@ -110,6 +159,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
110
159
|
- Enhanced status command with authentication, git, and tool information
|
|
111
160
|
|
|
112
161
|
### Fixed
|
|
162
|
+
|
|
113
163
|
- Task handler number type (string for proper padding)
|
|
114
164
|
- Repository URL format in package.json
|
|
115
165
|
- Test coverage for all critical paths
|
|
@@ -117,14 +167,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
117
167
|
## [0.0.3] - 2024-01-XX
|
|
118
168
|
|
|
119
169
|
### Changed
|
|
170
|
+
|
|
120
171
|
- Initial npm publication as `@braingrid/cli`
|
|
121
172
|
|
|
122
173
|
## [0.0.2] - 2024-01-XX
|
|
123
174
|
|
|
124
175
|
### Changed
|
|
176
|
+
|
|
125
177
|
- Initial version as `@braingridai/cli`
|
|
126
178
|
|
|
127
179
|
## [0.0.1] - 2024-01-XX
|
|
128
180
|
|
|
129
181
|
### Added
|
|
182
|
+
|
|
130
183
|
- Initial CLI implementation
|
package/README.md
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
<p>Turn thoughts into AI-ready specs and ship 100 faster.</p>
|
|
6
6
|
<h3>A CLI for spec-driven development.</h3>
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
[](https://www.npmjs.com/package/@braingrid/cli)
|
|
9
|
+
[](https://www.npmjs.com/package/@braingrid/cli)
|
|
10
|
+
[](https://github.com/BrainGridAI/braingrid)
|
|
11
|
+
|
|
11
12
|
</div>
|
|
12
13
|
|
|
13
14
|
---
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
- 📊 **Track Progress** - Manage and update task statuses
|
|
30
31
|
- 💾 **Multiple Output Formats** - View data as formatted tables or JSON for scripting
|
|
31
32
|
- 🔍 **Environment Detection** - Automatically detect git repository info and installed AI coding tools
|
|
33
|
+
- 🔌 **JSON-RPC Mode** - Programmatic access via JSON-RPC 2.0 protocol for IDE integration
|
|
32
34
|
|
|
33
35
|
---
|
|
34
36
|
|
|
@@ -63,6 +65,7 @@ braingrid task create -r REQ-1 --title "Implement login endpoint"
|
|
|
63
65
|
# 6. View tasks for a requirement
|
|
64
66
|
braingrid task list -r REQ-1
|
|
65
67
|
```
|
|
68
|
+
|
|
66
69
|
---
|
|
67
70
|
|
|
68
71
|
## Usage
|
|
@@ -72,9 +75,9 @@ BrainGrid CLI uses a resource-oriented command structure: `braingrid <resource>
|
|
|
72
75
|
### Authentication Commands
|
|
73
76
|
|
|
74
77
|
```bash
|
|
75
|
-
braingrid login
|
|
76
|
-
braingrid
|
|
77
|
-
braingrid
|
|
78
|
+
braingrid login
|
|
79
|
+
braingrid whoami
|
|
80
|
+
braingrid logout
|
|
78
81
|
```
|
|
79
82
|
|
|
80
83
|
### Initialization
|
|
@@ -82,31 +85,36 @@ braingrid whoami # Show current user information
|
|
|
82
85
|
Initialize your repository with a BrainGrid project:
|
|
83
86
|
|
|
84
87
|
```bash
|
|
85
|
-
|
|
86
|
-
braingrid init --
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
braingrid init
|
|
88
|
+
# Run interactive wizard with confirmation prompt
|
|
89
|
+
braingrid init --wizard
|
|
90
|
+
|
|
91
|
+
# Auto-detects project from git remote (owner/name)
|
|
92
|
+
braingrid init
|
|
93
|
+
|
|
94
|
+
# Manually specify project by ID (short ID or UUID)
|
|
95
|
+
braingrid init --project PROJ-123
|
|
96
|
+
|
|
97
|
+
# Force reinitialization if already initialized
|
|
98
|
+
braingrid init --force
|
|
99
|
+
|
|
100
|
+
# Manually specify and force reinitialization
|
|
101
|
+
braingrid init --project PROJ-123 --force
|
|
90
102
|
```
|
|
91
103
|
|
|
92
|
-
The `init` command
|
|
93
|
-
- **Auto-detect mode** (default): Fetches the project linked to your current git repository
|
|
94
|
-
- **Manual mode** (`--project`): Fetches a specific project by ID, bypassing git detection
|
|
95
|
-
- Creates a `.braingrid/project.json` file in the `.braingrid/` directory
|
|
96
|
-
- Fails if already initialized unless `--force` is provided
|
|
104
|
+
The `init` command creates a `.braingrid/project.json` file in the `.braingrid/` directory. This tells the CLI what project it is working on so you don't have to pass it as a parameter.
|
|
97
105
|
|
|
98
106
|
### Project Commands
|
|
99
107
|
|
|
100
108
|
```bash
|
|
101
109
|
braingrid project list [--format json] [--page 1] [--limit 20]
|
|
102
|
-
braingrid project show
|
|
103
|
-
braingrid project show [<id>] [--repository "owner/repo"]
|
|
110
|
+
braingrid project show
|
|
111
|
+
braingrid project show [<id>] [--repository "owner/repo"]
|
|
104
112
|
braingrid project create --name "Project Name" [--description "Description"] [--repositories "owner/repo,owner/repo2"]
|
|
105
113
|
braingrid project update <id> [--name "New Name"] [--description "New Description"]
|
|
106
114
|
braingrid project delete <id> [--force]
|
|
107
115
|
```
|
|
108
116
|
|
|
109
|
-
> **Note:** `project show`
|
|
117
|
+
> **Note:** `project show` displays the initialized project from your workspace when called without arguments. Use `--repository "owner/repo"` to list all projects for a specific repository, or provide a project ID directly to view a specific project.
|
|
110
118
|
|
|
111
119
|
### Requirement Commands
|
|
112
120
|
|
package/dist/build-config.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* BUILD_ENV
|
|
3
|
-
* - 'production': Uses production URLs
|
|
4
|
-
* - 'development':
|
|
2
|
+
* BUILD_ENV determines which configuration to use.
|
|
3
|
+
* - 'production': Uses production URLs (when NODE_ENV=production)
|
|
4
|
+
* - 'development': Uses development/local URLs (default)
|
|
5
5
|
*/
|
|
6
6
|
export declare const BUILD_ENV: 'production' | 'development';
|
|
7
|
-
|
|
8
|
-
* CLI_VERSION is set at build time from package.json
|
|
9
|
-
* Used for update checks and version display
|
|
10
|
-
*/
|
|
11
|
-
export declare const CLI_VERSION = "development";
|
|
7
|
+
export declare const CLI_VERSION: string;
|
|
12
8
|
/**
|
|
13
9
|
* Production configuration
|
|
14
10
|
* Used when BUILD_ENV === 'production' (npm published package)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-config.d.ts","sourceRoot":"","sources":["../src/build-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-config.d.ts","sourceRoot":"","sources":["../src/build-config.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,YAAY,GAAG,aAC8B,CAAC;AAgBtE,eAAO,MAAM,WAAW,QAAe,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;CAIpB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;CAIrB,CAAC"}
|
package/dist/build-config.js
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
5
|
+
const __dirname = dirname(__filename);
|
|
3
6
|
/**
|
|
4
|
-
* BUILD_ENV
|
|
5
|
-
* - 'production': Uses production URLs
|
|
6
|
-
* - 'development':
|
|
7
|
+
* BUILD_ENV determines which configuration to use.
|
|
8
|
+
* - 'production': Uses production URLs (when NODE_ENV=production)
|
|
9
|
+
* - 'development': Uses development/local URLs (default)
|
|
7
10
|
*/
|
|
8
|
-
export const BUILD_ENV = 'production';
|
|
11
|
+
export const BUILD_ENV = process.env.NODE_ENV === 'production' ? 'production' : 'development';
|
|
9
12
|
/**
|
|
10
|
-
* CLI_VERSION
|
|
13
|
+
* CLI_VERSION read from package.json at runtime
|
|
11
14
|
* Used for update checks and version display
|
|
12
15
|
*/
|
|
13
|
-
|
|
16
|
+
function getVersion() {
|
|
17
|
+
try {
|
|
18
|
+
const packagePath = join(__dirname, '..', 'package.json');
|
|
19
|
+
const pkg = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
20
|
+
return pkg.version;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return 'unknown';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export const CLI_VERSION = getVersion();
|
|
14
27
|
/**
|
|
15
28
|
* Production configuration
|
|
16
29
|
* Used when BUILD_ENV === 'production' (npm published package)
|
package/dist/build-config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-config.js","sourceRoot":"","sources":["../src/build-config.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"build-config.js","sourceRoot":"","sources":["../src/build-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GACrB,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,aAAa,CAAC;AAEtE;;;GAGG;AACH,SAAS,UAAU;IAClB,IAAI,CAAC;QACJ,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;QAC3D,OAAO,GAAG,CAAC,OAAO,CAAC;IACpB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,EAAE,CAAC;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,MAAM,EAAE,0BAA0B;IAClC,aAAa,EAAE,0CAA0C;IACzD,cAAc,EAAE,mCAAmC;CAC1C,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,MAAM,EAAE,8BAA8B;IACtC,aAAa,EAAE,qDAAqD;IACpE,cAAc,EAAE,mCAAmC;CAC1C,CAAC"}
|