context-first-cli 1.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/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +253 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/feature.d.ts +11 -0
- package/dist/commands/feature.d.ts.map +1 -0
- package/dist/commands/feature.js +224 -0
- package/dist/commands/feature.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +95 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/scaffold-orchestrator.d.ts +2 -0
- package/dist/commands/scaffold-orchestrator.d.ts.map +1 -0
- package/dist/commands/scaffold-orchestrator.js +203 -0
- package/dist/commands/scaffold-orchestrator.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +102 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/config.d.ts +67 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +118 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/git.d.ts +35 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +152 -0
- package/dist/utils/git.js.map +1 -0
- package/package.json +59 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Thatix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# Context-First CLI
|
|
2
|
+
|
|
3
|
+
A generic, cross-platform CLI to manage the **Context-First** development methodology across any project ecosystem. This tool provides a robust framework for orchestrating development workflows, managing multiple repositories, and ensuring consistency for both human developers and AI agents.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🚀 Core Concepts
|
|
8
|
+
|
|
9
|
+
This CLI is built on three core concepts that enable scalable, parallel, and context-aware development.
|
|
10
|
+
|
|
11
|
+
### 1. The Orchestrator Repository
|
|
12
|
+
|
|
13
|
+
Instead of embedding process logic into each of your application repositories, you define it in one central **Orchestrator Repository**. This repository acts as the single source of truth for your development methodology. It contains:
|
|
14
|
+
|
|
15
|
+
- **Command Definitions**: Markdown files (`/commands/definitions`) that instruct an AI (like Claude) on the purpose and logic of each step in your process (e.g., `/work`, `/spec`).
|
|
16
|
+
- **Repository Manifest**: A `context-manifest.json` file that maps out your entire project ecosystem, defining all repositories and their relationships.
|
|
17
|
+
- **Configuration Templates**: Files like `ai.properties.md` that define project-specific commands (lint, test, build) and settings.
|
|
18
|
+
|
|
19
|
+
### 2. Feature Workspaces
|
|
20
|
+
|
|
21
|
+
To enable parallel development without conflicts, the CLI uses **Feature Workspaces**. When you start working on a new feature (e.g., an issue from Jira), the CLI creates a dedicated, isolated directory. Inside this workspace, it uses `git worktree` to check out a specific branch for each relevant repository. This is extremely efficient, as it doesn't re-clone the entire repository, saving disk space and time.
|
|
22
|
+
|
|
23
|
+
- **Isolation**: Every feature has its own folder, preventing any overlap or context-clash between concurrent tasks.
|
|
24
|
+
- **Efficiency**: Powered by `git worktree`, creating and switching between workspaces is nearly instantaneous.
|
|
25
|
+
|
|
26
|
+
### 3. The Agnostic CLI (`context-cli`)
|
|
27
|
+
|
|
28
|
+
This is the tool you install on your machine. It's completely project-agnostic. You can use the same CLI to manage desenvolvimento para o `credit-flow`, `orca-sonhos`, ou qualquer outro projeto.
|
|
29
|
+
|
|
30
|
+
- **Cross-Platform**: Built with Node.js/TypeScript, it works seamlessly on Windows, macOS, and Linux.
|
|
31
|
+
- **Configurable**: The `init` command creates a `.contextrc.json` file in your project, telling the CLI which Orchestrator to use.
|
|
32
|
+
- **AI-Agnostic**: You can configure it to create command structures for different AI providers (e.g., `.claude/commands` for Claude, `.cursor/commands` for Cursor).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## ⚙️ Getting Started
|
|
37
|
+
|
|
38
|
+
### Installation
|
|
39
|
+
|
|
40
|
+
Install the CLI globally on your machine via NPM.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install -g context-first-cli
|
|
44
|
+
```
|
|
45
|
+
*(Note: Once published to NPM)*
|
|
46
|
+
|
|
47
|
+
### Initialization
|
|
48
|
+
|
|
49
|
+
There are two main scenarios for getting started.
|
|
50
|
+
|
|
51
|
+
**Scenario 1: You have an existing project and want to adopt Context-First.**
|
|
52
|
+
|
|
53
|
+
1. Navigate to the root of one of your application repositories.
|
|
54
|
+
2. Run the `init` command:
|
|
55
|
+
```bash
|
|
56
|
+
context-cli init
|
|
57
|
+
```
|
|
58
|
+
3. The CLI will ask you for the Git URL of your Orchestrator repository and your preferred AI provider. It will then create a `.contextrc.json` file to link this project to its orchestrator.
|
|
59
|
+
|
|
60
|
+
**Scenario 2: You are starting a new project ecosystem from scratch.**
|
|
61
|
+
|
|
62
|
+
1. Create a new, empty directory for your orchestrator.
|
|
63
|
+
2. Run the `scaffold:orchestrator` command:
|
|
64
|
+
```bash
|
|
65
|
+
context-cli scaffold:orchestrator
|
|
66
|
+
```
|
|
67
|
+
3. This will generate a complete, ready-to-use Orchestrator repository with template files and a standard directory structure.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## 📋 Main Commands
|
|
72
|
+
|
|
73
|
+
Below is an overview of the primary commands available in the CLI.
|
|
74
|
+
|
|
75
|
+
| Command | Description |
|
|
76
|
+
| :--- | :--- |
|
|
77
|
+
| `context-cli init` | **Initializes** a project by creating a `.contextrc.json` file that links it to an orchestrator. |
|
|
78
|
+
| `context-cli scaffold:orchestrator` | **Creates a new** Orchestrator repository from a best-practice template. |
|
|
79
|
+
| `context-cli feature:start <issue-id>` | **Starts a new feature** by creating an isolated workspace with all necessary repositories checked out via `git worktree`. |
|
|
80
|
+
| `context-cli feature:list` | **Lists all** active feature workspaces on your machine. |
|
|
81
|
+
| `context-cli feature:end <issue-id>` | **Cleans up** a completed feature by removing the worktrees and archiving the workspace. |
|
|
82
|
+
| `context-cli work "<message>"` | **Records a unit of work** within the current workspace, typically performing a `git commit`. |
|
|
83
|
+
| `context-cli spec` | **Generates specifications** (e.g., a PRD) for the feature in the current workspace. |
|
|
84
|
+
| `context-cli doctor` | **Checks your environment** to ensure all configurations, paths, and dependencies are correctly set up. |
|
|
85
|
+
|
|
86
|
+
### Example Workflow
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# 1. Start work on a new feature from Jira
|
|
90
|
+
context-cli feature:start FIN-123
|
|
91
|
+
|
|
92
|
+
# 2. Navigate into the newly created workspace
|
|
93
|
+
cd workspaces/FIN-123
|
|
94
|
+
|
|
95
|
+
# 3. Open the workspace in your favorite editor
|
|
96
|
+
code .
|
|
97
|
+
|
|
98
|
+
# 4. Make code changes, then record your work
|
|
99
|
+
context-cli work "feat(api): add validation to user endpoint"
|
|
100
|
+
|
|
101
|
+
# 5. When done, create pull requests
|
|
102
|
+
context-cli pr
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 🏗️ Architecture Overview
|
|
108
|
+
|
|
109
|
+
```mermaid
|
|
110
|
+
graph TD
|
|
111
|
+
subgraph User (Any OS)
|
|
112
|
+
Dev[Developer] -->|uses| CLI
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
subgraph CLI (context-cli NPM package)
|
|
116
|
+
CLI[CLI Commands] -->|reads| Config
|
|
117
|
+
CLI -->|executes logic on| Workspace
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
subgraph Project Setup
|
|
121
|
+
Config[.contextrc.json] -->|points to| OrchestratorRepo
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
subgraph OrchestratorRepo [Orchestrator Repository]
|
|
125
|
+
style OrchestratorRepo fill:#cde,stroke:#333,stroke-width:2px
|
|
126
|
+
Manifest[context-manifest.json]
|
|
127
|
+
Defs[commands/definitions/*.md]
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
subgraph Workspace [Feature Workspace]
|
|
131
|
+
style Workspace fill:#f9f,stroke:#333,stroke-width:2px
|
|
132
|
+
Worktree1[Worktree of Repo A]
|
|
133
|
+
Worktree2[Worktree of Repo B]
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
CLI -- "Reads Manifest from" --> Manifest
|
|
137
|
+
CLI -- "Creates/Manages" --> Workspace
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
This structure ensures a clean separation of concerns:
|
|
141
|
+
|
|
142
|
+
- **The CLI** is the universal engine.
|
|
143
|
+
- **The Orchestrator Repo** defines the process for a specific project.
|
|
144
|
+
- **The Workspace** is the temporary, isolated environment where work actually happens.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAiBA,wBAAsB,aAAa,kBA0DlC"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.doctorCommand = doctorCommand;
|
|
40
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
+
const child_process_1 = require("child_process");
|
|
42
|
+
const path_1 = __importDefault(require("path"));
|
|
43
|
+
const config_1 = require("../utils/config");
|
|
44
|
+
const git_1 = require("../utils/git");
|
|
45
|
+
async function doctorCommand() {
|
|
46
|
+
console.log(chalk_1.default.blue.bold('\n🏥 Running environment diagnostics...\n'));
|
|
47
|
+
const results = [];
|
|
48
|
+
// Check 1: Git installation
|
|
49
|
+
results.push(await checkGit());
|
|
50
|
+
// Check 2: Node.js version
|
|
51
|
+
results.push(await checkNode());
|
|
52
|
+
// Check 3: Configuration file
|
|
53
|
+
results.push(await checkConfiguration());
|
|
54
|
+
// Check 4: Orchestrator repository
|
|
55
|
+
const orchestratorCheck = await checkOrchestrator();
|
|
56
|
+
if (orchestratorCheck) {
|
|
57
|
+
results.push(orchestratorCheck);
|
|
58
|
+
}
|
|
59
|
+
// Check 5: Main repositories
|
|
60
|
+
const reposCheck = await checkMainRepositories();
|
|
61
|
+
if (reposCheck) {
|
|
62
|
+
results.push(reposCheck);
|
|
63
|
+
}
|
|
64
|
+
// Check 6: Workspaces directory
|
|
65
|
+
results.push(await checkWorkspacesDirectory());
|
|
66
|
+
// Display results
|
|
67
|
+
console.log(chalk_1.default.bold('\n📊 Diagnostic Results:\n'));
|
|
68
|
+
for (const result of results) {
|
|
69
|
+
const icon = result.status === 'pass' ? '✓' : result.status === 'warn' ? '⚠' : '✗';
|
|
70
|
+
const color = result.status === 'pass' ? chalk_1.default.green : result.status === 'warn' ? chalk_1.default.yellow : chalk_1.default.red;
|
|
71
|
+
console.log(color(`${icon} ${result.name}`));
|
|
72
|
+
console.log(chalk_1.default.gray(` ${result.message}`));
|
|
73
|
+
}
|
|
74
|
+
// Summary
|
|
75
|
+
const passed = results.filter(r => r.status === 'pass').length;
|
|
76
|
+
const warned = results.filter(r => r.status === 'warn').length;
|
|
77
|
+
const failed = results.filter(r => r.status === 'fail').length;
|
|
78
|
+
console.log(chalk_1.default.bold('\n📈 Summary:'));
|
|
79
|
+
console.log(chalk_1.default.green(` ✓ Passed: ${passed}`));
|
|
80
|
+
if (warned > 0)
|
|
81
|
+
console.log(chalk_1.default.yellow(` ⚠ Warnings: ${warned}`));
|
|
82
|
+
if (failed > 0)
|
|
83
|
+
console.log(chalk_1.default.red(` ✗ Failed: ${failed}`));
|
|
84
|
+
if (failed > 0) {
|
|
85
|
+
console.log(chalk_1.default.red('\n❌ Some checks failed. Please address the issues above.'));
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
else if (warned > 0) {
|
|
89
|
+
console.log(chalk_1.default.yellow('\n⚠️ Some checks have warnings. Review them if needed.'));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
console.log(chalk_1.default.green('\n✅ All checks passed! Your environment is ready.'));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function checkGit() {
|
|
96
|
+
try {
|
|
97
|
+
const version = (0, child_process_1.execSync)('git --version', { encoding: 'utf-8' }).trim();
|
|
98
|
+
return {
|
|
99
|
+
name: 'Git Installation',
|
|
100
|
+
status: 'pass',
|
|
101
|
+
message: version,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
return {
|
|
106
|
+
name: 'Git Installation',
|
|
107
|
+
status: 'fail',
|
|
108
|
+
message: 'Git is not installed or not in PATH',
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function checkNode() {
|
|
113
|
+
try {
|
|
114
|
+
const version = process.version;
|
|
115
|
+
const major = parseInt(version.slice(1).split('.')[0]);
|
|
116
|
+
if (major >= 18) {
|
|
117
|
+
return {
|
|
118
|
+
name: 'Node.js Version',
|
|
119
|
+
status: 'pass',
|
|
120
|
+
message: `Node.js ${version} (recommended: >= 18)`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
return {
|
|
125
|
+
name: 'Node.js Version',
|
|
126
|
+
status: 'warn',
|
|
127
|
+
message: `Node.js ${version} (recommended: >= 18)`,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return {
|
|
133
|
+
name: 'Node.js Version',
|
|
134
|
+
status: 'fail',
|
|
135
|
+
message: 'Could not determine Node.js version',
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function checkConfiguration() {
|
|
140
|
+
const configResult = await (0, config_1.findConfig)();
|
|
141
|
+
if (!configResult) {
|
|
142
|
+
return {
|
|
143
|
+
name: 'Configuration File',
|
|
144
|
+
status: 'fail',
|
|
145
|
+
message: 'No .contextrc.json found. Run "context-cli init" to create one.',
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const { config, configDir } = configResult;
|
|
149
|
+
return {
|
|
150
|
+
name: 'Configuration File',
|
|
151
|
+
status: 'pass',
|
|
152
|
+
message: `Found at ${configDir} (AI Provider: ${config.aiProvider})`,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async function checkOrchestrator() {
|
|
156
|
+
const configResult = await (0, config_1.findConfig)();
|
|
157
|
+
if (!configResult)
|
|
158
|
+
return null;
|
|
159
|
+
const { config, configDir } = configResult;
|
|
160
|
+
const orchestratorPath = path_1.default.join(configDir, '.context-orchestrator');
|
|
161
|
+
if (!(await (0, config_1.pathExists)(orchestratorPath))) {
|
|
162
|
+
return {
|
|
163
|
+
name: 'Orchestrator Repository',
|
|
164
|
+
status: 'warn',
|
|
165
|
+
message: 'Not cloned yet. Will be cloned on first "feature:start".',
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const isRepo = await (0, git_1.isGitRepo)(orchestratorPath);
|
|
169
|
+
if (!isRepo) {
|
|
170
|
+
return {
|
|
171
|
+
name: 'Orchestrator Repository',
|
|
172
|
+
status: 'fail',
|
|
173
|
+
message: `Directory exists at ${orchestratorPath} but is not a valid Git repository`,
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
const manifest = await (0, config_1.loadManifest)(orchestratorPath);
|
|
177
|
+
if (!manifest) {
|
|
178
|
+
return {
|
|
179
|
+
name: 'Orchestrator Repository',
|
|
180
|
+
status: 'warn',
|
|
181
|
+
message: 'Cloned but context-manifest.json not found or invalid',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
return {
|
|
185
|
+
name: 'Orchestrator Repository',
|
|
186
|
+
status: 'pass',
|
|
187
|
+
message: `Cloned and valid (Project: ${manifest.project}, ${manifest.repositories.length} repos defined)`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
async function checkMainRepositories() {
|
|
191
|
+
const configResult = await (0, config_1.findConfig)();
|
|
192
|
+
if (!configResult)
|
|
193
|
+
return null;
|
|
194
|
+
const { configDir } = configResult;
|
|
195
|
+
const mainReposDir = path_1.default.join(configDir, '.context-repos');
|
|
196
|
+
if (!(await (0, config_1.pathExists)(mainReposDir))) {
|
|
197
|
+
return {
|
|
198
|
+
name: 'Main Repositories',
|
|
199
|
+
status: 'warn',
|
|
200
|
+
message: 'No main repositories cloned yet. Will be cloned on first "feature:start".',
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
const orchestratorPath = path_1.default.join(configDir, '.context-orchestrator');
|
|
204
|
+
const manifest = await (0, config_1.loadManifest)(orchestratorPath);
|
|
205
|
+
if (!manifest) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
209
|
+
const entries = await fs.readdir(mainReposDir, { withFileTypes: true });
|
|
210
|
+
const clonedRepos = entries.filter(e => e.isDirectory()).map(e => e.name);
|
|
211
|
+
const clonedCount = clonedRepos.length;
|
|
212
|
+
const totalCount = manifest.repositories.length;
|
|
213
|
+
if (clonedCount === 0) {
|
|
214
|
+
return {
|
|
215
|
+
name: 'Main Repositories',
|
|
216
|
+
status: 'warn',
|
|
217
|
+
message: 'No repositories cloned yet',
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
else if (clonedCount < totalCount) {
|
|
221
|
+
return {
|
|
222
|
+
name: 'Main Repositories',
|
|
223
|
+
status: 'pass',
|
|
224
|
+
message: `${clonedCount}/${totalCount} repositories cloned`,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
return {
|
|
229
|
+
name: 'Main Repositories',
|
|
230
|
+
status: 'pass',
|
|
231
|
+
message: `All ${totalCount} repositories cloned`,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
async function checkWorkspacesDirectory() {
|
|
236
|
+
const workspacesDir = (0, config_1.getWorkspacesDir)();
|
|
237
|
+
if (!(await (0, config_1.pathExists)(workspacesDir))) {
|
|
238
|
+
return {
|
|
239
|
+
name: 'Workspaces Directory',
|
|
240
|
+
status: 'warn',
|
|
241
|
+
message: `No workspaces created yet (${workspacesDir})`,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const fs = await Promise.resolve().then(() => __importStar(require('fs/promises')));
|
|
245
|
+
const entries = await fs.readdir(workspacesDir, { withFileTypes: true });
|
|
246
|
+
const workspaceCount = entries.filter(e => e.isDirectory()).length;
|
|
247
|
+
return {
|
|
248
|
+
name: 'Workspaces Directory',
|
|
249
|
+
status: 'pass',
|
|
250
|
+
message: `${workspaceCount} workspace(s) found at ${workspacesD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,GAAE,CAAC;IAEzC,IAAI,CAAC,CAAC,MAAM,IAAA,mBAAU,EAAC,aAAa,CAAC,CAAC,EAAE,CAAC;QACvC,OAAO;YACL,IAAI,EAAE,sBAAsB;YAC5B,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,8BAA8B,aAAa,GAAG;SACxD,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,GAAG,wDAAa,aAAa,GAAC,CAAC;IACvC,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;IAEnE,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,GAAG,cAAc,0BAA0B,aAAa,EAAE;KACpE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const featureCommands: {
|
|
2
|
+
start: (issueId: string, options: {
|
|
3
|
+
repos?: string;
|
|
4
|
+
}) => Promise<void>;
|
|
5
|
+
list: () => Promise<void>;
|
|
6
|
+
switch: (issueId: string) => Promise<void>;
|
|
7
|
+
end: (issueId: string, options: {
|
|
8
|
+
force?: boolean;
|
|
9
|
+
}) => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../src/commands/feature.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,eAAe;qBACH,MAAM,WAAW;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;;sBA6KlC,MAAM;mBAaT,MAAM,WAAW;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;CA2D1D,CAAC"}
|