Skip to content

Commit

Permalink
feat(build): fix build after upgrading a bunch of dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Dec 17, 2021
1 parent 384e424 commit 60cdbbb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Expand Up @@ -3,5 +3,5 @@
"buildCommand": false,
"packages": ["packages/*"],
"sandboxes": ["/examples/codesandbox", "/website"],
"node": "14"
"node": "16"
}
6 changes: 5 additions & 1 deletion babel.config.js
@@ -1,3 +1,7 @@
module.exports = {
presets: [['react-app', { runtime: 'automatic', typescript: true }]],
presets: [
["@babel/preset-env", { loose: true }],
"@babel/preset-react",
"@babel/preset-typescript",
],
}
6 changes: 4 additions & 2 deletions conf/rollup.config.js
Expand Up @@ -6,15 +6,16 @@ import stripBanner from 'rollup-plugin-strip-banner'
import cleanup from 'rollup-plugin-cleanup'
import size from 'rollup-plugin-size'
import visualizer from 'rollup-plugin-visualizer'
import { terser } from "rollup-plugin-terser"

const pkg = process.env.PACKAGE
const isWatching = process.env.ROLLUP_WATCH === 'TRUE'

const extensions = ['.js', '.jsx', '.es6', '.es', '.mjs', '.ts', '.tsx']
const babelConfig = {
extensions,
exclude: 'node_modules/**',
babelHelpers: 'runtime',
exclude: /node_modules/,
babelHelpers: 'bundled',
comments: false,
plugins: ['lodash'],
}
Expand Down Expand Up @@ -63,6 +64,7 @@ const commonPlugins = [
modulesOnly: true,
}),
babel(babelConfig),
!isWatching && terser(),
cleanup()
]

Expand Down
9 changes: 3 additions & 6 deletions package.json
Expand Up @@ -16,7 +16,7 @@
"url": "https://github.com/plouc"
},
"keywords": [],
"devDependencies": {
"dependencies": {
"@babel/core": "^7.16.5",
"@ekino/config": "^0.3.0",
"@nivo/generators": "*",
Expand All @@ -43,7 +43,6 @@
"babel-jest": "^24.9.0",
"babel-loader": "^8.2.3",
"babel-plugin-lodash": "^3.3.4",
"babel-preset-react-app": "^10.0.1",
"chalk": "^2.4.2",
"core-js": "^3.19.3",
"enzyme": "^3.11.0",
Expand All @@ -61,6 +60,7 @@
"jsdom": "^16.2.2",
"lerna": "^3.22.1",
"lodash": "^4.17.21",
"npm-normalize-package-bin": "^1.0.1",
"prettier": "^2.5.1",
"prop-types": "^15.7.2",
"puppeteer": "^0.13.0",
Expand All @@ -73,6 +73,7 @@
"rollup-plugin-prettier": "^2.2.0",
"rollup-plugin-size": "^0.2.2",
"rollup-plugin-strip-banner": "^2.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-visualizer": "^5.5.2",
"serve": "^13.0.2",
"typescript": "^4.5.4"
Expand All @@ -95,10 +96,6 @@
"api",
"website"
],
"dependencies": {
"npm-normalize-package-bin": "^1.0.1",
"rollup-plugin-terser": "^7.0.2"
},
"engines": {
"node": "16.x"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/network/src/NetworkCanvas.js
Expand Up @@ -129,7 +129,7 @@ const NetworkCanvas = props => {
])

const getNodeFromMouseEvent = useCallback(
(event: MouseEvent) => {
(event) => {
if (!canvasEl.current) return null

const [x, y] = getRelativeCursor(canvasEl.current, event)
Expand All @@ -150,7 +150,7 @@ const NetworkCanvas = props => {
const { showTooltipFromEvent, hideTooltip } = useTooltip()

const handleMouseHover = useCallback(
(event: React.MouseEvent<HTMLCanvasElement>) => {
(event) => {
const node = getNodeFromMouseEvent(event)
if (node) {
showTooltipFromEvent(<NetworkNodeTooltip node={node} tooltip={tooltip} />, event)
Expand All @@ -166,7 +166,7 @@ const NetworkCanvas = props => {
}, [hideTooltip])

const handleClick = useCallback(
(event: React.MouseEvent<HTMLCanvasElement>) => {
(event) => {
if (!onClick) return

const node = getNodeFromMouseEvent(event)
Expand Down
9 changes: 5 additions & 4 deletions tsconfig.json
Expand Up @@ -3,8 +3,10 @@
"esModuleInterop": true,
"isolatedModules": true,
"jsx": "react-jsx",
"lib": ["ESNext", "dom"],
"target": "es5",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"target": "ES2020",
"module": "ES2020",
"moduleResolution": "node",
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": false,
Expand All @@ -15,8 +17,7 @@
"strict": true,
"allowJs": true,
"composite": true,
"declarationMap": true,
"moduleResolution": "node"
"declarationMap": true
},
"include": ["./packages/*/index.d.ts"]
}
23 changes: 0 additions & 23 deletions tslint.json

This file was deleted.

0 comments on commit 60cdbbb

Please sign in to comment.