dashcam 1.0.1-beta.2 → 1.0.1-beta.21

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/test_workflow.sh CHANGED
@@ -30,44 +30,93 @@ if [ ! -f "$TEMP_FILE" ]; then
30
30
  fi
31
31
  echo "✅ File tracking configured"
32
32
 
33
- # 4. Start background process that logs current time to the temporary file
33
+ # 4. Start dashcam recording in background
34
34
  echo ""
35
- echo "4. Starting background logging process..."
36
- (
37
- while true; do
38
- echo "$(date): Current time logged" >> "$TEMP_FILE"
39
- sleep 2
40
- done
41
- ) &
42
- LOGGER_PID=$!
43
- echo "✅ Background logger started (PID: $LOGGER_PID)"
35
+ echo "4. Starting dashcam recording in background..."
36
+ # Start recording and redirect output to a log file so we can still monitor it
37
+ ./bin/dashcam.js record --title "Sync Test Recording" --description "Testing video/log synchronization with timestamped events" > /tmp/dashcam-recording.log 2>&1 &
38
+ RECORD_PID=$!
44
39
 
45
- # 5. Start dashcam recording in background
40
+ # Wait for recording to initialize and log tracker to start
41
+ echo "Waiting for recording to initialize (PID: $RECORD_PID)..."
42
+ sleep 1
43
+
44
+ # Write first event after log tracker is fully ready
45
+ RECORDING_START=$(date +%s)
46
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
47
+ echo "🔴 EVENT 1: Recording START at $(date '+%H:%M:%S')"
48
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
49
+ echo "[EVENT 1] Recording started at $(date '+%H:%M:%S') - TIMESTAMP: $RECORDING_START" >> "$TEMP_FILE"
50
+
51
+ # Verify recording is actually running
52
+ if ps -p $RECORD_PID > /dev/null; then
53
+ echo "✅ Recording started successfully"
54
+ else
55
+ echo "❌ Recording process died, check /tmp/dashcam-recording.log"
56
+ exit 1
57
+ fi
58
+
59
+ # 5. Create synchronized log events with visual markers
60
+ echo ""
61
+ echo "5. Creating synchronized test events..."
62
+ echo ""
63
+ echo "╔════════════════════════════════════════════════════════════════╗"
64
+ echo "║ SYNC TEST - Watch for these markers in the recording! ║"
65
+ echo "╚════════════════════════════════════════════════════════════════╝"
46
66
  echo ""
47
- echo "5. Starting dashcam recording in background..."
48
- ./bin/dashcam.js record --title "Test Workflow Recording" --description "Testing CLI workflow with web and file tracking" &
49
67
 
50
- # Give the recording a moment to initialize
51
- sleep 2
52
- echo "✅ Recording started in background"
68
+ # Event 1 was already written above - now continue with the rest
69
+ sleep 3
53
70
 
54
- # 6. Let recording run for a few seconds
71
+ # Event 2 - after 3 seconds
55
72
  echo ""
56
- echo "6. Letting recording run for 20 seconds..."
57
- sleep 20
58
- echo "✅ Recording completed"
73
+ echo "🟡 EVENT 2: 3 seconds mark at $(date '+%H:%M:%S')"
74
+ echo "[EVENT 2] 3 seconds elapsed at $(date '+%H:%M:%S')" >> "$TEMP_FILE"
75
+ sleep 3
59
76
 
60
- # 7. Stop recording and upload (this will kill the background recording process)
77
+ # Event 3 - after 6 seconds
61
78
  echo ""
62
- echo "7. Stopping recording and uploading..."
79
+ echo "🟢 EVENT 3: 6 seconds mark at $(date '+%H:%M:%S')"
80
+ echo "[EVENT 3] 6 seconds elapsed at $(date '+%H:%M:%S')" >> "$TEMP_FILE"
81
+ sleep 3
82
+
83
+ # Event 4 - after 9 seconds
84
+ echo ""
85
+ echo "🔵 EVENT 4: 9 seconds mark at $(date '+%H:%M:%S')"
86
+ echo "[EVENT 4] 9 seconds elapsed at $(date '+%H:%M:%S')" >> "$TEMP_FILE"
87
+ sleep 3
88
+
89
+ # Event 5 - after 12 seconds
90
+ echo ""
91
+ echo "🟣 EVENT 5: 12 seconds mark at $(date '+%H:%M:%S')"
92
+ echo "[EVENT 5] 12 seconds elapsed at $(date '+%H:%M:%S')" >> "$TEMP_FILE"
93
+ sleep 3
94
+
95
+ # Event 6 - before ending
96
+ echo ""
97
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
98
+ echo "⚫ EVENT 6: Recording END at $(date '+%H:%M:%S')"
99
+ echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
100
+ RECORDING_END=$(date +%s)
101
+ echo "[EVENT 6] Recording ending at $(date '+%H:%M:%S') - TIMESTAMP: $RECORDING_END" >> "$TEMP_FILE"
102
+
103
+ DURATION=$((RECORDING_END - RECORDING_START))
104
+ echo ""
105
+ echo "✅ Test events completed (Duration: ${DURATION}s)"
106
+
107
+ # Give a moment for the last event to be fully processed
108
+ echo ""
109
+ echo "Waiting 2 seconds to ensure all events are captured..."
110
+ sleep 2
111
+
112
+ # 6. Stop recording and upload (this will kill the background recording process)
113
+ echo ""
114
+ echo "6. Stopping recording and uploading..."
63
115
  ./bin/dashcam.js stop
