@itcase/storybook-config 1.2.78 → 1.2.80

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.
Files changed (116) hide show
  1. package/dist/cjs/components/EmailTemplatePreview.js +1 -1
  2. package/dist/cjs/decorators/withFormSubmitDecorator.js +0 -1
  3. package/dist/cjs/decorators/withNextDecorator.js +1 -1
  4. package/dist/cjs/decorators/withUiDecorator.js +1 -1
  5. package/dist/cjs/decorators.js +1 -2
  6. package/dist/components/EmailTemplatePreview/index.d.ts +2 -0
  7. package/dist/components/EmailTemplatePreview/index.js +38 -0
  8. package/dist/components/EmailTemplatePreview.js +1 -1
  9. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.d.ts +14 -0
  10. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.js +84 -0
  11. package/dist/components/FormSubmitWrapper/autoSubmitForm.d.ts +2 -0
  12. package/dist/components/FormSubmitWrapper/autoSubmitForm.js +106 -0
  13. package/dist/components/FormSubmitWrapper/index.d.ts +2 -0
  14. package/dist/components/FormSubmitWrapper/index.js +2 -0
  15. package/dist/config/addons/addonThemes.d.ts +15 -0
  16. package/dist/config/addons/addonThemes.js +14 -15
  17. package/dist/config/addons/addonsNextJs.d.ts +2 -0
  18. package/dist/config/addons/addonsNextJs.js +8 -9
  19. package/dist/config/addons/addonsReactNative.d.ts +2 -0
  20. package/dist/config/addons/addonsReactNative.js +6 -7
  21. package/dist/config/addons/addonsReactNativeWeb.d.ts +2 -0
  22. package/dist/config/addons/addonsReactNativeWeb.js +2 -3
  23. package/dist/config/addons/addonsVite.d.ts +2 -0
  24. package/dist/config/addons/addonsVite.js +8 -9
  25. package/dist/config/addons/addonsWebpack.d.ts +18 -0
  26. package/dist/config/addons/addonsWebpack.js +26 -27
  27. package/dist/config/appearance/appearance.d.ts +1 -0
  28. package/dist/config/appearance/appearance.js +1 -1
  29. package/dist/config/backgrounds/backgrounds.d.ts +23 -0
  30. package/dist/config/backgrounds/backgrounds.js +22 -24
  31. package/dist/config/code/code.d.ts +8 -0
  32. package/dist/config/code/code.js +18 -22
  33. package/dist/config/config/mainConfigNextJsVite.d.ts +10 -0
  34. package/dist/config/config/mainConfigNextJsVite.js +35 -38
  35. package/dist/config/config/mainConfigReactNative.d.ts +9 -0
  36. package/dist/config/config/mainConfigReactNative.js +21 -23
  37. package/dist/config/config/mainConfigReactNativeWeb.d.ts +23 -0
  38. package/dist/config/config/mainConfigReactNativeWeb.js +42 -46
  39. package/dist/config/config/mainConfigVite.d.ts +9 -0
  40. package/dist/config/config/mainConfigVite.js +75 -80
  41. package/dist/config/config/mainConfigWebpack.d.ts +9 -0
  42. package/dist/config/config/mainConfigWebpack.js +39 -64
  43. package/dist/config/framework/frameworkNextJs.d.ts +4 -0
  44. package/dist/config/framework/frameworkNextJs.js +3 -4
  45. package/dist/config/framework/frameworkNextJsVite.d.ts +4 -0
  46. package/dist/config/framework/frameworkNextJsVite.js +3 -4
  47. package/dist/config/framework/frameworkReactNative.d.ts +4 -0
  48. package/dist/config/framework/frameworkReactNative.js +3 -4
  49. package/dist/config/framework/frameworkReactNativeWeb.d.ts +4 -0
  50. package/dist/config/framework/frameworkReactNativeWeb.js +3 -4
  51. package/dist/config/framework/frameworkVite.d.ts +4 -0
  52. package/dist/config/framework/frameworkVite.js +3 -4
  53. package/dist/config/framework/frameworkWebpack.d.ts +11 -0
  54. package/dist/config/framework/frameworkWebpack.js +9 -10
  55. package/dist/config/main/index.d.ts +26 -0
  56. package/dist/config/main/index.js +26 -53
  57. package/dist/config/msw/index.d.ts +2 -0
  58. package/dist/config/msw/index.js +2 -7
  59. package/dist/config/msw/mswHandlers.d.ts +5 -0
  60. package/dist/config/msw/mswHandlers.js +20 -24
  61. package/dist/config/ondevice/ondeviceBackgrounds.d.ts +8 -0
  62. package/dist/config/ondevice/ondeviceBackgrounds.js +8 -9
  63. package/dist/config/preview/index.d.ts +6 -0
  64. package/dist/config/preview/index.js +6 -13
  65. package/dist/config/refs/refs.d.ts +13 -0
  66. package/dist/config/refs/refs.js +12 -13
  67. package/dist/config/sourceLink/sourceLink.d.ts +35 -0
  68. package/dist/config/sourceLink/sourceLink.js +32 -36
  69. package/dist/config/static/staticDirsNextJs.d.ts +5 -0
  70. package/dist/config/static/staticDirsNextJs.js +5 -6
  71. package/dist/config/static/staticDirsReactNative.d.ts +2 -0
  72. package/dist/config/static/staticDirsReactNative.js +2 -3
  73. package/dist/config/static/staticDirsReactNativeWeb.d.ts +2 -0
  74. package/dist/config/static/staticDirsReactNativeWeb.js +2 -3
  75. package/dist/config/static/staticDirsVite.d.ts +5 -0
  76. package/dist/config/static/staticDirsVite.js +2 -3
  77. package/dist/config/static/staticDirsWebpack.d.ts +5 -0
  78. package/dist/config/static/staticDirsWebpack.js +2 -3
  79. package/dist/config/status/status.d.ts +21 -0
  80. package/dist/config/status/status.js +23 -24
  81. package/dist/config/users/authorization.d.ts +22 -0
  82. package/dist/config/users/authorization.js +6 -8
  83. package/dist/config/users/users.d.ts +18 -0
  84. package/dist/config/users/users.js +19 -21
  85. package/dist/config/viewport/viewport.d.ts +264 -0
  86. package/dist/config/viewport/viewport.js +23 -25
  87. package/dist/config/vite/getMediaProxyServerConfig.d.ts +13 -0
  88. package/dist/config/vite/getMediaProxyServerConfig.js +14 -16
  89. package/dist/decorators/index.d.ts +8 -0
  90. package/dist/decorators/index.js +8 -0
  91. package/dist/decorators/withClearStoresDecorator.d.ts +4 -0
  92. package/dist/decorators/withExtraProviders.d.ts +2 -0
  93. package/dist/decorators/withFigmaSourceLink.d.ts +5 -0
  94. package/dist/decorators/withFormSubmitDecorator.d.ts +2 -0
  95. package/dist/decorators/withFormSubmitDecorator.js +0 -1
  96. package/dist/decorators/withLayoutDecorator.d.ts +4 -0
  97. package/dist/decorators/withNextDecorator.d.ts +9 -0
  98. package/dist/decorators/withNextDecorator.js +1 -1
  99. package/dist/decorators/withUiDecorator.d.ts +5 -0
  100. package/dist/decorators/withUiDecorator.js +1 -1
  101. package/dist/decorators.js +1 -2
  102. package/dist/utils/getFigmaSourceLink.d.ts +2 -0
  103. package/dist/utils/getFigmaSourceLink.js +13 -14
  104. package/dist/utils/getStoryInfoBlocks.d.ts +2 -0
  105. package/dist/utils/getStoryInfoBlocks.js +45 -55
  106. package/dist/utils/handleMSWParameters.d.ts +8 -0
  107. package/dist/utils/handleMSWParameters.js +18 -27
  108. package/dist/utils/hasFormParameters.d.ts +2 -0
  109. package/dist/utils/hasFormParameters.js +6 -9
  110. package/dist/utils/index.d.ts +7 -0
  111. package/dist/utils/index.js +9 -17
  112. package/dist/utils/isVitestEnvironment.d.ts +2 -0
  113. package/dist/utils/isVitestEnvironment.js +2 -3
  114. package/dist/utils/storybookServerErrorOnSubmit.d.ts +2 -0
  115. package/dist/utils/storybookServerErrorOnSubmit.js +12 -19
  116. package/package.json +62 -55
