Merge pull request #2476 from jellyfin/deyarn

Switch to npm
This commit is contained in:
Joshua M. Boniface 2021-04-07 18:52:29 -04:00 committed by GitHub
commit e5cd92c01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 14221 additions and 9296 deletions

View File

@ -21,19 +21,19 @@ jobs:
- task: Cache@2 - task: Cache@2
displayName: 'Cache node_modules' displayName: 'Cache node_modules'
inputs: inputs:
key: 'yarn | yarn.lock' key: 'npm | package-lock.json'
path: 'node_modules' path: 'node_modules'
- script: 'yarn install --frozen-lockfile' - script: 'npm ci --no-audit'
displayName: 'Install Dependencies' displayName: 'Install Dependencies'
env: env:
SKIP_PREPARE: 'true' SKIP_PREPARE: 'true'
- script: 'yarn build:development' - script: 'npm run build:development'
displayName: 'Build Development' displayName: 'Build Development'
condition: eq(variables['BuildConfiguration'], 'development') condition: eq(variables['BuildConfiguration'], 'development')
- script: 'yarn build:production' - script: 'npm run build:production'
displayName: 'Build Production' displayName: 'Build Production'
condition: eq(variables['BuildConfiguration'], 'production') condition: eq(variables['BuildConfiguration'], 'production')

View File

@ -5,3 +5,9 @@ updates:
schedule: schedule:
interval: monthly interval: monthly
open-pull-requests-limit: 10 open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: monthly
open-pull-requests-limit: 10

View File

@ -15,24 +15,32 @@ jobs:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Node.js - name: Setup node environment
uses: actions/setup-node@v1 uses: actions/setup-node@v2.1.5
with: with:
node-version: 12 node-version: 12
check-latest: true
- name: Cache dependencies - name: Get npm cache directory path
uses: actions/cache@v2 id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with: with:
path: '**/node_modules' path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Node.js dependencies - name: Install Node.js dependencies
run: yarn install --frozen-lockfile run: npm ci --no-audit
env: env:
SKIP_PREPARE: true SKIP_PREPARE: true
- name: Run eslint - name: Run eslint
run: yarn lint run: npm run lint
run-stylelint-css: run-stylelint-css:
name: Run stylelint (css) name: Run stylelint (css)
@ -42,27 +50,35 @@ jobs:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Node.js - name: Setup node environment
uses: actions/setup-node@v1 uses: actions/setup-node@v2.1.5
with: with:
node-version: 12 node-version: 12
check-latest: true
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Set up stylelint matcher - name: Set up stylelint matcher
uses: xt0rted/stylelint-problem-matcher@v1 uses: xt0rted/stylelint-problem-matcher@v1
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Node.js dependencies - name: Install Node.js dependencies
run: yarn install --frozen-lockfile run: npm ci --no-audit
env: env:
SKIP_PREPARE: true SKIP_PREPARE: true
- name: Run stylelint - name: Run stylelint
run: yarn stylelint:css run: npm run stylelint:css
run-stylelint-scss: run-stylelint-scss:
name: Run stylelint (scss) name: Run stylelint (scss)
@ -72,24 +88,32 @@ jobs:
- name: Check out Git repository - name: Check out Git repository
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set up Node.js - name: Setup node environment
uses: actions/setup-node@v1 uses: actions/setup-node@v2.1.5
with: with:
node-version: 12 node-version: 12
check-latest: true
- name: Get npm cache directory path
id: npm-cache-dir-path
run: echo "::set-output name=dir::$(npm config get cache)"
- name: Cache node_modules
uses: actions/cache@v2.1.4
id: npm-cache
with:
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Set up stylelint matcher - name: Set up stylelint matcher
uses: xt0rted/stylelint-problem-matcher@v1 uses: xt0rted/stylelint-problem-matcher@v1
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install Node.js dependencies - name: Install Node.js dependencies
run: yarn install --frozen-lockfile run: npm ci --no-audit
env: env:
SKIP_PREPARE: true SKIP_PREPARE: true
- name: Run stylelint - name: Run stylelint
run: yarn stylelint:scss run: npm run stylelint:scss

1
.npmrc Normal file
View File

@ -0,0 +1 @@
fund=false

View File

