56 Commits

Author SHA1 Message Date
Emrik Östling
f8f90ebd69 Merge pull request #55 from C4illin/release-please--branches--main--components--convertx-frontend 2024-06-28 00:23:46 +02:00
github-actions[bot]
648d5070e2 chore(main): release 0.3.0 2024-06-27 22:05:48 +00:00
C4illin
801cf28d1e feat: print version of installed converters to log 2024-06-28 00:05:21 +02:00
C4illin
fae2ba9c54 feat: change to xelatex 2024-06-27 23:26:46 +02:00
Emrik Östling
10d20a8786 Merge pull request #56 from C4illin/dependabot/npm_and_yarn/types/bun-tw-1.1.6
build(deps-dev): update @types/bun requirement from ^1.1.5 to ^1.1.6
2024-06-27 11:00:55 +02:00
dependabot[bot]
c9bc1e237e build(deps-dev): update @types/bun requirement from ^1.1.5 to ^1.1.6
---
updated-dependencies:
- dependency-name: "@types/bun"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-27 08:14:49 +00:00
C4illin
48a76a46b3 refactor: fix typescript 2024-06-27 01:05:36 +02:00
C4illin
4dcb796e1b feat: add version number to log
issue #44
2024-06-27 00:59:06 +02:00
C4illin
5952103bcd build(deps-dev): update @ianvs/prettier-plugin-sort-imports requirement 2024-06-27 00:58:07 +02:00
Emrik Östling
fd05ee5cd5 Merge pull request #54 from C4illin/dependabot/npm_and_yarn/types/node-tw-20.14.9
build(deps-dev): update @types/node requirement from ^20.14.8 to ^20.14.9
2024-06-26 16:27:25 +02:00
dependabot[bot]
7e7d238c7a build(deps-dev): update @types/node requirement
---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-26 08:52:48 +00:00
Emrik Östling
755a4170f2 Merge pull request #52 from C4illin/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-tw-7.14.1
build(deps-dev): update @typescript-eslint/eslint-plugin requirement from ^7.13.1 to ^7.14.1
2024-06-25 11:34:25 +02:00
dependabot[bot]
263ba415f5 build(deps-dev): update @typescript-eslint/eslint-plugin requirement
Updates the requirements on [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.14.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 09:16:20 +00:00
Emrik Östling
317260098a Merge pull request #51 from C4illin/dependabot/npm_and_yarn/typescript-eslint/parser-tw-7.14.1
build(deps-dev): update @typescript-eslint/parser requirement from ^7.13.1 to ^7.14.1
2024-06-25 11:14:48 +02:00
dependabot[bot]
5304e94b4e build(deps-dev): update @typescript-eslint/parser requirement
Updates the requirements on [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.14.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-25 08:28:04 +00:00
Emrik Östling
aab2b311cf Merge pull request #48 from C4illin/dependabot/github_actions/docker/build-push-action-6
build(deps): bump docker/build-push-action from 5 to 6
2024-06-24 11:44:13 +02:00
Emrik Östling
baa7ea40e6 Merge pull request #49 from C4illin/dependabot/github_actions/oven-sh/setup-bun-2
build(deps): bump oven-sh/setup-bun from 1 to 2
2024-06-24 11:44:01 +02:00
Emrik Östling
481a11b610 Merge pull request #50 from C4illin/dependabot/npm_and_yarn/elysia-tw-1.0.25
build(deps): update elysia requirement from ^1.0.24 to ^1.0.25
2024-06-24 11:43:51 +02:00
dependabot[bot]
c09fe296b1 build(deps): update elysia requirement from ^1.0.24 to ^1.0.25
---
updated-dependencies:
- dependency-name: elysia
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 08:48:40 +00:00
dependabot[bot]
f023aae753 build(deps): bump oven-sh/setup-bun from 1 to 2
Bumps [oven-sh/setup-bun](https://github.com/oven-sh/setup-bun) from 1 to 2.
- [Release notes](https://github.com/oven-sh/setup-bun/releases)
- [Commits](https://github.com/oven-sh/setup-bun/compare/v1...v2)

---
updated-dependencies:
- dependency-name: oven-sh/setup-bun
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 08:38:19 +00:00
dependabot[bot]
5cd9544b55 build(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-24 08:38:17 +00:00
Emrik Östling
97c23ba65c Merge pull request #47 from C4illin/dependabot/npm_and_yarn/types/node-tw-20.14.8
build(deps-dev): update @types/node requirement from ^20.14.6 to ^20.14.8
2024-06-22 15:49:14 +02:00
dependabot[bot]
0ffda40ac8 build(deps-dev): update @types/node requirement
---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-22 12:55:07 +00:00
Emrik Östling
cb639907ee Merge pull request #43 from C4illin/dependabot/npm_and_yarn/biomejs/biome-1.8.2
build(deps-dev): bump @biomejs/biome from 1.8.1 to 1.8.2
2024-06-22 14:53:36 +02:00
dependabot[bot]
0166842b78 build(deps-dev): bump @biomejs/biome from 1.8.1 to 1.8.2
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/cli/v1.8.2/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-21 08:47:40 +00:00
Emrik Östling
277a35b5df Merge pull request #32 from C4illin/release-please--branches--main--components--convertx-frontend 2024-06-20 20:27:26 +02:00
github-actions[bot]
42124e08b2 chore(main): release 0.2.0 2024-06-20 18:24:09 +00:00
C4illin
13169574f0 feat: change from debian to alpine
issue #34
2024-06-20 20:23:34 +02:00
C4illin
6fb07f0d13 build(deps-dev): update typescroipt 2024-06-20 20:10:02 +02:00
Emrik Östling
8121114ccb Merge pull request #40 from C4illin/dependabot/npm_and_yarn/types/node-tw-20.14.6
build(deps-dev): update @types/node requirement from ^20.14.5 to ^20.14.6
2024-06-20 11:20:37 +02:00
dependabot[bot]
81881af1c1 build(deps-dev): update @types/node requirement
---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 08:58:16 +00:00
Emrik Östling
bbb4117e9d Merge pull request #41 from C4illin/dependabot/npm_and_yarn/types/bun-tw-1.1.5
build(deps-dev): update @types/bun requirement from ^1.1.4 to ^1.1.5
2024-06-20 10:56:48 +02:00
dependabot[bot]
d7ec8179d8 build(deps-dev): update @types/bun requirement from ^1.1.4 to ^1.1.5
---
updated-dependencies:
- dependency-name: "@types/bun"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-20 08:51:56 +00:00
Emrik Östling
cef60afee3 Merge pull request #37 from C4illin/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-tw-7.13.1
build(deps-dev): update @typescript-eslint/eslint-plugin requirement from ^7.13.0 to ^7.13.1
2024-06-19 00:40:57 +02:00
dependabot[bot]
ccf116acde build(deps-dev): update @typescript-eslint/eslint-plugin requirement
Updates the requirements on [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 09:44:48 +00:00
Emrik Östling
f609984c90 Merge pull request #38 from C4illin/dependabot/npm_and_yarn/types/node-tw-20.14.5
build(deps-dev): update @types/node requirement from ^20.14.2 to ^20.14.5
2024-06-18 11:44:10 +02:00
dependabot[bot]
663e654c80 build(deps-dev): update @types/node requirement
---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 09:43:46 +00:00
Emrik Östling
31050dbf66 Merge pull request #36 from C4illin/dependabot/npm_and_yarn/typescript-eslint/parser-tw-7.13.1
build(deps-dev): update @typescript-eslint/parser requirement from ^7.13.0 to ^7.13.1
2024-06-18 11:42:16 +02:00
dependabot[bot]
8918c418f4 build(deps-dev): update @typescript-eslint/parser requirement
Updates the requirements on [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.1/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 08:30:14 +00:00
Emrik Östling
56266e0da8 Merge pull request #35 from C4illin/dependabot/npm_and_yarn/elysia-tw-1.0.24
build(deps): update elysia requirement from ^1.0.23 to ^1.0.24
2024-06-18 10:28:46 +02:00
dependabot[bot]
a3f5b5153a build(deps): update elysia requirement from ^1.0.23 to ^1.0.24
---
updated-dependencies:
- dependency-name: elysia
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 08:16:34 +00:00
Emrik Östling
6b4c7a16e0 Merge pull request #33 from C4illin/dependabot/npm_and_yarn/types/bun-tw-1.1.4
build(deps-dev): update @types/bun requirement from ^1.1.3 to ^1.1.4
2024-06-13 12:43:00 +02:00
dependabot[bot]
7c7756713b build(deps-dev): update @types/bun requirement from ^1.1.3 to ^1.1.4
---
updated-dependencies:
- dependency-name: "@types/bun"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 08:22:51 +00:00
Emrik Östling
15d4233a82 Merge pull request #31 from C4illin/feature-libjxl 2024-06-11 19:36:52 +02:00
C4illin
a1411a7559 chore: update readme with libjxl 2024-06-11 19:36:19 +02:00
C4illin
853a4c4f32 chore: format 2024-06-11 19:32:23 +02:00
C4illin
b05b0a14b0 build(deps-dev): update trustedDependencies in package.json 2024-06-11 19:31:40 +02:00
C4illin
ff680cb295 feat: add libjxl for jpegxl conversion 2024-06-11 19:30:06 +02:00
Emrik Östling
31e1a3124c Merge pull request #30 from C4illin/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-tw-7.13.0
build(deps-dev): update @typescript-eslint/eslint-plugin requirement from ^7.12.0 to ^7.13.0
2024-06-11 15:52:39 +02:00
dependabot[bot]
70278ef0b6 build(deps-dev): update @typescript-eslint/eslint-plugin requirement
Updates the requirements on [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 10:28:16 +00:00
Emrik Östling
0a33fb32e7 Merge pull request #29 from C4illin/dependabot/npm_and_yarn/typescript-eslint/parser-tw-7.13.0
build(deps-dev): update @typescript-eslint/parser requirement from ^7.12.0 to ^7.13.0
2024-06-11 12:26:48 +02:00
dependabot[bot]
26f52a5122 build(deps-dev): update @typescript-eslint/parser requirement
Updates the requirements on [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) to permit the latest version.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v7.13.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 10:24:09 +00:00
Emrik Östling
8f8de4295a Merge pull request #28 from C4illin/dependabot/npm_and_yarn/biomejs/biome-1.8.1
build(deps-dev): bump @biomejs/biome from 1.8.0 to 1.8.1
2024-06-11 12:22:41 +02:00
dependabot[bot]
660b342f2e build(deps-dev): bump @biomejs/biome from 1.8.0 to 1.8.1
Bumps [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) from 1.8.0 to 1.8.1.
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/cli/v1.8.1/packages/@biomejs/biome)

---
updated-dependencies:
- dependency-name: "@biomejs/biome"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 10:08:39 +00:00
Emrik Östling
6306a99740 Merge pull request #27 from C4illin/dependabot/npm_and_yarn/prettier-tw-3.3.2
build(deps-dev): update prettier requirement from ^3.3.1 to ^3.3.2
2024-06-11 12:07:08 +02:00
dependabot[bot]
5ca6f45809 build(deps-dev): update prettier requirement from ^3.3.1 to ^3.3.2
Updates the requirements on [prettier](https://github.com/prettier/prettier) to permit the latest version.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.3.1...3.3.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-11 09:03:10 +00:00
16 changed files with 296 additions and 39 deletions

View File

@@ -14,7 +14,7 @@ jobs:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- uses: oven-sh/setup-bun@v1
- uses: oven-sh/setup-bun@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

View File

@@ -58,7 +58,7 @@ jobs:
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}

View File

@@ -1,5 +1,22 @@
# Changelog
## [0.3.0](https://github.com/C4illin/ConvertX/compare/v0.2.0...v0.3.0) (2024-06-27)
### Features
* add version number to log ([4dcb796](https://github.com/C4illin/ConvertX/commit/4dcb796e1bd27badc078d0638076cd9f1e81c4a4)), closes [#44](https://github.com/C4illin/ConvertX/issues/44)
* change to xelatex ([fae2ba9](https://github.com/C4illin/ConvertX/commit/fae2ba9c54461dccdccd1bfb5e76398540d11d0b))
* print version of installed converters to log ([801cf28](https://github.com/C4illin/ConvertX/commit/801cf28d1e5edac9353b0b16be75a4fb48470b8a))
## [0.2.0](https://github.com/C4illin/ConvertX/compare/v0.1.2...v0.2.0) (2024-06-20)
### Features
* add libjxl for jpegxl conversion ([ff680cb](https://github.com/C4illin/ConvertX/commit/ff680cb29534a25c3148a90fd064bb86c71fb482))
* change from debian to alpine ([1316957](https://github.com/C4illin/ConvertX/commit/13169574f0134ae236f8d41287bb73930b575e82)), closes [#34](https://github.com/C4illin/ConvertX/issues/34)
## [0.1.2](https://github.com/C4illin/ConvertX/compare/v0.1.1...v0.1.2) (2024-06-10)

63
Debian.Dockerfile Normal file
View File

@@ -0,0 +1,63 @@
FROM oven/bun:1-debian as base
WORKDIR /app
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
# FROM base AS install-libjxl-tools
# download
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
# FROM base AS prerelease
# COPY --from=install /temp/dev/node_modules node_modules
# COPY . .
# # [optional] tests & build
# ENV NODE_ENV=production
# RUN bun test
# RUN bun run build
# copy production dependencies and source code into final image
FROM base AS release
LABEL maintainer="Emrik Östling (C4illin)"
LABEL description="ConvertX: self-hosted online file converter supporting 700+ file formats."
LABEL repo="https://github.com/C4illin/ConvertX"
# install additional dependencies
RUN rm -rf /var/lib/apt/lists/partial && apt-get update -o Acquire::CompressionTypes::Order::=gz \
&& apt-get install -y \
pandoc \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-latex-extra \
ffmpeg \
graphicsmagick \
ghostscript \
libvips-tools
# # libjxl is not available in the official debian repositories
# RUN wget https://github.com/libjxl/libjxl/releases/download/v0.10.2/jxl-debs-amd64-debian-bullseye-v0.10.2.tar.gz -O /tmp/jxl-debs-amd64-debian-bullseye-v0.10.2.tar.gz \
# && mkdir -p /tmp/libjxl \
# && tar -xvf /tmp/jxl-debs-amd64-debian-bullseye-v0.10.2.tar.gz -C /tmp/libjxl \
# && dpkg -i /tmp/libjxl/libjxl_0.10.2_amd64.deb /tmp/libjxl/jxl_0.10.2_amd64.deb \
# && rm -rf /tmp/jxl-debs-amd64-debian-bullseye-v0.10.2.tar.gz /tmp/libjxl
COPY --from=install /temp/prod/node_modules node_modules
# COPY --from=prerelease /app/src/index.tsx /app/src/
# COPY --from=prerelease /app/package.json .
COPY . .
EXPOSE 3000/tcp
ENTRYPOINT [ "bun", "run", "./src/index.tsx" ]

View File

@@ -1,4 +1,4 @@
FROM oven/bun:1-debian as base
FROM oven/bun:1-alpine as base
WORKDIR /app
# install dependencies into temp directory
@@ -31,16 +31,19 @@ LABEL description="ConvertX: self-hosted online file converter supporting 700+ f
LABEL repo="https://github.com/C4illin/ConvertX"
# install additional dependencies
RUN rm -rf /var/lib/apt/lists/partial && apt-get update -o Acquire::CompressionTypes::Order::=gz \
&& apt-get install -y \
RUN apk --no-cache add \
pandoc \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-latex-extra \
texlive \
texlive-xetex \
texmf-dist-latexextra \
ffmpeg \
graphicsmagick \
ghostscript \
libvips-tools
vips-tools \
libjxl-tools
# this might be needed for some latex use cases, will add it if needed.
# texmf-dist-fontsextra \
COPY --from=install /temp/prod/node_modules node_modules
# COPY --from=prerelease /app/src/index.tsx /app/src/
@@ -48,4 +51,5 @@ COPY --from=install /temp/prod/node_modules node_modules
COPY . .
EXPOSE 3000/tcp
ENV NODE_ENV=production
ENTRYPOINT [ "bun", "run", "./src/index.tsx" ]

View File

@@ -19,8 +19,9 @@ A self-hosted online file converter. Supports 831 different formats. Written wit
| Converter | Use case | Converts from | Converts to |
|------------------------------------------------------------------------------|---------------|---------------|-------------|
| [Vips](https://github.com/libvips/libvips) | Images (fast) | 45 | 23 |
| [PDFLaTeX](https://www.math.rug.nl/~trentelman/jacob/pdflatex/pdflatex.html) | Documents | 1 | 1 |
| [libjxl](https://github.com/libjxl/libjxl) | JPEG XL | 11 | 11 |
| [Vips](https://github.com/libvips/libvips) | Images | 45 | 23 |
| [XeLaTeX](https://tug.org/xetex/) | Documents | 1 | 1 |
| [Pandoc](https://pandoc.org/) | Documents | 43 | 65 |
| [GraphicsMagick](http://www.graphicsmagick.org/) | Images | 166 | 133 |
| [FFmpeg](https://ffmpeg.org/) | Video | ~473 | ~280 |

BIN
bun.lockb

Binary file not shown.

View File

@@ -2,6 +2,7 @@ services:
convertx:
build:
context: .
# dockerfile: Debian.Dockerfile
volumes:
- ./data:/app/data
environment:

View File

@@ -1,6 +1,6 @@
{
"name": "convertx-frontend",
"version": "0.1.2",
"version": "0.3.0",
"scripts": {
"dev": "bun run --watch src/index.tsx",
"hot": "bun run --hot src/index.tsx",
@@ -12,28 +12,31 @@
"@elysiajs/html": "^1.0.2",
"@elysiajs/jwt": "^1.0.2",
"@elysiajs/static": "^1.0.3",
"elysia": "^1.0.23"
"elysia": "^1.0.25"
},
"module": "src/index.tsx",
"bun-create": {
"start": "bun run src/index.tsx"
},
"devDependencies": {
"@biomejs/biome": "1.8.0",
"@ianvs/prettier-plugin-sort-imports": "^4.2.1",
"@biomejs/biome": "1.8.2",
"@ianvs/prettier-plugin-sort-imports": "^4.3.0",
"@kitajs/ts-html-plugin": "^4.0.1",
"@picocss/pico": "^2.0.6",
"@total-typescript/ts-reset": "^0.5.1",
"@types/bun": "^1.1.3",
"@types/bun": "^1.1.6",
"@types/eslint": "^8.56.10",
"@types/node": "^20.14.2",
"@types/node": "^20.14.9",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"cpy-cli": "^5.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.3.1",
"typescript": "^5.4.5"
}
"prettier": "^3.3.2",
"typescript": "^5.5.2"
},
"trustedDependencies": [
"@biomejs/biome"
]
}

View File

@@ -50,4 +50,4 @@ export const Header = ({
</nav>
</header>
);
};
};

71
src/converters/libjxl.ts Normal file
View File

@@ -0,0 +1,71 @@
import { exec } from "node:child_process";
// declare possible conversions
export const properties = {
from: {
jxl: ["jxl"],
images: [
"apng",
"exr",
"gif",
"jpeg",
"pam",
"pfm",
"pgm",
"pgx",
"png",
"ppm",
],
},
to: {
jxl: [
"apng",
"exr",
"gif",
"jpeg",
"pam",
"pfm",
"pgm",
"pgx",
"png",
"ppm",
],
images: ["jxl"],
},
};
export function convert(
filePath: string,
fileType: string,
convertTo: string,
targetPath: string,
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
options?: any,
): Promise<string> {
let tool = "";
if (fileType === "jxl") {
tool = "djxl";
}
if (convertTo === "jxl") {
tool = "cjxl";
}
return new Promise((resolve, reject) => {
exec(`${tool} "${filePath}" "${targetPath}"`, (error, stdout, stderr) => {
if (error) {
reject(`error: ${error}`);
}
if (stdout) {
console.log(`stdout: ${stdout}`);
}
if (stderr) {
console.error(`stderr: ${stderr}`);
}
resolve("success");
});
});
}

View File

@@ -16,9 +16,14 @@ import {
} from "./graphicsmagick";
import {
convert as convertPdflatex,
properties as propertiesPdflatex,
} from "./pdflatex";
convert as convertxelatex,
properties as propertiesxelatex,
} from "./xelatex";
import {
convert as convertLibjxl,
properties as propertiesLibjxl,
} from "./libjxl";
import { normalizeFiletype } from "../helpers/normalizeFiletype";
@@ -50,13 +55,17 @@ const properties: {
) => any;
};
} = {
libjxl: {
properties: propertiesLibjxl,
converter: convertLibjxl,
},
vips: {
properties: propertiesImage,
converter: convertImage,
},
pdflatex: {
properties: propertiesPdflatex,
converter: convertPdflatex,
xelatex: {
properties: propertiesxelatex,
converter: convertxelatex,
},
pandoc: {
properties: propertiesPandoc,
@@ -102,9 +111,8 @@ export async function mainConverter(
for (const key in converterObj.properties.from) {
if (
// HOW??
converterObj.properties.from[key].includes(fileType) &&
converterObj.properties.to[key].includes(convertTo)
converterObj?.properties?.from[key]?.includes(fileType) &&
converterObj?.properties?.to[key]?.includes(convertTo)
) {
converterFunc = converterObj.converter;
break;
@@ -208,9 +216,9 @@ for (const converterName in properties) {
for (const key in converterProperties.to) {
if (allTargets[converterName]) {
allTargets[converterName].push(...converterProperties.to[key]);
allTargets[converterName].push(...(converterProperties.to[key] || []));
} else {
allTargets[converterName] = converterProperties.to[key];
allTargets[converterName] = converterProperties.to[key] || [];
}
}
}
@@ -229,9 +237,9 @@ for (const converterName in properties) {
for (const key in converterProperties.from) {
if (allInputs[converterName]) {
allInputs[converterName].push(...converterProperties.from[key]);
allInputs[converterName].push(...(converterProperties.from[key] || []));
} else {
allInputs[converterName] = converterProperties.from[key];
allInputs[converterName] = converterProperties.from[key] || [];
}
}
}

View File

@@ -127,9 +127,15 @@ export function convert(
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
options?: any,
): Promise<string> {
// set xelatex here
const xelatex = ["pdf", "latex"];
let option = "";
if (xelatex.includes(convertTo)) {
option = "--pdf-engine=xelatex";
}
return new Promise((resolve, reject) => {
exec(
`pandoc "${filePath}" -f ${fileType} -t ${convertTo} -o "${targetPath}"`,
`pandoc ${option} "${filePath}" -f ${fileType} -t ${convertTo} -o "${targetPath}"`,
(error, stdout, stderr) => {
if (error) {
reject(`error: ${error}`);

View File

@@ -19,9 +19,13 @@ export function convert(
): Promise<string> {
return new Promise((resolve, reject) => {
// const fileName: string = (targetPath.split("/").pop() as string).replace(".pdf", "")
const outputPath = targetPath.split("/").slice(0, -1).join("/").replace("./", "")
const outputPath = targetPath
.split("/")
.slice(0, -1)
.join("/")
.replace("./", "");
exec(
`pdflatex -interaction=nonstopmode -output-directory="${outputPath}" "${filePath}"`,
`latexmk -xelatex -interaction=nonstopmode -output-directory="${outputPath}" "${filePath}"`,
(error, stdout, stderr) => {
if (error) {
reject(`error: ${error}`);

View File

@@ -0,0 +1,75 @@
import { exec } from "node:child_process";
import { version } from "../../package.json";
console.log(`ConvertX v${version}`);
if (process.env.NODE_ENV === "production") {
exec("cat /etc/os-release", (error, stdout) => {
if (error) {
console.error("Not running on docker, this is not supported.");
}
if (stdout) {
console.log(stdout.split('PRETTY_NAME="')[1]?.split('"')[0]);
}
});
exec("pandoc -v", (error, stdout) => {
if (error) {
console.error("Pandoc is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
exec("ffmpeg -version", (error, stdout) => {
if (error) {
console.error("FFmpeg is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
exec("vips -v", (error, stdout) => {
if (error) {
console.error("Vips is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
exec("gm version", (error, stdout) => {
if (error) {
console.error("GraphicsMagick is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
exec("djxl --version", (error, stdout) => {
if (error) {
console.error("libjxl-tools is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
exec("xelatex -version", (error, stdout) => {
if (error) {
console.error("Tex Live with XeTeX is not installed.");
}
if (stdout) {
console.log(stdout.split("\n")[0]);
}
});
}

View File

@@ -19,6 +19,10 @@ import {
normalizeFiletype,
normalizeOutputFiletype,
} from "./helpers/normalizeFiletype";
import "./helpers/printVersions";
const db = new Database("./data/mydb.sqlite", { create: true });
const uploadsDir = "./data/uploads/";