-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better addon apis & devkits for addons (#6759)
Better addon apis & devkits for addons
- Loading branch information
Showing
59 changed files
with
1,833 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ jobs: | |
- node_modules | ||
- examples | ||
- addons | ||
- dev-kits | ||
- app | ||
- lib | ||
chromatic: | ||
|
81 changes: 81 additions & 0 deletions
81
.teamcity/OpenSourceProjects_Storybook/buildTypes/OpenSourceProjects_Storybook_Bootstrap.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
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) | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Storybook addon for design assets | ||
|
||
This addon for storybook allows you to link to image files, other files, and even url's for embedding in the storybook panel! | ||
|
||
You can add as many assets to a single story as you want. | ||
|
||
## Install | ||
|
||
```sh | ||
npm install @storybook/addon-design-assets | ||
``` | ||
|
||
## Usage | ||
within `addons.js`: | ||
|
||
```js | ||
import '@storybook/addon-design-assets/register'; | ||
``` | ||
|
||
within your stories: | ||
```js | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
import imageUrl from './images/my-image.jpg'; | ||
|
||
storiesOf('root|group/component', module) | ||
.addParameters({ | ||
assets: [ | ||
imageUrl, // link to a file imported | ||
'https://via.placeholder.com/300/09f/fff.png', // link to an external image | ||
'https://www.example.com', // link to a webpage | ||
'https://www.example.com?id={id}', // link to a webpage with the current story's id in the url | ||
], | ||
}) | ||
.add('variant', () => <div>your story here</div>); | ||
``` | ||
|
||
If you have a set of different assets on 1 story, you might want to name then: | ||
```js | ||
import { storiesOf } from '@storybook/react'; | ||
|
||
import imageUrl from './images/my-image.jpg'; | ||
|
||
storiesOf('root|group/component', module) | ||
.addParameters({ | ||
assets: [{ | ||
url: 'https://via.placeholder.com/300/09f/fff.png', // link to an external image | ||
name: 'blue', | ||
}, { | ||
url: 'https://via.placeholder.com/300/f90/fff.png', // link to an external image | ||
name: 'orange', | ||
}], | ||
}) | ||
.add('variant', () => <div>your story here</div>); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"name": "@storybook/addon-design-assets", | ||
"version": "5.1.0-rc.5", | ||
"description": "Design asset preview for storybook", | ||
"keywords": [ | ||
"addon", | ||
"storybook", | ||
"parameter", | ||
"design", | ||
"assets", | ||
"files", | ||
"viewer" | ||
], | ||
"homepage": "https://github.com/storybooks/storybook#readme", | ||
"bugs": { | ||
"url": "https://github.com/storybooks/storybook/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/storybooks/storybook.git", | ||
"directory": "addons/design-assets" | ||
}, | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"prepare": "node ../../scripts/prepare.js" | ||
}, | ||
"dependencies": { | ||
"@storybook/addons": "5.1.0-rc.5", | ||
"@storybook/api": "5.1.0-rc.5", | ||
"@storybook/client-logger": "5.1.0-rc.5", | ||
"@storybook/components": "5.1.0-rc.5", | ||
"@storybook/core-events": "5.1.0-rc.5", | ||
"@storybook/theming": "5.1.0-rc.5", | ||
"common-tags": "^1.8.0", | ||
"core-js": "^2.6.5", | ||
"global": "^4.3.2", | ||
"react": "^16.8.4", | ||
"use-image": "^1.0.3" | ||
}, | ||
"devDependencies": { | ||
"@types/common-tags": "^1.8.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('./dist/register'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const ADDON_ID = 'storybook/design-assets'; | ||
export const PANEL_ID = `${ADDON_ID}/panel`; | ||
export const PARAM_KEY = `assets`; |
Oops, something went wrong.
ee70754
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully aliased the URL https://monorepo-8ct1rrm57.now.sh to the following aliases.