Skip to content

Commit

Permalink
Migrate to node 16, npm 7. (#3773)
Browse files Browse the repository at this point in the history
* Migrate to node 16 and nmp 7.

* Step 2

* Moving eslint to one package.json

* Fix package for 3D

* Update package files

* Fix package.json. Update package-lock.json. Update DockeFile.ui

* Change "node-sass" to "sass" due to snyk issues

* Automatically update your stylesheets due to DEPRECATION WARNING from sass

* Moving all dev dependencies to root package.json

* Remove unnecessary dependence from cvat-core-package.json

* Update of the year in copyrights

* Update CHANGELOG.md

* Define workspaces

* Update npm command to root package.json

* Update npm commands and corresponding files

* Update npm command.

* Fix Dockerfile.ui

* Fix error loading rule '@typescript-eslint/dot-notation'

* Fix eslint check issue

Co-authored-by: Boris Sekachev <boris.sekachev@intel.com>
  • Loading branch information
dvkruchinin and Boris Sekachev committed Oct 14, 2021
1 parent 8fea507 commit e484aa7
Show file tree
Hide file tree
Showing 34 changed files with 66,655 additions and 109,518 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'

- name: Run checks
run: |
Expand All @@ -21,10 +21,8 @@ jobs:
done
if [[ ! -z ${changed_files_eslint} ]]; then
for package_files in `find -maxdepth 2 -name "package.json" -type f`; do
cd $(dirname $package_files) && npm ci && cd ${{ github.workspace }}
done
npm install eslint-detailed-reporter --save-dev
npm ci
npm install eslint-detailed-reporter --save-dev --legacy-peer-deps
mkdir -p eslint_report
echo "ESLint version: "`npx eslint --version`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'

- name: Install npm packages
working-directory: ./site
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
key: ${{ runner.os }}-build-ui-${{ steps.get-sha.outputs.sha }}
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1.1.2
- name: Building CVAT server image
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'
- name: Run end-to-end tests
env:
DJANGO_SU_NAME: 'admin'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'

- name: Run checks
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'
- name: Build CVAT
env:
DJANGO_SU_NAME: "admin"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stylelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
node-version: '16.x'

- name: Run checks
run: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- UI tracking has been reworked (<https://github.com/openvinotoolkit/cvat/pull/3571>)
- Manifest generation: Reduce creating time (<https://github.com/openvinotoolkit/cvat/pull/3712>)
- Migration from NPM 6 to NPM 7 (<https://github.com/openvinotoolkit/cvat/pull/3773>)

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get update && \
&& \
curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \
curl https://deb.nodesource.com/setup_12.x | bash - && \
curl https://deb.nodesource.com/setup_16.x | bash - && \
DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends install -yq \
google-chrome-stable \
nodejs \
Expand Down
27 changes: 6 additions & 21 deletions Dockerfile.ui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:lts-buster AS cvat-ui
FROM node:stretch AS cvat-ui

ARG http_proxy
ARG https_proxy
Expand All @@ -16,39 +16,24 @@ ENV TERM=xterm \
LC_ALL='C.UTF-8'

# Install dependencies
COPY package*.json /tmp/
COPY cvat-core/package*.json /tmp/cvat-core/
COPY cvat-canvas/package*.json /tmp/cvat-canvas/
COPY cvat-canvas3d/package*.json /tmp/cvat-canvas3d/
COPY cvat-ui/package*.json /tmp/cvat-ui/
COPY cvat-data/package*.json /tmp/cvat-data/

# Install cvat-data dependencies
WORKDIR /tmp/cvat-data/
RUN npm ci

# Install cvat-core dependencies
WORKDIR /tmp/cvat-core/
RUN npm ci

# Install cvat-canvas dependencies
WORKDIR /tmp/cvat-canvas/
RUN npm ci

# Install cvat-canvas dependencies
WORKDIR /tmp/cvat-canvas3d/
RUN npm ci

# Install cvat-ui dependencies
WORKDIR /tmp/cvat-ui/
RUN npm ci
# Install common dependencies
WORKDIR /tmp/
RUN npm ci --ignore-scripts

# Build source code
COPY cvat-data/ /tmp/cvat-data/
COPY cvat-core/ /tmp/cvat-core/
COPY cvat-canvas3d/ /tmp/cvat-canvas3d/
COPY cvat-canvas/ /tmp/cvat-canvas/
COPY cvat-ui/ /tmp/cvat-ui/
RUN npm run build
RUN npm run build:cvat-ui

FROM nginx:mainline-alpine
# Replace default.conf configuration to remove unnecessary rules
Expand Down
5 changes: 4 additions & 1 deletion cvat-canvas/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2019-2020 Intel Corporation
// Copyright (C) 2019-2021 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -9,6 +9,8 @@ module.exports = {
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 6,
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'import'],
extends: [
Expand All @@ -18,6 +20,7 @@ module.exports = {
'plugin:import/warnings',
'plugin:import/typescript',
],
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/indent': ['warn', 4],
Expand Down
Loading

0 comments on commit e484aa7

Please sign in to comment.