mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
Merge remote-tracking branch 'origin/next' into tom/sb-1144-update-api-of-story-block
This commit is contained in:
commit
3116dd7f35
@ -162,7 +162,7 @@ jobs:
|
||||
name: Running local registry
|
||||
command: |
|
||||
cd code
|
||||
yarn local-registry --port 6001 --open
|
||||
yarn local-registry --open
|
||||
background: true
|
||||
- run:
|
||||
name: Wait for registry
|
||||
@ -203,7 +203,7 @@ jobs:
|
||||
name: Running local registry
|
||||
command: |
|
||||
cd code
|
||||
yarn local-registry --port 6001 --open
|
||||
yarn local-registry --open
|
||||
background: true
|
||||
- run:
|
||||
name: Wait for registry
|
||||
|
2
.github/workflows/generate-repros-next.yml
vendored
2
.github/workflows/generate-repros-next.yml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
- name: Compile Storybook libraries
|
||||
run: yarn task --task publish --start-from=auto --no-link
|
||||
- name: Running local registry
|
||||
run: yarn local-registry --port 6001 --open &
|
||||
run: yarn local-registry --open &
|
||||
working-directory: ./code
|
||||
- name: Wait for registry
|
||||
run: yarn wait-on http://localhost:6001
|
||||
|
2
.github/workflows/linear-export.yml
vendored
2
.github/workflows/linear-export.yml
vendored
@ -8,7 +8,7 @@ on:
|
||||
|
||||
jobs:
|
||||
trigger:
|
||||
if: github.event.label.name == 'linear'
|
||||
if: github.event.label.name == 'linear-ghaction'
|
||||
name: Export to linear
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
75
CHANGELOG.md
75
CHANGELOG.md
@ -1,3 +1,78 @@
|
||||
## 7.0.0-beta.25 (January 12, 2023)
|
||||
|
||||
#### Features
|
||||
|
||||
- Vue3: Rendering slots passed from controls [#20536](https://github.com/storybooks/storybook/pull/20536)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- Core: Export build from core-server instead of standalone [#20574](https://github.com/storybooks/storybook/pull/20574)
|
||||
|
||||
#### Maintenance
|
||||
|
||||
- Blocks: New Description API, introduce useOf [#20563](https://github.com/storybooks/storybook/pull/20563)
|
||||
|
||||
## 7.0.0-beta.24 (January 11, 2023)
|
||||
|
||||
#### Maintenance
|
||||
|
||||
- Migrations: Add `preact-vite` to new frameworks automigration [#20542](https://github.com/storybooks/storybook/pull/20542)
|
||||
|
||||
#### Build
|
||||
|
||||
- Build: remove unneeded dependencies & upgrades [#20533](https://github.com/storybooks/storybook/pull/20533)
|
||||
- Build: upgrade verdaccio [#20561](https://github.com/storybooks/storybook/pull/20561)
|
||||
- Build: remove usage of enzyme [#20534](https://github.com/storybooks/storybook/pull/20534)
|
||||
|
||||
## 7.0.0-beta.23 (January 10, 2023)
|
||||
|
||||
#### Features
|
||||
|
||||
- Composition: Add basic auth support [#20488](https://github.com/storybooks/storybook/pull/20488)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
- UI: Fix managerEntries containing long paths with hidden folders [#20550](https://github.com/storybooks/storybook/pull/20550)
|
||||
- Addon-docs: Fix attachment logic [#20531](https://github.com/storybooks/storybook/pull/20531)
|
||||
|
||||
#### Maintenance
|
||||
|
||||
- Addon-docs: Move reactPeerCheck to docs package [#20560](https://github.com/storybooks/storybook/pull/20560)
|
||||
- Addon-docs: Rename `storyByModuleExport` to `resolveModuleExport` [#20517](https://github.com/storybooks/storybook/pull/20517)
|
||||
- Telemetry: Filter out example stories/docs from summary [#20553](https://github.com/storybooks/storybook/pull/20553)
|
||||
- Telemetry: Count play function usage [#20541](https://github.com/storybooks/storybook/pull/20541)
|
||||
- Telemetry: Add pageStoryCount [#20539](https://github.com/storybooks/storybook/pull/20539)
|
||||
- Vite/Vue3: Pre-bundle @vitejs/plugin-vue [#20343](https://github.com/storybooks/storybook/pull/20343)
|
||||
|
||||
#### Build
|
||||
|
||||
- Build: downgrade slash to non-ESM [#20543](https://github.com/storybooks/storybook/pull/20543)
|
||||
|
||||
#### Other
|
||||
|
||||
- Update GH action to use "linear-ghaction" label for sync [#20546](https://github.com/storybooks/storybook/pull/20546)
|
||||
|
||||
## 7.0.0-beta.22 (January 10, 2023)
|
||||
|
||||
Failed publish
|
||||
|
||||
## 7.0.0-beta.21 (January 9, 2023)
|
||||
|
||||
#### Maintenance
|
||||
|
||||
- Ember: Build with tsc [#20524](https://github.com/storybooks/storybook/pull/20524)
|
||||
- Storyshots: Build with tsc [#20523](https://github.com/storybooks/storybook/pull/20523)
|
||||
|
||||
#### Dependencies
|
||||
|
||||
- Downgrade find-cache-dir [#20532](https://github.com/storybooks/storybook/pull/20532)
|
||||
|
||||
#### Build
|
||||
|
||||
- Build: Cleanup babel prepare related code & dependencies [#20156](https://github.com/storybooks/storybook/pull/20156)
|
||||
- Build: Create a tsc prepare script, use it for angular framework, add ESM to angular dist [#20516](https://github.com/storybooks/storybook/pull/20516)
|
||||
- Build: Fix InternalCanvas story tests [#20521](https://github.com/storybooks/storybook/pull/20521)
|
||||
|
||||
## 7.0.0-beta.20 (January 6, 2023)
|
||||
|
||||
#### Bug Fixes
|
||||
|
13
MIGRATION.md
13
MIGRATION.md
@ -41,6 +41,7 @@
|
||||
- [Docs Changes](#docs-changes)
|
||||
- [Standalone docs files](#standalone-docs-files)
|
||||
- [Referencing stories in docs files](#referencing-stories-in-docs-files)
|
||||
- [Description block, `parameters.notes` and `parameters.info`](#description-block-parametersnotes-and-parametersinfo)
|
||||
- [Autodocs](#autodocs)
|
||||
- [Configuring the Docs Container](#configuring-the-docs-container)
|
||||
- [External Docs](#external-docs)
|
||||
@ -306,8 +307,8 @@ To opt-out of the old behavior you can set the `storyStoreV7` feature flag to `f
|
||||
module.exports = {
|
||||
features: {
|
||||
storyStoreV7: false,
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
#### Removed global client APIs
|
||||
@ -796,6 +797,13 @@ import * as SecondComponentStories from './second-component.stories';
|
||||
<Story of={SecondComponentStories.standard} meta={SecondComponentStories} />
|
||||
```
|
||||
|
||||
#### Description block, `parameters.notes` and `parameters.info`
|
||||
|
||||
In 6.5 the Description doc block accepted a range of different props, `markdown`, `type` and `children` as a way to customize the content.
|
||||
The props have been simplified and the block now only accepts an `of` prop, which can be a reference to either a CSF file, a default export (meta) or a story export, depending on which description you want to be shown. See TDB DOCS LINK for a deeper explanation of the new prop.
|
||||
|
||||
`parameters.notes` and `parameters.info` have been deprecated as a way to specify descriptions. Instead use JSDoc comments above the default export or story export, or use `parameters.docs.description.story | component` directly. See TDB DOCS LINK for a deeper explanation on how to write descriptions.
|
||||
|
||||
#### Autodocs
|
||||
|
||||
In 7.0, rather than rendering each story in "docs view mode", Autodocs (formerly known as "Docs Page") operates by adding additional sidebar entries for each component. By default it uses the same template as was used in 6.x, and the entries are entitled `Docs`.
|
||||
@ -3812,4 +3820,3 @@ If you **are** using these addons, it takes two steps to migrate:
|
||||
```
|
||||
|
||||
<!-- markdown-link-check-enable -->
|
||||
|
||||
|
@ -10,8 +10,6 @@ scripts/storage
|
||||
scripts/repros-generator
|
||||
*.bundle.js
|
||||
*.js.map
|
||||
examples/ember-cli/.storybook/preview-head.html
|
||||
examples/official-storybook/tests/addon-jest.test.js
|
||||
ember-output
|
||||
.yarn
|
||||
!.remarkrc.js
|
||||
|
6
code/.gitignore
vendored
6
code/.gitignore
vendored
@ -13,22 +13,16 @@ dist
|
||||
coverage/
|
||||
*.lerna_backup
|
||||
build
|
||||
packages/examples/automated-*
|
||||
/**/LICENSE
|
||||
docs/public
|
||||
packs/*.tgz
|
||||
package-lock.json
|
||||
.nvmrc
|
||||
storybook-static
|
||||
integration/__image_snapshots__/__diff_output__
|
||||
.jest-test-results.json
|
||||
lib/*.jar
|
||||
lib/**/dll
|
||||
/false
|
||||
/addons/docs/common/config-*
|
||||
built-storybooks
|
||||
cypress/videos
|
||||
cypress/screenshots
|
||||
.verdaccio-cache
|
||||
tsconfig.tsbuildinfo
|
||||
junit.xml
|
||||
|
@ -7,8 +7,6 @@ logFilters:
|
||||
level: discard
|
||||
- code: YN0076
|
||||
level: discard
|
||||
- level: discard
|
||||
pattern: '@workspace:examples'
|
||||
- level: discard
|
||||
pattern: '@storybook/root@workspace:.'
|
||||
- level: discard
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-a11y",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Test component compliance with web accessibility standards",
|
||||
"keywords": [
|
||||
"a11y",
|
||||
@ -63,16 +63,16 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-highlight": "7.0.0-beta.20",
|
||||
"@storybook/channels": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/addon-highlight": "7.0.0-beta.25",
|
||||
"@storybook/channels": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"axe-core": "^4.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"react-resize-detector": "^7.1.2"
|
||||
@ -104,7 +104,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Accessibility",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-actions",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Get UI feedback when an action is performed on an interactive element",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -77,14 +77,14 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"dequal": "^2.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
"polished": "^4.2.2",
|
||||
@ -121,7 +121,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Actions",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-backgrounds",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Switch backgrounds to view components in different settings",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -76,14 +76,14 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"memoizerific": "^1.11.3",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -112,7 +112,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Backgrounds",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991667-479cc600-3c7c-11eb-96d3-410e936252e7.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-controls",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Interact with component inputs dynamically in the Storybook UI",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -68,15 +68,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/blocks": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/blocks": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.8",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -102,7 +102,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Controls",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991669-479cc600-3c7c-11eb-93d9-38b67e8371f2.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-docs",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Document component usage and properties in Markdown",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -103,18 +103,18 @@
|
||||
"@babel/plugin-transform-react-jsx": "^7.19.0",
|
||||
"@jest/transform": "^29.3.1",
|
||||
"@mdx-js/react": "^2.1.5",
|
||||
"@storybook/blocks": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/csf-plugin": "7.0.0-beta.20",
|
||||
"@storybook/csf-tools": "7.0.0-beta.20",
|
||||
"@storybook/blocks": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/csf-plugin": "7.0.0-beta.25",
|
||||
"@storybook/csf-tools": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/mdx2-csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/postinstall": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/postinstall": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"fs-extra": "^9.0.1",
|
||||
"remark-external-links": "^8.0.0",
|
||||
"remark-slug": "^6.0.0",
|
||||
@ -141,7 +141,7 @@
|
||||
"./src/shims/mdx-react-shim.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Docs",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991672-48355c80-3c7c-11eb-82d9-95fa12438f64.png",
|
||||
|
@ -7,6 +7,7 @@ import type { IndexerOptions, StoryIndexer, DocsOptions, Options } from '@storyb
|
||||
import type { CsfPluginOptions } from '@storybook/csf-plugin';
|
||||
import type { JSXOptions } from '@storybook/mdx2-csf';
|
||||
import { loadCsf } from '@storybook/csf-tools';
|
||||
import { ensureReactPeerDeps } from './ensure-react-peer-deps';
|
||||
|
||||
async function webpack(
|
||||
webpackConfig: any = {},
|
||||
@ -164,4 +165,6 @@ const webpackX = webpack as any;
|
||||
const storyIndexersX = storyIndexers as any;
|
||||
const docsX = docs as any;
|
||||
|
||||
ensureReactPeerDeps();
|
||||
|
||||
export { webpackX as webpack, storyIndexersX as storyIndexers, docsX as docs };
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-essentials",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Curated addons to bring out the best of Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -119,23 +119,23 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-actions": "7.0.0-beta.20",
|
||||
"@storybook/addon-backgrounds": "7.0.0-beta.20",
|
||||
"@storybook/addon-controls": "7.0.0-beta.20",
|
||||
"@storybook/addon-docs": "7.0.0-beta.20",
|
||||
"@storybook/addon-highlight": "7.0.0-beta.20",
|
||||
"@storybook/addon-measure": "7.0.0-beta.20",
|
||||
"@storybook/addon-outline": "7.0.0-beta.20",
|
||||
"@storybook/addon-toolbars": "7.0.0-beta.20",
|
||||
"@storybook/addon-viewport": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/addon-actions": "7.0.0-beta.25",
|
||||
"@storybook/addon-backgrounds": "7.0.0-beta.25",
|
||||
"@storybook/addon-controls": "7.0.0-beta.25",
|
||||
"@storybook/addon-docs": "7.0.0-beta.25",
|
||||
"@storybook/addon-highlight": "7.0.0-beta.25",
|
||||
"@storybook/addon-measure": "7.0.0-beta.25",
|
||||
"@storybook/addon-outline": "7.0.0-beta.25",
|
||||
"@storybook/addon-toolbars": "7.0.0-beta.25",
|
||||
"@storybook/addon-viewport": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/vue": "7.0.0-beta.20",
|
||||
"@storybook/vue": "7.0.0-beta.25",
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@ -166,5 +166,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-highlight",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Highlight DOM nodes within your stories",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -61,9 +61,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/preview-api": "7.0.0-beta.20"
|
||||
"@storybook/preview-api": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/webpack-env": "^1.16.0",
|
||||
@ -78,7 +78,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"sbmodern": "dist/modern/index.js",
|
||||
"storybook": {
|
||||
"displayName": "Highlight",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-interactions",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Automate, test and debug user interactions",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -72,16 +72,16 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/instrumenter": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/instrumenter": "7.0.0-beta.25",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"jest-mock": "^27.0.6",
|
||||
"polished": "^4.2.2",
|
||||
"ts-dedent": "^2.2.0"
|
||||
@ -118,7 +118,7 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Interactions",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -58,7 +58,10 @@ const addActionsFromArgTypes: ArgsEnhancer<Renderer> = ({ id, initialArgs }) =>
|
||||
export const argsEnhancers = [addActionsFromArgTypes];
|
||||
|
||||
export const { step: runStep } = instrument(
|
||||
{ step: (label: StepLabel, play: PlayFunction, context: PlayFunctionContext) => play(context) },
|
||||
{
|
||||
step: (label: StepLabel, play: PlayFunction, context: PlayFunctionContext<any>) =>
|
||||
play(context),
|
||||
},
|
||||
{ intercept: true }
|
||||
);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-jest",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "React storybook addon that show component jest report",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -70,13 +70,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"react-resize-detector": "^7.1.2",
|
||||
"upath": "^1.2.0"
|
||||
},
|
||||
@ -105,7 +105,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Jest",
|
||||
"icon": "https://pbs.twimg.com/profile_images/821713465245102080/mMtKIMax_400x400.jpg",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-links",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Link stories together to build demos and prototypes with your UI components",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -77,14 +77,14 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/router": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/router": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"prop-types": "^15.7.2",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
@ -114,7 +114,7 @@
|
||||
"./src/react/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Links",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991673-48355c80-3c7c-11eb-9b6e-b627c96a75f6.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-measure",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Inspect layouts by visualizing the box model",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -75,13 +75,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20"
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.9.3"
|
||||
@ -108,7 +108,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Measure",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-outline",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Outline all elements with CSS to help with layout placement and alignment",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -78,13 +78,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -112,7 +112,7 @@
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Outline",
|
||||
"unsupportedFrameworks": [
|
||||
|
@ -7,7 +7,6 @@ module.exports = {
|
||||
'@storybook/preact',
|
||||
'@storybook/vue',
|
||||
'@storybook/svelte',
|
||||
'enzyme',
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Take a code snapshot of every story automatically with Jest",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -32,20 +32,17 @@
|
||||
"*.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"build-storybook": "sb build",
|
||||
"example": "jest storyshot.test",
|
||||
"prep": "../../../scripts/prepare/tsc.ts",
|
||||
"storybook": "yarn sb dev -p 6006"
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/transform": "^29.3.1",
|
||||
"@storybook/babel-plugin-require-context-hook": "1.0.1",
|
||||
"@storybook/client-api": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-webpack": "7.0.0-beta.20",
|
||||
"@storybook/client-api": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-webpack": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/glob": "^7.1.3",
|
||||
"@types/jest-specific-snapshot": "^0.5.6",
|
||||
"core-js": "^3.8.2",
|
||||
@ -61,17 +58,19 @@
|
||||
"@angular/core": "^13.3.6",
|
||||
"@angular/platform-browser-dynamic": "^13.3.6",
|
||||
"@emotion/jest": "^11.8.0",
|
||||
"@storybook/addon-docs": "7.0.0-beta.20",
|
||||
"@storybook/angular": "7.0.0-beta.20",
|
||||
"@storybook/react": "7.0.0-beta.20",
|
||||
"@storybook/vue": "7.0.0-beta.20",
|
||||
"@storybook/vue3": "7.0.0-beta.20",
|
||||
"@storybook/addon-docs": "7.0.0-beta.25",
|
||||
"@storybook/angular": "7.0.0-beta.25",
|
||||
"@storybook/react": "7.0.0-beta.25",
|
||||
"@storybook/vue": "7.0.0-beta.25",
|
||||
"@storybook/vue3": "7.0.0-beta.25",
|
||||
"babel-loader": "^8.3.0",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.5",
|
||||
"enzyme-to-json": "^3.6.1",
|
||||
"jest-preset-angular": "^8.3.2",
|
||||
"jest-vue-preprocessor": "^1.7.1",
|
||||
"react-test-renderer": "^16",
|
||||
"rimraf": "^3.0.2",
|
||||
"rxjs": "^6.6.3",
|
||||
"vue-jest": "^5.0.0-alpha.8"
|
||||
},
|
||||
@ -144,7 +143,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Storyshots",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991676-48cdf300-3c7c-11eb-8aa1-944dab6ab29b.png",
|
||||
|
@ -52,6 +52,7 @@ function integrityTest(integrityOptions: any, stories2snapsConverter: any) {
|
||||
const snapshotExtension = stories2snapsConverter.getSnapshotExtension();
|
||||
const storyshots = glob.sync(`**/*${snapshotExtension}`, integrityOptions);
|
||||
|
||||
// @ts-expect-error (ts doesn't 'get' the extension happening on line 9)
|
||||
expect(storyshots).notToBeAbandoned(stories2snapsConverter);
|
||||
});
|
||||
});
|
||||
|
@ -1,7 +1,11 @@
|
||||
import path from 'path';
|
||||
import { mount } from 'enzyme';
|
||||
import { mount, configure } from 'enzyme';
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
import initStoryshots from '../src';
|
||||
|
||||
configure({ adapter: new Adapter() });
|
||||
|
||||
initStoryshots({
|
||||
framework: 'react',
|
||||
configPath: path.join(__dirname, 'exported_metadata'),
|
||||
|
23
code/addons/storyshots-core/tsconfig.build.json
Normal file
23
code/addons/storyshots-core/tsconfig.build.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"lib": ["es2020", "dom"],
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"declaration": true,
|
||||
"outDir": "dist",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"allowJs": true,
|
||||
"pretty": true,
|
||||
"noErrorTruncation": true,
|
||||
"listEmittedFiles": false,
|
||||
"noUnusedLocals": false
|
||||
},
|
||||
"include": ["src/**/*", "src/**/*.json"]
|
||||
}
|
@ -4,8 +4,7 @@
|
||||
"declaration": true,
|
||||
"jsx": "preserve",
|
||||
"skipLibCheck": true,
|
||||
"skipDefaultLibCheck": true,
|
||||
"types": ["jest", "testing-library__jest-dom"]
|
||||
"skipDefaultLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots-puppeteer",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Image snapshots addition to StoryShots based on puppeteer",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -36,17 +36,20 @@
|
||||
"dependencies": {
|
||||
"@axe-core/puppeteer": "^4.2.0",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/jest-image-snapshot": "^5.1.0",
|
||||
"jest-image-snapshot": "^6.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/puppeteer": "^5.4.0",
|
||||
"puppeteer": "^2.0.0 || ^3.0.0"
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-to-json": "^3.6.1",
|
||||
"puppeteer": "^2.0.0 || ^3.0.0",
|
||||
"rimraf": "^3.0.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@storybook/addon-storyshots": "7.0.0-beta.20",
|
||||
"@storybook/addon-storyshots": "7.0.0-beta.25",
|
||||
"puppeteer": ">=2.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
@ -58,5 +61,5 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
23
code/addons/storyshots-puppeteer/tsconfig.build.json
Normal file
23
code/addons/storyshots-puppeteer/tsconfig.build.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"lib": ["es2020", "dom"],
|
||||
"esModuleInterop": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"declaration": true,
|
||||
"outDir": "dist",
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
"resolveJsonModule": true,
|
||||
"allowJs": true,
|
||||
"pretty": true,
|
||||
"noErrorTruncation": true,
|
||||
"listEmittedFiles": false,
|
||||
"noUnusedLocals": false
|
||||
},
|
||||
"include": ["src/**/*", "src/**/*.json"]
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storysource",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "View a story’s source code to see how it works and paste into your app",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -54,13 +54,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/router": "7.0.0-beta.20",
|
||||
"@storybook/source-loader": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/router": "7.0.0-beta.25",
|
||||
"@storybook/source-loader": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"estraverse": "^5.2.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-syntax-highlighter": "^15.5.0"
|
||||
@ -92,7 +92,7 @@
|
||||
"./src/preset.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Storysource",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991675-48cdf300-3c7c-11eb-9400-58de5ac6daa7.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-toolbars",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Create your own toolbar items that control story rendering",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -68,11 +68,11 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20"
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.9.3"
|
||||
@ -99,7 +99,7 @@
|
||||
],
|
||||
"platform": "browser"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Toolbars",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991677-48cdf300-3c7c-11eb-93b4-19b0e3366959.png",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-viewport",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -73,13 +73,13 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"memoizerific": "^1.11.3",
|
||||
"prop-types": "^15.7.2"
|
||||
},
|
||||
@ -109,7 +109,7 @@
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec",
|
||||
"storybook": {
|
||||
"displayName": "Viewport",
|
||||
"icon": "https://user-images.githubusercontent.com/263385/101991678-48cdf300-3c7c-11eb-9764-f8af293c1b28.png",
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"defaultCommandTimeout": 20000,
|
||||
"requestTimeout": 20000,
|
||||
"responseTimeout": 60000,
|
||||
"viewportHeight": 800,
|
||||
"viewportWidth": 1280
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/angular",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -36,19 +36,19 @@
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/core-client": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/core-webpack": "7.0.0-beta.20",
|
||||
"@storybook/docs-tools": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/core-client": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/core-webpack": "7.0.0-beta.25",
|
||||
"@storybook/docs-tools": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/react": "^16.14.34",
|
||||
"@types/react-dom": "^16.9.14",
|
||||
@ -127,5 +127,5 @@
|
||||
"bundler": {
|
||||
"tsConfig": "tsconfig.build.json"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ function commandBuilder(
|
||||
return standaloneOptions;
|
||||
}),
|
||||
switchMap((standaloneOptions) => runInstance(standaloneOptions)),
|
||||
map(() => {
|
||||
return { success: true };
|
||||
map((port: number) => {
|
||||
return { success: true, info: { port } };
|
||||
})
|
||||
);
|
||||
}
|
||||
@ -132,10 +132,10 @@ async function setup(options: StorybookBuilderOptions, context: BuilderContext)
|
||||
};
|
||||
}
|
||||
function runInstance(options: StandaloneOptions) {
|
||||
return new Observable<void>((observer) => {
|
||||
return new Observable<number>((observer) => {
|
||||
// This Observable intentionally never complete, leaving the process running ;)
|
||||
buildDevStandalone(options as any).then(
|
||||
() => observer.next(),
|
||||
({ port }) => observer.next(port),
|
||||
(error) => observer.error(buildStandaloneErrorHandler(error))
|
||||
);
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/ember",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
|
||||
"bugs": {
|
||||
@ -31,13 +31,12 @@
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/docs-tools": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/docs-tools": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"read-pkg-up": "^7.0.1",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -60,5 +59,5 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ export default {
|
||||
argTypes: {
|
||||
label: { control: 'text' },
|
||||
},
|
||||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/7.0/react/writing-docs/docs-page
|
||||
tags: ['autodocs'],
|
||||
};
|
||||
|
||||
// More on writing stories with args: https://storybook.js.org/docs/7.0/ember/writing-stories/args
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,15 +48,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "7.0.0-beta.20",
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/channel-postmessage": "7.0.0-beta.20",
|
||||
"@storybook/channel-websocket": "7.0.0-beta.20",
|
||||
"@storybook/client-api": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/html": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-web": "7.0.0-beta.20",
|
||||
"@storybook/addons": "7.0.0-beta.25",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/channel-postmessage": "7.0.0-beta.25",
|
||||
"@storybook/channel-websocket": "7.0.0-beta.25",
|
||||
"@storybook/client-api": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/html": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-web": "7.0.0-beta.25",
|
||||
"magic-string": "^0.26.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -76,5 +76,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,11 +48,11 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/html": "7.0.0-beta.20",
|
||||
"@storybook/preset-html-webpack": "7.0.0-beta.20",
|
||||
"@storybook/html": "7.0.0-beta.25",
|
||||
"@storybook/preset-html-webpack": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -76,5 +76,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/nextjs",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Next.js",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -60,13 +60,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/font": "^13.0.7",
|
||||
"@storybook/addon-actions": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preset-react-webpack": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/react": "7.0.0-beta.20",
|
||||
"@storybook/addon-actions": "7.0.0-beta.25",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preset-react-webpack": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/react": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0",
|
||||
"find-up": "^5.0.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
@ -123,5 +123,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,8 +48,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@preact/preset-vite": "^2.0.0",
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/preact": "7.0.0-beta.20"
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/preact": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.0.0",
|
||||
@ -73,5 +73,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preact": "7.0.0-beta.20",
|
||||
"@storybook/preset-preact-webpack": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preact": "7.0.0-beta.25",
|
||||
"@storybook/preset-preact-webpack": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -77,5 +77,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,8 +50,8 @@
|
||||
"dependencies": {
|
||||
"@joshwooding/vite-plugin-react-docgen-typescript": "^0.2.1",
|
||||
"@rollup/pluginutils": "^4.2.0",
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/react": "7.0.0-beta.20",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/react": "7.0.0-beta.25",
|
||||
"@vitejs/plugin-react": "^3.0.0",
|
||||
"ast-types": "^0.14.2",
|
||||
"magic-string": "^0.26.1",
|
||||
@ -80,5 +80,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,9 +48,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/preset-react-webpack": "7.0.0-beta.20",
|
||||
"@storybook/react": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/preset-react-webpack": "7.0.0-beta.25",
|
||||
"@storybook/react": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -83,5 +83,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/server-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preset-server-webpack": "7.0.0-beta.20",
|
||||
"@storybook/server": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preset-server-webpack": "7.0.0-beta.25",
|
||||
"@storybook/server": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -74,5 +74,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,9 +48,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/svelte": "7.0.0-beta.20",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/svelte": "7.0.0-beta.25",
|
||||
"@sveltejs/vite-plugin-svelte": "^2.0.0",
|
||||
"magic-string": "^0.26.1",
|
||||
"svelte": "^3.0.0",
|
||||
@ -80,5 +80,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preset-svelte-webpack": "7.0.0-beta.20",
|
||||
"@storybook/svelte": "7.0.0-beta.20"
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preset-svelte-webpack": "7.0.0-beta.25",
|
||||
"@storybook/svelte": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"svelte": "^3.48.0",
|
||||
@ -78,5 +78,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ Check out our [Frameworks API](https://storybook.js.org/blog/framework-api/) ann
|
||||
- [Manual migration](#manual-migration)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Error: `ERR! SyntaxError: Identifier '__esbuild_register_import_meta_url__' has already been declared` when starting Storybook](#error-err-syntaxerror-identifier-__esbuild_register_import_meta_url__-has-already-been-declared-when-starting-storybook)
|
||||
- [Error: `Cannot read properties of undefined (reading 'disable_scroll_handling')` in preview](#error-cannot-read-properties-of-undefined-reading-disable_scroll_handling-in-preview)
|
||||
- [Acknowledgements](#acknowledgements)
|
||||
|
||||
## Supported features
|
||||
@ -22,20 +23,20 @@ Check out our [Frameworks API](https://storybook.js.org/blog/framework-api/) ann
|
||||
All Svelte language features are supported out of the box, as Storybook uses the Svelte compiler underneath.
|
||||
However SvelteKit has some [Kit-specific modules](https://kit.svelte.dev/docs/modules) that currently aren't supported. It's on our roadmap to support most of them soon:
|
||||
|
||||
| **Module** | **Status** |
|
||||
| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`$app/environment`](https://kit.svelte.dev/docs/modules#$app-environment) | 🔜 Coming in 7.0 |
|
||||
| [`$app/forms`](https://kit.svelte.dev/docs/modules#$app-forms) | ⏳ Planned for 7.1 |
|
||||
| [`$app/navigation`](https://kit.svelte.dev/docs/modules#$app-navigation) | ⏳ Planned for 7.1. With mocks so the Actions addon will display when the hooks are being called. |
|
||||
| [`$app/paths`](https://kit.svelte.dev/docs/modules#$app-paths) | ⏳ Planned for 7.1 |
|
||||
| [`$app/stores`](https://kit.svelte.dev/docs/modules#$app-stores) | 🔜 Coming in 7.0. Mocks are planned for 7.1 so you can set different store values per story. |
|
||||
| [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. |
|
||||
| [`$env/dynamic/public`](https://kit.svelte.dev/docs/modules#$env-dynamic-public) | 🔜 Coming in 7.0 |
|
||||
| [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private) | ⛔ Not supported. They are meant to only be available server-side, and Storybook renders all components on the client. |
|
||||
| [`$env/static/public`](https://kit.svelte.dev/docs/modules#$env-static-public) | 🔜 Coming in 7.0 |
|
||||
| [`$lib`](https://kit.svelte.dev/docs/modules#$lib) | 🔜 Coming in 7.0 |
|
||||
| [`$service-worker`](https://kit.svelte.dev/docs/modules#$service-worker) | ⛔ Not supported. They are only meant to be used in service workers |
|
||||
| [`@sveltejs/kit/*`](https://kit.svelte.dev/docs/modules#sveltejs-kit) | ✅ Supported |
|
||||
| **Module** | **Status** | **Note** |
|
||||
| ---------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`$app/environment`](https://kit.svelte.dev/docs/modules#$app-environment) | ✅ Supported | `version` is always empty in Storybook. |
|
||||
| [`$app/forms`](https://kit.svelte.dev/docs/modules#$app-forms) | ⏳ Planned for 7.1 | See [section in Troubleshooting](#error-cannot-read-properties-of-undefined-reading-disable_scroll_handling-in-preview) |
|
||||
| [`$app/navigation`](https://kit.svelte.dev/docs/modules#$app-navigation) | ⏳ Planned for 7.1. With mocks so the Actions addon will display when the hooks are being called. | See [section in Troubleshooting](#error-cannot-read-properties-of-undefined-reading-disable_scroll_handling-in-preview) |
|
||||
| [`$app/paths`](https://kit.svelte.dev/docs/modules#$app-paths) | ⏳ Planned for 7.1. | |
|
||||
| [`$app/stores`](https://kit.svelte.dev/docs/modules#$app-stores) | ✅ Supported | Mocks planned for 7.1, so you can set different store values per story. |
|
||||
| [`$env/dynamic/private`](https://kit.svelte.dev/docs/modules#$env-dynamic-private) | ⛔ Not supported | They are meant to only be available server-side, and Storybook renders all components on the client. |
|
||||
| [`$env/dynamic/public`](https://kit.svelte.dev/docs/modules#$env-dynamic-public) | 🚧 Partially supported | Only supported in development mode. |
|
||||
| [`$env/static/private`](https://kit.svelte.dev/docs/modules#$env-static-private) | ⛔ Not supported | They are meant to only be available server-side, and Storybook renders all components on the client. |
|
||||
| [`$env/static/public`](https://kit.svelte.dev/docs/modules#$env-static-public) | ✅ Supported | |
|
||||
| [`$lib`](https://kit.svelte.dev/docs/modules#$lib) | ✅ Supported | |
|
||||
| [`$service-worker`](https://kit.svelte.dev/docs/modules#$service-worker) | ⛔ Not supported | They are only meant to be used in service workers |
|
||||
| [`@sveltejs/kit/*`](https://kit.svelte.dev/docs/modules#sveltejs-kit) | ✅ Supported | |
|
||||
|
||||
This is just the beginning. We're close to adding basic support for many of the SvelteKit features. Longer term we're planning on making it an even better experience to [build](https://storybook.js.org/docs/7.0/react/writing-stories/introduction), [test](https://storybook.js.org/docs/7.0/react/writing-tests/introduction) and [document](https://storybook.js.org/docs/7.0/react/writing-docs/introduction) all the SvelteKit goodies like [pages](https://kit.svelte.dev/docs/routing), [forms](https://kit.svelte.dev/docs/form-actions) and [layouts](https://kit.svelte.dev/docs/routing#layout) in Storybook, while still integrating with all the addons and workflows you know and love.
|
||||
|
||||
@ -111,6 +112,16 @@ yarn remove @storybook/builder-vite
|
||||
|
||||
You'll get this error when manually upgrading from 6.5 to 7.0. You need to remove the `svelteOptions` property in `.storybook/main.cjs`, as that is not supported by Storybook 7.0 + SvelteKit. The property is also not necessary anymore because the Vite and Svelte configurations are loaded automatically in Storybook 7.0.
|
||||
|
||||
### Error: `Cannot read properties of undefined (reading 'disable_scroll_handling')` in preview
|
||||
|
||||
> Some stories don't load, instead they show the following error in the preview:
|
||||
>
|
||||
> ```
|
||||
> Cannot read properties of undefined (reading 'disable_scroll_handling')
|
||||
> ```
|
||||
|
||||
You'll experience this if anything in your story is importing from `$app/forms` or `$app/navigation`, which is currently not supported. To get around this, separate your component into a shallow parent component that imports what's needed and passes it to a child component via props. This way you can write stories for your child component and mock any of the necessary modules by passing props in.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Integrating with SvelteKit would not have been possible if it weren't for the fantastic efforts by the Svelte core team - especially [Ben McCann](https://twitter.com/benjaminmccann) - to make integrations with the wider ecosystem possible.
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/sveltekit",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for SvelteKit",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -51,9 +51,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/svelte": "7.0.0-beta.20",
|
||||
"@storybook/svelte-vite": "7.0.0-beta.20"
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/svelte": "7.0.0-beta.25",
|
||||
"@storybook/svelte-vite": "7.0.0-beta.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.0.0",
|
||||
@ -76,5 +76,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -16,10 +16,7 @@ export const viteFinal: NonNullable<StorybookConfig['viteFinal']> = async (confi
|
||||
// Remove vite-plugin-svelte-kit from plugins if using SvelteKit
|
||||
// see https://github.com/storybookjs/storybook/issues/19280#issuecomment-1281204341
|
||||
plugins = await withoutVitePlugins(plugins, [
|
||||
// pre @sveltejs/kit@1.0.0-next.574
|
||||
'vite-plugin-svelte-kit',
|
||||
// @sveltejs/kit@1.0.0-next.582 and later
|
||||
'vite-plugin-sveltekit-setup',
|
||||
// @sveltejs/kit@1.0.0-next.587 and later
|
||||
'vite-plugin-sveltekit-compile',
|
||||
]);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/vue": "7.0.0-beta.20",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/vue": "7.0.0-beta.25",
|
||||
"magic-string": "^0.26.1",
|
||||
"vue-docgen-api": "^4.40.0"
|
||||
},
|
||||
@ -79,5 +79,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Vue: Develop Vue Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preset-vue-webpack": "7.0.0-beta.20",
|
||||
"@storybook/vue": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preset-vue-webpack": "7.0.0-beta.25",
|
||||
"@storybook/vue": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -83,5 +83,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Vue3 and Vite: Develop Vue3 components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,15 +48,15 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/vue3": "7.0.0-beta.20",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/vue3": "7.0.0-beta.25",
|
||||
"magic-string": "^0.26.1",
|
||||
"vue-docgen-api": "^4.40.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.0.0",
|
||||
"@vitejs/plugin-vue": "^4.0.0",
|
||||
"typescript": "~4.9.3",
|
||||
"vite": "^4.0.0"
|
||||
},
|
||||
@ -76,7 +76,12 @@
|
||||
"./src/index.ts",
|
||||
"./src/preset.ts"
|
||||
],
|
||||
"externals": [
|
||||
"util",
|
||||
"tty",
|
||||
"path"
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue3-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for Vue 3: Develop Vue 3 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preset-vue3-webpack": "7.0.0-beta.20",
|
||||
"@storybook/vue3": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preset-vue3-webpack": "7.0.0-beta.25",
|
||||
"@storybook/vue3": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -80,5 +80,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for web-components and Vite: Develop Web Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -48,10 +48,10 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/web-components": "7.0.0-beta.20",
|
||||
"@storybook/builder-vite": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/web-components": "7.0.0-beta.25",
|
||||
"magic-string": "^0.26.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -75,5 +75,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/web-components-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook for web-components: View web components snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"lit-html",
|
||||
@ -51,10 +51,10 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/preset-web-components-webpack": "7.0.0-beta.20",
|
||||
"@storybook/web-components": "7.0.0-beta.20",
|
||||
"@storybook/builder-webpack5": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/preset-web-components-webpack": "7.0.0-beta.25",
|
||||
"@storybook/web-components": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -79,5 +79,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ module.exports = {
|
||||
'<rootDir>/frameworks/!(angular)*',
|
||||
'<rootDir>/lib/*',
|
||||
'<rootDir>/renderers/*',
|
||||
'<rootDir>/ui/*',
|
||||
'<rootDir>/ui/!(node_modules)*',
|
||||
],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: [
|
||||
|
@ -1,11 +1,6 @@
|
||||
import '@testing-library/jest-dom';
|
||||
|
||||
// setup file
|
||||
import { configure } from 'enzyme';
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
import Adapter from 'enzyme-adapter-react-16';
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
import regeneratorRuntime from 'regenerator-runtime';
|
||||
import registerRequireContextHook from '@storybook/babel-plugin-require-context-hook/register';
|
||||
|
||||
registerRequireContextHook();
|
||||
@ -24,10 +19,6 @@ const localStorageMock = {
|
||||
};
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
global.localStorage = localStorageMock;
|
||||
// @ts-expect-error (Converted from ts-ignore)
|
||||
global.regeneratorRuntime = regeneratorRuntime;
|
||||
|
||||
configure({ adapter: new Adapter() });
|
||||
|
||||
/* Fail tests on PropType warnings
|
||||
This allows us to throw an error in tests environments when there are prop-type warnings.
|
||||
|
@ -2,5 +2,5 @@
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"registry": "https://registry.npmjs.org",
|
||||
"version": "7.0.0-beta.20"
|
||||
"version": "7.0.0-beta.25"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addons",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook addons store",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -44,9 +44,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20"
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
@ -60,5 +60,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-manager",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook manager builder",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -44,9 +44,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/manager": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/manager": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@types/ejs": "^3.1.1",
|
||||
"@types/find-cache-dir": "^3.2.1",
|
||||
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
|
||||
@ -55,7 +55,7 @@
|
||||
"esbuild": "^0.16.4",
|
||||
"esbuild-plugin-alias": "^0.2.1",
|
||||
"express": "^4.17.3",
|
||||
"find-cache-dir": "^4.0.0",
|
||||
"find-cache-dir": "^3.0.0",
|
||||
"fs-extra": "^9.0.1",
|
||||
"process": "^0.11.10",
|
||||
"slash": "^3.0.0",
|
||||
@ -73,5 +73,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,7 +1,18 @@
|
||||
import findCacheDirectory from 'find-cache-dir';
|
||||
import fs from 'fs-extra';
|
||||
import { join, parse, relative } from 'node:path';
|
||||
import { join, parse, relative, sep } from 'node:path';
|
||||
import slash from 'slash';
|
||||
|
||||
const sanitizeBase = (path: string) => {
|
||||
return path.replaceAll('.', '').replaceAll('@', '').replaceAll(sep, '-').replaceAll('/', '-');
|
||||
};
|
||||
|
||||
const sanitizeFinal = (path: string) => {
|
||||
const sections = path.split(/-?node_modules-?/);
|
||||
|
||||
return sections[sections.length - 1].replaceAll('storybook-addon-', '').replaceAll('dist-', '');
|
||||
};
|
||||
|
||||
/**
|
||||
* Manager entries should be **self-invoking** bits of code.
|
||||
* They can of-course import from modules, and ESbuild will bundle all of that into a single file.
|
||||
@ -20,7 +31,7 @@ import slash from 'slash';
|
||||
*/
|
||||
export async function wrapManagerEntries(entrypoints: string[]) {
|
||||
return Promise.all(
|
||||
entrypoints.map(async (entry) => {
|
||||
entrypoints.map(async (entry, i) => {
|
||||
const { name, dir } = parse(entry);
|
||||
const cacheLocation = findCacheDirectory({ name: 'sb-manager' });
|
||||
|
||||
@ -28,7 +39,12 @@ export async function wrapManagerEntries(entrypoints: string[]) {
|
||||
throw new Error('Could not create/find cache directory');
|
||||
}
|
||||
|
||||
const location = join(cacheLocation, relative(process.cwd(), dir), `${name}-bundle.mjs`);
|
||||
const base = relative(process.cwd(), dir);
|
||||
const location = join(
|
||||
cacheLocation,
|
||||
sanitizeFinal(join(`${sanitizeBase(base)}-${i}`, `${sanitizeBase(name)}-bundle.mjs`))
|
||||
);
|
||||
|
||||
await fs.ensureFile(location);
|
||||
await fs.writeFile(location, `import '${slash(entry)}';`);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-vite",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "A plugin to run and build Storybooks with Vite",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/main/code/lib/builder-vite/#readme",
|
||||
"bugs": {
|
||||
@ -43,14 +43,14 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/csf-plugin": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/csf-plugin": "7.0.0-beta.25",
|
||||
"@storybook/mdx2-csf": "next",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"browser-assert": "^1.2.1",
|
||||
"es-module-lexer": "^0.9.3",
|
||||
"express": "^4.17.3",
|
||||
@ -59,8 +59,8 @@
|
||||
"glob-promise": "^4.2.0",
|
||||
"magic-string": "^0.26.1",
|
||||
"rollup": "^2.25.0 || ^3.3.0",
|
||||
"rollup-plugin-external-globals": "^0.7.1",
|
||||
"slash": "^3.0.0"
|
||||
"slash": "^3.0.0",
|
||||
"vite-plugin-externals": "^0.5.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.13",
|
||||
@ -95,5 +95,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
1
code/lib/builder-vite/src/typings.d.ts
vendored
1
code/lib/builder-vite/src/typings.d.ts
vendored
@ -1 +0,0 @@
|
||||
declare module 'rollup-plugin-external-globals';
|
@ -7,7 +7,7 @@ import type {
|
||||
UserConfig as ViteConfig,
|
||||
InlineConfig,
|
||||
} from 'vite';
|
||||
import externalGlobals from 'rollup-plugin-external-globals';
|
||||
import { viteExternalsPlugin } from 'vite-plugin-externals';
|
||||
import { isPreservingSymlinks, getFrameworkName } from '@storybook/core-common';
|
||||
import { globals } from '@storybook/preview/globals';
|
||||
import {
|
||||
@ -91,7 +91,7 @@ export async function pluginConfig(options: ExtendedOptions) {
|
||||
}
|
||||
},
|
||||
},
|
||||
externalGlobals(globals),
|
||||
viteExternalsPlugin(globals, { useWindow: false }),
|
||||
] as PluginOption[];
|
||||
|
||||
// TODO: framework doesn't exist, should move into framework when/if built
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-webpack5",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -58,25 +58,25 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.12.10",
|
||||
"@storybook/addons": "7.0.0-beta.20",
|
||||
"@storybook/api": "7.0.0-beta.20",
|
||||
"@storybook/channel-postmessage": "7.0.0-beta.20",
|
||||
"@storybook/channel-websocket": "7.0.0-beta.20",
|
||||
"@storybook/channels": "7.0.0-beta.20",
|
||||
"@storybook/client-api": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/components": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/core-webpack": "7.0.0-beta.20",
|
||||
"@storybook/addons": "7.0.0-beta.25",
|
||||
"@storybook/api": "7.0.0-beta.25",
|
||||
"@storybook/channel-postmessage": "7.0.0-beta.25",
|
||||
"@storybook/channel-websocket": "7.0.0-beta.25",
|
||||
"@storybook/channels": "7.0.0-beta.25",
|
||||
"@storybook/client-api": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/components": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/core-webpack": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/router": "7.0.0-beta.20",
|
||||
"@storybook/store": "7.0.0-beta.20",
|
||||
"@storybook/theming": "7.0.0-beta.20",
|
||||
"@storybook/manager-api": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/router": "7.0.0-beta.25",
|
||||
"@storybook/store": "7.0.0-beta.25",
|
||||
"@storybook/theming": "7.0.0-beta.25",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/semver": "^7.3.4",
|
||||
"babel-loader": "^8.3.0",
|
||||
@ -91,7 +91,7 @@
|
||||
"path-browserify": "^1.0.1",
|
||||
"process": "^0.11.10",
|
||||
"semver": "^7.3.7",
|
||||
"slash": "^5.0.0",
|
||||
"slash": "^3.0.0",
|
||||
"style-loader": "^3.3.1",
|
||||
"terser-webpack-plugin": "^5.3.1",
|
||||
"ts-dedent": "^2.0.0",
|
||||
@ -131,5 +131,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-postmessage",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,9 +43,9 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/channels": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"qs": "^6.10.0",
|
||||
"telejson": "^7.0.3"
|
||||
@ -61,5 +61,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-websocket",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "7.0.0-beta.20",
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/channels": "7.0.0-beta.25",
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"telejson": "^7.0.3"
|
||||
},
|
||||
@ -59,5 +59,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channels",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -53,5 +53,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sb",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -21,10 +21,10 @@
|
||||
"license": "MIT",
|
||||
"bin": "./index.js",
|
||||
"dependencies": {
|
||||
"@storybook/cli": "7.0.0-beta.20"
|
||||
"@storybook/cli": "7.0.0-beta.25"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "storybook",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook CLI",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -24,10 +24,10 @@
|
||||
"storybook": "./index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/cli": "7.0.0-beta.20"
|
||||
"@storybook/cli": "7.0.0-beta.25"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/cli",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook's CLI - easiest method of adding storybook to your projects",
|
||||
"keywords": [
|
||||
"cli",
|
||||
@ -43,13 +43,13 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@storybook/codemod": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-server": "7.0.0-beta.20",
|
||||
"@storybook/csf-tools": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/telemetry": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/codemod": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-server": "7.0.0-beta.25",
|
||||
"@storybook/csf-tools": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/telemetry": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/semver": "^7.3.4",
|
||||
"boxen": "^5.1.2",
|
||||
"chalk": "^4.1.0",
|
||||
@ -78,7 +78,7 @@
|
||||
"util-deprecate": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-api": "7.0.0-beta.20",
|
||||
"@storybook/client-api": "7.0.0-beta.25",
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
"@types/prompts": "^2.0.9",
|
||||
"@types/puppeteer-core": "^2.1.0",
|
||||
@ -88,10 +88,6 @@
|
||||
"strip-json-comments": "^3.1.1",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
@ -101,5 +97,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,19 +1,18 @@
|
||||
/// <reference types="@types/jest" />;
|
||||
|
||||
import { dedent } from 'ts-dedent';
|
||||
import { fixMdxScript } from './mdx-1-to-2';
|
||||
import { fixMdxStyleTags, fixMdxComments } from './mdx-1-to-2';
|
||||
|
||||
describe('fix', () => {
|
||||
it('fixes badly-formatted style blocks', () => {
|
||||
expect(
|
||||
fixMdxScript(dedent`
|
||||
it('fixMdxStyleTags fixes badly-formatted style blocks', () => {
|
||||
expect(
|
||||
fixMdxStyleTags(dedent`
|
||||
<style>{\`
|
||||
.foo {}
|
||||
|
||||
.bar {}
|
||||
\`}</style>
|
||||
`)
|
||||
).toEqual(dedent`
|
||||
).toEqual(dedent`
|
||||
<style>
|
||||
{\`
|
||||
.foo {}
|
||||
@ -22,11 +21,11 @@ describe('fix', () => {
|
||||
\`}
|
||||
</style>
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
it('fixes multiple style blocks', () => {
|
||||
expect(
|
||||
fixMdxScript(dedent`
|
||||
it('fixMdxStyleTags fixes multiple style blocks', () => {
|
||||
expect(
|
||||
fixMdxStyleTags(dedent`
|
||||
<style>{\`
|
||||
.foo {}
|
||||
\`}</style>
|
||||
@ -34,7 +33,7 @@ describe('fix', () => {
|
||||
.bar {}
|
||||
\`}</style>
|
||||
`)
|
||||
).toMatchInlineSnapshot(`
|
||||
).toMatchInlineSnapshot(`
|
||||
<style>
|
||||
{\`
|
||||
.foo {}
|
||||
@ -46,5 +45,76 @@ describe('fix', () => {
|
||||
\`}
|
||||
</style>
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
||||
it('fixMdxComments fixes all comments', () => {
|
||||
expect(
|
||||
fixMdxComments(dedent`
|
||||
# Hello
|
||||
|
||||
<!-- This is a comment -->
|
||||
|
||||
and this is not
|
||||
|
||||
<!-- This is another comment -->
|
||||
`)
|
||||
).toMatchInlineSnapshot(`
|
||||
"# Hello
|
||||
|
||||
{/* This is a comment */}
|
||||
|
||||
and this is not
|
||||
|
||||
{/* This is another comment */}"
|
||||
`);
|
||||
});
|
||||
|
||||
it('fixMdxComments keeps html comments in codeblocks', () => {
|
||||
expect(
|
||||
fixMdxComments(dedent`
|
||||
# Hello
|
||||
|
||||
~~~html
|
||||
<!-- This is a comment -->
|
||||
~~~
|
||||
|
||||
~~~html
|
||||
<!-- This is a comment -->
|
||||
~~~
|
||||
|
||||
\`\`\`html
|
||||
<!-- This is a comment -->
|
||||
\`\`\`
|
||||
|
||||
\`\`\`html
|
||||
<!-- This is a comment -->
|
||||
\`\`\`
|
||||
|
||||
and this is not
|
||||
|
||||
<!-- This is another comment -->
|
||||
`)
|
||||
).toMatchInlineSnapshot(`
|
||||
"# Hello
|
||||
|
||||
~~~html
|
||||
<!-- This is a comment -->
|
||||
~~~
|
||||
|
||||
~~~html
|
||||
<!-- This is a comment -->
|
||||
~~~
|
||||
|
||||
\`\`\`html
|
||||
<!-- This is a comment -->
|
||||
\`\`\`
|
||||
|
||||
\`\`\`html
|
||||
<!-- This is a comment -->
|
||||
\`\`\`
|
||||
|
||||
and this is not
|
||||
|
||||
{/* This is another comment */}"
|
||||
`);
|
||||
});
|
||||
|
@ -5,11 +5,28 @@ import fse from 'fs-extra';
|
||||
import globby from 'globby';
|
||||
import type { Fix } from '../types';
|
||||
|
||||
const MDX1_SCRIPT_START = /<style>{`/g;
|
||||
const MDX1_SCRIPT_END = /`}<\/style>/g;
|
||||
const MDX1_STYLE_START = /<style>{`/g;
|
||||
const MDX1_STYLE_END = /`}<\/style>/g;
|
||||
const MDX1_COMMENT = /<!--(.+)-->/g;
|
||||
const MDX1_CODEBLOCK = /(?:\n~~~(?:\n|.)*?\n~~~)|(?:\n```(?:\n|.)*?\n```)/g;
|
||||
|
||||
export const fixMdxScript = (mdx: string) => {
|
||||
return mdx.replace(MDX1_SCRIPT_START, '<style>\n {`').replace(MDX1_SCRIPT_END, ' `}\n</style>');
|
||||
export const fixMdxStyleTags = (mdx: string) => {
|
||||
return mdx.replace(MDX1_STYLE_START, '<style>\n {`').replace(MDX1_STYLE_END, ' `}\n</style>');
|
||||
};
|
||||
|
||||
export const fixMdxComments = (mdx: string) => {
|
||||
const codeblocks = mdx.matchAll(MDX1_CODEBLOCK);
|
||||
|
||||
// separate the mdx into sections without codeblocks & replace html comments NOT in codeblocks
|
||||
const sections = mdx
|
||||
.split(MDX1_CODEBLOCK)
|
||||
.map((v) => v.replace(MDX1_COMMENT, (original, group) => `{/*${group}*/}`));
|
||||
|
||||
// interleave the original codeblocks with the replaced sections
|
||||
return sections.reduce((acc, item, i) => {
|
||||
const next = codeblocks.next();
|
||||
return next.done ? acc + item : acc + item + next.value[0];
|
||||
}, '');
|
||||
};
|
||||
|
||||
const logger = console;
|
||||
@ -48,10 +65,10 @@ export const mdx1to2: Fix<Mdx1to2Options> = {
|
||||
},
|
||||
|
||||
async run({ result: { storiesMdxFiles }, dryRun }) {
|
||||
await Promise.all(
|
||||
storiesMdxFiles.map(async (fname) => {
|
||||
await Promise.all([
|
||||
...storiesMdxFiles.map(async (fname) => {
|
||||
const contents = await fse.readFile(fname, 'utf-8');
|
||||
const updated = fixMdxScript(contents);
|
||||
const updated = fixMdxComments(fixMdxStyleTags(contents));
|
||||
if (updated === contents) {
|
||||
logger.info(`🆗 Unmodified ${basename(fname)}`);
|
||||
} else {
|
||||
@ -60,7 +77,7 @@ export const mdx1to2: Fix<Mdx1to2Options> = {
|
||||
await fse.writeFile(fname, updated);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
}),
|
||||
]);
|
||||
},
|
||||
};
|
||||
|
@ -252,6 +252,33 @@ describe('new-frameworks fix', () => {
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
it('should update to @storybook/preact-vite', async () => {
|
||||
const packageJson = {
|
||||
dependencies: {
|
||||
'@storybook/preact': '^7.0.0-alpha.0',
|
||||
'@storybook/builder-vite': '^0.0.2',
|
||||
vite: '3.0.0',
|
||||
},
|
||||
};
|
||||
await expect(
|
||||
checkNewFrameworks({
|
||||
packageJson,
|
||||
main: {
|
||||
framework: '@storybook/preact',
|
||||
core: {
|
||||
builder: '@storybook/builder-vite',
|
||||
},
|
||||
},
|
||||
})
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
frameworkPackage: '@storybook/preact-vite',
|
||||
dependenciesToAdd: ['@storybook/preact-vite'],
|
||||
dependenciesToRemove: ['@storybook/builder-vite'],
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ const packagesMap: Record<string, { webpack5?: string; vite?: string }> = {
|
||||
},
|
||||
'@storybook/preact': {
|
||||
webpack5: '@storybook/preact-webpack5',
|
||||
vite: '@storybook/preact-vite',
|
||||
},
|
||||
'@storybook/server': {
|
||||
webpack5: '@storybook/server-webpack5',
|
||||
|
@ -2,11 +2,8 @@ import { sync as readUpSync } from 'read-pkg-up';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import { buildStaticStandalone, withTelemetry } from '@storybook/core-server';
|
||||
import { cache } from '@storybook/core-common';
|
||||
import { ensureReactPeerDeps } from './ensure-react-peer-deps';
|
||||
|
||||
export const build = async (cliOptions: any) => {
|
||||
ensureReactPeerDeps();
|
||||
|
||||
try {
|
||||
const options = {
|
||||
...cliOptions,
|
||||
|
@ -3,13 +3,10 @@ import { sync as readUpSync } from 'read-pkg-up';
|
||||
import { logger, instance as npmLog } from '@storybook/node-logger';
|
||||
import { buildDevStandalone, withTelemetry } from '@storybook/core-server';
|
||||
import { cache } from '@storybook/core-common';
|
||||
import { ensureReactPeerDeps } from './ensure-react-peer-deps';
|
||||
|
||||
export const dev = async (cliOptions: any) => {
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
ensureReactPeerDeps();
|
||||
|
||||
try {
|
||||
const options = {
|
||||
...cliOptions,
|
||||
|
@ -73,7 +73,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => {
|
||||
}
|
||||
*/
|
||||
|
||||
// to the user's angular.json file. see: https://github.com/storybookjs/storybook/blob/next/examples/angular-cli/angular.json#L78
|
||||
// to the user's angular.json file.
|
||||
|
||||
// then we want to add these scripts to package.json
|
||||
// packageManager.addScripts({
|
||||
|
@ -5,7 +5,8 @@ import boxen from 'boxen';
|
||||
import { dedent } from 'ts-dedent';
|
||||
import { downloadTemplate } from 'giget';
|
||||
|
||||
import { existsSync } from 'fs-extra';
|
||||
import { existsSync, readdir } from 'fs-extra';
|
||||
import type { Template, TemplateKey } from './repro-templates';
|
||||
import { allTemplates as TEMPLATES } from './repro-templates';
|
||||
|
||||
const logger = console;
|
||||
@ -26,85 +27,89 @@ export const reproNext = async ({
|
||||
branch,
|
||||
init,
|
||||
}: ReproOptions) => {
|
||||
const filterRegex = new RegExp(`^${filterValue || ''}`, 'i');
|
||||
|
||||
const keys = Object.keys(TEMPLATES) as Choice[];
|
||||
// get value from template and reduce through TEMPLATES to filter out the correct template
|
||||
const choices = keys.reduce<Choice[]>((acc, group) => {
|
||||
const current = TEMPLATES[group];
|
||||
|
||||
if (!filterValue) {
|
||||
acc.push(group);
|
||||
return acc;
|
||||
}
|
||||
|
||||
if (
|
||||
current.name.match(filterRegex) ||
|
||||
group.match(filterRegex) ||
|
||||
current.expected.builder.match(filterRegex) ||
|
||||
current.expected.framework.match(filterRegex) ||
|
||||
current.expected.renderer.match(filterRegex)
|
||||
) {
|
||||
acc.push(group);
|
||||
return acc;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
if (choices.length === 0) {
|
||||
logger.info(
|
||||
boxen(
|
||||
dedent`
|
||||
🔎 You filtered out all templates. 🔍
|
||||
|
||||
After filtering all the templates with "${chalk.yellow(
|
||||
filterValue
|
||||
)}", we found no results. Please try again with a different filter.
|
||||
|
||||
Available templates:
|
||||
${keys.map((key) => chalk.blue`- ${key}`).join('\n')}
|
||||
`.trim(),
|
||||
{ borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
let selectedTemplate: Choice | null = null;
|
||||
|
||||
if (choices.length === 1) {
|
||||
[selectedTemplate] = choices;
|
||||
} else {
|
||||
logger.info(
|
||||
boxen(
|
||||
dedent`
|
||||
🤗 Welcome to ${chalk.yellow('sb repro NEXT')}! 🤗
|
||||
|
||||
Create a ${chalk.green('new project')} to minimally reproduce Storybook issues.
|
||||
|
||||
1. select an environment that most closely matches your project setup.
|
||||
2. select a location for the reproduction, outside of your project.
|
||||
|
||||
After the reproduction is ready, we'll guide you through the next steps.
|
||||
`.trim(),
|
||||
{ borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any
|
||||
)
|
||||
);
|
||||
|
||||
selectedTemplate = await promptSelectedTemplate(choices);
|
||||
}
|
||||
|
||||
const hasSelectedTemplate = !!(selectedTemplate ?? null);
|
||||
if (!hasSelectedTemplate) {
|
||||
logger.error('Somehow we got no templates. Please rerun this command!');
|
||||
return;
|
||||
}
|
||||
|
||||
const selectedConfig = TEMPLATES[selectedTemplate];
|
||||
// Either get a direct match when users pass a template id, or filter through all templates
|
||||
let selectedConfig: Template | undefined = TEMPLATES[filterValue as TemplateKey];
|
||||
let selectedTemplate: Choice | null = selectedConfig ? (filterValue as TemplateKey) : null;
|
||||
|
||||
if (!selectedConfig) {
|
||||
throw new Error('🚨 Repro: please specify a valid template type');
|
||||
const filterRegex = new RegExp(`^${filterValue || ''}`, 'i');
|
||||
|
||||
const keys = Object.keys(TEMPLATES) as Choice[];
|
||||
// get value from template and reduce through TEMPLATES to filter out the correct template
|
||||
const choices = keys.reduce<Choice[]>((acc, group) => {
|
||||
const current = TEMPLATES[group];
|
||||
|
||||
if (!filterValue) {
|
||||
acc.push(group);
|
||||
return acc;
|
||||
}
|
||||
|
||||
if (
|
||||
current.name.match(filterRegex) ||
|
||||
group.match(filterRegex) ||
|
||||
current.expected.builder.match(filterRegex) ||
|
||||
current.expected.framework.match(filterRegex) ||
|
||||
current.expected.renderer.match(filterRegex)
|
||||
) {
|
||||
acc.push(group);
|
||||
return acc;
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
if (choices.length === 0) {
|
||||
logger.info(
|
||||
boxen(
|
||||
dedent`
|
||||
🔎 You filtered out all templates. 🔍
|
||||
|
||||
After filtering all the templates with "${chalk.yellow(
|
||||
filterValue
|
||||
)}", we found no results. Please try again with a different filter.
|
||||
|
||||
Available templates:
|
||||
${keys.map((key) => chalk.blue`- ${key}`).join('\n')}
|
||||
`.trim(),
|
||||
{ borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (choices.length === 1) {
|
||||
[selectedTemplate] = choices;
|
||||
} else {
|
||||
logger.info(
|
||||
boxen(
|
||||
dedent`
|
||||
🤗 Welcome to ${chalk.yellow('sb repro NEXT')}! 🤗
|
||||
|
||||
Create a ${chalk.green('new project')} to minimally reproduce Storybook issues.
|
||||
|
||||
1. select an environment that most closely matches your project setup.
|
||||
2. select a location for the reproduction, outside of your project.
|
||||
|
||||
After the reproduction is ready, we'll guide you through the next steps.
|
||||
`.trim(),
|
||||
{ borderStyle: 'round', padding: 1, borderColor: '#F1618C' } as any
|
||||
)
|
||||
);
|
||||
|
||||
selectedTemplate = await promptSelectedTemplate(choices);
|
||||
}
|
||||
|
||||
const hasSelectedTemplate = !!(selectedTemplate ?? null);
|
||||
if (!hasSelectedTemplate) {
|
||||
logger.error('Somehow we got no templates. Please rerun this command!');
|
||||
return;
|
||||
}
|
||||
|
||||
selectedConfig = TEMPLATES[selectedTemplate];
|
||||
|
||||
if (!selectedConfig) {
|
||||
throw new Error('🚨 Repro: please specify a valid template type');
|
||||
}
|
||||
}
|
||||
|
||||
let selectedDirectory = outputDirectory;
|
||||
@ -114,16 +119,24 @@ export const reproNext = async ({
|
||||
}
|
||||
|
||||
if (!selectedDirectory) {
|
||||
const { directory } = await prompts({
|
||||
type: 'text',
|
||||
message: 'Enter the output directory',
|
||||
name: 'directory',
|
||||
initial: outputDirectoryName,
|
||||
validate: async (directoryName) =>
|
||||
existsSync(directoryName)
|
||||
? `${directoryName} already exists. Please choose another name.`
|
||||
: true,
|
||||
});
|
||||
const { directory } = await prompts(
|
||||
{
|
||||
type: 'text',
|
||||
message: 'Enter the output directory',
|
||||
name: 'directory',
|
||||
initial: outputDirectoryName,
|
||||
validate: async (directoryName) =>
|
||||
existsSync(directoryName)
|
||||
? `${directoryName} already exists. Please choose another name.`
|
||||
: true,
|
||||
},
|
||||
{
|
||||
onCancel: () => {
|
||||
logger.log('Command cancelled by the user. Exiting...');
|
||||
process.exit(1);
|
||||
},
|
||||
}
|
||||
);
|
||||
selectedDirectory = directory;
|
||||
}
|
||||
|
||||
@ -138,13 +151,20 @@ export const reproNext = async ({
|
||||
try {
|
||||
const templateType = init ? 'after-storybook' : 'before-storybook';
|
||||
// Download the repro based on subfolder "after-storybook" and selected branch
|
||||
await downloadTemplate(
|
||||
`github:storybookjs/repro-templates-temp/${selectedTemplate}/${templateType}#${branch}`,
|
||||
{
|
||||
force: true,
|
||||
dir: templateDestination,
|
||||
}
|
||||
);
|
||||
const gitPath = `github:storybookjs/repro-templates-temp/${selectedTemplate}/${templateType}#${branch}`;
|
||||
await downloadTemplate(gitPath, {
|
||||
force: true,
|
||||
dir: templateDestination,
|
||||
});
|
||||
// throw an error if templateDestination is an empty directory using fs-extra
|
||||
if ((await readdir(templateDestination)).length === 0) {
|
||||
throw new Error(
|
||||
dedent`Template downloaded from ${chalk.blue(gitPath)} is empty.
|
||||
Are you use it exists? Or did you want to set ${chalk.yellow(
|
||||
selectedTemplate
|
||||
)} to inDevelopment first?`
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error(`🚨 Failed to download repro template: ${err.message}`);
|
||||
throw err;
|
||||
@ -180,12 +200,20 @@ export const reproNext = async ({
|
||||
};
|
||||
|
||||
async function promptSelectedTemplate(choices: Choice[]): Promise<Choice | null> {
|
||||
const { template } = await prompts({
|
||||
type: 'select',
|
||||
message: '🌈 Select the template',
|
||||
name: 'template',
|
||||
choices: choices.map(toChoices),
|
||||
});
|
||||
const { template } = await prompts(
|
||||
{
|
||||
type: 'select',
|
||||
message: '🌈 Select the template',
|
||||
name: 'template',
|
||||
choices: choices.map(toChoices),
|
||||
},
|
||||
{
|
||||
onCancel: () => {
|
||||
logger.log('Command cancelled by the user. Exiting...');
|
||||
process.exit(1);
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return template || null;
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
import type { StorybookConfig } from '@storybook/types';
|
||||
|
||||
export type SkippableTask = 'smoke-test' | 'test-runner' | 'chromatic' | 'e2e-tests';
|
||||
export type TemplateKey = keyof typeof allTemplates;
|
||||
export type TemplateKey = keyof typeof baseTemplates | keyof typeof internalTemplates;
|
||||
export type Cadence = keyof typeof templatesByCadence;
|
||||
|
||||
export type Template = {
|
||||
/**
|
||||
* Readable name for the template, which will be used for feedback and the status page
|
||||
@ -41,9 +44,21 @@ export type Template = {
|
||||
* NOTE: Make sure to always add a TODO comment to remove this flag in a subsequent PR.
|
||||
*/
|
||||
inDevelopment?: boolean;
|
||||
/**
|
||||
* Some sandboxes might need extra modifications in the initialized Storybook,
|
||||
* such as extend main.js, for setting specific feature flags like storyStoreV7, etc.
|
||||
*/
|
||||
modifications?: {
|
||||
mainConfig?: Partial<StorybookConfig>;
|
||||
};
|
||||
/**
|
||||
* Flag to indicate that this template is a secondary template, which is used mainly to test rather specific features.
|
||||
* This means the template might be hidden from the Storybook status page or the repro CLI command.
|
||||
* */
|
||||
isInternal?: boolean;
|
||||
};
|
||||
|
||||
export const allTemplates = {
|
||||
const baseTemplates = {
|
||||
'cra/default-js': {
|
||||
name: 'Create React App (Javascript)',
|
||||
script: 'npx create-react-app .',
|
||||
@ -351,6 +366,45 @@ export const allTemplates = {
|
||||
},
|
||||
} satisfies Record<string, Template>;
|
||||
|
||||
/**
|
||||
* Internal templates reuse config from other templates and add extra config on top.
|
||||
* They must contain an id that starts with 'internal/' and contain "isInternal: true".
|
||||
* They will be hidden by default in the Storybook status page.
|
||||
*/
|
||||
const internalTemplates = {
|
||||
'internal/ssv6-vite': {
|
||||
...baseTemplates['react-vite/default-ts'],
|
||||
name: 'StoryStore v6 (react-vite/default-ts)',
|
||||
inDevelopment: true,
|
||||
isInternal: true,
|
||||
modifications: {
|
||||
mainConfig: {
|
||||
features: {
|
||||
storyStoreV7: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
'internal/ssv6-webpack': {
|
||||
...baseTemplates['react-webpack/18-ts'],
|
||||
name: 'StoryStore v6 (react-webpack/18-ts)',
|
||||
inDevelopment: true,
|
||||
isInternal: true,
|
||||
modifications: {
|
||||
mainConfig: {
|
||||
features: {
|
||||
storyStoreV7: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies Record<`internal/${string}`, Template & { isInternal: true }>;
|
||||
|
||||
export const allTemplates: Record<TemplateKey, Template> = {
|
||||
...baseTemplates,
|
||||
...internalTemplates,
|
||||
};
|
||||
|
||||
export const ci: TemplateKey[] = ['cra/default-ts', 'react-vite/default-ts'];
|
||||
export const pr: TemplateKey[] = [
|
||||
...ci,
|
||||
@ -371,6 +425,8 @@ export const merged: TemplateKey[] = [
|
||||
'preact-webpack5/default-ts',
|
||||
'preact-vite/default-ts',
|
||||
'html-webpack/default',
|
||||
'internal/ssv6-vite',
|
||||
'internal/ssv6-webpack',
|
||||
];
|
||||
export const daily: TemplateKey[] = [
|
||||
...merged,
|
||||
|
@ -1,90 +1,90 @@
|
||||
// auto generated file, do not edit
|
||||
export default {
|
||||
'@storybook/addon-a11y': '7.0.0-beta.20',
|
||||
'@storybook/addon-actions': '7.0.0-beta.20',
|
||||
'@storybook/addon-backgrounds': '7.0.0-beta.20',
|
||||
'@storybook/addon-controls': '7.0.0-beta.20',
|
||||
'@storybook/addon-docs': '7.0.0-beta.20',
|
||||
'@storybook/addon-essentials': '7.0.0-beta.20',
|
||||
'@storybook/addon-highlight': '7.0.0-beta.20',
|
||||
'@storybook/addon-interactions': '7.0.0-beta.20',
|
||||
'@storybook/addon-jest': '7.0.0-beta.20',
|
||||
'@storybook/addon-links': '7.0.0-beta.20',
|
||||
'@storybook/addon-measure': '7.0.0-beta.20',
|
||||
'@storybook/addon-outline': '7.0.0-beta.20',
|
||||
'@storybook/addon-storyshots': '7.0.0-beta.20',
|
||||
'@storybook/addon-storyshots-puppeteer': '7.0.0-beta.20',
|
||||
'@storybook/addon-storysource': '7.0.0-beta.20',
|
||||
'@storybook/addon-toolbars': '7.0.0-beta.20',
|
||||
'@storybook/addon-viewport': '7.0.0-beta.20',
|
||||
'@storybook/addons': '7.0.0-beta.20',
|
||||
'@storybook/angular': '7.0.0-beta.20',
|
||||
'@storybook/manager-api': '7.0.0-beta.20',
|
||||
'@storybook/blocks': '7.0.0-beta.20',
|
||||
'@storybook/builder-manager': '7.0.0-beta.20',
|
||||
'@storybook/builder-vite': '7.0.0-beta.20',
|
||||
'@storybook/builder-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/channel-postmessage': '7.0.0-beta.20',
|
||||
'@storybook/channel-websocket': '7.0.0-beta.20',
|
||||
'@storybook/channels': '7.0.0-beta.20',
|
||||
'@storybook/cli': '7.0.0-beta.20',
|
||||
'@storybook/client-api': '7.0.0-beta.20',
|
||||
'@storybook/client-logger': '7.0.0-beta.20',
|
||||
'@storybook/codemod': '7.0.0-beta.20',
|
||||
'@storybook/components': '7.0.0-beta.20',
|
||||
'@storybook/core-client': '7.0.0-beta.20',
|
||||
'@storybook/core-common': '7.0.0-beta.20',
|
||||
'@storybook/core-events': '7.0.0-beta.20',
|
||||
'@storybook/core-server': '7.0.0-beta.20',
|
||||
'@storybook/core-webpack': '7.0.0-beta.20',
|
||||
'@storybook/csf-tools': '7.0.0-beta.20',
|
||||
'@storybook/docs-tools': '7.0.0-beta.20',
|
||||
'@storybook/ember': '7.0.0-beta.20',
|
||||
'@storybook/html': '7.0.0-beta.20',
|
||||
'@storybook/html-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/html-vite': '7.0.0-beta.20',
|
||||
'@storybook/instrumenter': '7.0.0-beta.20',
|
||||
'@storybook/nextjs': '7.0.0-beta.20',
|
||||
'@storybook/node-logger': '7.0.0-beta.20',
|
||||
'@storybook/postinstall': '7.0.0-beta.20',
|
||||
'@storybook/preact': '7.0.0-beta.20',
|
||||
'@storybook/preact-vite': '7.0.0-beta.20',
|
||||
'@storybook/preact-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/preset-html-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-preact-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-react-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-server-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-svelte-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-vue-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-vue3-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preset-web-components-webpack': '7.0.0-beta.20',
|
||||
'@storybook/preview': '7.0.0-beta.20',
|
||||
'@storybook/preview-api': '7.0.0-beta.20',
|
||||
'@storybook/preview-web': '7.0.0-beta.20',
|
||||
'@storybook/react': '7.0.0-beta.20',
|
||||
'@storybook/react-vite': '7.0.0-beta.20',
|
||||
'@storybook/react-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/router': '7.0.0-beta.20',
|
||||
'@storybook/server': '7.0.0-beta.20',
|
||||
'@storybook/server-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/source-loader': '7.0.0-beta.20',
|
||||
'@storybook/store': '7.0.0-beta.20',
|
||||
'@storybook/svelte': '7.0.0-beta.20',
|
||||
'@storybook/sveltekit': '7.0.0-beta.20',
|
||||
'@storybook/svelte-vite': '7.0.0-beta.20',
|
||||
'@storybook/svelte-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/telemetry': '7.0.0-beta.20',
|
||||
'@storybook/theming': '7.0.0-beta.20',
|
||||
'@storybook/manager': '7.0.0-beta.20',
|
||||
'@storybook/vue': '7.0.0-beta.20',
|
||||
'@storybook/vue-vite': '7.0.0-beta.20',
|
||||
'@storybook/vue-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/vue3': '7.0.0-beta.20',
|
||||
'@storybook/vue3-vite': '7.0.0-beta.20',
|
||||
'@storybook/vue3-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/web-components': '7.0.0-beta.20',
|
||||
'@storybook/web-components-webpack5': '7.0.0-beta.20',
|
||||
'@storybook/web-components-vite': '7.0.0-beta.20',
|
||||
sb: '7.0.0-beta.20',
|
||||
storybook: '7.0.0-beta.20',
|
||||
'@storybook/addon-a11y': '7.0.0-beta.25',
|
||||
'@storybook/addon-actions': '7.0.0-beta.25',
|
||||
'@storybook/addon-backgrounds': '7.0.0-beta.25',
|
||||
'@storybook/addon-controls': '7.0.0-beta.25',
|
||||
'@storybook/addon-docs': '7.0.0-beta.25',
|
||||
'@storybook/addon-essentials': '7.0.0-beta.25',
|
||||
'@storybook/addon-highlight': '7.0.0-beta.25',
|
||||
'@storybook/addon-interactions': '7.0.0-beta.25',
|
||||
'@storybook/addon-jest': '7.0.0-beta.25',
|
||||
'@storybook/addon-links': '7.0.0-beta.25',
|
||||
'@storybook/addon-measure': '7.0.0-beta.25',
|
||||
'@storybook/addon-outline': '7.0.0-beta.25',
|
||||
'@storybook/addon-storyshots': '7.0.0-beta.25',
|
||||
'@storybook/addon-storyshots-puppeteer': '7.0.0-beta.25',
|
||||
'@storybook/addon-storysource': '7.0.0-beta.25',
|
||||
'@storybook/addon-toolbars': '7.0.0-beta.25',
|
||||
'@storybook/addon-viewport': '7.0.0-beta.25',
|
||||
'@storybook/addons': '7.0.0-beta.25',
|
||||
'@storybook/angular': '7.0.0-beta.25',
|
||||
'@storybook/manager-api': '7.0.0-beta.25',
|
||||
'@storybook/blocks': '7.0.0-beta.25',
|
||||
'@storybook/builder-manager': '7.0.0-beta.25',
|
||||
'@storybook/builder-vite': '7.0.0-beta.25',
|
||||
'@storybook/builder-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/channel-postmessage': '7.0.0-beta.25',
|
||||
'@storybook/channel-websocket': '7.0.0-beta.25',
|
||||
'@storybook/channels': '7.0.0-beta.25',
|
||||
'@storybook/cli': '7.0.0-beta.25',
|
||||
'@storybook/client-api': '7.0.0-beta.25',
|
||||
'@storybook/client-logger': '7.0.0-beta.25',
|
||||
'@storybook/codemod': '7.0.0-beta.25',
|
||||
'@storybook/components': '7.0.0-beta.25',
|
||||
'@storybook/core-client': '7.0.0-beta.25',
|
||||
'@storybook/core-common': '7.0.0-beta.25',
|
||||
'@storybook/core-events': '7.0.0-beta.25',
|
||||
'@storybook/core-server': '7.0.0-beta.25',
|
||||
'@storybook/core-webpack': '7.0.0-beta.25',
|
||||
'@storybook/csf-tools': '7.0.0-beta.25',
|
||||
'@storybook/docs-tools': '7.0.0-beta.25',
|
||||
'@storybook/ember': '7.0.0-beta.25',
|
||||
'@storybook/html': '7.0.0-beta.25',
|
||||
'@storybook/html-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/html-vite': '7.0.0-beta.25',
|
||||
'@storybook/instrumenter': '7.0.0-beta.25',
|
||||
'@storybook/nextjs': '7.0.0-beta.25',
|
||||
'@storybook/node-logger': '7.0.0-beta.25',
|
||||
'@storybook/postinstall': '7.0.0-beta.25',
|
||||
'@storybook/preact': '7.0.0-beta.25',
|
||||
'@storybook/preact-vite': '7.0.0-beta.25',
|
||||
'@storybook/preact-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/preset-html-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-preact-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-react-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-server-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-svelte-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-vue-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-vue3-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preset-web-components-webpack': '7.0.0-beta.25',
|
||||
'@storybook/preview': '7.0.0-beta.25',
|
||||
'@storybook/preview-api': '7.0.0-beta.25',
|
||||
'@storybook/preview-web': '7.0.0-beta.25',
|
||||
'@storybook/react': '7.0.0-beta.25',
|
||||
'@storybook/react-vite': '7.0.0-beta.25',
|
||||
'@storybook/react-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/router': '7.0.0-beta.25',
|
||||
'@storybook/server': '7.0.0-beta.25',
|
||||
'@storybook/server-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/source-loader': '7.0.0-beta.25',
|
||||
'@storybook/store': '7.0.0-beta.25',
|
||||
'@storybook/svelte': '7.0.0-beta.25',
|
||||
'@storybook/sveltekit': '7.0.0-beta.25',
|
||||
'@storybook/svelte-vite': '7.0.0-beta.25',
|
||||
'@storybook/svelte-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/telemetry': '7.0.0-beta.25',
|
||||
'@storybook/theming': '7.0.0-beta.25',
|
||||
'@storybook/manager': '7.0.0-beta.25',
|
||||
'@storybook/vue': '7.0.0-beta.25',
|
||||
'@storybook/vue-vite': '7.0.0-beta.25',
|
||||
'@storybook/vue-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/vue3': '7.0.0-beta.25',
|
||||
'@storybook/vue3-vite': '7.0.0-beta.25',
|
||||
'@storybook/vue3-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/web-components': '7.0.0-beta.25',
|
||||
'@storybook/web-components-webpack5': '7.0.0-beta.25',
|
||||
'@storybook/web-components-vite': '7.0.0-beta.25',
|
||||
sb: '7.0.0-beta.25',
|
||||
storybook: '7.0.0-beta.25',
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-api",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook Client API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -42,8 +42,8 @@
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20"
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@ -54,5 +54,5 @@
|
||||
],
|
||||
"shim": "@storybook/preview-api/dist/client-api"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-logger",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -56,5 +56,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
import { global } from '@storybook/global';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
const { LOGLEVEL } = global;
|
||||
|
||||
type LogLevel = 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
||||
@ -20,22 +22,34 @@ type LoggingFn = (message: any, ...args: any[]) => void;
|
||||
|
||||
export const logger = {
|
||||
trace: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber <= levels.trace) console.trace(message, ...rest);
|
||||
if (currentLogLevelNumber <= levels.trace) {
|
||||
console.trace(message, ...rest);
|
||||
}
|
||||
},
|
||||
debug: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber <= levels.debug) console.debug(message, ...rest);
|
||||
if (currentLogLevelNumber <= levels.debug) {
|
||||
console.debug(message, ...rest);
|
||||
}
|
||||
},
|
||||
info: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber <= levels.info) console.info(message, ...rest);
|
||||
if (currentLogLevelNumber <= levels.info) {
|
||||
console.info(message, ...rest);
|
||||
}
|
||||
},
|
||||
warn: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber <= levels.warn) console.warn(message, ...rest);
|
||||
if (currentLogLevelNumber <= levels.warn) {
|
||||
console.warn(message, ...rest);
|
||||
}
|
||||
},
|
||||
error: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber <= levels.error) console.error(message, ...rest);
|
||||
if (currentLogLevelNumber <= levels.error) {
|
||||
console.error(message, ...rest);
|
||||
}
|
||||
},
|
||||
log: (message: any, ...rest: any[]): void => {
|
||||
if (currentLogLevelNumber < levels.silent) console.log(message, ...rest);
|
||||
if (currentLogLevelNumber < levels.silent) {
|
||||
console.log(message, ...rest);
|
||||
}
|
||||
},
|
||||
} as const;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/codemod",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "A collection of codemod scripts written with JSCodeshift",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -50,9 +50,9 @@
|
||||
"@babel/preset-env": "^7.20.2",
|
||||
"@babel/types": "^7.20.2",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/csf-tools": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/csf-tools": "7.0.0-beta.25",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"cross-spawn": "^7.0.3",
|
||||
"globby": "^11.0.2",
|
||||
"jscodeshift": "^0.13.1",
|
||||
@ -85,5 +85,5 @@
|
||||
"./src/transforms/upgrade-hierarchy-separators.js"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import Button from './Button';
|
||||
|
||||
export default {
|
||||
title: 'Some.Button',
|
||||
decorators: [withKnobs, storyFn => <div className="foo">{storyFn}</div>],
|
||||
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
|
||||
};
|
||||
|
||||
export const story1 = () => <Button label="The Button" />;
|
||||
|
@ -5,5 +5,5 @@ import Button from './Button';
|
||||
// This isn't a valid story, but it tests the `import { comp } from ...` case
|
||||
storiesOf('Some.Button', module)
|
||||
.addDecorator(withKnobs)
|
||||
.addDecorator(storyFn => <div className="foo">{storyFn}</div>)
|
||||
.addDecorator((storyFn) => <div className="foo">{storyFn}</div>)
|
||||
.add('with decorator', () => <Button label="The Button" />);
|
||||
|
@ -8,5 +8,5 @@ export function someHelper() {
|
||||
}
|
||||
|
||||
storiesOf('ComponentItem', module)
|
||||
.addDecorator(storyFn => <div style={{ margin: '1rem' }}>{storyFn()}</div>)
|
||||
.addDecorator((storyFn) => <div style={{ margin: '1rem' }}>{storyFn()}</div>)
|
||||
.add('loading', () => <ComponentItem loading />);
|
||||
|
@ -4,7 +4,7 @@ import Button from './Button';
|
||||
storiesOf('Some.Button', module)
|
||||
.add('with story params and decorators', () => <Button label="The Button" />, {
|
||||
bar: 1,
|
||||
decorators: [withKnobs, storyFn => <div className="foo">{storyFn}</div>],
|
||||
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
|
||||
})
|
||||
.add('with story decorators', () => <Button label="The Button" />, {
|
||||
decorators: [withKnobs],
|
||||
|
@ -1,25 +1,21 @@
|
||||
/* eslint-disable */
|
||||
import React from 'react'
|
||||
import Button from './Button'
|
||||
import React from 'react';
|
||||
import Button from './Button';
|
||||
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import { action } from '@storybook/addon-actions'
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
storiesOf(
|
||||
'Button'
|
||||
).addWithInfo(
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage',
|
||||
'This is the basic usage with the button with providing a label to show the text.',
|
||||
() => (
|
||||
<div>
|
||||
<Button label="The Button" onClick={action('onClick')} />
|
||||
<br />
|
||||
<p>
|
||||
Click the "?" mark at top-right to view the info.
|
||||
</p>
|
||||
<p>Click the "?" mark at top-right to view the info.</p>
|
||||
</div>
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (inline info)',
|
||||
@ -28,7 +24,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ inline: true }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (disable source)',
|
||||
@ -37,7 +33,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ source: false, inline: true }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (no header)',
|
||||
@ -46,7 +42,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ header: false, inline: true }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (no prop tables)',
|
||||
@ -55,7 +51,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ propTables: false, inline: true }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (custom propTables)',
|
||||
@ -80,22 +76,19 @@ storiesOf('Button').addWithInfo(
|
||||
</div>
|
||||
),
|
||||
{ inline: true, propTables: [Button] }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (JSX description)',
|
||||
<div>
|
||||
<h2>This is a JSX info section</h2>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed ornare massa rutrum metus commodo, a mattis velit dignissim.
|
||||
Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero
|
||||
nulla.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
||||
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
||||
libero nulla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://github.com/storybookjs/react-storybook-addon-info">
|
||||
This is a link
|
||||
</a>
|
||||
<a href="https://github.com/storybookjs/react-storybook-addon-info">This is a link</a>
|
||||
</p>
|
||||
<p>
|
||||
<img src="https://storybook.js.org/images/placeholders/350x150.png" />
|
||||
@ -105,27 +98,22 @@ storiesOf('Button').addWithInfo(
|
||||
<div>
|
||||
<Button label="The Button" onClick={action('onClick')} />
|
||||
<br />
|
||||
<p>
|
||||
Click the "?" mark at top-right to view the info.
|
||||
</p>
|
||||
<p>Click the "?" mark at top-right to view the info.</p>
|
||||
</div>
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (inline JSX description)',
|
||||
<div>
|
||||
<h2>This is a JSX info section</h2>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed ornare massa rutrum metus commodo, a mattis velit dignissim.
|
||||
Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero
|
||||
nulla.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
||||
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
||||
libero nulla.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://github.com/storybookjs/react-storybook-addon-info">
|
||||
This is a link
|
||||
</a>
|
||||
<a href="https://github.com/storybookjs/react-storybook-addon-info">This is a link</a>
|
||||
</p>
|
||||
<p>
|
||||
<img src="https://storybook.js.org/images/placeholders/350x150.png" />
|
||||
@ -133,7 +121,7 @@ storiesOf('Button').addWithInfo(
|
||||
</div>,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ inline: true }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (maxPropsInLine === 1)',
|
||||
@ -142,7 +130,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{ inline: true, maxPropsIntoLine: 1 }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (maxPropObjectKeys === 5)',
|
||||
@ -151,7 +139,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" object={{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }} />,
|
||||
{ inline: true, maxPropObjectKeys: 5 }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (maxPropArrayLength === 8)',
|
||||
@ -160,7 +148,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" array={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />,
|
||||
{ inline: true, maxPropArrayLength: 8 }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'simple usage (maxPropStringLength === 10)',
|
||||
@ -169,7 +157,7 @@ storiesOf('Button').addWithInfo(
|
||||
`,
|
||||
() => <Button label="The Button" string="1 2 3 4 5 6 7 8" />,
|
||||
{ inline: true, maxPropStringLength: 5 }
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('Button').addWithInfo(
|
||||
'with custom styles',
|
||||
@ -180,19 +168,17 @@ storiesOf('Button').addWithInfo(
|
||||
() => <Button label="The Button" onClick={action('onClick')} />,
|
||||
{
|
||||
inline: true,
|
||||
styles: stylesheet => {
|
||||
styles: (stylesheet) => {
|
||||
stylesheet.infoPage = {
|
||||
backgroundColor: '#ccc'
|
||||
}
|
||||
return stylesheet
|
||||
}
|
||||
backgroundColor: '#ccc',
|
||||
};
|
||||
return stylesheet;
|
||||
},
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
storiesOf('shared/ProgressBar', module)
|
||||
.addDecorator(withKnobs)
|
||||
.addWithInfo('default style', () => (
|
||||
<ProgressBar progress={number('progress', 25)}
|
||||
delay={number('delay', 500)}
|
||||
/>
|
||||
<ProgressBar progress={number('progress', 25)} delay={number('delay', 500)} />
|
||||
));
|
||||
|
@ -2,27 +2,23 @@
|
||||
|
||||
exports[`update-addon-info transforms correctly using "update-addon-info.input.js" data 1`] = `
|
||||
"/* eslint-disable */
|
||||
import React from 'react'
|
||||
import Button from './Button'
|
||||
import React from 'react';
|
||||
import Button from './Button';
|
||||
|
||||
import { storiesOf } from '@storybook/react'
|
||||
import { action } from '@storybook/addon-actions'
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
|
||||
import { withInfo } from \\"@storybook/addon-info\\";
|
||||
|
||||
storiesOf(
|
||||
'Button'
|
||||
).add('simple usage', withInfo(
|
||||
storiesOf('Button').add('simple usage', withInfo(
|
||||
'This is the basic usage with the button with providing a label to show the text.'
|
||||
)(() => (
|
||||
<div>
|
||||
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
||||
<br />
|
||||
<p>
|
||||
Click the \\"?\\" mark at top-right to view the info.
|
||||
</p>
|
||||
<p>Click the \\"?\\" mark at top-right to view the info.</p>
|
||||
</div>
|
||||
)))
|
||||
)));
|
||||
|
||||
storiesOf('Button').add('simple usage (inline info)', withInfo({
|
||||
text: \`
|
||||
@ -30,7 +26,7 @@ storiesOf('Button').add('simple usage (inline info)', withInfo({
|
||||
\`,
|
||||
|
||||
inline: true
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (disable source)', withInfo({
|
||||
text: \`
|
||||
@ -39,7 +35,7 @@ storiesOf('Button').add('simple usage (disable source)', withInfo({
|
||||
|
||||
source: false,
|
||||
inline: true
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (no header)', withInfo({
|
||||
text: \`
|
||||
@ -48,7 +44,7 @@ storiesOf('Button').add('simple usage (no header)', withInfo({
|
||||
|
||||
header: false,
|
||||
inline: true
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (no prop tables)', withInfo({
|
||||
text: \`
|
||||
@ -57,7 +53,7 @@ storiesOf('Button').add('simple usage (no prop tables)', withInfo({
|
||||
|
||||
propTables: false,
|
||||
inline: true
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (custom propTables)', withInfo({
|
||||
text: \`
|
||||
@ -82,20 +78,17 @@ storiesOf('Button').add('simple usage (custom propTables)', withInfo({
|
||||
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
||||
<br />
|
||||
</div>
|
||||
)))
|
||||
)));
|
||||
|
||||
storiesOf('Button').add('simple usage (JSX description)', withInfo(<div>
|
||||
<h2>This is a JSX info section</h2>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed ornare massa rutrum metus commodo, a mattis velit dignissim.
|
||||
Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero
|
||||
nulla.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
||||
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
||||
libero nulla.
|
||||
</p>
|
||||
<p>
|
||||
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">
|
||||
This is a link
|
||||
</a>
|
||||
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">This is a link</a>
|
||||
</p>
|
||||
<p>
|
||||
<img src=\\"https://storybook.js.org/images/placeholders/350x150.png\\" />
|
||||
@ -104,25 +97,20 @@ storiesOf('Button').add('simple usage (JSX description)', withInfo(<div>
|
||||
<div>
|
||||
<Button label=\\"The Button\\" onClick={action('onClick')} />
|
||||
<br />
|
||||
<p>
|
||||
Click the \\"?\\" mark at top-right to view the info.
|
||||
</p>
|
||||
<p>Click the \\"?\\" mark at top-right to view the info.</p>
|
||||
</div>
|
||||
)))
|
||||
)));
|
||||
|
||||
storiesOf('Button').add('simple usage (inline JSX description)', withInfo({
|
||||
text: <div>
|
||||
<h2>This is a JSX info section</h2>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
Sed ornare massa rutrum metus commodo, a mattis velit dignissim.
|
||||
Fusce vestibulum turpis sed massa egestas pharetra. Sed at libero
|
||||
nulla.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ornare massa rutrum metus
|
||||
commodo, a mattis velit dignissim. Fusce vestibulum turpis sed massa egestas pharetra. Sed at
|
||||
libero nulla.
|
||||
</p>
|
||||
<p>
|
||||
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">
|
||||
This is a link
|
||||
</a>
|
||||
<a href=\\"https://github.com/storybookjs/react-storybook-addon-info\\">This is a link</a>
|
||||
</p>
|
||||
<p>
|
||||
<img src=\\"https://storybook.js.org/images/placeholders/350x150.png\\" />
|
||||
@ -130,7 +118,7 @@ storiesOf('Button').add('simple usage (inline JSX description)', withInfo({
|
||||
</div>,
|
||||
|
||||
inline: true
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (maxPropsInLine === 1)', withInfo({
|
||||
text: \`
|
||||
@ -139,7 +127,7 @@ storiesOf('Button').add('simple usage (maxPropsInLine === 1)', withInfo({
|
||||
|
||||
inline: true,
|
||||
maxPropsIntoLine: 1
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('Button').add('simple usage (maxPropObjectKeys === 5)', withInfo({
|
||||
text: \`
|
||||
@ -150,7 +138,7 @@ storiesOf('Button').add('simple usage (maxPropObjectKeys === 5)', withInfo({
|
||||
maxPropObjectKeys: 5
|
||||
})(
|
||||
() => <Button label=\\"The Button\\" object={{ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }} />
|
||||
))
|
||||
));
|
||||
|
||||
storiesOf('Button').add('simple usage (maxPropArrayLength === 8)', withInfo({
|
||||
text: \`
|
||||
@ -161,7 +149,7 @@ storiesOf('Button').add('simple usage (maxPropArrayLength === 8)', withInfo({
|
||||
maxPropArrayLength: 8
|
||||
})(
|
||||
() => <Button label=\\"The Button\\" array={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]} />
|
||||
))
|
||||
));
|
||||
|
||||
storiesOf('Button').add('simple usage (maxPropStringLength === 10)', withInfo({
|
||||
text: \`
|
||||
@ -170,7 +158,7 @@ storiesOf('Button').add('simple usage (maxPropStringLength === 10)', withInfo({
|
||||
|
||||
inline: true,
|
||||
maxPropStringLength: 5
|
||||
})(() => <Button label=\\"The Button\\" string=\\"1 2 3 4 5 6 7 8\\" />))
|
||||
})(() => <Button label=\\"The Button\\" string=\\"1 2 3 4 5 6 7 8\\" />));
|
||||
|
||||
storiesOf('Button').add('with custom styles', withInfo({
|
||||
text: \`
|
||||
@ -180,19 +168,17 @@ storiesOf('Button').add('with custom styles', withInfo({
|
||||
|
||||
inline: true,
|
||||
|
||||
styles: stylesheet => {
|
||||
styles: (stylesheet) => {
|
||||
stylesheet.infoPage = {
|
||||
backgroundColor: '#ccc'
|
||||
}
|
||||
return stylesheet
|
||||
backgroundColor: '#ccc',
|
||||
};
|
||||
return stylesheet;
|
||||
}
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />))
|
||||
})(() => <Button label=\\"The Button\\" onClick={action('onClick')} />));
|
||||
|
||||
storiesOf('shared/ProgressBar', module)
|
||||
.addDecorator(withKnobs)
|
||||
.add('default style', withInfo('default style')(() => (
|
||||
<ProgressBar progress={number('progress', 25)}
|
||||
delay={number('delay', 500)}
|
||||
/>
|
||||
<ProgressBar progress={number('progress', 25)} delay={number('delay', 500)} />
|
||||
)));"
|
||||
`;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-client",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -35,8 +35,8 @@
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20"
|
||||
"@storybook/client-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
@ -47,5 +47,5 @@
|
||||
],
|
||||
"shim": "@storybook/preview-api/dist/core-client"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-common",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -44,8 +44,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.20.2",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/babel__core": "^7.1.20",
|
||||
"@types/express": "^4.7.0",
|
||||
"@types/node": "^16.0.0",
|
||||
@ -83,5 +83,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import path from 'path';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import './presets';
|
||||
|
||||
function wrapPreset(basePresets: any): { babel: Function; webpack: Function } {
|
||||
@ -459,6 +460,10 @@ describe('loadPreset', () => {
|
||||
|
||||
const { loadPreset } = jest.requireActual('./presets');
|
||||
|
||||
beforeEach(() => {
|
||||
jest.spyOn(logger, 'warn');
|
||||
});
|
||||
|
||||
it('should prepend framework field to list of presets', async () => {
|
||||
const loaded = await loadPreset(
|
||||
{
|
||||
@ -595,4 +600,53 @@ describe('loadPreset', () => {
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should warn for addons that are not installed', async () => {
|
||||
const loaded = await loadPreset(
|
||||
{
|
||||
name: '',
|
||||
type: 'virtual',
|
||||
framework: '@storybook/react',
|
||||
presets: ['@storybook/preset-typescript'],
|
||||
addons: ['@storybook/addon-docs/preset', 'uninstalled-addon'],
|
||||
},
|
||||
0,
|
||||
{}
|
||||
);
|
||||
expect(logger.warn).toHaveBeenCalledWith(
|
||||
'Could not resolve addon "uninstalled-addon", skipping. Is it installed?'
|
||||
);
|
||||
expect(loaded).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
Object {
|
||||
"name": "@storybook/preset-typescript",
|
||||
"options": Object {},
|
||||
"preset": Object {},
|
||||
},
|
||||
Object {
|
||||
"name": "@storybook/addon-docs/preset",
|
||||
"options": Object {},
|
||||
"preset": Object {},
|
||||
},
|
||||
Object {
|
||||
"name": Object {
|
||||
"addons": Array [
|
||||
"@storybook/addon-docs/preset",
|
||||
"uninstalled-addon",
|
||||
],
|
||||
"framework": "@storybook/react",
|
||||
"name": "",
|
||||
"presets": Array [
|
||||
"@storybook/preset-typescript",
|
||||
],
|
||||
"type": "virtual",
|
||||
},
|
||||
"options": Object {},
|
||||
"preset": Object {
|
||||
"framework": "@storybook/react",
|
||||
},
|
||||
},
|
||||
]
|
||||
`);
|
||||
});
|
||||
});
|
||||
|
@ -166,18 +166,27 @@ const map =
|
||||
(item: any) => {
|
||||
const options = isObject(item) ? item['options'] || undefined : undefined;
|
||||
const name = isObject(item) ? item['name'] : item;
|
||||
|
||||
let resolved;
|
||||
|
||||
try {
|
||||
const resolved = resolveAddonName(configDir, name, options);
|
||||
return {
|
||||
...(options ? { options } : {}),
|
||||
...resolved,
|
||||
};
|
||||
resolved = resolveAddonName(configDir, name, options);
|
||||
} catch (err) {
|
||||
logger.error(
|
||||
`Addon value should end in /manager or /preview or /register OR it should be a valid preset https://storybook.js.org/docs/react/addons/writing-presets/\n${item}`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
|
||||
if (!resolved) {
|
||||
logger.warn(`Could not resolve addon "${name}", skipping. Is it installed?`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return {
|
||||
...(options ? { options } : {}),
|
||||
...resolved,
|
||||
};
|
||||
};
|
||||
|
||||
async function getContent(input: any) {
|
||||
@ -259,7 +268,11 @@ async function loadPresets(
|
||||
}
|
||||
|
||||
return (
|
||||
await Promise.all(presets.map(async (preset) => loadPreset(preset, level, storybookOptions)))
|
||||
await Promise.all(
|
||||
presets.map(async (preset) => {
|
||||
return loadPreset(preset, level, storybookOptions);
|
||||
})
|
||||
)
|
||||
).reduce((acc, loaded) => {
|
||||
return acc.concat(loaded);
|
||||
}, []);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-events",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Event names used in storybook core",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -53,5 +53,5 @@
|
||||
"./src/index.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-server",
|
||||
"version": "7.0.0-beta.20",
|
||||
"version": "7.0.0-beta.25",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -58,17 +58,18 @@
|
||||
"dependencies": {
|
||||
"@aw-web-design/x-default-browser": "1.4.88",
|
||||
"@discoveryjs/json-ext": "^0.5.3",
|
||||
"@storybook/builder-manager": "7.0.0-beta.20",
|
||||
"@storybook/core-common": "7.0.0-beta.20",
|
||||
"@storybook/core-events": "7.0.0-beta.20",
|
||||
"@storybook/builder-manager": "7.0.0-beta.25",
|
||||
"@storybook/core-common": "7.0.0-beta.25",
|
||||
"@storybook/core-events": "7.0.0-beta.25",
|
||||
"@storybook/csf": "next",
|
||||
"@storybook/csf-tools": "7.0.0-beta.20",
|
||||
"@storybook/csf-tools": "7.0.0-beta.25",
|
||||
"@storybook/docs-mdx": "next",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/node-logger": "7.0.0-beta.20",
|
||||
"@storybook/preview-api": "7.0.0-beta.20",
|
||||
"@storybook/telemetry": "7.0.0-beta.20",
|
||||
"@storybook/types": "7.0.0-beta.20",
|
||||
"@storybook/node-logger": "7.0.0-beta.25",
|
||||
"@storybook/preview-api": "7.0.0-beta.25",
|
||||
"@storybook/telemetry": "7.0.0-beta.25",
|
||||
"@storybook/types": "7.0.0-beta.25",
|
||||
"@types/detect-port": "^1.3.0",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/pretty-hrtime": "^1.0.0",
|
||||
@ -118,5 +119,5 @@
|
||||
],
|
||||
"platform": "node"
|
||||
},
|
||||
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
|
||||
"gitHead": "2109ab8d7c0667e686db757abf5afcbf3d48a6ec"
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user