diff --git a/.gitignore b/.gitignore index ab13b2a..b9eeb2c 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ package-lock.json /db /data /Bruno -/tsconfig.tsbuildinfo \ No newline at end of file +/tsconfig.tsbuildinfo +/src/public/style.css \ No newline at end of file diff --git a/Debian.Dockerfile b/Debian.Dockerfile deleted file mode 100644 index 60e8d88..0000000 --- a/Debian.Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -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" ] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b227c8b..803d382 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,14 +22,14 @@ RUN cargo install resvg # 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 . . +FROM base AS prerelease +COPY --from=install /temp/dev/node_modules node_modules +COPY . . # # [optional] tests & build -# ENV NODE_ENV=production +ENV NODE_ENV=production # RUN bun test -# RUN bun run build +RUN bun run build # copy production dependencies and source code into final image FROM base AS release @@ -56,6 +56,7 @@ RUN apk --no-cache add \ COPY --from=install /temp/prod/node_modules node_modules COPY --from=builder /root/.cargo/bin/resvg /usr/local/bin/resvg +COPY --from=prerelease /app/src/public/style.css /app/src/public/ # COPY --from=prerelease /app/src/index.tsx /app/src/ # COPY --from=prerelease /app/package.json . COPY . . diff --git a/biome.json b/biome.json index c751d74..e14b242 100644 --- a/biome.json +++ b/biome.json @@ -10,9 +10,14 @@ "attributePosition": "auto" }, "files": { - "ignore": ["**/node_modules/**", "**/pico.lime.min.css"] + "ignore": [ + "**/node_modules/**", + "**/pico.lime.min.css" + ] + }, + "organizeImports": { + "enabled": true }, - "organizeImports": { "enabled": true }, "linter": { "enabled": true, "rules": { @@ -25,7 +30,11 @@ "useLiteralKeys": "error", "useOptionalChain": "error" }, - "correctness": { "noPrecisionLoss": "error", "noUnusedVariables": "off" }, + "correctness": { + "noPrecisionLoss": "error", + "noUnusedVariables": "off", + "useJsxKeyInIterable": "off" + }, "style": { "noInferrableTypes": "error", "noNamespace": "error", @@ -45,6 +54,9 @@ "noUnsafeDeclarationMerging": "error", "useAwait": "error", "useNamespaceKeyword": "error" + }, + "nursery": { + "useSortedClasses": "error" } } }, @@ -60,4 +72,4 @@ "attributePosition": "auto" } } -} +} \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 977bbcd..336c19e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 4292374..dfad85c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "dev": "bun run --watch src/index.tsx", "hot": "bun run --hot src/index.tsx", "format": "biome format --write ./src", - "css": "cpy 'node_modules/@picocss/pico/css/pico.lime.min.css' 'src/public/' --flat", + "build": "postcss ./src/main.css -o ./src/public/style.css", "lint": "run-p 'lint:*'", "lint:tsc": "tsc --noEmit", "lint:knip": "knip", @@ -36,7 +36,8 @@ "@types/node": "^22.5.4", "@typescript-eslint/eslint-plugin": "^8.4.0", "@typescript-eslint/parser": "^8.4.0", - "cpy-cli": "^5.0.0", + "autoprefixer": "^10.4.20", + "cssnano": "^7.0.6", "eslint": "^9.9.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-deprecation": "^3.0.0", @@ -47,7 +48,12 @@ "eslint-plugin-simple-import-sort": "^12.1.1", "knip": "^5.29.2", "npm-run-all2": "^6.2.2", + "postcss": "^8.4.47", + "postcss-cli": "^11.0.0", + "postcss-lightningcss": "^1.0.1", "prettier": "^3.3.3", + "tailwind-scrollbar": "^3.1.0", + "tailwindcss": "^3.4.12", "typescript": "^5.5.4", "typescript-eslint": "^8.4.0" }, diff --git a/postcss.config.cjs b/postcss.config.cjs new file mode 100644 index 0000000..f8fd003 --- /dev/null +++ b/postcss.config.cjs @@ -0,0 +1,9 @@ +// eslint-disable-next-line no-undef +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + // eslint-disable-next-line no-undef + ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}) + } +} \ No newline at end of file diff --git a/src/components/base.tsx b/src/components/base.tsx index c11af2e..b368b6e 100644 --- a/src/components/base.tsx +++ b/src/components/base.tsx @@ -7,7 +7,6 @@ export const BaseHtml = ({