Skip to content

Commit

Permalink
Merge pull request #5 from storybooks/master
Browse files Browse the repository at this point in the history
Update from latest master
  • Loading branch information
Stephanemw authored Oct 29, 2018
2 parents 72116e5 + 1de2180 commit 69884b8
Show file tree
Hide file tree
Showing 168 changed files with 4,018 additions and 2,042 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Code snippets**
If applicable, add code samples to help explain your problem.

**System:**
- OS: [e.g. iOS, Windows10, MacOS]
- Device: [e.g. iPhoneX, Macbook Pro 2018]
- Browser: [e.g. chrome, safari]
- Framework: [e.g. react, vue, angular]
- Addons: [if relevant]
- Version: [e.g. 4.0.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Are you able to assist bring the feature to reality?**
no | yes, I can...

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"tabWidth": 2,
"bracketSpacing": true,
"trailingComma": "es5",
"singleQuote": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object OpenSourceProjects_Storybook_Docs : BuildType({
artifactRules = "docs/public => docs.zip"

params {
param("Deploy branch", "release/3.4")
param("Deploy branch", "release/4.0")
}

vcs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ changeBuildType("759f0116-2f7d-4c03-8220-56e4ab03be3a") {
update {
password("env.DANGER_GITHUB_API_TOKEN", "credentialsJSON:9ac87388-d267-4def-a10e-3e596369f644")
}
expect {
param("env.PULL_REQUEST_URL", "https://github.com/storybooks/storybook/pull/%teamcity.build.branch%")
}
update {
param("env.PULL_REQUEST_URL", "https://github.com/storybooks/storybook/%teamcity.build.branch%")
}
}
}
131 changes: 125 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,122 @@

# 4.0.0

2018-October-29

[Storybook 4.0](https://medium.com/storybookjs/storybook-4-0-is-here-10b9857fc7de) is our first major-version update in over a year! Key improvements include:

- Build tools
- Webpack 4 [#3148](https://github.com/storybooks/storybook/pull/3148)
- Babel 7 [#3746](https://github.com/storybooks/storybook/pull/3746)
- View layers
- Storybook for Ember [#4237](https://github.com/storybooks/storybook/pull/4237)
- Storybook for MarkoJS [#3504](https://github.com/storybooks/storybook/pull/3504)
- Storybook for Mithril [#3244](https://github.com/storybooks/storybook/pull/3244)
- Storybook for HTML snippets [#3475](https://github.com/storybooks/storybook/pull/3475)
- Storybook for Svelte [#3770](https://github.com/storybooks/storybook/pull/3770)
- Storybook for Riot [#4070](https://github.com/storybooks/storybook/pull/4070)
- Mobile
- Mobile device view: toggling stories panel with ☰ button [#3337](https://github.com/storybooks/storybook/pull/3337)
- React Native: Remove the packager from storybook [#4261](https://github.com/storybooks/storybook/pull/4261)
- React-Native: On-device addons [#4381](https://github.com/storybooks/storybook/pull/4381)
- React-Native: On-device addons for notes, knobs, backgrounds [#4327](https://github.com/storybooks/storybook/pull/4327)
- UI
- Storybook UI theming [#3628](https://github.com/storybooks/storybook/pull/3628)
- Core
- Story parameters [#2679](https://github.com/storybooks/storybook/pull/2679)
- Generic addon decorators [#3555]
(https://github.com/storybooks/storybook/pull/3555)
- Support css-modules [#4405](https://github.com/storybooks/storybook/pull/4405)
- start-storybook: open browser tab on first compilation [#4149](https://github.com/storybooks/storybook/pull/4149)
- start-storybook: suggest an alternative when the port is occupied [#4146](https://github.com/storybooks/storybook/pull/4146)
- CLI-less Node api [#4344](https://github.com/storybooks/storybook/pull/4344)
- Rename CLI to sb [#4345](https://github.com/storybooks/storybook/pull/4345)

There are hundreds of more fixes, features, and tweaks in the 4.0 release. See changelogs for `4.0.0-rc.*` and `4.0.0-alpha.*` for details; check out our [migration guide](https://medium.com/storybookjs/migrating-to-storybook-4-c65b19a03d2c) for a walkthrough of how to upgrade or the
[migration docs](https://github.com/storybooks/storybook/blob/master/MIGRATION.md#from-version-34x-to-40x) for an enumeration of breaking changes.

# 4.0.0-rc.6

2018-October-25

#### Dependency Upgrades

- Upgrade react-komposer to 2.0.5 [#4547](https://github.com/storybooks/storybook/pull/4547)

# 4.0.0-rc.5

2018-October-25

#### Maintenance

- Fix issue with `sb init` on the Vue CLI [#4535](https://github.com/storybooks/storybook/pull/4535)

# 4.0.0-rc.4

2018-October-25

#### Features

- Ember: update to not require any manual setup [#4544](https://github.com/storybooks/storybook/pull/4544)

#### Bug Fixes

- React: add mini-css-extract-plugin to app/react dependencies [#4534](https://github.com/storybooks/storybook/pull/4534)

#### Maintenance

- Add angular@7 cli tests [#4524](https://github.com/storybooks/storybook/pull/4524)
- Fix the node-logger version in app/react [#4539](https://github.com/storybooks/storybook/pull/4539)

#### Dependency Upgrades

- Bump danger from 4.4.8 to 6.0.2 [#4538](https://github.com/storybooks/storybook/pull/4538)
- Bump react-test-renderer from 16.5.2 to 16.6.0 [#4536](https://github.com/storybooks/storybook/pull/4536)
- Bump fuse.js from 3.2.1 to 3.3.0 [#4537](https://github.com/storybooks/storybook/pull/4537)
- Bump riot from 3.12.0 to 3.13.0 [#4511](https://github.com/storybooks/storybook/pull/4511)


# 4.0.0-rc.3

2018-October-23

#### Bug Fixes

- Fix knobs select to support rich values [#4522](https://github.com/storybooks/storybook/pull/4522)
- Turn off spell check in story filter [#4472](https://github.com/storybooks/storybook/pull/4472)-

#### Maintenance

- ADD timeout to update check [#4530](https://github.com/storybooks/storybook/pull/4530)
- REMOVE emotion from demo components to make backwards compatibility easier && ADD demo components to official example [#4527](https://github.com/storybooks/storybook/pull/4527)
- Exclude story files from angular app build [#4485](https://github.com/storybooks/storybook/pull/4485)

# 4.0.0-rc.2

2018-October-22

#### Features

- Support css-modules [#4405](https://github.com/storybooks/storybook/pull/4405)
- Angular: Support sass files [#4343](https://github.com/storybooks/storybook/pull/4343)
- Support "mjs" extensions [#4466](https://github.com/storybooks/storybook/pull/4466)
- Allow presets to be async [#4450](https://github.com/storybooks/storybook/pull/4450)

#### Bug Fixes

- Addon-Jest: undefined file extension [#4452](https://github.com/storybooks/storybook/pull/4452)

#### Maintenance

- Override babelrc for the node related code [#4451](https://github.com/storybooks/storybook/pull/4451)
- Use cross-env in official example [#4474](https://github.com/storybooks/storybook/pull/4474)

#### Dependency Upgrades

- Bump copy-webpack-plugin from 4.5.3 to 4.5.4 [#4492](https://github.com/storybooks/storybook/pull/4492)
- Bump jest-image-snapshot from 2.5.0 to 2.6.0 [#4494](https://github.com/storybooks/storybook/pull/4494)
- Bump webpack from 4.20.2 to 4.21.0 [#4477](https://github.com/storybooks/storybook/pull/4477)

# 4.0.0-rc.1

2018-October-18
Expand Down Expand Up @@ -117,7 +236,7 @@

#### Features

- Ember: add ember support [#4237](https://github.com/storybooks/storybook/pull/4237)
- Storybook for Ember [#4237](https://github.com/storybooks/storybook/pull/4237)
- Riot: support the tagConstructor option [#4258](https://github.com/storybooks/storybook/pull/4258)
- Presets: Add "addons" and "config" to preset extensions [#4240](https://github.com/storybooks/storybook/pull/4240)

Expand Down Expand Up @@ -219,7 +338,7 @@

#### Features

- Riot support [#4070](https://github.com/storybooks/storybook/pull/4070)
- Storybook for Riot [#4070](https://github.com/storybooks/storybook/pull/4070)
- Backgrounds addon: Allow setting background via name [#4081](https://github.com/storybooks/storybook/pull/4081)
- Storysource addon: injectDecorator option custom stories [#4012](https://github.com/storybooks/storybook/pull/4012)

Expand Down Expand Up @@ -268,7 +387,7 @@ Not published to NPM
#### Features

- Emit messages when stories fail to render [#3967](https://github.com/storybooks/storybook/pull/3967)
- Svelte support [#3770](https://github.com/storybooks/storybook/pull/3770)
- Storybook for Svelte [#3770](https://github.com/storybooks/storybook/pull/3770)
- Allow extending extensions without a full control mode [#3976](https://github.com/storybooks/storybook/pull/3976)

#### Bug Fixes
Expand Down Expand Up @@ -695,7 +814,7 @@ NOTE: As part of the generic addon decorators, we've reversed the order of addon

#### Features

- Add marko support to storybooksJS [#3504](https://github.com/storybooks/storybook/pull/3504)
- Storybook for Marko [#3504](https://github.com/storybooks/storybook/pull/3504)
- Storybook addon Jest angular suport [#3532](https://github.com/storybooks/storybook/pull/3532)
- Storybook for HTML snippets [#3475](https://github.com/storybooks/storybook/pull/3475)
- Feature/config custom chrome executable path [#3518](https://github.com/storybooks/storybook/pull/3518)
Expand Down Expand Up @@ -1156,7 +1275,7 @@ Welcome to Storybook 3.4 with the following key improvements:
- Multiple story hierarchies [#2452](https://github.com/storybooks/storybook/pull/2452)
- Addon-storysource: story source in addon pane [#2885](https://github.com/storybooks/storybook/pull/2885)

Read on for more improvements, fixes, 1In addition, there are hundreds of dependency upgrades in the 3.4 release, so to see the details, please see the changelogs for `3.4.0-rc.*` and `3.4.0-alpha.*`.
Read on for more improvements, fixes. In addition, there are hundreds of dependency upgrades in the 3.4 release, so to see the details, please see the changelogs for `3.4.0-rc.*` and `3.4.0-alpha.*`.

#### Features

Expand Down Expand Up @@ -1260,7 +1379,7 @@ Read on for more improvements, fixes, 1In addition, there are hundreds of depend
#### Features

- Viewport-addon Allow setting callback to be called whenever viewport changes [#3283](https://github.com/storybooks/storybook/pull/3283)
- App for Mithril [#3244](https://github.com/storybooks/storybook/pull/3244)
- Storybook for Mithril [#3244](https://github.com/storybooks/storybook/pull/3244)
- Feature request: adding aXe configuration for a11y addon [#3285](https://github.com/storybooks/storybook/pull/3285)
- files knob [#2860](https://github.com/storybooks/storybook/pull/2860)
- Using svg-url-loader for webpack configs that accept svgs [#3221](https://github.com/storybooks/storybook/pull/3221)
Expand Down
64 changes: 50 additions & 14 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
# Migration

## Table of contents

- [From version 3.4.x to 4.0.x](#from-version-34x-to-40x)
- [React 16.3](#react-163)
- [React 16.3+](#react-163)
- [Generic addons](#generic-addons)
- [Knobs select ordering](#knobs-select-ordering)
- [Knobs URL parameters](#knobs-url-parameters)
- [Keyboard shortcuts moved](#keyboard-shortcuts-moved)
- [Removed addWithInfo](#removed-add-with-info)
- [Removed addWithInfo](#removed-addwithinfo)
- [Removed RN packager](#removed-rn-packager)
- [Removed RN addons](#removed-rn-addons)
- [Storyshots changes](#storyshots-changes)
- [Storyshots Changes](#storyshots-changes)
- [Webpack 4](#webpack-4)
- [Babel 7](#babel-7)
- [Create-react-app](#create-react-app)
- [CLI rename](#cli-rename)
- [Upgrade CRA1 to babel 7](#upgrade-cra1-to-babel-7)
- [Migrate CRA1 while keeping babel 6](#migrate-cra1-while-keeping-babel-6)
- [start-storybook opens browser](#start-storybook-opens-browser)
- [CLI Rename](#cli-rename)
- [Addon story parameters](#addon-story-parameters)
- [From version 3.3.x to 3.4.x](#from-version-33x-to-34x)
- [From version 3.2.x to 3.3.x](#from-version-32x-to-33x)
- [`babel-core` is now a peer dependency (#2494)](#babel-core-is-now-a-peer-dependency-2494)
- [Base webpack config now contains vital plugins (#1775)](#base-webpack-config-now-contains-vital-plugins-1775)
- [Refactored Knobs](#refactored-knobs)
- [Storyshots Jest configuration](#storyshots-jest-configuration)
- [From version 3.1.x to 3.2.x](#from-version-31x-to-32x)
- [Moved TypeScript addons definitions](#moved-typescript-addons-definitions)
- [Updated Addons API](#updated-addons-api)
Expand Down Expand Up @@ -164,7 +170,7 @@ Also make sure you have a `.babelrc` in your project directory. You probably alr
}
```

### start-storybook opens browser automatically
### start-storybook opens browser

If you're using `start-storybook` on CI, you may need to opt out of this using the new `--ci` flag.

Expand All @@ -173,9 +179,42 @@ If you're using `start-storybook` on CI, you may need to opt out of this using t
We've deprecated the `getstorybook` CLI in 4.0. The new way to install storybook is `sb init`. We recommend using `npx` for convenience and to make sure you're always using the latest version of the CLI:

```
npx -p @storybook/cli@rc sb init
npx -p @storybook/cli sb init
```

### Addon story parameters

Storybook 4 introduces story parameters, a more convenient way to configure how addons are configured.

```js
storiesOf('My component', module)
.add('story1', withNotes('some notes')(() => <Component ... />))
.add('story2', withNotes('other notes')(() => <Component ... />));
```

Becomes:

```js
// config.js
addDecorator(withNotes);

// Component.stories.js
storiesOf('My component', module)
.add('story1', () => <Component ... />, { notes: 'some notes' })
.add('story2', () => <Component ... />, { notes: 'other notes' });
```

This example applies notes globally to all stories. You can apply it locally with `storiesOf(...).addDecorator(withNotes)`.

The story parameters correspond directly to the old withX arguments, so it's easy to migrate your code. See the parameters documentation for the packages that have been upgraded:

- [Notes](https://github.com/storybooks/storybook/blob/master/addons/notes/README.md)
- [Jest](https://github.com/storybooks/storybook/blob/master/addons/jest/README.md)
- [Knobs](https://github.com/storybooks/storybook/blob/master/addons/knobs/README.md)
- [Viewport](https://github.com/storybooks/storybook/blob/master/addons/viewport/README.md)
- [Backgrounds](https://github.com/storybooks/storybook/blob/master/addons/backgrounds/README.md)
- [Options](https://github.com/storybooks/storybook/blob/master/addons/options/README.md)

## From version 3.3.x to 3.4.x

There are no expected breaking changes in the 3.4.x release, but 3.4 contains a major refactor to make it easier to support new frameworks, and we will document any breaking changes here if they arise.
Expand Down Expand Up @@ -288,13 +327,10 @@ All our packages have been renamed and published to npm as version 3.0.0 under t
To update your app to use the new package names, you can use the cli:

```bash
npm install --global @storybook/cli

# if you run this inside a v2 app, it should perform the necessary codemods.
storybook init
npx -p @storybook/cli sb init
```

#### Details
**Details**

If the above doesn't work, or you want to make the changes manually, the details are below:

Expand Down
Loading

0 comments on commit 69884b8

Please sign in to comment.