Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/next' into remove-re-exports
Browse files Browse the repository at this point in the history
# Conflicts:
#	code/addons/highlight/preview.js
#	code/addons/interactions/preview.js
#	code/addons/outline/preview.js
  • Loading branch information
IanVS committed Nov 10, 2022
2 parents cc9a1cc + 02e4a69 commit c0d46d6
Show file tree
Hide file tree
Showing 320 changed files with 4,485 additions and 3,002 deletions.
387 changes: 307 additions & 80 deletions .circleci/config.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/handle-release-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- id: next-version
uses: notiz-dev/github-action-json-property@release
with:
path: ${{ github.workspace }}/next/package.json
path: ${{ github.workspace }}/next/code/package.json
prop_path: version

- run: |
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ on:
branches:
- next
pull_request:
types: [opened, reopened, labeled, synchronize]
types: [opened, synchronize, reopened]

jobs:
build:
name: Core Unit Tests node-${{ matrix.node_version }}, ${{ matrix.os }}
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:matrix')
strategy:
fail-fast: false
matrix:
Expand All @@ -28,8 +27,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: yarn
- name: install and compile
run: yarn task --task compile --start-from=auto
run: yarn task --task compile --start-from=auto --no-link
- name: test
run: yarn test --runInBand --ci
102 changes: 91 additions & 11 deletions .github/workflows/trigger-circle-ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,101 @@
name: Trigger CircleCI workflow

on:
pull_request:
types: [labeled]
# Use pull_request_target, as we don't need to check out the actual code of the fork in this script.
# And this is the only way to trigger the Circle CI API on forks as well.
pull_request_target:
types: [opened, synchronize, labeled, unlabeled, reopened, converted_to_draft, ready_for_review]
push:
branches:
- next

jobs:
trigger:
if: github.event.label.name == 'run e2e extended test suite' && github.event.pull_request.head.repo.fork == false
name: Run workflow with all e2e tests
get-branch:
runs-on: ubuntu-latest
steps:
- name: Make request to CircleCI
- id: get-branch
run: |
if [ "${{ github.event.pull_request.head.repo.fork }}" = "true" ]; then
export BRANCH=pull/${{ github.event.pull_request.number }}/head
elif [ "${{ github.event_name }}" = "push" ]; then
export BRANCH=${{ github.ref_name }}
else
export BRANCH=${{ github.event.pull_request.head.ref }}
fi
echo "$BRANCH"
echo "branch=$BRANCH" >> $GITHUB_ENV
outputs:
branch: ${{ env.branch }}

