Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions .changeset/fresh-deps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@transloadit/abbr': major
'@transloadit/analyze-step': major
'@transloadit/file-exists': major
'@transloadit/format-duration-ms': major
'@transloadit/has-property': major
'@transloadit/post': major
'@transloadit/pr': major
'@transloadit/prd': major
'@transloadit/prettier-bytes': major
'@transloadit/sev-logger': major
'@transloadit/slugify': major
'@transloadit/sort-assembly': major
'@transloadit/sort-object': major
'@transloadit/sort-object-by-prio': major
'@transloadit/sort-result': major
'@transloadit/sort-result-meta': major
'@transloadit/trigger-pager': major
---

Move monolib packages to ESM-only output and refresh dependencies.

This is a breaking change for CommonJS consumers: import these packages from ESM code or use dynamic import from CommonJS.
The supported Node.js floor is now 22, package exports are explicit, and TypeScript checks are stricter.
13 changes: 9 additions & 4 deletions .github/workflows/ci-monolib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ concurrency:

jobs:
test:
name: Test
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version:
- 22
- 24
permissions:
contents: read
pull-requests: read
Expand All @@ -27,17 +32,17 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
node-version: ${{ matrix.node-version }}

- name: 🏗 Setup Caching
uses: actions/cache@v4
with:
path: |
**/node_modules
.yarn/cache
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock', '**/package.json') }}
restore-keys: |
${{ runner.os }}-
${{ runner.os }}-node-${{ matrix.node-version }}-

- run: corepack yarn config set enableHardenedMode false
- run: corepack yarn install --immutable
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.14/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
"files": {
"includes": ["**", "!**/dist", "!**/node_modules", "!**/coverage", "!**/package.json"]
},
Expand Down
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,16 @@
"version": "changeset version",
"release": "changeset publish"
},
"dependencies": {
"execa": "5.1.1",
"inflection": "^3.0.2",
"inquirer": "^8.2.7"
},
"devDependencies": {
"@biomejs/biome": "^2.4.14",
"@biomejs/biome": "^2.4.15",
"@changesets/cli": "^2.31.0",
"@types/node": "^22.19.17",
"@types/node": "^25.9.1",
"npm-run-all": "^4.1.5",
"typescript": "^5.9.3"
"typescript": "^6.0.3"
},
"packageManager": "yarn@4.12.0",
"engines": {
"node": ">= 18",
"node": ">= 22",
"yarn": "4.2.1"
}
}
11 changes: 11 additions & 0 deletions packages/abbr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/abbr.d.ts",
"import": "./dist/abbr.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/abbr/src/abbr.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'

import { abbr } from './abbr'
import { abbr } from './abbr.ts'

