-
Notifications
You must be signed in to change notification settings - Fork 38
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
Switch to pnpm #1071
Switch to pnpm #1071
Conversation
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8.x | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've replicated the set-up of other front-end projects, but maybe there's a better way to install it in MXCuBE. 🤷
@@ -156,55 +157,51 @@ pip install -e . | |||
pip install -e . | |||
``` | |||
|
|||
The above makes it possible to add break points directly in the "checked out code". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repeats what is said before the commands block.
@@ -156,55 +157,51 @@ pip install -e . | |||
pip install -e . | |||
``` | |||
|
|||
The above makes it possible to add break points directly in the "checked out code". | |||
|
|||
Before running any test, make sure that the local *Redis* server is running. For example with the `mxcubeweb` *conda* environment activated in a terminal, run the `redis-server` command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to next section.
conda activate mxcubeweb | ||
mxcubeweb-server -r $(pwd)/mxcubeweb/test/HardwareObjectsMockup.xml/ --static-folder $(pwd)/mxcubeweb/ui/build/ -L debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point, we're already in the mxcubeweb
folder (there's a cd mxcubeweb
somewhere above).
pnpm start | ||
|
||
# Note that you can also run any pnpm script from the root folder with: | ||
pnpm --prefix ui <script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought it'd be a good place to explain this.
ui/README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default README
of create-react-app; I don't think it's needed.
"ws": "^8.5.0" | ||
}, | ||
"devDependencies": { | ||
"@fortawesome/fontawesome-free": "^5.15.4", | ||
"@testing-library/cypress": "9.0.0", | ||
"@testing-library/cypress": "10.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upgrading Cypress Testing Library to fix the peer dep issue, while I'm at it.
"@testing-library/jest-dom": "^5.16.2", | ||
"@testing-library/react": "^12.1.2", | ||
"@testing-library/user-event": "^13.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to devDependencies
along with a few others.
"@testing-library/jest-dom": "^5.16.2", | ||
"@testing-library/react": "^12.1.2", | ||
"@testing-library/user-event": "^13.5.0", | ||
"babel-preset-react-app": "10.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing dep required for ESLint (and our linting config) to work properly when installed with pnpm
"less": "^4.1.2", | ||
"less-watch-compiler": "^1.16.3", | ||
"prettier": "3.0.0" | ||
"prettier": "3.0.0", | ||
"prop-types": "15.8.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prop-types
was missing
Very nice :) |
.. awesome actually :) |
https://pnpm.io
Lots of benefits to pnpm:
node_modules
when working on multiple projects, since packages are symbolically linked to a global storenode_modules
folder is structured in such a way that a package can only "see" dependencies that it depends on explicitly. In our case, theprop-types
package, while used in the codebase, was not actually installed as a direct dev dependency. Phantom dependencies can cause more complicated issues when various (sub-)dependencies dependent on multiple versions of the same package.pnpm
property inpackage.json
. No more--legacy-peer-deps
, ever.Comments incoming, as always.