trigger-ci-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, 'ci:pr') && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily')
steps:
- name: Trigger draft PR tests
run: >
curl --request POST
--url https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline
--header 'Circle-Token: '"$CIRCLE_CI_TOKEN"' '
--header 'content-type: application/json'
--data '{"branch":"${{ github.event.pull_request.head.ref }}"}'
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "${{ needs.get-branch.outputs.branch }}",
"parameters": {
"workflow": "ci"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
trigger-pr-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && ((github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
steps:
- name: Trigger PR tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "${{ needs.get-branch.outputs.branch }}",
"parameters": {
"workflow": "pr"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
trigger-merged-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
steps:
- name: Trigger merged tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "${{ needs.get-branch.outputs.branch }}",
"parameters": {
"workflow": "merged"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
trigger-daily-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:daily')
steps:
- name: Trigger the daily tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "${{ needs.get-branch.outputs.branch }}",
"parameters": {
"workflow": "daily"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dist
*.DS_Store
.cache
junit.xml
test-results
/repros
/sandbox
.verdaccio-cache
Expand Down
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
## 7.0.0-alpha.48 (November 7, 2022)

#### Breaking Changes

- Preact: Make preact use inline stories (without iframe) by default in docs [#19741](https://github.com/storybooks/storybook/pull/19741)

#### Features

- Angular: Undo template gen removal during deprecation property removal [#19614](https://github.com/storybooks/storybook/pull/19614)
- CSF-tools: Support main.js default exports [#19738](https://github.com/storybooks/storybook/pull/19738)
- Addon-docs: Disable play functions in docs mode unless you set `parameters.docs.autoplay` [#19659](https://github.com/storybooks/storybook/pull/19659)
- Addon-docs: Add docsPage `automatic` to create docs entries for all components [#19713](https://github.com/storybooks/storybook/pull/19713)
- CLI: Add docsPage to all Button/Header story templates [#19715](https://github.com/storybooks/storybook/pull/19715)

#### Bug Fixes

- Svelte: Fix docs rendering [#19705](https://github.com/storybooks/storybook/pull/19705)
- React: Expose ReactFramework type [#19704](https://github.com/storybooks/storybook/pull/19704)

#### Maintenance

- Core: Update index generation to use tags to detect MDX stories [#19712](https://github.com/storybooks/storybook/pull/19712)
- CI: Fix cross OS github actions [#19754](https://github.com/storybooks/storybook/pull/19754)
- Blocks: Redo stories for controls [#19744](https://github.com/storybooks/storybook/pull/19744)
- Blocks: Setup and create example story for blocks with context [#19740](https://github.com/storybooks/storybook/pull/19740)
- Client-api: Fix export from store [#19720](https://github.com/storybooks/storybook/pull/19720)
- Pull renderer+builder from framework's package.json + a known list [#19717](https://github.com/storybooks/storybook/pull/19717)
- CLI: Add automigration to set docsPage = 'automatic' for existing Storybooks [#19716](https://github.com/storybooks/storybook/pull/19716)
- Builder-webpack5: Use import.meta.webpackHot instead of module.hot for check [#19686](https://github.com/storybooks/storybook/pull/19686)
- Fix: Point to correct .d.ts files from export maps [#19724](https://github.com/storybooks/storybook/pull/19724)
- CLI: Remove deprecated `-s` flag on `sb init` [#19585](https://github.com/storybooks/storybook/pull/19585)

#### Build

- Build: Fix eslint formatting in scripts [#19765](https://github.com/storybooks/storybook/pull/19765)
- Sandboxes: Fix up stories entry to allow HMR [#19750](https://github.com/storybooks/storybook/pull/19750)
- Fix prepare script on Windows machines [#19762](https://github.com/storybooks/storybook/pull/19762)
- CI: Fix fix handle-release-branches workflow [#19756](https://github.com/storybooks/storybook/pull/19756)
- Build: Cancel workflow in CI on steps failure [#19748](https://github.com/storybooks/storybook/pull/19748)
- CI: Schedule a daily job that runs all sandboxes [#19699](https://github.com/storybooks/storybook/pull/19699)
- Build: Delete node_modules in repro generation [#19734](https://github.com/storybooks/storybook/pull/19734)
- Fix: dts facade generator did not support deep links [#19723](https://github.com/storybooks/storybook/pull/19723)
- Build: Re-enable test-runner for vue-cli [#19706](https://github.com/storybooks/storybook/pull/19706)

#### Dependency Upgrades

- Upgrade mdx2-csf to fix mdxSource generation [#19766](https://github.com/storybooks/storybook/pull/19766)
- Dependencies: Bump prettier dependency, cleanup config [#19672](https://github.com/storybooks/storybook/pull/19672)
- Vue: Add babel loader 9.0.0 to vue-webpack5 peer dependencies [#19697](https://github.com/storybooks/storybook/pull/19697)

## 7.0.0-alpha.47 (November 1, 2022)

#### Features
Expand Down
12 changes: 12 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
- [MDX2 upgrade](#mdx2-upgrade)
- [Dropped source loader / storiesOf static snippets](#dropped-source-loader--storiesof-static-snippets)
- [Dropped addon-docs manual configuration](#dropped-addon-docs-manual-configuration)
- [Autoplay in docs](#autoplay-in-docs)
- [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)
- [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 @@ -780,6 +782,12 @@ module.exports = {

Storybook Docs 5.x shipped with instructions for how to manually configure webpack and storybook without the use of Storybook's "presets" feature. Over time, these docs went out of sync. Now in Storybook 7 we have removed support for manual configuration entirely.

#### Autoplay in docs

Running play functions in docs is generally tricky, as they can steal focus and cause the window to scroll. Consequently, we've disabled play functions in docs by default.

If your story depends on a play function to render correctly, _and_ you are confident the function autoplaying won't mess up your docs, you can set `parameters.docs.autoplay = true` to have it auto play.

### 7.0 Deprecations

#### `Story` type deprecated
Expand Down Expand Up @@ -829,6 +837,10 @@ export const CSF2Story: StoryFn<ButtonProps> = (args) => <Button {...args} />;
CSF2Story.args = { label: 'Label' };
```

#### Renamed `renderToDOM` to `renderToCanvas`

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.

## From version 6.4.x to 6.5.0

### Vue 3 upgrade
Expand Down
22 changes: 11 additions & 11 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.47",
"version": "7.0.0-alpha.48",
"description": "Test component compliance with web accessibility standards",
"keywords": [
"a11y",
Expand Down Expand Up @@ -62,15 +62,15 @@
"prep": "../../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/addon-highlight": "7.0.0-alpha.47",
"@storybook/addons": "7.0.0-alpha.47",
"@storybook/api": "7.0.0-alpha.47",
"@storybook/channels": "7.0.0-alpha.47",
"@storybook/client-logger": "7.0.0-alpha.47",
"@storybook/components": "7.0.0-alpha.47",
"@storybook/core-events": "7.0.0-alpha.47",
"@storybook/theming": "7.0.0-alpha.47",
"@storybook/types": "7.0.0-alpha.47",
"@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",
"axe-core": "^4.2.0",
"global": "^4.4.0",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -102,7 +102,7 @@
"./src/preview.tsx"
]
},
"gitHead": "1c706a4a778831e012343c905f86225fa71491a7",
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
"storybook": {
"displayName": "Accessibility",
"icon": "https://user-images.githubusercontent.com/263385/101991665-47042f80-3c7c-11eb-8f00-64b5a18f498a.png",
Expand Down
31 changes: 22 additions & 9 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.47",
"version": "7.0.0-alpha.48",
"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.47",
"@storybook/api": "7.0.0-alpha.47",
"@storybook/client-logger": "7.0.0-alpha.47",
"@storybook/components": "7.0.0-alpha.47",
"@storybook/core-events": "7.0.0-alpha.47",
"@storybook/theming": "7.0.0-alpha.47",
"@storybook/types": "7.0.0-alpha.47",
"@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",
"dequal": "^2.0.2",
"global": "^4.4.0",
"lodash": "^4.17.21",
Expand Down Expand Up @@ -107,7 +120,7 @@
"./src/preview.ts"
]
},
"gitHead": "1c706a4a778831e012343c905f86225fa71491a7",
"gitHead": "b58a29b785462f8a8b711b6bb2d7223fd6dc17fd",
"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, AnyFramework, ArgsEnhancer } from '@storybook/types';
import type { Args, Framework, 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<AnyFramework> = (context) => {
export const inferActionsFromArgTypesRegex: ArgsEnhancer<Framework> = (context) => {
const {
initialArgs,
argTypes,
Expand All @@ -40,7 +40,7 @@ export const inferActionsFromArgTypesRegex: ArgsEnhancer<AnyFramework> = (contex
/**
* Add action args for list of strings.
*/
export const addActionsFromArgTypes: ArgsEnhancer<AnyFramework> = (context) => {
export const addActionsFromArgTypes: ArgsEnhancer<Framework> = (context) => {
const {
initialArgs,
argTypes,
Expand Down
Loading

0 comments on commit c0d46d6

Please sign in to comment.