Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@schrodinger/ui
Advanced tools
@schrodinger/ui
A React component library for Schrodinger.
Check out the Storybook on github-pages, under the Environments heading →
Components may be imported from the entire library or à la carte. Both ES6 modules and CommonJS are supported.
ES6 Modules
import { Dropdown } from '@schrodinger/ui'
import { Dropdown } from '@schrodinger/ui-dropdown'
CommmonJS
const Dropdown = require('@schrodinger/ui').Dropdown
const Dropdown = require('@schrodinger/ui-dropdown').Dropdown
The component organization philosophy used here is highly inspired by Brad Frost's Atomic Design, and is worth a read.
A Particle is the smallest individual building block that can be used to compose a component. Think of them as being similar to single html elements: an input, checkbox, heading, button, etc.
An Atom is a combination of Particles which represent a small and simple component. For example, you might combine an input, label, and button Particle to create a row in a form. Atoms should "do one thing, and do it well."
A molecule is a complex combination of Atoms to create more complex components. If a button and an input are Particles, a dropdown menu an Atom, then an entire would be a Molecule.
Storybook is where the primary development work should take place, and is a very straightforward process:
<@schrodinger/ui>/src/index
yarn deploy
to update the live storybook on github-pagesYou will likely at some point want to integrate library components into other external applications, before that component is published to the repo / npm. This is a little bit trickier, and there are two approaches suggested:
Take advantage of yarn workspaces, which is quite seamless and abstracts much of the work in maintaining dependency links. Essentially, you would simply need to add your external project to the workspace
entry, in the top-level package.json.
"workspaces": [
"packages/**/*",
"my-cra-project/"
],
Then you would just run:
lerna link
In order to symlink the repositories. Your project should now reflect any changes to components in the @schrodinger/ui library.
Alternatively, you can use Yalc if it is not feasible to colocate the consuming application within the UI Library directory. First you need to install yalc:
yarn global add yalc
Then "install" (symlink) the library (or individual component) with your project::
cd <path/to/my-cra-project>
yalc <add|link> @schrodinger/ui
yalc check
Note: yalc add
will modify your project's package.json to point to the local copy of the library / library component, which is useful when you are adding a new component into the library and it hasn't been published to the repo / npm yet. Conversely, yalc link
will not modify the package.json, but will simply use the local Yalc repository on your system to fetch the desired component or the library. This is useful when your project's package.json already contains the dependency (ie, editing an existing component in the library).
After making changes to a library component, the workflow for this looks like:
yarn build
cd <path/to/@schrodinger/ui>/packages/ui
yalc push # Will update all yalc'd packages on your system
FAQs
Schrodinger UI Library
We found that @schrodinger/ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.