
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
storybook-addon-playground
Advanced tools
A playground to enable consumers learn how to use the component library or to reproduce bugs
Install dependencies and start
npm i
npm start
Go to localhost:6006
npm install -D storybook-addon-playground
On your .storybook/main.ts
file, add the following:
const config = {
...
addons: [
...
"storybook-addon-playground",
],
};
On your .storybook/preview.ts
file, add the following:
...
import MyComponentsLibrary from 'my-components-library';
import MyIconsLibrary from 'my-icons-library';
...
const preview = {
...
parameters: {
playground: {
// title of your story (including category prefix, if there is one)
storyId: "playground",
components: { ...MyComponentsLibrary, ...MyIconsLibrary },
editorTheme: "light", // optional - set this to override your storybook's theme
introCode: { jsx: `<div>Welcome to my Playground!</div>`, css: "" }, // optional - set this to introdoce a "welcome" code example
},
},
};
Create a story with the following content:
import { withPlayground } from "../../src/decorators";
export default {
title: "Playground",
decorators: [withPlayground],
};
export const Playground = {};
Vite is used to build the local Storybook for testing and dev purposes
Rollup is used to build the addon for publishing
graph TD;
subgraph ADDON
A{{Rollup}}
B[index.ts]
C[manager.ts]
D[Panel addon]
E[Tool addon]
F[withPlayground]
G[PlaygroundPreview]
H[react-live]
I[Editor]
J[useCopyToClipboard]
K[usePlaygroundArgs]
Q[useInitialCode]
R[useBroadcastEditorChanges]
S[usePlaygroundState]
T[useEditorTheme]
L[useToolbarActions]
M[prettier]
N[react-codemirror]
O[Toolbar icon]
P[Storybook Addon API]
A -->|Entry| B
A -->|Entry| C
B -->|Exports| F
P --> D
P --> E
E -->|Renders| O
C -->|Registers Addons| P
F -->|Renders in a story| G
G ======>|Using lib| H
D -->|Calls| Q
D -->|Calls| R
R -->|Uses| S
D --->|Renders| I
I ====>|Using lib| N
I -->|Uses| L
I -->|Uses| K
I -->|Uses| T
L ===>|Using lib| M
L -->|Uses| J
end
subgraph UI
X{{Vite}}
Z["Storybook UI (.storybook - Testing and Development)"]
X --> Z
end
FAQs
A playground to enable consumers learn how to use the component library or to reproduce bugs
The npm package storybook-addon-playground receives a total of 356 weekly downloads. As such, storybook-addon-playground popularity was classified as not popular.
We found that storybook-addon-playground demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.