Merge branch 'next' into feature/action-args

This commit is contained in:
Michael Shilman 2020-03-11 15:07:00 +08:00
commit 2b3f137336
261 changed files with 5611 additions and 3707 deletions

View File

@ -7,7 +7,7 @@ aliases:
- image: circleci/node:10
jobs:
build:
install:
<<: *defaults
steps:
- checkout
@ -21,9 +21,6 @@ jobs:
- run:
name: Check that yarn.lock is not corrupted
command: yarn repo-dirty-check
- run:
name: Bootstrap
command: yarn bootstrap --core
- save_cache:
name: Cache core dependencies
key: core-dependencies-v4-{{ checksum "yarn.lock" }}
@ -40,6 +37,23 @@ jobs:
- dev-kits
- app
- lib
build:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Bootstrap
command: yarn bootstrap --core
- persist_to_workspace:
root: .
paths:
- examples
- addons
- dev-kits
- app
- lib
chromatic:
<<: *defaults
steps:
@ -111,7 +125,7 @@ jobs:
yarn packtracker
examples:
<<: *defaults
parallelism: 4
parallelism: 10
steps:
- checkout
- attach_workspace:
@ -292,7 +306,10 @@ jobs:
workflows:
test:
jobs:
- build
- install
- build:
requires:
- install
- lint:
requires:
- build

View File

@ -1,32 +0,0 @@
name: Puppeteer & A11y tests
on: [push]
jobs:
build:
name: Puppeteer & A11y tests
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: install, bootstrap
run: |
yarn bootstrap --core
- name: build storybook
run: |
yarn --cwd examples/official-storybook build-storybook
- name: test
run: |
yarn test --puppeteer

View File

@ -1,81 +0,0 @@
package OpenSourceProjects_Storybook.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.buildFeatures.commitStatusPublisher
import jetbrains.buildServer.configs.kotlin.v2017_2.buildSteps.script
import jetbrains.buildServer.configs.kotlin.v2017_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2017_2.triggers.retryBuild
import jetbrains.buildServer.configs.kotlin.v2017_2.triggers.VcsTrigger
object OpenSourceProjects_Storybook_Bootstrap : BuildType({
uuid = "9f9177e7-9ec9-4e2e-aabb-d304fd667712"
id = "OpenSourceProjects_Storybook_Bootstrap"
name = "Bootstrap"
artifactRules = """
addons/*/dist/** => dist.zip/addons
addons/storyshots/*/dist/** => dist.zip/addons/storyshots
app/*/dist/** => dist.zip/app
dev-kits/*/dist/** => dist.zip/dev-kits
lib/*/dist/** => dist.zip/lib
lib/core/dll/** => dist.zip/lib/core/dll
""".trimIndent()
vcs {
root(OpenSourceProjects_Storybook.vcsRoots.OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster)
}
steps {
script {
name = "Bootstrap"
scriptContent = """
#!/bin/sh
set -e -x
yarn
yarn bootstrap --core
""".trimIndent()
dockerImage = "node:%docker.node.version%"
}
}
triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
triggerRules = "-:comment=^TeamCity change:**"
branchFilter = """
+:pull/*
+:release/*
+:master
+:next
+:snyk-fix-*
""".trimIndent()
enabled = false
}
retryBuild {
delaySeconds = 60
enabled = false
}
}
features {
commitStatusPublisher {
publisher = github {
githubUrl = "https://api.github.com"
authType = personalToken {
token = "credentialsJSON:5ffe2d7e-531e-4f6f-b1fc-a41bfea26eaa"
}
}
param("github_oauth_user", "Hypnosphi")
}
}
requirements {
doesNotContain("env.OS", "Windows")
}
cleanup {
artifacts(days = 1)
}
})

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '1bda59b5-d08d-4fd8-b317-953e7d79d881' (id = 'OpenSourceProjects_Storybook_Docs')
accordingly, and delete the patch script.
*/
changeBuildType("1bda59b5-d08d-4fd8-b317-953e7d79d881") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '1ea2b5bd-28f6-44f5-8ab3-6c659ce8fbd6' (id = 'OpenSourceProjects_Storybook_SmokeTests')
accordingly, and delete the patch script.
*/
changeBuildType("1ea2b5bd-28f6-44f5-8ab3-6c659ce8fbd6") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '2b9c73e2-0a6e-47ca-95ae-729cac42be2b' (id = 'OpenSourceProjects_Storybook_Build_2')
accordingly, and delete the patch script.
*/
changeBuildType("2b9c73e2-0a6e-47ca-95ae-729cac42be2b") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '42cfbb9a-f35b-4f96-afae-0b508927a737' (id = 'OpenSourceProjects_Storybook_Lint')
accordingly, and delete the patch script.
*/
changeBuildType("42cfbb9a-f35b-4f96-afae-0b508927a737") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '42cfbb9a-f35b-4f96-afae-0b508927a738' (id = 'OpenSourceProjects_Storybook_Lint_Warnings')
accordingly, and delete the patch script.
*/
changeBuildType("42cfbb9a-f35b-4f96-afae-0b508927a738") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-angular' (id = 'OpenSourceProjects_Storybook_Angular')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-angular") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-chromatic' (id = 'OpenSourceProjects_Storybook_Chromatic')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-chromatic") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra' (id = 'OpenSourceProjects_Storybook_CRA')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra_react15' (id = 'OpenSourceProjects_Storybook_CRA_REACT15')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra_react15") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra_ts' (id = 'OpenSourceProjects_Storybook_CRA_TS')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-cra_ts") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-ember' (id = 'OpenSourceProjects_Storybook_Ember')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-ember") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-html' (id = 'OpenSourceProjects_Storybook_HTML')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-html") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-marko' (id = 'OpenSourceProjects_Storybook_Marko')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-marko") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-mithril' (id = 'OpenSourceProjects_Storybook_Mithril')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-mithril") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-polymer' (id = 'OpenSourceProjects_Storybook_Polymer')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-polymer") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-preact' (id = 'OpenSourceProjects_Storybook_Preact')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-preact") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-riot' (id = 'OpenSourceProjects_Storybook_Riot')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-riot") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-svelte' (id = 'OpenSourceProjects_Storybook_Svelte')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-svelte") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6-vue' (id = 'OpenSourceProjects_Storybook_Vue')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6-vue") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '8cc5f747-4ca7-4f0d-940d-b0c422f501a6' (id = 'OpenSourceProjects_Storybook_Examples')
accordingly, and delete the patch script.
*/
changeBuildType("8cc5f747-4ca7-4f0d-940d-b0c422f501a6") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,22 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '9f9177e7-9ec9-4e2e-aabb-d304fd667711' (id = 'OpenSourceProjects_Storybook_Test')
accordingly, and delete the patch script.
*/
changeBuildType("9f9177e7-9ec9-4e2e-aabb-d304fd667711") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
params {
add {
param("docker.node.version", "10.13")
}
}
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = '9f9177e7-9ec9-4e2e-aabb-d304fd667712' (id = 'OpenSourceProjects_Storybook_Bootstrap')
accordingly, and delete the patch script.
*/
changeBuildType("9f9177e7-9ec9-4e2e-aabb-d304fd667712") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.patches.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the buildType with uuid = 'd4320bd8-6094-4dd6-9bed-e13d6f0d12e2' (id = 'OpenSourceProjects_Storybook_CliTestLatestCra')
accordingly, and delete the patch script.
*/
changeBuildType("d4320bd8-6094-4dd6-9bed-e13d6f0d12e2") {
check(paused == false) {
"Unexpected paused: '$paused'"
}
paused = true
}

View File

@ -1,17 +0,0 @@
package OpenSourceProjects_Storybook.patches.projects
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.Project
import jetbrains.buildServer.configs.kotlin.v2017_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the project with uuid = '69382d9b-7791-418a-9ff6-1c83b86ed6b5' (id = 'OpenSourceProjects_Storybook')
accordingly, and delete the patch script.
*/
changeProject("69382d9b-7791-418a-9ff6-1c83b86ed6b5") {
check(archived == false) {
"Unexpected archived: '$archived'"
}
archived = true
}

View File

@ -1,20 +0,0 @@
package OpenSourceProjects_Storybook.vcsRoots
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.vcs.GitVcsRoot
object OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster : GitVcsRoot({
uuid = "cec03c4b-d52c-42a0-8e9e-53bde85d6b33"
id = "OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster"
name = "Main root"
url = "git@github.com:storybookjs/storybook.git"
branch = "refs/heads/next"
branchSpec = """
+:refs/(pull/*)/head
+:refs/heads/*
""".trimIndent()
authMethod = uploadedKey {
userName = "git"
uploadedKey = "Storybook bot"
}
})

View File

@ -1,16 +0,0 @@
package OpenSourceProjects_Storybook.vcsRoots
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.vcs.GitVcsRoot
object OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster1 : GitVcsRoot({
uuid = "5cacf90a-381a-4c73-9aa3-57f6439b545e"
id = "OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster1"
name = "https://github.com/storybookjs/storybook#refs/heads/master (1)"
url = "git@github.com:storybookjs/storybook.git"
branch = "refs/heads/next"
authMethod = uploadedKey {
userName = "git"
uploadedKey = "Storybook bot"
}
})

17
.teamcity/patches/templates/Common.kts vendored Normal file
View File

@ -0,0 +1,17 @@
package patches.templates
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.ui.*
/*
This patch script was generated by TeamCity on settings change in UI.
To apply the patch, change the template with id = 'Common'
accordingly, and delete the patch script.
*/
changeTemplate(RelativeId("Common")) {
requirements {
add {
doesNotContain("system.agent.name", "tiny", "RQ_1")
}
}
}

