380 Commits

Author SHA1 Message Date
Yann Braga
1440cdd19b improve error message in validateConfigurationFiles 2023-02-13 11:07:26 +01:00
Yann Braga
17abe51da1 add fallback value in loadMainConfig 2023-02-13 11:06:55 +01:00
Yann Braga
077bea8e79 export renderer and framework packages in core-common 2023-02-13 11:04:08 +01:00
Yann Braga
0dfdc4c766 Merge branch 'next' into feat/configDir-automigrations 2023-02-09 17:40:16 +01:00
Michael Shilman
0878bcd1f1 Update git head to 7.0.0-beta.45, update yarn.lock [ci skip] 2023-02-09 11:00:25 +08:00
Michael Shilman
c7fdb03a40 v7.0.0-beta.45 2023-02-09 10:58:59 +08:00
Michael Shilman
cd5abae631 Update git head to 7.0.0-beta.44, update yarn.lock [ci skip] 2023-02-08 00:15:29 +08:00
Michael Shilman
cb3de6c33a v7.0.0-beta.44 2023-02-08 00:13:50 +08:00
Norbert de Langen
1ad2f09035
Merge pull request #20959 from storybookjs/norbert/bump-glob-promise
Tech: upgrade glob-promise
2023-02-06 13:41:32 +01:00
Norbert de Langen
f2b5be1222
upgrade glob-promise 2023-02-06 12:59:45 +01:00
Yann Braga
80790c825f undo AST main.js check in validateConfigFile 2023-02-06 10:11:44 +01:00
Michael Shilman
b84e01a563 Update git head to 7.0.0-beta.43, update yarn.lock [ci skip] 2023-02-04 17:16:26 +08:00
Michael Shilman
b1b7c2bc99 v7.0.0-beta.43 2023-02-04 17:15:16 +08:00
Michael Shilman
108143cdbe Core: Fix globs on windows 2023-02-04 16:01:57 +08:00
Michael Shilman
87cc22de12 Update git head to 7.0.0-beta.42, update yarn.lock [ci skip] 2023-02-04 12:27:53 +08:00
Michael Shilman
0b8d11c617 v7.0.0-beta.42 2023-02-04 12:26:43 +08:00
chakir qatab
815e6bdf6f fix deps conflict on sandboxes install react, vue. 2023-02-04 03:24:19 +04:00
Michael Shilman
898cee2081 Update git head to 7.0.0-beta.41, update yarn.lock [ci skip] 2023-02-03 21:27:11 +08:00
Michael Shilman
b73df3011f v7.0.0-beta.41 2023-02-03 21:26:05 +08:00
Norbert de Langen
bb7171da17
fix https://github.com/storybookjs/storybook/pull/20802#issuecomment-1413033420 2023-02-02 13:22:18 +01:00
Michael Shilman
15e14b85b9 Update git head to 7.0.0-beta.40, update yarn.lock [ci skip] 2023-02-02 11:40:56 +08:00
Michael Shilman
9c68cc3a66 v7.0.0-beta.40 2023-02-02 11:39:38 +08:00
Michael Shilman
ed1b8b8b19 Update git head to 7.0.0-beta.39, update yarn.lock [ci skip] 2023-02-01 23:57:11 +08:00
Michael Shilman
96d4845118 v7.0.0-beta.39 2023-02-01 23:55:24 +08:00
Yann Braga
55ebe5b594 CLI: replace glob with glob-promise 2023-01-31 10:35:29 +01:00
Yann Braga
4ea443c13e Warn users to use default export in main.js
- involves changes in csf-tools to define a flag that tells us there is (or not) a default export
- involves changes in affected packages now that loadMainConfig is async
2023-01-31 10:23:07 +01:00
Michael Shilman
cb1cb566b7 Update git head to 7.0.0-beta.38, update yarn.lock [ci skip] 2023-01-31 16:58:47 +08:00
Michael Shilman
91302a6818 v7.0.0-beta.38 2023-01-31 16:57:30 +08:00
Michael Shilman
a30b991777 v7.0.0-beta.37 2023-01-31 16:53:10 +08:00
Norbert de Langen
ec2346a69f
update & regen lockfile 2023-01-30 14:11:56 +01:00
Michael Shilman
b6b51d5a2a Update git head to 7.0.0-beta.36, update yarn.lock [ci skip] 2023-01-28 11:30:40 +08:00
Michael Shilman
5268eb0fa2 v7.0.0-beta.36 2023-01-28 11:29:32 +08:00
Michael Shilman
894f514d99 Update git head to 7.0.0-beta.35, update yarn.lock [ci skip] 2023-01-27 00:59:07 +08:00
Michael Shilman
e6d5c50c88 v7.0.0-beta.35 2023-01-27 00:57:32 +08:00
Michael Shilman
af85902b01 Update git head to 7.0.0-beta.34, update yarn.lock [ci skip] 2023-01-26 01:39:11 +08:00
Michael Shilman
b8c17b23e9 v7.0.0-beta.34 2023-01-26 01:37:57 +08: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
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
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
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
Ian VanSchooten
046eef6b8e Prefer framework.options.builder 2023-01-19 08:05:57 -05:00
Ian VanSchooten
174fb61b15 Vite: Add config for vite.config path 2023-01-18 19:27:37 -05:00
Michael Shilman
5ab9699391 Update git head to 7.0.0-beta.30, update yarn.lock [ci skip] 2023-01-18 23:11:11 +08:00
Michael Shilman
633f95bec7 v7.0.0-beta.30 2023-01-18 23:09:16 +08:00
Benjamin Kindle
d8944a5dda feat: support Qwik framework in sb init
Works with this change in the storybook-framework-qwik project: 3dca5b48de
2023-01-18 07:58:58 -05:00