-
Notifications
You must be signed in to change notification settings - Fork 27
Incorporate CLI that supports all transloadify commands
#268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use a unique testId (timestamp + random string) for all template names in e2e tests to prevent conflicts when tests run in parallel or when previous runs didn't clean up properly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Previously, the abort signal passed to createAssembly was only honored during the initial HTTP POST and TUS uploads. Now it's also honored during the polling loop in awaitAssemblyCompletion, allowing users to cancel long-running assembly operations at any point. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- JobsPromise now throws if error handler not set before adding promises - Added clarifying comment explaining orphaned promise pattern in createAssembly - WatchJobEmitter now properly cleans up file watchers on SIGINT/SIGTERM and errors - Expanded --verbose/--quiet documentation with output level table 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Use syslog-style severity levels inspired by @transloadit/sev-logger: - err (3): Error conditions - warn (4): Warning conditions - notice (5): Normal but significant (default) - info (6): Informational messages - debug (7): Debug-level messages Example: `npx transloadit assemblies list -l debug` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Now accepts both level names and numeric values: -l warn OR -l 4 -l debug OR -l 7 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Most verbose level for detailed tracing, matching sev-logger. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add hasFailures tracking to JobsPromise so CLI can detect failures - CLI assemblies create now returns exit code 1 when any job fails - Fix memory leak in awaitAssemblyCompletion: remove abort listener when sleep timeout resolves normally - Update CHANGELOG with better onPoll description 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add --endpoint option to all commands for custom API endpoint (also reads from TRANSLOADIT_ENDPOINT env var) - Add --single-assembly flag to assemblies create command Passes all input files to a single assembly instead of creating one assembly per file. Cannot be used with --watch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
When downloading a template that has no steps defined, `result.content.steps`
is undefined. JSON.stringify strips undefined values, so after writing and
reading the file back, the `steps` property would be missing.
Use nullish coalescing to default to empty object: `steps ?? {}`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replace try-catch blocks with tryCatch() in assemblies-create.ts for simple "stat file, use default on error" patterns. This reduces boilerplate and improves readability. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove assembly-notifications list command (Transloadit API doesn't have a list notifications endpoint, only replay) - Remove the stub implementation and test - Update README to remove the non-existent list command - Add AbortSignal to https.get downloads so they can be cancelled when errors occur or the process is aborted 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replace http/https.get with got.stream() and Node's pipeline(). This is cleaner, more consistent with the rest of the SDK (which uses got), and reduces callback nesting. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add test that verifies downloaded file md5 matches the md5hash from the assembly result - Return assembly status from job promises so tests can access result metadata like md5hash 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add --concurrency option and fix file handle leaks: 1. Default mode: Queue job metadata and process up to N at a time (default: 5). Creates fresh streams only when job slots available. 2. Single-assembly mode: Close streams immediately after collecting paths, create fresh streams only when uploading. Both fixes prevent EMFILE errors when processing many files. Tests verify: - "PROCESSING JOB" messages emitted with concurrency limiting - "STREAM CLOSED" messages emitted in single-assembly mode - Max concurrent jobs respects the concurrency limit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolved conflict in assemblies-create.ts by adopting the cleaner got.stream + pipeline approach for downloads while preserving the concurrency limiting and fresh stream creation from the local branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Split assemblies.test.ts into three files to leverage vitest's file-level parallelism: - assemblies.test.ts: get, delete, replay tests - assemblies-create.test.ts: create tests - assemblies-list.test.ts: list test (slowest at ~30s) This reduces e2e test wall time from ~73s to ~40s (~45% faster). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
We started to modernize Transloadify, but as that work was nearing completion, we decided the work should be merged into this repo. So that consuming devs can just
npm install transloadit, and use it on the command-line, as well as import and interface with it programatically. The two are very related, Transoadify was merely a wrapper around the Node SDK.Merging them gives developers an easier path to discovery, and for Transloadians will help spot duplicate code and cut atomic releases as we propel our JS client.
In the future, I could imagine this repo gets renamed and also becomes the single source of truth for browser based js clients (as well as official support for Deno, Bun, etc). But today, we're just folding the CLI into here.