64
116
  echo "✅ Recording stopped and uploaded"
65
117
 
66
- # Cleanup: Stop the background logger
67
118
  echo ""
68
119
  echo "🧹 Cleaning up..."
69
- kill $LOGGER_PID 2>/dev/null || true
70
- echo "✅ Background logger stopped"
71
120
 
72
121
  echo ""
73
122
  echo "🎉 Test workflow completed successfully!"
@@ -78,3 +127,28 @@ echo ""
78
127
  echo "📊 Final Status:"
79
128
  ./bin/dashcam.js status
80
129
 
130
+ echo ""
131
+ echo "╔════════════════════════════════════════════════════════════════╗"
132
+ echo "║ SYNC VERIFICATION GUIDE ║"
133
+ echo "╚════════════════════════════════════════════════════════════════╝"
134
+ echo ""
135
+ echo "To verify video/log synchronization in the recording:"
136
+ echo ""
137
+ echo "1. Open the uploaded recording in your browser"
138
+ echo "2. Check the log panel for '$TEMP_FILE'"
139
+ echo "3. Verify these events appear at the correct times:"
140
+ echo ""
141
+ echo " Time | Terminal Display | Log Entry"
142
+ echo " -------|---------------------------|---------------------------"
143
+ echo " 0:00 | 🔴 EVENT 1 | [EVENT 1] Recording started"
144
+ echo " 0:03 | 🟡 EVENT 2 | [EVENT 2] 3 seconds elapsed"
145
+ echo " 0:06 | 🟢 EVENT 3 | [EVENT 3] 6 seconds elapsed"
146
+ echo " 0:09 | 🔵 EVENT 4 | [EVENT 4] 9 seconds elapsed"
147
+ echo " 0:12 | 🟣 EVENT 5 | [EVENT 5] 12 seconds elapsed"
148
+ echo " 0:15 | ⚫ EVENT 6 | [EVENT 6] Recording ending"
149
+ echo ""
150
+ echo "4. The log timestamps should match the video timeline exactly"
151
+ echo "5. Each colored event marker should appear in the video"
152
+ echo " at the same moment as the corresponding log entry"
153
+ echo ""
154
+
@@ -1,103 +0,0 @@
1
- name: Build Binaries
2
-
3
- on:
4
- workflow_dispatch:
5
- workflow_call:
6
- inputs:
7
- upload_artifacts:
8
- description: 'Whether to upload artifacts'
9
- required: false
10
- type: boolean
11
- default: true
12
-
13
- jobs:
14
- build:
15
- runs-on: ${{ matrix.os }}
16
- strategy:
17
- matrix:
18
- os: [ubuntu-latest, macos-latest, windows-latest]
19
-
20
- steps:
21
- - name: Checkout code
22
- uses: actions/checkout@v4
23
-
24
- - name: Setup Node.js
25
- uses: actions/setup-node@v4
26
- with:
27
- node-version: '20'
28
- cache: 'npm'
29
-
30
- - name: Setup Python (Windows)
31
- if: matrix.os == 'windows-latest'
32
- uses: actions/setup-python@v5
33
- with:
34
- python-version: '3.11'
35
-
36
- - name: Install dependencies
37
- run: npm ci
38
-
39
- - name: Build bundle
40
- run: npm run bundle
41
-
42
- - name: Verify bundle created
43
- run: |
44
- ls -la dist/ || dir dist\
45
- shell: bash
46
-
47
- - name: Build binaries (macOS)
48
- if: matrix.os == 'macos-latest'
49
- run: npm run build:macos
50
-
51
- - name: Build binaries (Linux)
52
- if: matrix.os == 'ubuntu-latest'
53
- run: npm run build:linux
54
-
55
- - name: Build binaries (Windows)
56
- if: matrix.os == 'windows-latest'
57
- run: npm run build:windows
58
- continue-on-error: true
59
-
60
- - name: Check Windows build
61
- if: matrix.os == 'windows-latest'
62
- run: |
63
- if (Test-Path dist/bundle-x64.exe) {
64
- Write-Host "Windows build successful"
65
- exit 0
66
- } else {
67
- Write-Host "Windows build failed, but continuing..."
68
- exit 0
69
- }
70
- shell: pwsh
71
-
72
- - name: List built files
73
- run: |
74
- ls -la dist/ || dir dist\
75
- shell: bash
76
-
77
- - name: Upload artifacts (macOS)
78
- if: matrix.os == 'macos-latest' && (inputs.upload_artifacts || github.event_name == 'pull_request')
79
- uses: actions/upload-artifact@v4
80
- with:
81
- name: dashcam-macos
82
- path: |
83
- dist/bundle-arm64
84
- dist/bundle-x64
85
-
86
- - name: Upload artifacts (Linux)
87
- if: matrix.os == 'ubuntu-latest' && (inputs.upload_artifacts || github.event_name == 'pull_request')
88
- uses: actions/upload-artifact@v4
89
- with:
90
- name: dashcam-linux
91
- path: |
92
- dist/bundle-arm64
93
- dist/bundle-x64
94
-
95
- - name: Upload artifacts (Windows)
96
- if: (matrix.os == 'windows-latest' && hashFiles('dist/bundle-x64.exe') != '') && (inputs.upload_artifacts || github.event_name == 'pull_request')
97
- uses: actions/upload-artifact@v4
98
- with:
99
- name: dashcam-windows
100
- path: |
101
- dist/bundle-x64.exe
102
- dist/bundle-arm64.exe
103
- if-no-files-found: warn
@@ -1,107 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- workflow_dispatch:
5
-
6
- permissions:
7
- contents: write
8
-
9
- jobs:
10
- bump-version:
11
- runs-on: ubuntu-latest
12
- # Skip if commit message contains [skip ci] or [skip release]
13
- if: ${{ !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip release]') }}
14
- outputs:
15
- new_tag: ${{ steps.bump.outputs.new_tag }}
16
- version: ${{ steps.bump.outputs.tag }}
17
- steps:
18
- - name: Checkout code
19
- uses: actions/checkout@v4
20
- with:
21
- fetch-depth: 0
22
- token: ${{ secrets.GITHUB_TOKEN }}
23
-
24
- - name: Bump version and create tag
25
- id: bump
26
- uses: anothrNick/github-tag-action@1.67.0
27
- env:
28
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29
- WITH_V: true
30
- DEFAULT_BUMP: patch
31
- INITIAL_VERSION: 1.0.0
32
- RELEASE_BRANCHES: main,master
33
-
34
- build:
35
- needs: bump-version
36
- uses: ./.github/workflows/build.yml
37
- with:
38
- upload_artifacts: true
39
-
40
- release:
41
- needs: [bump-version, build]
42
- runs-on: ubuntu-latest
43
- if: needs.bump-version.outputs.new_tag != ''
44
-
45
- steps:
46
- - name: Download all artifacts
47
- uses: actions/download-artifact@v4
48
- continue-on-error: true
49
-
50
- - name: List downloaded artifacts
51
- run: |
52
- echo "Downloaded artifacts:"
53
- ls -R
54
-
55
- - name: Prepare release files
56
- run: |
57
- mkdir -p release
58
- # macOS binaries
59
- if [ -f dashcam-macos/bundle-arm64 ]; then
60
- cp dashcam-macos/bundle-arm64 release/dashcam-macos-arm64
61
- chmod +x release/dashcam-macos-arm64
62
- fi
63
- if [ -f dashcam-macos/bundle-x64 ]; then
64
- cp dashcam-macos/bundle-x64 release/dashcam-macos-x64
65
- chmod +x release/dashcam-macos-x64
66
- fi
67
- # Linux binaries
68
- if [ -f dashcam-linux/bundle-arm64 ]; then
69
- cp dashcam-linux/bundle-arm64 release/dashcam-linux-arm64
70
- chmod +x release/dashcam-linux-arm64
71
- fi
72
- if [ -f dashcam-linux/bundle-x64 ]; then
73
- cp dashcam-linux/bundle-x64 release/dashcam-linux-x64
74
- chmod +x release/dashcam-linux-x64
75
- fi
76
- # Windows binaries
77
- if [ -f dashcam-windows/bundle-x64.exe ]; then
78
- cp dashcam-windows/bundle-x64.exe release/dashcam-windows-x64.exe
79
- fi
80
- if [ -f dashcam-windows/bundle-arm64.exe ]; then
81
- cp dashcam-windows/bundle-arm64.exe release/dashcam-windows-arm64.exe
82
- fi
83
- ls -la release/
84
-
85
- - name: Create Release
86
- uses: softprops/action-gh-release@v1
87
- with:
88
- tag_name: ${{ needs.bump-version.outputs.new_tag }}
89
- name: Release ${{ needs.bump-version.outputs.new_tag }}
90
- body: |
91
- ## Dashcam CLI Release ${{ needs.bump-version.outputs.new_tag }}
92
-
93
- Automated release with binaries for macOS (x64, ARM64), Linux (x64, ARM64), and Windows (x64, ARM64).
94
-
95
- ### Download Instructions
96
- - **macOS Intel**: `dashcam-macos-x64`
97
- - **macOS Apple Silicon**: `dashcam-macos-arm64`
98
- - **Linux x64**: `dashcam-linux-x64`
99
- - **Linux ARM64**: `dashcam-linux-arm64`
100
- - **Windows x64**: `dashcam-windows-x64.exe`
101
- - **Windows ARM64**: `dashcam-windows-arm64.exe`
102
- files: release/*
103
- draft: false
104
- prerelease: false
105
- fail_on_unmatched_files: false
106
- env:
107
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}