Coder Social home page Coder Social logo

chromaui / learnstorybook.com Goto Github PK

View Code? Open in Web Editor NEW
2.4K 40.0 437.0 182.15 MB

Static site and content for Storybook tutorials

Home Page: https://storybook.js.org/tutorials/

License: MIT License

JavaScript 99.16% Shell 0.64% CSS 0.20%
storybook learning design-system component-driven

learnstorybook.com's Introduction

Learn Storybook

Learn Storybook teaches you how to use Storybook and Component-Driven Development to build UIs from scratch. We walk through core concepts from building and testing to deployment. Using engaging guides and content, we hope to get you up to speed on Storybook best practices in a fast and approachable way.

Who made LearnStorybook.com?

The text, code, and production were contributed by Chromatic. The tutorial was inspired by Chromatic’s popular GraphQL + React tutorial series

Contributors

Contribute

Contributions to Learn Storybook are encouraged! If it’s something small like grammar, punctuation, or even a code snippet, first check the open pull requests to see if it's already being addressed, if it's not, then open up a pull request. If it’s a bigger change like adding a new guide or chapter, add an issue for discussion before getting started.

You'll find the guides and chapters in the /content directory. Content is organized at the guide level. Within the /content directory, you'll find directories for the current guides that are offered. Within each guide directory, you can see the chapters that make up that guide.

We love translations of our guides to new languages. That helps the Storybook community learn in the language they're most comfortable with. Find out more ».

Traditional Chinese translation is converted from Simplified Chinese using OpenCC. Please help us correct any idiomatic errors.

Running the project locally

Storybook instructions

The Storybook for Storybook contains every UI component. The UI is built following Component-Driven Development, a process that builds UIs from the “bottom up” starting with components and ending with screens. That means contributors should compose UIs in Storybook before integration with the Gatsby app.

  1. Run yarn install to install dependencies
  2. Run yarn storybook to start Storybook on localhost:6006

Gatsby instructions

Gatsby is used for static site generation. To run the project locally, you'll need to:

  1. Run yarn install to install dependencies
  2. Run yarn extract-sb-docs-metadata to fetch content from the main Storybook repo
  3. Set up a .env.development file with the following environment variables:
SKIP_DX_DATA=true
  1. Run yarn dev to start the development server

Adding new content

Thanks for taking the time to contribute and add content to Learn Storybook! The tutorials below reference file paths, which will be represented in this format:

/content/:guide/:framework?/:language/:chapter.md

Path parts that are prefixed with a colon (:) are meant to be dynamic names that are chosen by you. :guide becomes intro-to-storybook or whatever you decide to use for your content. If a path part is followed by a question mark (?), then it is optional.

Add a guide

  1. Within the /content directory, add a directory for your new guide: /content/:guide. The name you choose for the directory will be used as the slug for the directory when you access it in a browser.

  2. Add a new file, index.md, to your newly created directory: /content/:guide/index.md. This file will contain the content and metadata for your guide that will be used to populate the site. Using intro-to-storybook's index.md as an example, populate the following required frontmatter fields with meaningful content about your guide:

---
title:
heroDescription:
description:
overview:
themeColor:
---
  1. See the guide frontmatter section for additional customization options, many of which you'll want to use in order to create a guide that feels complete.

  2. Populate the guide content in markdown underneath the frontmatter. This content shows up on the guide page after the table of contents. For example, you can insert images, call out frameworks, or provide details about the project contained within the guide.

  3. Visit your guide at http://localhost:8000/:guide

Add a chapter

If you are translating a chapter that already exists in a different language, skip to step 2.

If you are writing a new chapter for a language that already exists, skip to step 3.

  1. Decide if your guide should be organized by framework. Will the examples and messaging be specific to the reader's framework of choice? If so, add an additional directory for the framework: /content/:guide/:framework. If not, carry on to the next step -- you will put your translation directories and chapters inside the /content/:guide directory.

  2. Add a directory for the language that you will use to write your chapter. The naming of this language directory is important and should mirror what has been used in other guides for similar translations. Additionally, a helper is used across the app to transform the language into a human readable name, so make sure to update that helper if you are adding a language that has not yet been used. Know of a better way to convert this language into something more readable? Start an issue and let us know your idea.

  3. Add a new file for the chapter that you are going to write:

/content/:guide/:framework?/:language/:chapter.md

  1. Update the guide's toc frontmatter. Each time you add a new chapter, make sure to go back and update the guide's toc in order to populate the Table of Contents as well as control the order of the chapters. Using the name of the file that you just created in step 3, go back to the guide frontmatter and update the toc:
toc: [":chapter"]
  1. Populate the chapter frontmatter.

  2. Populate the chapter content in markdown underneath the frontmatter.

  3. Visit your chapter at http://localhost:8000/:guide/:chapter or by going to http://localhost:8000/:guide/ and subsequently navigating to your chapter from the Table of Contents.

Guide frontmatter


Required


title

The primary name for your guide. What is it called?

description

A relatively short description of the guide. Used primarily in the primary navigation tooltip menu.

heroDescription

A message about the guide that will live prominently on the guide page. Why is this guide important? What is the context around the guide that helps reinforce the importance of moving forward to read the guide?

overview

A section on the guide page discussing the things you will learn in the guide.

themeColor

A named color, hex, rgba value, etc. Basically anything you can use in the color css property.

toc

A list and the corresponding order of the chapters in the guide. Short for "Table of Contents". List items should map to the file name of the chapter.


Suggested


codeGithubUrl

The URL to the repository that has the code examples for your guide. Used in combination with the commit frontmatter in the chapter to link chapters to their corresponding code examples.

coverImagePath

The primary image for the guide. Used on the guide page.

thumbImagePath

A thumbnail representation of the cover image. Used in smaller places such as the guide list on the index page.

contributorCount

A string representation of the amount of contributors to this guide. Since the Github API only shows contributors to the repo as a whole rather than specific directories, we do this manually for now. Know of a better way? Start an issue and let us know your idea.

authors

A list of authors of the guide. Format:

authors:
  [
    {
      src: "",
      name: "",
      detail: "",
    },
  ]

contributors

A list of contributors to the guide. Format:

contributors:
  [
    {
      src: "",
      name: "",
      detail: "",
    },
  ]

heroAnimationName

An animation to use on the guide's hero image, which corresponds with a named export from the animation styles file. The export must contain the entire CSS property and value for the animation.

twitterShareText

The text content for the tweet that is auto-populated when people choose to share the guide on Twitter. The URL that is included in the tweet is auto-generated based on the guide, but the individual guide can control the messaging before the link.

Chapter frontmatter


Required


title

The primary name for the chapter. What is it called?

tocTitle

Specify a different title to only be used for the Table of Contents sections.

description

A brief description of the chapter. Shown underneath the chapter title on the chapter page as well as in the Table of Contents on the guide page.


Suggested


commit

The short commit hash that maps to the commit on the code example repo for this chapter.


Current Guide Status

Currently, the Intro to Storybook tutorial features the following translations. Some are updated; others are not. If you want to get acquainted with Storybook and you are a native speaker of any of the languages detailed below. Help us out updating the translations. Leave a comment on the issue above.

Framework Translation Updated
React English
Spanish
Portuguese
ZH-TW
Mainland Chinese
Dutch
Korean
Japanese
French
Italian
German
React Native English
Spanish
Portuguese
Vue English
Italian
Spanish
Portuguese
French
Mainland Chinese
Angular English
Spanish
Portuguese
Japanese
Svelte English
Spanish
Ember English

The Design Systems for Developers tutorial features the following translations. Some are updated; some are not. If you want to expand your Storybook knowledge and learn how to build an industry-grade component library, and you're a native speaker of any of the languages, detailed below. Help us out by updating the translations. Comment in the issue above.

Translation Updated
English
Korean
Portuguese
Japanese
Mainland Chinese

The Visual Testing handbook features the following translations. If you want to learn more about testing and solid workflows that can help you as a frontend developer, and you're a native speaker of any of the languages, detailed below. Help us out by updating the translations. Leave a comment on the issue above.

Translation Updated
English
Spanish

The UI Testing handbook features the following translations. If you want to learn more about industry-grade testing patterns and workflows, and you're a native speaker of any of the languages, detailed below. Help us out by updating the translations. Leave a comment on the issue above.

Translation Updated
English
Korean

learnstorybook.com's People

Contributors

andre-brdoch avatar archetipo95 avatar bhbs avatar calaway avatar chameleonhead avatar dannyhw avatar domyen avatar draketheb4dass avatar dschungelabenteuer avatar eihabkhan avatar github-actions[bot] avatar icarlossz avatar ivansotelo avatar janeshin059 avatar jonniebigodes avatar josegarciamanez avatar katepark1009 avatar kylegach avatar kylemh avatar kylesuss avatar lisohh avatar lmac-1 avatar ludovicobesana avatar nagashimam avatar naoki8ster avatar ndelangen avatar sosunnyproject avatar tmeasday avatar winkervsbecks avatar zydmayday 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  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

learnstorybook.com's Issues

Grammar on first page

Tweet: I'm learning Storybook! It's a great dev tool for UI components.

It's just something with a large font size, first page, users wouldn't want to share it even if they'd gloss over a mistake in the actual tutorial, easy fix, bada bing, bada boom.

A couple of quick questions

This one has been on the back burner for quite some time and sorry for that.
Here are the questions:

  • While i was working in translating the documentation, one thing kept me wondering and that was about the addons section, react has it but vue and angular doesn't, is this section left out by omission, probably due to the fact that probably no one made a pr for it? Should it be a good thing to revisit this and try and standardize the whole documentation? More even now that #91 is currently underway.

  • I was thinking about having a copy code snippet button added to the documentation, is this doable in a near future? After the refresh of the site is gone through and possibly expand it to #137.

Feel free to provide feedback

Thanks in advance

Spanish version

This is the discussion for the Spanish version of Learn Storybook. Use this issue to divvy up translation, request feedback, etc. For more info about the translation project and to get involved checkout #3

Please target your PRs at branch language-spanish. 🙏

cc @icarlossz and @luchux

Mix between Yarn and npm

I just completed the tutorial and enjoyed learning about storybook.

However I noticed a mix of npm and yarn commands throughout the tutorial. Would you be interested in a PR consolidating the commands to use either npm or yarn throughout for consistency? And if so, which?

Storybook fails to restart in Angular tutorial at config section

In the following section of the Angular tutorial:

https://github.com/chromaui/learnstorybook.com/blob/master/content/angular/en/simple-component.md#config

When prompted to restart the Storybook server with yarn run storybook the following errors are generated:

ERROR in ./src/styles.less (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/less-loader/dist/cjs.js??ref--10-3!./node_modules/style-loader!./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/styles.less)
Module build failed (from ./node_modules/less-loader/dist/cjs.js):

var content = require("!!../node_modules/css-loader/dist/cjs.js!../node_modules/less-loader/dist/cjs.js!./styles.less");
          ^
Unrecognised input
      in /Users/blah/blah/blah/blah/taskbox/src/styles.less (line 2, column 12)
 @ ./src/styles.less 2:14-356 21:1-42:3 22:19-361
 @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js ./node_modules/webpack-hot-middleware/client.js?reload=true ./src/styles.less

yarn start_error

yarn_start
yarn start error

Error: [BABEL] /Volumes/LaCie/react/taskbox/src/index.js: Cannot find module '@babel/plugin-syntax-jsx' (While processing: "/Volumes/LaCie/react/taskbox/node_modules/babel-preset-react-app/index.js$1$0")

yarn version:1.10.1
nodejs version:v10.11.0

Hot Reloader doesn't work with React Js

Hello,
I have been through the tutorial and I have a problem with the Hot Reload that does not work. I mean the project is working but I have to restart storybook (npm run storybook) everytime I make one change on a file to see it appear.

I have already check/try :

  • that the module keyword is present (storiesOf('TaskList', module))
  • deleting nodes_modules and reisntalling (using npm or yarn)

I have the same problem on two differents storybook projects.

Do you have any tips on how I can fix this?

Thanks in advance :)

Port tutorial to Vue

Update Jun 13
Thanks to @mattrothenberg we have the example UI code ported to Vue. 🤙
Vue UI example code

Contributors wanted
Port the prose to Vue. This is mostly find & replace in Markdown with a bit of extra explanation for Vue-specific concepts.

Final code for the 'data' chapter doesn't work

Lovely tutorial, but I've hit a bit of a roadblock.

Working through the "Wire in data" section, my Storybook tests predictably stop working when TaskList is renamed to PureTaskList - however, the solution given still doesn't work. Instead, I'm just given the following error:

Invariant Violation: Could not find "store" in the context of "Connect(PureTaskList)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(PureTaskList) in connect options.

I've gone over all of my code and, as far as I can tell, it's identical to that shown in the article. I also had a look at the linked commit and noticed that App.js now wraps the TaskList component in a Provider with access to the store, which isn't mentioned in the article. Adding that leaves the app itself working correctly - does something similar need to happen in the component's story?

Cheers.

icon-star is not shown

Hi I am using css from this link as written in document.
image

However the icon star is not shown. I think I need more link from css not only that link. This is not really critical and unimportant but I want to fix it. Whatever documents or css. Thanks if you give me any comments please.

  • currently shown in my localhost
    image

Publishing component library as NPM package

The whole concept of storybook, component library and using in the application is very cool. I was looking at something which could be used in other projects too as a npm package and use the components from the component library. Is there a way to do it ?

Error on fresh install

ENV

  • MacBook Pro 2017
  • MacOS High Sierra v10.13.5
  • Node v8.9.4
  • Yarn v1.7.0

STR

  • Fork repository
  • Clone repository locally
  • Open a shell within the folder's root level
  • Run yarn && yarn dev
  • Open http://localhost:8000
  • See the following error:
    screen shot 2018-07-11 at 11 39 16 pm

I thought this might be because the yarn.lock file has not been updated in parity with the package-lock.json file; however, after deleting it locally and adding a fresh lockfile, the error persisted. There also exists a lint error on line 66 of src/pages/index.js, but fixing this also does not resolve the screenshotted issue. I'll be submitting a PR soon in regards to #21 but I'll just keep it to content 👍

Incorrect use of prepare script & missing @babel/cli dependency

Babel Issue

While working through the Distribute instructions, I ran into a babel issue when the package was building after install (unfortunately I didn't get a screenshot of this before I fixed it). It was an unknown option error to the build script "BABEL_ENV=production babel src -d dist".

After looking through the example code base, I realized that @babel/cli was a dependency. I added it to my own package and published. This totally fixed the issue.

PROPOSED CHANGE:
Add instructions around adding @babel/cli as a dependency.

Prepare issue

I ran through this issue within the two example repos, as well as my personal repo

I realized that the example repo is using the prepare script from npm which is run BEFORE the package is packed and published. This causes an issue wherever the build is run because Babel is going to include the import statements with the wrong direct path.
Screenshot of issue:
Screen Shot 2019-10-09 at 12 17 12 PM

Which then hits the following error once the stories are imported (for each file):
Screen Shot 2019-10-09 at 12 34 16 PM

This example has the build context from within the users local build, but when publishing through auto, the build is run in the context of CircleCI causing the direct path to be something like home/circleci/node_modules...

PROPOSED CHANGE:
Changing the prepare script to postinstall solves this issue as it only runs the build within the correct context (within the node_modules directory of the app in which its installed)

There currently is no documentation surrounding the need for a build to run once the package is installed to create the dist folder within the node module. I think there should be some documentation around having the correct script run after the package is installed (with postinstall).

I also noticed that after installing the example package created by @tmeasday that the index.js file had incorrect paths to the components. It seems to be fixed in the repo, but probably needs to be published with the updated chage.

Learn Storybook HTML

Hey there,

not sure if this is the right way to approach you with the subject, so feel free to close this issue, if not.
First of all, thank you for providing this great resource. Did the tutorial for react and really enjoyed it.
Anyhow, I was wondering, if you are planning to add Storybook HTML (in combination with a templating system like mustache) to your curriculum any time soon?
We're considering using it at work but learning resources are quite rare...

Best wishes!
Astrid

Design systems for developers missing image

While giving the finishing touches to the translation regarding the "Design Systems for Developers", when i've reached the "Document page" it seems that one image is missing. The markdown has the following content:

![alt_text](/design-systems-for-developers/Feedback-wanted53.png)

Checking the static folder where the assets are stored, the image in question as you can see in the screenshot below:
learn_design_systems_document_image_missing

On the left is the folder with the assets and on the right is the live version.

I've checked the repo and the image is also not there.

I'm going to leave it as is and hope that soon the image is added.

Feel free to provide feedback

How to translate?

Hello, I would like to help with the translation of the tutorial into Spanish but would like an explanation on how to do it in the same way it can be useful for anyone who also intends to help translate.

Greetings,
Carlos

Review Design Systems for Developers guide

@tmeasday and I are creating a new Storybook guide! 🎉 It'll be launched with the website refresh that @kylesuss is working on here.

Overview
“Design systems for developers” is a free 9-chapter guide that teaches professional developers about the design system infrastructure and production workflows used by the smartest frontend teams. It focuses on Storybook and includes real code + example repositories.

Feedback areas
General feedback is definitely appreciated. Here are some specific areas that could use extra attention:

  • Logical consistency: Does it make sense?
  • Syntax and grammar: Does it conform to the standards of the English language?
  • Tone and flow: Is it enjoyable to read?
  • Code samples: Is code sensible and skim-able while reading?

👉Read the preview here👈

We'd love early feedback from contributors 🙏
@jonniebigodes @icarlossz @alterx @luchux @danielduan @chinanf-boy

Storybook Guide for React Native

I think it will be great if there is a guide for React Native Storybook! There is a massive lack of guides on RN, and right now, there are vast differences in terms of expectations and implementations of Storybook for React vs React Native which the current Storybook website fails to highlight.
e.g.

  • Deployment of the Storybook as a static web app (buildstorybook does not exist for RN)
  • Interface configuration of Storybook on RN
  • Implementing add-ons on RN (in the official docs, they only mentioned the list of add-ons available but not how to use them on RN)
  • The experience of running Storybook web on localhost together with iOS/Android Simulator is different than what the example on React showed. On RN, from what I have tried, you can click on different stories on the localhost and it only shows up on the simulator. The web unfortunately does not show the component itself.

Icon font error

Following instructions through https://www.learnstorybook.com/react/en/simple-component/, the icon font fails to load in the application, with console warnings:

iframe.html?selectedKind=Task&selectedStory=archived:1 Failed to decode downloaded font: http://localhost:9009/icon/percolate.woff?5w3um4
iframe.html?selectedKind=Task&selectedStory=archived:1 OTS parsing error: invalid version tag
iframe.html?selectedKind=Task&selectedStory=archived:1 Failed to decode downloaded font: http://localhost:9009/icon/percolate.woff?5w3um4
iframe.html?selectedKind=Task&selectedStory=archived:1 OTS parsing error: invalid version tag
iframe.html?selectedKind=Task&selectedStory=archived:1 Failed to decode downloaded font: http://localhost:9009/icon/percolate.ttf?5w3um4
iframe.html?selectedKind=Task&selectedStory=archived:1 OTS parsing error: invalid version tag
iframe.html?selectedKind=Task&selectedStory=archived:1 Failed to decode downloaded font: http://localhost:9009/icon/percolate.ttf?5w3um4
iframe.html?selectedKind=Task&selectedStory=archived:1 OTS parsing error: invalid version tag

Typo in Design Systems for Developers React build.md

There is a typo in build.md in which there is an unterminated string in the config example.

Issue:

// automatically import all files ending in *.stories.js
configure(require.context('../src, true, /\.stories\.js$/), module);

should be:

// automatically import all files ending in *.stories.js
configure(require.context('../src', true, /\.stories\.js$/), module);

I tried opening a PR but I didn't have permission to create the PR 😢

Fix prettier settings for MD files or reformat all of them

It seems that saving a MD file causes it to update for those that have prettier enabled. I think that is expected, but maybe we can do 1 big PR where all of the files are reformatted at once so it doesn't just happen sporadically in smaller PRs.

Storysource Webpack rule causing build errors in Design Systems for Developers [REACT]

Description

When I followed the instructions for adding webpack.config.js into .storybook, which pushes the loader rule for addon-storybook, it caused the build to error in every .stories file with the error Import in body of module; reorder to top import/first.

After researching the issue, I found that this comment seems to solve the problem: storybookjs/storybook#6974 (comment)

Proposed Change

Original:

//And update your webpack config in .storybook/webpack.config.js:

module.exports = function({ config }) {
 config.module.rules.push({
   test: /\.stories\.jsx?$/,
   loaders: [require.resolve('@storybook/addon-storysource/loader')],
   enforce: 'pre',
 });

 return config;
`};

Fixed:

//And update your webpack config in .storybook/webpack.config.js:

module.exports = function({ config }) {
 config.module.rules.unshift({
   test: /\.stories\.jsx?$/,
   loaders: [require.resolve('@storybook/addon-storysource/loader')],
   enforce: 'pre',
 });

 return config;
`};

error while using requireContext

Once we start to use requireContext in .storybook/config.js, running the storybook is giving me an error, I was following the exact steps mentioned in tutorial.

Screenshot 2019-06-14 at 2 51 28 PM

if I start to use const req = require.context('../src', true, /.stories.js$/);, the stuffs work fine

PFB my package.json

{
  "name": "taskbox1",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-scripts": "3.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "storybook": "start-storybook -p 9009 -s public",
    "build-storybook": "build-storybook -s public"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@storybook/addon-actions": "^5.1.7",
    "@storybook/addon-links": "^5.1.7",
    "@storybook/addon-storyshots": "^5.1.7",
    "@storybook/addons": "^5.1.7",
    "@storybook/react": "^5.1.7",
    "react-test-renderer": "^16.8.6",
    "require-context.macro": "^1.0.4"
  }
}

node version : v10.13.0
yarn version: v1.15.2

Angular code

Angular users, we need your help converting the LearnStorybook example code. 🙏

The example is currently written in React and Redux. If you use Angular (and a little React) and have a grasp on its state management ecosystem help us introduce Storybook to that community.

Comment below!

Question vue tutorial broken

Everything was ok until i got to https://www.learnstorybook.com/vue/en/data/

This section and forward:

Then we'll update our TaskList to read data out of the store. First let's move our existing presentational version to the file src/components/PureTaskList (renaming the component to pure-task-list), and wrap it with a container in src/containers/TaskList.vue:

ERROR in ./src/components/PureTaskList
Module build failed: Error: ENOENT: no such file or directory, open '~./taskbox/src/components/PureTaskList'

To keep confusion down and amplify clarity can you list the filename above the code snips clearly?

filename.extension

...some code

Plus I'm working on the vue version, but towards the end of the page, the screenshot is a duplicate from the last chapter but should show task being pulled from the store. Then the jest example is written for react not vue.

composite-component.md line 248 unclear

248 Notice as well that this test is quite brittle. It's possible that as the project matures, and the exact implementation of the Task changes --perhaps using a different classname or a textarea rather than an input--the test will fail, and need to be updated.

Need more clarity about this line. I can work on enhancing this line if the intended meaning was conveyed.

Learn Storybook sequel – Mastering Storybook – a guide for intermediate/advanced users

This issue documents "advanced" topics that readers have inquired about in the past. These topics will be incorporated into the sequel to Learn Storybook's intro guide. Feel free to suggest topics for the team to consider.

  • Organizing your Storybook
  • Setting up SB in production
  • Collaboration (Loop/Deploy)
  • Testing (visual, responsive, a11y, i18n, etc.)
  • Publishing the component library
  • Feedback loops with Storybook (QA, product team, etc.)
  • Using Storybook for component library & design system documentation
  • Graphql and storybook
  • Serve static assets with Storybook #297

Related issues: #67

diffrences

what are the diffrences between testing tool storybook and mocha or jest

Translations wanted

Learn Storybook is read by over 300,000 developers! We need help translating the tutorial to other languages.

What's needed

Translating is manageable for one person. The content length is the equivalent to one long blog post (5–6k words). Ideally, we try to have 2 people to collaborate on writing and proofreading, but that shouldn't prevent you from getting started.

Note: React/English is the "master" edition that is updated often. Please use React/English as the source-of-truth in your translations. 🙏

How to get started

  1. Comment on this issue with your language (so folks can work together)
  2. Add a new directory in content with language (e.g., /react/jp).
  3. Copy the existing docs to the new directory
  4. Translate markdown content including what's in the "frontmatter" (title, tocTitle, description). Do not change the code snippets, commit, or filename.
  5. Run the project on localhost using yarn dev to confirm that everything looks OK. For now, you can preview changes by going to a url that looks like this http://localhost:8000/intro-to-storybook/react/jp/composite-component/
  6. Make a pull request
  7. Get a review by another native language speaker (if possible)

Status

React

Language Contributors Discussion Status
🇲🇽 Spanish @lmac-1 @icarlossz, @luchux 🎉 Live
🇨🇳 Simplified Chinese @chinanf-boy,@stpace 🎉 Live
🇹🇼 🇭🇰Traditional Chinese @ymcheung 🎉 Live
🇵🇹🇧🇷 Portuguese @jonniebigodes 🎉 Live
🇳🇱🇧🇪 Dutch @Robin-Hoodie, @ghengeveld 🎉 Live
🇩🇪 German @renet @jonathanherdt 🎉 Live
🇯🇵 Japanese @chameleonhead, @match5121 🎉 Live
🇫🇷 French @Draketheb4dass , @rjussserand 🎉 Live
🇮🇹 Italian @ludovicobesana , @giowhatever 🎉 Live
🇰🇷 Korean @katepark1009, @jinho6225 🎉 Live
🇲🇦 Arabic @eihabkhan, @merodiro 🎉 Live

React Native

Language Contributors Discussion Status
🇲🇽 Spanish @IvanSotelo
🇵🇹🇧🇷 Portuguese @Wanderson77, @pablolucas890 🎉 Live

Angular

Language Contributors Discussion Status
🇲🇽 Spanish @josegarciamanez #478 🎉 Live
🇵🇹 Portuguese @jonniebigodes 🎉 Live
🇯🇵 Japanese @nagashimam, @chameleonhead 🎉 Live

Vue

Language Contributors Discussion Status
🇵🇹🇧🇷 Portuguese @jonniebigodes 🎉 Live
🇲🇽 Spanish @IvanSotelo 🎉 Live
🇫🇷 French @jeanphibaconnais 🎉 Live
🇨🇳 Simplified Chinese @zydmayday, @fengnzl #680 🎉 Live
🇮🇹 Italian @Archetipo95 , @ludovicobesana 🎉 Live

Svelte

Language Contributors Discussion Status
🇲🇽 Spanish @IvanSotelo 🎉 Live

SDS: MDX causes chromatic test error

Going through the Design System tutorial, after adding the Intro.stories.mdx file, the build fails on the chromatic test on CircleCI...builds fine locally.
code
code
code
Screen Shot 2019-10-09 at 09 54 37

Latest version of addon-knobs breaks tutorial

Hi

In following your excellent tutorial, I ran into a roadblock on the Addons section. Doing yarn add @storybook/addon-knobs gives me the latest addon-knobs (v4.x), and that causes an "Accessing non-existent channel" error when going to Storybook.

After a comparing your code @ chromaui/learnstorybook-code@f4d933#diff-f5db38d9ba5560598e902c026311b340, I updated my package.json to "@storybook/addon-knobs": "^3.3.15", reinstalled, and everything worked fine.

Vue with TypeScript Example Configs Missing

TypeScript is coming fast for Vue. Already at this point, it may not be such a good idea to start a new Vue project without TypeScript...

Could you please update Vue tutorial to show proper configurations for working with TypeScript also?

Angular jest integration broken

I think due to the new angular CLI version, when following the instructions on https://www.learnstorybook.com/angular/en/simple-component/ to install and use jest, I get babel errors -- maybe we need to setup jest slightly differently?

Jest encountered an unexpected token

    This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.

    By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".

    Here's what you can do:
     • To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
     • If you need a custom transformation specify a "transform" option in your config.
     • If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.

    You'll find more details and examples of these config options in the docs:
    https://jestjs.io/docs/en/configuration.html

    Details:

    /private/tmp/taskbox-angular-sb3/src/app/app.component.spec.ts:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import { TestBed, async } from '@angular/core/testing';
                                                                                             ^^^^^^

    SyntaxError: Unexpected token import

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)

NOTE: this is with @storybook/angular@rc -- the 4.0 version. SB3.4 doesn't work with the new angular CLI at all.

SECOND NOTE: to get storyshots working again there are some other small changes required, see this commit for hints: https://github.com/chromaui/learnstorybook.com/pull/59/files#diff-4501e37952bca452aa3f7d49ac721bee

Not able to run tests in simple component chapter

I am not able to run yarn test after setting up the .storybook/config.js file in the simple component chapter.

The issue is that it won't find the require.context function that seems to be webpack specific.

     TypeError: require.context is not a function
       2 | import '../src/index.css';
       3 |
     > 4 | const req = require.context('../src', true, /.stories.js$/);
         |                     ^
       5 |

Uncaught TypeError: Cannot read property 'string' of undefined

Just followed the first step on the tutorial at https://www.learnstorybook.com/get-started/ and when opening the storybook at http://localhost:6006/ an Uncaught TypeError error is thrown and the page is blank.

{
  "name": "tasklist",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.3.1",
    "react-dom": "^16.3.1",
    "react-scripts": "1.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "storybook": "start-storybook -p 6006",
    "build-storybook": "build-storybook"
  },
  "devDependencies": {
    "@kadira/storybook": "^2.21.0"
  }
}

