464 Commits

Author SHA1 Message Date
Michael Shilman
3d4dfa4df6
Merge pull request #20116 from storybookjs/support-customization-of-mdx-plugins
Addon-docs: Fix customization of MDX plugins
2023-02-03 00:37:23 +08:00
Norbert de Langen
505a5af06a
Merge pull request #20846 from storybookjs/valentin/add-nunito-sans
Add nunito sans font
2023-02-02 15:08:52 +01:00
Norbert de Langen
69dabfa0ee
add font css to preview, minimize number of preloaded fonts for manager 2023-02-02 11:40:07 +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
80d9808df5
Merge pull request #20801 from storybookjs/docs/default-exports-in-main
Docs: Update main.js format in docs/tutorials/recipes
2023-01-31 13:18:27 +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
Charles GRUENAIS
66a11919ee Deps: Upgrade magic-string to 0.27.0 2023-01-30 18:40:41 +01:00
Yann Braga
c23294a3b6 docs: update documentation regarding main.js to use default exports 2023-01-30 15:35:29 +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
Jeppe Reinhold
4d71923093
Merge pull request #20790 from storybookjs/disable-markdown-transclusion
Docs: Disable Markdown transclusion and support ?raw .md files
2023-01-27 23:35:02 +01:00
Charles GRUENAIS
a602c6a302 Merge remote-tracking branch 'origin/next' into fix-hmr-vite 2023-01-27 17:41:39 +01:00
Charles GRUENAIS
759047eb4e Made names more consistent 2023-01-27 17:12:32 +01:00
Jeppe Reinhold
f852ea715b
Merge branch 'next' into disable-markdown-transclusion 2023-01-27 09:31:03 +01: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
Charles GRUENAIS
e9592b247e Pass globals definition through plugin's arguments 2023-01-26 16:15:37 +01:00
Charles GRUENAIS
f86ff03826 Fixed default imports, added support for import namespace specifiers, added more tests 2023-01-26 14:22:32 +01:00
Josh Wooding
a9f388e6b8
Support customization of MDX plugins 2023-01-26 10:59:34 +00:00
Jeppe Reinhold
021818a795
Merge branch 'next' into disable-markdown-transclusion 2023-01-26 02:17:30 +01:00
Jeppe Reinhold
34d1defd83 disable MDX loader for MD in Vite 2023-01-26 01:36:40 +01:00
Ian VanSchooten
ab1508e28d Merge remote-tracking branch 'origin/next' into fix-hmr-vite 2023-01-25 13:26:22 -05:00
Charles GRUENAIS
71c3cc2c68 Cleaned up pointless types 2023-01-25 18:59:13 +01:00
Charles GRUENAIS
007b5bb6fd Merge branch 'next' into fix-hmr-vite 2023-01-25 18:45:11 +01: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
Charles GRUENAIS
76ca07d4ad Parallel cache creation, grouped all replaces as a single regex, added basic tests 2023-01-23 23:35:35 +01:00
Ian VanSchooten
563fa6c1f6 Handle minified code 2023-01-22 23:44:09 -05:00
Ian VanSchooten
156178506d Add a few docblocks 2023-01-22 22:23:04 -05:00
Ian VanSchooten
b78244e652 Create aliases for dev 2023-01-22 22:22:49 -05:00
Ian VanSchooten
22af7fe512 Return sourcemap 2023-01-22 20:39:46 -05:00
Ian VanSchooten
69f23e4b56 Replace all as in import specifiers with colons 2023-01-22 20:37:25 -05:00
Ian VanSchooten
61acc22f7f Remove vite-plugin-externals 2023-01-22 19:49:12 -05:00
Ian VanSchooten
b49050af0a Remove unused imports 2023-01-22 19:47:18 -05:00
n028
04a76cf48f
Merge branch 'next' into fix-hmr-vite 2023-01-21 18:52:11 +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
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
charles.gruenais
9642d04f28 Naive implementation of local vite plugin to replace vite-plugin-externals 2023-01-19 23:57:34 +01:00
Ian VanSchooten
174fb61b15 Vite: Add config for vite.config path 2023-01-18 19:27:37 -05:00