Skip to content

Commit

Permalink
Merge pull request #74 from bcgsc/chore/KBDEV-1095-package-updates
Browse files Browse the repository at this point in the history
[KBDEV-1095] package updates
  • Loading branch information
elewis2 authored May 2, 2024
2 parents f711158 + 987d04d commit 30f20f7
Show file tree
Hide file tree
Showing 36 changed files with 10,150 additions and 14,376 deletions.
31 changes: 0 additions & 31 deletions .babelrc

This file was deleted.

2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@
"react/function-component-definition": "off",
"react/jsx-no-constructed-context-values": "off",
"react/jsx-no-useless-fragment": "off",
// Default props deprecated in React v16, to be removed v18
"react/require-default-props": "off",
"jest/no-conditional-expect": "off",
"max-classes-per-file": "off",
"no-mixed-operators": "off",
Expand Down
31 changes: 31 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
loose: false,
targets: {
node: 'current',
},
},
],
'@babel/preset-typescript',
'@babel/preset-react',
],
plugins: [
'@babel/plugin-transform-runtime',
['@babel/plugin-proposal-decorators',
{ legacy: true }
],
'@babel/plugin-transform-class-properties',
],
env: {
test: {
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
},
local: {
presets: ['@babel/preset-env', '@babel/preset-typescript', '@babel/preset-react'],
},
},
};
7 changes: 5 additions & 2 deletions config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
const path = require('path');

const BASE_DIR = path.resolve(__dirname, '..');
const libsToConvert = [
'd3-force', 'd3-drag', 'd3-selection', 'd3-zoom', 'd3-interpolate', 'd3-color', 'd3-ease', 'ag-grid-community'
].join("|");


module.exports = {
rootDir: BASE_DIR,
Expand Down Expand Up @@ -38,12 +42,11 @@ module.exports = {
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx|mjs|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.js$': 'babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|mjs|css|json|ts|tsx)$)': '<rootDir>/config/jest/fileTransform.js',
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs)$',
`<rootDir>/node_modules/(?!(${libsToConvert})/)`,
],
moduleNameMapper: {
'@/(.*)$': '<rootDir>/src/$1',
Expand Down
9 changes: 9 additions & 0 deletions config/webpack/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ const createBaseConfig = ({
// Don't precache sourcemaps (they're large) and build asset manifest:
exclude: [/\.map$/, /asset-manifest\.json$/],
}),
new webpack.ProvidePlugin({
// Make a global `process` variable that points to the `process` package,
// because the `util` package expects there to be a global variable named `process`.
// Thanks to https://stackoverflow.com/a/65018686/14239942
process: 'process/browser'
})
];


Expand Down Expand Up @@ -216,6 +222,9 @@ const createBaseConfig = ({
alias: {
'@': SRC_PATH,
},
fallback: {
"util": require.resolve("util/")
}
},
module: moduleSettings,

Expand Down
Loading

0 comments on commit 30f20f7

Please sign in to comment.