4189 Commits

Author SHA1 Message Date
Valentin Palkovic
b003f78f8c Upgrade react-popper-tooltip 2023-01-23 13:40:29 +01: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
0dac4c4114
Merge branch 'next' into norbert/fix-20580 2023-01-20 13:55:50 +01: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
Yann Braga
a044e18ad5 csf-tools: add helpers to get name from node path 2023-01-20 10:21:14 +01:00
Norbert de Langen
f385bd4a89
Merge branch 'next' into qwik-init 2023-01-20 10:20:40 +01:00
Yann Braga
7be3f8376e remove preact-webpack5 from babelrc automigration 2023-01-20 09:56:53 +01:00
Norbert de Langen
fc3b221569
Merge branch 'next' into qwik-init 2023-01-20 09:15:41 +01:00
Michael Shilman
457694a15a Update git head to 7.0.0-beta.31, update yarn.lock [ci skip] 2023-01-20 13:24:01 +08:00
Michael Shilman
6d1ea7647f v7.0.0-beta.31 2023-01-20 13:22:31 +08:00
Michael Shilman
bc018cf157 Update root, peer deps, version.ts/json to 7.0.0-beta.31 [ci skip] 2023-01-20 13:16:28 +08:00
Michael Shilman
838da74e97
Merge pull request #20603 from storybookjs/tom/sb-1147-update-api-of-source-block
Docs: Added source stories and updated API
2023-01-20 12:59:08 +08:00
Michael Shilman
882f864003
Merge pull request #20688 from storybookjs/shilman/20421-split-docs-storysource
Source-loader: Fix export default variable references
2023-01-20 10:56:54 +08:00
Tom Coleman
5f2a98ffce Merge branch 'tom/sb-1149-implement-argtypes-block' into tom/sb-1152-implement-controls-block 2023-01-20 10:00:20 +11:00
Tom Coleman
05ff649346 Merge branch 'next' into tom/sb-1149-implement-argtypes-block 2023-01-20 09:59:43 +11:00
Tom Coleman
3f1154ee2c Update to use resolveOf 2023-01-20 09:26:19 +11:00
Tom Coleman
7fa20f2316 Merge branch 'next' into tom/sb-1147-update-api-of-source-block 2023-01-20 09:25:24 +11:00
Tom Coleman
c564a166e1 Remove log 2023-01-20 09:24:57 +11:00
Tom Coleman
471cf96e3a Merge branch 'tom/sb-1149-implement-argtypes-block' into tom/sb-1152-implement-controls-block 2023-01-20 09:19:36 +11:00
Tom Coleman
a919466694 Merge branch 'tom/sb-1149-implement-argtypes-block' of https://github.com/storybookjs/storybook into tom/sb-1149-implement-argtypes-block 2023-01-20 09:19:15 +11:00
Yann Braga
f160d3bb62 turn missing-babelrc into an automatic migration 2023-01-19 17:13:13 +01:00
Yann Braga
91f3f62405 use correct method in ui example story 2023-01-19 16:31:48 +01:00
Ian VanSchooten
046eef6b8e Prefer framework.options.builder 2023-01-19 08:05:57 -05:00
Michael Shilman
4eff3e6288
Merge pull request #20679 from sheriffMoose/next
Addon-docs: Update story index generator
2023-01-19 20:57:42 +08:00
Michael Shilman
285a7b820f Source-loader: Handle export default variable references 2023-01-19 18:41:51 +08:00
Tom Coleman
e02c9522a1 Merge branch 'tom/sb-1149-implement-argtypes-block' into tom/sb-1152-implement-controls-block 2023-01-19 20:47:24 +11:00
Tom Coleman
4fec6d4036 Small fix 2023-01-19 20:46:29 +11:00
Tom Coleman
17849d4459
Apply suggestions from code review
Co-authored-by: Jeppe Reinhold <jeppe@chromatic.com>
2023-01-19 19:58:27 +11:00
Tom Coleman
c04ae7d64b Remove unused file 2023-01-19 19:37:15 +11:00
Tom Coleman
9aadeade4c
Update code/ui/blocks/src/examples/ArgTypesParameters.stories.tsx
Co-authored-by: Jeppe Reinhold <jeppe@chromatic.com>
2023-01-19 19:36:34 +11:00
Tom Coleman
b0386b983d Use Controls in DocsPage 2023-01-19 17:18:37 +11:00
Tom Coleman
375cee1edd Implement Controls block 2023-01-19 17:16:19 +11:00
Tom Coleman
0089455b8d Merge remote-tracking branch 'origin/next' into tom/sb-1149-implement-argtypes-block 2023-01-19 17:00:50 +11:00
Tom Coleman
b588070fe3 Refactor source reference stories 2023-01-19 16:54:21 +11:00
Tom Coleman
cf87680a1e
Merge pull request #20662 from storybookjs/refactor-useOf
Docs: Move validation logic into `context.resolveOf`
2023-01-19 16:43:15 +11:00
Michael Shilman
f1765bfd2d
fix linting 2023-01-19 12:31:26 +08:00