@@ -1,24 +1,20 @@
1
1
  const CODE = {
2
- codePanel: true,
3
- source: {
4
- type: 'dynamic',
5
- transform: (code, context) => {
6
- const booleanProps = Object.entries(context.argTypes ?? {})
7
- .filter(
8
- ([, v]) => v?.control === 'boolean' || v?.type?.name === 'boolean',
9
- )
10
- .map(([name]) => name)
11
- let result = code
12
- for (const prop of booleanProps) {
13
- // badge → badge={true}, но не трогаем badge={...} и badgeValue
14
- result = result.replace(
15
- new RegExp(`(\\s)${prop}(?=[\\s/>])`, 'g'),
16
- `$1${prop}={true}`,
17
- )
18
- }
19
- return result
2
+ codePanel: true,
3
+ source: {
4
+ type: 'dynamic',
5
+ transform: (code, context) => {
6
+ const booleanProps = Object.entries(context.argTypes ?? {})
7
+ .filter(([, v]) => {
8
+ return v?.control === 'boolean' || v?.type?.name === 'boolean';
9
+ })
10
+ .map(([name]) => name);
11
+ let result = code;
12
+ for (const prop of booleanProps) {
13
+ // badge → badge={true}, но не трогаем badge={...} и badgeValue
14
+ result = result.replace(new RegExp(`(\\s)${prop}(?=[\\s/>])`, 'g'), `$1${prop}={true}`);
15
+ }
16
+ return result;
17
+ },
20
18
  },
21
- },
22
- }
23
-
24
- export { CODE }
19
+ };
20
+ export { CODE };
@@ -0,0 +1,10 @@
1
+ declare const MAIN_CONFIG_NEXTJS_VITE: {
2
+ env: (config: any) => any;
3
+ viteFinal: (config: any) => Promise<Record<string, any>>;
4
+ core: {
5
+ disableTelemetry: boolean;
6
+ disableWhatsNewNotifications: boolean;
7
+ };
8
+ tags: string[];
9
+ };
10
+ export { MAIN_CONFIG_NEXTJS_VITE };
@@ -1,39 +1,36 @@
1
- import svgr from 'vite-plugin-svgr'
2
-
3
- import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
4
-
1
+ import svgr from 'vite-plugin-svgr';
2
+ import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
5
3
  const MAIN_CONFIG_NEXTJS_VITE = {
6
- env: (config) => ({
7
- ...config,
8
- REST_BASE_URL: process.env.REST_BASE_URL,
9
- STORYBOOK_MODE: process.env.STORYBOOK_MODE || '',
10
- }),
11
- viteFinal: async (config) => {
12
- const { mergeConfig } = await import('vite')
13
- return mergeConfig(config, {
14
- css: {
15
- devSourcemap: true,
16
- },
17
- optimizeDeps: {
18
- ...config.optimizeDeps,
19
- exclude: ['react-native', ...(config.optimizeDeps?.exclude ?? [])],
20
- rolldownOptions: {
21
- ...config.optimizeDeps?.rolldownOptions,
22
- },
23
- },
24
- plugins: [svgr({ include: '**/*.svg' })],
25
- resolve: {
26
- ...config.resolve,
27
- tsconfigPaths: true,
28
- },
29
- ...getMediaProxyServerConfig(),
30
- })
31
- },
32
- core: {
33
- disableTelemetry: true,
34
- disableWhatsNewNotifications: true,
35
- },
36
- tags: ['autodocs'],
37
- }
38
-
39
- export { MAIN_CONFIG_NEXTJS_VITE }
4
+ env: (config) => ({
5
+ ...config,
6
+ REST_BASE_URL: process.env.REST_BASE_URL,
7
+ STORYBOOK_MODE: process.env.STORYBOOK_MODE || '',
8
+ }),
9
+ viteFinal: async (config) => {
10
+ const { mergeConfig } = await import('vite');
11
+ return mergeConfig(config, {
12
+ css: {
13
+ devSourcemap: true,
14
+ },
15
+ optimizeDeps: {
16
+ ...config.optimizeDeps,
17
+ exclude: ['react-native', ...(config.optimizeDeps?.exclude ?? [])],
18
+ rolldownOptions: {
19
+ ...config.optimizeDeps?.rolldownOptions,
20
+ },
21
+ },
22
+ plugins: [svgr({ include: '**/*.svg' })],
23
+ resolve: {
24
+ ...config.resolve,
25
+ tsconfigPaths: true,
26
+ },
27
+ ...getMediaProxyServerConfig(),
28
+ });
29
+ },
30
+ core: {
31
+ disableTelemetry: true,
32
+ disableWhatsNewNotifications: true,
33
+ },
34
+ tags: ['autodocs'],
35
+ };
36
+ export { MAIN_CONFIG_NEXTJS_VITE };
@@ -0,0 +1,9 @@
1
+ declare const MAIN_CONFIG_REACT_NATIVE: {
2
+ viteFinal: (config: any) => Promise<Record<string, any>>;
3
+ core: {
4
+ disableTelemetry: boolean;
5
+ disableWhatsNewNotifications: boolean;
6
+ };
7
+ tags: string[];
8
+ };
9
+ export { MAIN_CONFIG_REACT_NATIVE };
@@ -1,24 +1,22 @@
1
- import svgr from 'vite-plugin-svgr'
2
- import tsconfigPaths from 'vite-tsconfig-paths'
3
-
1
+ import svgr from 'vite-plugin-svgr';
2
+ import tsconfigPaths from 'vite-tsconfig-paths';
4
3
  const MAIN_CONFIG_REACT_NATIVE = {
5
- viteFinal: async (config) => {
6
- const { mergeConfig } = await import('vite')
7
- return mergeConfig(config, {
8
- css: {
9
- devSourcemap: true,
10
- },
11
- optimizeDeps: {
12
- exclude: ['react-native'],
13
- },
14
- plugins: [tsconfigPaths(), svgr({ include: '**/*.svg' })],
15
- })
16
- },
17
- core: {
18
- disableTelemetry: true,
19
- disableWhatsNewNotifications: true,
20
- },
21
- tags: ['autodocs'],
22
- }
23
-
24
- export { MAIN_CONFIG_REACT_NATIVE }
4
+ viteFinal: async (config) => {
5
+ const { mergeConfig } = await import('vite');
6
+ return mergeConfig(config, {
7
+ css: {
8
+ devSourcemap: true,
9
+ },
10
+ optimizeDeps: {
11
+ exclude: ['react-native'],
12
+ },
13
+ plugins: [tsconfigPaths(), svgr({ include: '**/*.svg' })],
14
+ });
15
+ },
16
+ core: {
17
+ disableTelemetry: true,
18
+ disableWhatsNewNotifications: true,
19
+ },
20
+ tags: ['autodocs'],
21
+ };
22
+ export { MAIN_CONFIG_REACT_NATIVE };
@@ -0,0 +1,23 @@
1
+ declare const MAIN_CONFIG_REACT_NATIVE_WEB: {
2
+ viteFinal: (viteConfig: any) => Promise<Record<string, any>>;
3
+ addons: string[];
4
+ core: {
5
+ disableTelemetry: boolean;
6
+ disableWhatsNewNotifications: boolean;
7
+ };
8
+ docs: {
9
+ autodocs: boolean;
10
+ };
11
+ framework: {
12
+ name: string;
13
+ };
14
+ stories: string[];
15
+ typescript: {
16
+ reactDocgen: string;
17
+ reactDocgenTypescriptOptions: {
18
+ propFilter: (prop: any) => boolean;
19
+ shouldExtractLiteralValuesFromEnum: boolean;
20
+ };
21
+ };
22
+ };
23
+ export { MAIN_CONFIG_REACT_NATIVE_WEB };
@@ -1,48 +1,44 @@
1
- import path from 'path'
2
- import { fileURLToPath } from 'url'
3
-
4
- import { mergeConfig } from 'vite'
5
- import babel from 'vite-plugin-babel'
6
-
7
- const __dirname = path.dirname(fileURLToPath(import.meta.url))
8
-
1
+ import path from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import { mergeConfig } from 'vite';
4
+ import babel from 'vite-plugin-babel';
5
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
6
  const MAIN_CONFIG_REACT_NATIVE_WEB = {
10
- viteFinal: async (viteConfig) => {
11
- return mergeConfig(viteConfig, {
12
- plugins: [
13
- babel({
14
- babelConfig: {
15
- babelrc: false,
16
- configFile: path.resolve(__dirname, '../../../babel.config.js'),
17
- },
18
- }),
19
- ],
20
- })
21
- },
22
- addons: ['@storybook/addon-docs'],
23
- core: {
24
- disableTelemetry: true,
25
- disableWhatsNewNotifications: true,
26
- },
27
- docs: {
28
- autodocs: true,
29
- },
30
- framework: {
31
- name: '@storybook/react-native-web-vite',
32
- },
33
- stories: ['../stories/react-native/**/*.stories.?(ts|tsx|js|jsx)'],
34
- typescript: {
35
- reactDocgen: 'react-docgen-typescript',
36
- reactDocgenTypescriptOptions: {
37
- propFilter: (prop) => {
38
- if (prop.parent) {
39
- return !prop.parent.fileName.includes('node_modules')
40
- }
41
- return true
42
- },
43
- shouldExtractLiteralValuesFromEnum: true,
7
+ viteFinal: async (viteConfig) => {
8
+ return mergeConfig(viteConfig, {
9
+ plugins: [
10
+ babel({
11
+ babelConfig: {
12
+ babelrc: false,
13
+ configFile: path.resolve(__dirname, '../../../babel.config.js'),
14
+ },
15
+ }),
16
+ ],
17
+ });
44
18
  },
45
- },
46
- }
47
-
48
- export { MAIN_CONFIG_REACT_NATIVE_WEB }
19
+ addons: ['@storybook/addon-docs'],
20
+ core: {
21
+ disableTelemetry: true,
22
+ disableWhatsNewNotifications: true,
23
+ },
24
+ docs: {
25
+ autodocs: true,
26
+ },
27
+ framework: {
28
+ name: '@storybook/react-native-web-vite',
29
+ },
30
+ stories: ['../stories/react-native/**/*.stories.?(ts|tsx|js|jsx)'],
31
+ typescript: {
32
+ reactDocgen: 'react-docgen-typescript',
33
+ reactDocgenTypescriptOptions: {
34
+ propFilter: (prop) => {
35
+ if (prop.parent) {
36
+ return !prop.parent.fileName.includes('node_modules');
37
+ }
38
+ return true;
39
+ },
40
+ shouldExtractLiteralValuesFromEnum: true,
41
+ },
42
+ },
43
+ };
44
+ export { MAIN_CONFIG_REACT_NATIVE_WEB };
@@ -0,0 +1,9 @@
1
+ declare const MAIN_CONFIG_VITE: {
2
+ viteFinal: (config: any) => Promise<Record<string, any>>;
3
+ core: {
4
+ disableTelemetry: boolean;
5
+ disableWhatsNewNotifications: boolean;
6
+ };
7
+ tags: string[];
8
+ };
9
+ export { MAIN_CONFIG_VITE };
@@ -1,81 +1,76 @@
1
- import path from 'node:path'
2
-
3
- import svgr from 'vite-plugin-svgr'
4
-
5
- import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js'
6
-
1
+ import path from 'node:path';
2
+ import svgr from 'vite-plugin-svgr';
3
+ import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
7
4
  const MAIN_CONFIG_VITE = {
8
- viteFinal: async function (config) {
9
- const { mergeConfig } = await import('vite')
10
- const existingHmr = config.server?.hmr
11
- const existingWatch = config.server?.watch
12
- const projectRoot = process.cwd()
13
- const srcAlias = {
14
- find: 'src',
15
- replacement: path.join(projectRoot, 'src'),
16
- }
17
- const existingAlias = config.resolve?.alias
18
- const alias = Array.isArray(existingAlias)
19
- ? [...existingAlias, srcAlias]
20
- : existingAlias
21
- ? [existingAlias, srcAlias]
22
- : [srcAlias]
23
-
24
- return mergeConfig(config, {
25
- // Включаем source maps для отладки в DevTools
26
- // Для dev режима Vite автоматически генерирует source maps, но нужно явно указать
27
- build: {
28
- ...config.build,
29
- sourcemap: true,
30
- },
31
- css: {
32
- preprocessorOptions: {
33
- scss: {
34
- api: 'modern-compiler',
35
- },
36
- },
37
- },
38
- optimizeDeps: {
39
- ...config.optimizeDeps,
40
- rolldownOptions: {
41
- ...config.optimizeDeps?.rolldownOptions,
42
- },
43
- },
44
- plugins: [svgr({ include: '**/*.svg' })],
45
- resolve: {
46
- ...config.resolve,
47
- alias: alias,
48
- tsconfigPaths: true,
49
- },
50
- root: projectRoot,
51
- // Улучшаем HMR для более быстрого обновления и работы с DevTools
52
- server: {
53
- ...config.server,
54
- hmr: {
55
- ...(existingHmr && typeof existingHmr === 'object'
56
- ? existingHmr
57
- : {}),
58
- overlay: true,
59
- // Убеждаемся, что HMR работает правильно
60
- protocol: 'ws',
61
- },
62
- // Включаем source maps для dev сервера
63
- sourcemapIgnoreList: false,
64
- watch: {
65
- ...(existingWatch && typeof existingWatch === 'object'
66
- ? existingWatch
67
- : {}),
68
- usePolling: false,
69
- },
70
- ...getMediaProxyServerConfig().server,
71
- },
72
- })
73
- },
74
- core: {
75
- disableTelemetry: true,
76
- disableWhatsNewNotifications: true,
77
- },
78
- tags: ['autodocs'],
79
- }
80
-
81
- export { MAIN_CONFIG_VITE }
5
+ viteFinal: async function (config) {
6
+ const { mergeConfig } = await import('vite');
7
+ const existingHmr = config.server?.hmr;
8
+ const existingWatch = config.server?.watch;
9
+ const projectRoot = process.cwd();
10
+ const srcAlias = {
11
+ find: 'src',
12
+ replacement: path.join(projectRoot, 'src'),
13
+ };
14
+ const existingAlias = config.resolve?.alias;
15
+ const alias = Array.isArray(existingAlias)
16
+ ? [...existingAlias, srcAlias]
17
+ : existingAlias
18
+ ? [existingAlias, srcAlias]
19
+ : [srcAlias];
20
+ return mergeConfig(config, {
21
+ // Включаем source maps для отладки в DevTools
22
+ // Для dev режима Vite автоматически генерирует source maps, но нужно явно указать
23
+ build: {
24
+ ...config.build,
25
+ sourcemap: true,
26
+ },
27
+ css: {
28
+ preprocessorOptions: {
29
+ scss: {
30
+ api: 'modern-compiler',
31
+ },
32
+ },
33
+ },
34
+ optimizeDeps: {
35
+ ...config.optimizeDeps,
36
+ rolldownOptions: {
37
+ ...config.optimizeDeps?.rolldownOptions,
38
+ },
39
+ },
40
+ plugins: [svgr({ include: '**/*.svg' })],
41
+ resolve: {
42
+ ...config.resolve,
43
+ alias: alias,
44
+ tsconfigPaths: true,
45
+ },
46
+ root: projectRoot,
47
+ // Улучшаем HMR для более быстрого обновления и работы с DevTools
48
+ server: {
49
+ ...config.server,
50
+ hmr: {
51
+ ...(existingHmr && typeof existingHmr === 'object'
52
+ ? existingHmr
53
+ : {}),
54
+ overlay: true,
55
+ // Убеждаемся, что HMR работает правильно
56
+ protocol: 'ws',
57
+ },
58
+ // Включаем source maps для dev сервера
59
+ sourcemapIgnoreList: false,
60
+ watch: {
61
+ ...(existingWatch && typeof existingWatch === 'object'
62
+ ? existingWatch
63
+ : {}),
64
+ usePolling: false,
65
+ },
66
+ ...getMediaProxyServerConfig().server,
67
+ },
68
+ });
69
+ },
70
+ core: {
71
+ disableTelemetry: true,
72
+ disableWhatsNewNotifications: true,
73
+ },
74
+ tags: ['autodocs'],
75
+ };
76
+ export { MAIN_CONFIG_VITE };
@@ -0,0 +1,9 @@
1
+ declare const MAIN_CONFIG_WEBPACK: {
2
+ webpackFinal: (config: any) => Promise<any>;
3
+ core: {
4
+ disableTelemetry: boolean;
5
+ disableWhatsNewNotifications: boolean;
6
+ };
7
+ tags: string[];
8
+ };
9
+ export { MAIN_CONFIG_WEBPACK };
@@ -1,66 +1,41 @@
1
- import chalk from 'chalk'
2
-
3
- const STORYBOOK_PUBLIC_PATH = null
1
+ import chalk from 'chalk';
2
+ const STORYBOOK_PUBLIC_PATH = null;
4
3
  const WEBPACK_ALIAS = {
5
- src: `${process.cwd()}/src`,
6
- '@itcase/ui-web': `${process.cwd()}/node_modules/@itcase/ui-web/dist`,
7
- '@itcase/ui-core': `${process.cwd()}/node_modules/@itcase/ui-core/dist`,
8
- }
9
-
4
+ src: `${process.cwd()}/src`,
5
+ '@itcase/ui-core': `${process.cwd()}/node_modules/@itcase/ui-core/dist`,
6
+ '@itcase/ui-web': `${process.cwd()}/node_modules/@itcase/ui-web/dist`,
7
+ };
10
8
  const MAIN_CONFIG_WEBPACK = {
11
- webpackFinal: async (config) => {
12
- console.log(
13
- chalk.green(
14
- 'info =>',
15
- chalk.white(
16
- 'Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one',
17
- ),
18
- ),
19
- )
20
-
21
- if (STORYBOOK_PUBLIC_PATH) {
22
- config.output.publicPath = STORYBOOK_PUBLIC_PATH
23
- }
24
- // @svgr/webpack
25
- const imageRule = config.module?.rules?.find((rule) => {
26
- const test = rule.test
27
- if (!test) {
28
- return false
29
- }
30
- return test.test('.svg')
31
- })
32
-
33
- imageRule.exclude = /\.svg$/
34
-
35
- config.module?.rules?.push({
36
- test: /\.svg$/,
37
- use: ['@svgr/webpack'],
38
- })
39
-
40
- // update webpack alias
41
- console.log(
42
- chalk.green(
43
- 'info =>',
44
- chalk.white('Using default "WEBPACK_ALIAS" from'),
45
- chalk.cyan('src'),
46
- chalk.white('to'),
47
- chalk.cyan(`${process.cwd()}/src`),
48
- chalk.white('change it to use another one'),
49
- ),
50
- )
51
-
52
- config.resolve.alias = {
53
- ...config.resolve.alias,
54
- ...WEBPACK_ALIAS,
55
- }
56
-
57
- return config
58
- },
59
- core: {
60
- disableTelemetry: true,
61
- disableWhatsNewNotifications: true,
62
- },
63
- tags: ['autodocs'],
64
- }
65
-
66
- export { MAIN_CONFIG_WEBPACK }
9
+ webpackFinal: async (config) => {
10
+ console.log(chalk.green('info =>', chalk.white('Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one')));
11
+ if (STORYBOOK_PUBLIC_PATH) {
12
+ config.output.publicPath = STORYBOOK_PUBLIC_PATH;
13
+ }
14
+ // @svgr/webpack
15
+ const imageRule = config.module?.rules?.find((rule) => {
16
+ const test = rule.test;
17
+ if (!test) {
18
+ return false;
19
+ }
20
+ return test.test('.svg');
21
+ });
22
+ imageRule.exclude = /\.svg$/;
23
+ config.module?.rules?.push({
24
+ test: /\.svg$/,
25
+ use: ['@svgr/webpack'],
26
+ });
27
+ // update webpack alias
28
+ console.log(chalk.green('info =>', chalk.white('Using default "WEBPACK_ALIAS" from'), chalk.cyan('src'), chalk.white('to'), chalk.cyan(`${process.cwd()}/src`), chalk.white('change it to use another one')));
29
+ config.resolve.alias = {
30
+ ...config.resolve.alias,
31
+ ...WEBPACK_ALIAS,
32
+ };
33
+ return config;
34
+ },
35
+ core: {
36
+ disableTelemetry: true,
37
+ disableWhatsNewNotifications: true,
38
+ },
39
+ tags: ['autodocs'],
40
+ };
41
+ export { MAIN_CONFIG_WEBPACK };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_NEXTJS: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_NEXTJS };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_NEXTJS = {
2
- framework: '@storybook/nextjs',
3
- }
4
-
5
- export { FRAMEWORK_NEXTJS }
2
+ framework: '@storybook/nextjs',
3
+ };
4
+ export { FRAMEWORK_NEXTJS };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_NEXTJS_VITE: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_NEXTJS_VITE };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_NEXTJS_VITE = {
2
- framework: '@storybook/nextjs-vite',
3
- }
4
-
5
- export { FRAMEWORK_NEXTJS_VITE }
2
+ framework: '@storybook/nextjs-vite',
3
+ };
4
+ export { FRAMEWORK_NEXTJS_VITE };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_REACT_NATIVE: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_REACT_NATIVE = {
2
- framework: '@storybook/react-native',
3
- }
4
-
5
- export { FRAMEWORK_REACT_NATIVE }
2
+ framework: '@storybook/react-native',
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_REACT_NATIVE_WEB: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE_WEB };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_REACT_NATIVE_WEB = {
2
- framework: '@storybook/react-native-web-vite',
3
- }
4
-
5
- export { FRAMEWORK_REACT_NATIVE_WEB }
2
+ framework: '@storybook/react-native-web-vite',
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE_WEB };