Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Prerelease 8.2.0-alpha.7 #28157

Merged
merged 59 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
fd20e3b
CsfFile: Automatically extract componentPath
shilman Oct 5, 2023
8c78f83
Indexer: Add componentPath to to the indexer
shilman Oct 11, 2023
746914e
Clean up and add mjs/mts support
shilman Oct 11, 2023
51edf4a
Fix CI
shilman Oct 11, 2023
4edf3e2
Merge branch 'next' into shilman/auto-component-path
shilman Nov 17, 2023
d61652d
Update snapshot
shilman Nov 17, 2023
a7b2887
Merge branch 'next' into shilman/auto-component-path
shilman Dec 29, 2023
0d50baa
Merge branch 'next' into shilman/auto-component-path
shilman Dec 29, 2023
d82fb47
remove stories.mdx reporting in telemetry
JReinhold Feb 9, 2024
656c718
remove stories.mdx from tests
JReinhold Feb 9, 2024
2021951
remove stories.mdx from index creation
JReinhold Feb 9, 2024
a0268b8
remove stories.mdx from client apis
JReinhold Feb 9, 2024
3aaf33a
Docs: fix link to react-inspector theme
kyletsang Feb 23, 2024
51f3167
feat: remove doctrine
43081j Mar 4, 2024
581a096
Merge branch 'next' into doctrineless
ndelangen Mar 11, 2024
df5fe39
Merge branch 'next' into doctrineless
ndelangen Mar 12, 2024
e687789
Merge branch 'next' into shilman/auto-component-path
shilman Mar 20, 2024
856efbc
Merge branch 'next' into pr/43081j/26305
ndelangen Mar 26, 2024
849ad4d
Disable YARN_ENABLE_IMMUTABLE_INSTALLS in CircleCI config
ndelangen Mar 26, 2024
d4078e3
Merge branch 'next' into doctrineless
43081j May 6, 2024
395405a
test: update argTypes snapshot
43081j May 6, 2024
7b9f554
Merge branch 'next' into doctrineless
ndelangen May 9, 2024
b25d3bc
Merge branch 'next' into doctrineless
shilman May 14, 2024
20a1a24
Build: Update trigger conditions for Circle CI workflows
valentinpalkovic May 31, 2024
09653c1
Display Github Context
valentinpalkovic May 31, 2024
b5331b2
Apply more constraint if conditions to run certain CircleCI actions
valentinpalkovic May 31, 2024
6f4d27a
Test
valentinpalkovic May 31, 2024
7e4a26c
Fix workflow
valentinpalkovic May 31, 2024
ec0823a
Remove GitHub context logging in CI
valentinpalkovic Jun 3, 2024
a2df89a
CLI: Fix typo in React Docgen migration
jonniebigodes Jun 4, 2024
6e58aba
Test: display toHaveBeenCalledWith expected / received values on failure
kasperpeulen Jun 6, 2024
984d11a
Add storybook tests
kasperpeulen Jun 6, 2024
88097b5
Angular: Allow outputPath object syntax
valentinpalkovic Jun 7, 2024
6f19ef5
Angular: Add preserveSymlinks option to Storybook builders
valentinpalkovic Jun 7, 2024
ca4456f
Disable test for now
kasperpeulen Jun 7, 2024
096c612
Build: Add --prod flag to be able to create Angular-specific sandboxe…
valentinpalkovic Jun 7, 2024
f783605
chore: Update trigger conditions for Circle CI workflows
valentinpalkovic Jun 7, 2024
df6d614
Merge branch 'next' into valentin/improve-ci-triggers
valentinpalkovic Jun 7, 2024
dfe9d46
Merge pull request #27481 from storybookjs/valentin/improve-ci-triggers
valentinpalkovic Jun 7, 2024
0683575
Merge branch 'next' into react_docgen_migration_typo
jonniebigodes Jun 7, 2024
2351f7c
Merge branch 'next' into doctrineless
43081j Jun 7, 2024
a0a6212
Merge branch 'next' into shilman/auto-component-path
shilman Jun 8, 2024
c69d536
Support tsconfig paths
shilman Jun 8, 2024
60c7320
Merge pull request #28144 from storybookjs/valentin/angular-output-pa…
shilman Jun 8, 2024
a57e45c
Add indexer API docs
shilman Jun 9, 2024
b64489c
Merge pull request #24396 from storybookjs/shilman/auto-component-path
shilman Jun 9, 2024
f7b7225
Merge pull request #27536 from storybookjs/react_docgen_migration_typo
valentinpalkovic Jun 9, 2024
899b7fc
Merge pull request #26163 from kyletsang/fix-react-inspector-link
valentinpalkovic Jun 9, 2024
1b07285
Merge branch 'next' into doctrineless
shilman Jun 9, 2024
e20977a
Update yarn.lock
shilman Jun 10, 2024
ee00876
add bun to canary release pr workflow
ndelangen Jun 10, 2024
8e3e06b
Merge pull request #28163 from storybookjs/norbert/bun-gh-action
ndelangen Jun 10, 2024
5e4d590
Merge branch 'next' into jeppe/remove-more-stories-mdx
shilman Jun 10, 2024
c388109
Restore back-compat code
shilman Jun 10, 2024
1af1f3c
Merge pull request #25973 from storybookjs/jeppe/remove-more-stories-mdx
shilman Jun 10, 2024
9b8b946
Merge pull request #28145 from storybookjs/valentin/angular-introduce…
valentinpalkovic Jun 10, 2024
2cbf3a7
Merge pull request #26305 from 43081j/doctrineless
shilman Jun 10, 2024
ea73dac
Merge pull request #28088 from storybookjs/kasper/display-vitest-errors
kasperpeulen Jun 10, 2024
2bb06bf
Write changelog for 8.2.0-alpha.7 [skip ci]
storybook-bot Jun 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,8 @@ jobs:
name: Install dependencies
command: yarn install --no-immutable
working_directory: test-storybooks/portable-stories-kitchen-sink/<< parameters.directory >>
environment:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- run:
name: Run Jest tests
command: yarn jest
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/canary-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"

