diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85790477..abfc2954 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,17 @@ jobs: - run: corepack yarn - run: corepack yarn lint:js + knip: + name: Knip + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: corepack yarn + - run: corepack yarn knip + typescript: name: Lint (TypeScript) runs-on: ubuntu-latest diff --git a/knip.ts b/knip.ts new file mode 100644 index 00000000..63cecad6 --- /dev/null +++ b/knip.ts @@ -0,0 +1,42 @@ +import type { KnipConfig } from 'knip' + +// Note: `yarn check` runs knip with --fix --allow-remove-files. This is safe because +// lint:ts and tests run immediately after - they'll fail if knip removes something needed. +const config: KnipConfig = { + entry: ['src/Transloadit.ts', 'src/cli.ts', 'test/**/*.{ts,tsx,js,jsx}', 'vitest.config.ts'], + project: ['{src,test}/**/*.{ts,tsx,js,jsx}'], + ignore: [ + 'dist/**', + 'coverage/**', + 'static-build/**', + 'node_modules/**', + // alphalib is a shared utility library. Exclude it so knip does not remove + // files that may only be used in other repos. + 'src/alphalib/**', + ], + ignoreDependencies: [ + // Used in src/alphalib/** which is excluded from knip + '@aws-sdk/client-s3', + '@aws-sdk/s3-request-presigner', + '@transloadit/sev-logger', + 'type-fest', + 'zod', + // Repo-specific ignores + '@types/minimist', + 'minimatch', + 'tsx', + ], + ignoreExportsUsedInFile: { + type: true, + interface: true, + }, + rules: { + exports: 'warn', + types: 'warn', + nsExports: 'warn', + nsTypes: 'warn', + duplicates: 'warn', + }, +} + +export default config diff --git a/package.json b/package.json index 847562eb..5aed4e0c 100644 --- a/package.json +++ b/package.json @@ -32,18 +32,22 @@ "p-queue": "^9.0.1", "recursive-readdir": "^2.2.3", "tus-js-client": "^4.3.1", + "typanion": "^3.14.0", "type-fest": "^4.41.0", "zod": "3.25.76" }, "devDependencies": { "@biomejs/biome": "^2.2.4", "@types/debug": "^4.1.12", + "@types/minimist": "^1.2.5", + "@types/node": "^24.10.3", "@types/recursive-readdir": "^2.2.4", "@types/temp": "^0.9.4", "@vitest/coverage-v8": "^3.2.4", "badge-maker": "^5.0.2", "execa": "9.6.0", "image-size": "^2.0.2", + "knip": "^5.73.3", "minimatch": "^10.1.1", "nock": "^14.0.10", "npm-run-all": "^4.1.5", @@ -62,13 +66,16 @@ "src": "./src" }, "scripts": { - "check": "yarn lint:ts && yarn fix && yarn test:unit", + "check": "yarn knip --fix --allow-remove-files --no-config-hints && yarn lint:ts && yarn fix && yarn test:unit", "fix:js": "biome check --write .", "lint:ts": "tsc --build", "fix:js:unsafe": "biome check --write . --unsafe", "lint:js": "biome check .", "lint": "npm-run-all --parallel 'lint:js'", "fix": "npm-run-all --serial 'fix:js'", + "lint:deps": "knip --dependencies --no-progress", + "fix:deps": "knip --dependencies --no-progress --fix", + "knip": "knip --no-config-hints --no-progress", "prepack": "rm -f tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && tsc --build tsconfig.build.json", "test:unit": "vitest run --coverage ./test/unit", "test:e2e": "vitest run ./test/e2e", diff --git a/src/cli/OutputCtl.ts b/src/cli/OutputCtl.ts index 144e4a4c..be6fc9a2 100644 --- a/src/cli/OutputCtl.ts +++ b/src/cli/OutputCtl.ts @@ -2,7 +2,7 @@ * Log levels following syslog severity (https://en.wikipedia.org/wiki/Syslog#Severity_level) * Lower numbers = more severe, higher numbers = more verbose */ -export const LOG_LEVEL = { +const LOG_LEVEL = { ERR: 3, // Error conditions WARN: 4, // Warning conditions NOTICE: 5, // Normal but significant (default) diff --git a/src/cli/commands/BaseCommand.ts b/src/cli/commands/BaseCommand.ts index 9532a064..e652ec25 100644 --- a/src/cli/commands/BaseCommand.ts +++ b/src/cli/commands/BaseCommand.ts @@ -6,7 +6,7 @@ import { getEnvCredentials } from '../helpers.ts' import type { IOutputCtl } from '../OutputCtl.ts' import OutputCtl, { LOG_LEVEL_DEFAULT, LOG_LEVEL_NAMES, parseLogLevel } from '../OutputCtl.ts' -export abstract class BaseCommand extends Command { +abstract class BaseCommand extends Command { logLevelOption = Option.String('-l,--log-level', { description: `Log level: ${LOG_LEVEL_NAMES.join(', ')} or 3-8 (default: notice)`, }) diff --git a/src/cli/commands/assemblies.ts b/src/cli/commands/assemblies.ts index bab5bbc2..d29ff660 100644 --- a/src/cli/commands/assemblies.ts +++ b/src/cli/commands/assemblies.ts @@ -36,7 +36,7 @@ export interface AssemblyGetOptions { assemblies: string[] } -export interface AssemblyDeleteOptions { +interface AssemblyDeleteOptions { assemblies: string[] } diff --git a/src/cli/commands/notifications.ts b/src/cli/commands/notifications.ts index e31b4edc..e65ba452 100644 --- a/src/cli/commands/notifications.ts +++ b/src/cli/commands/notifications.ts @@ -7,12 +7,12 @@ import { AuthenticatedCommand } from './BaseCommand.ts' // --- Types and business logic --- -export interface NotificationsReplayOptions { +interface NotificationsReplayOptions { notify_url?: string assemblies: string[] } -export async function replay( +async function replay( output: IOutputCtl, client: Transloadit, { notify_url, assemblies }: NotificationsReplayOptions, diff --git a/src/cli/commands/templates.ts b/src/cli/commands/templates.ts index f0649687..03405d54 100644 --- a/src/cli/commands/templates.ts +++ b/src/cli/commands/templates.ts @@ -33,11 +33,11 @@ export interface TemplateModifyOptions { file: string } -export interface TemplateDeleteOptions { +interface TemplateDeleteOptions { templates: string[] } -export interface TemplateListOptions { +interface TemplateListOptions { before?: string after?: string order?: 'asc' | 'desc' @@ -162,7 +162,7 @@ const TemplateIdSchema = z.object({ id: z.string(), }) -export function list( +function list( output: IOutputCtl, client: Transloadit, { before, after, order, sort, fields }: TemplateListOptions, diff --git a/src/cli/helpers.ts b/src/cli/helpers.ts index e84cd186..a2029faa 100644 --- a/src/cli/helpers.ts +++ b/src/cli/helpers.ts @@ -1,6 +1,5 @@ import fs from 'node:fs' import type { Readable } from 'node:stream' -import type { APIError } from './types.ts' import { isAPIError } from './types.ts' export function getEnvCredentials(): { authKey: string; authSecret: string } | null { @@ -35,8 +34,9 @@ export function formatAPIError(err: unknown): string { return String(err) } -// Re-export APIError type for convenience -export type { APIError } +// Re-export APIError type for CLI consumers relying on deep imports. +/** @public */ +export type { APIError } from './types.ts' export function zip(listA: A[], listB: B[]): [A, B][] export function zip(...lists: T[][]): T[][] diff --git a/src/cli/types.ts b/src/cli/types.ts index 99c3821a..b0a59177 100644 --- a/src/cli/types.ts +++ b/src/cli/types.ts @@ -1,23 +1,15 @@ import { z } from 'zod' import type { Steps } from '../alphalib/types/template.ts' import { optionalStepsSchema } from '../alphalib/types/template.ts' -import type { BillResponse, ListedTemplate, TemplateResponse } from '../apiTypes.ts' -import type { AssemblyStatus, Transloadit } from '../Transloadit.ts' -import type { IOutputCtl } from './OutputCtl.ts' - -// Re-export transloadit types for CLI use -export type { AssemblyStatus, BillResponse, ListedTemplate, TemplateResponse } -export type { Transloadit } -export type { CreateAssemblyOptions } from '../Transloadit.ts' // Zod schemas for runtime validation -export const APIErrorSchema = z.object({ +const APIErrorSchema = z.object({ error: z.string(), message: z.string(), }) export type APIError = z.infer -export const TransloaditAPIErrorSchema = z.object({ +const TransloaditAPIErrorSchema = z.object({ error: z.string().optional(), message: z.string(), code: z.string().optional(), @@ -54,98 +46,6 @@ export interface TemplateFile { data: TemplateFileData } -// Template list item (from API) -export interface TemplateListItem { - id: string - modified: string - name?: string -} - -// CLI Invocation types -export interface BaseInvocation { - error?: boolean - message?: string - mode: string - action?: string - logLevel?: number - jsonMode?: boolean -} - -export interface AssemblyInvocation extends BaseInvocation { - mode: 'assemblies' - action?: 'create' | 'get' | 'list' | 'delete' | 'replay' - inputs: string[] - output?: string - recursive?: boolean - watch?: boolean - del?: boolean - reprocessStale?: boolean - steps?: string - template?: string - fields?: Record - assemblies?: string[] - before?: string - after?: string - keywords?: string[] - notify_url?: string - reparse?: boolean -} - -export interface TemplateInvocation extends BaseInvocation { - mode: 'templates' - action?: 'create' | 'get' | 'list' | 'delete' | 'modify' | 'sync' - templates?: string[] - template?: string - name?: string - file?: string - files?: string[] - before?: string - after?: string - order?: 'asc' | 'desc' - sort?: string - fields?: string[] - recursive?: boolean -} - -export interface BillInvocation extends BaseInvocation { - mode: 'bills' - action?: 'get' - months: string[] -} - -export interface NotificationInvocation extends BaseInvocation { - mode: 'assembly-notifications' - action?: 'list' | 'replay' - assemblies?: string[] - notify_url?: string - type?: string - assembly_id?: string - pagesize?: number -} - -export interface HelpInvocation extends BaseInvocation { - mode: 'help' | 'version' | 'register' -} - -export type Invocation = - | AssemblyInvocation - | TemplateInvocation - | BillInvocation - | NotificationInvocation - | HelpInvocation - -// Command handler type -export type CommandHandler = ( - output: IOutputCtl, - client: Transloadit | undefined, - invocation: T, -) => void | Promise - -// Type guard for Error -export function isError(value: unknown): value is Error { - return value instanceof Error -} - // Helper to ensure error is Error type export function ensureError(value: unknown): Error { if (value instanceof Error) { @@ -168,16 +68,3 @@ export function isTransloaditAPIError(value: unknown): value is TransloaditAPIEr export function isErrnoException(value: unknown): value is NodeJS.ErrnoException { return value instanceof Error && 'code' in value } - -// Safe array access helper -export function safeGet(arr: T[], index: number): T | undefined { - return arr[index] -} - -// Assert defined helper -export function assertDefined(value: T | undefined | null, message: string): T { - if (value === undefined || value === null) { - throw new Error(message) - } - return value -} diff --git a/yarn.lock b/yarn.lock index b400b8b8..1bec426a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -830,6 +830,34 @@ __metadata: languageName: node linkType: hard +"@emnapi/core@npm:^1.7.1": + version: 1.7.1 + resolution: "@emnapi/core@npm:1.7.1" + dependencies: + "@emnapi/wasi-threads": "npm:1.1.0" + tslib: "npm:^2.4.0" + checksum: 10c0/f3740be23440b439333e3ae3832163f60c96c4e35337f3220ceba88f36ee89a57a871d27c94eb7a9ff98a09911ed9a2089e477ab549f4d30029f8b907f84a351 + languageName: node + linkType: hard + +"@emnapi/runtime@npm:^1.7.1": + version: 1.7.1 + resolution: "@emnapi/runtime@npm:1.7.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/26b851cd3e93877d8732a985a2ebf5152325bbacc6204ef5336a47359dedcc23faeb08cdfcb8bb389b5401b3e894b882bc1a1e55b4b7c1ed1e67c991a760ddd5 + languageName: node + linkType: hard + +"@emnapi/wasi-threads@npm:1.1.0": + version: 1.1.0 + resolution: "@emnapi/wasi-threads@npm:1.1.0" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/e6d54bf2b1e64cdd83d2916411e44e579b6ae35d5def0dea61a3c452d9921373044dff32a8b8473ae60c80692bdc39323e98b96a3f3d87ba6886b24dd0ef7ca1 + languageName: node + linkType: hard + "@esbuild/aix-ppc64@npm:0.25.6": version: 0.25.6 resolution: "@esbuild/aix-ppc64@npm:0.25.6" @@ -1296,6 +1324,44 @@ __metadata: languageName: node linkType: hard +"@napi-rs/wasm-runtime@npm:^1.1.0": + version: 1.1.0 + resolution: "@napi-rs/wasm-runtime@npm:1.1.0" + dependencies: + "@emnapi/core": "npm:^1.7.1" + "@emnapi/runtime": "npm:^1.7.1" + "@tybys/wasm-util": "npm:^0.10.1" + checksum: 10c0/ee351052123bfc635c4cef03ac273a686522394ccd513b1e5b7b3823cecd6abb4a31f23a3a962933192b87eb7b7c3eb3def7748bd410edc66f932d90cf44e9ab + languageName: node + linkType: hard + +"@nodelib/fs.scandir@npm:2.1.5": + version: 2.1.5 + resolution: "@nodelib/fs.scandir@npm:2.1.5" + dependencies: + "@nodelib/fs.stat": "npm:2.0.5" + run-parallel: "npm:^1.1.9" + checksum: 10c0/732c3b6d1b1e967440e65f284bd06e5821fedf10a1bea9ed2bb75956ea1f30e08c44d3def9d6a230666574edbaf136f8cfd319c14fd1f87c66e6a44449afb2eb + languageName: node + linkType: hard + +"@nodelib/fs.stat@npm:2.0.5, @nodelib/fs.stat@npm:^2.0.2": + version: 2.0.5 + resolution: "@nodelib/fs.stat@npm:2.0.5" + checksum: 10c0/88dafe5e3e29a388b07264680dc996c17f4bda48d163a9d4f5c1112979f0ce8ec72aa7116122c350b4e7976bc5566dc3ddb579be1ceaacc727872eb4ed93926d + languageName: node + linkType: hard + +"@nodelib/fs.walk@npm:^1.2.3": + version: 1.2.8 + resolution: "@nodelib/fs.walk@npm:1.2.8" + dependencies: + "@nodelib/fs.scandir": "npm:2.1.5" + fastq: "npm:^1.6.0" + checksum: 10c0/db9de047c3bb9b51f9335a7bb46f4fcfb6829fb628318c12115fbaf7d369bfce71c15b103d1fc3b464812d936220ee9bc1c8f762d032c9f6be9acc99249095b1 + languageName: node + linkType: hard + "@npmcli/agent@npm:^3.0.0": version: 3.0.0 resolution: "@npmcli/agent@npm:3.0.0" @@ -1342,6 +1408,148 @@ __metadata: languageName: node linkType: hard +"@oxc-resolver/binding-android-arm-eabi@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-android-arm-eabi@npm:11.16.2" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-android-arm64@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-android-arm64@npm:11.16.2" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-darwin-arm64@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-darwin-arm64@npm:11.16.2" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-darwin-x64@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-darwin-x64@npm:11.16.2" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-freebsd-x64@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-freebsd-x64@npm:11.16.2" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-arm-gnueabihf@npm:11.16.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm-musleabihf@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-arm-musleabihf@npm:11.16.2" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-gnu@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-arm64-gnu@npm:11.16.2" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-arm64-musl@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-arm64-musl@npm:11.16.2" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-ppc64-gnu@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-ppc64-gnu@npm:11.16.2" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-riscv64-gnu@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-riscv64-gnu@npm:11.16.2" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-riscv64-musl@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-riscv64-musl@npm:11.16.2" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-s390x-gnu@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-s390x-gnu@npm:11.16.2" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-gnu@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-x64-gnu@npm:11.16.2" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxc-resolver/binding-linux-x64-musl@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-linux-x64-musl@npm:11.16.2" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxc-resolver/binding-openharmony-arm64@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-openharmony-arm64@npm:11.16.2" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-wasm32-wasi@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-wasm32-wasi@npm:11.16.2" + dependencies: + "@napi-rs/wasm-runtime": "npm:^1.1.0" + conditions: cpu=wasm32 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-arm64-msvc@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-win32-arm64-msvc@npm:11.16.2" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-ia32-msvc@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-win32-ia32-msvc@npm:11.16.2" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxc-resolver/binding-win32-x64-msvc@npm:11.16.2": + version: 11.16.2 + resolution: "@oxc-resolver/binding-win32-x64-msvc@npm:11.16.2" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -2134,6 +2342,15 @@ __metadata: languageName: node linkType: hard +"@tybys/wasm-util@npm:^0.10.1": + version: 0.10.1 + resolution: "@tybys/wasm-util@npm:0.10.1" + dependencies: + tslib: "npm:^2.4.0" + checksum: 10c0/b255094f293794c6d2289300c5fbcafbb5532a3aed3a5ffd2f8dc1828e639b88d75f6a376dd8f94347a44813fd7a7149d8463477a9a49525c8b2dcaa38c2d1e8 + languageName: node + linkType: hard + "@types/chai@npm:^5.2.2": version: 5.2.2 resolution: "@types/chai@npm:5.2.2" @@ -2173,6 +2390,13 @@ __metadata: languageName: node linkType: hard +"@types/minimist@npm:^1.2.5": + version: 1.2.5 + resolution: "@types/minimist@npm:1.2.5" + checksum: 10c0/3f791258d8e99a1d7d0ca2bda1ca6ea5a94e5e7b8fc6cde84dd79b0552da6fb68ade750f0e17718f6587783c24254bbca0357648dd59dc3812c150305cabdc46 + languageName: node + linkType: hard + "@types/ms@npm:*": version: 2.1.0 resolution: "@types/ms@npm:2.1.0" @@ -2189,6 +2413,15 @@ __metadata: languageName: node linkType: hard +"@types/node@npm:^24.10.3": + version: 24.10.4 + resolution: "@types/node@npm:24.10.4" + dependencies: + undici-types: "npm:~7.16.0" + checksum: 10c0/069639cb7233ee747df1897b5e784f6b6c5da765c96c94773c580aac888fa1a585048d2a6e95eb8302d89c7a9df75801c8b5a0b7d0221d4249059cf09a5f4228 + languageName: node + linkType: hard + "@types/recursive-readdir@npm:^2.2.4": version: 2.2.4 resolution: "@types/recursive-readdir@npm:2.2.4" @@ -2386,6 +2619,13 @@ __metadata: languageName: node linkType: hard +"argparse@npm:^2.0.1": + version: 2.0.1 + resolution: "argparse@npm:2.0.1" + checksum: 10c0/c5640c2d89045371c7cedd6a70212a04e360fd34d6edeae32f6952c63949e3525ea77dbec0289d8213a99bbaeab5abfa860b5c12cf88a2e6cf8106e90dd27a7e + languageName: node + linkType: hard + "array-buffer-byte-length@npm:^1.0.1, array-buffer-byte-length@npm:^1.0.2": version: 1.0.2 resolution: "array-buffer-byte-length@npm:1.0.2" @@ -2504,6 +2744,15 @@ __metadata: languageName: node linkType: hard +"braces@npm:^3.0.3": + version: 3.0.3 + resolution: "braces@npm:3.0.3" + dependencies: + fill-range: "npm:^7.1.1" + checksum: 10c0/7c6dfd30c338d2997ba77500539227b9d1f85e388a5f43220865201e407e076783d0881f2d297b9f80951b4c957fcf0b51c1d2d24227631643c3f7c284b0aa04 + languageName: node + linkType: hard + "buffer-from@npm:^1.1.2": version: 1.1.2 resolution: "buffer-from@npm:1.1.2" @@ -3279,6 +3528,19 @@ __metadata: languageName: node linkType: hard +"fast-glob@npm:^3.3.3": + version: 3.3.3 + resolution: "fast-glob@npm:3.3.3" + dependencies: + "@nodelib/fs.stat": "npm:^2.0.2" + "@nodelib/fs.walk": "npm:^1.2.3" + glob-parent: "npm:^5.1.2" + merge2: "npm:^1.3.0" + micromatch: "npm:^4.0.8" + checksum: 10c0/f6aaa141d0d3384cf73cbcdfc52f475ed293f6d5b65bfc5def368b09163a9f7e5ec2b3014d80f733c405f58e470ee0cc451c2937685045cddcdeaa24199c43fe + languageName: node + linkType: hard + "fast-xml-parser@npm:5.2.5": version: 5.2.5 resolution: "fast-xml-parser@npm:5.2.5" @@ -3290,6 +3552,24 @@ __metadata: languageName: node linkType: hard +"fastq@npm:^1.6.0": + version: 1.20.1 + resolution: "fastq@npm:1.20.1" + dependencies: + reusify: "npm:^1.0.4" + checksum: 10c0/e5dd725884decb1f11e5c822221d76136f239d0236f176fab80b7b8f9e7619ae57e6b4e5b73defc21e6b9ef99437ee7b545cff8e6c2c337819633712fa9d352e + languageName: node + linkType: hard + +"fd-package-json@npm:^2.0.0": + version: 2.0.0 + resolution: "fd-package-json@npm:2.0.0" + dependencies: + walk-up-path: "npm:^4.0.0" + checksum: 10c0/a0a48745257bc09c939486608dad9f2ced238f0c64266222cc881618ed4c8f6aa0ccfe45a1e6d4f9ce828509e8d617cec60e2a114851bebb1ff4886dc5ed5112 + languageName: node + linkType: hard + "fdir@npm:^6.5.0": version: 6.5.0 resolution: "fdir@npm:6.5.0" @@ -3311,6 +3591,15 @@ __metadata: languageName: node linkType: hard +"fill-range@npm:^7.1.1": + version: 7.1.1 + resolution: "fill-range@npm:7.1.1" + dependencies: + to-regex-range: "npm:^5.0.1" + checksum: 10c0/b75b691bbe065472f38824f694c2f7449d7f5004aa950426a2c28f0306c60db9b880c0b0e4ed819997ffb882d1da02cfcfc819bddc94d71627f5269682edf018 + languageName: node + linkType: hard + "for-each@npm:^0.3.3, for-each@npm:^0.3.5": version: 0.3.5 resolution: "for-each@npm:0.3.5" @@ -3350,6 +3639,17 @@ __metadata: languageName: node linkType: hard +"formatly@npm:^0.3.0": + version: 0.3.0 + resolution: "formatly@npm:0.3.0" + dependencies: + fd-package-json: "npm:^2.0.0" + bin: + formatly: bin/index.mjs + checksum: 10c0/ef9dbd3cdaee649e9604ea060d8d62d8131eb81117634336592ee2193fc7c98a3f1f1b5d09a045dbd36287ba88edf868ef179d39fbda2f34fbe2be70c42dd014 + languageName: node + linkType: hard + "fs-minipass@npm:^3.0.0": version: 3.0.3 resolution: "fs-minipass@npm:3.0.3" @@ -3471,6 +3771,15 @@ __metadata: languageName: node linkType: hard +"glob-parent@npm:^5.1.2": + version: 5.1.2 + resolution: "glob-parent@npm:5.1.2" + dependencies: + is-glob: "npm:^4.0.1" + checksum: 10c0/cab87638e2112bee3f839ef5f6e0765057163d39c66be8ec1602f3823da4692297ad4e972de876ea17c44d652978638d2fd583c6713d0eb6591706825020c9ee + languageName: node + linkType: hard + "glob@npm:^10.2.2, glob@npm:^10.4.1": version: 10.4.5 resolution: "glob@npm:10.4.5" @@ -3834,6 +4143,13 @@ __metadata: languageName: node linkType: hard +"is-extglob@npm:^2.1.1": + version: 2.1.1 + resolution: "is-extglob@npm:2.1.1" + checksum: 10c0/5487da35691fbc339700bbb2730430b07777a3c21b9ebaecb3072512dfd7b4ba78ac2381a87e8d78d20ea08affb3f1971b4af629173a6bf435ff8a4c47747912 + languageName: node + linkType: hard + "is-finalizationregistry@npm:^1.1.0": version: 1.1.1 resolution: "is-finalizationregistry@npm:1.1.1" @@ -3862,6 +4178,15 @@ __metadata: languageName: node linkType: hard +"is-glob@npm:^4.0.1": + version: 4.0.3 + resolution: "is-glob@npm:4.0.3" + dependencies: + is-extglob: "npm:^2.1.1" + checksum: 10c0/17fb4014e22be3bbecea9b2e3a76e9e34ff645466be702f1693e8f1ee1adac84710d0be0bd9f967d6354036fd51ab7c2741d954d6e91dae6bb69714de92c197a + languageName: node + linkType: hard + "is-map@npm:^2.0.3": version: 2.0.3 resolution: "is-map@npm:2.0.3" @@ -3893,6 +4218,13 @@ __metadata: languageName: node linkType: hard +"is-number@npm:^7.0.0": + version: 7.0.0 + resolution: "is-number@npm:7.0.0" + checksum: 10c0/b4686d0d3053146095ccd45346461bc8e53b80aeb7671cc52a4de02dbbf7dc0d1d2a986e2fe4ae206984b4d34ef37e8b795ebc4f4295c978373e6575e295d811 + languageName: node + linkType: hard + "is-plain-obj@npm:^4.1.0": version: 4.1.0 resolution: "is-plain-obj@npm:4.1.0" @@ -4078,6 +4410,15 @@ __metadata: languageName: node linkType: hard +"jiti@npm:^2.6.0": + version: 2.6.1 + resolution: "jiti@npm:2.6.1" + bin: + jiti: lib/jiti-cli.mjs + checksum: 10c0/79b2e96a8e623f66c1b703b98ec1b8be4500e1d217e09b09e343471bbb9c105381b83edbb979d01cef18318cc45ce6e153571b6c83122170eefa531c64b6789b + languageName: node + linkType: hard + "js-base64@npm:^3.7.2": version: 3.7.7 resolution: "js-base64@npm:3.7.7" @@ -4092,6 +4433,17 @@ __metadata: languageName: node linkType: hard +"js-yaml@npm:^4.1.1": + version: 4.1.1 + resolution: "js-yaml@npm:4.1.1" + dependencies: + argparse: "npm:^2.0.1" + bin: + js-yaml: bin/js-yaml.js + checksum: 10c0/561c7d7088c40a9bb53cc75becbfb1df6ae49b34b5e6e5a81744b14ae8667ec564ad2527709d1a6e7d5e5fa6d483aa0f373a50ad98d42fde368ec4a190d4fae7 + languageName: node + linkType: hard + "jsbn@npm:1.1.0": version: 1.1.0 resolution: "jsbn@npm:1.1.0" @@ -4129,6 +4481,32 @@ __metadata: languageName: node linkType: hard +"knip@npm:^5.73.3": + version: 5.78.0 + resolution: "knip@npm:5.78.0" + dependencies: + "@nodelib/fs.walk": "npm:^1.2.3" + fast-glob: "npm:^3.3.3" + formatly: "npm:^0.3.0" + jiti: "npm:^2.6.0" + js-yaml: "npm:^4.1.1" + minimist: "npm:^1.2.8" + oxc-resolver: "npm:^11.15.0" + picocolors: "npm:^1.1.1" + picomatch: "npm:^4.0.1" + smol-toml: "npm:^1.5.2" + strip-json-comments: "npm:5.0.3" + zod: "npm:^4.1.11" + peerDependencies: + "@types/node": ">=18" + typescript: ">=5.0.4 <7" + bin: + knip: bin/knip.js + knip-bun: bin/knip-bun.js + checksum: 10c0/2d23fa06941ab5e84b4461d1796b8ded147e7b854ee6d5107e0558a5d4b2c6f5ab70b5b3d29cea2d1e1b133947f972cc0c2c01a1e4d13e681fe0d6f162554bd9 + languageName: node + linkType: hard + "load-json-file@npm:^4.0.0": version: 4.0.0 resolution: "load-json-file@npm:4.0.0" @@ -4297,6 +4675,23 @@ __metadata: languageName: node linkType: hard +"merge2@npm:^1.3.0": + version: 1.4.1 + resolution: "merge2@npm:1.4.1" + checksum: 10c0/254a8a4605b58f450308fc474c82ac9a094848081bf4c06778200207820e5193726dc563a0d2c16468810516a5c97d9d3ea0ca6585d23c58ccfff2403e8dbbeb + languageName: node + linkType: hard + +"micromatch@npm:^4.0.8": + version: 4.0.8 + resolution: "micromatch@npm:4.0.8" + dependencies: + braces: "npm:^3.0.3" + picomatch: "npm:^2.3.1" + checksum: 10c0/166fa6eb926b9553f32ef81f5f531d27b4ce7da60e5baf8c021d043b27a388fb95e46a8038d5045877881e673f8134122b59624d5cecbd16eb50a42e7a6b5ca8 + languageName: node + linkType: hard + "mime-db@npm:1.52.0": version: 1.52.0 resolution: "mime-db@npm:1.52.0" @@ -4354,7 +4749,7 @@ __metadata: languageName: node linkType: hard -"minimist@npm:^1.2.6": +"minimist@npm:^1.2.6, minimist@npm:^1.2.8": version: 1.2.8 resolution: "minimist@npm:1.2.8" checksum: 10c0/19d3fcdca050087b84c2029841a093691a91259a47def2f18222f41e7645a0b7c44ef4b40e88a1e58a40c84d2ef0ee6047c55594d298146d0eb3f6b737c20ce6 @@ -4641,6 +5036,75 @@ __metadata: languageName: node linkType: hard +"oxc-resolver@npm:^11.15.0": + version: 11.16.2 + resolution: "oxc-resolver@npm:11.16.2" + dependencies: + "@oxc-resolver/binding-android-arm-eabi": "npm:11.16.2" + "@oxc-resolver/binding-android-arm64": "npm:11.16.2" + "@oxc-resolver/binding-darwin-arm64": "npm:11.16.2" + "@oxc-resolver/binding-darwin-x64": "npm:11.16.2" + "@oxc-resolver/binding-freebsd-x64": "npm:11.16.2" + "@oxc-resolver/binding-linux-arm-gnueabihf": "npm:11.16.2" + "@oxc-resolver/binding-linux-arm-musleabihf": "npm:11.16.2" + "@oxc-resolver/binding-linux-arm64-gnu": "npm:11.16.2" + "@oxc-resolver/binding-linux-arm64-musl": "npm:11.16.2" + "@oxc-resolver/binding-linux-ppc64-gnu": "npm:11.16.2" + "@oxc-resolver/binding-linux-riscv64-gnu": "npm:11.16.2" + "@oxc-resolver/binding-linux-riscv64-musl": "npm:11.16.2" + "@oxc-resolver/binding-linux-s390x-gnu": "npm:11.16.2" + "@oxc-resolver/binding-linux-x64-gnu": "npm:11.16.2" + "@oxc-resolver/binding-linux-x64-musl": "npm:11.16.2" + "@oxc-resolver/binding-openharmony-arm64": "npm:11.16.2" + "@oxc-resolver/binding-wasm32-wasi": "npm:11.16.2" + "@oxc-resolver/binding-win32-arm64-msvc": "npm:11.16.2" + "@oxc-resolver/binding-win32-ia32-msvc": "npm:11.16.2" + "@oxc-resolver/binding-win32-x64-msvc": "npm:11.16.2" + dependenciesMeta: + "@oxc-resolver/binding-android-arm-eabi": + optional: true + "@oxc-resolver/binding-android-arm64": + optional: true + "@oxc-resolver/binding-darwin-arm64": + optional: true + "@oxc-resolver/binding-darwin-x64": + optional: true + "@oxc-resolver/binding-freebsd-x64": + optional: true + "@oxc-resolver/binding-linux-arm-gnueabihf": + optional: true + "@oxc-resolver/binding-linux-arm-musleabihf": + optional: true + "@oxc-resolver/binding-linux-arm64-gnu": + optional: true + "@oxc-resolver/binding-linux-arm64-musl": + optional: true + "@oxc-resolver/binding-linux-ppc64-gnu": + optional: true + "@oxc-resolver/binding-linux-riscv64-gnu": + optional: true + "@oxc-resolver/binding-linux-riscv64-musl": + optional: true + "@oxc-resolver/binding-linux-s390x-gnu": + optional: true + "@oxc-resolver/binding-linux-x64-gnu": + optional: true + "@oxc-resolver/binding-linux-x64-musl": + optional: true + "@oxc-resolver/binding-openharmony-arm64": + optional: true + "@oxc-resolver/binding-wasm32-wasi": + optional: true + "@oxc-resolver/binding-win32-arm64-msvc": + optional: true + "@oxc-resolver/binding-win32-ia32-msvc": + optional: true + "@oxc-resolver/binding-win32-x64-msvc": + optional: true + checksum: 10c0/b20a0fea18fdf31dbaee51354ce7b987ba8f3e780c6c1de9034628033a69d0b3085f9596d9925797d9340bdf4b98cd72a258b0728d0d5e5de2b1748154921b42 + languageName: node + linkType: hard + "p-cancelable@npm:^4.0.1": version: 4.0.1 resolution: "p-cancelable@npm:4.0.1" @@ -4790,7 +5254,14 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^4.0.2, picomatch@npm:^4.0.3": +"picomatch@npm:^2.3.1": + version: 2.3.1 + resolution: "picomatch@npm:2.3.1" + checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be + languageName: node + linkType: hard + +"picomatch@npm:^4.0.1, picomatch@npm:^4.0.2, picomatch@npm:^4.0.3": version: 4.0.3 resolution: "picomatch@npm:4.0.3" checksum: 10c0/9582c951e95eebee5434f59e426cddd228a7b97a0161a375aed4be244bd3fe8e3a31b846808ea14ef2c8a2527a6eeab7b3946a67d5979e81694654f939473ae2 @@ -4882,6 +5353,13 @@ __metadata: languageName: node linkType: hard +"queue-microtask@npm:^1.2.2": + version: 1.2.3 + resolution: "queue-microtask@npm:1.2.3" + checksum: 10c0/900a93d3cdae3acd7d16f642c29a642aea32c2026446151f0778c62ac089d4b8e6c986811076e1ae180a694cedf077d453a11b58ff0a865629a4f82ab558e102 + languageName: node + linkType: hard + "quick-lru@npm:^5.1.1": version: 5.1.1 resolution: "quick-lru@npm:5.1.1" @@ -5002,6 +5480,13 @@ __metadata: languageName: node linkType: hard +"reusify@npm:^1.0.4": + version: 1.1.0 + resolution: "reusify@npm:1.1.0" + checksum: 10c0/4eff0d4a5f9383566c7d7ec437b671cc51b25963bd61bf127c3f3d3f68e44a026d99b8d2f1ad344afff8d278a8fe70a8ea092650a716d22287e8bef7126bb2fa + languageName: node + linkType: hard + "rimraf@npm:^6.1.2": version: 6.1.2 resolution: "rimraf@npm:6.1.2" @@ -5103,6 +5588,15 @@ __metadata: languageName: node linkType: hard +"run-parallel@npm:^1.1.9": + version: 1.2.0 + resolution: "run-parallel@npm:1.2.0" + dependencies: + queue-microtask: "npm:^1.2.2" + checksum: 10c0/200b5ab25b5b8b7113f9901bfe3afc347e19bb7475b267d55ad0eb86a62a46d77510cb0f232507c9e5d497ebda569a08a9867d0d14f57a82ad5564d991588b39 + languageName: node + linkType: hard + "safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" @@ -5314,6 +5808,13 @@ __metadata: languageName: node linkType: hard +"smol-toml@npm:^1.5.2": + version: 1.6.0 + resolution: "smol-toml@npm:1.6.0" + checksum: 10c0/baf33bb6cd914d481329e31998a12829cd126541458ba400791212c80f1245d5b27dac04a56a52c02b287d2a494f1628c05fc19643286b258b2e0bb9fe67747c + languageName: node + linkType: hard + "socks-proxy-agent@npm:^8.0.3": version: 8.0.5 resolution: "socks-proxy-agent@npm:8.0.5" @@ -5517,6 +6018,13 @@ __metadata: languageName: node linkType: hard +"strip-json-comments@npm:5.0.3": + version: 5.0.3 + resolution: "strip-json-comments@npm:5.0.3" + checksum: 10c0/daaf20b29f69fb51112698f4a9a662490dbb78d5baf6127c75a0a83c2ac6c078a8c0f74b389ad5e0519d6fc359c4a57cb9971b1ae201aef62ce45a13247791e0 + languageName: node + linkType: hard + "strip-literal@npm:^3.0.0": version: 3.0.0 resolution: "strip-literal@npm:3.0.0" @@ -5638,6 +6146,15 @@ __metadata: languageName: node linkType: hard +"to-regex-range@npm:^5.0.1": + version: 5.0.1 + resolution: "to-regex-range@npm:5.0.1" + dependencies: + is-number: "npm:^7.0.0" + checksum: 10c0/487988b0a19c654ff3e1961b87f471702e708fa8a8dd02a298ef16da7206692e8552a0250e8b3e8759270f62e9d8314616f6da274734d3b558b1fc7b7724e892 + languageName: node + linkType: hard + "transloadit@workspace:.": version: 0.0.0-use.local resolution: "transloadit@workspace:." @@ -5647,6 +6164,8 @@ __metadata: "@biomejs/biome": "npm:^2.2.4" "@transloadit/sev-logger": "npm:^0.0.15" "@types/debug": "npm:^4.1.12" + "@types/minimist": "npm:^1.2.5" + "@types/node": "npm:^24.10.3" "@types/recursive-readdir": "npm:^2.2.4" "@types/temp": "npm:^0.9.4" "@vitest/coverage-v8": "npm:^3.2.4" @@ -5660,6 +6179,7 @@ __metadata: image-size: "npm:^2.0.2" into-stream: "npm:^9.0.0" is-stream: "npm:^4.0.1" + knip: "npm:^5.73.3" minimatch: "npm:^10.1.1" nock: "npm:^14.0.10" node-watch: "npm:^0.7.4" @@ -5672,6 +6192,7 @@ __metadata: temp: "npm:^0.9.4" tsx: "npm:4.21.0" tus-js-client: "npm:^4.3.1" + typanion: "npm:^3.14.0" type-fest: "npm:^4.41.0" typescript: "npm:5.9.3" vitest: "npm:^3.2.4" @@ -5681,7 +6202,7 @@ __metadata: languageName: unknown linkType: soft -"tslib@npm:^2.6.2": +"tslib@npm:^2.4.0, tslib@npm:^2.6.2": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62 @@ -5719,7 +6240,7 @@ __metadata: languageName: node linkType: hard -"typanion@npm:^3.8.0": +"typanion@npm:^3.14.0, typanion@npm:^3.8.0": version: 3.14.0 resolution: "typanion@npm:3.14.0" checksum: 10c0/8b03b19844e6955bfd906c31dc781bae6d7f1fb3ce4fe24b7501557013d4889ae5cefe671dafe98d87ead0adceb8afcb8bc16df7dc0bd2b7331bac96f3a7cae2 @@ -5825,6 +6346,13 @@ __metadata: languageName: node linkType: hard +"undici-types@npm:~7.16.0": + version: 7.16.0 + resolution: "undici-types@npm:7.16.0" + checksum: 10c0/3033e2f2b5c9f1504bdc5934646cb54e37ecaca0f9249c983f7b1fc2e87c6d18399ebb05dc7fd5419e02b2e915f734d872a65da2e3eeed1813951c427d33cc9a + languageName: node + linkType: hard + "unicorn-magic@npm:^0.3.0": version: 0.3.0 resolution: "unicorn-magic@npm:0.3.0" @@ -6005,6 +6533,13 @@ __metadata: languageName: node linkType: hard +"walk-up-path@npm:^4.0.0": + version: 4.0.0 + resolution: "walk-up-path@npm:4.0.0" + checksum: 10c0/fabe344f91387d1d41df230af962ef18bf703dd4178006d55cd6412caacd187b54440002d4d53a982d4f7f0455567dcffb6d3884533c8b2268928eca3ebd8a19 + languageName: node + linkType: hard + "which-boxed-primitive@npm:^1.1.0, which-boxed-primitive@npm:^1.1.1": version: 1.1.1 resolution: "which-boxed-primitive@npm:1.1.1" @@ -6167,3 +6702,10 @@ __metadata: checksum: 10c0/5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c languageName: node linkType: hard + +"zod@npm:^4.1.11": + version: 4.2.1 + resolution: "zod@npm:4.2.1" + checksum: 10c0/ecb5219bddf76a42d092a843fb98ad4cb78f1e1077082772b03ef032ee5cbc80790a4051836b962d26fb4af854323bc784d628bd1b8d9898149eba7af21c5560 + languageName: node + linkType: hard