Coder Social home page Coder Social logo

vscode-react-native-storybooks's Introduction

React Native Storybook

Select storybooks inside your editor.

https://github.com/orta/vscode-react-native-storybooks/raw/master/preview.gif

How do I use it?

Install it, ensure that the configuration is right. You should see a new section under the files in the Explorer panel called "Storybook".

🎉

If your react-native server crashes, use the command "Reconnect Storybook to VS Code" to re-connect.

What does it do?

  • Connect to the React Native storybooks web socket.
  • Single click a story to open it in your simulator.
  • Double click to open story in your editor.
  • Search / picker for quick story activation

Configuration

  • react-native-storybooks.host: string (default: "localhost")
  • react-native-storybooks.port: number (default: 7007)
  • react-native-storybooks.storyRegex: string (default: "**/*.story.*")
  • react-native-storybooks.storybookFilterRegex: string (default: ".")

You can either change these in your user settings, or per-project you can create a .vscode/settings.json file and add them there.

Filtering

If you work with quite a lot of stories in a project, it can be a bit of a chore to scroll through them all, so you can use setting react-native-storybooks.storybookFilterRegex to filter down the shown stories. If you do this on your user settings then only you will see the changes.

You can also access the quick picker menu with:

  • the Storybook search / picker command; or
  • via shortcuts:
    • CTRL+K S on Windows
    • CMD+K S on Mac

Known Issues

Nothing critical ATM.

vscode-react-native-storybooks's People

Contributors

ceyhun avatar chrismcleod avatar hellocore avatar manishalexin avatar mennenia avatar notjosh avatar orta avatar sterlingwes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-react-native-storybooks's Issues

Prevent Previous/Next Story Keyboard Shortcuts from Conflicting with Cmd+K when Terminal is focused

It appears that this extension prevents the default Command + K keyboard shortcut from working when the integrated Terminal is focused.

Steps to Reproduce

  1. Launch Visual Studio Code 1.14.2 on macOS Sierra 10.12.5 with the default keyboard shortcuts.
  2. Use the Extensions sidebar to install the React Native Storybook extension and reload the Code window.
  3. Open the integrated Terminal and focus it to begin entering text.
  4. Run a command which produces output, such as ls.
  5. With the Terminal still focused, attempt to clear it with the default Command + K keyboard shortcut.

Expected Results

  1. Code launches normally and opens a new window.
  2. After the window reloads, the React Native Storybook extension is installed.
  3. The Panel appears at the bottom of the code window with the integrated terminal active.
  4. Running ls prints a list of folders in the current working directory of the terminal.
  5. Typing Command + K clears the terminal, and the output of the previous command is no longer visible.

Actual Results

  1. Same
  2. Same
  3. Same
  4. Same
  5. The status bar at the bottom of the Code window displays the message, "(⌘K) was pressed. Waiting for second key of chord…". The output of the previous command is still visible in the terminal.

Add commands to move up/down in the current storybooks

You can look at the current "kind" and "story" then move them up/down. This means you can add key commands to jump between stories - which is really my kind of end goal, as my mouse always runs out of power and I need it for this stuff.

Support derived nesting?

storybook's ability to only have 2 levels of hierarchy is a bit sucky, so maybe this extension can do a workaround. Right now what we do is this:

screen shot 2017-06-09 at 14 26 19

Maybe the extension should support converting all those "XX - YY" into another hierarchy, providing three levels.

Artist Header
  Full Data
Consignments
  Styling
      Type Reference
      blank
      Boolean Selector

Support choosing a story from a dropdown

Let's say I wanted to find an exact storybook via the keyboard, I'd like to be able to do something like "choose stories" then it presents a drop down list of all of them which I can do a quicksilver-y thing with.

Little bit blocked by the lack of selection mentioned in #6

cant find server at localhost:9001

Just installed vscode-react-native-storybooks in VS Code 1.12.2 ; have a 0.44 React Native app open etc.

After selecting Show Storybooks I see this error. How/where can I set the correct port# ?

image

When clicked once, the story does not open in the simulator.

hello, I have a problem.

The Problem:

  • When clicked once, the story does not open in the simulator.

Env

  • React Native Storybook Vscode Extensions Version: 2.7.0
  • @Stroybook 버전: 5.2.1
  • VSCode Version: 1.38.1
  • Connected to stories(show the stories)
  • When clicked once, the story does not open in the simulator. (it is working, good)

How can I solve this problem?

Add icons

There's weird gaps because of the lack of icons. Not really sure what they should look like though.

screen shot 2017-06-13 at 14 51 23

nested stories don't work in vscode

Hi

According to the documentation: https://storybook.js.org/basics/writing-stories/#nesting-stories

We can do nesting with the stories. So, i made this example.

import React from 'react';
import { View, Text } from 'react-native';

import { storiesOf } from '@storybook/react-native';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import { Background, Input } from './';

storiesOf('CC/DD/Inputs', module)
  .addDecorator(story => (
    <Background style={styles.center}>
      <View style={{ alignSelf: 'stretch' }}>{story()}</View>
    </Background>
  ))
  .add('Email', () => <Input />)
  .add('Password', () => <Input pass />);

storiesOf('CC/DD/Backgrounds', module).add('Gradiente Azul', () => (
  <Background />
));

In the web browser:

captura de pantalla 2018-01-17 a la s 13 42 18

But in VSCODE.

captura de pantalla 2018-01-17 a la s 13 43 20

The nesting don't work.

Thank you

What is "Show Storybook tab" supposed to do? (currently nothing)

The browser shows the welcome page (but doesn't navigate due to a known issue, https://github.com/storybookjs/storybook/issues/7858 ), and the stories work as expected in the simulator. I can see the stories in the vs code file explorer, but single-, double-, and right-clicking do nothing. Basically, it seems like the plugin connects to the server to list stories, but nothing else.

    "@storybook/addon-actions": "^5.2.0-beta.40",
    "@storybook/addon-links": "^5.2.0-beta.40",
    "@storybook/addons": "^5.2.0-beta.40",
    "@storybook/react-native": "^5.2.0-beta.40",
    "@storybook/react-native-server": "^5.2.0-beta.40",
 npx -p @storybook/cli --version
6.9.0

vs code...

Version: 1.37.1
Commit: f06011ac164ae4dc8e753a3fe7f9549844d15e35
Date: 2019-08-15T16:16:34.800Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.