
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
pollination-viewer
Advanced tools
Pollination component library using Rollup, TypeScript, Sass and Storybook
React component library using:
Created using this excellent resource▸
Minimal tests have been written for the components in this library.
npm run test
npm run build
To run a live-reload Storybook server on your local machine:
npm run storybook
To export your Storybook as static files:
npm run storybook:export
You can then serve the files under storybook-static using S3, GitHub pages, Express etc.
npm run generate YourComponentName
This will generate:
/src
/components
/YourComponentName
YourComponentName.tsx
YourComponentName.stories.tsx
YourComponentName.test.tsx
YourComponentName.types.ts
YourComponentName.scss
The default templates for each file can be modified under util/templates.
Don't forget to add the component to your index.ts exports if you want the library to export the component!
This component library can be installed using npm link.
If you are getting errors like Invalid Hook Call Warning you may need to add the following to your webpack.config:
resolve: {
alias: {
"react/jsx-dev-runtime": "react/jsx-dev-runtime",
"react/jsx-runtime": "react/jsx-runtime",
"react": "react"
}
}
Check ../solo-viewer/config-overrides.js for how we solved this problem in an (unejected) create-react-app.
First, make sure you have an NPM account and are logged into NPM using the npm login command.
Then update the name field in package.json to reflect your NPM package name in your private or public NPM registry. Then run:
npm publish
The "prepublishOnly": "npm run build" script in package.json will execute before publish occurs, ensuring the build/ directory and the compiled component library exist.
Usage of the component (after the library installed as a dependency into another project) will be:
import React from "react";
import { TestComponent } from "lavender-vtkjs";
const App = () => (
<div className="app-container">
<h1>Hello I'm consuming the component library</h1>
<TestComponent theme="primary" />
</div>
);
export default App;
I've found that it's helpful to export SASS variables to projects consuming the library. As such, I've added the rollup-plugin-copy NPM package and used it to copy the src/typography.scss and variables.scss into the build directory as part of the Rollup bundle process. This allows you to use these variables in your projects consuming the component library.
For example, let's say you installed lavender-vtkjs into your project. To use the exported variables/mixins, in a SASS file you would do the following:
@import '~lavender-vtkjs/build/typography';
.example-container {
@include heading;
color: $vtkjs-white;
}
FAQs
Pollination component library using Rollup, TypeScript, Sass and Storybook
We found that pollination-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.