Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update Next.js, React.js and Node.js #815

Merged
merged 38 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9ab5fa5
refactor: update Next.js and React.js
gauthier-th Jun 13, 2024
63d8f55
refactor: update Next.js images
gauthier-th Jun 15, 2024
c680202
refactor: update ESLint rules and fix warnings/errors
gauthier-th Jun 15, 2024
5d6e7f0
fix: remove old intl polyfill
gauthier-th Jun 15, 2024
48d178c
fix: add proper size to next/image components
gauthier-th Jun 15, 2024
65239a9
fix: adjust full-size for next/image components
gauthier-th Jun 17, 2024
5fb1c68
fix: temporary allow all domains for image optimization
gauthier-th Jun 18, 2024
06e465d
build: fixes an issue where dev env could lead to javascript heap out…
Fallenbagel Jun 18, 2024
cb8cada
chore: merge origin/develop
gauthier-th Jun 19, 2024
5efa1d7
fix: resolve webpack cache issue with country-flag-icons
gauthier-th Jun 19, 2024
6b248d9
refactor: switch compiler from Babel to SWC
gauthier-th Jun 19, 2024
5c212ae
fix: resize logo in sidebar
gauthier-th Jun 20, 2024
f7de241
fix: break word on long path to avoid text overflow
gauthier-th Jun 20, 2024
5070000
chore: added sharp for production image optimisation
Fallenbagel Jun 20, 2024
43f8260
fix: change extract script for i18n to a custom script
gauthier-th Jun 21, 2024
966a721
fix: resolve GitHub CodeQL alert
gauthier-th Jun 21, 2024
b5738b4
chore: temporarily remove builds for ARMv7
gauthier-th Jun 22, 2024
f3e180a
fix: resize avatar images
gauthier-th Jun 23, 2024
ea43e3b
refactor: update Node.js to v20
gauthier-th Jun 23, 2024
fac81f7
fix: resolve various UI issues
gauthier-th Jun 23, 2024
99ee19c
build: migrate yarn to pnpm and restrict engine to node@^20.0.0
Fallenbagel Jun 23, 2024
588b1e3
ci: specify the pnpm version to use in workflow actions
Fallenbagel Jun 23, 2024
cb7e2f0
ci: fix typo in pnpm action-setup for cypress workflow
Fallenbagel Jun 23, 2024
ffb20eb
test(cypress): use pnpm instead of yarn
Fallenbagel Jun 23, 2024
878afb9
style: ran prettier on pnpm-lock
Fallenbagel Jun 23, 2024
e50df22
ci(cypress): setup nodejs v20 in cypress workflow
Fallenbagel Jun 23, 2024
37ba36f
ci: pnpm cache to reduce install time
Fallenbagel Jun 23, 2024
a58811e
ci: use sh shell to get pnpm store directory
Fallenbagel Jun 23, 2024
182aeaa
build(dockerfile): migrate to pnpm from yarn in docker builds
Fallenbagel Jun 23, 2024
1168c77
build(dockerfile): copy the proper pnpm lockfile
Fallenbagel Jun 23, 2024
2c52dbc
build: install pnpm for all platforms
Fallenbagel Jun 23, 2024
cc80bf2
build(dockerfile): remove unnecessary `&&` on apk installation steps
Fallenbagel Jun 23, 2024
e30a3ea
build: migrate pnpm 8 to 9
Fallenbagel Jun 23, 2024
f5a5091
build(dockerfile): add node-gyp back in
Fallenbagel Jun 23, 2024
d5e37e4
build(dockerfile): install node-gyp through npm
Fallenbagel Jun 23, 2024
0da85ca
build(dockerfile): ignore scripts to not run husky install when devde…
Fallenbagel Jun 23, 2024
efab06b
build: migrate to pnpm from yarn
Fallenbagel Jun 23, 2024
013312c
chore: remove a section that is no longer relevant
gauthier-th Jun 23, 2024
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
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:react/jsx-runtime',
'plugin:@next/next/recommended',
'prettier',
],
parserOptions: {
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,35 @@ jobs:
name: Lint & Test Build
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
container: node:18.18-alpine
container: node:20-alpine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pnpm Setup
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get pnpm store directory
shell: sh
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
env:
HUSKY: 0
run: yarn
run: pnpm install
- name: Lint
run: yarn lint
run: pnpm lint
- name: Formatting
run: yarn format:check
run: pnpm format:check
- name: Build
run: yarn build
run: pnpm build

build_and_push:
name: Build & Publish Docker Images
Expand Down Expand Up @@ -60,7 +75,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64
push: true
build-args: |
COMMIT_TAG=${{ github.sha }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Pnpm Setup
uses: pnpm/action-setup@v4
with:
version: 9
- name: Cypress run
uses: cypress-io/github-action@v6
with:
build: yarn cypress:build
start: yarn start
build: pnpm cypress:build
start: pnpm start
wait-on: 'http://localhost:5055'
record: true
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64
push: true
build-args: |
COMMIT_TAG=${{ github.sha }}
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -26,8 +26,23 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Pnpm Setup
uses: pnpm/action-setup@v4
with:
version: 9
- name: Get pnpm store directory
shell: sh
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: yarn
run: pnpm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -45,7 +60,6 @@ jobs:
# architecture:
# - amd64
# - arm64
# - armhf
# steps:
# - name: Checkout Code
# uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/snap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
architecture:
- amd64
- arm64
- armhf
steps:
- name: Checkout Code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.18-alpine AS BUILD_IMAGE
FROM node:20-alpine AS BUILD_IMAGE

WORKDIR /app

Expand All @@ -10,22 +10,24 @@ RUN \
'linux/arm64' | 'linux/arm/v7') \
apk update && \
apk add --no-cache python3 make g++ gcc libc6-compat bash && \
yarn global add node-gyp \
npm install --global node-gyp \
;; \
esac

COPY package.json yarn.lock ./
RUN CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile --network-timeout 1000000
Run npm install --global pnpm

COPY package.json pnpm-lock.yaml ./
RUN CYPRESS_INSTALL_BINARY=0 pnpm install --frozen-lockfile

COPY . ./

ARG COMMIT_TAG
ENV COMMIT_TAG=${COMMIT_TAG}

RUN yarn build
RUN pnpm build

# remove development dependencies
RUN yarn install --production --ignore-scripts --prefer-offline
RUN pnpm prune --prod --ignore-scripts

RUN rm -rf src server .next/cache

Expand All @@ -34,7 +36,7 @@ RUN touch config/DOCKER
RUN echo "{\"commitTag\": \"${COMMIT_TAG}\"}" > committag.json


FROM node:18.18-alpine
FROM node:20-alpine

# Metadata for Github Package Registry
LABEL org.opencontainers.image.source="https://github.com/Fallenbagel/jellyseerr"
Expand All @@ -47,6 +49,6 @@ RUN apk add --no-cache tzdata tini && rm -rf /tmp/*
COPY --from=BUILD_IMAGE /app ./

ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "yarn", "start" ]
CMD [ "pnpm", "start" ]

EXPOSE 5055
8 changes: 5 additions & 3 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
FROM node:18.18-alpine
FROM node:20-alpine

Fallenbagel marked this conversation as resolved.
Show resolved Hide resolved
COPY . /app
WORKDIR /app

RUN yarn
Run npm install --global pnpm

CMD yarn dev
RUN pnpm install

CMD pnpm dev
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ _The original Overseerr team have been busy and Jellyfin/Emby support aren't on

## Current Features

<!-- -->

- Full Jellyfin/Emby/Plex integration including authentication with user import & management
- Supports Movies, Shows and Mixed Libraries
- Ability to change email addresses for smtp purposes
Expand All @@ -38,10 +40,6 @@ With more features on the way! Check out our [issue tracker](https://github.com/

## Getting Started

#### Pre-requisite (Important)

_*On Jellyfin/Emby, ensure the `Settings > Home > Automatically group content from the following folders into views such as 'Movies', 'Music' and 'TV'` is turned off*_

### Launching Jellyseerr using Docker (Recommended)

Check out our docker hub for instructions on how to install and run Jellyseerr:
Expand All @@ -53,28 +51,30 @@ https://hub.docker.com/r/fallenbagel/jellyseerr

Pre-requisites:

- Nodejs [v18](https://nodejs.org/download/release/v18.18.2)
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/install)
- Nodejs [v20](https://nodejs.org/en/download)
- Pnpm [v9](https://pnpm.io/installation)
- Download/git clone the source code from the github (Either develop branch or main for stable)

Fallenbagel marked this conversation as resolved.
Show resolved Hide resolved
```cmd
npm i -g win-node-env
set CYPRESS_INSTALL_BINARY=0
yarn install --frozen-lockfile --network-timeout 1000000
yarn run build
yarn start
pnpm install --frozen-lockfile
pnpm add [email protected]
pnpm run build
pnpm start
```

(You can use task scheduler to run a bat script with `@echo off` and `yarn start` to run jellyseerr in the background)
(You can use task scheduler to run a bat script with `@echo off` and `pnpm start` to run jellyseerr in the background)
(You can also use nssm to run jellyseerr as a service, see [nssm](https://nssm.cc/usage) for more information)

_To set env variables such as `JELLYFIN_TYPE=emby` create a file called `.env` in the root directory of jellyseerr_

#### Linux

**Pre-requisites:**

- Nodejs [v18](https://nodejs.org/en/download/package-manager)
- [Yarn](https://classic.yarnpkg.com/lang/en/docs/install) (on Debian based distros, the package manager provided `yarn` is different and is a package called cmdlet. You can remove that using `apt-remove cmdlet` then install yarn using `npm install -g yarn`)
- Nodejs [v20](https://nodejs.org/en/download)
- Pnpm [v9](https://pnpm.io/installation)
- Git

**Steps:**
Expand All @@ -95,11 +95,11 @@ git checkout main
3. Then install the dependencies and build the dist

```bash
CYPRESS_INSTALL_BINARY=0 yarn install --frozen-lockfile --network-timeout 1000000
yarn run build
CYPRESS_INSTALL_BINARY=0 pnpm install --frozen-lockfile
pnpm build
```

4. Now you can start jellyseerr using `yarn start` and opening http://localhost:5055 in your browser.
4. Now you can start jellyseerr using `pnpm start` and opening http://localhost:5055 in your browser.

5. If you want to run jellyseerr as a _Systemd-service:_

Expand Down Expand Up @@ -147,7 +147,7 @@ WantedBy=multi-user.target

Archlinux: [AUR](https://aur.archlinux.org/packages/jellyseerr)
Nixpkg: [Nixpkg](https://search.nixos.org/packages?channel=unstable&show=jellyseerr)
Snap: [Snap](https://snapcraft.io/jellyseerr)
~Snap: [Snap](https://snapcraft.io/jellyseerr)~(Deprecated)

## Preview

Expand Down
25 changes: 0 additions & 25 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/support/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import './commands';

before(() => {
if (Cypress.env('SEED_DATABASE')) {
cy.exec('yarn cypress:prepare');
cy.exec('pnpm cypress:prepare');
}
});
6 changes: 5 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ module.exports = {
JELLYFIN_TYPE: process.env.JELLYFIN_TYPE,
},
images: {
domains: ['image.tmdb.org'],
remotePatterns: [
{ hostname: 'gravatar.com' },
{ hostname: 'image.tmdb.org' },
{ hostname: '*', protocol: 'https' },
],
},
webpack(config) {
config.module.rules.push({
Expand Down
Loading
Loading