Switch to npm

This commit is contained in:
Fernando Fernández 2021-03-02 00:28:44 +01:00
parent 09856cc8c1
commit 6efef9680d
19 changed files with 14221 additions and 9296 deletions

View File

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

View File

@ -5,3 +5,9 @@ updates:
schedule:
interval: monthly
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
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
- name: Setup node environment
uses: actions/setup-node@v2.1.5
with:
node-version: 12
check-latest: true
- name: Cache dependencies
uses: actions/cache@v2
- 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: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Install Node.js dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
env:
SKIP_PREPARE: true
- name: Run eslint
run: yarn lint
run: npm run lint
run-stylelint-css:
name: Run stylelint (css)
@ -42,27 +50,35 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
- name: Setup node environment
uses: actions/setup-node@v2.1.5
with:
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
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
run: yarn install --frozen-lockfile
run: npm ci --no-audit
env:
SKIP_PREPARE: true
- name: Run stylelint
run: yarn stylelint:css
run: npm run stylelint:css
run-stylelint-scss:
name: Run stylelint (scss)
@ -72,24 +88,32 @@ jobs:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
- name: Setup node environment
uses: actions/setup-node@v2.1.5
with:
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
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
run: yarn install --frozen-lockfile
run: npm ci --no-audit
env:
SKIP_PREPARE: true
- 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
- [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
@ -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.
```sh
yarn install
npm install
```
3. Run the web client with webpack for local development.
```sh
yarn serve
npm start
```
4. Build the client with sourcemaps available.
```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_auto_build:
npx yarn install
npm ci --no-audit
mv $(CURDIR)/dist $(CURDIR)/web
override_dh_auto_clean:

View File

@ -12,12 +12,10 @@ ENV IS_DOCKER=YES
# Prepare CentOS environment
RUN yum update -y \
&& 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
RUN curl -fSsLo /etc/yum.repos.d/yarn.repo https://dl.yarnpkg.com/rpm/yarn.repo \
&& rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm \
&& yum install -y yarn
# Install recent NodeJS
RUN rpm -i https://rpm.nodesource.com/pub_10.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm
# Link to build script
RUN ln -sf ${SOURCE_DIR}/deployment/build.centos /build.sh

View File

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

View File

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

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory
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
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -36,6 +36,6 @@ if [[ ${IS_DOCKER} == YES ]]; then
fi
rm -f fedora/jellyfin*.tar.gz
cp -a /tmp/yarn.lock yarn.lock
cp -a /tmp/package-lock.json package-lock.json
popd

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory
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
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -30,7 +30,7 @@ dpkg-buildpackage -us -uc --pre-clean --post-clean
mkdir -p ${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
chown -Rc $(stat -c %u:%g ${ARTIFACT_DIR}) ${ARTIFACT_DIR}

View File

@ -6,7 +6,7 @@ set -o xtrace
# move to source directory
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
if [[ ${IS_UNSTABLE} == 'yes' ]]; then
@ -36,6 +36,6 @@ if [[ ${IS_DOCKER} == YES ]]; then
fi
rm -f fedora/jellyfin*.tar.gz
cp -a /tmp/yarn.lock yarn.lock
cp -a /tmp/package-lock.json package-lock.json
popd

View File

@ -14,7 +14,7 @@ else
fi
# build archives
npx yarn install
npm ci --no-audit
mv dist jellyfin-web_${version}
tar -czf jellyfin-web_${version}_portable.tar.gz jellyfin-web_${version}
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`
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
%if 0%{?fedora} >= 33
BuildRequires: nodejs
@ -35,7 +27,7 @@ Jellyfin is a free software media system that puts you in control of managing an
%build
%install
yarn install
npm ci --no-audit
%{__mkdir} -p %{buildroot}%{_datadir}
mv dist %{buildroot}%{_datadir}/jellyfin-web
%{__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"
],
"scripts": {
"start": "yarn serve",
"start": "npm run serve",
"serve": "webpack serve --config webpack.dev.js",
"prepare": "node ./scripts/prepare.js",
"build:development": "webpack --config webpack.dev.js",
"build:production": "webpack --config webpack.prod.js",
"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: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