Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with updating plugin library dependencies properly in Node 22+ #604

Open
dwertheimer opened this issue Dec 2, 2024 · 11 comments
Open
Assignees
Labels

Comments

@dwertheimer
Copy link
Collaborator

We have reached a point where our project dependencies will no longer load properly with a standard npm i. In order to get the modules to load with their dependencies, we have to enter npm i --legacy-peer-deps. This is obviously a band-aid and needs to be fixed. This is outside of my node/coding level expertise. @nmn or anyone else listed here, can you help upgrade the codebase?

@aaronpoweruser
Copy link
Collaborator

I'll take a look later this week

@dwertheimer
Copy link
Collaborator Author

Thanks @aaronpoweruser
FWIW, I am personally using node v22, which should be active for the next year. I think it would be fine to make that the base

@aaronpoweruser
Copy link
Collaborator

Result of npm outdated

(node:21902) ExperimentalWarning: CommonJS module /opt/homebrew/lib/node_modules/npm/node_modules/debug/src/node.js is loading ES Module /opt/homebrew/lib/node_modules/npm/node_modules/supports-color/index.js using require().
Support for loading ES Module in require() is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)
Package Current Wanted Latest Location Depended by
@babel/cli 7.21.0 7.25.9 7.25.9 node_modules/@babel/cli plugins
@babel/core 7.21.0 7.26.0 7.26.0 node_modules/@babel/core plugins
@babel/eslint-parser 7.19.1 7.25.9 7.25.9 node_modules/@babel/eslint-parser plugins
@babel/generator 7.21.1 7.26.2 7.26.2 node_modules/@babel/generator plugins
@babel/parser 7.21.2 7.26.2 7.26.2 node_modules/@babel/parser plugins
@babel/preset-env 7.20.2 7.26.0 7.26.0 node_modules/@babel/preset-env plugins
@babel/preset-flow 7.18.6 7.25.9 7.25.9 node_modules/@babel/preset-flow plugins
@babel/preset-react 7.18.6 7.25.9 7.25.9 node_modules/@babel/preset-react plugins
@codedungeon/gunner 0.77.0 0.77.0 0.80.1 node_modules/@codedungeon/gunner plugins
@rollup/plugin-alias 4.0.3 4.0.4 5.1.1 node_modules/@rollup/plugin-alias plugins
@rollup/plugin-babel 5.3.1 5.3.1 6.0.4 node_modules/@rollup/plugin-babel plugins
@rollup/plugin-commonjs 19.0.2 19.0.2 28.0.1 node_modules/@rollup/plugin-commonjs plugins
@rollup/plugin-json 4.1.0 4.1.0 6.1.0 node_modules/@rollup/plugin-json plugins
@rollup/plugin-node-resolve 13.0.4 13.0.4 15.3.0 node_modules/@rollup/plugin-node-resolve plugins
babel 6.23.0 6.23.0 5.8.38 node_modules/babel plugins
bcrypt 5.0.1 5.0.1 5.1.1 node_modules/bcrypt plugins
browserify 17.0.0 17.0.1 17.0.1 node_modules/browserify plugins
chroma-js 2.4.2 2.6.0 3.1.2 node_modules/chroma-js plugins
chrono-node 2.6.3 2.7.7 2.7.7 node_modules/chrono-node plugins
clipboardy 3.0.0 3.0.0 4.0.0 node_modules/clipboardy plugins
commander 8.3.0 8.3.0 12.1.0 node_modules/commander plugins
concurrently 6.5.1 6.5.1 9.1.0 node_modules/concurrently plugins
contentful-html-rich-text-converter 1.0.9 1.0.9 1.0.11 node_modules/contentful-html-rich-text-converter plugins
date-fns 2.29.3 2.30.0 4.1.0 node_modules/date-fns plugins
dayjs 1.10.6 1.10.6 1.11.13 node_modules/dayjs plugins
documentation 13.2.5 13.2.5 14.0.3 node_modules/documentation plugins
enquirer 2.3.6 2.4.1 2.4.1 node_modules/enquirer plugins
eslint 7.32.0 7.32.0 9.16.0 node_modules/eslint plugins
eslint-config-prettier 8.6.0 8.10.0 9.1.0 node_modules/eslint-config-prettier plugins
eslint-plugin-flowtype 5.10.0 5.10.0 8.0.3 node_modules/eslint-plugin-flowtype plugins
eslint-plugin-import 2.27.5 2.31.0 2.31.0 node_modules/eslint-plugin-import plugins
eslint-plugin-no-floating-promise 1.0.2 1.0.2 2.0.0 node_modules/eslint-plugin-no-floating-promise plugins
eslint-plugin-react 7.32.2 7.37.2 7.37.2 node_modules/eslint-plugin-react plugins
eslint-plugin-unused-imports 1.1.5 1.1.5 4.1.4 node_modules/eslint-plugin-unused-imports plugins
fast-glob 3.2.12 3.3.2 3.3.2 node_modules/fast-glob plugins
findup-sync 4.0.0 4.0.0 5.0.0 node_modules/findup-sync plugins
flow-bin 0.210.2 0.245.2 0.255.0 node_modules/flow-bin plugins
fsevents 2.3.2 2.3.3 2.3.3 node_modules/fsevents plugins
fuse.js 6.6.2 6.6.2 7.0.0 node_modules/fuse.js plugins
inquirer 8.2.5 8.2.6 12.1.0 node_modules/inquirer plugins
jest 27.5.1 27.5.1 29.7.0 node_modules/jest plugins
jest-silent-reporter 0.5.0 0.5.0 0.6.0 node_modules/jest-silent-reporter plugins
jest-spec-reporter 1.0.17 1.0.17 1.0.19 node_modules/jest-spec-reporter plugins
mathjs 11.6.0 11.12.0 14.0.0 node_modules/mathjs plugins
mermaid 10.1.0 10.9.3 11.4.1 node_modules/mermaid plugins
mkdirp 1.0.4 1.0.4 3.0.1 node_modules/mkdirp plugins
moment 2.29.1 2.29.1 2.30.1 node_modules/moment plugins
node-gyp 9.3.1 9.4.1 10.2.0 node_modules/node-gyp plugins
node-notifier 10.0.0 10.0.0 10.0.1 node_modules/node-notifier plugins
plotly.js-dist-min 2.32.0 2.35.2 2.35.2 node_modules/plotly.js-dist-min plugins
prettier 2.8.4 2.8.8 3.4.1 node_modules/prettier plugins
react 18.2.0 18.3.1 18.3.1 node_modules/react plugins
react-circular-progressbar MISSING 2.1.0 2.1.0 - plugins
react-data-table-component 7.5.3 7.6.2 7.6.2 node_modules/react-data-table-component plugins
react-day-picker 8.10.1 8.10.1 9.4.1 node_modules/react-day-picker plugins
react-dom 18.2.0 18.3.1 18.3.1 node_modules/react-dom plugins
react-error-boundary 4.0.13 4.1.2 4.1.2 node_modules/react-error-boundary plugins
react-loader-spinner 5.3.4 5.4.5 6.1.6 node_modules/react-loader-spinner plugins
react-select 5.7.0 5.8.3 5.8.3 node_modules/react-select plugins
rollup 2.79.1 2.79.2 4.28.0 node_modules/rollup plugins
rollup-plugin-visualizer 5.9.0 5.12.0 5.12.0 node_modules/rollup-plugin-visualizer plugins
rxjs 6.6.7 6.6.7 7.8.1 node_modules/rxjs plugins
showdown 1.9.1 1.9.1 2.1.0 node_modules/showdown plugins
sprintf-js 1.0.3 1.0.3 1.1.3 node_modules/sprintf-js plugins
strftime 0.10.0 0.10.0 0.10.3 node_modules/strftime plugins

@nmn
Copy link
Collaborator

nmn commented Dec 4, 2024

I can do this fairly quickly so I'll put up a PR. My question is if people would prefer switching to a different package manager for the repo?

Both pnpm and bun are significantly faster and generally more reliable. I recommend switching to bun for this repo instead of Node. Bun is essentially a drop-in replacement for Node but it uses the JavasrciptCore JS engine instead of V8. This is the same engine that Noteplan uses internally and so should work more reliably.

The counter-point is that Bun on Windows is somewhat new and it's another new thing for people to install.

@nmn
Copy link
Collaborator

nmn commented Dec 4, 2024

#606 created

@dwertheimer
Copy link
Collaborator Author

dwertheimer commented Dec 4, 2024 via email

@nmn
Copy link
Collaborator

nmn commented Dec 5, 2024

@dwertheimer I will try to do a big improvement to the setup sometime soon then. There should be fewer dependencies and everything should compile faster.

I also think it would be useful to switch from Flow to Typescript just because that is the industry standard now.

Anyway, if it's too much work, I'll bail!

@dwertheimer
Copy link
Collaborator Author

@nmn Thanks so much. This all looks good. The plugins all build and the tests all pass. Of course we don't have near 100% coverage, but it all seems good to merge when you are ready.

Fingers crossed on all of this!

@jgclark
Copy link
Collaborator

jgclark commented Dec 5, 2024

I've switched to node 22 and then npm i.
npc has stopped working, with this error:

Error: Cannot find module 'rollup-plugin-terser'
Require stack:
- /Users/jonathan/GitHub/NP-plugins/scripts/rollup.js
...

I've had a go at fixing this, but its saying its a deprecated package, and I'm beyond my limited understanding.
Anyway, I'd appreciate someone looking at this (@nmn ?) soonest, and certainly before the much bigger change I see brewing ... Thanks.

@nmn
Copy link
Collaborator

nmn commented Dec 5, 2024

@jgclark Go to /Users/jonathan/GitHub/NP-plugins/scripts/rollup.js and remove rollup-plugin-terser from the list of plugins being applied.

This dependency was removed because terser is a minifier but we never use it to actually minify the output.

@jgclark
Copy link
Collaborator

jgclark commented Dec 5, 2024

Thanks, @nmn. I'd not wanted to do that as I could see that the terser was being used in rollup.js. Anyway, with your encouragement I've commented that out, and it now builds and runs again. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants