@arela/uploader 0.0.9 β†’ 0.0.11

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.
Files changed (4) hide show
  1. package/README.md +83 -0
  2. package/package.json +2 -3
  3. package/src/index.js +639 -127
  4. package/upload.log +1323 -158
package/README.md CHANGED
@@ -1 +1,84 @@
1
1
  # arela-uploader
2
+
3
+ CLI tool to upload files and directories to Supabase Storage with automatic file renaming and sanitization.
4
+
5
+ ## Features
6
+
7
+ - πŸ“ Upload entire directories or individual files
8
+ - πŸ”„ Automatic file renaming to handle problematic characters
9
+ - πŸ“ Comprehensive logging (local and remote)
10
+ - ⚑ Retry mechanism for failed uploads
11
+ - 🎯 Skip duplicate files automatically
12
+ - πŸ“Š Progress bars and detailed summaries
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ npm install -g @arela/uploader
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ### Basic Upload
23
+ ```bash
24
+ arela -p "my-folder"
25
+ ```
26
+
27
+ ### Upload with File Renaming
28
+ For files with accents, special characters, or problematic names:
29
+
30
+ ```bash
31
+ # Preview what files would be renamed (dry run)
32
+ arela --rename-files --dry-run
33
+
34
+ # Actually rename and upload files
35
+ arela --rename-files -p "documents"
36
+ ```
37
+
38
+ ### Options
39
+
40
+ - `-p, --prefix <prefix>`: Prefix path in bucket (default: "")
41
+ - `-r, --rename-files`: Rename files with problematic characters before uploading
42
+ - `--dry-run`: Show what files would be renamed without actually renaming them
43
+ - `-h, --help`: Display help information
44
+ - `-v, --version`: Display version number
45
+
46
+ ## Environment Variables
47
+
48
+ Create a `.env` file in your project root:
49
+
50
+ ```env
51
+ SUPABASE_URL=your_supabase_url
52
+ SUPABASE_KEY=your_supabase_anon_key
53
+ SUPABASE_BUCKET=your_bucket_name
54
+ UPLOAD_BASE_PATH=/path/to/your/files
55
+ UPLOAD_SOURCES=folder1|folder2|file.pdf
56
+ ```
57
+
58
+ ## File Renaming
59
+
60
+ The tool automatically handles problematic characters by:
61
+
62
+ - Removing accents (Γ‘ β†’ a, Γ± β†’ n, etc.)
63
+ - Replacing special characters with safe alternatives
64
+ - Converting spaces to dashes
65
+ - Removing or replacing symbols like `{}[]~^`|"<>?*:`
66
+ - Handling Korean characters and other Unicode symbols
67
+
68
+ ### Examples
69
+
70
+ | Original | Renamed |
71
+ |----------|---------|
72
+ | `Facturas ImportaciΓ³n.pdf` | `Facturas-Importacion.pdf` |
73
+ | `File{with}brackets.pdf` | `File-with-brackets.pdf` |
74
+ | `Document ^& symbols.pdf` | `Document-and-symbols.pdf` |
75
+ | `CI & PL-20221212(λ©•μ‹œμ½”μš©).xls` | `CI-and-PL-20221212.xls` |
76
+
77
+ ## Logging
78
+
79
+ The tool maintains logs both locally (`upload.log`) and remotely in your Supabase database. Logs include:
80
+
81
+ - Upload status (success/error/skipped)
82
+ - File paths and sanitization changes
83
+ - Error messages and timestamps
84
+ - Rename operations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arela/uploader",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "CLI to upload files/directories to Arela",
5
5
  "bin": {
6
6
  "arela": "./src/index.js"
@@ -33,8 +33,7 @@
33
33
  "commander": "^13.1.0",
34
34
  "dotenv": "^16.5.0",
35
35
  "globby": "^14.1.0",
36
- "mime-types": "^3.0.1",
37
- "ora": "^8.2.0"
36
+ "mime-types": "^3.0.1"
38
37
  },
39
38
  "devDependencies": {
40
39
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",