@storybook/experimental-nextjs-vite 0.0.0-pr-30197-sha-7e96e461 → 0.0.0-pr-30202-sha-a2a9f276

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.
@@ -24,7 +24,7 @@ declare const headers: {
24
24
 
25
25
  declare class RequestCookiesMock extends RequestCookies {
26
26
  get: Mock<(...args: [name: string] | [next_dist_compiled__edge_runtime_cookies.RequestCookie]) => next_dist_compiled__edge_runtime_cookies.RequestCookie | undefined>;
27
- getAll: Mock<(...args: [] | [next_dist_compiled__edge_runtime_cookies.RequestCookie] | [name: string]) => next_dist_compiled__edge_runtime_cookies.RequestCookie[]>;
27
+ getAll: Mock<(...args: [name: string] | [next_dist_compiled__edge_runtime_cookies.RequestCookie] | []) => next_dist_compiled__edge_runtime_cookies.RequestCookie[]>;
28
28
  has: Mock<(name: string) => boolean>;
29
29
  set: Mock<(...args: [key: string, value: string] | [options: next_dist_compiled__edge_runtime_cookies.RequestCookie]) => this>;
30
30
  delete: Mock<(names: string | string[]) => boolean | boolean[]>;
@@ -3,8 +3,8 @@ import * as next_dist_client_with_router from 'next/dist/client/with-router';
3
3
  import * as next from 'next';
4
4
  import { M as Mock$1 } from '../../index.d-5a935e77.js';
5
5
  import { Mock } from '@storybook/test';
6
- import * as originalRouter from 'next/dist/client/router';
7
- import originalRouter__default from 'next/dist/client/router';
6
+ import * as singletonRouter from 'next/dist/client/router';
7
+ import singletonRouter__default from 'next/dist/client/router';
8
8
  export * from 'next/dist/client/router';
9
9
  export { default } from 'next/dist/client/router';
10
10
  import { NextRouter } from 'next/router';
@@ -15,7 +15,7 @@ import { NextRouter } from 'next/router';
15
15
  * @ignore
16
16
  * @internal
17
17
  */
18
- declare const createRouter: (overrides: Partial<NextRouter>) => originalRouter.NextRouter;
18
+ declare const createRouter: (overrides: Partial<NextRouter>) => NextRouter;
19
19
  declare const getRouter: () => {
20
20
  push: Mock;
21
21
  replace: Mock;
@@ -41,7 +41,7 @@ declare const getRouter: () => {
41
41
  isPreview: boolean;
42
42
  };
43
43
 
44
- declare const useRouter: Mock$1<typeof originalRouter.useRouter>;
44
+ declare const useRouter: Mock$1<typeof singletonRouter.useRouter>;
45
45
  declare const withRouter: Mock$1<(ComposedComponent: next.NextComponentType<next.NextPageContext, any, next_dist_client_with_router.WithRouterProps>) => React.ComponentType<next_dist_client_with_router.ExcludeRouterProps<next_dist_client_with_router.WithRouterProps>>>;
46
46
 
47
47
  export { createRouter, getRouter, useRouter, withRouter };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,30 @@
1
1
  import vitePluginStorybookNextJs from 'vite-plugin-storybook-nextjs';
2
- export { F as FrameworkOptions, N as NextJsParameters, S as StorybookConfig } from './types-8b63ba10.js';
3
- import { NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Args, StoryAnnotationsOrFn, ProjectAnnotations, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
2
+ import { CompatibleString, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Args, StoryAnnotationsOrFn, ProjectAnnotations, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
3
+ import { BuilderOptions } from '@storybook/builder-vite';
4
+ import { StorybookConfig as StorybookConfig$1 } from '@storybook/react-vite';
4
5
  import { ReactRenderer, Meta } from '@storybook/react';
5
- import '@storybook/builder-vite';
6
- import '@storybook/react-vite';
7
- import 'next/router';
6
+
7
+ type FrameworkName = CompatibleString<'@storybook/experimental-nextjs-vite'>;
8
+ type BuilderName = CompatibleString<'@storybook/builder-vite'>;
9
+ type FrameworkOptions = {
10
+ /** The path to the Next.js configuration file. */
11
+ nextConfigPath?: string;
12
+ builder?: BuilderOptions;
13
+ };
14
+ type StorybookConfigFramework = {
15
+ framework: FrameworkName | {
16
+ name: FrameworkName;
17
+ options: FrameworkOptions;
18
+ };
19
+ core?: StorybookConfig$1['core'] & {
20
+ builder?: BuilderName | {
21
+ name: BuilderName;
22
+ options: BuilderOptions;
23
+ };
24
+ };
25
+ };
26
+ /** The interface for Storybook configuration in `main.ts` files. */
27
+ type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigFramework> & StorybookConfigFramework;
8
28
 
9
29
  /**
10
30
  * Function that sets the globalConfig of your storybook. The global config is the preview module of
@@ -88,4 +108,4 @@ declare module '@storybook/experimental-nextjs-vite/vite-plugin' {
88
108
  const storybookNextJsPlugin: typeof vitePluginStorybookNextJs;
89
109
  }
90
110
 
91
- export { composeStories, composeStory, setProjectAnnotations };
111
+ export { FrameworkOptions, StorybookConfig, composeStories, composeStory, setProjectAnnotations };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/experimental-nextjs-vite",
3
- "version": "0.0.0-pr-30197-sha-7e96e461",
3
+ "version": "0.0.0-pr-30202-sha-a2a9f276",
4
4
  "description": "Storybook for Next.js and Vite",
5
5
  "keywords": [
6
6
  "storybook",
@@ -58,12 +58,6 @@
58
58
  "import": "./dist/vite-plugin/index.mjs",
59
59
  "require": "./dist/vite-plugin/index.js"
60
60
  },
61
- "./node": {
62
- "types": "./dist/node/index.d.ts",
63
- "node": "./dist/node/index.js",
64
- "import": "./dist/node/index.mjs",
65
- "require": "./dist/node/index.js"
66
- },
67
61
  "./package.json": "./package.json"
68
62
  },
69
63
  "main": "dist/index.js",
@@ -101,24 +95,24 @@
101
95
  "prep": "jiti ../../../scripts/prepare/bundle.ts"
102
96
  },
103
97
  "dependencies": {
104
- "@storybook/builder-vite": "0.0.0-pr-30197-sha-7e96e461",
105
- "@storybook/react": "0.0.0-pr-30197-sha-7e96e461",
106
- "@storybook/react-vite": "0.0.0-pr-30197-sha-7e96e461",
107
- "@storybook/test": "0.0.0-pr-30197-sha-7e96e461",
98
+ "@storybook/builder-vite": "0.0.0-pr-30202-sha-a2a9f276",
99
+ "@storybook/react": "0.0.0-pr-30202-sha-a2a9f276",
100
+ "@storybook/react-vite": "0.0.0-pr-30202-sha-a2a9f276",
101
+ "@storybook/test": "0.0.0-pr-30202-sha-a2a9f276",
108
102
  "styled-jsx": "5.1.6",
109
103
  "vite-plugin-storybook-nextjs": "^1.1.0"
110
104
  },
111
105
  "devDependencies": {
112
106
  "@types/node": "^22.0.0",
113
107
  "next": "^15.0.3",
114
- "typescript": "^5.3.2"
108
+ "typescript": "^5.7.3"
115
109
  },
116
110
  "peerDependencies": {
117
- "@storybook/test": "0.0.0-pr-30197-sha-7e96e461",
111
+ "@storybook/test": "0.0.0-pr-30202-sha-a2a9f276",
118
112
  "next": "^14.1.0 || ^15.0.0",
119
113
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
120
114
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
121
- "storybook": "^0.0.0-pr-30197-sha-7e96e461",
115
+ "storybook": "^0.0.0-pr-30202-sha-a2a9f276",
122
116
  "vite": "^5.0.0 || ^6.0.0"
123
117
  },
124
118
  "peerDependenciesMeta": {
@@ -140,7 +134,6 @@
140
134
  "./src/index.ts",
141
135
  "./src/vite-plugin/index.ts",
142
136
  "./src/preset.ts",
143
- "./src/node/index.ts",
144
137
  "./src/preview.tsx",
145
138
  "./src/export-mocks/cache/index.ts",
146
139
  "./src/export-mocks/headers/index.ts",
@@ -1,9 +0,0 @@
1
- import { S as StorybookConfig } from '../types-8b63ba10.js';
2
- import 'storybook/internal/types';
3
- import '@storybook/builder-vite';
4
- import '@storybook/react-vite';
5
- import 'next/router';
6
-
7
- declare function defineMain(config: StorybookConfig): StorybookConfig;
8
-
9
- export { defineMain };
@@ -1 +0,0 @@
1
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var node_exports={};__export(node_exports,{defineMain:()=>defineMain});module.exports=__toCommonJS(node_exports);function defineMain(config){return config}0&&(module.exports={defineMain});
@@ -1,5 +0,0 @@
1
- import '../chunk-H6MOWX77.mjs';
2
-
3
- function defineMain(config){return config}
4
-
5
- export { defineMain };
@@ -1,49 +0,0 @@
1
- import { CompatibleString } from 'storybook/internal/types';
2
- import { BuilderOptions } from '@storybook/builder-vite';
3
- import { StorybookConfig as StorybookConfig$1 } from '@storybook/react-vite';
4
- import { NextRouter } from 'next/router';
5
-
6
- type FrameworkName = CompatibleString<'@storybook/experimental-nextjs-vite'>;
7
- type BuilderName = CompatibleString<'@storybook/builder-vite'>;
8
- type FrameworkOptions = {
9
- /** The path to the Next.js configuration file. */
10
- nextConfigPath?: string;
11
- builder?: BuilderOptions;
12
- };
13
- type StorybookConfigFramework = {
14
- framework: FrameworkName | {
15
- name: FrameworkName;
16
- options: FrameworkOptions;
17
- };
18
- core?: StorybookConfig$1['core'] & {
19
- builder?: BuilderName | {
20
- name: BuilderName;
21
- options: BuilderOptions;
22
- };
23
- };
24
- };
25
- /** The interface for Storybook configuration in `main.ts` files. */
26
- type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigFramework> & StorybookConfigFramework;
27
- interface NextJsParameters {
28
- /**
29
- * Next.js framework configuration
30
- *
31
- * @see https://storybook.js.org/docs/get-started/frameworks/nextjs
32
- */
33
- nextjs?: {
34
- /**
35
- * Enable App Directory features If your story imports components that use next/navigation, you
36
- * need to set this parameter to true
37
- */
38
- appDirectory?: boolean;
39
- /**
40
- * Next.js navigation configuration when using `next/navigation`. Please note that it can only
41
- * be used in components/pages in the app directory.
42
- */
43
- navigation?: NextRouter;
44
- /** Next.js router configuration */
45
- router?: NextRouter;
46
- };
47
- }
48
-
49
- export { FrameworkOptions as F, NextJsParameters as N, StorybookConfig as S };