vg-coder-cli 1.0.1 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vg-coder-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "🚀 CLI tool to analyze projects, concatenate source files, count tokens, and export HTML with syntax highlighting and copy functionality",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -36,12 +36,12 @@
36
36
  "license": "MIT",
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/vg-coder/vg-coder-cli.git"
39
+ "url": "https://github.com/tinhthanh/vg-coder-cli.git"
40
40
  },
41
41
  "bugs": {
42
- "url": "https://github.com/vg-coder/vg-coder-cli/issues"
42
+ "url": "https://github.com/tinhthanh/vg-coder-cli/issues"
43
43
  },
44
- "homepage": "https://github.com/vg-coder/vg-coder-cli#readme",
44
+ "homepage": "https://github.com/tinhthanh/vg-coder-cli#readme",
45
45
  "dependencies": {
46
46
  "commander": "^11.1.0",
47
47
  "directory-tree": "^3.5.1",
@@ -215,6 +215,27 @@ class HtmlExporter {
215
215
 
216
216
  ${this.options.includeSearch ? this.generateSearchSection() : ''}
217
217
 
218
+ <section class="template-section">
219
+ <h2>📝 Script Template Hướng Dẫn</h2>
220
+ <div class="template-container">
221
+ <div class="template-header">
222
+ <span class="template-title">Quy tắc tạo script chỉnh sửa file:</span>
223
+ <button onclick="copyTemplateGuide()" class="btn btn-copy">📋 Copy Template</button>
224
+ </div>
225
+ <div class="template-content">
226
+ <pre id="template-guide"><code>Trả về với định dạng
227
+ Quy tắc bắt buộc:
228
+ Script phải có cú pháp:
229
+ mkdir -p $(dirname "path/to/file.ext")
230
+ cat <<'EOF' > path/to/file.ext
231
+ ... toàn bộ nội dung file sau khi chỉnh sửa ...
232
+ EOF
233
+ Mỗi file cần thay đổi phải được ghi đè hoàn toàn bằng nội dung mới.
234
+ Nếu file chưa tồn tại, script sẽ tự tạo file và thư mục cha.</code></pre>
235
+ </div>
236
+ </div>
237
+ </section>
238
+
218
239
  <section class="content-section">
219
240
  <div class="code-container">
220
241
  <pre id="combined-content"><code>${highlightedContent}</code></pre>
@@ -460,6 +481,63 @@ body {
460
481
  color: #2c3e50;
461
482
  }
462
483
 
484
+ /* Template Section */
485
+ .template-section {
486
+ margin: 30px 0;
487
+ padding: 20px;
488
+ background: #f8f9fa;
489
+ border-radius: 8px;
490
+ border-left: 4px solid #3498db;
491
+ }
492
+
493
+ .template-section h2 {
494
+ margin: 0 0 20px 0;
495
+ color: #2c3e50;
496
+ font-size: 1.4em;
497
+ }
498
+
499
+ .template-container {
500
+ background: white;
501
+ border-radius: 6px;
502
+ overflow: hidden;
503
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
504
+ }
505
+
506
+ .template-header {
507
+ display: flex;
508
+ justify-content: space-between;
509
+ align-items: center;
510
+ padding: 15px 20px;
511
+ background: #ecf0f1;
512
+ border-bottom: 1px solid #bdc3c7;
513
+ }
514
+
515
+ .template-title {
516
+ font-weight: 600;
517
+ color: #2c3e50;
518
+ }
519
+
520
+ .template-content {
521
+ padding: 0;
522
+ }
523
+
524
+ .template-content pre {
525
+ margin: 0;
526
+ padding: 20px;
527
+ background: #2c3e50;
528
+ color: #ecf0f1;
529
+ font-family: 'Courier New', monospace;
530
+ font-size: 14px;
531
+ line-height: 1.6;
532
+ overflow-x: auto;
533
+ }
534
+
535
+ .template-content code {
536
+ background: none;
537
+ color: inherit;
538
+ padding: 0;
539
+ }
540
+
463
541
  .content-section {
464
542
  background: white;
465
543
  border-radius: 10px;
@@ -891,7 +969,43 @@ document.addEventListener('DOMContentLoaded', function() {
891
969
  }
892
970
  }
893
971
  });
894
- });`;
972
+ });
973
+
974
+ // Copy template guide
975
+ async function copyTemplateGuide() {
976
+ try {
977
+ const templateText = \`Trả về với định dạng
978
+ Quy tắc bắt buộc:
979
+ Script phải có cú pháp:
980
+ mkdir -p $(dirname "path/to/file.ext")
981
+ cat <<'EOF' > path/to/file.ext
982
+ ... toàn bộ nội dung file sau khi chỉnh sửa ...
983
+ EOF
984
+ Mỗi file cần thay đổi phải được ghi đè hoàn toàn bằng nội dung mới.
985
+ Nếu file chưa tồn tại, script sẽ tự tạo file và thư mục cha.\`;
986
+
987
+ if (navigator.clipboard && window.isSecureContext) {
988
+ await navigator.clipboard.writeText(templateText);
989
+ } else {
990
+ // Fallback for older browsers
991
+ const textArea = document.createElement('textarea');
992
+ textArea.value = templateText;
993
+ textArea.style.position = 'fixed';
994
+ textArea.style.left = '-999999px';
995
+ textArea.style.top = '-999999px';
996
+ document.body.appendChild(textArea);
997
+ textArea.focus();
998
+ textArea.select();
999
+ document.execCommand('copy');
1000
+ document.body.removeChild(textArea);
1001
+ }
1002
+
1003
+ showCopySuccess();
1004
+ } catch (err) {
1005
+ console.error('Failed to copy template: ', err);
1006
+ alert('Failed to copy template to clipboard');
1007
+ }
1008
+ }`;
895
1009
 
896
1010
  await fs.writeFile(path.join(assetsPath, 'scripts.js'), js);
897
1011
  }
@@ -0,0 +1 @@
1
+ {"name": "test-small", "version": "1.0.0"}
@@ -0,0 +1 @@
1
+ console.log("Hello World");
Binary file
Binary file
Binary file
Binary file