appydave-tools 0.66.0 → 0.67.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/bin/dam +1 -1
- data/lib/appydave/tools/dam/project_listing.rb +120 -43
- data/lib/appydave/tools/version.rb +1 -1
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcb556d99a18280e3339c68e65df1fd7e821c1a55e55e2be9f4a8972ab50f07c
|
|
4
|
+
data.tar.gz: f999edff5d375ce8fc34bc708d3ff2c9e7bb099bf8d8301bc25519411b67e0a4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77c0312c15cb033e6c7c23ebe6e2c81b18214b199297e25fd0f030faf8de76d479460a93d700066a1a7e1cc9c560f3d20af3263933a35ab2b409dfc1be37533b
|
|
7
|
+
data.tar.gz: 360c380d91269fc8db5bd7713350aaadce1182e918b5318db52ce7e3744b92d0ecce93e4dc0e36af4e8fbb4e31bdef6c943bda8ccbe2aaff94317d6f5c4cb53b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [0.66.0](https://github.com/appydave/appydave-tools/compare/v0.65.0...v0.66.0) (2025-11-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* add --detailed flag to brand list showing PATH, SSD BACKUP, WORKFLOW, and ACTIVE PROJECTS ([e336e58](https://github.com/appydave/appydave-tools/commit/e336e585270305f01295c91c0543075a0e0438ad))
|
|
7
|
+
|
|
1
8
|
# [0.65.0](https://github.com/appydave/appydave-tools/compare/v0.64.0...v0.65.0) (2025-11-22)
|
|
2
9
|
|
|
3
10
|
|
data/bin/dam
CHANGED
|
@@ -143,7 +143,7 @@ class VatCLI
|
|
|
143
143
|
Appydave::Tools::Dam::ProjectListing.list_with_pattern(brand_arg, pattern_arg)
|
|
144
144
|
else
|
|
145
145
|
# Specific brand
|
|
146
|
-
Appydave::Tools::Dam::ProjectListing.list_brand_projects(brand_arg)
|
|
146
|
+
Appydave::Tools::Dam::ProjectListing.list_brand_projects(brand_arg, detailed: detailed)
|
|
147
147
|
end
|
|
148
148
|
rescue StandardError => e
|
|
149
149
|
puts "❌ Error: #{e.message}"
|
|
@@ -10,6 +10,7 @@ module Appydave
|
|
|
10
10
|
# Project listing functionality for VAT
|
|
11
11
|
class ProjectListing
|
|
12
12
|
# List all brands with summary table
|
|
13
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
13
14
|
def self.list_brands_with_counts(detailed: false)
|
|
14
15
|
brands = Config.available_brands
|
|
15
16
|
|
|
@@ -77,9 +78,11 @@ module Appydave
|
|
|
77
78
|
"#{total_projects} project#{'s' if total_projects != 1}, " \
|
|
78
79
|
"#{format_size(total_size)}"
|
|
79
80
|
end
|
|
81
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
80
82
|
|
|
81
83
|
# List all projects for a specific brand (Mode 3)
|
|
82
|
-
|
|
84
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
85
|
+
def self.list_brand_projects(brand_arg, detailed: false)
|
|
83
86
|
# ProjectResolver expects the original brand key/shortcut, not the expanded v-* version
|
|
84
87
|
projects = ProjectResolver.list_projects(brand_arg)
|
|
85
88
|
|
|
@@ -102,58 +105,57 @@ module Appydave
|
|
|
102
105
|
|
|
103
106
|
# Gather project data
|
|
104
107
|
brand_path = Config.brand_path(brand_arg)
|
|
108
|
+
brand_info = Appydave::Tools::Configuration::Config.brands.get_brand(brand_arg)
|
|
105
109
|
is_git_repo = Dir.exist?(File.join(brand_path, '.git'))
|
|
106
110
|
|
|
107
111
|
project_data = projects.map do |project|
|
|
108
|
-
|
|
109
|
-
size = FileHelper.calculate_directory_size(project_path)
|
|
110
|
-
modified = File.mtime(project_path)
|
|
111
|
-
|
|
112
|
-
# Check if project has uncommitted changes (if brand is git repo)
|
|
113
|
-
git_status = if is_git_repo
|
|
114
|
-
calculate_project_git_status(brand_path, project)
|
|
115
|
-
else
|
|
116
|
-
'N/A'
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
# Check if project has s3-staging folder
|
|
120
|
-
s3_sync = if Dir.exist?(File.join(project_path, 's3-staging'))
|
|
121
|
-
'✓ staged'
|
|
122
|
-
else
|
|
123
|
-
'none'
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
name: project,
|
|
128
|
-
path: project_path,
|
|
129
|
-
size: size,
|
|
130
|
-
modified: modified,
|
|
131
|
-
age: format_age(modified),
|
|
132
|
-
stale: stale?(modified),
|
|
133
|
-
git_status: git_status,
|
|
134
|
-
s3_sync: s3_sync
|
|
135
|
-
}
|
|
112
|
+
collect_project_data(brand_arg, brand_path, brand_info, project, is_git_repo, detailed: detailed)
|
|
136
113
|
end
|
|
137
114
|
|
|
138
|
-
# Print
|
|
115
|
+
# Print common header
|
|
139
116
|
puts "Projects in #{brand}:"
|
|
140
117
|
puts ''
|
|
141
118
|
puts 'ℹ️ Note: Lists only projects with files, not empty directories'
|
|
142
119
|
puts ''
|
|
143
|
-
puts 'PROJECT SIZE AGE GIT S3'
|
|
144
|
-
puts '-' * 130
|
|
145
120
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
data[:
|
|
155
|
-
|
|
156
|
-
|
|
121
|
+
if detailed
|
|
122
|
+
# Detailed view with additional columns
|
|
123
|
+
header = 'PROJECT SIZE AGE GIT S3 ' \
|
|
124
|
+
'PATH HEAVY FILES LIGHT FILES SSD BACKUP'
|
|
125
|
+
puts header
|
|
126
|
+
puts '-' * 200
|
|
127
|
+
|
|
128
|
+
project_data.each do |data|
|
|
129
|
+
age_display = data[:stale] ? "#{data[:age]} ⚠️" : data[:age]
|
|
130
|
+
puts format(
|
|
131
|
+
'%-45s %12s %15s %-15s %-10s %-35s %-18s %-18s %-30s',
|
|
132
|
+
data[:name],
|
|
133
|
+
format_size(data[:size]),
|
|
134
|
+
age_display,
|
|
135
|
+
data[:git_status],
|
|
136
|
+
data[:s3_sync],
|
|
137
|
+
shorten_path(data[:path]),
|
|
138
|
+
data[:heavy_files] || 'N/A',
|
|
139
|
+
data[:light_files] || 'N/A',
|
|
140
|
+
data[:ssd_backup] || 'N/A'
|
|
141
|
+
)
|
|
142
|
+
end
|
|
143
|
+
else
|
|
144
|
+
# Default view
|
|
145
|
+
puts 'PROJECT SIZE AGE GIT S3'
|
|
146
|
+
puts '-' * 130
|
|
147
|
+
|
|
148
|
+
project_data.each do |data|
|
|
149
|
+
age_display = data[:stale] ? "#{data[:age]} ⚠️" : data[:age]
|
|
150
|
+
puts format(
|
|
151
|
+
'%-45s %12s %15s %-15s %-10s',
|
|
152
|
+
data[:name],
|
|
153
|
+
format_size(data[:size]),
|
|
154
|
+
age_display,
|
|
155
|
+
data[:git_status],
|
|
156
|
+
data[:s3_sync]
|
|
157
|
+
)
|
|
158
|
+
end
|
|
157
159
|
end
|
|
158
160
|
|
|
159
161
|
# Print footer summary
|
|
@@ -163,8 +165,10 @@ module Appydave
|
|
|
163
165
|
puts ''
|
|
164
166
|
puts "Total: #{project_count} project#{'s' if project_count != 1}, #{format_size(total_size)}"
|
|
165
167
|
end
|
|
168
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
166
169
|
|
|
167
170
|
# List with pattern matching (Mode 3b)
|
|
171
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
168
172
|
def self.list_with_pattern(brand_arg, pattern)
|
|
169
173
|
# ProjectResolver expects the original brand key/shortcut, not the expanded v-* version
|
|
170
174
|
matches = ProjectResolver.resolve_pattern(brand_arg, pattern)
|
|
@@ -227,10 +231,12 @@ module Appydave
|
|
|
227
231
|
puts "Total: #{match_count} project#{'s' if match_count != 1}, #{format_size(total_size)} " \
|
|
228
232
|
"(#{percentage}% of #{brand})"
|
|
229
233
|
end
|
|
234
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
230
235
|
|
|
231
236
|
# Helper methods
|
|
232
237
|
|
|
233
238
|
# Show brand context header with git, S3, and SSD info
|
|
239
|
+
# rubocop:disable Metrics/AbcSize
|
|
234
240
|
def self.show_brand_header(brand_arg, brand)
|
|
235
241
|
Appydave::Tools::Configuration::Config.configure
|
|
236
242
|
brand_info = Appydave::Tools::Configuration::Config.brands.get_brand(brand_arg)
|
|
@@ -265,8 +271,10 @@ module Appydave
|
|
|
265
271
|
|
|
266
272
|
puts ''
|
|
267
273
|
end
|
|
274
|
+
# rubocop:enable Metrics/AbcSize
|
|
268
275
|
|
|
269
276
|
# Collect brand data for display
|
|
277
|
+
# rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
|
270
278
|
def self.collect_brand_data(brand, detailed: false)
|
|
271
279
|
Appydave::Tools::Configuration::Config.configure
|
|
272
280
|
brand_info = Appydave::Tools::Configuration::Config.brands.get_brand(brand)
|
|
@@ -325,6 +333,7 @@ module Appydave
|
|
|
325
333
|
|
|
326
334
|
result
|
|
327
335
|
end
|
|
336
|
+
# rubocop:enable Metrics/AbcSize, Metrics/MethodLength
|
|
328
337
|
|
|
329
338
|
# Calculate git status for a brand
|
|
330
339
|
def self.calculate_git_status(brand_path)
|
|
@@ -368,6 +377,74 @@ module Appydave
|
|
|
368
377
|
end
|
|
369
378
|
end
|
|
370
379
|
|
|
380
|
+
# Collect project data for display
|
|
381
|
+
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
|
|
382
|
+
def self.collect_project_data(brand_arg, brand_path, brand_info, project, is_git_repo, detailed: false)
|
|
383
|
+
project_path = Config.project_path(brand_arg, project)
|
|
384
|
+
size = FileHelper.calculate_directory_size(project_path)
|
|
385
|
+
modified = File.mtime(project_path)
|
|
386
|
+
|
|
387
|
+
# Check if project has uncommitted changes (if brand is git repo)
|
|
388
|
+
git_status = if is_git_repo
|
|
389
|
+
calculate_project_git_status(brand_path, project)
|
|
390
|
+
else
|
|
391
|
+
'N/A'
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
# Check if project has s3-staging folder
|
|
395
|
+
s3_sync = if Dir.exist?(File.join(project_path, 's3-staging'))
|
|
396
|
+
'✓ staged'
|
|
397
|
+
else
|
|
398
|
+
'none'
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
result = {
|
|
402
|
+
name: project,
|
|
403
|
+
path: project_path,
|
|
404
|
+
size: size,
|
|
405
|
+
modified: modified,
|
|
406
|
+
age: format_age(modified),
|
|
407
|
+
stale: stale?(modified),
|
|
408
|
+
git_status: git_status,
|
|
409
|
+
s3_sync: s3_sync
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
# Add detailed fields if requested
|
|
413
|
+
if detailed
|
|
414
|
+
# Heavy files (video files in root)
|
|
415
|
+
heavy_count = 0
|
|
416
|
+
heavy_size = 0
|
|
417
|
+
Dir.glob(File.join(project_path, '*.{mp4,mov,avi,mkv,webm}')).each do |file|
|
|
418
|
+
heavy_count += 1
|
|
419
|
+
heavy_size += File.size(file)
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
# Light files (subtitles, images, metadata)
|
|
423
|
+
light_count = 0
|
|
424
|
+
light_size = 0
|
|
425
|
+
Dir.glob(File.join(project_path, '**/*.{srt,vtt,jpg,png,md,txt,json,yml}')).each do |file|
|
|
426
|
+
light_count += 1
|
|
427
|
+
light_size += File.size(file)
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# SSD backup path (if exists)
|
|
431
|
+
ssd_backup = brand_info.locations.ssd_backup
|
|
432
|
+
ssd_path = if ssd_backup && !ssd_backup.empty? && ssd_backup != 'NOT-SET'
|
|
433
|
+
ssd_project_path = File.join(ssd_backup, project)
|
|
434
|
+
File.exist?(ssd_project_path) ? shorten_path(ssd_project_path) : nil
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
result.merge!(
|
|
438
|
+
heavy_files: "#{heavy_count} (#{format_size(heavy_size)})",
|
|
439
|
+
light_files: "#{light_count} (#{format_size(light_size)})",
|
|
440
|
+
ssd_backup: ssd_path
|
|
441
|
+
)
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
result
|
|
445
|
+
end
|
|
446
|
+
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
|
|
447
|
+
|
|
371
448
|
# Calculate total size of all projects in a brand
|
|
372
449
|
def self.calculate_total_size(brand, projects)
|
|
373
450
|
projects.sum do |project|
|
data/package.json
CHANGED