-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs2: Extract doc blocks into a separate package #18587
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
93c4ff1
Extract doc blocks
shilman 3a293e9
Merge branch 'future/base' into future/doc-blocks-take2
shilman ed240eb
Merge commit '95bd68d08a0f40ab37de688c8966932b3fb85aa8' into pr/iaman…
ndelangen 69e4485
Merge branch 'future/doc-blocks-take2' of github.com:storybookjs/stor…
ndelangen 2f0b362
we should revert this once the prebuilt manager is merged
ndelangen 5b923f1
Merge branch 'future/base' into future/doc-blocks-take2
ndelangen 7511432
fix example
ndelangen 8b80e55
Merge branch 'future/base' into future/doc-blocks-take2
ndelangen 4b11506
fix version mismatch
ndelangen 37dd381
fixes
ndelangen 36027e1
fix snapshots
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,28 +1 @@ | ||
export { ColorPalette, ColorItem, IconGallery, IconItem, Typeset } from '@storybook/components'; | ||
|
||
export * from './Anchor'; | ||
export * from './ArgsTable'; | ||
export * from './Canvas'; | ||
export * from './Description'; | ||
export * from './DocsContext'; | ||
export * from './DocsPage'; | ||
export * from './DocsContainer'; | ||
export * from './DocsRenderer'; // For testing | ||
export * from './ExternalDocsContainer'; | ||
export * from './DocsStory'; | ||
export * from './Heading'; | ||
export * from './Meta'; | ||
export * from './Preview'; | ||
export * from './Primary'; | ||
export * from './Props'; | ||
export * from './Source'; | ||
export * from './SourceContainer'; | ||
export * from './Stories'; | ||
export * from './Story'; | ||
export * from './Subheading'; | ||
export * from './Subtitle'; | ||
export * from './Title'; | ||
export * from './Wrapper'; | ||
|
||
export * from './types'; | ||
export * from './mdx'; | ||
export * from '@storybook/blocks'; |
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 @@ | ||
FOO=bar |
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,26 @@ | ||
import type { StorybookConfig } from '@storybook/react-webpack5/types'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../../../lib/blocks/src/**/*.stories.*'], | ||
logLevel: 'debug', | ||
addons: ['@storybook/addon-essentials'], | ||
core: { | ||
channelOptions: { allowFunction: false, maxDepth: 10 }, | ||
disableTelemetry: true, | ||
}, | ||
typescript: { | ||
check: true, | ||
checkOptions: {}, | ||
}, | ||
features: { | ||
postcss: false, | ||
storyStoreV7: true, | ||
buildStoriesJson: true, | ||
babelModeV7: true, | ||
warnOnLegacyHierarchySeparator: false, | ||
previewMdx2: true, | ||
breakingChangesV7: true, | ||
}, | ||
framework: '@storybook/react-webpack5', | ||
}; | ||
module.exports = config; |
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,8 @@ | ||
import { addons } from '@storybook/addons'; | ||
import startCase from 'lodash/startCase'; | ||
|
||
addons.setConfig({ | ||
sidebar: { | ||
renderLabel: ({ name, type }) => (type === 'story' ? name : startCase(name)), | ||
}, | ||
}); |
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,11 @@ | ||
import React from 'react'; | ||
import { Global, ThemeProvider, convert, themes, createReset } from '@storybook/theming'; | ||
|
||
export const decorators = [ | ||
(StoryFn) => ( | ||
<ThemeProvider theme={convert(themes.light)}> | ||
<Global styles={createReset} /> | ||
<StoryFn /> | ||
</ThemeProvider> | ||
), | ||
]; |
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 @@ | ||
# Storybook TS example | ||
|
||
This Storybook demonstrates support for TypeScript in Storybook without additional configuration. |
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,7 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { chrome: '100' } }], | ||
'@babel/preset-react', | ||
'@babel/preset-typescript', | ||
], | ||
}; |
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,40 @@ | ||
{ | ||
"name": "@storybook/example-doc-blocks", | ||
"version": "7.0.0-alpha.6", | ||
"private": true, | ||
"scripts": { | ||
"build-storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true sb build", | ||
"debug": "cross-env NODE_OPTIONS=--inspect-brk STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true yarn sb dev -p 9011", | ||
"storybook": "cross-env STORYBOOK_DISPLAY_WARNING=true DISPLAY_WARNING=true sb dev -p 9010 --no-manager-cache" | ||
}, | ||
"dependencies": { | ||
"react": "16.14.0", | ||
"react-dom": "16.14.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/preset-env": "^7.12.11", | ||
"@babel/preset-react": "^7.12.10", | ||
"@babel/preset-typescript": "^7.12.7", | ||
"@storybook/addon-essentials": "7.0.0-alpha.6", | ||
"@storybook/addon-storyshots": "7.0.0-alpha.6", | ||
"@storybook/addon-storysource": "7.0.0-alpha.6", | ||
"@storybook/addons": "7.0.0-alpha.6", | ||
"@storybook/cli": "7.0.0-alpha.6", | ||
"@storybook/components": "7.0.0-alpha.6", | ||
"@storybook/react-webpack5": "7.0.0-alpha.6", | ||
"@storybook/theming": "7.0.0-alpha.6", | ||
"@types/babel__preset-env": "^7", | ||
"@types/react": "^16.14.23", | ||
"@types/react-dom": "^16.9.14", | ||
"cross-env": "^7.0.3", | ||
"lodash": "^4.17.21", | ||
"sb": "7.0.0-alpha.6", | ||
"typescript": "~4.6.3", | ||
"webpack": "5" | ||
}, | ||
"storybook": { | ||
"chromatic": { | ||
"projectToken": "2ea6e5abac97" | ||
} | ||
} | ||
} |
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,13 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"esModuleInterop": true, | ||
"jsx": "preserve", | ||
"skipLibCheck": true, | ||
"strict": true | ||
}, | ||
"include": [ | ||
"src/*", | ||
".storybook/main.ts" | ||
] | ||
} |
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,23 @@ | ||
# Storybook Doc Blocks | ||
|
||
Portable documentation components for building design systems in Storybook. | ||
|
||
## Blocks development | ||
|
||
To bootstrap, in the monorepo root: | ||
|
||
```sh | ||
yarn && yarn bootstrap --core | ||
``` | ||
|
||
To develop this package, in the monorepo root: | ||
|
||
```sh | ||
yarn build blocks --watch | ||
``` | ||
|
||
To run storybook, in this directory: | ||
|
||
```sh | ||
yarn storybook | ||
``` |
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,68 @@ | ||
{ | ||
"name": "@storybook/blocks", | ||
"version": "7.0.0-alpha.6", | ||
"description": "Storybook Doc Blocks", | ||
"keywords": [ | ||
"storybook" | ||
], | ||
"homepage": "https://github.com/storybookjs/storybook/tree/main/lib/blocks", | ||
"bugs": { | ||
"url": "https://github.com/storybookjs/storybook/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/storybookjs/storybook.git", | ||
"directory": "lib/blocks" | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/storybook" | ||
}, | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"files": [ | ||
"dist/**/*", | ||
"README.md", | ||
"*.js", | ||
"*.d.ts" | ||
], | ||
"scripts": { | ||
"prepare": "node ../../scripts/prepare.js" | ||
}, | ||
"dependencies": { | ||
"@mdx-js/react": "^1.6.22", | ||
"@storybook/addons": "7.0.0-alpha.6", | ||
"@storybook/api": "7.0.0-alpha.6", | ||
"@storybook/client-logger": "7.0.0-alpha.6", | ||
"@storybook/components": "7.0.0-alpha.6", | ||
"@storybook/core-events": "7.0.0-alpha.6", | ||
"@storybook/csf": "0.0.2--canary.7c6c115.0", | ||
"@storybook/docs-tools": "7.0.0-alpha.6", | ||
"@storybook/preview-web": "7.0.0-alpha.6", | ||
"@storybook/store": "7.0.0-alpha.6", | ||
"@storybook/theming": "7.0.0-alpha.6", | ||
"color-convert": "^2.0.1", | ||
"core-js": "^3.8.2", | ||
"fast-deep-equal": "^3.1.3", | ||
"global": "^4.4.0", | ||
"lodash": "^4.17.21", | ||
"markdown-to-jsx": "^7.1.3", | ||
"memoizerific": "^1.11.3", | ||
"polished": "^4.2.2", | ||
"react-colorful": "^5.1.2", | ||
"regenerator-runtime": "^0.13.7", | ||
"ts-dedent": "^2.0.0", | ||
"util-deprecate": "^1.0.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0", | ||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"gitHead": "b2e85f3599c043815b18bbfc5ca563bf1c6e4add" | ||
} |
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
addons/docs/src/blocks/ArgsTable.tsx → lib/blocks/src/blocks/ArgsTable.tsx
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
4 changes: 2 additions & 2 deletions
4
addons/docs/src/blocks/Canvas.tsx → lib/blocks/src/blocks/Canvas.tsx
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
2 changes: 1 addition & 1 deletion
2
addons/docs/src/blocks/Description.tsx → lib/blocks/src/blocks/Description.tsx
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
addons/docs/src/blocks/Source.tsx → lib/blocks/src/blocks/Source.tsx
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
4 changes: 3 additions & 1 deletion
4
addons/docs/src/blocks/SourceContainer.tsx → lib/blocks/src/blocks/SourceContainer.tsx
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
File renamed without changes.
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
addons/docs/src/blocks/Subtitle.tsx → lib/blocks/src/blocks/Subtitle.tsx
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
2 changes: 1 addition & 1 deletion
2
addons/docs/src/blocks/Title.tsx → lib/blocks/src/blocks/Title.tsx
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
How are we thinking about the dependencies of this package? We might need to discuss @shilman. In particular I am interested in the thinking behind pulling some but not all of the dependencies from
@storybook/components
into this package.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.
Ideally this doesn't pull anything form
@storybook/components
, but I think we'll need to tackle that later on.