Socket
Socket
Sign inDemoInstall

@storybook/core-server

Package Overview
Dependencies
371
Maintainers
9
Versions
968
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @storybook/core-server

Storybook framework-agnostic API


Version published
Maintainers
9
Install size
57.9 MB
Created

Package description

What is @storybook/core-server?

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.

What are @storybook/core-server's main functionalities?

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;
  }
};

Other packages similar to @storybook/core-server

Changelog

Source

8.0.0

Storybook 8.0 is here

It brings major improvements to Storybook's feature set for testing and documentation, with strengthened framework support across React, Vue, Angular, web-components, Svelte, and more.

  • ๐Ÿฉป Built-in visual testing
  • โš›๏ธ React Server Component support
  • ๐ŸŽ›๏ธ Improved controls for React and Vue projects
  • โšก๏ธ Improved Vite architecture, Vitest testing, and Vite 5 support
  • ๐Ÿงช 2-4x faster Storybooks for testing
  • โœจ Refreshed desktop UI
  • ๐Ÿ“ฒ Rebuilt mobile UX
  • ๐Ÿ™…โ€โ™€๏ธ No more React requirement in non-React projects

Please checkout our Migration Guide to upgrade from earlier versions of Storybook. To see a comprehensive list of changes that went into 8.0, you can refer to the 8.0 prerelease changelogs.

Readme

Source

Storybook Core-server

This package contains common node-side functionality used among the different frameworks (React, RN, Vue 3, Ember, Angular, etc).

It contains:

  • CLI arg parsing
  • Storybook UI "manager" webpack configuration
  • start-storybook dev server
  • build-storybook static builder
  • presets handling

The "preview" (aka iframe) side is implemented in pluggable builders:

  • @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.

Keywords

FAQs

Last updated on 11 Mar 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc