Skip to content

Commit c4bfdb1

Browse files
committed
chore: update tooling requirements and parity checks
1 parent 0ff6c28 commit c4bfdb1

23 files changed

+408
-58
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ jobs:
196196
- uses: softprops/action-gh-release@v1
197197
with:
198198
draft: true
199+
- uses: actions/checkout@v4
199200
- uses: actions/setup-node@v4
200201
with:
201202
node-version: 22
202203
registry-url: https://registry.npmjs.org
203-
- uses: actions/download-artifact@v4
204-
with: { name: package }
205-
- run: npm install -g npm@^11.5.1
206-
- run: npm publish *.tgz --provenance
204+
- run: corepack yarn
205+
- run: corepack yarn changeset publish
206+
env:
207+
NPM_CONFIG_PROVENANCE: "true"

CONTRIBUTING.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ To check for updates, run:
2020
yarn upgrade-interactive
2121
```
2222

23+
## Tooling requirements
24+
25+
Local tooling (the TypeScript scripts in `scripts/` and package tests) requires Node 22.18+ so `node file.ts` works without flags. The published packages still support Node 20+ at runtime.
26+
2327
## Linting
2428

2529
This project is linted using Biome. You can lint the project by running:
@@ -89,7 +93,7 @@ yarn pack
8993

9094
## Releasing
9195

92-
Only maintainers can make releases. Releases to [npm](https://www.npmjs.com) are automated using GitHub actions. To make a release, perform the following steps:
96+
Only maintainers can make releases. Releases to [npm](https://www.npmjs.com) are automated using GitHub actions and Changesets (including the legacy `transloadit` package). To make a release, perform the following steps:
9397

9498
1. Create a changeset:
9599
- `yarn changeset`
@@ -101,5 +105,12 @@ Only maintainers can make releases. Releases to [npm](https://www.npmjs.com) are
101105
4. Publish (maintainers only; GitHub Actions handles the release):
102106
- `yarn changeset publish`
103107
5. When successful add [release notes](https://github.com/transloadit/node-sdk/releases).
104-
6. If this was a pre-release, remember to reset the [npm `latest` tag](https://www.npmjs.com/package/transloadit?activeTab=versions) to the previous version (replace `x.y.z` with previous version):
108+
6. Scoped packages publish with the `experimental` dist-tag by default. If you need to promote a scoped package to `latest`, update the tag manually.
109+
7. If this was a pre-release, remember to reset the [npm `latest` tag](https://www.npmjs.com/package/transloadit?activeTab=versions) to the previous version (replace `x.y.z` with previous version):
105110
- `npm dist-tag add [email protected] latest`
111+
112+
### Release FAQ
113+
114+
- **Lockstep versions:** Changesets use a fixed group, so version bumps and releases are always in lock‑step across `transloadit`, `@transloadit/node`, `@transloadit/types`, and `@transloadit/zod`.
115+
- **Legacy parity:** `transloadit` is generated from `@transloadit/node` artifacts via `scripts/prepare-transloadit.ts`, then verified with `yarn parity:transloadit`. Only `package.json` metadata drift is allowed; any other drift fails.
116+
- **Experimental packages:** Scoped packages (`@transloadit/node`, `@transloadit/types`, `@transloadit/zod`) publish with the `experimental` dist-tag. The unscoped `transloadit` package remains stable.

docs/fingerprint/transloadit-after.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"packageDir": "/home/kvz/code/node-sdk/packages/transloadit",
33
"tarball": {
44
"filename": "transloadit-4.1.2.tgz",
5-
"sizeBytes": 1110479,
6-
"sha256": "1f9d45a0d0055c488da28eac563ad79073cedfab16ccf7bd4e5ea9bb50cf655a"
5+
"sizeBytes": 1110470,
6+
"sha256": "61a25c361b18372e0e590cf3195c617ae88966e53b3217acc88e1680493cad9f"
77
},
88
"packageJson": {
99
"name": "transloadit",
@@ -13,7 +13,10 @@
1313
".": "./dist/Transloadit.js",
1414
"./package.json": "./package.json"
1515
},
16-
"files": ["dist", "src"]
16+
"files": [
17+
"dist",
18+
"src"
19+
]
1720
},
1821
"files": [
1922
{
@@ -613,8 +616,8 @@
613616
},
614617
{
615618
"path": "package.json",
616-
"sizeBytes": 2648,
617-
"sha256": "a2fd83a1adc245ade4d1a376c3d8c92ba286e73412afb89fa5d8ef31212f560d"
619+
"sizeBytes": 2601,
620+
"sha256": "18cd60ab2fb8dd2a146181d9b0965e40e42a4ee1ffa9100f812bff85bd88a185"
618621
},
619622
{
620623
"path": "dist/alphalib/types/robots/_index.d.ts.map",
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"name": "transloadit",
3+
"version": "4.1.2",
4+
"description": "Node.js SDK for Transloadit",
5+
"type": "module",
6+
"keywords": [
7+
"transloadit",
8+
"encoding",
9+
"transcoding",
10+
"video",
11+
"audio",
12+
"mp3"
13+
],
14+
"author": "Tim Koschuetzki <[email protected]>",
15+
"packageManager": "[email protected]",
16+
"engines": {
17+
"node": ">= 20"
18+
},
19+
"dependencies": {
20+
"@aws-sdk/client-s3": "^3.891.0",
21+
"@aws-sdk/s3-request-presigner": "^3.891.0",
22+
"@transloadit/sev-logger": "^0.0.15",
23+
"clipanion": "^4.0.0-rc.4",
24+
"debug": "^4.4.3",
25+
"dotenv": "^17.2.3",
26+
"form-data": "^4.0.4",
27+
"got": "14.4.9",
28+
"into-stream": "^9.0.0",
29+
"is-stream": "^4.0.1",
30+
"node-watch": "^0.7.4",
31+
"p-map": "^7.0.3",
32+
"p-queue": "^9.0.1",
33+
"recursive-readdir": "^2.2.3",
34+
"tus-js-client": "^4.3.1",
35+
"type-fest": "^4.41.0",
36+
"zod": "3.25.76"
37+
},
38+
"devDependencies": {
39+
"@biomejs/biome": "^2.2.4",
40+
"@types/debug": "^4.1.12",
41+
"@types/recursive-readdir": "^2.2.4",
42+
"@types/temp": "^0.9.4",
43+
"@vitest/coverage-v8": "^3.2.4",
44+
"badge-maker": "^5.0.2",
45+
"execa": "9.6.0",
46+
"image-size": "^2.0.2",
47+
"nock": "^14.0.10",
48+
"npm-run-all": "^4.1.5",
49+
"p-retry": "^7.0.0",
50+
"rimraf": "^6.1.2",
51+
"temp": "^0.9.4",
52+
"tsx": "4.20.5",
53+
"typescript": "5.9.2",
54+
"vitest": "^3.2.4"
55+
},
56+
"repository": {
57+
"type": "git",
58+
"url": "git://github.com/transloadit/node-sdk.git"
59+
},
60+
"directories": {
61+
"src": "./src"
62+
},
63+
"scripts": {
64+
"check": "yarn lint:ts && yarn fix && yarn test:unit",
65+
"fix:js": "biome check --write .",
66+
"lint:ts": "tsc --build",
67+
"fix:js:unsafe": "biome check --write . --unsafe",
68+
"lint:js": "biome check .",
69+
"lint": "npm-run-all --parallel 'lint:js'",
70+
"fix": "npm-run-all --serial 'fix:js'",
71+
"prepack": "rm -f tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && tsc --build tsconfig.build.json",
72+
"test:unit": "vitest run --coverage ./test/unit",
73+
"test:e2e": "vitest run ./test/e2e",
74+
"test": "vitest run --coverage"
75+
},
76+
"license": "MIT",
77+
"main": "./dist/Transloadit.js",
78+
"exports": {
79+
".": "./dist/Transloadit.js",
80+
"./package.json": "./package.json"
81+
},
82+
"files": [
83+
"dist",
84+
"src"
85+
],
86+
"bin": "./dist/cli.js"
87+
}

docs/monorepo-architecture.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ node-sdk/
3838
- Publishes the legacy package name.
3939
- Built from the same runtime artifacts as `@transloadit/node`.
4040
- Compatibility is verified via tarball fingerprinting.
41+
- Allowed drift is limited to `package.json` metadata and is reported explicitly.
4142

4243
### @transloadit/types
4344
- Pure type package; no Zod runtime dependency.
@@ -84,14 +85,25 @@ The `@transloadit/zod` `check` script runs `sync`, `tsc`, and runtime parity.
8485

8586
## Node & TypeScript execution
8687

87-
All internal scripts are TypeScript and run via Node 24’s erasable syntax support (no `--experimental-strip-types` in the zod package). Other packages may still use the flag where needed.
88+
All internal scripts are TypeScript and rely on Node’s built-in type stripping. Tooling expects Node 22.18+ (or newer) so scripts can run directly via `node script.ts` without flags.
8889

8990
## Publishing strategy
9091

9192
- `@transloadit/node` is canonical.
9293
- `transloadit` is generated from the same artifacts and fingerprinted.
9394
- `@transloadit/types` and `@transloadit/zod` are versioned in lock‑step (changesets).
9495

96+
### Parity verification
97+
98+
The `transloadit` tarball is compared against a recorded baseline:
99+
100+
- `scripts/fingerprint-pack.ts` creates a tarball fingerprint.
101+
- `scripts/verify-fingerprint.ts` compares fingerprints and reports drift.
102+
- `docs/fingerprint/transloadit-baseline.json` is the baseline fingerprint.
103+
- `docs/fingerprint/transloadit-baseline.package.json` is used to diff `package.json`.
104+
105+
Only `package.json` metadata drift is currently allowed; any other file difference fails the check.
106+
95107
## Future extensions
96108

97109
- Add JSON Schema export for v4 (`@transloadit/jsonschema` or subpath) once v4 tooling is stable.

docs/todo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
- [x] Hash the tarball SHA256
1616
- [x] Hash each file via `tar -tf` + `tar -xOf`
1717
- [x] Output JSON artifact for comparison
18-
- [x] Support `node --experimental-strip-types scripts/fingerprint-pack.ts .`
19-
- [x] Support `node --experimental-strip-types scripts/fingerprint-pack.ts packages/transloadit`
18+
- [x] Support `node scripts/fingerprint-pack.ts .`
19+
- [x] Support `node scripts/fingerprint-pack.ts packages/transloadit`
2020

2121
## Versioning and releases
2222
- [x] Add Changesets at workspace root

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"fix:js": "biome check --write .",
1616
"fix:js:unsafe": "biome check --write . --unsafe",
1717
"knip": "yarn workspace @transloadit/node knip",
18-
"pack": "node --experimental-strip-types scripts/pack-transloadit.ts",
18+
"pack": "node scripts/pack-transloadit.ts",
19+
"parity:transloadit": "node scripts/fingerprint-pack.ts packages/transloadit --ignore-scripts --out /tmp/transloadit-after.json && node scripts/verify-fingerprint.ts --current /tmp/transloadit-after.json --baseline docs/fingerprint/transloadit-baseline.json --allow package.json --baseline-package-json docs/fingerprint/transloadit-baseline.package.json --current-package-json packages/transloadit/package.json",
1920
"test:unit": "yarn workspace @transloadit/node test:unit && yarn workspace @transloadit/types test:unit && yarn workspace @transloadit/zod test:unit",
2021
"test:e2e": "yarn workspace @transloadit/node test:e2e",
2122
"test": "yarn workspace @transloadit/node test"

packages/node/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[![Build Status](https://github.com/transloadit/node-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/transloadit/node-sdk/actions/workflows/ci.yml)
22
[![Coverage](https://codecov.io/gh/transloadit/node-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/transloadit/node-sdk)
33

4+
> **Stability: Experimental.** This scoped package is new and may change without notice.
5+
> For the stable SDK, use the unscoped `transloadit` package.
6+
47
<a href="https://transloadit.com/?utm_source=github&utm_medium=referral&utm_campaign=sdks&utm_content=node_sdk">
58
<picture>
69
<source media="(prefers-color-scheme: dark)" srcset="https://assets.transloadit.com/assets/images/sponsorships/logo-dark.svg">

packages/node/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@transloadit/node",
3-
"version": "4.1.3",
3+
"version": "4.1.2",
44
"description": "Node.js SDK for Transloadit",
55
"type": "module",
66
"keywords": ["transloadit", "encoding", "transcoding", "video", "audio", "mp3"],
@@ -29,6 +29,9 @@
2929
"type-fest": "^4.41.0",
3030
"zod": "3.25.76"
3131
},
32+
"publishConfig": {
33+
"tag": "experimental"
34+
},
3235
"devDependencies": {
3336
"@biomejs/biome": "^2.3.11",
3437
"@types/debug": "^4.1.12",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export class InconsistentResponseError extends Error {
1+
export default class InconsistentResponseError extends Error {
22
override name = 'InconsistentResponseError'
33
}

0 commit comments

Comments
 (0)