jettypod 4.4.21 → 4.4.22
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/jettypod.js +11 -11
- package/lib/decisions/index.js +490 -0
- package/lib/git-hooks/git-hooks.feature +30 -0
- package/lib/git-hooks/index.js +94 -0
- package/lib/git-hooks/post-commit +59 -0
- package/lib/git-hooks/post-merge +71 -0
- package/lib/git-hooks/pre-commit +28 -0
- package/lib/git-hooks/simple-steps.js +53 -0
- package/lib/git-hooks/simple-test.feature +10 -0
- package/lib/git-hooks/steps.js +196 -0
- package/lib/mode-prompts/index.js +95 -0
- package/lib/mode-prompts/simple-steps.js +44 -0
- package/lib/mode-prompts/simple-test.feature +9 -0
- package/lib/update-command/index.js +181 -0
- package/lib/work-commands/bug-workflow-display.feature +22 -0
- package/lib/work-commands/index.js +1603 -0
- package/lib/work-commands/simple-steps.js +69 -0
- package/lib/work-commands/stable-tests.feature +57 -0
- package/lib/work-commands/steps.js +1233 -0
- package/lib/work-commands/work-commands.feature +13 -0
- package/lib/work-commands/worktree-management.feature +63 -0
- package/lib/work-tracking/index.js +2396 -0
- package/lib/work-tracking/mode-required.feature +111 -0
- package/lib/work-tracking/work-set-mode.feature +70 -0
- package/lib/work-tracking/work-start-mode.feature +83 -0
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const packageJson = require('../../package.json');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get current jettypod version from package.json
|
|
7
|
+
* @returns {string} Current version
|
|
8
|
+
*/
|
|
9
|
+
function getCurrentVersion() {
|
|
10
|
+
return packageJson.version;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Check npm registry for latest version
|
|
15
|
+
* @returns {Promise<string>} Latest version from npm
|
|
16
|
+
*/
|
|
17
|
+
function getLatestVersion() {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const packageName = packageJson.name;
|
|
20
|
+
const url = `https://registry.npmjs.org/${packageName}/latest`;
|
|
21
|
+
|
|
22
|
+
const request = https.get(url, (res) => {
|
|
23
|
+
let data = '';
|
|
24
|
+
|
|
25
|
+
if (res.statusCode !== 200) {
|
|
26
|
+
reject(new Error(`HTTP ${res.statusCode}`));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
res.on('data', (chunk) => {
|
|
31
|
+
data += chunk;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
res.on('end', () => {
|
|
35
|
+
try {
|
|
36
|
+
const json = JSON.parse(data);
|
|
37
|
+
if (!json.version) {
|
|
38
|
+
reject(new Error('No version found in npm response'));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
resolve(json.version);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
reject(new Error(`Invalid JSON response: ${err.message}`));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Set timeout for network request (30 seconds)
|
|
49
|
+
request.setTimeout(30000, () => {
|
|
50
|
+
request.destroy();
|
|
51
|
+
reject(new Error('Request timeout - network too slow'));
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
request.on('error', (err) => {
|
|
55
|
+
// Provide specific error messages for common network errors
|
|
56
|
+
if (err.code === 'ENOTFOUND') {
|
|
57
|
+
reject(new Error('network error - DNS lookup failed (check internet connection)'));
|
|
58
|
+
} else if (err.code === 'ETIMEDOUT' || err.code === 'ESOCKETTIMEDOUT') {
|
|
59
|
+
reject(new Error('network error - connection timeout'));
|
|
60
|
+
} else if (err.code === 'ECONNREFUSED') {
|
|
61
|
+
reject(new Error('network error - connection refused'));
|
|
62
|
+
} else if (err.code === 'ECONNRESET') {
|
|
63
|
+
reject(new Error('network error - connection reset'));
|
|
64
|
+
} else {
|
|
65
|
+
reject(err);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Update jettypod to latest version using npm
|
|
73
|
+
* @param {string} version - Version to update to (default: latest)
|
|
74
|
+
* @returns {boolean} True if update succeeded
|
|
75
|
+
*/
|
|
76
|
+
function updateJettyPod(version = 'latest') {
|
|
77
|
+
try {
|
|
78
|
+
console.log(`📦 Installing jettypod@${version}...`);
|
|
79
|
+
|
|
80
|
+
// Use npm to update globally
|
|
81
|
+
const packageName = packageJson.name;
|
|
82
|
+
execSync(`npm install -g ${packageName}@${version}`, {
|
|
83
|
+
stdio: 'inherit'
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
return true;
|
|
87
|
+
} catch (err) {
|
|
88
|
+
console.log('');
|
|
89
|
+
console.error(`❌ Update failed`);
|
|
90
|
+
console.log('');
|
|
91
|
+
|
|
92
|
+
// Provide specific error messages for common failures
|
|
93
|
+
const errorOutput = err.stderr ? err.stderr.toString() : '';
|
|
94
|
+
|
|
95
|
+
if (err.message.includes('EACCES') || err.message.includes('EPERM') ||
|
|
96
|
+
errorOutput.includes('EACCES') || errorOutput.includes('EPERM')) {
|
|
97
|
+
console.error('Permission denied - try running with sudo:');
|
|
98
|
+
console.log(` sudo npm install -g ${packageName}@${version}`);
|
|
99
|
+
console.log('');
|
|
100
|
+
console.error('Or configure npm to use a different directory:');
|
|
101
|
+
console.log(' mkdir ~/.npm-global');
|
|
102
|
+
console.log(' npm config set prefix ~/.npm-global');
|
|
103
|
+
console.log(' export PATH=~/.npm-global/bin:$PATH');
|
|
104
|
+
} else if (errorOutput.includes('ENOSPC')) {
|
|
105
|
+
console.error('Not enough disk space to install update');
|
|
106
|
+
console.log('Free up disk space and try again');
|
|
107
|
+
} else if (errorOutput.includes('404') || errorOutput.includes('E404')) {
|
|
108
|
+
console.error(`Version ${version} not found in npm registry`);
|
|
109
|
+
} else if (errorOutput.includes('network') || errorOutput.includes('ETIMEDOUT') ||
|
|
110
|
+
errorOutput.includes('ENOTFOUND')) {
|
|
111
|
+
console.error('Network error during npm install');
|
|
112
|
+
console.log('Check your internet connection and try again');
|
|
113
|
+
} else {
|
|
114
|
+
console.error(`Error details: ${err.message}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log('');
|
|
118
|
+
console.error('Manual update:');
|
|
119
|
+
console.log(` npm install -g ${packageName}@${version}`);
|
|
120
|
+
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Run the update command
|
|
127
|
+
* @param {Object} options - Optional dependencies for testing
|
|
128
|
+
* @param {Function} options.getCurrentVersion - Function to get current version
|
|
129
|
+
* @param {Function} options.getLatestVersion - Function to get latest version
|
|
130
|
+
* @param {Function} options.updateJettyPod - Function to update jettypod
|
|
131
|
+
*/
|
|
132
|
+
async function runUpdate(options = {}) {
|
|
133
|
+
const _getCurrentVersion = options.getCurrentVersion || getCurrentVersion;
|
|
134
|
+
const _getLatestVersion = options.getLatestVersion || getLatestVersion;
|
|
135
|
+
const _updateJettyPod = options.updateJettyPod || updateJettyPod;
|
|
136
|
+
|
|
137
|
+
console.log('🔍 Checking for updates...');
|
|
138
|
+
|
|
139
|
+
const currentVersion = _getCurrentVersion();
|
|
140
|
+
console.log(`Current version: ${currentVersion}`);
|
|
141
|
+
|
|
142
|
+
let latestVersion;
|
|
143
|
+
try {
|
|
144
|
+
latestVersion = await _getLatestVersion();
|
|
145
|
+
} catch (err) {
|
|
146
|
+
console.log(`Cannot check for updates: ${err.message}`);
|
|
147
|
+
console.log('');
|
|
148
|
+
console.log('You can still manually update with:');
|
|
149
|
+
console.log(` npm install -g ${packageJson.name}@latest`);
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
console.log(`Latest version: ${latestVersion}`);
|
|
154
|
+
console.log('');
|
|
155
|
+
|
|
156
|
+
if (currentVersion === latestVersion) {
|
|
157
|
+
console.log(`Already on latest version: ${latestVersion}`);
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
console.log(`New version available: ${latestVersion} (current: ${currentVersion})`);
|
|
162
|
+
console.log('');
|
|
163
|
+
|
|
164
|
+
const success = _updateJettyPod(latestVersion);
|
|
165
|
+
|
|
166
|
+
if (success) {
|
|
167
|
+
console.log('');
|
|
168
|
+
console.log(`✅ JettyPod updated to ${latestVersion}`);
|
|
169
|
+
console.log('');
|
|
170
|
+
return true;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
module.exports = {
|
|
177
|
+
runUpdate,
|
|
178
|
+
getCurrentVersion,
|
|
179
|
+
getLatestVersion,
|
|
180
|
+
updateJettyPod
|
|
181
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Feature: Bug Workflow Display
|
|
2
|
+
As a developer
|
|
3
|
+
I want to see bug-specific workflow guidance when starting a bug
|
|
4
|
+
So that I have systematic steps to follow for fixing bugs
|
|
5
|
+
|
|
6
|
+
Scenario: Starting work on a bug displays workflow guidance
|
|
7
|
+
Given jettypod is initialized
|
|
8
|
+
And I create a bug "Install script fails"
|
|
9
|
+
When I start work on the bug
|
|
10
|
+
Then the output contains "BUG FIXING WORKFLOW"
|
|
11
|
+
And the output contains "1. REPRODUCE"
|
|
12
|
+
And the output contains "2. INVESTIGATE"
|
|
13
|
+
And the output contains "3. ISOLATE"
|
|
14
|
+
And the output contains "4. FIX"
|
|
15
|
+
And the output contains "5. VERIFY"
|
|
16
|
+
And the output contains "6. COMMIT"
|
|
17
|
+
|
|
18
|
+
Scenario: Starting work on a feature does not display bug workflow
|
|
19
|
+
Given jettypod is initialized
|
|
20
|
+
And I create a feature "Add new feature"
|
|
21
|
+
When I start work on the feature
|
|
22
|
+
Then the output does not contain "BUG FIXING WORKFLOW"
|