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
8 changes: 7 additions & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "@m4k/client",
"version": "0.2.4",
"version": "0.2.5",
"type": "module",
"module": "./lib/index.js",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js"
}
},
"license": "MIT",
"description": "Client for m4k server",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ProcessedFile } from "@m4k/common";
export { processAudio, processImage, processVideo } from "./client";
export { processAudio, processImage, processVideo } from "./client.js";
8 changes: 7 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "@m4k/common",
"version": "0.2.4",
"version": "0.2.5",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"module": "./lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js"
}
},
"license": "MIT",
"description": "Common types and utilities for m4k",
"author": "sv2dev",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ export class ProcessedFile {
) {}
}

export { mimeTypes } from "./mime";
export { mimeTypes } from "./mime.js";
8 changes: 7 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "m4k",
"version": "0.3.0",
"version": "0.3.1",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"module": "./lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js"
}
},
"license": "MIT",
"description": "Media toolkit for node, bun, and deno",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/audio/audio-processor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type AudioOptions } from "@m4k/common";
import { mkdir } from "node:fs/promises";
import { createQueue } from "tasque";
import { getExtension, processFfmpeg } from "../util/ffmpeg-processor";
import { getExtension, processFfmpeg } from "../util/ffmpeg-processor.js";

/**
* Process an audio file.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/images/image-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type ImageOptions, ProcessedFile } from "@m4k/common";
import { createReadStream } from "node:fs";
import sharp from "sharp";
import { createQueue } from "tasque";
import { exhaustAsyncIterableToWritable } from "../util/streams";
import { exhaustAsyncIterableToWritable } from "../util/streams.js";

export type Format = Required<ImageOptions>["format"];
export type Fit = Required<Required<ImageOptions>["resize"]>["fit"];
Expand Down
10 changes: 5 additions & 5 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export {
type QueuePosition,
type VideoOptions
} from "@m4k/common";
export { audioQueue, processAudio } from "./audio/audio-processor";
export { imageQueue, processImage } from "./images/image-processor";
export { getExtension } from "./util/ffmpeg-processor";
export { mimeTypes } from "./util/mime";
export { processVideo, videoQueue } from "./videos/video-processor";
export { audioQueue, processAudio } from "./audio/audio-processor.js";
export { imageQueue, processImage } from "./images/image-processor.js";
export { getExtension } from "./util/ffmpeg-processor.js";
export { mimeTypes } from "./util/mime.js";
export { processVideo, videoQueue } from "./videos/video-processor.js";
4 changes: 2 additions & 2 deletions packages/core/src/util/ffmpeg-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { getRandomValues } from "node:crypto";
import { createWriteStream } from "node:fs";
import { rm } from "node:fs/promises";
import { type Tasque } from "tasque";
import { mimeTypes } from "../util/mime";
import { exhaustAsyncIterableToWritable } from "../util/streams";
import { mimeTypes } from "../util/mime.js";
import { exhaustAsyncIterableToWritable } from "../util/streams.js";

/**
* Process a video.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/videos/video-processor.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type VideoOptions } from "@m4k/common";
import { mkdir } from "node:fs/promises";
import { createQueue } from "tasque";
import { getExtension, processFfmpeg } from "../util/ffmpeg-processor";
import { getExtension, processFfmpeg } from "../util/ffmpeg-processor.js";
/**
* Process a video.
* @param input - The input video. Can be a file path, a stream or a blob.
Expand Down
8 changes: 7 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "@m4k/server",
"version": "0.2.5",
"version": "0.2.6",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"module": "./lib/index.js",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js"
}
},
"license": "MIT",
"description": "Server for m4k",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/audio/process-audio-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { TypeCompiler } from "@sinclair/typebox/compiler";
import { ProcessedFile, processAudio } from "m4k";
import { rm } from "node:fs/promises";
import { basename } from "node:path";
import { parseOpts } from "../util/request-parsing";
import { error, queueAndStream } from "../util/response";
import { parseOpts } from "../util/request-parsing.js";
import { error, queueAndStream } from "../util/response.js";

const compiledOptionsSchema = TypeCompiler.Compile(audioOptionsSchema);

Expand Down
6 changes: 3 additions & 3 deletions packages/server/src/images/process-image-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Type as T } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";
import { ProcessedFile, processImage } from "m4k";
import { rm } from "node:fs/promises";
import { parseOpts } from "../util/request-parsing";
import { error, queueAndStream } from "../util/response";
import { numberQueryParamSchema, parse } from "../util/typebox";
import { parseOpts } from "../util/request-parsing.js";
import { error, queueAndStream } from "../util/response.js";
import { numberQueryParamSchema, parse } from "../util/typebox.js";

const compiledOptionsSchema = TypeCompiler.Compile(imageOptionsSchema);

Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serveOpts } from "./server";
import { serveOpts } from "./server.js";

export default {
...serveOpts,
Expand Down
6 changes: 3 additions & 3 deletions packages/server/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { ServeOptions, Server } from "bun";
import { version } from "../package.json";
import { processAudioHandler } from "./audio/process-audio-handler";
import { processImageHandler } from "./images/process-image-handler";
import { processVideoHandler } from "./videos/process-video-handler";
import { processAudioHandler } from "./audio/process-audio-handler.js";
import { processImageHandler } from "./images/process-image-handler.js";
import { processVideoHandler } from "./videos/process-video-handler.js";

export const serveOpts: ServeOptions = {
maxRequestBodySize: 2 ** 40, // 1TB
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/util/request-parsing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { StaticDecode, TSchema } from "@sinclair/typebox";
import type { TypeCheck } from "@sinclair/typebox/compiler";
import { parse } from "./typebox";
import { parse } from "./typebox.js";

export function parseOpts<TOptions extends TSchema>(
request: Request,
Expand Down
2 changes: 1 addition & 1 deletion packages/server/src/util/response.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ProcessedFile } from "m4k";
import { basename } from "node:path";
import { BOUNDARY, MultipartMixed } from "./multipart-mixed";
import { BOUNDARY, MultipartMixed } from "./multipart-mixed.js";

export function error(status: number, message: string) {
return new Response(message, { status });
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/videos/process-video-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { TypeCompiler } from "@sinclair/typebox/compiler";
import { ProcessedFile, processVideo } from "m4k";
import { rm } from "node:fs/promises";
import { basename } from "node:path";
import { parseOpts } from "../util/request-parsing";
import { error, queueAndStream } from "../util/response";
import { parseOpts } from "../util/request-parsing.js";
import { error, queueAndStream } from "../util/response.js";

const compiledOptionsSchema = TypeCompiler.Compile(videoOptionsSchema);

Expand Down
2 changes: 1 addition & 1 deletion packages/typebox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@m4k/typebox",
"version": "0.1.0",
"version": "0.1.1",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
Loading