2546 Commits

Author SHA1 Message Date
Michael Shilman
b8c17b23e9 v7.0.0-beta.34 2023-01-26 01:37:57 +08:00
Michael Shilman
572a0caf79 Update root, peer deps, version.ts/json to 7.0.0-beta.34 [ci skip] 2023-01-26 01:33:50 +08:00
Michael Shilman
1dc6152240
Merge pull request #20776 from storybookjs/shilman/fix-cli-options
CLI: Fix global flag corner case
2023-01-26 01:14:06 +08:00
Michael Shilman
4de2478676
Merge pull request #20747 from storybookjs/shilman/20145-legacy-mdx1
Addon-docs: Add legacy transitional support for MDX1
2023-01-26 01:12:34 +08:00
Yann Braga
c3a7637697
Merge pull request #20785 from storybookjs/fix/csf-tools-name-from-path
CSF-tools: Fix ConfigFile string literal property handling
2023-01-25 17:09:13 +01:00
Michael Shilman
7a495e03d2 Merge branch 'next' into shilman/20145-legacy-mdx1 2023-01-25 23:54:45 +08:00
Michael Shilman
cf3ab50342
Merge pull request #20781 from storybookjs/test-sandbox-storybook-id
Verify consistency of anonymous id
2023-01-25 23:49:48 +08:00
Yann Braga
4691ac0f76 csf-tools: fix getNameFromPaths in string literal obj property 2023-01-25 15:23:28 +01:00
Norbert de Langen
bdf56cd566
Merge pull request #20711 from alexandertrefz/fix-angular-docs-mode
Ensure Angular docsMode flag has effect
2023-01-25 14:25:29 +01:00
Alexander Trefz
b814ecad04
fix: Ensure Angular docsMode flag has effect & rename it to docs 2023-01-25 13:19:09 +01:00
Tom Coleman
e4921c45d3 Trim whitespace in anon id 2023-01-25 22:02:34 +11:00
Michael Shilman
214c6ae3ac Add extra error sanitization handling 2023-01-25 18:48:18 +08:00
Michael Shilman
4efae5ad71 Improve CLI options types 2023-01-25 11:31:06 +08:00
Michael Shilman
3f7451d2b2 CLI: Fix global flag handling 2023-01-25 11:23:29 +08:00
Ian VanSchooten
8d595b81e6 Fix utf-8 encoding flag 2023-01-24 15:54:10 -05:00
Ian VanSchooten
50ac037342 Deps: Upgrade fs-extra to 11.1.0 2023-01-24 15:32:13 -05:00
Michael Shilman
deab4d860f Update git head to 7.0.0-beta.33, update yarn.lock [ci skip] 2023-01-24 23:37:11 +08:00
Michael Shilman
7b662c4448 v7.0.0-beta.33 2023-01-24 23:35:44 +08:00
Michael Shilman
ef86cd23e6 Update root, peer deps, version.ts/json to 7.0.0-beta.33 [ci skip] 2023-01-24 22:45:12 +08:00
Tom Coleman
7cc2a41c67 Merge branch 'next' into tom/sb-1156-write-migration-docs-and-reference-in 2023-01-24 21:54:36 +11:00
Tom Coleman
bcca0cc704
Merge pull request #20705 from storybookjs/>20626-fix-inconsistent-order
Core: Fix issue with inconsistent CSF ordering in sandboxes
2023-01-24 21:30:31 +11:00
Tom Coleman
0542214140 Merge branch 'next' into tom/sb-1156-write-migration-docs-and-reference-in 2023-01-24 21:25:11 +11:00
Jeppe Reinhold
6f7a603a31
Merge branch 'next' into jeppe/sb-1145-update-api-of-canvas-block 2023-01-24 10:09:18 +01:00
Tom Coleman
4eabf7ea12 Merge branch 'next' into >20626-fix-inconsistent-order 2023-01-24 17:33:34 +11:00
Michael Shilman
92436c8e0f Update git head to 7.0.0-beta.32, update yarn.lock [ci skip] 2023-01-24 11:39:46 +08:00
Michael Shilman
99f5bb60dd v7.0.0-beta.32 2023-01-24 11:38:31 +08:00
Michael Shilman
d28f6f920c Update root, peer deps, version.ts/json to 7.0.0-beta.32 [ci skip] 2023-01-24 11:06:40 +08:00
Michael Shilman
8c5fe63074 Addon-docs: Add legacy transitional support for MDX1 2023-01-24 00:14:46 +08:00
chakir qatab
682f8c1ce1 cleanup and check the forceReRender api not firing 2023-01-23 12:27:27 +04:00
chakir qatab
9670e97919 refactory and cleanup 2023-01-22 20:43:05 +04:00
Jeppe Reinhold
2c905fc963 Merge branch 'next' of github.com:storybookjs/storybook into jeppe/sb-1145-update-api-of-canvas-block 2023-01-21 22:44:16 +01:00
Jeppe Reinhold
73b9c7b1b6 use new Canvas API in autodocs 2023-01-21 22:25:11 +01:00
chakir qatab
5898ba5587 fix issue with testing args.stories 2023-01-21 21:59:32 +04:00
chakir qatab
d4b8b9ae35 fixing test issues 2023-01-21 12:44:29 +04:00
Ian VanSchooten
994a26df8f
Vite: Allow specifying path to vite.config file (#20681)
Issue: #20552

## What I did

I added a new builder option for the Vite builder named `viteConfigPath`, which is a path to a custom config relative to the cwd.  If the path does not resolve, a clear error will be thrown with the absolute path being checked.

I also added a new utility, `getBuilderOptions()`, which is helpful because these options can be specified two different ways, with `core.builder.options` or `framework.options.builder`.  The utility gives an easy way to check both.  It gives preference to ~`core.builder.options`~ `framework.options.builder`, since that's the newer way to define the options.

## How to test

1. `yarn task --task sandbox --start-from auto --template react-vite/default-ts`
2. Move the `vite.config.ts` file into `.storybook`
3. Add an alias, like:
```ts
export default defineConfig({
  plugins: [react()],
  resolve: {
    alias: {
      stories: path.resolve(__dirname, '../src/stories'),
    },
  },
});
```
4. Change one of the stories to use this alias, such as the Button story:
```ts
import { Button } from 'stories/Button';
```
5. Start Storybook, it will fail
6. Add `viteConfigPath: ".storybook/vite.config.ts"` to the builder options in `.storybook/main.ts`
7. Restart storybook, and it should work.


## Checklist

<!-- Please check (put an "x" inside the "[ ]") the applicable items below to make sure your PR is ready to be reviewed. -->

- [ ] Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
- [X] Make sure to add/update documentation regarding your changes
- [ ] If you are deprecating/removing a feature, make sure to update
      [MIGRATION.MD](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md)

Is there a way to create an automated test for this?  I couldn't think of a good way to do it.

#### Maintainers

- [ ] If this PR should be tested against many or all sandboxes,
      make sure to add the `ci:merged` or `ci:daily` GH label to it.
- [X] Make sure this PR contains **one** of the labels below.

`["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]`

<!--

Everybody: Please submit all PRs to the `next` branch unless they are specific to the current release. Storybook maintainers cherry-pick bug and documentation fixes into the `main` branch as part of the release process, so you shouldn't need to worry about this. For additional guidance: https://storybook.js.org/docs/react/contribute/how-to-contribute

-->
2023-01-20 09:17:29 -05:00
Norbert de Langen
2a370ff769
Merge pull request #20411 from literalpie/qwik-init
CLI: Add init support for qwik projects
2023-01-20 13:49:03 +01:00
Norbert de Langen
a7fe25daf0
Merge pull request #20707 from storybookjs/norbert/fix-windows-test-snapshot
fix snapshot
2023-01-20 13:39:42 +01:00
Norbert de Langen
785ab0a9b0
I'm not sure where this change came from 2023-01-20 13:31:28 +01:00
Norbert de Langen
ee9b7a80cd
remove need for snapshots at all, and check for actual syntax validity 2023-01-20 13:22:40 +01:00
Valentin Palkovic
b8ed843bf7
Merge pull request #20708 from storybookjs/valentin/fix-package-execution
CLI: Fix package execution for npm package manager
2023-01-20 13:22:39 +01:00
Norbert de Langen
8ffe82e12b
remove the need for platform specific snapshots 2023-01-20 12:36:11 +01:00
Norbert de Langen
a29056b8d4
fix 2023-01-20 12:19:25 +01:00
Norbert de Langen
10e5f5f682
add trim 2023-01-20 11:32:32 +01:00
Norbert de Langen
684362e61f
make snapshots easier to read 2023-01-20 11:30:44 +01:00
Valentin Palkovic
b1b872debc Fix package execution for npm package manager 2023-01-20 11:18:05 +01:00
Norbert de Langen
fb566dee2b
fix snapshot 2023-01-20 10:48:10 +01:00
Yann Braga
f380b27244 small tweaks on babelrc automigration 2023-01-20 10:31:45 +01:00
Yann Braga
fd5bd13dcb replace getFieldValue with getNameFromPath where applicable
- This makes the code safer as it does not evaluate properties, just looks for string literals that identify that property
2023-01-20 10:25:39 +01:00
Yann Braga
a11bcbe35a return undefined when node does not exist 2023-01-20 10:24:05 +01:00
Yann Braga
04b691e443 throw an error with unexpected node value 2023-01-20 10:21:14 +01:00