Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Allow building with modern NodeJS #467

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
},
},
],
parser: "babel-eslint",
parser: "@babel/eslint-parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/npm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ jobs:
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Run `npm install`
run: npm install
node-version: '20.x'
- name: Run `npm ci`
# See the PR below for why `--legacy-peer-deps`` is needed.
# https://github.com/netdata/dashboard/pull/467
run: npm ci --legacy-peer-deps
- name: Run `npm test`
run: npm test
npm-lint:
Expand All @@ -28,8 +30,8 @@ jobs:
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Run `npm install`
run: npm install
node-version: '20.x'
- name: Run `npm ci`
run: npm ci --legacy-peer-deps
- name: Run `npm run lint`
run: npm run lint
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ jobs:
- name: 'Prepare Node.js'
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: 'Fetch Dependencies'
run: npm install
node-version: '20.x'
- name: Run `npm ci`
# See the PR below for why `--legacy-peer-deps`` is needed.
# https://github.com/netdata/dashboard/pull/467
run: npm ci --legacy-peer-deps
- name: 'Build Dashboard'
run: npm run build
- name: 'Prepare Tarball'
Expand Down
11 changes: 8 additions & 3 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const path = require("path")
const console = require("console")

// eslint-disable-next-line import/no-extraneous-dependencies
const HtmlWebpackPlugin = require("html-webpack-plugin")
Expand All @@ -14,15 +15,19 @@ module.exports = {
webpack: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-unused-vars
configure: (webpackConfig, { env, paths }) => {
const [parser, tsLoader, loadersObject, ...rules] = webpackConfig.module.rules
const [sourceMapLoaderOrFalse, loadersObject, ...rules] = webpackConfig.module.rules
console.assert(
sourceMapLoaderOrFalse == false ||
sourceMapLoaderOrFalse.loader === require.resolve('source-map-loader'),
"react-scripts' webpack config has changed, please update CRACO config.")

const { oneOf } = loadersObject
return {
...webpackConfig,
module: {
...webpackConfig.module,
rules: [
parser,
tsLoader,
sourceMapLoaderOrFalse,
{
oneOf: [
{
Expand Down
Loading