NCIOCPL / drug-dictionary-app

NCI Drug Dictionary Application
2 stars 0 forks source link

Upgrade to Node 20, Webpack 5, npm audit fixes #147

Open adriancofie opened 5 months ago

adriancofie commented 5 months ago

Description

This ticket is to upgrade the version of node to a supported version, update webpack, and resolve any moderate or above vulnerabilities related to this repository.

This should entail the following:

Update Node to the latest LTS v20 (lts/iron) Update Webpack to v5 Update any other required dependencies to resolve aforementioned security issues

Steps:

Node


- [ ]  Update `.nvmrc` to contain `lts/iron` and update the allowed version ins `package.json`

### Webpack et al.

- [ ] Extract the jest config from `package.json` to `jest.config.js`
Note: This allows for more modularity and lets us have dynamic paths

- [ ] Run the following:
  ```bash
      npm install webpack@latest --save-dev

npm uninstall eslint-loader babel-eslint
                fallback: {
                    "http": require.resolve("stream-http"),
                    "https": require.resolve('https-browserify'),
                    "buffer": require.resolve('buffer'),
                    "url": require.resolve("url"),
                },
                    Buffer: ['buffer', 'Buffer'],
                })

Import the new plugin

const ESLintPlugin = require('eslint-webpack-plugin');

Add the plugin to the plugin list in webpack.config.js

        plugins: [
            new ESLintPlugin( {
    extensions: [`js`, `jsx`, `cjs`,`mjs`,`ts`,`tsx`],
    exclude:[  `/node_modules/`, ...paths.appExcludeFromBuild],
    cache: true,
formatter: require.resolve('react-dev-utils/eslintFormatter'),
eslintPath: require.resolve('eslint'),
resolvePluginsRelativeTo: __dirname,
ignore: true,
useEslintrc: true,}),

Requirements:

In the commits comment take note of which packages were updated to a new major version, and any other pertinent information or steps taken to resolve issues encountered.

Acceptance Criteria:

All major and above node/NPM vulnerabilities are resolved. Node is at LTS v20 Webpack is at v5