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

Sign up to get free protection for your applications and to get access to all the features.
@@ -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: [name: string] | [next_dist_compiled__edge_runtime_cookies.RequestCookie] | []) => next_dist_compiled__edge_runtime_cookies.RequestCookie[]>;
27
+ getAll: Mock<(...args: [] | [next_dist_compiled__edge_runtime_cookies.RequestCookie] | [name: string]) => 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 singletonRouter from 'next/dist/client/router';
7
- import singletonRouter__default from 'next/dist/client/router';
6
+ import * as originalRouter from 'next/dist/client/router';
7
+ import originalRouter__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>) => NextRouter;
18
+ declare const createRouter: (overrides: Partial<NextRouter>) => originalRouter.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 singletonRouter.useRouter>;
44
+ declare const useRouter: Mock$1<typeof originalRouter.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,30 +1,10 @@
1
1
  import vitePluginStorybookNextJs from 'vite-plugin-storybook-nextjs';
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';
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';
5
4
  import { ReactRenderer, Meta } from '@storybook/react';
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;
5
+ import '@storybook/builder-vite';
6
+ import '@storybook/react-vite';
7
+ import 'next/router';
28
8
 
29
9
  /**
30
10
  * Function that sets the globalConfig of your storybook. The global config is the preview module of
@@ -108,4 +88,4 @@ declare module '@storybook/experimental-nextjs-vite/vite-plugin' {
108
88
  const storybookNextJsPlugin: typeof vitePluginStorybookNextJs;
109
89
  }
110
90
 
111
- export { FrameworkOptions, StorybookConfig, composeStories, composeStory, setProjectAnnotations };
91
+ export { composeStories, composeStory, setProjectAnnotations };
@@ -0,0 +1,9 @@
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 };
@@ -0,0 +1 @@
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});
@@ -0,0 +1,5 @@
1
+ import '../chunk-H6MOWX77.mjs';
2
+
3
+ function defineMain(config){return config}
4
+
5
+ export { defineMain };
@@ -0,0 +1,49 @@
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/experimental-nextjs-vite",
3
- "version": "0.0.0-pr-30202-sha-078ba9c5",
3
+ "version": "0.0.0-pr-30197-sha-7e96e461",
4
4
  "description": "Storybook for Next.js and Vite",
5
5
  "keywords": [
6
6
  "storybook",
@@ -58,6 +58,12 @@
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
+ },
61
67
  "./package.json": "./package.json"
62
68
  },
63
69
  "main": "dist/index.js",
@@ -95,24 +101,24 @@
95
101
  "prep": "jiti ../../../scripts/prepare/bundle.ts"
96
102
  },
97
103
  "dependencies": {
98
- "@storybook/builder-vite": "0.0.0-pr-30202-sha-078ba9c5",
99
- "@storybook/react": "0.0.0-pr-30202-sha-078ba9c5",
100
- "@storybook/react-vite": "0.0.0-pr-30202-sha-078ba9c5",
101
- "@storybook/test": "0.0.0-pr-30202-sha-078ba9c5",
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",
102
108
  "styled-jsx": "5.1.6",
103
109
  "vite-plugin-storybook-nextjs": "^1.1.0"
104
110
  },
105
111
  "devDependencies": {
106
112
  "@types/node": "^22.0.0",
107
113
  "next": "^15.0.3",
108
- "typescript": "^5.7.3"
114
+ "typescript": "^5.3.2"
109
115
  },
110
116
  "peerDependencies": {
111
- "@storybook/test": "0.0.0-pr-30202-sha-078ba9c5",
117
+ "@storybook/test": "0.0.0-pr-30197-sha-7e96e461",
112
118
  "next": "^14.1.0 || ^15.0.0",
113
119
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
114
120
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta",
115
- "storybook": "^0.0.0-pr-30202-sha-078ba9c5",
121
+ "storybook": "^0.0.0-pr-30197-sha-7e96e461",
116
122
  "vite": "^5.0.0 || ^6.0.0"
117
123
  },
118
124
  "peerDependenciesMeta": {
@@ -134,6 +140,7 @@
134
140
  "./src/index.ts",
135
141
  "./src/vite-plugin/index.ts",
136
142
  "./src/preset.ts",
143
+ "./src/node/index.ts",
137
144
  "./src/preview.tsx",
138
145
  "./src/export-mocks/cache/index.ts",
139
146
  "./src/export-mocks/headers/index.ts",