Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8c4af32
first stab at merging in transloadify
kvz Dec 2, 2025
5295273
use cli subdir. more re-use of code
kvz Dec 2, 2025
bb64157
fix e2e
kvz Dec 2, 2025
690603a
apply stricter biome & tsconfig rules
kvz Dec 2, 2025
ebbbcb7
abort assemblies
kvz Dec 2, 2025
714ea73
Improve types, make replay clearer, roll test for it
kvz Dec 2, 2025
164354e
stronger types
kvz Dec 2, 2025
2fdc525
wip
kvz Dec 2, 2025
9023343
fix version
kvz Dec 2, 2025
dbcbaf4
format
kvz Dec 3, 2025
1fc64ca
run e2e for own PRs
kvz Dec 3, 2025
228afed
dotenv
kvz Dec 3, 2025
ba3823f
cli docs
kvz Dec 3, 2025
d28058f
add missing docs
kvz Dec 3, 2025
170aba2
merge CI
kvz Dec 3, 2025
4c14d93
add node 24
kvz Dec 3, 2025
946a8f6
e2e only on 24
kvz Dec 3, 2025
90cde44
test: use unique template names to avoid CI conflicts
kvz Dec 3, 2025
21b85f7
feat: honor abort signal during awaitAssemblyCompletion polling
kvz Dec 3, 2025
35e50cd
add browser
kvz Dec 3, 2025
da6f0b4
fix bug
kvz Dec 3, 2025
ce030e9
fix: address code review feedback
kvz Dec 3, 2025
44aa6e3
feat: replace --verbose/--quiet with --log-level (-l)
kvz Dec 3, 2025
0ca0f87
feat: allow numeric values for --log-level
kvz Dec 3, 2025
887ba60
feat: add trace log level (8)
kvz Dec 3, 2025
0f795cb
add onPoll
kvz Dec 3, 2025
8c5ee5d
fix
kvz Dec 3, 2025
ce86458
format
kvz Dec 3, 2025
b62dac6
fix: CLI exits with code 1 when jobs fail, fix AbortSignal listener leak
kvz Dec 3, 2025
f22b4a1
feat(cli): add --endpoint option and --single-assembly flag
kvz Dec 3, 2025
447f73f
docs: document --endpoint and --single-assembly CLI options
kvz Dec 3, 2025
85c06b9
fix: handle templates with no steps in sync download
kvz Dec 3, 2025
c364b3b
refactor: use tryCatch utility for cleaner error handling
kvz Dec 3, 2025
243852d
fix: remove non-functional notifications list, add download abort signal
kvz Dec 3, 2025
60273d6
refactor: use got.stream + pipeline for downloads
kvz Dec 3, 2025
d73f212
test: add e2e test verifying download integrity via md5 hash
kvz Dec 3, 2025
13b3547
fix: prevent file descriptor exhaustion with concurrency limiting
kvz Dec 4, 2025
20471f1
Merge origin/cli: use got.stream for downloads
kvz Dec 4, 2025
400719f
perf: split assemblies e2e tests for parallel execution
kvz Dec 4, 2025
7d50065
upgrade yarn, add p-queue
kvz Dec 4, 2025
523e289
upgrade yarn
kvz Dec 4, 2025
9b3fe42
use p-queue instead of JobPromise
kvz Dec 4, 2025
d921f30
natives
kvz Dec 4, 2025
4299b8d
no esnureDir
kvz Dec 4, 2025
9cceb6f
unify cli files
kvz Dec 4, 2025
6386b77
format
kvz Dec 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration tests
name: e2e tests

on:
workflow_dispatch:
Expand All @@ -12,7 +12,7 @@ jobs:
test:
runs-on: ubuntu-latest
strategy:
# Integration tests are not yet ready to run in parallel
# e2e tests are not yet ready to run in parallel
max-parallel: 1
matrix:
node:
Expand All @@ -33,7 +33,7 @@ jobs:
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- run: corepack yarn test:all
- run: corepack yarn test
env:
TRANSLOADIT_KEY: ${{ secrets.TRANSLOADIT_KEY }}
TRANSLOADIT_SECRET: ${{ secrets.TRANSLOADIT_SECRET }}
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ yarn test:unit

This will also generate a coverage report in the `coverage` directory.

### Integration tests
### e2e tests

Integration tests are in the [`test/integration`](test/integration) folder. They require some extra setup.
e2e tests are in the [`test/e2e`](test/e2e) folder. They require some extra setup.

Firstly, these tests require the Cloudflare executable. You can download this with:

Expand All @@ -63,10 +63,10 @@ chmod +x cloudflared-linux-amd64

They also require a Transloadit key and secret, which you can get from https://transloadit.com/c/credentials.

You can run the integration tests with:
You can run the e2e tests with:

```sh
TRANSLOADIT_KEY='YOUR_TRANSLOADIT_KEY' TRANSLOADIT_SECRET='YOUR_TRANSLOADIT_SECRET' CLOUDFLARED_PATH='./cloudflared-linux-amd64' yarn test:integration
TRANSLOADIT_KEY='YOUR_TRANSLOADIT_KEY' TRANSLOADIT_SECRET='YOUR_TRANSLOADIT_SECRET' CLOUDFLARED_PATH='./cloudflared-linux-amd64' yarn test:e2e
```

