Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storybook-addon-angular-router

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storybook-addon-angular-router

Addon to enable logging and mocking for the angular router in storybook

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.7K
increased by40.69%
Maintainers
1
Weekly downloads
 
Created
Source

Storybook Addon Kit

Simplify the creation of Storybook addons

  • 📝 Live-editing in development
  • ⚛️ React/JSX support
  • 📦 Transpiling and bundling with Babel
  • 🏷 Plugin metadata
  • 🚢 Release management with Auto
  • 🧺 Boilerplate and sample code

Getting Started

Click the Use this template button to get started.

Clone your repository and install dependencies.

npm install

Development scripts

  • npm run start runs babel in watch mode and starts Storybook
  • npm run build build and package your addon code

What's included?

Demo

The addon code lives in src. It demonstrates all core addon related concepts. The three UI paradigms

  • src/Tool.js
  • src/Panel.js
  • src/Tab.js

Which, along with the addon itself, are registered in src/preset/manager.js.

Managing State and interacting with a story:

  • src/withAngularRouter.js & src/Tool.js demonstrates how to use useGlobals to manage global state and modify the contents of a Story.
  • src/withRoundTrip.js & src/Panel.js demonstrates two-way communication using channels.
  • src/Tab.js demonstrates how to use useParameter to access the current story's parameters.

Your addon might use one or more of these patterns. Feel free to delete unused code. Update src/preset/manager.js and src/preset/preview.js accordingly.

Lastly, configure you addon name in src/constants.js.

Metadata

Storybook addons are listed in the catalog and distributed via npm. The catalog is populated by querying npm's registry for Storybook-specific metadata in package.json. This project has been configured with sample data. Learn more about available options in the Addon metadata docs.

Release Management

Setup

This project is configured to use auto for release management. It generates a changelog and pushes it to both GitHub and npm. Therefore, you need to configure access to both:

  • NPM_TOKEN Create a token with both Read and Publish permissions.
  • GH_TOKEN Create a token with the repo scope.

Then open your package.json and edit the following fields:

  • name
  • author
  • repository
Local

To use auto locally create a .env file at the root of your project and add your tokens to it:

GH_TOKEN=<value you just got from GitHub>
NPM_TOKEN=<value you just got from npm>

Lastly, create labels on GitHub. You’ll use these labels in the future when making changes to the package.

npx auto create-labels

If you check on GitHub, you’ll now see a set of labels that auto would like you to use. Use these to tag future pull requests.

GitHub Actions

This template comes with GitHub actions already set up to publish your addon anytime someone pushes to your repository.

Go to Settings > Secrets, click New repository secret, and add your NPM_TOKEN.

Creating a releasing

To create a release locally you can run the following command, otherwise the GitHub action will make the release for you.

npm run release

That will:

  • Build and package the addon code
  • Bump the version
  • Push a release to GitHub and npm
  • Push a changelog to GitHub

Keywords

FAQs

Package last updated on 25 Mar 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc