React-dates: README.md

Created on 1 Nov 2017  路  4Comments  路  Source: airbnb/react-dates

Bug?

Maybe not. But suggestion is real. I forked the repo and followed the steps as saying in the README.md:

npm install
npm run storybook

But when I opened the url http://localhost:6001, I met the error:

Uncaught Error: Cannot resolve './lib/constants' in [path/to/local/directory]

And after checking out the package.json, I found that I should build first then execute npm run storybook. And I thought the README.md can update as follow:

npm install
npm run build && npm run storybook

Or any other ways that can let other people could easily set up in their local, and thus will reduce some misleadings and time, I think.

documentation enhancement pull request wanted

Most helpful comment

@ljharb @eryue0220 I think the right thing to do is not to have the build step before storybook but rather to update the components in https://github.com/airbnb/react-dates/tree/master/examples to rely on the src version of the constants file.

If we have storybook relying on built files, that means changes to those files won't be updated automatically as you're developing which is a bad experience.

All 4 comments

Yes, you're correct that the build process is required - it should probably be in package.json as "prestorybook": "npm run build", though, rather than modifying the documentation.

@ljharb Why does storybook require the build process now? It didn't before. Is this because of the esm changes?

@ljharb @eryue0220 I think the right thing to do is not to have the build step before storybook but rather to update the components in https://github.com/airbnb/react-dates/tree/master/examples to rely on the src version of the constants file.

If we have storybook relying on built files, that means changes to those files won't be updated automatically as you're developing which is a bad experience.

Pushed up a fix to use the constants from src.

If we can figure out how to forbid imports from outside src or examples or node_modules in the examples dir, we should.

Was this page helpful?
0 / 5 - 0 ratings