MDX integration causes build error

Description

When following the Documentation steps in Design Systems for Developers, I came across a build error with @babel/parser when I changed the config to import the new mdx file Avatar.stories.mdx

Via the instructions here, adding babel-loader as a dev dependency seems to solve the issue. Not sure if this is 100% needed but I wasn't able to get it working without it.

Error

Screen Shot 2019-10-07 at 2 50 44 PM

Proposed Change

Add yarn add -D babel-loader as a step when integrating MDX.

Clarity in Design Systems for Developers tutorial

On the Build step of the tutorial when explaining about GlobalStyles and the addDecorator function it never actually says where to add the code. I ended up adding it to the config.js and that worked, but it doesn't tell you to do that in the tutorial. In the actual Docs on Decorators that is actually what is suggested to do.

Wording should be added that says something like "For this tutorial we will add this code to the ./storybook/config.js file."

Avatar MDX file not included in build

I noticed that when the design system is built, it leaves the Avatar.stories.mdx file out of the build. This leaves this component out of the UI of the app.

This seems to be the case in the screenshot in the Distribute docs as well:
example-app-storybook-with-design-system-stories

How do we go about getting the mdx file included in the build?

Run alongside vs separately

In the Storybook official documentation, it says

Storybook runs outside of your app.

But in the intro of your guide, it says

Storybook runs alongside your app in development mode.

Can you talk about this discrepancy?

Redux store data not used in React tutorial 'Data' chapter

I followed through the chapter Wire In Data on wiring in data. I couldn't help notice that the data in the store did not appear to be used in the final code, or show up in Storybook.

Indeed it doesn't even appear in the screenshots which accompany the chapter and subsequent chapters.

I know it is possible to make this happen because I am currently the client on a live SB project which is using a data store to display data.

Not suggesting this is an error but perhaps an explanation would be helpful.

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.