describe('abbr', () => {
test('main', async () => {
Expand Down
11 changes: 11 additions & 0 deletions packages/analyze-step/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/analyzeStep.d.ts",
"import": "./dist/analyzeStep.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/analyze-step/src/analyzeStep.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'
import { analyzeStep } from './analyzeStep'
import { analyzeStep } from './analyzeStep.ts'

const ROBOTS = {
'/image/resize': {
Expand Down
14 changes: 7 additions & 7 deletions packages/analyze-step/src/analyzeStep.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { formatDurationMs } from '@transloadit/format-duration-ms'
import { prettierBytes } from '@transloadit/prettier-bytes'

import inflect = require('inflection')
import JSONPath = require('jsonpath-plus')
import clone = require('lodash/clone')
import countBy = require('lodash/countBy')
import get = require('lodash/get')
import has = require('lodash/has')
import inflect from 'inflection'
import { JSONPath } from 'jsonpath-plus'
import clone from 'lodash/clone.js'
import countBy from 'lodash/countBy.js'
import get from 'lodash/get.js'
import has from 'lodash/has.js'

function humanJoin(array: string[], reduce = true, glueword = 'and'): string {
let countedArray = array
Expand Down Expand Up @@ -405,7 +405,7 @@ export function analyzeStep(step: Step, robots: Robots, extrameta: ExtraMeta = {
}

if (robot?.rname === '/video/merge') {
const types = JSONPath.JSONPath({ path: '$..as', json: step })
const types = JSONPath({ path: '$..as', json: step })
if (types.length) {
str = `Merge ${humanJoin(types)} to create a new video`
} else if (get(step, 'ffmpeg.f') === 'gif') {
Expand Down
11 changes: 11 additions & 0 deletions packages/file-exists/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/fileExists.d.ts",
"import": "./dist/fileExists.js"
},
"./package.json": "./package.json"
}
}
6 changes: 3 additions & 3 deletions packages/file-exists/src/fileExists.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'
import { fileExists } from './fileExists'
import { fileExists } from './fileExists.ts'

describe('fileExists', () => {
test('main', async () => {
assert.strictEqual(await fileExists(`${__filename}`), true)
assert.strictEqual(await fileExists(`${__filename}-nonexistant`), false)
assert.strictEqual(await fileExists(import.meta.filename), true)
assert.strictEqual(await fileExists(`${import.meta.filename}-nonexistant`), false)
})
})
13 changes: 12 additions & 1 deletion packages/format-duration-ms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,20 @@
"test:watch": "node --test --enable-source-maps --watch"
},
"dependencies": {
"pretty-ms": "6.0.1"
"pretty-ms": "^9.3.0"
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/formatDurationMs.d.ts",
"import": "./dist/formatDurationMs.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/format-duration-ms/src/formatDurationMs.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'
import { formatDurationMs } from './formatDurationMs'
import { formatDurationMs } from './formatDurationMs.ts'

describe('formatDurationMs', () => {
test('main', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/format-duration-ms/src/formatDurationMs.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prettyMS = require('pretty-ms')
import prettyMS from 'pretty-ms'

export function formatDurationMs(ms: number): string {
let human = prettyMS(ms)
Expand Down
11 changes: 11 additions & 0 deletions packages/has-property/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/has-property.d.ts",
"import": "./dist/has-property.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/has-property/src/has-property.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { test } from 'node:test'
import { hasProperty } from './has-property'
import { hasProperty } from './has-property.ts'

test('hasProperty', () => {
assert.ok(hasProperty({ foo: 'bar' }, 'foo'))
Expand Down
10 changes: 8 additions & 2 deletions packages/post/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,21 @@
"dependencies": {
"@transloadit/file-exists": "^1.0.0",
"@transloadit/slugify": "^1.0.0",
"inquirer": "^8.2.7",
"inquirer": "^14.0.0",
"open-in-editor": "^2.2.0",
"title": "^4.0.1"
},
"devDependencies": {
"@types/inquirer": "^8.2.12",
"@types/open-in-editor": "^2.2.0"
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
"./package.json": "./package.json"
}
}
10 changes: 4 additions & 6 deletions packages/post/src/post.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#!/usr/bin/env node
import fs = require('node:fs/promises')
import inquirer = require('inquirer')

import openInEditor = require('open-in-editor')

import fs from 'node:fs/promises'
import { fileExists } from '@transloadit/file-exists'
import { slugify } from '@transloadit/slugify'
import openInEditor from 'open-in-editor'

import title from 'title'

Expand All @@ -23,7 +20,8 @@ async function post(): Promise<void> {
const mysqlNow = mysqlDate[0] ? (mysqlDate[0].split(' ')[0] ?? '') : ''

const [dateY, datem] = mysqlNow.split('-')
const answers = await inquirer.prompt([
const { default: inquirer } = await import('inquirer')
const answers = await inquirer.prompt<{ title: string; author: string }>([
{ type: 'input', name: 'title', message: 'title:' },
{ type: 'input', name: 'author', message: 'author:', default: process.env.USER },
])
Expand Down
11 changes: 11 additions & 0 deletions packages/pr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/pr.d.ts",
"import": "./dist/pr.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/pr/src/pr.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { describe, test } from 'node:test'
import { pr } from './pr'
import { pr } from './pr.ts'

describe('pr', () => {
test('main', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/pr/src/pr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import util = require('node:util')
import util from 'node:util'

export function pr<T>(...args: T[]): T[] {
for (const arg of args) {
Expand Down
11 changes: 11 additions & 0 deletions packages/prd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/prd.d.ts",
"import": "./dist/prd.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/prd/src/prd.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { describe, mock, test } from 'node:test'
import { prd } from './prd'
import { prd } from './prd.ts'

describe('prd', () => {
test('main', async () => {
Expand Down
11 changes: 11 additions & 0 deletions packages/prettier-bytes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,16 @@
},
"publishConfig": {
"access": "public"
},
"type": "module",
"engines": {
"node": ">=22"
},
"exports": {
".": {
"types": "./dist/prettierBytes.d.ts",
"import": "./dist/prettierBytes.js"
},
"./package.json": "./package.json"
}
}
2 changes: 1 addition & 1 deletion packages/prettier-bytes/src/prettierBytes.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'node:assert'
import { describe, it } from 'node:test'
import { prettierBytes } from './prettierBytes'
import { prettierBytes } from './prettierBytes.ts'

const testData: [number, string, string, string, string][] = [
[2, '2 B', '2 B', '0.0 MB', '0.00 TB'],
Expand Down
Loading
Loading