- uses: oven-sh/setup-bun@v1
with:
bun-version: 1.1.1

- name: Cache dependencies
uses: actions/cache@v4
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/trigger-circle-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
# 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]
types: [opened, synchronize, labeled, reopened]
push:
branches:
- next
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
trigger-normal-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal')
if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:normal') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:normal')))
steps:
- name: Trigger Normal tests
run: >
Expand All @@ -58,7 +58,7 @@ jobs:
trigger-docs-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:docs')
if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:docs') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:docs')))
steps:
- name: Trigger docs tests
run: >
Expand All @@ -77,7 +77,7 @@ jobs:
trigger-merged-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged')
if: github.event_name == 'push' || (github.event.action == 'labeled' && github.event.label.name == 'ci:merged') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:merged'))
steps:
- name: Trigger merged tests
run: >
Expand All @@ -96,7 +96,7 @@ jobs:
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')
if: github.event_name == 'pull_request_target' && ((github.event.action == 'labeled' && github.event.label.name == 'ci:daily') || (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'ci:daily')))
steps:
- name: Trigger the daily tests
run: >
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.prerelease.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 8.2.0-alpha.7

- Angular: Allow outputPath object syntax - [#28144](https://github.com/storybookjs/storybook/pull/28144), thanks @valentinpalkovic!
- Angular: Introduce preserveSymlink builder option - [#28145](https://github.com/storybookjs/storybook/pull/28145), thanks @valentinpalkovic!
- CLI: Fix typo in React Docgen migration - [#27536](https://github.com/storybookjs/storybook/pull/27536), thanks @jonniebigodes!
- CSF: Automatically extract componentPath - [#24396](https://github.com/storybookjs/storybook/pull/24396), thanks @shilman!
- Core: Remove more `.stories.mdx` handling - [#25973](https://github.com/storybookjs/storybook/pull/25973), thanks @JReinhold!
- Docs-tools: Replace `doctrine` with `jsdoc-type-pratt-parser` - [#26305](https://github.com/storybookjs/storybook/pull/26305), thanks @43081j!
- Test: Display toHaveBeenCalledWith expected / received values on failure - [#28088](https://github.com/storybookjs/storybook/pull/28088), thanks @kasperpeulen!

## 8.2.0-alpha.6

- Addon-actions: Only log spies with names - [#28091](https://github.com/storybookjs/storybook/pull/28091), thanks @kasperpeulen!
Expand Down
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ yarn build --watch react core-server api addon-docs
yarn task --task dev --template <your template> --start-from=publish
```

### Making code changes when working on Angular-specific code

If you are working on Angular-specific code, you will need to append `--prod` to the above mentioned commands to ensure that the Angular compiler is able to pick up the changes appropriately and doesn't fail. This will build all the packages in production mode.

```sh
yarn task --prod
```

```bash
cd code
yarn build --prod --watch angular core-server api addon-docs
```

## Contributing to Storybook

For further advice on how to contribute, please refer to our [NEW contributing guide on the Storybook website](https://storybook.js.org/docs/contribute).
4 changes: 2 additions & 2 deletions code/addons/docs/docs/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ export const parameters = {
transform: (src, storyContext) => {
const match = SOURCE_REGEX.exec(src);
return match ? match[1] : src;
}
}
},
},
},
};
```
Expand Down
38 changes: 14 additions & 24 deletions code/addons/interactions/src/components/Interaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { styled, typography } from '@storybook/theming';
import { transparentize } from 'polished';

import { ListUnorderedIcon } from '@storybook/icons';
import { Expected, MatcherResult, Received } from './MatcherResult';
import { MatcherResult } from './MatcherResult';
import { MethodCall } from './MethodCall';
import { StatusIcon } from './StatusIcon';

import type { Controls } from './InteractionsPanel';
import { isJestError } from '../utils';
import { isChaiError, isJestError } from '../utils';

const MethodCallWrapper = styled.div(() => ({
fontFamily: typography.fonts.mono,
Expand Down Expand Up @@ -117,33 +117,23 @@ export const Exception = ({ exception }: { exception: Call['exception'] }) => {
if (isJestError(exception)) {
return <MatcherResult {...exception} />;
}
if (isChaiError(exception)) {
return (
<RowMessage>
<MatcherResult
message={`${exception.message}${exception.diff ? `\n\n${exception.diff}` : ''}`}
style={{ padding: 0 }}
/>
<p>See the full stack trace in the browser console.</p>
</RowMessage>
);
}

const paragraphs = exception.message.split('\n\n');
const more = paragraphs.length > 1;
return (
<RowMessage>
<pre>{paragraphs[0]}</pre>
{exception.showDiff && exception.diff ? (
<>
<br />
<MatcherResult message={exception.diff} style={{ padding: 0 }} />
</>
) : (
<pre>
<br />
{exception.expected && (
<>
Expected: <Expected value={exception.expected} />
<br />
</>
)}
{exception.actual && (
<>
Received: <Received value={exception.actual} />
<br />
</>
)}
</pre>
)}
{more && <p>See the full stack trace in the browser console.</p>}
</RowMessage>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export const Failed: Story = {
},
};

export const NoInteractions: Story = {
args: {
interactions: [],
},
};
// export const NoInteractions: Story = {
// args: {
// interactions: [],
// },
// };

export const CaughtException: Story = {
args: {
Expand Down
80 changes: 54 additions & 26 deletions code/addons/interactions/src/components/MatcherResult.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,53 +29,81 @@ export default {
export const Expected = {
args: {
message: dedent`
expect(jest.fn()).lastCalledWith(...expected)

Expected: {"email": "[email protected]", "password": "testpasswordthatwontfail"}

Number of calls: 0
expected last "spy" call to have been called with [ { …(2) } ]

- Expected:
Array [
Object {
"email": "[email protected]",
"password": "testpasswordthatwontfail",
},
]

+ Received:
undefined
`,
},
};

export const ExpectedReceived = {
args: {
message: dedent`
expect(jest.fn()).toHaveBeenCalledWith(...expected)

Expected: called with 0 arguments
Received: {"email": "[email protected]", "password": "testpasswordthatwontfail"}

Number of calls: 1
expected last "spy" call to have been called with []

- Expected
+ Received

- Array []
+ Array [
+ Object {
+ "email": "[email protected]",
+ "password": "testpasswordthatwontfail",
+ },
+ ]
`,
},
};

export const ExpectedNumberOfCalls = {
args: {
message: dedent`
expect(jest.fn()).toHaveBeenCalledTimes(expected)

Expected number of calls: 1
Received number of calls: 0
expected "spy" to not be called at all, but actually been called 1 times

Received:

1st spy call:

Array [
Object {
"email": "[email protected]",
"password": "testpasswordthatwontfail",
},
]


Number of calls: 1
`,
},
};

export const Diff = {
args: {
message: dedent`
expect(jest.fn()).toHaveBeenCalledWith(...expected)

- Expected
+ Received

Object {
- "email": "[email protected]",
+ "email": "[email protected]",
"password": "testpasswordthatwontfail",
},

expected "spy" to be called with arguments: [ { …(2) } ]

Received:

1st spy call:

Array [
Object {
- "email": "[email protected]",
+ "email": "[email protected]",
"password": "testpasswordthatwontfail",
},
]


Number of calls: 1
`,
},
Expand Down
2 changes: 1 addition & 1 deletion code/addons/interactions/src/components/MatcherResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const MatcherResult = ({
if (line.match(/^\s*- /)) {
return [<Expected key={line + index} value={line} />, <br key={`br${index}`} />];
}
if (line.match(/^\s*\+ /)) {
if (line.match(/^\s*\+ /) || line.match(/^Received: $/)) {
return [<Received key={line + index} value={line} />, <br key={`br${index}`} />];
}

Expand Down
3 changes: 3 additions & 0 deletions code/frameworks/angular/src/builders/build-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export type StorybookBuilderOptions = JsonObject & {
enableProdMode?: boolean;
styles?: StyleElement[];
stylePreprocessorOptions?: StylePreprocessorOptions;
preserveSymlinks?: boolean;
assets?: AssetPattern[];
sourceMap?: SourceMapUnion;
} & Pick<
Expand Down Expand Up @@ -102,6 +103,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
assets,
previewUrl,
sourceMap = false,
preserveSymlinks = false,
} = options;

const standaloneOptions: StandaloneBuildOptions = {
Expand All @@ -121,6 +123,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
...(styles ? { styles } : {}),
...(assets ? { assets } : {}),
sourceMap,
preserveSymlinks,
},
tsConfig,
webpackStatsJson,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"description": "Directory where to store built files.",
"default": "storybook-static"
},
"preserveSymlinks": {
"type": "boolean",
"description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.",
"default": false
},
"configDir": {
"type": "string",
"description": "Directory where to load Storybook configurations from.",
Expand Down
3 changes: 3 additions & 0 deletions code/frameworks/angular/src/builders/start-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type StorybookBuilderOptions = JsonObject & {
styles?: StyleElement[];
stylePreprocessorOptions?: StylePreprocessorOptions;
assets?: AssetPattern[];
preserveSymlinks?: boolean;
sourceMap?: SourceMapUnion;
} & Pick<
// makes sure the option exists
Expand Down Expand Up @@ -118,6 +119,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
statsJson,
previewUrl,
sourceMap = false,
preserveSymlinks = false,
} = options;

const standaloneOptions: StandaloneOptions = {
Expand All @@ -141,6 +143,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
...(stylePreprocessorOptions ? { stylePreprocessorOptions } : {}),
...(styles ? { styles } : {}),
...(assets ? { assets } : {}),
preserveSymlinks,
sourceMap,
},
tsConfig,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"type": "string",
"description": "The full path for the TypeScript configuration file, relative to the current workspace."
},
"preserveSymlinks": {
"type": "boolean",
"description": "Do not use the real path when resolving modules. If true, symlinks are resolved to their real path, if false, symlinks are resolved to their symlinked path.",
"default": false
},
"port": {
"type": "number",
"description": "Port to listen on.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type StandaloneOptions = CLIOptions &
stylePreprocessorOptions?: StylePreprocessorOptions;
assets?: AssetPattern[];
sourceMap?: SourceMapUnion;
preserveSymlinks?: boolean;
};
angularBuilderContext?: BuilderContext | null;
tsConfig?: string;
Expand Down
4 changes: 4 additions & 0 deletions code/frameworks/angular/src/server/angular-cli-webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }
styles: builderOptions.styles
?.map((style) => (typeof style === 'string' ? style : style.input))
.filter((style) => typeof style === 'string' || style.inject !== false),
outputPath:
typeof builderOptions.outputPath === 'string'
? builderOptions.outputPath
: builderOptions.outputPath?.base,

// Fixed options
optimization: false,
Expand Down
Loading