jettypod 4.4.19 → 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.
@@ -0,0 +1,39 @@
1
+ // Terminal Logo - Unicode Box Drawing + Gradients
2
+ // Zero dependencies, pure ANSI escape codes
3
+
4
+ const colors = {
5
+ cyan1: '\x1b[38;5;51m', // Bright cyan
6
+ cyan2: '\x1b[38;5;45m', // Medium cyan
7
+ cyan3: '\x1b[38;5;39m', // Darker cyan
8
+ green1: '\x1b[38;5;48m', // Bright green
9
+ green2: '\x1b[38;5;42m', // Medium green
10
+ green3: '\x1b[38;5;36m', // Darker green
11
+ gray: '\x1b[38;5;244m', // Gray for subtitle
12
+ reset: '\x1b[0m', // Reset color
13
+ bold: '\x1b[1m' // Bold text
14
+ };
15
+
16
+ function showLogo() {
17
+ console.log(`
18
+ ${colors.cyan1} ██╗${colors.cyan2}███████╗${colors.cyan3}████████╗${colors.green1}████████╗${colors.green2}██╗ ██╗${colors.reset}
19
+ ${colors.cyan1} ██║${colors.cyan2}██╔════╝${colors.cyan3}╚══██╔══╝${colors.green1}╚══██╔══╝${colors.green2}╚██╗ ██╔╝${colors.reset}
20
+ ${colors.cyan1} ██║${colors.cyan2}█████╗ ${colors.cyan3} ██║ ${colors.green1} ██║ ${colors.green2} ╚████╔╝ ${colors.reset}
21
+ ${colors.cyan1}██ ██║${colors.cyan2}██╔══╝ ${colors.cyan3} ██║ ${colors.green1} ██║ ${colors.green2} ╚██╔╝ ${colors.reset}
22
+ ${colors.cyan1}╚█████╔╝${colors.cyan2}███████╗${colors.cyan3} ██║ ${colors.green1} ██║ ${colors.green2} ██║ ${colors.reset}
23
+ ${colors.cyan1} ╚════╝ ${colors.cyan2}╚══════╝${colors.cyan3} ╚═╝ ${colors.green1} ╚═╝ ${colors.green2} ╚═╝ ${colors.reset}
24
+
25
+ ${colors.green1}██████╗ ${colors.green2}██████╗ ${colors.green3}██████╗ ${colors.reset}
26
+ ${colors.green1}██╔══██╗${colors.green2}██╔═══██╗${colors.green3}██╔══██╗${colors.reset}
27
+ ${colors.green1}██████╔╝${colors.green2}██║ ██║${colors.green3}██║ ██║${colors.reset}
28
+ ${colors.green1}██╔═══╝ ${colors.green2}██║ ██║${colors.green3}██║ ██║${colors.reset}
29
+ ${colors.green1}██║ ${colors.green2}╚██████╔╝${colors.green3}██████╔╝${colors.reset}
30
+ ${colors.green1}╚═╝ ${colors.green2} ╚═════╝ ${colors.green3}╚═════╝ ${colors.reset}
31
+ `);
32
+
33
+ const pkg = require('../../package.json');
34
+ const version = pkg.version || '3.0.0';
35
+ console.log(colors.gray + ' AI Development Context Manager ' + colors.bold + 'v' + version + colors.reset);
36
+ console.log();
37
+ }
38
+
39
+ module.exports = { showLogo };
@@ -0,0 +1,30 @@
1
+ Feature: Terminal Logo Display
2
+ As a JettyPod user
3
+ I want to see a welcoming logo when I run jettypod init
4
+ So that the tool feels approachable and modern
5
+
6
+ Scenario: jettypod init displays unicode gradient logo
7
+ Given a new empty directory
8
+ When I run jettypod init
9
+ Then the output contains the unicode gradient logo
10
+ And the logo includes "DEV" and "POD" text
11
+ And the logo uses ANSI color codes
12
+
13
+ Scenario: Logo module exports showLogo function
14
+ Given the logo module exists
15
+ When I import it
16
+ Then it exports a "showLogo" function
17
+
18
+ Scenario: Logo output is properly formatted
19
+ When I call the showLogo function
20
+ Then it outputs 6 lines of logo art
21
+ And it includes the version subtitle
22
+
23
+ # Integration test
24
+ Scenario: jettypod init integrates with existing features
25
+ Given a new empty directory
26
+ When I run jettypod init
27
+ Then I see the unicode logo
28
+ And the .jettypod directory is created
29
+ And CLAUDE.md is created
30
+ And git hooks are installed
@@ -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"