Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into tom/sb-880-update-exe…
Browse files Browse the repository at this point in the history
…ca-and-try-to-fix-waiting
  • Loading branch information
tmeasday committed Nov 21, 2022
2 parents f1ea8e1 + 8fb754a commit 3de9794
Show file tree
Hide file tree
Showing 1,390 changed files with 12,402 additions and 13,001 deletions.
138 changes: 97 additions & 41 deletions .circleci/config.yml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions .github/workflows/generate-repros-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
run: node ./scripts/check-dependencies.js
- 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 &
working-directory: ./code
- name: Wait for registry
run: yarn wait-on http://localhost:6001
working-directory: ./code
- name: Generate repros
run: yarn generate-repros-next --local-registry
working-directory: ./code
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ junit.xml
test-results
/repros
/sandbox
/bench
.verdaccio-cache

# Yarn stuff
Expand Down
90 changes: 87 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
## 7.0.0-alpha.51 (November 19, 2022)

#### Bug Fixes

- NextJS: Fix out-of-the-box babel handling [#19842](https://github.com/storybooks/storybook/pull/19842)
- NextJS: Fix import url on windows [#19798](https://github.com/storybooks/storybook/pull/19798)
- UI: Fix panel invisible for any addon listed after the interactions panel [#19771](https://github.com/storybooks/storybook/pull/19771)
- Core: Bail preview builder on failure [#19849](https://github.com/storybooks/storybook/pull/19849)
- Core: Fix double esbuild-register register [#19852](https://github.com/storybooks/storybook/pull/19852)
- Composition: Fix regression in the `#root` to `#storybook-root` change [#19848](https://github.com/storybooks/storybook/pull/19848)
- UI: Fix `showPanel=false` doesn't work on mobile view [#19807](https://github.com/storybooks/storybook/pull/19807)

#### Maintenance

- CLI: Replace degit with giget [#19870](https://github.com/storybooks/storybook/pull/19870)
- Build: Bundle lib/channel-websocket with tsup [#19694](https://github.com/storybooks/storybook/pull/19694)
- Maintenance: Upgrade monorepo to TS 4.9 [#19869](https://github.com/storybooks/storybook/pull/19869)

#### Build

- Build: Downgrade @types/node [#19890](https://github.com/storybooks/storybook/pull/19890)
- Maintenance: Add angular 14 template and skip test runner on angular 15 for now [#19871](https://github.com/storybooks/storybook/pull/19871)
- Build: Upgrade Jest to 29 [#19863](https://github.com/storybooks/storybook/pull/19863)
- Build: Fix chromatic version to 6.11.2 in local scripts [#19889](https://github.com/storybooks/storybook/pull/19889)
- Build: Pin chromatic version to 6.11.2 to temporary fix flakiness [#19874](https://github.com/storybooks/storybook/pull/19874)

#### Dependency Upgrades

- Bump mdx2-csf dependency [#19885](https://github.com/storybooks/storybook/pull/19885)

## 7.0.0-alpha.50 (November 17, 2022)

#### Features

- Expose more CSF types in all renderers [#19833](https://github.com/storybooks/storybook/pull/19833)
- CSF: Renamed Framework to Renderer [#19802](https://github.com/storybooks/storybook/pull/19802)

#### Bug Fixes

- Next.js: use file path instead of image contents for next-image-loader-stub [#19858](https://github.com/storybooks/storybook/pull/19858)
- TypeScript: Fix type inference bug with decorators [#19839](https://github.com/storybooks/storybook/pull/19839)
- Vite: Keep using absolute path node_modules splitting [#19836](https://github.com/storybooks/storybook/pull/19836)
- Vite: Fix preview annotation paths on Windows [#19822](https://github.com/storybooks/storybook/pull/19822)
- Fix csf-plugin ignoring options [#19823](https://github.com/storybooks/storybook/pull/19823)
- Controls: Checkbox does not update when using useArgs hook [#19508](https://github.com/storybooks/storybook/pull/19508)

#### Maintenance

- Jest: switch from Parameters to StorybookInternalParameters [#19853](https://github.com/storybooks/storybook/pull/19853)
- Blocks: Story stories [#19805](https://github.com/storybooks/storybook/pull/19805)
- Blocks: Canvas stories [#19804](https://github.com/storybooks/storybook/pull/19804)
- Tech: TypeScript should check stories and tests as well [#19831](https://github.com/storybooks/storybook/pull/19831)

#### Build

- UI Storybook: Disable sourcemaps when building in CI [#19862](https://github.com/storybooks/storybook/pull/19862)
- Build: Increase max node memory for jobs [#19856](https://github.com/storybooks/storybook/pull/19856)
- CI: improve error reporting mechanism [#19841](https://github.com/storybooks/storybook/pull/19841)
- Fix tests on Windows [#19777](https://github.com/storybooks/storybook/pull/19777)
- Build: Fix benchmark to run on local packages [#19832](https://github.com/storybooks/storybook/pull/19832)
- CI: Report failures on discord [#19801](https://github.com/storybooks/storybook/pull/19801)

## 7.0.0-alpha.49 (November 13, 2022)

#### Bug Fixes

- Essentials: Fix preview annotations for Vite pnpm support [#19689](https://github.com/storybooks/storybook/pull/19689)

#### Maintenance

- Build: convert addon-docs to use ts-up [#19790](https://github.com/storybooks/storybook/pull/19790)
- Core: Allow overriding WebView and UrlStore [#19623](https://github.com/storybooks/storybook/pull/19623)
- Storyshots: Support .cjs and .mjs file extensions [#19726](https://github.com/storybooks/storybook/pull/19726)

#### Build

- Build: less noise when compiling [#19808](https://github.com/storybooks/storybook/pull/19808)
- Build: Upgrade bench to `next` [#19791](https://github.com/storybooks/storybook/pull/19791)
- Maintenance: improve error feedback when tasks fail in CI [#19786](https://github.com/storybooks/storybook/pull/19786)
- UI: Enable TurboSnap for UI Storybook [#19767](https://github.com/storybooks/storybook/pull/19767)
- CI: Use a new cadence (ci, pr, merged, daily) and trigger CircleCI from github actions [#19768](https://github.com/storybooks/storybook/pull/19768)
- Maintenance: provide expected failure metadata in junit reports [#19775](https://github.com/storybooks/storybook/pull/19775)

## 7.0.0-alpha.48 (November 7, 2022)

#### Breaking Changes
Expand Down Expand Up @@ -542,9 +625,10 @@ Bad publish

#### Bug Fixes

- CLI: Fix race condition in sb init [#19083](https://github.com/storybooks/storybook/pull/19083)
- Vite: Fix framework option checks, and SSv6 [#19062](https://github.com/storybooks/storybook/pull/19062)
- Core: Fix WebProjectAnnotations export in preview-web for back-compat [#19048](https://github.com/storybooks/storybook/pull/19048)
- CLI: Fix race condition in sb init [#19083](https://github.com/storybooks/storybook/pull/19083)
- Vite: Fix framework option checks, and SSv6 [#19062](https://github.com/storybooks/storybook/pull/19062)
- Core: Fix WebProjectAnnotations export in preview-web for back-compat [#19048](https://github.com/storybooks/storybook/pull/19048)
- Blocks: Fix Checkbox control update when using useArgs hook

#### Maintenance

Expand Down
67 changes: 66 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
- [7.0 Deprecations](#70-deprecations)
- [`Story` type deprecated](#story-type-deprecated)
- [`ComponentStory`, `ComponentStoryObj`, `ComponentStoryFn` and `ComponentMeta` types are deprecated](#componentstory-componentstoryobj-componentstoryfn-and-componentmeta-types-are-deprecated)
- [Renamed `renderToDOM` to `renderToCanvas`](#renamed-rendertodom-to-rendertoroot)
- [Renamed `renderToDOM` to `renderToCanvas`](#renamed-rendertodom-to-rendertocanvas)
- [Renamed `XFramework` to `XRenderer`](#renamed-xframework-to-xrenderer)
- [Renamed `DecoratorFn` to `Decorator`](#renamed-decoratorfn-to-decorator)
- [From version 6.4.x to 6.5.0](#from-version-64x-to-650)
- [Vue 3 upgrade](#vue-3-upgrade)
- [React18 new root API](#react18-new-root-api)
Expand Down Expand Up @@ -841,6 +843,69 @@ CSF2Story.args = { label: 'Label' };

The "rendering" function that renderers (ex-frameworks) must export (`renderToDOM`) has been renamed to `renderToCanvas` to acknowledge that some consumers of frameworks/the preview do not work with DOM elements.

#### Renamed `XFramework` to `XRenderer`

In 6.x you could import XFramework types:

```ts
import type { ReactFramework } from '@storybook/react';
import type { VueFramework } from '@storybook/vue';
import type { SvelteFramework } from '@storybook/svelte';

// etc.
```

Those are deprecated in 7.0 as they are renamed to:

```ts
import type { ReactRenderer } from '@storybook/react';
import type { VueRenderer } from '@storybook/vue';
import type { SvelteRenderer } from '@storybook/svelte';

// etc.
```

#### Renamed `DecoratorFn` to `Decorator`

In 6.x you could import the type `DecoratorFn`:

```ts
import type { DecoratorFn } from '@storybook/react';
```

This type is deprecated in 7.0, instead you can use the type `Decorator`, which is now available for all renderers:

```ts
import type { Decorator } from '@storybook/react';
// or
import type { Decorator } from '@storybook/vue';
// or
import type { Decorator } from '@storybook/svelte';
// etc.
```

The type `Decorator` accepts a generic parameter `TArgs`. This can be used like this:

```tsx
import type { Decorator } from '@storybook/react';
import { LocaleProvider } from './locale';

const withLocale: Decorator<{ locale: 'en' | 'es' }> = (Story, { args }) => (
<LocaleProvider lang={args.locale}>
<Story />
</LocaleProvider>
);
```

If you want to use `Decorator` in a backwards compatible way to `DecoratorFn`, you can use:

```tsx
import type { Args, Decorator } from '@storybook/react';

// Decorator<Args> behaves the same as DecoratorFn (without generic)
const withLocale: Decorator<Args> = (Story, { args }) => // args has type { [name: string]: any }
```
## From version 6.4.x to 6.5.0
### Vue 3 upgrade
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<p align="center">
<a href="https://storybook.js.org/">
<img src="https://user-images.githubusercontent.com/321738/63501763-88dbf600-c4cc-11e9-96cd-94adadc2fd72.png" alt="Storybook" width="400" />
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/263385/199832481-bbbf5961-6a26-481d-8224-51258cce9b33.png">
<img src="https://user-images.githubusercontent.com/321738/63501763-88dbf600-c4cc-11e9-96cd-94adadc2fd72.png" alt="Storybook" width="400" />
</picture>

</a>

</p>

<p align="center">Build bulletproof UI components faster</p>
Expand Down
1 change: 0 additions & 1 deletion code/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
dist
lib/**/dll
build
coverage
node_modules
Expand Down
7 changes: 7 additions & 0 deletions code/addons/a11y/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');
const baseConfig = require('../../jest.config.browser');

module.exports = {
...baseConfig,
displayName: __dirname.split(path.sep).slice(-2).join(path.posix.sep),
};
24 changes: 12 additions & 12 deletions code/addons/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-a11y",
"version": "7.0.0-alpha.48",
"version": "7.0.0-alpha.51",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down Expand Up @@ -62,23 +62,23 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addon-highlight": "7.0.0-alpha.48",
"@storybook/addons": "7.0.0-alpha.48",
"@storybook/api": "7.0.0-alpha.48",
"@storybook/channels": "7.0.0-alpha.48",
"@storybook/client-logger": "7.0.0-alpha.48",
"@storybook/components": "7.0.0-alpha.48",
"@storybook/core-events": "7.0.0-alpha.48",
"@storybook/theming": "7.0.0-alpha.48",
"@storybook/types": "7.0.0-alpha.48",
"@storybook/addon-highlight": "7.0.0-alpha.51",
"@storybook/addons": "7.0.0-alpha.51",
"@storybook/api": "7.0.0-alpha.51",
"@storybook/channels": "7.0.0-alpha.51",
"@storybook/client-logger": "7.0.0-alpha.51",
"@storybook/components": "7.0.0-alpha.51",
"@storybook/core-events": "7.0.0-alpha.51",
"@storybook/theming": "7.0.0-alpha.51",
"@storybook/types": "7.0.0-alpha.51",
"axe-core": "^4.2.0",
"global": "^4.4.0",
"lodash": "^4.17.21",
"react-sizeme": "^3.0.1"
},
"devDependencies": {
"@testing-library/react": "^11.2.2",
"typescript": "~4.6.3"
"typescript": "^4.9.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -102,7 +102,7 @@
"./src/preview.tsx"
]
},
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded",
"storybook": {
"displayName": "Accessibility",
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",
Expand Down
7 changes: 7 additions & 0 deletions code/addons/actions/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const path = require('path');
const baseConfig = require('../../jest.config.browser');

module.exports = {
...baseConfig,
displayName: __dirname.split(path.sep).slice(-2).join(path.posix.sep),
};
33 changes: 23 additions & 10 deletions code/addons/actions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@storybook/addon-actions",
"version": "7.0.0-alpha.48",
"version": "7.0.0-alpha.51",
"description": "Get UI feedback when an action is performed on an interactive element",
"keywords": [
"storybook",
Expand Down Expand Up @@ -52,6 +52,19 @@
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"dist/index.d.ts"
],
"manager": [
"dist/manager.d.ts"
],
"preview": [
"dist/preview.d.ts"
]
}
},
"files": [
"dist/**/*",
"README.md",
Expand All @@ -63,13 +76,13 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addons": "7.0.0-alpha.48",
"@storybook/api": "7.0.0-alpha.48",
"@storybook/client-logger": "7.0.0-alpha.48",
"@storybook/components": "7.0.0-alpha.48",
"@storybook/core-events": "7.0.0-alpha.48",
"@storybook/theming": "7.0.0-alpha.48",
"@storybook/types": "7.0.0-alpha.48",
"@storybook/addons": "7.0.0-alpha.51",
"@storybook/api": "7.0.0-alpha.51",
"@storybook/client-logger": "7.0.0-alpha.51",
"@storybook/components": "7.0.0-alpha.51",
"@storybook/core-events": "7.0.0-alpha.51",
"@storybook/theming": "7.0.0-alpha.51",
"@storybook/types": "7.0.0-alpha.51",
"dequal": "^2.0.2",
"global": "^4.4.0",
"lodash": "^4.17.21",
Expand All @@ -82,7 +95,7 @@
},
"devDependencies": {
"@types/lodash": "^4.14.167",
"typescript": "~4.6.3"
"typescript": "^4.9.3"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
Expand All @@ -107,7 +120,7 @@
"./src/preview.ts"
]
},
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded",
"storybook": {
"displayName": "Actions",
"unsupportedFrameworks": [
Expand Down
6 changes: 3 additions & 3 deletions code/addons/actions/src/addArgsHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Args, Framework, ArgsEnhancer } from '@storybook/types';
import type { Args, Renderer, ArgsEnhancer } from '@storybook/types';
import { action } from './runtime/action';

// interface ActionsParameter {
Expand All @@ -14,7 +14,7 @@ const isInInitialArgs = (name: string, initialArgs: Args) =>
* matches a regex, such as `^on.*` for react-style `onClick` etc.
*/

export const inferActionsFromArgTypesRegex: ArgsEnhancer<Framework> = (context) => {
export const inferActionsFromArgTypesRegex: ArgsEnhancer<Renderer> = (context) => {
const {
initialArgs,
argTypes,
Expand All @@ -40,7 +40,7 @@ export const inferActionsFromArgTypesRegex: ArgsEnhancer<Framework> = (context)
/**
* Add action args for list of strings.
*/
export const addActionsFromArgTypes: ArgsEnhancer<Framework> = (context) => {
export const addActionsFromArgTypes: ArgsEnhancer<Renderer> = (context) => {
const {
initialArgs,
argTypes,
Expand Down
10 changes: 1 addition & 9 deletions code/addons/actions/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,5 @@
"compilerOptions": {
"strict": true
},
"include": ["src/**/*"],
"exclude": [
"src/**/*.test.*",
"src/**/tests/**/*",
"src/**/__tests__/**/*",
"src/**/*.stories.*",
"src/**/*.mockdata.*",
"src/**/__testfixtures__/**"
]
"include": ["src/**/*"]
}
Loading

0 comments on commit 3de9794

Please sign in to comment.