1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-08-16 21:50:33 +03:00

refactor: prerequisites Node.js >= 16.0.0 and npm >= 8.0.0 (#322)

BREAKING CHANGE: minimum supported Node.js v16.0.0 and npm v8.0.0
This commit is contained in:
Divlo 2021-11-07 03:24:00 +01:00 committed by GitHub
parent cf6d7d0749
commit 2f66f1c17b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21317 additions and 3568 deletions

View File

@ -8,27 +8,27 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x
- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
node-version: 16.x
cache: npm
- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv
- name: Install
run: npm ci
run: npm install
- name: Check setup
run: npm run check

View File

@ -8,27 +8,27 @@ on:
jobs:
lint:
runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x
- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
node-version: 16.x
cache: npm
- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv
- name: Install
run: npm ci
run: npm install
- name: Run linter
run: npm run lint

View File

@ -8,27 +8,27 @@ on:
jobs:
tests:
runs-on: ubuntu-20.04
container: leonai/ci:latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node_modules
uses: actions/cache@v2
- name: Use Python
uses: actions/setup-python@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
restore-keys: ${{ runner.os }}-npm-
- name: Cache Pipenv
uses: actions/cache@v2
python-version: 3.x
- name: Use Node.js
uses: actions/setup-node@v2
with:
path: ./bridges/python/.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install npm dependencies
run: npm ci
node-version: 16.x
cache: npm
- name: Install Pipenv
run: pip install --upgrade pip && pip install pipenv
- name: Install
run: npm install
- name: Run JSON tests
run: npm run test:json

View File

@ -1,25 +1,20 @@
FROM node:14-alpine
FROM node:16-alpine
ENV IS_DOCKER true
WORKDIR /app
# Install system packages
RUN apk add --no-cache --no-progress \
ca-certificates \
python3 \
git \
tzdata
ca-certificates \
py3-pip \
git \
tzdata
# Upgrade pip and install Pipenv
RUN pip3 install --no-cache-dir --progress-bar off pipenv
# Install Leon
# Need to explicitly run the npm preinstall and npm posinstall scripts (not needed with npm@7)
# because npm tries to downgrade its privileges, and these scripts are not executed
COPY ./package*.json ./
RUN npm clean-install
COPY ./ ./
RUN npm run preinstall
RUN npm run postinstall
RUN npm install
RUN npm run build
CMD ["npm", "start"]

View File

@ -75,8 +75,8 @@ Gitpod will automatically setup an environment and run an instance for you.
### Prerequisites
- [Node.js](https://nodejs.org/) >= 14
- [npm](https://npmjs.com/) >= 5
- [Node.js](https://nodejs.org/) >= 16
- [npm](https://npmjs.com/) >= 8
- [Python](https://www.python.org/downloads/) >= 3
- [Pipenv](https://docs.pipenv.org) >= 2020.11.15
- Supported OSes: Linux, macOS and Windows

24766
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,8 +17,8 @@
"url": "https://github.com/leon-ai/leon/issues"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=5.0.0"
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"scripts": {
"lint": "babel-node scripts/lint.js",
@ -80,10 +80,10 @@
"superagent": "^6.1.0"
},
"devDependencies": {
"@babel/cli": "^7.14.3",
"@babel/core": "^7.13.8",
"@babel/node": "^7.14.2",
"@babel/preset-env": "^7.14.5",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/node": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"babel-plugin-module-resolver": "^4.1.0",
"cli-spinner": "^0.2.10",
"eslint": "^7.28.0",