@itcase/storybook-config 1.2.82 → 1.2.83

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.
@@ -1,11 +1,35 @@
1
1
  import path from 'node:path';
2
2
  import svgr from 'vite-plugin-svgr';
3
3
  import { getMediaProxyServerConfig } from '../vite/getMediaProxyServerConfig.js';
4
+ const WS_OPTION_KEYS = [
5
+ 'protocol',
6
+ 'host',
7
+ 'port',
8
+ 'path',
9
+ 'clientPort',
10
+ 'timeout',
11
+ 'server',
12
+ ];
13
+ function splitHmrAndWsOptions(hmr) {
14
+ if (!hmr || typeof hmr !== 'object') {
15
+ return { hmrRest: {}, wsFromHmr: {} };
16
+ }
17
+ const hmrRest = { ...hmr };
18
+ const wsFromHmr = {};
19
+ for (const key of WS_OPTION_KEYS) {
20
+ if (key in hmrRest) {
21
+ wsFromHmr[key] = hmrRest[key];
22
+ delete hmrRest[key];
23
+ }
24
+ }
25
+ return { hmrRest, wsFromHmr };
26
+ }
4
27
  const MAIN_CONFIG_VITE = {
5
28
  viteFinal: async function (config) {
6
29
  const { mergeConfig } = await import('vite');
7
- const existingHmr = config.server?.hmr;
8
30
  const existingWatch = config.server?.watch;
31
+ const existingWs = config.server?.ws;
32
+ const { hmrRest, wsFromHmr } = splitHmrAndWsOptions(config.server?.hmr);
9
33
  const projectRoot = process.cwd();
10
34
  const srcAlias = {
11
35
  find: 'src',
@@ -48,12 +72,8 @@ const MAIN_CONFIG_VITE = {
48
72
  server: {
49
73
  ...config.server,
50
74
  hmr: {
51
- ...(existingHmr && typeof existingHmr === 'object'
52
- ? existingHmr
53
- : {}),
75
+ ...hmrRest,
54
76
  overlay: true,
55
- // Убеждаемся, что HMR работает правильно
56
- protocol: 'ws',
57
77
  },
58
78
  // Включаем source maps для dev сервера
59
79
  sourcemapIgnoreList: false,
@@ -63,6 +83,12 @@ const MAIN_CONFIG_VITE = {
63
83
  : {}),
64
84
  usePolling: false,
65
85
  },
86
+ // Vite 8.1+: WebSocket options live under `server.ws`, not `server.hmr`
87
+ ws: {
88
+ ...(existingWs && typeof existingWs === 'object' ? existingWs : {}),
89
+ ...wsFromHmr,
90
+ protocol: 'ws',
91
+ },
66
92
  ...getMediaProxyServerConfig().server,
67
93
  },
68
94
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "author": "ITCase",
5
5
  "description": "Storybook configuration package",
6
6
  "engines": {
@@ -95,7 +95,7 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@gorhom/bottom-sheet": "^5.2.14",
98
- "@itcase/config": "^1.6.61",
98
+ "@itcase/config": "^1.6.63",
99
99
  "@itcase/storybook-addon-auth": "^1.0.5",
100
100
  "@react-native-async-storage/async-storage": "^3.1.1",
101
101
  "@react-native-community/datetimepicker": "^9.1.0",
@@ -135,7 +135,7 @@
135
135
  "react-native-safe-area-context": "^5.8.1",
136
136
  "react-native-svg": "^15.15.5",
137
137
  "react-native-web": "^0.21.2",
138
- "react-native-worklets": "^0.11.3",
138
+ "react-native-worklets": "^0.11.4",
139
139
  "storybook": "^10.5.7",
140
140
  "storybook-addon-source-link": "^2.0.1",
141
141
  "vite": "^8.2.1",
@@ -152,17 +152,17 @@
152
152
  "@babel/runtime": "^8.0.0",
153
153
  "@commitlint/cli": "^21.2.1",
154
154
  "@commitlint/config-conventional": "^21.2.0",
155
- "@itcase/common": "^1.2.50",
155
+ "@itcase/common": "^1.2.51",
156
156
  "@itcase/lint": "^1.1.121",
157
- "@itcase/ui-core": "^1.10.66",
158
- "@itcase/ui-web": "^1.10.66",
157
+ "@itcase/ui-core": "^1.10.71",
158
+ "@itcase/ui-web": "^1.10.72",
159
159
  "@react-native-community/cli": "20.2.0",
160
160
  "@react-native-community/cli-platform-android": "20.2.0",
161
161
  "@react-native-community/cli-platform-ios": "20.2.0",
162
- "@react-native/babel-preset": "0.86.2",
163
- "@react-native/eslint-config": "0.86.2",
164
- "@react-native/metro-config": "0.86.2",
165
- "@react-native/typescript-config": "0.86.2",
162
+ "@react-native/babel-preset": "0.87.0",
163
+ "@react-native/eslint-config": "0.87.0",
164
+ "@react-native/metro-config": "0.87.0",
165
+ "@react-native/typescript-config": "0.87.0",
166
166
  "@rollup/plugin-babel": "^7.1.0",
167
167
  "@rollup/plugin-commonjs": "^29.0.3",
168
168
  "@rollup/plugin-json": "^6.1.0",
@@ -171,7 +171,7 @@
171
171
  "@types/react": "^18",
172
172
  "@types/react-dom": "^18",
173
173
  "babel-plugin-transform-inline-environment-variables": "^0.4.4",
174
- "conventional-changelog-conventionalcommits": "^10.2.1",
174
+ "conventional-changelog-conventionalcommits": "^10.3.0",
175
175
  "eslint": "9.39.2",
176
176
  "glob": "^13.0.6",
177
177
  "husky": "^9.1.7",
@@ -182,7 +182,7 @@
182
182
  "react-docgen": "^8.0.3",
183
183
  "react-docgen-typescript": "^2.4.0",
184
184
  "react-dom": "^18",
185
- "react-native": "0.86.2",
185
+ "react-native": "0.87.0",
186
186
  "react-native-web": "^0.21.2",
187
187
  "rollup": "^4.62.4",
188
188
  "rollup-plugin-copy": "^3.5.0",