107
.teamcity/pom.xml vendored Normal file
View File

@ -0,0 +1,107 @@
<?xml version="1.0"?>
<project>
<modelVersion>4.0.0</modelVersion>
<name>Hosted_Root Config DSL Script</name>
<groupId>Hosted_Root</groupId>
<artifactId>Hosted_Root_dsl</artifactId>
<version>1.0-SNAPSHOT</version>
<parent>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>jetbrains-all</id>
<url>https://download.jetbrains.com/teamcity-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>teamcity-server</id>
<url>https://storybook.beta.teamcity.com/app/dsl-plugins-repository</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>JetBrains</id>
<url>https://download.jetbrains.com/teamcity-repository</url>
</pluginRepository>
</pluginRepositories>
<build>
<sourceDirectory>${basedir}</sourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<configuration/>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>teamcity-configs-maven-plugin</artifactId>
<version>${teamcity.dsl.version}</version>
<configuration>
<format>kotlin</format>
<dstDir>target/generated-configs</dstDir>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin</artifactId>
<version>${teamcity.dsl.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.teamcity</groupId>
<artifactId>configs-dsl-kotlin-plugins</artifactId>
<version>1.0-SNAPSHOT</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-script-runtime</artifactId>
<version>${kotlin.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<teamcity.dsl.version>2019.2.2-SNAPSHOT</teamcity.dsl.version>
</properties>
</project>

795
.teamcity/settings.kts vendored Normal file
View File

@ -0,0 +1,795 @@
import jetbrains.buildServer.configs.kotlin.v2019_2.*
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.PullRequests
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.commitStatusPublisher
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.pullRequests
import jetbrains.buildServer.configs.kotlin.v2019_2.buildFeatures.swabra
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.ScriptBuildStep
import jetbrains.buildServer.configs.kotlin.v2019_2.buildSteps.script
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.BuildFailureOnMetric
import jetbrains.buildServer.configs.kotlin.v2019_2.failureConditions.failOnMetricChange
import jetbrains.buildServer.configs.kotlin.v2019_2.projectFeatures.buildReportTab
import jetbrains.buildServer.configs.kotlin.v2019_2.projectFeatures.githubConnection
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.vcs
/*
The settings script is an entry point for defining a TeamCity
project hierarchy. The script should contain a single call to the
project() function with a Project instance or an init function as
an argument.
VcsRoots, BuildTypes, Templates, and subprojects can be
registered inside the project using the vcsRoot(), buildType(),
template(), and subProject() methods respectively.
To debug settings scripts in command-line, run the
mvnDebug org.jetbrains.teamcity:teamcity-configs-maven-plugin:generate
command and attach your debugger to the port 8000.
To debug in IntelliJ Idea, open the 'Maven Projects' tool window (View
-> Tool Windows -> Maven Projects), find the generate task node
(Plugins -> teamcity-configs -> teamcity-configs:generate), the
'Debug' option is available in the context menu for the task.
*/
version = "2019.2"
project {
template(Common)
defaultTemplate = Common
buildType(TestWorkflow)
buildType(Build)
buildType(Chromatic)
buildType(Packtracker)
buildType(E2E)
buildType(SmokeTests)
buildType(Frontpage)
buildType(Docs)
buildType(Lint)
buildType(Test)
buildType(Coverage)
subProject(ExamplesProject)
subProject(ChromaticProject)
buildTypesOrderIds = arrayListOf(
RelativeId("TestWorkflow"),
RelativeId("Build"),
RelativeId("Packtracker"),
RelativeId("Chromatic"),
RelativeId("E2E"),
RelativeId("SmokeTests"),
RelativeId("Frontpage"),
RelativeId("Docs"),
RelativeId("Lint"),
RelativeId("Test"),
RelativeId("Coverage")
)
features {
githubConnection {
id = "PROJECT_EXT_6"
displayName = "GitHub.com"
clientId = "800d730c725f771d6d2a"
clientSecret = "credentialsJSON:d1a5af15-1200-46c6-b0f1-f35bd466d909"
}
buildReportTab {
id = "PROJECT_EXT_8"
title = "Official"
startPage = "built-storybooks.tar.gz!official-storybook/index.html"
}
}
}
object Common: Template({
name = "Common"
vcs {
root(DslContext.settingsRoot)
checkoutMode = CheckoutMode.ON_AGENT
checkoutDir = "storybook/%teamcity.build.branch%"
}
features {
commitStatusPublisher {
id = "BUILD_EXT_1"
publisher = github {
githubUrl = "https://api.github.com"
authType = personalToken {
token = "credentialsJSON:5273320e-14be-4317-951e-a54c4dcca35d"
}
}
param("github_oauth_user", "Hypnosphi")
}
swabra {
id = "swabra"
verbose = true
paths = """
-:node_modules
-:**/node_modules
""".trimIndent()
}
pullRequests {
id = "BUILD_EXT_2"
provider = github {
authType = vcsRoot()
filterAuthorRole = PullRequests.GitHubRoleFilter.EVERYBODY
}
}
}
})
object Build : BuildType({
name = "Build"
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn repo-dirty-check
yarn bootstrap --core
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
artifactRules = """
+:**/dist/** => dist.tar.gz
+:**/dll/** => dist.tar.gz
-:**/node_modules/** => dist.tar.gz
""".trimIndent()
})
object Packtracker : BuildType({
name = "Packtracker"
description = "Report webpack stats for manager of official storybook"
dependencies {
dependency(Build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "dist.tar.gz!** => ."
}
}
}
steps {
script {
workingDir = "examples/official-storybook"
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn packtracker
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
params {
param("env.PT_BRANCH", "%teamcity.build.branch%")
}
})
object ExamplesProject : Project({
name = "Examples"
template(ExamplesTemplate)
buildType(Examples1)
buildType(Examples2)
buildType(Examples3)
buildType(Examples4)
buildType(Examples5)
buildType(AggregateExamples)
})
object ExamplesTemplate : Template({
name = "Examples Template"
dependencies {
dependency(Build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "dist.tar.gz!** => ."
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
rm -rf built-storybooks
mkdir -p built-storybooks
yarn build-storybooks
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
artifactRules = "built-storybooks => built-storybooks.tar.gz"
params {
param("env.CIRCLE_NODE_TOTAL", "5")
}
})
object Examples1 : BuildType({
name = "Examples 1"
templates = listOf(ExamplesTemplate)
params {
param("env.CIRCLE_NODE_INDEX", "0")
}
})
object Examples2 : BuildType({
name = "Examples 2"
templates = listOf(ExamplesTemplate)
params {
param("env.CIRCLE_NODE_INDEX", "1")
}
})
object Examples3 : BuildType({
name = "Examples 3"
templates = listOf(ExamplesTemplate)
params {
param("env.CIRCLE_NODE_INDEX", "2")
}
})
object Examples4 : BuildType({
name = "Examples 4"
templates = listOf(ExamplesTemplate)
params {
param("env.CIRCLE_NODE_INDEX", "3")
}
})
object Examples5 : BuildType({
name = "Examples 5"
templates = listOf(ExamplesTemplate)
params {
param("env.CIRCLE_NODE_INDEX", "4")
}
})
object AggregateExamples : BuildType({
name = "Aggregate Examples"
dependencies {
dependency(Examples1) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
dependency(Examples2) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
dependency(Examples3) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
dependency(Examples4) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
dependency(Examples5) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
artifactRules = "built-storybooks => built-storybooks.tar.gz"
})
object ChromaticProject : Project({
name = "Chromatic"
buildType(Chromatic1)
buildType(Chromatic2)
buildType(Chromatic3)
buildType(Chromatic4)
})
object Chromatic1 : BuildType({
name = "Chromatic 1"
dependencies {
dependency(AggregateExamples) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn chromatic --storybook-build-dir="built-storybooks/official-storybook" --exit-zero-on-changes --app-code="ab7m45tp9p"
yarn chromatic --storybook-build-dir="built-storybooks/angular-cli" --app-code="tl92yzsj6w"
yarn chromatic --storybook-build-dir="built-storybooks/cra-kitchen-sink" --app-code="tg55gajmdt"
yarn chromatic --storybook-build-dir="built-storybooks/cra-react15" --app-code="gxk7iqej3wt"
yarn chromatic --storybook-build-dir="built-storybooks/cra-ts-essentials" --app-code="b311ypk6of"
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object Chromatic2 : BuildType({
name = "Chromatic 2"
dependencies {
dependency(AggregateExamples) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn chromatic --storybook-build-dir="built-storybooks/cra-ts-kitchen-sink" --app-code="19whyj1tlac"
yarn chromatic --storybook-build-dir="built-storybooks/dev-kits" --app-code="7yykp9ifdxx"
yarn chromatic --storybook-build-dir="built-storybooks/ember-cli" --app-code="19z23qxndju"
yarn chromatic --storybook-build-dir="built-storybooks/html-kitchen-sink" --app-code="e8zolxoyg8o"
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object Chromatic3 : BuildType({
name = "Chromatic 3"
dependencies {
dependency(AggregateExamples) {
snapshot {
onDependencyFailure = FailureAction.IGNORE
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn chromatic --storybook-build-dir="built-storybooks/marko-cli" --app-code="qaegx64axu"
yarn chromatic --storybook-build-dir="built-storybooks/mithril-kitchen-sink" --app-code="8adgm46jzk8"
yarn chromatic --storybook-build-dir="built-storybooks/preact-kitchen-sink" --app-code="ls0ikhnwqt"
yarn chromatic --storybook-build-dir="built-storybooks/rax-kitchen-sink" --app-code="4co6vptx8qo"
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object Chromatic4 : BuildType({
name = "Chromatic 4"
dependencies {
dependency(AggregateExamples) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn chromatic --storybook-build-dir="built-storybooks/riot-kitchen-sink" --app-code="g2dp3lnr34a"
yarn chromatic --storybook-build-dir="built-storybooks/svelte-kitchen-sink" --app-code="8ob73wgl995"
yarn chromatic --storybook-build-dir="built-storybooks/vue-kitchen-sink" --app-code="cyxj0e38bqj"
yarn chromatic --storybook-build-dir="built-storybooks/web-components-kitchen-sink" --app-code="npm5gsofwkf"
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object Chromatic : BuildType({
name = "Chromatic"
type = Type.COMPOSITE
dependencies {
snapshot(Chromatic1) {}
snapshot(Chromatic2) {}
snapshot(Chromatic3) {}
snapshot(Chromatic4) {}
}
})
object E2E : BuildType({
name = "E2E"
dependencies {
dependency(AggregateExamples) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "built-storybooks.tar.gz!** => built-storybooks"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn cypress install
yarn serve-storybooks &
yarn await-serve-storybooks
yarn cypress run --reporter teamcity || :
yarn ts-node --transpile-only cypress/report-teamcity-metadata.ts || :
""".trimIndent()
dockerImage = "cypress/base:10.18.1"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
artifactRules = """
cypress/screenshots => screenshots.tar.gz
cypress/videos => videos.tar.gz
""".trimIndent()
failureConditions {
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.TEST_COUNT
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
comparison = BuildFailureOnMetric.MetricComparison.LESS
compareTo = value()
}
}
})
object SmokeTests : BuildType({
name = "Smoke Tests"
dependencies {
dependency(Build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "dist.tar.gz!** => ."
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
cd examples/cra-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../cra-ts-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../vue-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../svelte-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../angular-cli
yarn storybook --smoke-test --quiet
cd ../ember-cli
yarn storybook --smoke-test --quiet
cd ../marko-cli
yarn storybook --smoke-test --quiet
cd ../official-storybook
yarn storybook --smoke-test --quiet
cd ../mithril-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../riot-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../preact-kitchen-sink
yarn storybook --smoke-test --quiet
cd ../cra-react15
yarn storybook --smoke-test --quiet
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object Frontpage : BuildType({
name = "Frontpage"
type = Type.DEPLOYMENT
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn bootstrap --install
node ./scripts/build-frontpage.js
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
triggerRules = "-:.teamcity/**"
branchFilter = "+:master"
}
}
})
object Docs : BuildType({
name = "Docs"
type = Type.DEPLOYMENT
steps {
script {
workingDir = "docs"
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn build
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
triggerRules = "-:.teamcity/**"
branchFilter = """
+:<default>
+:next
+:master
+:pull/*
""".trimIndent()
}
}
})
object Lint : BuildType({
name = "Lint"
dependencies {
dependency(Build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "dist.tar.gz!** => ."
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
# TODO remove after merging
mkdir temp-eslint-teamcity
cd temp-eslint-teamcity
yarn init -y
yarn add -D eslint-teamcity
cd ..
yarn lint:js --format ./temp-eslint-teamcity/node_modules/eslint-teamcity/index.js .
yarn lint:md .
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
failureConditions {
failOnMetricChange {
metric = BuildFailureOnMetric.MetricType.INSPECTION_ERROR_COUNT
threshold = 0
units = BuildFailureOnMetric.MetricUnit.DEFAULT_UNIT
comparison = BuildFailureOnMetric.MetricComparison.MORE
compareTo = value()
}
}
})
object Test : BuildType({
name = "Test"
dependencies {
dependency(Build) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "dist.tar.gz!** => ."
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
# TODO remove after merging
mkdir temp-jest-teamcity
cd temp-jest-teamcity
yarn init -y
yarn add -D jest-teamcity
cd ..
yarn jest --coverage -w 2 --reporters=${'$'}PWD/temp-jest-teamcity/node_modules/jest-teamcity
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
artifactRules = "coverage => coverage.tar.gz"
})
object Coverage : BuildType({
name = "Coverage"
dependencies {
dependency(Test) {
snapshot {
onDependencyFailure = FailureAction.CANCEL
}
artifacts {
artifactRules = "coverage.tar.gz!** => coverage"
}
}
}
steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install
yarn coverage
""".trimIndent()
dockerImage = "node:10"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}
})
object TestWorkflow : BuildType({
name = "Test Workflow"
type = Type.COMPOSITE
maxRunningBuilds = 2
dependencies {
snapshot(Chromatic) {}
snapshot(Packtracker) {}
snapshot(E2E) {}
snapshot(SmokeTests) {}
snapshot(Lint) {}
snapshot(Coverage) {}
}
triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
triggerRules = "-:.teamcity/**"
branchFilter = """
+:<default>
+:next
+:master
+:pull/*
""".trimIndent()
}
}
})

View File

@ -1,3 +1,54 @@
## 6.0.0-alpha.22 (March 10, 2020)
### Breaking Changes
- MDX: Compile to improved source-loader format ([#10084](https://github.com/storybookjs/storybook/pull/10084))
### Features
- Core: Add args feature ([#10014](https://github.com/storybookjs/storybook/pull/10014))
### Maintenance
- Tech/improvements ([#10083](https://github.com/storybookjs/storybook/pull/10083))
- Few minor improvements extracted from the inception feature PR ([#10072](https://github.com/storybookjs/storybook/pull/10072))
- Tech/improvements ([#10070](https://github.com/storybookjs/storybook/pull/10070))
### Dependency Upgrades
- Yarn 2: Add missing dependencies ([#10012](https://github.com/storybookjs/storybook/pull/10012))
- Security: Remove usage of a vulnerable version of serialize-javascript ([#10071](https://github.com/storybookjs/storybook/pull/10071))
## 6.0.0-alpha.21 (March 5, 2020)
### Breaking Changes
- Core: Overhaul start.js and event emitting/listening ([#9914](https://github.com/storybookjs/storybook/pull/9914))
### Features
- CLI: Support js / jsx / ts / tsx stories in React CSF template ([#10003](https://github.com/storybookjs/storybook/pull/10003))
- Cra-kitchen-sink : Add Named Color Palette Example(MDX) ([#9709](https://github.com/storybookjs/storybook/pull/9709))
- Addon-Queryparams: Add addon preset ([#9949](https://github.com/storybookjs/storybook/pull/9949))
### Bug Fixes
- Addon-actions: Style ActionLogger to preserve whitespace ([#10046](https://github.com/storybookjs/storybook/pull/10046))
- Core: Disables html-webpack-plugin's option to remove script tag types ([#10042](https://github.com/storybookjs/storybook/pull/10042))
### Maintenance
- Tech: Misc improvements ([#10052](https://github.com/storybookjs/storybook/pull/10052))
- Tech: Misc improvements extracted from composition ([#10040](https://github.com/storybookjs/storybook/pull/10040))
- CI: change parallelism ([#10041](https://github.com/storybookjs/storybook/pull/10041))
- Storybook-official: try moving options to `manager.js` ([#9323](https://github.com/storybookjs/storybook/pull/9323))
- Misc: Add missing dependencies ([#9965](https://github.com/storybookjs/storybook/pull/9965))
- CI: Fix GitHub unit test workflow ([#9971](https://github.com/storybookjs/storybook/pull/9971))
### Dependency Upgrades
- Upgrade reach router ([#10016](https://github.com/storybookjs/storybook/pull/10016))
## 6.0.0-alpha.20 (February 27, 2020)
### Bug Fixes

View File

@ -135,11 +135,11 @@ First make sure the repo is bootstrapped.
Then run `yarn build-storybooks`, this creates a static website from all examples.
Then run `yarn serve-storybooks`, this will run the static sit of the port cypress expects.
Then run `yarn serve-storybooks`, this will run the static site on the port cypress expects.
Then run `yarn add cyress -W --optional`. When this has completed cypress should be installed on your system. If it is already on your system, this step can be skipped.
Then run `yarn add cypress -W --optional`. When this has completed cypress should be installed on your system. If it is already on your system, this step can be skipped.
Then run `yarn cypress open` if you ant to see the tests run in the UI, or `yarn cypress run` to run the tests headless.
Then run `yarn cypress open` if you want to see the tests run in the UI, or `yarn cypress run` to run the tests headless.
### Reproductions

View File

@ -1,91 +1,146 @@
# Migration
<h1>Migration</h1>
- [Migration](#migration)
- [From version 5.3.x to 6.0.x](#from-version-53x-to-60x)
- [New addon presets](#new-addon-presets)
- [Client API changes](#client-api-changes)
- [Removed legacy story APIs](#removed-legacy-story-apis)
- [Can no longer add decorators/parameters after stories](#can-no-longer-add-decorators-parameters-after-stories)
- [Changed Parameter Handling](#changed-parameter-handling)
- [Simplified Render Context](#simplified-render-context)
- [Story Store immutable outside of configuration](#story-store-immutable-outside-of-configuration)
- [From version 5.2.x to 5.3.x](#from-version-52x-to-53x)
- [To main.js configuration](#to-mainjs-configuration)
- [Create React App preset](#create-react-app-preset)
- [Description doc block](#description-doc-block)
- [React Native Async Storage](#react-native-async-storage)
- [Deprecate displayName parameter](#deprecate-displayname-parameter)
- [Unified docs preset](#unified-docs-preset)
- [Simplified hierarchy separators](#simplified-hierarchy-separators)
- [Addon StoryShots Puppeteer uses external puppeteer](#addon-storyshots-puppeteer-uses-external-puppeteer)
- [From version 5.1.x to 5.2.x](#from-version-51x-to-52x)
- [Source-loader](#source-loader)
- [Default viewports](#default-viewports)
- [Grid toolbar-feature](#grid-toolbar-feature)
- [Docs mode docgen](#docs-mode-docgen)
- [storySort option](#storysort-option)
- [From version 5.1.x to 5.1.10](#from-version-51x-to-5110)
- [babel.config.js support](#babelconfigjs-support)
- [From version 5.0.x to 5.1.x](#from-version-50x-to-51x)
- [React native server](#react-native-server)
- [Angular 7](#angular-7)
- [CoreJS 3](#corejs-3)
- [From version 5.0.1 to 5.0.2](#from-version-501-to-502)
- [Deprecate webpack extend mode](#deprecate-webpack-extend-mode)
- [From version 4.1.x to 5.0.x](#from-version-41x-to-50x)
- [sortStoriesByKind](#sortstoriesbykind)
- [Webpack config simplification](#webpack-config-simplification)
- [Theming overhaul](#theming-overhaul)
- [Story hierarchy defaults](#story-hierarchy-defaults)
- [Options addon deprecated](#options-addon-deprecated)
- [Individual story decorators](#individual-story-decorators)
- [Addon backgrounds uses parameters](#addon-backgrounds-uses-parameters)
- [Addon cssresources name attribute renamed](#addon-cssresources-name-attribute-renamed)
- [Addon viewport uses parameters](#addon-viewport-uses-parameters)
- [Addon a11y uses parameters, decorator renamed](#addon-a11y-uses-parameters-decorator-renamed)
- [New keyboard shortcuts defaults](#new-keyboard-shortcuts-defaults)
- [New URL structure](#new-url-structure)
- [Rename of the `--secure` cli parameter to `--https`](#rename-of-the---secure-cli-parameter-to---https)
- [Vue integration](#vue-integration)
- [From version 4.0.x to 4.1.x](#from-version-40x-to-41x)
- [Private addon config](#private-addon-config)
- [React 15.x](#react-15x)
- [From version 3.4.x to 4.0.x](#from-version-34x-to-40x)
- [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-addwithinfo)
- [Removed RN packager](#removed-rn-packager)
- [Removed RN addons](#removed-rn-addons)
- [Storyshots Changes](#storyshots-changes)
- [Webpack 4](#webpack-4)
- [Babel 7](#babel-7)
- [Create-react-app](#create-react-app)
- [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)
- [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)
- [From version 3.0.x to 3.1.x](#from-version-30x-to-31x)
- [Moved TypeScript definitions](#moved-typescript-definitions)
- [Deprecated head.html](#deprecated-headhtml)
- [From version 2.x.x to 3.x.x](#from-version-2xx-to-3xx)
- [Webpack upgrade](#webpack-upgrade)
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)
- [From version 5.3.x to 6.0.x](#from-version-53x-to-60x)
- [React prop tables with Typescript](#react-prop-tables-with-typescript)
- [New addon presets](#new-addon-presets)
- [Client API changes](#client-api-changes)
- [Removed Legacy Story APIs](#removed-legacy-story-apis)
- [Can no longer add decorators/parameters after stories](#can-no-longer-add-decoratorsparameters-after-stories)
- [Changed Parameter Handling](#changed-parameter-handling)
- [Simplified Render Context](#simplified-render-context)
- [Story Store immutable outside of configuration](#story-store-immutable-outside-of-configuration)
- [Improved story source handling](#improved-story-source-handling)
- [From version 5.2.x to 5.3.x](#from-version-52x-to-53x)
- [To main.js configuration](#to-mainjs-configuration)
- [Using main.js](#using-mainjs)
- [Using preview.js](#using-previewjs)
- [Using manager.js](#using-managerjs)
- [Create React App preset](#create-react-app-preset)
- [Description doc block](#description-doc-block)
- [React Native Async Storage](#react-native-async-storage)
- [Deprecate displayName parameter](#deprecate-displayname-parameter)
- [Unified docs preset](#unified-docs-preset)
- [Simplified hierarchy separators](#simplified-hierarchy-separators)
- [Addon StoryShots Puppeteer uses external puppeteer](#addon-storyshots-puppeteer-uses-external-puppeteer)
- [From version 5.1.x to 5.2.x](#from-version-51x-to-52x)
- [Source-loader](#source-loader)
- [Default viewports](#default-viewports)
- [Grid toolbar-feature](#grid-toolbar-feature)
- [Docs mode docgen](#docs-mode-docgen)
- [storySort option](#storysort-option)
- [From version 5.1.x to 5.1.10](#from-version-51x-to-5110)
- [babel.config.js support](#babelconfigjs-support)
- [From version 5.0.x to 5.1.x](#from-version-50x-to-51x)
- [React native server](#react-native-server)
- [Angular 7](#angular-7)
- [CoreJS 3](#corejs-3)
- [From version 5.0.1 to 5.0.2](#from-version-501-to-502)
- [Deprecate webpack extend mode](#deprecate-webpack-extend-mode)
- [From version 4.1.x to 5.0.x](#from-version-41x-to-50x)
- [sortStoriesByKind](#sortstoriesbykind)
- [Webpack config simplification](#webpack-config-simplification)
- [Theming overhaul](#theming-overhaul)
- [Story hierarchy defaults](#story-hierarchy-defaults)
- [Options addon deprecated](#options-addon-deprecated)
- [Individual story decorators](#individual-story-decorators)
- [Addon backgrounds uses parameters](#addon-backgrounds-uses-parameters)
- [Addon cssresources name attribute renamed](#addon-cssresources-name-attribute-renamed)
- [Addon viewport uses parameters](#addon-viewport-uses-parameters)
- [Addon a11y uses parameters, decorator renamed](#addon-a11y-uses-parameters-decorator-renamed)
- [New keyboard shortcuts defaults](#new-keyboard-shortcuts-defaults)
- [New URL structure](#new-url-structure)
- [Rename of the `--secure` cli parameter to `--https`](#rename-of-the---secure-cli-parameter-to---https)
- [Vue integration](#vue-integration)
- [From version 4.0.x to 4.1.x](#from-version-40x-to-41x)
- [Private addon config](#private-addon-config)
- [React 15.x](#react-15x)
- [From version 3.4.x to 4.0.x](#from-version-34x-to-40x)
- [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-addwithinfo)
- [Removed RN packager](#removed-rn-packager)
- [Removed RN addons](#removed-rn-addons)
- [Storyshots Changes](#storyshots-changes)
- [Webpack 4](#webpack-4)
- [Babel 7](#babel-7)
- [Create-react-app](#create-react-app)
- [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)
- [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)
- [From version 3.0.x to 3.1.x](#from-version-30x-to-31x)
- [Moved TypeScript definitions](#moved-typescript-definitions)
- [Deprecated head.html](#deprecated-headhtml)
- [From version 2.x.x to 3.x.x](#from-version-2xx-to-3xx)
- [Webpack upgrade](#webpack-upgrade)
- [Packages renaming](#packages-renaming)
- [Deprecated embedded addons](#deprecated-embedded-addons)
## From version 5.3.x to 6.0.x
### React prop tables with Typescript
Starting in 6.0 we are changing our recommended setup for extracting prop tables in `addon-docs` for React projects using TypeScript.
In earlier versions, we recommended `react-docgen-typescript-loader` (`RDTL`) and bundled it with `@storybook/preset-create-react-app` and `@storybook/preset-typescript` for this reason. We now recommend `babel-plugin-react-docgen`, which is already bundled as part of `@storybook/react`.
As a consequence we've removed `RDTL` from the presets, which is a breaking change. We made this change because `react-docgen` now supports TypeScript natively, and fewer dependencies simplifies things for everybody.
We will be updating this section with migration information as we collect information from our users, and fixing issues as they come up throughout the 6.0 prerelease process. We are cataloging known issues [here](https://github.com/storybookjs/storybook/blob/next/addons/docs/docs/props-tables.md#known-limitations).
The biggest known issue is https://github.com/reactjs/react-docgen/issues/387, which means that the following common pattern **DOESN'T WORK**:
```tsx
import React, { FC } from 'react';
interface IProps { ... };
const MyComponent: FC<IProps> = ({ ... }) => ...
```
The following workaround is needed:
```tsx
const MyComponent: FC<IProps> = ({ ... }: IProps) => ...
```
Please upvote https://github.com/reactjs/react-docgen/issues/387 if this is affecting your productivity, or better yet, submit a fix!
In the meantime, if you're not ready to make the move you have two options:
1. Pin your to a specific preset version: `preset-create-react-app@1.5.2` or `preset-typescript@1.2.2`
2. OR: Manually configure your setup to add back `react-docgen-typescript-loader`, add the following to your `.storybook/main.js`:
```js
module.exports = {
webpack: async (config, { configType }) => ({
...config,
module: {
...config.module,
rules: [
...config.module.rules,
{
test: /\.tsx?$/,
loader: require.resolve('react-docgen-typescript-loader'),
options: {}, // your options here
},
]
}
})
}
```
### New addon presets
In Storybook 5.3 we introduced a declarative [main.js configuration](#to-mainjs-configuration), which is now the recommended way to configure Storybook. Part of the change is a simplified syntax for registering addons, which in 6.0 automatically registers many addons _using a preset_, which is a slightly different behavior than in earlier versions.
@ -145,7 +200,7 @@ Although these were private APIs, if you were using them, you could probably use
You can no longer add decorators and parameters globally after you added your first story, and you can no longer add decorators and parameters to a kind after you've added your first story to it.
It unclear and confusing what happened if you did. If you want to disable a decorator for certain stories, use a parameter to do so:
It's unclear and confusing what would happened if you did. If you want to disable a decorator for certain stories, use a parameter to do so:
```js
export StoryOne = ...;
@ -197,6 +252,33 @@ The `RenderContext` that is passed to framework rendering layers in order to ren
You can no longer change the contents of the StoryStore outside of a `configure()` call. This is to ensure that any changes are properly published to the manager. If you want to add stories "out of band" you can call `store.startConfiguring()` and `store.finishConfiguring()` to ensure that your changes are published.
### Improved story source handling
The story source code handling has been improved in both `addon-storysource` and `addon-docs`.
In 5.x some users used an undocumented _internal_ API, `mdxSource` to customize source snippetization in `addon-docs`. This has been removed in 6.0.
The preferred way to customize source snippets for stories is now:
```js
export const Example = () => <Button />;
Example.story = {
parameters: {
storySource: {
source: 'custom source',
},
},
};
```
The MDX analog:
```jsx
<Story name="Example" parameters={{ storySource: { source: 'custom source' } }}>
<Button />
</Story>
```
## From version 5.2.x to 5.3.x
### To main.js configuration

View File

@ -109,21 +109,21 @@ For additional help, join us [in our Discord](https://discord.gg/sMFvFsG) or [Sl
### Supported Frameworks
| Framework | Demo | |
| -------------------------------- | ------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [React](app/react) | [v5.1.0](https://storybooks-official.netlify.com) | [![React](https://img.shields.io/npm/dm/@storybook/react.svg)](app/react) |
| [React Native](app/react-native) | - | [![React Native](https://img.shields.io/npm/dm/@storybook/react-native.svg)](app/react-native) |
| [Vue](app/vue) | [v5.1.0](https://storybooks-vue.netlify.com/) | [![Vue](https://img.shields.io/npm/dm/@storybook/vue.svg)](app/vue) |
| [Angular](app/angular) | [v5.1.0](https://storybooks-angular.netlify.com/) | [![Angular](https://img.shields.io/npm/dm/@storybook/angular.svg)](app/angular) |
| [Marionette.js](app/marionette) | - | [![Marionette.js](https://img.shields.io/npm/dm/@storybook/marionette.svg)](app/marionette) |
| [Mithril](app/mithril) | [v5.1.0](https://storybooks-mithril.netlify.com/) | [![Mithril](https://img.shields.io/npm/dm/@storybook/mithril.svg)](app/mithril) |
| [Marko](app/marko) | [v5.1.0](https://storybooks-marko.netlify.com/) | [![Marko](https://img.shields.io/npm/dm/@storybook/marko.svg)](app/marko) |
| [HTML](app/html) | [v5.1.0](https://storybooks-html.netlify.com/) | [![HTML](https://img.shields.io/npm/dm/@storybook/html.svg)](app/html) |
| [Svelte](app/svelte) | [v5.1.0](https://storybooks-svelte.netlify.com/) | [![Svelte](https://img.shields.io/npm/dm/@storybook/svelte.svg)](app/svelte) |
| [Riot](app/riot) | [v5.1.0](https://storybooks-riot.netlify.com/) | [![Riot](https://img.shields.io/npm/dm/@storybook/riot.svg)](app/riot) |
| [Ember](app/ember) | [v5.1.0](https://storybooks-ember.netlify.com/) | [![Ember](https://img.shields.io/npm/dm/@storybook/ember.svg)](app/ember) |
| [Preact](app/preact) | [v5.1.0](https://storybooks-preact.netlify.com/) | [![Preact](https://img.shields.io/npm/dm/@storybook/preact.svg)](app/preact) |
| [Rax](app/rax) | [v5.1.0](https://storybookjs.netlify.com/) | [![Rax](https://img.shields.io/npm/dm/@storybook/rax.svg)](app/rax) |
| Framework | Demo | |
| -------------------------------- | --------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [React](app/react) | [v5.3.0](https://storybookjs.netlify.com/official-storybook/?path=/story/*) | [![React](https://img.shields.io/npm/dm/@storybook/react.svg)](app/react) |
| [React Native](app/react-native) | - | [![React Native](https://img.shields.io/npm/dm/@storybook/react-native.svg)](app/react-native) |
| [Vue](app/vue) | [v5.3.0](https://storybookjs.netlify.com/vue-kitchen-sink/) | [![Vue](https://img.shields.io/npm/dm/@storybook/vue.svg)](app/vue) |
| [Angular](app/angular) | [v5.3.0](https://storybookjs.netlify.com/angular-cli/) | [![Angular](https://img.shields.io/npm/dm/@storybook/angular.svg)](app/angular) |
| [Marionette.js](app/marionette) | - | [![Marionette.js](https://img.shields.io/npm/dm/@storybook/marionette.svg)](app/marionette) |
| [Mithril](app/mithril) | [v5.3.0](https://storybookjs.netlify.com/mithril-kitchen-sink/) | [![Mithril](https://img.shields.io/npm/dm/@storybook/mithril.svg)](app/mithril) |
| [Marko](app/marko) | [v5.3.0](https://storybookjs.netlify.com/marko-cli/) | [![Marko](https://img.shields.io/npm/dm/@storybook/marko.svg)](app/marko) |
| [HTML](app/html) | [v5.3.0](https://storybookjs.netlify.com/html-kitchen-sink/) | [![HTML](https://img.shields.io/npm/dm/@storybook/html.svg)](app/html) |
| [Svelte](app/svelte) | [v5.3.0](https://storybookjs.netlify.com/svelte-kitchen-sink/) | [![Svelte](https://img.shields.io/npm/dm/@storybook/svelte.svg)](app/svelte) |
| [Riot](app/riot) | [v5.3.0](https://storybookjs.netlify.com/riot-kitchen-sink/) | [![Riot](https://img.shields.io/npm/dm/@storybook/riot.svg)](app/riot) |
| [Ember](app/ember) | [v5.3.0](https://storybookjs.netlify.com/ember-cli/) | [![Ember](https://img.shields.io/npm/dm/@storybook/ember.svg)](app/ember) |
| [Preact](app/preact) | [v5.3.0](https://storybookjs.netlify.com/preact-kitchen-sink/) | [![Preact](https://img.shields.io/npm/dm/@storybook/preact.svg)](app/preact) |
| [Rax](app/rax) | [v5.3.0](https://storybookjs.netlify.com/rax-kitchen-sink/) | [![Rax](https://img.shields.io/npm/dm/@storybook/rax.svg)](app/rax) |
### Sub Projects

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "a11y addon for storybook",
"keywords": [
"a11y",
@ -33,13 +33,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"axe-core": "^3.3.2",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -26,7 +26,7 @@ const Icon = styled(Icons)({
marginRight: 4,
});
const RotatingIcon = styled(Icon)(({ theme }) => ({
const RotatingIcon = styled(Icon)<{}>(({ theme }) => ({
animation: `${theme.animation.rotate360} 1s linear infinite;`,
}));

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Action Logger addon for storybook",
"keywords": [
"storybook"
@ -28,12 +28,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"fast-deep-equal": "^3.1.1",
"global": "^4.3.2",

View File

@ -8,6 +8,7 @@ export const Action = styled.div({
borderBottom: '1px solid transparent',
transition: 'all 0.1s',
alignItems: 'flex-start',
whiteSpace: 'pre',
});
export const Counter = styled.div<{}>(({ theme }) => ({

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-backgrounds",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "A storybook addon to show different backgrounds for your preview",
"keywords": [
"addon",
@ -32,12 +32,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"memoizerific": "^1.11.3",
"react": "^16.8.3",

View File

@ -64,7 +64,7 @@ const getSelectedBackgroundColor = (list: Input[], currentSelectedValue: string)
};
const mapper = ({ api, state }: Combo): { items: Input[]; selected: string | null } => {
const story = state.storiesHash[state.storyId];
const story = api.getData(state.storyId);
const list = story ? api.getParameters(story.id, PARAM_KEY) : [];
const selected = state.addons[PARAM_KEY] || null;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-centered",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook decorator to center components",
"keywords": [
"addon",
@ -30,7 +30,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",

View File

@ -84,7 +84,7 @@ Finally, you may want to modify the default setups at per story level. Here is h
export const defaultView = () => <div />;
defaultView.story = {
parameters: {
context: [{}]
contexts: [{}]
}
};
```

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-contexts",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook Addon Contexts",
"keywords": [
"preact",
@ -28,10 +28,10 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"qs": "^6.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-cssresources",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "A storybook addon to switch between css resources at runtime for your story",
"keywords": [
"addon",
@ -32,11 +32,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-design-assets",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Design asset preview for storybook",
"keywords": [
"addon",
@ -34,12 +34,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",

View File

@ -10,6 +10,7 @@ Storybook Docs automatically generates props tables for components in supported
- [Reporting a bug](#reporting-a-bug)
- [Known limitations](#known-limitations)
- [React](#react)
- [Fully support React.FC](#fully-support-reactfc)
- [Vue](#vue)
- [Angular](#angular)
- [Web components](#web-components)
@ -73,6 +74,24 @@ This package relies on a variety of sub-packages to extract property information
SB Docs for React uses `babel-plugin-react-docgen`/`react-docgen` for both JS PropTypes prop tables and, as of 6.0, TypeScript-driven props tables.
#### Fully support React.FC
The biggest known issue is https://github.com/reactjs/react-docgen/issues/387, which means that the following common pattern **DOESN'T WORK**:
```tsx
import React, { FC } from 'react';
interface IProps { ... };
const MyComponent: FC<IProps> = ({ ... }) => ...
```
The following workaround is needed:
```tsx
const MyComponent: FC<IProps> = ({ ... }: IProps) => ...
```
Please upvote https://github.com/reactjs/react-docgen/issues/387 if this is affecting your productivity, or better yet, submit a fix!
### Vue
SB Docs for Vue uses `vue-docgen-loader`/`vue-docgen-api` for SFC and JSX components.

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-docs",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Superior documentation for your components",
"keywords": [
"addon",
@ -41,20 +41,22 @@
"@babel/generator": "^7.8.4",
"@babel/parser": "^7.8.4",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@babel/preset-env": "^7.8.4",
"@egoist/vue-to-react": "^1.1.0",
"@jest/transform": "^25.1.0",
"@mdx-js/loader": "^1.5.1",
"@mdx-js/mdx": "^1.5.1",
"@mdx-js/react": "^1.5.1",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/csf": "0.0.1",
"@storybook/postinstall": "6.0.0-alpha.20",
"@storybook/source-loader": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/node-logger": "6.0.0-alpha.22",
"@storybook/postinstall": "6.0.0-alpha.22",
"@storybook/source-loader": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"acorn": "^7.1.0",
"acorn-jsx": "^5.1.0",
"acorn-walk": "^7.0.0",
@ -76,28 +78,53 @@
"vue-docgen-loader": "^1.4.0"
},
"devDependencies": {
"@storybook/react": "6.0.0-alpha.20",
"@storybook/web-components": "6.0.0-alpha.20",
"@angular/core": "^8.2.8",
"@babel/core": "^7.8.4",
"@emotion/core": "^10.0.20",
"@emotion/styled": "^10.0.17",
"@storybook/react": "6.0.0-alpha.22",
"@storybook/web-components": "6.0.0-alpha.22",
"@types/doctrine": "^0.0.3",
"@types/enzyme": "^3.10.3",
"@types/jest": "^25.1.1",
"@types/prop-types": "^15.5.9",
"@types/util-deprecate": "^1.0.0",
"babel-loader": "^8.0.6",
"babel-plugin-react-docgen": "^4.1.0",
"cross-spawn": "^7.0.1",
"fs-extra": "^8.1.0",
"jest": "^25.1.0",
"jest-specific-snapshot": "^2.0.0",
"lit-element": "^2.2.1",
"lit-html": "^1.0.0",
"prettier": "^1.18.2",
"react": "^16.8.3",
"react-dom": "^16.8.3",
"react-is": "^16.12.0",
"require-from-string": "^2.0.2",
"rxjs": "^6.5.4",
"styled-components": "^5.0.1",
"tmp": "^0.1.0",
"web-component-analyzer": "^1.0.3"
"web-component-analyzer": "^1.0.3",
"webpack": "^4.33.0",
"zone.js": "^0.10.2"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0",
"babel-loader": "^8.0.0",
"react": "^16.9.0",
"react": ">=16.3.0",
"react-dom": "*",
"react-is": "^16.8.0"
"react-is": "^16.8.0",
"vue": "^2.6.10",
"webpack": ">=4"
},
"peerDependenciesMeta": {
"vue": {
"optional": true
},
"webpack": {
"optional": true
}
},
"publishConfig": {
"access": "public"

View File

@ -1,6 +1,5 @@
import fs from 'fs';
import { presetsAddPreset, getFrameworks } from '@storybook/postinstall';
// eslint-disable-next-line import/no-extraneous-dependencies
import { logger } from '@storybook/node-logger';
export default function transformer(file, api) {

View File

@ -75,8 +75,8 @@ export const getSourceProps = (
.map(sourceId => {
const data = storyStore.fromId(sourceId);
if (data && data.parameters) {
const { mdxSource, storySource } = data.parameters;
return mdxSource || (storySource && extract(sourceId, storySource));
const { storySource } = data.parameters;
return storySource && extract(sourceId, storySource);
}
return '';
})

View File

@ -26,5 +26,10 @@ export const extractProps = componentName => {
export const extractComponentDescription = componentName => {
const json = getJSONDoc();
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
if (!componentDoc) {
return '';
}
return componentDoc.attributes.description;
};

View File

@ -0,0 +1,36 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`react component properties 10017-ts-union 1`] = `
"import React from 'react';
const Avatar = ({
icon
}) => {
return React.createElement(\\"div\\", {
className: \\"hello\\"
}, \\"Hello Component \\", icon);
};
export const component = Avatar;
Avatar.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"Avatar\\",
\\"props\\": {
\\"icon\\": {
\\"required\\": true,
\\"tsType\\": {
\\"name\\": \\"union\\",
\\"raw\\": \\"React.ReactNode | string\\",
\\"elements\\": [{
\\"name\\": \\"ReactReactNode\\",
\\"raw\\": \\"React.ReactNode\\"
}, {
\\"name\\": \\"string\\"
}]
},
\\"description\\": \\"specify icon=\\\\\\"search\\\\\\" or icon={IconComponent}\\"
}
}
};"
`;

View File

@ -0,0 +1,12 @@
import React from 'react';
interface AvatarProps {
/** specify icon="search" or icon={IconComponent} */
icon: React.ReactNode | string;
}
const Avatar = ({ icon }: AvatarProps) => {
return <div className="hello">Hello Component {icon}</div>;
};
export const component = Avatar;

View File

@ -0,0 +1,18 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`react component properties 10017-ts-union 1`] = `
Object {
"rows": Array [
Object {
"defaultValue": null,
"description": "specify icon=\\"search\\" or icon={IconComponent}",
"name": "icon",
"required": true,
"type": Object {
"detail": undefined,
"summary": "union",
},
},
],
}
`;

View File

@ -14,6 +14,7 @@ React.createElement(\\"button\\", {
Button.__docgenInfo = {
\\"description\\": \\"\\",
\\"methods\\": [],
\\"displayName\\": \\"Button\\",
\\"props\\": {
\\"disabled\\": {
\\"defaultValue\\": {

View File

@ -24,6 +24,7 @@ interface ParsingResult<T> {
}
const ACORN_WALK_VISITORS = {
// @ts-ignore
...acornWalk.base,
JSXElement: () => {},
};
@ -43,6 +44,7 @@ function calculateNodeDepth(node: estree.Expression): number {
const depths: number[] = [];
acornWalk.ancestor(
// @ts-ignore
node,
{
ObjectExpression(_: any, ancestors: estree.Node[]) {
@ -82,6 +84,7 @@ function parseFunction(
// If there is at least a JSXElement in the body of the function, then it's a React component.
acornWalk.simple(
// @ts-ignore
funcNode.body,
{
JSXElement(node: any) {
@ -117,6 +120,7 @@ function parseClass(
// If there is at least a JSXElement in the body of the class, then it's a React component.
acornWalk.simple(
// @ts-ignore
classNode.body,
{
JSXElement(node: any) {

View File

@ -35,7 +35,7 @@ MDXContent.isMDXComponent = true;
export const componentNotes = () => <Button>Component notes</Button>;
componentNotes.story = {};
componentNotes.story.name = 'component notes';
componentNotes.story.parameters = { mdxSource: '<Button>Component notes</Button>' };
componentNotes.story.parameters = { storySource: { source: '<Button>Component notes</Button>' } };
const componentMeta = { title: 'Button', id: 'button-id', includeStories: ['componentNotes'] };

View File

@ -54,7 +54,7 @@ MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.story = {};
one.story.name = 'one';
one.story.parameters = { mdxSource: '<Button>One</Button>' };
one.story.parameters = { storySource: { source: '<Button>One</Button>' } };
one.story.decorators = [storyFn => <div className=\\"local\\">{storyFn()}</div>];
const componentMeta = {

View File

@ -42,12 +42,12 @@ MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.story = {};
one.story.name = 'one';
one.story.parameters = { mdxSource: '<Button>One</Button>' };
one.story.parameters = { storySource: { source: '<Button>One</Button>' } };
export const helloStory = () => <Button>Hello button</Button>;
helloStory.story = {};
helloStory.story.name = 'hello story';
helloStory.story.parameters = { mdxSource: '<Button>Hello button</Button>' };
helloStory.story.parameters = { storySource: { source: '<Button>Hello button</Button>' } };
const componentMeta = { title: 'Button', includeStories: ['one', 'helloStory'] };

View File

@ -51,13 +51,13 @@ MDXContent.isMDXComponent = true;
export const componentNotes = () => <Button>Component notes</Button>;
componentNotes.story = {};
componentNotes.story.name = 'component notes';
componentNotes.story.parameters = { mdxSource: '<Button>Component notes</Button>' };
componentNotes.story.parameters = { storySource: { source: '<Button>Component notes</Button>' } };
export const storyNotes = () => <Button>Story notes</Button>;
storyNotes.story = {};
storyNotes.story.name = 'story notes';
storyNotes.story.parameters = {
mdxSource: '<Button>Story notes</Button>',
storySource: { source: '<Button>Story notes</Button>' },
...{
notes: 'story notes',
},

View File

@ -55,12 +55,12 @@ MDXContent.isMDXComponent = true;
export const helloButton = () => <Button>Hello button</Button>;
helloButton.story = {};
helloButton.story.name = 'hello button';
helloButton.story.parameters = { mdxSource: '<Button>Hello button</Button>' };
helloButton.story.parameters = { storySource: { source: '<Button>Hello button</Button>' } };
export const two = () => <Button>Two</Button>;
two.story = {};
two.story.name = 'two';
two.story.parameters = { mdxSource: '<Button>Two</Button>' };
two.story.parameters = { storySource: { source: '<Button>Two</Button>' } };
const componentMeta = {
title: 'Button',

View File

@ -35,7 +35,7 @@ MDXContent.isMDXComponent = true;
export const text = () => 'Plain text';
text.story = {};
text.story.name = 'text';
text.story.parameters = { mdxSource: \\"'Plain text'\\" };
text.story.parameters = { storySource: { source: \\"'Plain text'\\" } };
const componentMeta = { title: 'Text', includeStories: ['text'] };

View File

@ -45,22 +45,22 @@ MDXContent.isMDXComponent = true;
export const one = () => <Button>One</Button>;
one.story = {};
one.story.name = 'one';
one.story.parameters = { mdxSource: '<Button>One</Button>' };
one.story.parameters = { storySource: { source: '<Button>One</Button>' } };
export const helloStory = () => <Button>Hello button</Button>;
helloStory.story = {};
helloStory.story.name = 'hello story';
helloStory.story.parameters = { mdxSource: '<Button>Hello button</Button>' };
helloStory.story.parameters = { storySource: { source: '<Button>Hello button</Button>' } };
export const wPunctuation = () => <Button>with punctuation</Button>;
wPunctuation.story = {};
wPunctuation.story.name = 'w/punctuation';
wPunctuation.story.parameters = { mdxSource: '<Button>with punctuation</Button>' };
wPunctuation.story.parameters = { storySource: { source: '<Button>with punctuation</Button>' } };
export const _1FineDay = () => <Button>starts with number</Button>;
_1FineDay.story = {};
_1FineDay.story.name = '1 fine day';
_1FineDay.story.parameters = { mdxSource: '<Button>starts with number</Button>' };
_1FineDay.story.parameters = { storySource: { source: '<Button>starts with number</Button>' } };
const componentMeta = {
title: 'Button',

View File

@ -39,7 +39,7 @@ MDXContent.isMDXComponent = true;
export const basic = assertIsFn(basicFn);
basic.story = {};
basic.story.name = 'basic';
basic.story.parameters = { mdxSource: 'basicFn' };
basic.story.parameters = { storySource: { source: 'basicFn' } };
const componentMeta = { title: 'story-function-var', includeStories: ['basic'] };

View File

@ -42,8 +42,10 @@ export const functionStory = () => {
functionStory.story = {};
functionStory.story.name = 'function';
functionStory.story.parameters = {
mdxSource:
\\"() => {\\\\n const btn = document.createElement('button');\\\\n btn.innerHTML = 'Hello Button';\\\\n btn.addEventListener('click', action('Click'));\\\\n return btn;\\\\n}\\",
storySource: {
source:
\\"() => {\\\\n const btn = document.createElement('button');\\\\n btn.innerHTML = 'Hello Button';\\\\n btn.addEventListener('click', action('Click'));\\\\n return btn;\\\\n}\\",
},
};
const componentMeta = { includeStories: ['functionStory'] };

View File

@ -54,8 +54,10 @@ export const toStorybook = () => ({
toStorybook.story = {};
toStorybook.story.name = 'to storybook';
toStorybook.story.parameters = {
mdxSource:
'{\\\\n template: \`<storybook-welcome-component (showApp)=\\"showApp()\\"></storybook-welcome-component>\`,\\\\n props: {\\\\n showApp: linkTo(\\\\'Button\\\\')\\\\n },\\\\n moduleMetadata: {\\\\n declarations: [Welcome]\\\\n }\\\\n}',
storySource: {
source:
'{\\\\n template: \`<storybook-welcome-component (showApp)=\\"showApp()\\"></storybook-welcome-component>\`,\\\\n props: {\\\\n showApp: linkTo(\\\\'Button\\\\')\\\\n },\\\\n moduleMetadata: {\\\\n declarations: [Welcome]\\\\n }\\\\n}',
},
};
const componentMeta = { title: 'MDX|Welcome', includeStories: ['toStorybook'] };

View File

@ -94,12 +94,12 @@ function genStoryExport(ast, context) {
let parameters = getAttr(ast.openingElement, 'parameters');
parameters = parameters && parameters.expression;
const source = jsStringEscape(storyCode);
const sourceParam = `storySource: { source: '${source}' }`;
if (parameters) {
const { code: params } = generate(parameters, {});
// FIXME: hack in the story's source as a parameter
statements.push(`${storyKey}.story.parameters = { mdxSource: '${source}', ...${params} };`);
statements.push(`${storyKey}.story.parameters = { ${sourceParam}, ...${params} };`);
} else {
statements.push(`${storyKey}.story.parameters = { mdxSource: '${source}' };`);
statements.push(`${storyKey}.story.parameters = { ${sourceParam} };`);
}
let decorators = getAttr(ast.openingElement, 'decorators');

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-essentials",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Curated addons to bring out the best of Storybook",
"keywords": [
"addon",
@ -28,11 +28,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addon-backgrounds": "6.0.0-alpha.20",
"@storybook/addon-viewport": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/node-logger": "6.0.0-alpha.20",
"@storybook/addon-backgrounds": "6.0.0-alpha.22",
"@storybook/addon-viewport": "6.0.0-alpha.22",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/node-logger": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"regenerator-runtime": "^0.13.3",
"ts-dedent": "^1.1.1"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-events",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Add events to your Storybook stories.",
"keywords": [
"addon",
@ -31,11 +31,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"format-json": "^1.0.3",
"lodash": "^4.17.15",

View File

@ -1,5 +1,4 @@
import React, { ChangeEvent, Component } from 'react';
import PropTypes from 'prop-types';
import { polyfill } from 'react-lifecycles-compat';
import isEqual from 'lodash/isEqual';
@ -109,19 +108,7 @@ interface ItemState {
}
class Item extends Component<ItemProps, ItemState> {
static propTypes = {
name: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
onEmit: PropTypes.func.isRequired,
// eslint-disable-next-line react/forbid-prop-types
payload: PropTypes.any,
};
static defaultProps = {
payload: {},
};
static getDerivedStateFromProps = ({ payload }: ItemProps, { prevPayload }: ItemState) => {
static getDerivedStateFromProps = ({ payload = {} }: ItemProps, { prevPayload }: ItemState) => {
if (!isEqual(payload, prevPayload)) {
const payloadString = json.plain(payload);
const refinedPayload = getJSONFromString(payloadString);

View File

@ -1,5 +1,4 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { styled } from '@storybook/theming';
import { API } from '@storybook/api';
@ -24,15 +23,6 @@ interface EventsPanelState {
}
export default class EventsPanel extends Component<EventsPanelProps, EventsPanelState> {
static propTypes = {
active: PropTypes.bool.isRequired,
api: PropTypes.shape({
emit: PropTypes.func,
off: PropTypes.func,
on: PropTypes.func,
}).isRequired,
};
state: EventsPanelState = {
events: [],
};

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-google-analytics",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook addon for google analytics",
"keywords": [
"addon",
@ -20,8 +20,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react-ga": "^2.5.7",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-graphql",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook addon to display the GraphiQL IDE",
"keywords": [
"addon",
@ -29,8 +29,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"graphiql": "^0.17.5",

View File

@ -1,10 +1,6 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import { style } from './style';
export const FullScreen: FunctionComponent = ({ children }) => {
return <div style={style.wrapper}>{children}</div>;
};
FullScreen.defaultProps = { children: null };
FullScreen.propTypes = { children: PropTypes.node };

View File

@ -1,5 +1,4 @@
import React, { FunctionComponent } from 'react';
import PropTypes from 'prop-types';
import GraphiQL from 'graphiql';
import 'graphiql/graphiql.css';
@ -16,7 +15,7 @@ const GQL: FunctionComponent<GQLProps> = ({ active }) => {
return active ? (
<Consumer>
{({ api, state }: Combo) => {
const story = state.storiesHash[state.storyId];
const story = api.getData(state.storyId);
const parameters = story ? api.getParameters(story.id, PARAM_KEY) : null;
if (parameters) {
@ -32,8 +31,5 @@ const GQL: FunctionComponent<GQLProps> = ({ active }) => {
</Consumer>
) : null;
};
GQL.propTypes = {
active: PropTypes.bool.isRequired,
};
export default GQL;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-jest",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "React storybook addon that show component jest report",
"keywords": [
"addon",
@ -35,11 +35,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"react": "^16.8.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-knobs",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook Addon Prop Editor Component",
"keywords": [
"addon",
@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/channels": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/channels": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"@types/react-color": "^3.0.1",
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-links",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Story Links addon for storybook",
"keywords": [
"addon",
@ -29,11 +29,11 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/csf": "0.0.1",
"@storybook/router": "6.0.0-alpha.20",
"@storybook/router": "6.0.0-alpha.22",
"@types/qs": "^6.9.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-options",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Options addon for storybook",
"keywords": [
"addon",
@ -29,7 +29,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"regenerator-runtime": "^0.13.3",
"util-deprecate": "^1.0.2"

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-queryparams",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "parameter addon for storybook",
"keywords": [
"addon",
@ -30,12 +30,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"qs": "^6.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "StoryShots is a Jest Snapshot Testing Addon for Storybook.",
"keywords": [
"addon",
@ -33,9 +33,9 @@
},
"dependencies": {
"@jest/transform": "^25.1.0",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/client-api": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@types/glob": "^7.1.1",
"@types/jest": "^25.1.1",
"@types/jest-specific-snapshot": "^0.5.3",
@ -50,8 +50,8 @@
"ts-dedent": "^1.1.1"
},
"devDependencies": {
"@storybook/addon-docs": "6.0.0-alpha.20",
"@storybook/react": "6.0.0-alpha.20",
"@storybook/addon-docs": "6.0.0-alpha.22",
"@storybook/react": "6.0.0-alpha.22",
"babel-loader": "^8.0.6",
"enzyme": "^3.11.0",
"enzyme-to-json": "^3.4.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storyshots-puppeteer",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Image snapshots addition to StoryShots based on puppeteer",
"keywords": [
"addon",
@ -30,7 +30,7 @@
},
"dependencies": {
"@storybook/csf": "0.0.1",
"@storybook/node-logger": "6.0.0-alpha.20",
"@storybook/node-logger": "6.0.0-alpha.22",
"@types/jest-image-snapshot": "^2.8.0",
"@wordpress/jest-puppeteer-axe": "^1.5.0",
"core-js": "^3.0.1",
@ -42,7 +42,7 @@
"@types/puppeteer": "^2.0.0"
},
"peerDependencies": {
"@storybook/addon-storyshots": "6.0.0-alpha.20",
"@storybook/addon-storyshots": "6.0.0-alpha.22",
"puppeteer": "^1.12.2 || ^2.0.0"
},
"peerDependenciesMeta": {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-storysource",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Stories addon for storybook",
"keywords": [
"addon",
@ -29,13 +29,13 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/router": "6.0.0-alpha.20",
"@storybook/source-loader": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/router": "6.0.0-alpha.22",
"@storybook/source-loader": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"estraverse": "^4.2.0",
"loader-utils": "^1.2.3",

View File

@ -58,7 +58,7 @@ export const StoryPanel: React.FC<StoryPanelProps> = ({ api }) => {
if (story) {
const {
parameters: {
mdxSource = '',
// @ts-ignore
storySource: { source, locationsMap } = { source: '', locationsMap: {} },
} = {},
} = story;
@ -70,7 +70,7 @@ export const StoryPanel: React.FC<StoryPanelProps> = ({ api }) => {
})
]
: undefined;
setState({ source: source || mdxSource, locationsMap, currentLocation });
setState({ source, locationsMap, currentLocation });
}
}, [story ? story.id : null]);
React.useEffect(() => {

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/addon-viewport",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook addon to change the viewport size to mobile",
"keywords": [
"addon",
@ -29,12 +29,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/api": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/components": "6.0.0-alpha.20",
"@storybook/core-events": "6.0.0-alpha.20",
"@storybook/theming": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/api": "6.0.0-alpha.22",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/components": "6.0.0-alpha.22",
"@storybook/core-events": "6.0.0-alpha.22",
"@storybook/theming": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"memoizerific": "^1.11.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/angular",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Angular: Develop Angular Components in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,9 +34,9 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/node-logger": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@storybook/node-logger": "6.0.0-alpha.22",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"fork-ts-checker-webpack-plugin": "^4.0.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/ember",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
"homepage": "https://github.com/storybookjs/storybook/tree/master/app/ember",
"bugs": {
@ -32,7 +32,7 @@
},
"dependencies": {
"@ember/test-helpers": "^1.7.0",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/html",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/marionette",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Marionette: Develop Marionette.js component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -25,7 +25,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.22",
"common-tags": "^1.8.0",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/marko",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Marko: Develop Marko Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,8 +34,8 @@
},
"dependencies": {
"@marko/webpack": "^2.1.0",
"@storybook/client-logger": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/client-logger": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/mithril",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Mithril: Develop Mithril Component in isolation.",
"keywords": [
"storybook"
@ -36,8 +36,8 @@
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@types/mithril": "^2.0.0",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/preact",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Preact: Develop Preact Component in isolation.",
"keywords": [
"storybook"
@ -35,8 +35,8 @@
},
"dependencies": {
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@types/webpack-env": "^1.15.1",
"core-js": "^3.0.1",
"global": "^4.3.2",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/rax",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Rax: Develop Rax Component in isolation.",
"keywords": [
"rax",
@ -34,7 +34,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.22",
"babel-preset-rax": "^1.0.0-beta.0",
"core-js": "^3.0.1",
"driver-dom": "^2.0.0",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/react",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -37,9 +37,9 @@
"@babel/plugin-transform-react-constant-elements": "^7.6.3",
"@babel/preset-flow": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/node-logger": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@storybook/node-logger": "6.0.0-alpha.22",
"@svgr/webpack": "^5.1.0",
"@types/webpack-env": "^1.15.1",
"babel-plugin-add-react-displayname": "^0.0.5",
@ -57,7 +57,7 @@
"webpack": "^4.33.0"
},
"devDependencies": {
"@storybook/client-api": "6.0.0-alpha.20",
"@storybook/client-api": "6.0.0-alpha.22",
"@types/mini-css-extract-plugin": "^0.9.0",
"@types/node": "^13.5.3",
"@types/webpack": "^4.41.0"

View File

@ -5,7 +5,6 @@ import React, {
FunctionComponent,
HTMLAttributes,
} from 'react';
import PropTypes from 'prop-types';
type MainProps = Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, 'style'>;
const Main: FunctionComponent<MainProps> = props => (
@ -25,12 +24,6 @@ type TitleProps = DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHead
const Title: FunctionComponent<TitleProps> = ({ children, ...props }) => (
<h1 {...props}>{children}</h1>
);
Title.propTypes = {
children: PropTypes.node,
};
Title.defaultProps = {
children: undefined,
};
type NoteProps = Omit<
DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>,
@ -85,14 +78,6 @@ const Link: FunctionComponent<LinkProps> = ({ children, href, target, rel, ...pr
{children}
</a>
);
Link.propTypes = {
href: PropTypes.string,
children: PropTypes.node,
};
Link.defaultProps = {
href: undefined,
children: undefined,
};
type NavButtonProps = Omit<
DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>,
@ -120,12 +105,6 @@ const NavButton: FunctionComponent<NavButtonProps> = ({ children, onClick, ...pr
{children}
</button>
);
NavButton.propTypes = {
children: PropTypes.node,
};
NavButton.defaultProps = {
children: undefined,
};
type WelcomeProps = {
showApp: () => void;
@ -176,8 +155,5 @@ const Welcome: FunctionComponent<WelcomeProps> = ({ showApp }) => (
</Main>
);
Welcome.displayName = 'Welcome';
Welcome.defaultProps = {
showApp: null,
};
export { Welcome as default };

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/riot",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for riot.js: View riot snippets in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,7 +34,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/core": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"raw-loader": "^4.0.0",

View File

@ -1,7 +1,72 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`render a riot element can accept a constructor 1`] = `"<simpletest hacked=\\"true\\" test=\\"with a parameter\\"><div>HACKED : true ; simple test (with a parameter). Oh, by the way (value is mapped to riotValue)</div></simpletest>"`;
exports[`render a riot element can accept a constructor 1`] = `
<simpletest hacked="true"
test="with a parameter"
>
<div>
HACKED : true ; simple test (with a parameter). Oh, by the way (value is mapped to riotValue)
</div>
</simpletest>
`;
exports[`render a riot element can nest several tags 1`] = `"<matriochka><div><tag1><div>Inside tag1:<ul><li><tag2><div>Inside tag2:<ul><li><tag3><div>Inside tag3:<ul><li><tag4><div>Inside tag4:<ul><li><tag5><div>Inside tag5:<ul><li>Content</li></ul></div></tag5></li></ul></div></tag4></li></ul></div></tag3></li></ul></div></tag2></li></ul></div></tag1></div></matriochka>"`;
exports[`render a riot element can nest several tags 1`] = `
<matriochka>
<div>
<tag1>
<div>
Inside tag1:
<ul>
<li>
<tag2>
<div>
Inside tag2:
<ul>
<li>
<tag3>
<div>
Inside tag3:
<ul>
<li>
<tag4>
<div>
Inside tag4:
<ul>
<li>
<tag5>
<div>
Inside tag5:
<ul>
<li>
Content
</li>
</ul>
</div>
</tag5>
</li>
</ul>
</div>
</tag4>
</li>
</ul>
</div>
</tag3>
</li>
</ul>
</div>
</tag2>
</li>
</ul>
</div>
</tag1>
</div>
</matriochka>
`;
exports[`render a riot element can template some vars 1`] = `"<simpletest test=\\"with a parameter\\"><div>simple test (with a parameter). Oh, by the way (value is mapped to riotValue)</div></simpletest>"`;
exports[`render a riot element can template some vars 1`] = `
<simpletest test="with a parameter">
<div>
simple test (with a parameter). Oh, by the way (value is mapped to riotValue)
</div>
</simpletest>
`;

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/server",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"@storybook/node-logger": "^5.2.8",
"@types/webpack-env": "^1.13.9",
"core-js": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@storybook/svelte",
"version": "6.0.0-alpha.20",
"version": "6.0.0-alpha.22",
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
"keywords": [
"storybook"
@ -34,8 +34,8 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "6.0.0-alpha.20",
"@storybook/core": "6.0.0-alpha.20",
"@storybook/addons": "6.0.0-alpha.22",
"@storybook/core": "6.0.0-alpha.22",
"core-js": "^3.0.1",
"global": "^4.3.2",
"regenerator-runtime": "^0.13.3",

Some files were not shown because too many files have changed in this diff Show More