vite-plugin-storybook-nextjs 1.0.8--canary.13.fbca3a4.0 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ This is a Vite plugin that allows you to use Next.js features in Vite. It is the
|
|
|
8
8
|
- **Storybook Compatibility**: Acts as the foundation for [the `@storybook/experimental-nextjs-vite` framework](https://storybook.js.org/docs/get-started/frameworks/nextjs#with-vite), enabling you to use Storybook with Next.js in a Vite environment.
|
|
9
9
|
- **Portable Stories**: Ideal for running portable stories in Vitest, ensuring your components are tested in an environment that closely mirrors production.
|
|
10
10
|
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
- Next.js v14.1.0 or higher
|
|
14
|
+
|
|
11
15
|
## Installation
|
|
12
16
|
|
|
13
17
|
Install the plugin using your preferred package manager:
|
|
@@ -64,7 +68,7 @@ This plugin is necessary to run portable stories in Vitest, as it provides the n
|
|
|
64
68
|
|
|
65
69
|
(⚠️ **Experimental**)
|
|
66
70
|
|
|
67
|
-
The experimental `@storybook/experimental-vitest
|
|
71
|
+
The experimental `@storybook/experimental-addon-vitest` can be used to automatically transform your stories at Vitest runtime to in-memory test files. This allows you to run your stories in a Vitest environment without needing to manually transform your stories. Please visit https://storybook.js.org/docs/8.3/writing-tests/test-runner-with-vitest for more information.
|
|
68
72
|
|
|
69
73
|
## Limitations and differences to the Webpack5-based integration of Next.js in Storybook
|
|
70
74
|
|
|
@@ -95,8 +99,9 @@ When testing components that rely on Next.js Server Actions, you need to ensure
|
|
|
95
99
|
```js
|
|
96
100
|
// @vitest-environment jsdom
|
|
97
101
|
```
|
|
102
|
+
|
|
98
103
|
2. To apply it to all tests, adjust your Vitest configuration:
|
|
99
|
-
|
|
104
|
+
|
|
100
105
|
```ts
|
|
101
106
|
// vitest.config.ts
|
|
102
107
|
import { defineConfig } from "vite";
|
|
@@ -2,7 +2,7 @@ import * as next_dist_shared_lib_get_img_props from 'next/dist/shared/lib/get-im
|
|
|
2
2
|
import * as _NextImage from 'next/image';
|
|
3
3
|
import React__default from 'next/dist/compiled/react';
|
|
4
4
|
|
|
5
|
-
declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "
|
|
5
|
+
declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "width" | "height" | "loading" | "ref" | "alt" | "srcSet"> & {
|
|
6
6
|
src: string | next_dist_shared_lib_get_img_props.StaticImport;
|
|
7
7
|
alt: string;
|
|
8
8
|
width?: number | `${number}` | undefined;
|
|
@@ -2,7 +2,7 @@ import * as next_dist_shared_lib_get_img_props from 'next/dist/shared/lib/get-im
|
|
|
2
2
|
import * as _NextImage from 'next/image';
|
|
3
3
|
import React__default from 'next/dist/compiled/react';
|
|
4
4
|
|
|
5
|
-
declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "
|
|
5
|
+
declare const MockedNextImage: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "width" | "height" | "loading" | "ref" | "alt" | "srcSet"> & {
|
|
6
6
|
src: string | next_dist_shared_lib_get_img_props.StaticImport;
|
|
7
7
|
alt: string;
|
|
8
8
|
width?: number | `${number}` | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-storybook-nextjs",
|
|
3
|
-
"version": "1.0.8
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite-plugin",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@storybook/test": "^8.3.0-alpha.3",
|
|
57
|
-
"next": "^14.
|
|
57
|
+
"next": "^14.1.0",
|
|
58
58
|
"storybook": "^8.3.0-alpha.3",
|
|
59
59
|
"vite": "^5.0.0"
|
|
60
60
|
},
|