Skip to content

Commit f1177a7

Browse files
committed
Allow using .ts extension in the source files
1 parent 7eb9d94 commit f1177a7

21 files changed

Lines changed: 39 additions & 38 deletions

examples/convert_to_webp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node examples/convert_to_webp.js ./examples/fixtures/berkley.jpg
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/convert_to_webp.ts ./examples/fixtures/berkley.jpg
44
//
55
// You may need to build the project first using:
66
//

examples/credentials.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node template_api.js
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/credentials.ts
44
//
55
// You may need to build the project first using:
66
//

examples/face_detect_download.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node examples/face_detect_download.js ./examples/fixtures/berkley.jpg
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/face_detect_download.ts ./examples/fixtures/berkley.jpg
44
//
55
// You may need to build the project first using:
66
//

examples/fetch_costs_of_all_assemblies_in_timeframe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node fetch_costs_of_all_assemblies_in_timeframe.js
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/fetch_costs_of_all_assemblies_in_timeframe.ts
44
//
55
// You may need to build the project first using:
66
//

examples/rasterize_svg_to_png.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node rasterize_svg_to_png.js ./examples/fixtures/circle.svg
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/rasterize_svg_to_png.ts ./examples/fixtures/circle.svg
44
//
55
// You may need to build the project first using:
66
//

examples/resize_an_image.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node resize_an_image.js ./examples/fixtures/berkley.jpg
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/resize_an_image.ts ./examples/fixtures/berkley.jpg
44
//
55
// You may need to build the project first using:
66
//

examples/retry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// Run this file as:
44
//
5-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node retry.js
5+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/retry.ts
66
//
77
// You may need to build the project first using:
88
//

examples/template_api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Run this file as:
22
//
3-
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy node template_api.js
3+
// env TRANSLOADIT_KEY=xxx TRANSLOADIT_SECRET=yyy yarn tsx examples/template_api.ts
44
//
55
// You may need to build the project first using:
66
//

src/PaginationStream.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Readable } from 'node:stream'
2-
import type { PaginationList, PaginationListWithCount } from './apiTypes.js'
2+
import type { PaginationList, PaginationListWithCount } from './apiTypes.ts'
33

44
type FetchPage<T> = (
55
pageno: number,

src/Transloadit.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ import intoStream, { type Input as IntoStreamInput } from 'into-stream'
1717
import { isReadableStream, isStream } from 'is-stream'
1818
import pMap from 'p-map'
1919
import packageJson from '../package.json' with { type: 'json' }
20-
import { ApiError, type TransloaditErrorResponseBody } from './ApiError.js'
20+
import { ApiError, type TransloaditErrorResponseBody } from './ApiError.ts'
2121
import {
2222
type AssemblyIndex,
2323
type AssemblyIndexItem,
2424
type AssemblyStatus,
2525
assemblyIndexSchema,
2626
assemblyStatusSchema,
27-
} from './alphalib/types/assemblyStatus.js'
27+
} from './alphalib/types/assemblyStatus.ts'
2828
import { zodParseWithContext } from './alphalib/zodParseWithContext.ts'
2929
import type {
3030
BaseResponse,
@@ -46,11 +46,11 @@ import type {
4646
TemplateCredentialResponse,
4747
TemplateCredentialsResponse,
4848
TemplateResponse,
49-
} from './apiTypes.js'
50-
import InconsistentResponseError from './InconsistentResponseError.js'
51-
import PaginationStream from './PaginationStream.js'
52-
import PollingTimeoutError from './PollingTimeoutError.js'
53-
import { type Stream, sendTusRequest } from './tus.js'
49+
} from './apiTypes.ts'
50+
import InconsistentResponseError from './InconsistentResponseError.ts'
51+
import PaginationStream from './PaginationStream.ts'
52+
import PollingTimeoutError from './PollingTimeoutError.ts'
53+
import { type Stream, sendTusRequest } from './tus.ts'
5454

5555
// See https://github.com/sindresorhus/got/tree/v11.8.6?tab=readme-ov-file#errors
5656
// Expose relevant errors
@@ -64,8 +64,8 @@ export {
6464
UploadError,
6565
} from 'got'
6666

67-
export type { AssemblyStatus } from './alphalib/types/assemblyStatus.js'
68-
export * from './apiTypes.js'
67+
export type { AssemblyStatus } from './alphalib/types/assemblyStatus.ts'
68+
export * from './apiTypes.ts'
6969
export { InconsistentResponseError, ApiError }
7070

7171
const log = debug('transloadit')

0 commit comments

Comments
 (0)