@ -42,7 +42,7 @@ Jellyfin Web is the frontend used for most of the clients available for end user
### Dependencies ### Dependencies
- [Node.js](https://nodejs.org/en/download) - [Node.js](https://nodejs.org/en/download)
- [Yarn 1.22.5](https://classic.yarnpkg.com/en/docs/install) - npm (included in Node.js)
### Getting Started ### Getting Started
@ -56,17 +56,17 @@ Jellyfin Web is the frontend used for most of the clients available for end user
2. Install build dependencies in the project directory. 2. Install build dependencies in the project directory.
```sh ```sh
yarn install npm install
``` ```
3. Run the web client with webpack for local development. 3. Run the web client with webpack for local development.
```sh ```sh
yarn serve npm start
``` ```
4. Build the client with sourcemaps available. 4. Build the client with sourcemaps available.
```sh ```sh
yarn build:development npm run build:development
``` ```

2
debian/rules vendored
View File

@ -11,7 +11,7 @@ override_dh_auto_test:
override_dh_clistrip: override_dh_clistrip:
override_dh_auto_build: override_dh_auto_build:
npx yarn install npm ci --no-audit
mv $(CURDIR)/dist $(CURDIR)/web mv $(CURDIR)/dist $(CURDIR)/web
override_dh_auto_clean: override_dh_auto_clean:

View File

@ -12,12 +12,10 @@ ENV IS_DOCKER=YES
# Prepare CentOS environment # Prepare CentOS environment
RUN yum update -y \ RUN yum update -y \
&& yum install -y epel-release \ && yum install -y epel-release \
&& yum install -y @buildsys-build rpmdevtools git yum-plugins-core nodejs-yarn autoconf automake glibc-devel && yum install -y @buildsys-build rpmdevtools git yum-plugins-core autoconf automake glibc-devel
# Install recent NodeJS and Yarn # Install recent NodeJS
RUN curl -fSsLo /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \ RUN rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
&& rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm \
&& yum install -y yarn
# Link to build script # Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.centos /build.sh RUN ln -sf ${SOURCE_DIR}/deployment/build.centos /build.sh

View File

@ -14,8 +14,6 @@ ENV IS_DOCKER=YES
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y debhelper mmv npm git && apt-get install -y debhelper mmv npm git
# Prepare Yarn
RUN npm install -g yarn
# Link to build script # Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.debian /build.sh RUN ln -sf ${SOURCE_DIR}/deployment/build.debian /build.sh

View File

@ -8,4 +8,4 @@ RUN apk add autoconf g++ make libpng-dev gifsicle alpine-sdk automake libtool ma
WORKDIR ${SOURCE_DIR} WORKDIR ${SOURCE_DIR}
COPY . . COPY . .
RUN yarn install && mv dist ${ARTIFACT_DIR} RUN npm ci --no-audit && mv dist ${ARTIFACT_DIR}

View File

@ -11,7 +11,7 @@ ENV IS_DOCKER=YES
# Prepare Fedora environment # Prepare Fedora environment
RUN dnf update -y \ RUN dnf update -y \
&& dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core nodejs-yarn autoconf automake glibc-devel && dnf install -y @buildsys-build rpmdevtools git dnf-plugins-core nodejs autoconf automake glibc-devel
# Link to build script # Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.fedora /build.sh RUN ln -sf ${SOURCE_DIR}/deployment/build.fedora /build.sh

View File

@ -13,9 +13,6 @@ ENV IS_DOCKER=YES
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y mmv npm git && apt-get install -y mmv npm git
# Prepare Yarn
RUN npm install -g yarn
# Link to build script # Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.portable /build.sh RUN ln -sf ${SOURCE_DIR}/deployment/build.portable /build.sh

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory # move to source directory
pushd ${SOURCE_DIR} pushd ${SOURCE_DIR}
cp -a yarn.lock /tmp/yarn.lock cp -a package-lock.json /tmp/package-lock.json
# modify changelog to unstable configuration if IS_UNSTABLE # modify changelog to unstable configuration if IS_UNSTABLE
if [[ ${IS_UNSTABLE} == 'yes' ]]; then if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -36,6 +36,6 @@ if [[ ${IS_DOCKER} == YES ]]; then
fi fi
rm -f fedora/jellyfin*.tar.gz rm -f fedora/jellyfin*.tar.gz
cp -a /tmp/yarn.lock yarn.lock cp -a /tmp/package-lock.json package-lock.json
popd popd

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory # move to source directory
pushd ${SOURCE_DIR} pushd ${SOURCE_DIR}
cp -a yarn.lock /tmp/yarn.lock cp -a package-lock.json /tmp/package-lock.json
# modify changelog to unstable configuration if IS_UNSTABLE # modify changelog to unstable configuration if IS_UNSTABLE
if [[ ${IS_UNSTABLE} == 'yes' ]]; then if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -30,7 +30,7 @@ dpkg-buildpackage -us -uc --pre-clean --post-clean
mkdir -p ${ARTIFACT_DIR} mkdir -p ${ARTIFACT_DIR}
mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR} mv ../jellyfin*.{deb,dsc,tar.gz,buildinfo,changes} ${ARTIFACT_DIR}
cp -a /tmp/yarn.lock yarn.lock cp -a /tmp/package-lock.json package-lock.json
if [[ ${IS_DOCKER} == YES ]]; then if [[ ${IS_DOCKER} == YES ]]; then
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR} chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory # move to source directory
pushd ${SOURCE_DIR} pushd ${SOURCE_DIR}
cp -a yarn.lock /tmp/yarn.lock cp -a package-lock.json /tmp/package-lock.json
# modify changelog to unstable configuration if IS_UNSTABLE # modify changelog to unstable configuration if IS_UNSTABLE
if [[ ${IS_UNSTABLE} == 'yes' ]]; then if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -36,6 +36,6 @@ if [[ ${IS_DOCKER} == YES ]]; then
fi fi
rm -f fedora/jellyfin*.tar.gz rm -f fedora/jellyfin*.tar.gz
cp -a /tmp/yarn.lock yarn.lock cp -a /tmp/package-lock.json package-lock.json
popd popd

