Skip to content

Commit 0eb3112

Browse files
committed
fix: flatten dist structure to fix GitHub Actions checksum generation
- Move report-template.html directly to dist/ instead of dist/templates/ - Update template loading paths to check new location - Simplify checksums generation to only process files in dist root - This avoids 'sha256sum: dist/templates: Is a directory' error
1 parent 3a41fed commit 0eb3112

File tree

6 files changed

+40
-54
lines changed

6 files changed

+40
-54
lines changed

.github/workflows/npm-publish.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ jobs:
6060
fi
6161
echo "Build output verified ✓"
6262
63-
- name: Generate build checksums
63+
- name: Verify build checksums
6464
run: |
65-
echo "Generating SHA256 checksums..."
66-
sha256sum dist/* > dist/checksums.sha256
65+
echo "Verifying checksums were generated during build..."
66+
if [ ! -f dist/checksums.sha256 ]; then
67+
echo "Error: dist/checksums.sha256 not found"
68+
exit 1
69+
fi
70+
echo "Checksums file contents:"
6771
cat dist/checksums.sha256
6872
6973
- name: Upload build artifacts

CHANGELOG.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,7 @@ All notable changes to the vibe-log-cli project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.5.4] - 2025-09-05
9-
10-
### Added
11-
- **install-auto-sync command**: New shortcut command for quick access to auto-sync configuration
12-
- **Documentation link**: Added link to auto-sync documentation in the menu
13-
14-
### Improved
15-
- **Auto-sync menu text**: Simplified educational text for better clarity and readability
16-
- **Help text**: Updated to show the new install-auto-sync command
17-
18-
## [0.6.0] - 2025-09-04
8+
## [0.6.0] - 2025-09-05
199

2010
### Added
2111
- **Template-Based Report Generation**: Complete replacement of direct HTML generation with JSON→Template system
@@ -39,6 +29,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3929
- **Report Generation Flow**: Claude provides data, template provides structure (separation of concerns)
4030
- **Error Messages**: More descriptive feedback during report generation process
4131

32+
### Improved
33+
- **Report Generation Output**: Tool failures are now hidden during report generation
34+
- "Tool failed" messages no longer shown for expected errors (file not found, etc.)
35+
- Cleaner, less intimidating output during analysis
36+
- Error messages still visible in debug mode (VIBELOG_DEBUG=1)
37+
- Reduces user anxiety during the 4-5 minute generation process
38+
- **Auto-sync menu**: Simplified educational text for better clarity
39+
- Added shortcut command `install-auto-sync` for quick access
40+
- Added documentation link in the menu
41+
- Updated help text to show the new command
42+
4243
## [0.5.3] - 2025-08-31
4344

4445
### Fixed

scripts/copy-templates.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33
const fs = require('fs');
44
const path = require('path');
55

6-
// Ensure dist/templates directory exists
7-
const distTemplatesDir = path.join(__dirname, '..', 'dist', 'templates');
8-
if (!fs.existsSync(distTemplatesDir)) {
9-
fs.mkdirSync(distTemplatesDir, { recursive: true });
10-
}
11-
12-
// Copy template file
6+
// Copy template file directly to dist/ to avoid directory issues with sha256sum
137
const srcTemplate = path.join(__dirname, '..', 'src', 'templates', 'report-template.html');
14-
const destTemplate = path.join(__dirname, '..', 'dist', 'templates', 'report-template.html');
8+
const destTemplate = path.join(__dirname, '..', 'dist', 'report-template.html');
159

1610
if (fs.existsSync(srcTemplate)) {
1711
fs.copyFileSync(srcTemplate, destTemplate);
18-
console.log('✅ Template copied to dist/templates/');
12+
console.log('✅ Template copied to dist/');
1913
} else {
2014
console.error('❌ Template file not found:', srcTemplate);
2115
process.exit(1);

scripts/generate-checksums.js

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,42 +18,23 @@ function generateChecksum(filePath) {
1818
});
1919
}
2020

21-
/**
22-
* Get all files in a directory recursively
23-
*/
24-
function getAllFiles(dirPath, arrayOfFiles = []) {
25-
const files = fs.readdirSync(dirPath);
26-
27-
files.forEach(file => {
28-
const filePath = path.join(dirPath, file);
29-
if (fs.statSync(filePath).isDirectory()) {
30-
arrayOfFiles = getAllFiles(filePath, arrayOfFiles);
31-
} else {
32-
arrayOfFiles.push(filePath);
33-
}
34-
});
35-
36-
return arrayOfFiles;
37-
}
38-
3921
async function main() {
4022
try {
4123
const distPath = path.join(process.cwd(), 'dist');
4224
const checksums = [];
4325

44-
// Get all files in dist directory (including subdirectories)
45-
const allFiles = getAllFiles(distPath);
46-
47-
// Filter out checksums.sha256 if it exists and sort for consistent output
48-
const filesToChecksum = allFiles
49-
.filter(file => !file.endsWith('checksums.sha256'))
26+
// Get all files in dist directory (only files, not directories)
27+
const files = fs.readdirSync(distPath)
28+
.filter(file => {
29+
const filePath = path.join(distPath, file);
30+
return fs.statSync(filePath).isFile() && file !== 'checksums.sha256';
31+
})
5032
.sort();
5133

52-
for (const filePath of filesToChecksum) {
34+
for (const file of files) {
35+
const filePath = path.join(distPath, file);
5336
const checksum = await generateChecksum(filePath);
54-
// Get relative path from dist directory for the checksum file
55-
const relativePath = path.relative(distPath, filePath).replace(/\\/g, '/');
56-
checksums.push(`${checksum} ${relativePath}`);
37+
checksums.push(`${checksum} ${file}`);
5738
}
5839

5940
// Write checksums file

src/lib/report-executor.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export async function executeClaudePrompt(
8282
const isError = content.is_error || false;
8383

8484
if (isError) {
85-
console.log(colors.dim(formatTimestamp(now)) + ' ❌ ' + colors.error('Tool failed'));
85+
// Don't show tool failures - they're usually expected (file not found, etc.)
86+
// Only show in debug mode
87+
if (process.env.VIBELOG_DEBUG) {
88+
console.log(colors.dim(formatTimestamp(now)) + ' ❌ ' + colors.error('Tool failed'));
89+
}
8690
} else {
8791
console.log(colors.dim(formatTimestamp(now)) + ' ✓ ' + colors.success('Tool completed'));
8892

src/lib/report-template-engine.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ export class ReportTemplateEngine {
3131
async loadTemplate(): Promise<void> {
3232
// Look for template in multiple locations to support both development and NPX usage
3333
const possiblePaths = [
34-
// NPX package - template is in dist/templates
34+
// NPX package - template is now directly in dist/
35+
join(__dirname, '..', 'report-template.html'),
36+
// NPX package - old location for compatibility
3537
join(__dirname, '..', 'templates', 'report-template.html'),
3638
// Development - template is in src/templates
3739
join(process.cwd(), 'src', 'templates', 'report-template.html'),
3840
join(process.cwd(), 'vibe-log-cli', 'src', 'templates', 'report-template.html'),
3941
// Fallback paths
4042
join(__dirname, '..', '..', 'src', 'templates', 'report-template.html'),
41-
join(__dirname, '..', '..', 'dist', 'templates', 'report-template.html'),
43+
join(__dirname, '..', '..', 'dist', 'report-template.html'),
4244
];
4345

4446
let templatePath: string | null = null;

0 commit comments

Comments
 (0)