add support node 17

This commit is contained in:
konstantin krivlenia
2022-02-13 23:33:41 -06:00
committed by Umputun
parent b5f34b8777
commit 188e3974bc
6 changed files with 21844 additions and 1168 deletions
+5 -5
View File
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.15]
node: [16.13.2]
steps:
- uses: actions/checkout@v2
@@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.15]
node: [16.13.2]
steps:
- uses: actions/checkout@v2
@@ -69,7 +69,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.15]
node: [16.13.2]
steps:
- uses: actions/checkout@v2
@@ -80,14 +80,14 @@ jobs:
- run: npm ci --loglevel warn
working-directory: ./frontend
- run: npx run-p lint
- run: npm run lint
working-directory: ./frontend
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [14.15]
node: [16.13.2]
steps:
- uses: actions/checkout@v2
+3 -3
View File
@@ -30,7 +30,7 @@ RUN \
echo "version=$version" && \
go build -o remark42 -ldflags "-X main.revision=${version} -s -w" ./app
FROM --platform=$BUILDPLATFORM node:12.16-alpine as build-frontend-deps
FROM --platform=$BUILDPLATFORM node:16.13.2-alpine as build-frontend-deps
ARG CI
ENV HUSKY_SKIP_INSTALL=true
@@ -40,7 +40,7 @@ ADD frontend/package.json /srv/frontend/package.json
ADD frontend/package-lock.json /srv/frontend/package-lock.json
RUN cd /srv/frontend && CI=true npm ci --loglevel warn
FROM --platform=$BUILDPLATFORM node:12.16-alpine as build-frontend
FROM --platform=$BUILDPLATFORM node:16.13.2-alpine as build-frontend
ARG CI
ARG SKIP_FRONTEND_TEST
@@ -49,7 +49,7 @@ ARG NODE_ENV=production
COPY --from=build-frontend-deps /srv/frontend/node_modules /srv/frontend/node_modules
ADD frontend /srv/frontend
RUN cd /srv/frontend && \
if [ -z "$SKIP_FRONTEND_TEST" ] ; then npx run-p lint test check; \
if [ -z "$SKIP_FRONTEND_TEST" ] ; then npm run lint test check; \
else echo "skip frontend tests and lint" ; npm run build ; fi && \
rm -rf ./node_modules
+21806 -1142
View File
File diff suppressed because it is too large Load Diff
+8 -8
View File
@@ -22,8 +22,8 @@
"translation:check": "node ./tasks/checkTranslation.js"
},
"engines": {
"node": ">=12.11",
"npm": ">=6.13.4"
"node": ">=16.13.0 <=17.*",
"npm": ">=8.1.0 <=8.*"
},
"dependencies": {
"@github/markdown-toolbar-element": "^1.5.1",
@@ -61,11 +61,11 @@
"@typescript-eslint/eslint-plugin": "^4.22.1",
"@typescript-eslint/parser": "^4.22.1",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"babel-loader": "^8.2.3",
"clean-webpack-plugin": "^3.0.0",
"codecov": "^3.8.2",
"cross-env": "^7.0.3",
"css-loader": "^5.2.4",
"css-loader": "^6.6.0",
"css-minimizer-webpack-plugin": "^3.0.2",
"cssnano": "^5.0.2",
"dotenv": "^9.0.0",
@@ -112,9 +112,9 @@
"tsconfig-paths-webpack-plugin": "^3.5.1",
"typescript": "^4.2.4",
"url-loader": "^4.1.1",
"webpack": "^5.36.2",
"webpack-bundle-analyzer": "^4.4.1",
"webpack-cli": "^4.7.0",
"webpack-dev-server": "^3.11.2"
"webpack": "^5.68.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^4.7.4"
}
}
+20 -8
View File
@@ -17,7 +17,7 @@ const NODE_ID = 'remark42';
const PUBLIC_PATH = '/web/';
const PORT = process.env.PORT || 9000;
const REMARK_API_BASE_URL = process.env.REMARK_API_BASE_URL || 'http://127.0.0.1:8080';
const DEVSERVER_BASE_PATH = process.env.DEVSERVER_BASE_PATH || 'http://127.0.0.1:9000';
const DEVSERVER_BASE_PATH = process.env.DEVSERVER_BASE_PATH || `http://127.0.0.1:${PORT}`;
const PUBLIC_FOLDER_PATH = path.resolve(__dirname, 'public');
const CUSTOM_PROPERTIES_PATH = path.resolve(__dirname, './app/styles/custom-properties.css');
@@ -204,13 +204,25 @@ module.exports = (_, { mode, analyze }) => {
const devServer = {
port: PORT,
contentBase: PUBLIC_FOLDER_PATH,
disableHostCheck: true,
hot: true,
stats: 'minimal',
watchOptions: {
ignored: [PUBLIC_FOLDER_PATH, path.resolve(__dirname, 'node_modules')],
devMiddleware: {
stats: 'minimal',
},
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
},
static: {
staticOptions: {
contentBase: PUBLIC_FOLDER_PATH,
watchOptions: {
ignored: [PUBLIC_FOLDER_PATH, path.resolve(__dirname, 'node_modules')],
},
},
watch: true,
},
allowedHosts: 'all',
hot: true,
proxy: [
{ path: '/api', target: REMARK_API_BASE_URL, changeOrigin: true },
{ path: '/auth', target: REMARK_API_BASE_URL, changeOrigin: true },
@@ -218,7 +230,7 @@ module.exports = (_, { mode, analyze }) => {
};
const plugins = [
...(isDev ? [new CleanWebpackPlugin(), new webpack.HotModuleReplacementPlugin(), new RefreshPlugin()] : []),
...(isDev ? [new CleanWebpackPlugin(), new RefreshPlugin()] : []),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(mode),
'process.env.REMARK_NODE': JSON.stringify(NODE_ID),
@@ -8,8 +8,8 @@ title: Frontend Development Guidelines
You must have at least 2GB RAM or swap enabled for building.
- install [Node.js 12.22](https://nodejs.org/en/) or higher
- install [NPM 6.14.16](https://www.npmjs.com/package/npm)
- install [Node.js 16.13.0](https://nodejs.org/en/) or higher
- install [NPM 8.1.0](https://www.npmjs.com/package/npm)
- run `npm install` inside `./frontend`
Running `npm install` will set up pre-commit hooks into your git repository. They are used to reformat your frontend code using `prettier` and lint with `eslint` and `stylelint` before every commit.