View File

@ -14,7 +14,7 @@ else
fi fi
# build archives # build archives
npx yarn install npm ci --no-audit
mv dist jellyfin-web_${version} mv dist jellyfin-web_${version}
tar -czf jellyfin-web_${version}_portable.tar.gz jellyfin-web_${version} tar -czf jellyfin-web_${version}_portable.tar.gz jellyfin-web_${version}
rm -rf dist rm -rf dist

View File

@ -9,14 +9,6 @@ URL: https://jellyfin.org
# Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%%{version}.tar.gz` # Jellyfin Server tarball created by `make -f .copr/Makefile srpm`, real URL ends with `v%%{version}.tar.gz`
Source0: jellyfin-web-%{version}.tar.gz Source0: jellyfin-web-%{version}.tar.gz
%if 0%{?centos}
BuildRequires: yarn
%else
BuildRequires: nodejs-yarn
%endif
# sadly the yarn RPM at https://dl.yarnpkg.com/rpm/ uses git but doesn't Requires: it
# ditto for Fedora's yarn RPM
BuildRequires: git
BuildArch: noarch BuildArch: noarch
%if 0%{?fedora} >= 33 %if 0%{?fedora} >= 33
BuildRequires: nodejs BuildRequires: nodejs
@ -35,7 +27,7 @@ Jellyfin is a free software media system that puts you in control of managing an
%build %build
%install %install
yarn install npm ci --no-audit
%{__mkdir} -p %{buildroot}%{_datadir} %{__mkdir} -p %{buildroot}%{_datadir}
mv dist %{buildroot}%{_datadir}/jellyfin-web mv dist %{buildroot}%{_datadir}/jellyfin-web
%{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE %{__install} -D -m 0644 LICENSE %{buildroot}%{_datadir}/licenses/jellyfin/LICENSE

14135
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -99,14 +99,17 @@
"Firefox ESR" "Firefox ESR"
], ],
"scripts": { "scripts": {
"start": "yarn serve", "start": "npm run serve",
"serve": "webpack serve --config webpack.dev.js", "serve": "webpack serve --config webpack.dev.js",
"prepare": "node ./scripts/prepare.js", "prepare": "node ./scripts/prepare.js",
"build:development": "webpack --config webpack.dev.js", "build:development": "webpack --config webpack.dev.js",
"build:production": "webpack --config webpack.prod.js", "build:production": "webpack --config webpack.prod.js",
"lint": "eslint \"src/\"", "lint": "eslint \"src/\"",
"stylelint": "yarn stylelint:css && yarn stylelint:scss", "stylelint": "npm run stylelint:css && npm run stylelint:scss",
"stylelint:css": "stylelint \"src/**/*.css\"", "stylelint:css": "stylelint \"src/**/*.css\"",
"stylelint:scss": "stylelint --config=\".stylelintrc.scss.json\" \"src/**/*.scss\"" "stylelint:scss": "stylelint --config=\".stylelintrc.scss.json\" \"src/**/*.scss\""
},
"engines": {
"yarn": "YARN NO LONGER USED - use npm instead."
} }
} }

9229
yarn.lock

File diff suppressed because it is too large Load Diff