Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ember] update ember ergonomics to not require any manual setup #4594

Merged
merged 11 commits into from Oct 31, 2018

Conversation

gabrielcsapo
Copy link
Contributor

Issue: The previously submitted PR did not accommodate for dist not being around, changes were made in the ember-cli-storybook plugin to ensure it used the right build time hook to ensure dist was available.

What I did

Removes hacky solutions for setting up ember environment, now supports ember's live reload out of the box.

@codecov
Copy link

codecov bot commented Oct 27, 2018

Codecov Report

Merging #4594 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4594   +/-   ##
=======================================
  Coverage   35.59%   35.59%           
=======================================
  Files         557      557           
  Lines        6732     6732           
  Branches      884      884           
=======================================
  Hits         2396     2396           
  Misses       3876     3876           
  Partials      460      460

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1de2180...2233ff0. Read the comment docs.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielcsapo smoke tests are still failing. mind looking into it? also there is a conflict in yarn.lock

@gabrielcsapo
Copy link
Contributor Author

@igor-dv @ndelangen would you be able to take a look at this?

@shilman
Copy link
Member

shilman commented Oct 30, 2018

@gabrielcsapo What's storybook:dev supposed to do? It doesn't seem to work:

$$ yarn storybook:dev
yarn run v1.10.1
$ yarn serve & start-storybook -p 9009 -s dist, public
error Command "serve" not found.

@gabrielcsapo
Copy link
Contributor Author

@shilman it was supposed to be ember serve, I made it yarn dev instead. The live reload has a race condition that happens because you need ember serve to finish serving before starting the storybook process, working on an enhancement to ember-cli-storybook that lets you do this running a command like ember storybook serve


```json
{
"scripts": {
"storybook": "start-storybook -p 9001 -s dist"
"build-storybook": "ember build & build-storybook -p 9001 -s dist",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be &&?

@@ -6,7 +6,8 @@
"build": "ember build",
"build-storybook": "yarn build && cp -r public/* dist && build-storybook -s dist",
"dev": "ember serve",
"storybook": "yarn build && start-storybook -p 9009 -s dist, public"
"storybook": "yarn build && start-storybook -p 9009 -s dist, public",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think dist, public works (tested briefly on my machine).

Also I don't think it's necessary -- looks like ember copies everything from public into dist when it builds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if that is the cases, I know I needed to copy the files for build-storybook, these are needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I added a new file logo1.png into public it automatically gets copied into dist when I ember build.

When I yarn storybook and try to access it at the following URL, it succeeds:

http://localhost:9009/logo1.png

When I remove the file from dist and try to access it at the following URL, it 404s:

http://localhost:9009/logo1.png

Therefore, I believe:

  1. The syntax "dist, public" doesn't work (maybe no comma is needed?), or possibly Storybook's ability to serve from multiple directories doesn't work.
  2. We don't even need to be serving from public because ember build does the copying even when I don't use the file anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, tested this also and it works.

@igor-dv igor-dv added the maintenance User-facing maintenance tasks label Oct 30, 2018
@gabrielcsapo
Copy link
Contributor Author

@shilman I think I resolved your feedback

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@shilman shilman merged commit 8e6d0c6 into storybookjs:master Oct 31, 2018
@shilman shilman added patch:yes Bugfix & documentation PR that need to be picked to main branch documentation and removed maintenance User-facing maintenance tasks labels Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation ember patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants