chore: switch to npm

This commit is contained in:
Fernando Fernández
2021-03-10 13:41:17 +01:00
parent 13bccb6eec
commit f3ba917e50
16 changed files with 28589 additions and 14804 deletions
+1 -1
View File
@@ -22,7 +22,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",
"postCreateCommand": "npm install",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
"mounts": ["source=jellyfin-vue-history,target=/commandhistory,type=volume"]
+1767
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -6,13 +6,14 @@ FROM node:14-alpine
LABEL maintainer="Jellyfin Packaging Team - packaging@jellyfin.org"
LABEL org.opencontainers.image.source="https://github.com/jellyfin/jellyfin-vue"
COPY .docker/package.json ./.docker/nuxt.config.js ./
COPY .docker/package.json .docker/package-lock.json ./.docker/nuxt.config.js ./
COPY .nuxt ./.nuxt
COPY static ./static
# Install runtime dependencies
RUN yarn install --production --no-lockfile
RUN npm ci --production --no-audit
RUN rm -rf package-lock.json
EXPOSE 80
CMD [ "yarn", "start" ]
CMD [ "npm", "start" ]
+20 -18
View File
@@ -19,25 +19,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build
run: yarn build
run: npm run build
static:
name: Build static
@@ -51,22 +52,23 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build
run: 'yarn build:static'
run: 'npm run build:static'
+22 -20
View File
@@ -19,25 +19,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build client
run: yarn build --production --standalone
run: npm run build --production --standalone
- name: Configure QEMU
uses: docker/setup-qemu-action@v1
@@ -52,7 +53,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -102,25 +103,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build client
run: 'yarn build:static'
run: 'npm run build:static'
- name: Configure QEMU
uses: docker/setup-qemu-action@v1
@@ -135,7 +137,7 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
+20 -18
View File
@@ -26,25 +26,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build client
run: yarn build --production --standalone
run: npm run build --production --standalone
- name: Configure QEMU
uses: docker/setup-qemu-action@v1
@@ -100,25 +101,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Build client
run: 'yarn build:static'
run: 'npm run build:static'
- name: Configure QEMU
uses: docker/setup-qemu-action@v1
+20 -18
View File
@@ -22,25 +22,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Run linter
run: yarn lint
run: npm run lint
test:
name: Test
@@ -56,25 +57,26 @@ jobs:
uses: actions/setup-node@v2.1.5
with:
node-version: 14
check-latest: true
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm config get cacheectory 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: yarn-cache
id: npm-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-npm-
- name: Install dependencies
run: yarn install --frozen-lockfile
run: npm ci --no-audit
- name: Run tests
run: yarn test
run: npm run test
- name: Upload coverage
uses: codecov/codecov-action@v1
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname $0)/_/husky.sh"
yarn commitlint --edit
npm commitlint --edit
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged
npm lint-staged
-5
View File
@@ -1,5 +0,0 @@
enableTelemetry false
httpRetry 20
network-timeout 600000
registry "https://registry.npmjs.org/"
npmRegistryServer "https://registry.npmjs.org/"
+6 -5
View File
@@ -10,26 +10,27 @@ RUN apk add --no-cache --virtual .build-deps git python make automake autoconf g
COPY . .
# Install dependencies
RUN yarn install --frozen-lockfile
RUN npm ci --no-audit
# Build SSR app for production in standalone mode
RUN yarn build --production --standalone
RUN npm run build --production --standalone
# Build final image
FROM node:14-alpine
WORKDIR /app
COPY .docker/package.json .docker/nuxt.config.js ./
COPY .docker/package.json .docker/package-lock.json .docker/nuxt.config.js ./
# Copy client files from the build image
COPY --from=build /app/.nuxt ./.nuxt
COPY --from=build /app/static ./static
# Install runtime dependencies
RUN yarn install --production --no-lockfile
RUN npm ci --production --no-audit
RUN rm -rf package-lock.json
EXPOSE 80
CMD [ "yarn", "start" ]
CMD [ "npm", "start" ]
+2 -2
View File
@@ -12,10 +12,10 @@ WORKDIR /app
COPY . .
# Install dependencies
RUN yarn install --frozen-lockfile
RUN npm ci --no-audit
# Build static site
RUN yarn build:static
RUN npm run build:static
# Deploy built distribution to nginx
FROM nginx:alpine
+18 -11
View File
@@ -41,7 +41,7 @@ This is an experimental web client for Jellyfin based on Vue.js. We welcome all
## Requirements
This project uses [Yarn](https://yarnpkg.com/getting-started/install) as a package manager.
This project uses [npm](https://docs.npmjs.com/getting-started) as a package manager.
## Contributing
@@ -63,21 +63,28 @@ Jellyfin >=10.7.0
```bash
# install dependencies
$ yarn install
$ npm install
# server with hot reload at localhost:3000
$ yarn dev
$ npm run dev
# serve with hot reload in static mode at localhost:3000
$ yarn dev:static
$ npm run dev:static
# build for production
$ npm run build
# launch server
$ npm run start
# build for production and launch server
$ yarn build
$ yarn start
$ npm run prod
# build for production in static mode
# you will need a web server to host the client
$ yarn build:static
$ npm run build:static
# build for production in static mode and run server
$ npm run prod:static
```
@@ -87,10 +94,10 @@ When using the SSR version of the client, you can run the client in standalone m
```bash
# install dependencies
$ yarn install
$ npm install
# build for production in standalone mode, with server-side rendering
$ yarn build --standalone
$ npm run build --standalone
# move the server and required files to a dedicated directory
$ mkdir -p /opt/jellyfin-vue
@@ -98,6 +105,6 @@ $ cp .nuxt .docker/nuxt.config.js .docker/package.json /opt/jellyfin-vue
# install the required dependency and start the client
$ cd /opt/jellyfin-vue
$ yarn install
$ yarn start
$ npm install
$ npm run start
```
+26701
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -8,12 +8,14 @@
"dev:static": "nuxt",
"build": "NUXT_SSR=1 nuxt build",
"build:static": "nuxt build",
"prod": "npm run build && npm run start",
"prod:static": "npm run build:static && npm run start:static",
"start": "NUXT_SSR=1 nuxt start",
"start:static": "nuxt start",
"generate": "nuxt generate",
"lint:js": "eslint --ext .ts,.js,.json,.vue .",
"lint:style": "stylelint **/*.{vue,css} --ignore-path .gitignore",
"lint": "yarn lint:js && yarn lint:style",
"lint": "npm run lint:js && npm run lint:style",
"test": "jest",
"prepare": "husky install"
},
@@ -124,5 +126,8 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"engines": {
"yarn": "YARN NO LONGER USED - use npm instead."
}
}
-14700
View File
File diff suppressed because it is too large Load Diff