Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@storybook/core-server
Advanced tools
The @storybook/core-server npm package is part of the Storybook ecosystem, which is a tool for developing UI components in isolation for React, Vue, Angular, and more. It allows developers to serve and manage Storybook instances in a Node.js environment. With this package, you can start a Storybook server, build a static version of Storybook for deployment, and customize various aspects of the Storybook instance.
Starting a Storybook server
This code sample demonstrates how to start a Storybook server on port 6006 using the configuration from the '.storybook' directory.
const { buildDevStandalone } = require('@storybook/core-server');
buildDevStandalone({
port: 6006,
configDir: './.storybook'
}).catch(error => {
console.error(error);
process.exit(1);
});
Building a static Storybook
This code sample shows how to build a static version of Storybook that can be deployed to a web server. The output will be placed in the 'storybook-static' directory.
const { buildStatic } = require('@storybook/core-server');
buildStatic({
staticDir: './public',
configDir: './.storybook',
outputDir: './storybook-static'
}).catch(error => {
console.error(error);
process.exit(1);
});
Customizing Storybook's Webpack configuration
This code sample is typically placed in a '.storybook/main.js' file and demonstrates how to customize Storybook's Webpack configuration using the 'webpackFinal' method.
module.exports = {
stories: ['../src/**/*.stories.js'],
addons: ['@storybook/addon-actions', '@storybook/addon-links'],
webpackFinal: async (config, { configType }) => {
// Modify or return the webpack config.
return config;
}
};
React Cosmos is a development tool for creating reusable React components. It allows developers to render components with different props and states, similar to Storybook. However, React Cosmos focuses specifically on React and does not support other frameworks.
Docz leverages MDX to help you document your things with a focus on writing and design. It's similar to Storybook in that it provides a UI for showcasing components, but it uses MDX as the primary format for stories and documentation.
This package contains common node-side functionality used among the different frameworks (React, RN, Vue, Ember, Angular, etc).
It contains:
start-storybook
dev serverbuild-storybook
static builderThe "preview" (aka iframe) side is implemented in pluggable builders:
@storybook/builder-webpack4
@storybook/builder-webpack5
These builders abstract both the webpack dependencies as well as the various core configurations and loader/plugin dependencies provided out of the box with Storybook.
FAQs
Storybook framework-agnostic API
The npm package @storybook/core-server receives a total of 2,975,305 weekly downloads. As such, @storybook/core-server popularity was classified as popular.
We found that @storybook/core-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 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
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.