diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..41cc9ab --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +dist +.git +.pnpm-store diff --git a/Dockerfile.test b/Dockerfile.test new file mode 100644 index 0000000..879111d --- /dev/null +++ b/Dockerfile.test @@ -0,0 +1,30 @@ +# MetaMesh Plugin: subtitle - Test Image +# Builds the plugin and runs its tests (no ffmpeg needed: WebDAV and the meta +# API are faked in-process) + +FROM node:20-slim + +# git for the GitHub dependency (filename-tools) +RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* + +ENV PNPM_HOME="/pnpm" +ENV PATH="$PNPM_HOME:$PATH" +RUN npm install -g corepack@latest && corepack enable + +WORKDIR /app + +COPY package.json pnpm-lock.yaml ./ +RUN corepack install +RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile + +# Build the git dependency (filename-tools), as the production Dockerfile does +RUN cd node_modules/@metazla/filename-tools && pnpm install && pnpm run build + +COPY tsconfig.json vitest.config.ts ./ +COPY src/ ./src/ +COPY test/ ./test/ +RUN pnpm run build + +ENV NODE_ENV=test + +CMD ["pnpm", "test"] diff --git a/README.md b/README.md index 3e90b1a..4f095cd 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,38 @@ # MetaMesh Plugin: Subtitle -A MetaMesh plugin that processes subtitle files and links them to videos. +Links subtitle **sidecar** files to the video they sit next to, in both directions, and determines each sidecar's language. -## Description +## What counts as a sidecar -This plugin handles subtitle file processing: +`