### Code Coverage
Expand Down
38 changes: 19 additions & 19 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Version 4 focuses on type-safety, clearer errors, and modern Node support. Most
```js
// CommonJS import example
async function getClient() {
const { Transloadit } = await import("transloadit");
const { Transloadit } = await import('transloadit')
return new Transloadit({
authKey: process.env.TRANSLOADIT_KEY ?? "",
authSecret: process.env.TRANSLOADIT_SECRET ?? "",
});
authKey: process.env.TRANSLOADIT_KEY ?? '',
authSecret: process.env.TRANSLOADIT_SECRET ?? '',
})
}
```

Expand All @@ -48,16 +48,16 @@ The package also exports `AssemblyInstructionsInput`, `AssemblyIndexItem`, `Asse
const params: AssemblyInstructionsInput = {
steps: {
resize: {
use: ":original",
robot: "/image/resize",
use: ':original',
robot: '/image/resize',
width: 320,
height: 240,
result: true,
},
},
};
}

await transloadit.createAssembly({ params, waitForCompletion: true });
await transloadit.createAssembly({ params, waitForCompletion: true })
```

## 3. Adjust API result handling
Expand All @@ -82,15 +82,15 @@ const createdAssembly = await transloadit.createAssembly(...);

```ts
try {
await transloadit.createAssembly({ params });
await transloadit.createAssembly({ params })
} catch (error) {
if (error instanceof ApiError && error.response.assembly_id) {
console.error(
"Troubleshoot at https://transloadit.com/c/assemblies/" +
'Troubleshoot at https://transloadit.com/c/assemblies/' +
error.response.assembly_id
);
)
}
throw error;
throw error
}
```

Expand All @@ -103,18 +103,18 @@ try {
authKey,
authSecret,
validateResponses: true,
});
})
```

- `getSignedSmartCDNUrl` generates Smart CDN URLs with signatures that match the server-side implementation:

```ts
const signedUrl = transloadit.getSignedSmartCDNUrl({
workspace: "my-team",
template: "hero-image",
input: "landing.jpg",
urlParams: { format: "webp" },
});
workspace: 'my-team',
template: 'hero-image',
input: 'landing.jpg',
urlParams: { format: 'webp' },
})
```

## 6. Removed `createAssembly` callback support
Expand All @@ -135,7 +135,7 @@ As a consequence of upgrading `got` to v14, the `gotRetry` option no longer acce

## Testing & troubleshooting

- Run your existing integration tests on Node 20+. If you relied on CommonJS `require`, convert those modules or wrap calls in `import()` shims as shown above.
- Run your existing e2e tests on Node 20+. If you relied on CommonJS `require`, convert those modules or wrap calls in `import()` shims as shown above.
- If TypeScript raises errors about unfamiliar properties, import the respective types from `transloadit` instead of redefining them.
- Schemas intentionally mirror the current public API. Some properties remain permissive while we tighten validation in the API itself; report gaps if the SDK raises or misses invalid data.

Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,33 @@
"@aws-sdk/client-s3": "^3.891.0",
"@aws-sdk/s3-request-presigner": "^3.891.0",
"@transloadit/sev-logger": "^0.0.15",
"clipanion": "^4.0.0-rc.4",
"debug": "^4.4.3",
"form-data": "^4.0.4",
"got": "14.4.9",
"into-stream": "^9.0.0",
"is-stream": "^4.0.1",
"node-watch": "^0.7.4",
"p-map": "^7.0.3",
"recursive-readdir": "^2.2.3",
"tus-js-client": "^4.3.1",
"type-fest": "^4.41.0",
"zod": "3.25.76"
},
"devDependencies": {
"@biomejs/biome": "^2.2.4",
"@types/debug": "^4.1.12",
"@types/recursive-readdir": "^2.2.4",
"@types/temp": "^0.9.4",
"@vitest/coverage-v8": "^3.2.4",
"badge-maker": "^5.0.2",
"dotenv": "^17.2.2",
"dotenv": "^17.2.3",
"execa": "9.6.0",
"image-size": "^2.0.2",
"nock": "^14.0.10",
"npm-run-all": "^4.1.5",
"p-retry": "^7.0.0",
"rimraf": "^6.1.2",
"temp": "^0.9.4",
"tsx": "4.20.5",
"typescript": "5.9.2",
Expand All @@ -61,12 +67,10 @@
"lint:js": "biome check .",
"lint": "npm-run-all --parallel 'lint:js'",
"fix": "npm-run-all --serial 'fix:js'",
"next:update": "next-update --keep true --tldr",
"prepack": "rm -f tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && tsc --build tsconfig.build.json",
"test:unit": "vitest run --coverage ./test/unit",
"test:integration": "vitest run ./test/integration",
"test:all": "vitest run --coverage",
"test": "yarn test:unit"
"test:e2e": "vitest run ./test/e2e",
"test": "vitest run --coverage"
},
"license": "MIT",
"main": "./dist/Transloadit.js",
Expand Down
Loading