gh-upload-file 0.0.0-stage → 0.13.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.
- package/CHANGELOG.md +253 -0
- package/LICENSE +24 -0
- package/README.md +708 -2
- package/package.json +43 -4
- package/src/cli.js +491 -0
- package/src/common.js +655 -0
- package/src/file-upload.js +177 -0
- package/src/git-push.js +98 -0
- package/src/index.js +577 -0
- package/src/package-version.js +14 -0
- package/src/repository-target.js +48 -0
- package/src/repository-upload.js +821 -0
- package/src/sanitization.js +106 -0
- package/src/self-test.js +286 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# gh-upload-log
|
|
2
|
+
|
|
3
|
+
## 0.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fix CI/CD false positives, false negatives and warnings: release scripts now fail on any failed git, npm or gh command instead of reporting success, and no longer evaluate code downloaded from unpkg. GitHub release notes are published as Changesets wrote them (nested lists, later entries and text after `---` are no longer dropped, every entry's pull request is linked), the npm badges no longer render as "badge not found", and a release reads exactly its own CHANGELOG.md section. The workflow adopts the pipeline template's practices (change detection, a pipeline-status gate, release preflight annotations, pinned runners and actions, per-job timeouts and concurrency, secret scanning, Markdown link checking, documentation and file-size checks, actionlint, ShellCheck, zizmor, CodeQL and dependency audits), and the lockfiles no longer contain known high or moderate advisories.
|
|
8
|
+
|
|
9
|
+
The release step now fails when GitHub refuses to create the release (under Bun, command-stream 0.7.1 reported exit code 0 for a failing command fed through stdin), a version-commit push that lost a race with another merge is rebased and retried while a push refused by a repository rule fails at once with the rule's output, npm publication is verified for up to 25 minutes and an E409 "already published" answer counts as landed, and a release that died after the version commit or the publish is finished by the next push to main instead of being forgotten.
|
|
10
|
+
|
|
11
|
+
Authentication and registry errors (E404, E401, E403, ENEEDAUTH) from `npm publish` are no longer retried, every published npm name is installed from the registry and smoke-tested (each bin's `--help` and the library import) before the GitHub release is created, and shell scripts and the git hook keep LF line endings on Windows checkouts, where CRLF made Bash fail with `set: pipefail\r: invalid option name`.
|
|
12
|
+
|
|
13
|
+
Sanitize every upload with sensitive-data-sanitizer in streaming credentials-only mode, preserving public account details and binary bytes while reporting rule counts. Block uploads on sanitization errors. Check npm package bootstrap before versioning releases, retain synchronized gh-upload-log publication, and document required npm owner recovery steps.
|
|
14
|
+
|
|
15
|
+
## 0.12.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- b30b770: Track the published compatibility package in the README badge, explain renamed-package availability, and add actionable npm authorization diagnostics.
|
|
20
|
+
|
|
21
|
+
## 0.12.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- 3b926b7: Publish the universal package as `gh-upload-file`: npm refuses `gh-upload` as too similar to `rc-upload`. The `gh-upload` command is unchanged and `gh-upload-file` is added as a command.
|
|
26
|
+
|
|
27
|
+
## 0.11.0
|
|
28
|
+
|
|
29
|
+
### Minor Changes
|
|
30
|
+
|
|
31
|
+
- b86bb49: Publish gh-upload alongside gh-upload-log with both command names and an uploadFile API alias. Automatically archive binary files with streaming gzip and split oversized archives into parts of at most 100 MB, while retaining readable text uploads, retries and resume support. Verify publication of every package name with uncached npm registry checks before creating a release.
|
|
32
|
+
|
|
33
|
+
## 0.10.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- de23ee4: Give real Git integration tests explicit Windows-sized timeouts and bounded subprocess diagnostics so slow runners do not block releases at Bun's default five-second limit.
|
|
38
|
+
|
|
39
|
+
## 0.10.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- 722cc83: Add explicit existing repository and branch targets for installation-token uploads without querying the authenticated user or creating repositories. Keep repository reads scoped to the selected branch and distinguish permanent Gist permission failures from retryable rate limits.
|
|
44
|
+
|
|
45
|
+
## 0.9.3
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- ea2dc72: Retry transient shared-repository push failures with exponential backoff and fetch/rebase recovery. Commit and push each log chunk separately, and resume incomplete uploads without treating the first chunk as a complete log. Add `--chunk-size` / `GH_UPLOAD_LOG_CHUNK_SIZE` and the library `chunkSize` option. Split chunks on line boundaries where possible and preserve UTF-8 characters when a line exceeds the byte limit.
|
|
50
|
+
|
|
51
|
+
## 0.9.2
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- 1b31255: Fail the release workflow when release-note formatting commands fail, and run both formatting helpers with Bun and locked dependencies.
|
|
56
|
+
|
|
57
|
+
## 0.9.1
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- 770cea8: Ship the existing relative-path upload fix to npm by repairing trusted publishing, reject failed publish commands instead of creating false-success GitHub releases, and report the installed package version from the CLI.
|
|
62
|
+
|
|
63
|
+
## 0.9.0
|
|
64
|
+
|
|
65
|
+
### Minor Changes
|
|
66
|
+
|
|
67
|
+
- a00463b: Upload a log again when its content changed, even if the same path was uploaded before (#38).
|
|
68
|
+
|
|
69
|
+
Repository-mode uploads are now content addressed: logs are stored as
|
|
70
|
+
`<normalized-directory>/<content-hash>/<file-name>.log.txt` instead of
|
|
71
|
+
`log-<flattened-path>/<flattened-path>.log.txt`. A changed file gets a new hash
|
|
72
|
+
folder and is uploaded again, identical content is deduplicated and links to the
|
|
73
|
+
file that actually exists, and the path is no longer duplicated in the folder and
|
|
74
|
+
file names.
|
|
75
|
+
- Deduplication now checks that the expected file exists in the folder, so a
|
|
76
|
+
partial upload is retried instead of being reported as complete.
|
|
77
|
+
- New `--gist-limit` / `GH_UPLOAD_LOG_GIST_LIMIT` option to configure the gist
|
|
78
|
+
size threshold (clamped to GitHub's documented 100MB per gist file).
|
|
79
|
+
- Gist creation retries on transient `502`/`503`/`504` responses instead of failing.
|
|
80
|
+
- New `--check-raw-url` / `GH_UPLOAD_LOG_CHECK_RAW_URL` option verifies that the
|
|
81
|
+
reported raw URL is reachable, with a hint about private-repository token expiry.
|
|
82
|
+
- Verbose mode reports the content hash, stored file name and deduplication decision.
|
|
83
|
+
- `self-test` cleanup refuses to delete the shared `private-logs`/`public-logs`
|
|
84
|
+
repositories.
|
|
85
|
+
|
|
86
|
+
## 0.8.3
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- c6cc736: Accept every log file path form (bare relative, `./`, `../`, `~/`, absolute) by resolving paths to absolute before use, run git commands with command-stream's `cwd` option instead of a `cd` prefix that changed the process working directory, and initialize temporary repositories with `git -c init.defaultBranch=<branch> init -q` so the "Using 'master' as the name for the initial branch" hint and other command noise are no longer printed.
|
|
91
|
+
|
|
92
|
+
## 0.8.2
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- 5d82718: Use `.log.txt` names for uploaded log files so raw gist and repository links open as text in browsers.
|
|
97
|
+
|
|
98
|
+
## 0.8.1
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- 647ab73: Route repository fallbacks through shared log repositories by default.
|
|
103
|
+
|
|
104
|
+
## 0.8.0
|
|
105
|
+
|
|
106
|
+
### Minor Changes
|
|
107
|
+
|
|
108
|
+
- 4c94056: Default large repository uploads to the shared `private-logs` /
|
|
109
|
+
`public-logs` repositories, skip duplicate large-log uploads that already
|
|
110
|
+
exist there, and add CLI/library configuration to keep the legacy dedicated
|
|
111
|
+
repository flow when needed. Also update `lino-arguments` to `0.3.0`.
|
|
112
|
+
|
|
113
|
+
## 0.7.1
|
|
114
|
+
|
|
115
|
+
### Patch Changes
|
|
116
|
+
|
|
117
|
+
- 4c2044e: Handle repository-create exit failures correctly and retry with a unique
|
|
118
|
+
repository name when the generated name already exists.
|
|
119
|
+
|
|
120
|
+
## 0.7.0
|
|
121
|
+
|
|
122
|
+
### Minor Changes
|
|
123
|
+
|
|
124
|
+
- 940281d: Handle ENOSPC (no space left on device) errors gracefully with actionable error messages, disk cleanup suggestions, and smart fallback prevention. Gist uploads can work without extra disk space; the tool now suggests --only-gist when appropriate.
|
|
125
|
+
|
|
126
|
+
## 0.6.1
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- 524dc7e: Fail early with a clean error message when the specified file does not exist, avoiding unnecessary output like the upload status line before the error.
|
|
131
|
+
|
|
132
|
+
## 0.6.0
|
|
133
|
+
|
|
134
|
+
### Minor Changes
|
|
135
|
+
|
|
136
|
+
- 05f977a: Add direct raw file URL support for single-file uploads
|
|
137
|
+
|
|
138
|
+
When uploading a single log file (not split into chunks), the tool now displays a direct link to the raw file content in addition to the repository/gist URL.
|
|
139
|
+
|
|
140
|
+
For gists:
|
|
141
|
+
- Returns the permanent `raw_url` from the GitHub API
|
|
142
|
+
- This URL is accessible without authentication (even for secret gists)
|
|
143
|
+
|
|
144
|
+
For repositories:
|
|
145
|
+
- Returns the `download_url` from the GitHub API
|
|
146
|
+
- For private repositories, includes a token that enables unauthenticated access
|
|
147
|
+
- Displays a warning that the token expires in ~10 minutes for private repos
|
|
148
|
+
|
|
149
|
+
Example output:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
✅ Gist created (🔒 private)
|
|
153
|
+
🔗 https://gist.github.com/user/abc123
|
|
154
|
+
📄 https://gist.githubusercontent.com/user/abc123/raw/hash/file.log
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
This enhancement addresses issue #21 and makes it easier to share direct links to uploaded log files.
|
|
158
|
+
|
|
159
|
+
## 0.5.0
|
|
160
|
+
|
|
161
|
+
### Minor Changes
|
|
162
|
+
|
|
163
|
+
- 428588e: Fix gist upload failing with HTTP 502 for large files
|
|
164
|
+
- Lower gist threshold from 100MB to 25MB to match GitHub's web interface limit and avoid HTTP 502 errors
|
|
165
|
+
- Add validation to detect failed gist creation (empty URL in stdout)
|
|
166
|
+
- Add automatic fallback from gist to repository mode when gist upload fails
|
|
167
|
+
- Add --test and --quick CLI flags for self-testing upload functionality
|
|
168
|
+
- Add test file generator script for different file sizes
|
|
169
|
+
- Update unit tests for new behavior
|
|
170
|
+
|
|
171
|
+
## 0.4.1
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- 456226d: Add npm version badge to README.md for better package visibility
|
|
176
|
+
|
|
177
|
+
## 0.4.0
|
|
178
|
+
|
|
179
|
+
### Minor Changes
|
|
180
|
+
|
|
181
|
+
- 32150a1: Make output more user friendly with cleaner, shorter format and emojis
|
|
182
|
+
- Reduced duplicate information (file size, URL were shown multiple times)
|
|
183
|
+
- Added colorful emojis for visual clarity: ⏳ (uploading), ✅ (success), 🔍 (dry run), 🔒 (private), 🌐 (public), 🔗 (URL)
|
|
184
|
+
- Moved verbose details (strategy, mode, file name) to --verbose mode only
|
|
185
|
+
- Output is now short and minimalistic by default while preserving all important information (size, visibility, URL)
|
|
186
|
+
|
|
187
|
+
## 0.3.1
|
|
188
|
+
|
|
189
|
+
### Patch Changes
|
|
190
|
+
|
|
191
|
+
- 9719c35: fix: Gist URL capture and human-readable file size display
|
|
192
|
+
- Fix gist URL not being captured due to empty string interpolation in command-stream template literal
|
|
193
|
+
- Add formatFileSize() function for human-readable file sizes (e.g., "1.90 KB" instead of "0.00 MB")
|
|
194
|
+
- Improve CLI output with better formatting and file info display before upload
|
|
195
|
+
- Add comprehensive tests for formatFileSize function
|
|
196
|
+
|
|
197
|
+
## 0.3.0
|
|
198
|
+
|
|
199
|
+
### Minor Changes
|
|
200
|
+
|
|
201
|
+
- 2cc28d3: feat: Make repository Bun-only
|
|
202
|
+
- Updated README.md to use Bun instead of Node.js/npm/Deno
|
|
203
|
+
- Changed all shebangs from `#!/usr/bin/env node` to `#!/usr/bin/env bun`
|
|
204
|
+
- Updated package.json scripts to use Bun commands
|
|
205
|
+
- Updated CI workflows to only run Bun tests (3 OS matrix: Ubuntu, macOS, Windows)
|
|
206
|
+
- Removed deno.json configuration file
|
|
207
|
+
- Changed engine requirement from Node.js to Bun ≥1.0.0
|
|
208
|
+
|
|
209
|
+
## 0.2.0
|
|
210
|
+
|
|
211
|
+
### Minor Changes
|
|
212
|
+
|
|
213
|
+
- 76ccd16: Complete template feature alignment with manual release support and enhanced CI/CD
|
|
214
|
+
|
|
215
|
+
This release implements ALL missing features from the js-ai-driven-development-pipeline-template repository:
|
|
216
|
+
|
|
217
|
+
**Manual Release Support**:
|
|
218
|
+
- **Instant releases**: Trigger immediate version bumps and npm publishing via GitHub Actions UI
|
|
219
|
+
- **Changeset PR mode**: Create pull requests with changesets for review before release
|
|
220
|
+
- **workflow_dispatch trigger**: Supports patch, minor, and major version bumps with optional descriptions
|
|
221
|
+
|
|
222
|
+
**Enhanced CI/CD**:
|
|
223
|
+
- **PR-scoped validation**: Only validates changesets added by the current PR using git diff, preventing failures when other PRs merge first
|
|
224
|
+
- **Multiple changeset merging**: Automatically merges multiple changesets during release with highest bump type selection and chronological description preservation
|
|
225
|
+
- **Modular release scripts**: Migrated to modular architecture using lino-arguments, command-stream, and use-m
|
|
226
|
+
- **OIDC trusted publishing**: Secure npm publishing without stored tokens
|
|
227
|
+
|
|
228
|
+
**New Scripts**:
|
|
229
|
+
- `version-and-commit.mjs` - Unified version bumping and git commits
|
|
230
|
+
- `publish-to-npm.mjs` - OIDC-enabled npm publishing
|
|
231
|
+
- `create-github-release.mjs` - Automated GitHub release creation
|
|
232
|
+
- `format-github-release.mjs` - Release note formatting with PR detection
|
|
233
|
+
- `create-manual-changeset.mjs` - Manual changeset file generation
|
|
234
|
+
- `setup-npm.mjs` - npm OIDC setup for trusted publishing
|
|
235
|
+
- `instant-version-bump.mjs` - Fast-track version bumps without changesets
|
|
236
|
+
|
|
237
|
+
These improvements provide complete feature parity with the template repository and enable flexible release workflows.
|
|
238
|
+
|
|
239
|
+
## 0.1.1
|
|
240
|
+
|
|
241
|
+
### Patch Changes
|
|
242
|
+
|
|
243
|
+
- ffde303: **Bug Fix**: Fixed CLI showing "Arguments public and private are mutually exclusive" error on every invocation
|
|
244
|
+
|
|
245
|
+
**Root Cause**: The `--public` and `--private` options had default values which caused yargs' `.conflicts()` method to always trigger, preventing the CLI from working at all.
|
|
246
|
+
|
|
247
|
+
**Solution**: Removed default values from conflicting CLI options (`--public`/`--private` and `--only-gist`/`--only-repository`). Default behavior is now handled in application code.
|
|
248
|
+
|
|
249
|
+
**Impact**: This critical bug prevented the CLI from working at all when installed via npm or bun. Users can now use the tool as intended.
|
|
250
|
+
|
|
251
|
+
**Testing**: Added comprehensive integration tests to verify the fix and prevent regression.
|
|
252
|
+
|
|
253
|
+
Fixes #6
|
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
This is free and unencumbered software released into the public domain.
|
|
2
|
+
|
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
|
4
|
+
distribute this software, either in source code form or as a compiled
|
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
|
6
|
+
means.
|
|
7
|
+
|
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
|
9
|
+
of this software dedicate any and all copyright interest in the
|
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
|
11
|
+
of the public at large and to the detriment of our heirs and
|
|
12
|
+
successors. We intend this dedication to be an overt act of
|
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
|
14
|
+
software under copyright law.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
For more information, please refer to <https://unlicense.org>
|