storybook 9.1.0-alpha.0 → 9.1.0-alpha.10
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/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -1
- package/dist/actions/index.cjs +16 -16
- package/dist/actions/index.d.ts +1 -38
- package/dist/actions/index.js +12 -12
- package/dist/bin/index.cjs +62 -69
- package/dist/bin/index.js +43 -50
- package/dist/builder-manager/index.cjs +379 -378
- package/dist/builder-manager/index.d.ts +567 -2
- package/dist/builder-manager/index.js +280 -279
- package/dist/cli/bin/index.cjs +945 -945
- package/dist/cli/bin/index.js +673 -672
- package/dist/cli/index.cjs +14965 -14973
- package/dist/cli/index.d.ts +713 -15
- package/dist/cli/index.js +13488 -13495
- package/dist/common/index.cjs +11211 -11103
- package/dist/common/index.d.ts +351 -72
- package/dist/common/index.js +18491 -18379
- package/dist/components/index.cjs +4606 -4425
- package/dist/components/index.d.ts +11 -12
- package/dist/components/index.js +3020 -2834
- package/dist/controls/index.cjs +16 -16
- package/dist/controls/index.d.ts +1 -36
- package/dist/core-server/index.cjs +6690 -6624
- package/dist/core-server/index.d.ts +14 -2
- package/dist/core-server/index.js +6088 -6023
- package/dist/core-server/presets/common-manager.js +3582 -3475
- package/dist/core-server/presets/common-preset.cjs +85015 -5213
- package/dist/core-server/presets/common-preset.js +85107 -5291
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs +28728 -0
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +28729 -0
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs +29339 -0
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +29340 -0
- package/dist/csf/index.cjs +3019 -104
- package/dist/csf/index.d.ts +301 -18
- package/dist/csf/index.js +3031 -98
- package/dist/csf-tools/index.cjs +489 -488
- package/dist/csf-tools/index.js +311 -309
- package/dist/highlight/index.cjs +15 -15
- package/dist/highlight/index.d.ts +1 -12
- package/dist/highlight/index.js +4 -4
- package/dist/instrumenter/index.cjs +1308 -1239
- package/dist/instrumenter/index.d.ts +25 -3
- package/dist/instrumenter/index.js +1345 -1280
- package/dist/manager/globals-module-info.cjs +1 -1
- package/dist/manager/globals-module-info.js +1 -1
- package/dist/manager/globals-runtime.js +42257 -44665
- package/dist/manager/runtime.js +3715 -3536
- package/dist/manager-api/index.cjs +74 -74
- package/dist/manager-api/index.d.ts +4 -1
- package/dist/manager-api/index.js +142 -142
- package/dist/node-logger/index.cjs +8520 -994
- package/dist/node-logger/index.d.ts +395 -2
- package/dist/node-logger/index.js +8535 -995
- package/dist/preview/runtime.js +13701 -16331
- package/dist/preview-api/index.cjs +1434 -1458
- package/dist/preview-api/index.d.ts +13 -10
- package/dist/preview-api/index.js +950 -976
- package/dist/server-errors.cjs +201 -242
- package/dist/server-errors.d.ts +1 -12
- package/dist/server-errors.js +182 -223
- package/dist/telemetry/index.cjs +1919 -1638
- package/dist/telemetry/index.d.ts +4 -2
- package/dist/telemetry/index.js +1972 -1690
- package/dist/test/index.cjs +9184 -9816
- package/dist/test/index.d.ts +8 -1
- package/dist/test/index.js +8390 -9029
- package/dist/types/index.d.ts +19 -17
- package/dist/viewport/index.cjs +17 -24
- package/dist/viewport/index.d.ts +9 -532
- package/dist/viewport/index.js +9 -16
- package/package.json +18 -187
- package/templates/mocker-runtime.template.js +89 -0
- package/dist/actions/preview.cjs +0 -159
- package/dist/actions/preview.d.ts +0 -555
- package/dist/actions/preview.js +0 -149
- package/dist/backgrounds/index.cjs +0 -148
- package/dist/backgrounds/index.d.ts +0 -592
- package/dist/backgrounds/index.js +0 -130
- package/dist/backgrounds/preview.cjs +0 -143
- package/dist/backgrounds/preview.d.ts +0 -555
- package/dist/backgrounds/preview.js +0 -127
- package/dist/component-testing/index.cjs +0 -23
- package/dist/component-testing/index.d.ts +0 -3
- package/dist/component-testing/index.js +0 -5
- package/dist/component-testing/preview.cjs +0 -40
- package/dist/component-testing/preview.d.ts +0 -5
- package/dist/component-testing/preview.js +0 -25
- package/dist/controls/preview.cjs +0 -26
- package/dist/controls/preview.d.ts +0 -555
- package/dist/controls/preview.js +0 -9
- package/dist/highlight/preview.cjs +0 -590
- package/dist/highlight/preview.d.ts +0 -555
- package/dist/highlight/preview.js +0 -574
- package/dist/measure/index.cjs +0 -476
- package/dist/measure/index.d.ts +0 -567
- package/dist/measure/index.js +0 -464
- package/dist/measure/preview.cjs +0 -466
- package/dist/measure/preview.d.ts +0 -560
- package/dist/measure/preview.js +0 -450
- package/dist/outline/index.cjs +0 -528
- package/dist/outline/index.d.ts +0 -567
- package/dist/outline/index.js +0 -500
- package/dist/outline/preview.cjs +0 -518
- package/dist/outline/preview.d.ts +0 -560
- package/dist/outline/preview.js +0 -486
- package/dist/test/preview.cjs +0 -73
- package/dist/test/preview.d.ts +0 -555
- package/dist/test/preview.js +0 -66
- package/dist/viewport/preview.cjs +0 -35
- package/dist/viewport/preview.d.ts +0 -569
- package/dist/viewport/preview.js +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook",
|
|
3
|
-
"version": "9.1.0-alpha.
|
|
3
|
+
"version": "9.1.0-alpha.10",
|
|
4
4
|
"description": "Storybook framework-agnostic API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -83,65 +83,13 @@
|
|
|
83
83
|
"import": "./dist/core-server/presets/common-override-preset.js",
|
|
84
84
|
"require": "./dist/core-server/presets/common-override-preset.cjs"
|
|
85
85
|
},
|
|
86
|
-
"./internal/
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"import": "./dist/backgrounds/index.js",
|
|
94
|
-
"require": "./dist/backgrounds/index.cjs"
|
|
95
|
-
},
|
|
96
|
-
"./internal/backgrounds/preview": {
|
|
97
|
-
"types": "./dist/backgrounds/preview.d.ts",
|
|
98
|
-
"import": "./dist/backgrounds/preview.js",
|
|
99
|
-
"require": "./dist/backgrounds/preview.cjs"
|
|
100
|
-
},
|
|
101
|
-
"./backgrounds/preview": {
|
|
102
|
-
"types": "./dist/backgrounds/preview.d.ts",
|
|
103
|
-
"import": "./dist/backgrounds/preview.js",
|
|
104
|
-
"require": "./dist/backgrounds/preview.cjs"
|
|
105
|
-
},
|
|
106
|
-
"./internal/measure": {
|
|
107
|
-
"types": "./dist/measure/index.d.ts",
|
|
108
|
-
"import": "./dist/measure/index.js",
|
|
109
|
-
"require": "./dist/measure/index.cjs"
|
|
110
|
-
},
|
|
111
|
-
"./measure": {
|
|
112
|
-
"types": "./dist/measure/index.d.ts",
|
|
113
|
-
"import": "./dist/measure/index.js",
|
|
114
|
-
"require": "./dist/measure/index.cjs"
|
|
115
|
-
},
|
|
116
|
-
"./internal/measure/preview": {
|
|
117
|
-
"types": "./dist/measure/preview.d.ts",
|
|
118
|
-
"import": "./dist/measure/preview.js",
|
|
119
|
-
"require": "./dist/measure/preview.cjs"
|
|
120
|
-
},
|
|
121
|
-
"./measure/preview": {
|
|
122
|
-
"types": "./dist/measure/preview.d.ts",
|
|
123
|
-
"import": "./dist/measure/preview.js",
|
|
124
|
-
"require": "./dist/measure/preview.cjs"
|
|
125
|
-
},
|
|
126
|
-
"./internal/outline": {
|
|
127
|
-
"types": "./dist/outline/index.d.ts",
|
|
128
|
-
"import": "./dist/outline/index.js",
|
|
129
|
-
"require": "./dist/outline/index.cjs"
|
|
130
|
-
},
|
|
131
|
-
"./outline": {
|
|
132
|
-
"types": "./dist/outline/index.d.ts",
|
|
133
|
-
"import": "./dist/outline/index.js",
|
|
134
|
-
"require": "./dist/outline/index.cjs"
|
|
135
|
-
},
|
|
136
|
-
"./internal/outline/preview": {
|
|
137
|
-
"types": "./dist/outline/preview.d.ts",
|
|
138
|
-
"import": "./dist/outline/preview.js",
|
|
139
|
-
"require": "./dist/outline/preview.cjs"
|
|
140
|
-
},
|
|
141
|
-
"./outline/preview": {
|
|
142
|
-
"types": "./dist/outline/preview.d.ts",
|
|
143
|
-
"import": "./dist/outline/preview.js",
|
|
144
|
-
"require": "./dist/outline/preview.cjs"
|
|
86
|
+
"./internal/core-server/presets/webpack/loaders/webpack-automock-loader": {
|
|
87
|
+
"import": "./dist/core-server/presets/webpack/loaders/webpack-automock-loader.js",
|
|
88
|
+
"require": "./dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs"
|
|
89
|
+
},
|
|
90
|
+
"./internal/core-server/presets/webpack/loaders/storybook-mock-transform-loader": {
|
|
91
|
+
"import": "./dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js",
|
|
92
|
+
"require": "./dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs"
|
|
145
93
|
},
|
|
146
94
|
"./internal/highlight": {
|
|
147
95
|
"types": "./dist/highlight/index.d.ts",
|
|
@@ -153,16 +101,6 @@
|
|
|
153
101
|
"import": "./dist/highlight/index.js",
|
|
154
102
|
"require": "./dist/highlight/index.cjs"
|
|
155
103
|
},
|
|
156
|
-
"./internal/highlight/preview": {
|
|
157
|
-
"types": "./dist/highlight/preview.d.ts",
|
|
158
|
-
"import": "./dist/highlight/preview.js",
|
|
159
|
-
"require": "./dist/highlight/preview.cjs"
|
|
160
|
-
},
|
|
161
|
-
"./highlight/preview": {
|
|
162
|
-
"types": "./dist/highlight/preview.d.ts",
|
|
163
|
-
"import": "./dist/highlight/preview.js",
|
|
164
|
-
"require": "./dist/highlight/preview.cjs"
|
|
165
|
-
},
|
|
166
104
|
"./internal/actions": {
|
|
167
105
|
"types": "./dist/actions/index.d.ts",
|
|
168
106
|
"import": "./dist/actions/index.js",
|
|
@@ -173,16 +111,6 @@
|
|
|
173
111
|
"import": "./dist/actions/index.js",
|
|
174
112
|
"require": "./dist/actions/index.cjs"
|
|
175
113
|
},
|
|
176
|
-
"./internal/actions/preview": {
|
|
177
|
-
"types": "./dist/actions/preview.d.ts",
|
|
178
|
-
"import": "./dist/actions/preview.js",
|
|
179
|
-
"require": "./dist/actions/preview.cjs"
|
|
180
|
-
},
|
|
181
|
-
"./actions/preview": {
|
|
182
|
-
"types": "./dist/actions/preview.d.ts",
|
|
183
|
-
"import": "./dist/actions/preview.js",
|
|
184
|
-
"require": "./dist/actions/preview.cjs"
|
|
185
|
-
},
|
|
186
114
|
"./internal/actions/decorator": {
|
|
187
115
|
"types": "./dist/actions/decorator.d.ts",
|
|
188
116
|
"import": "./dist/actions/decorator.js"
|
|
@@ -191,16 +119,6 @@
|
|
|
191
119
|
"types": "./dist/actions/decorator.d.ts",
|
|
192
120
|
"import": "./dist/actions/decorator.js"
|
|
193
121
|
},
|
|
194
|
-
"./internal/component-testing": {
|
|
195
|
-
"types": "./dist/component-testing/index.d.ts",
|
|
196
|
-
"import": "./dist/component-testing/index.js",
|
|
197
|
-
"require": "./dist/component-testing/index.cjs"
|
|
198
|
-
},
|
|
199
|
-
"./internal/component-testing/preview": {
|
|
200
|
-
"types": "./dist/component-testing/preview.d.ts",
|
|
201
|
-
"import": "./dist/component-testing/preview.js",
|
|
202
|
-
"require": "./dist/component-testing/preview.cjs"
|
|
203
|
-
},
|
|
204
122
|
"./internal/viewport": {
|
|
205
123
|
"types": "./dist/viewport/index.d.ts",
|
|
206
124
|
"import": "./dist/viewport/index.js",
|
|
@@ -211,26 +129,11 @@
|
|
|
211
129
|
"import": "./dist/viewport/index.js",
|
|
212
130
|
"require": "./dist/viewport/index.cjs"
|
|
213
131
|
},
|
|
214
|
-
"./internal/viewport/preview": {
|
|
215
|
-
"types": "./dist/viewport/preview.d.ts",
|
|
216
|
-
"import": "./dist/viewport/preview.js",
|
|
217
|
-
"require": "./dist/viewport/preview.cjs"
|
|
218
|
-
},
|
|
219
|
-
"./viewport/preview": {
|
|
220
|
-
"types": "./dist/viewport/preview.d.ts",
|
|
221
|
-
"import": "./dist/viewport/preview.js",
|
|
222
|
-
"require": "./dist/viewport/preview.cjs"
|
|
223
|
-
},
|
|
224
132
|
"./internal/controls": {
|
|
225
133
|
"types": "./dist/controls/index.d.ts",
|
|
226
134
|
"import": "./dist/controls/index.js",
|
|
227
135
|
"require": "./dist/controls/index.cjs"
|
|
228
136
|
},
|
|
229
|
-
"./internal/controls/preview": {
|
|
230
|
-
"types": "./dist/controls/preview.d.ts",
|
|
231
|
-
"import": "./dist/controls/preview.js",
|
|
232
|
-
"require": "./dist/controls/preview.cjs"
|
|
233
|
-
},
|
|
234
137
|
"./internal/controls/decorator": {
|
|
235
138
|
"types": "./dist/controls/decorator.d.ts",
|
|
236
139
|
"import": "./dist/controls/decorator.js"
|
|
@@ -363,16 +266,6 @@
|
|
|
363
266
|
"import": "./dist/instrumenter/index.js",
|
|
364
267
|
"require": "./dist/instrumenter/index.cjs"
|
|
365
268
|
},
|
|
366
|
-
"./internal/test/preview": {
|
|
367
|
-
"types": "./dist/test/preview.d.ts",
|
|
368
|
-
"import": "./dist/test/preview.js",
|
|
369
|
-
"require": "./dist/test/preview.cjs"
|
|
370
|
-
},
|
|
371
|
-
"./test/preview": {
|
|
372
|
-
"types": "./dist/test/preview.d.ts",
|
|
373
|
-
"import": "./dist/test/preview.js",
|
|
374
|
-
"require": "./dist/test/preview.cjs"
|
|
375
|
-
},
|
|
376
269
|
"./internal/test": {
|
|
377
270
|
"types": "./dist/test/index.d.ts",
|
|
378
271
|
"import": "./dist/test/index.js",
|
|
@@ -389,6 +282,7 @@
|
|
|
389
282
|
"./internal/manager/globals-runtime": {
|
|
390
283
|
"import": "./dist/manager/globals-runtime.js"
|
|
391
284
|
},
|
|
285
|
+
"./bin/index.cjs": "./bin/index.cjs",
|
|
392
286
|
"./package.json": "./package.json",
|
|
393
287
|
"./internal/package.json": "./package.json"
|
|
394
288
|
},
|
|
@@ -421,96 +315,33 @@
|
|
|
421
315
|
"internal/core-server": [
|
|
422
316
|
"./dist/core-server/index.d.ts"
|
|
423
317
|
],
|
|
424
|
-
"internal/backgrounds": [
|
|
425
|
-
"./dist/backgrounds/index.d.ts"
|
|
426
|
-
],
|
|
427
|
-
"backgrounds": [
|
|
428
|
-
"./dist/backgrounds/index.d.ts"
|
|
429
|
-
],
|
|
430
|
-
"internal/backgrounds/preview": [
|
|
431
|
-
"./dist/backgrounds/preview.d.ts"
|
|
432
|
-
],
|
|
433
|
-
"backgrounds/preview": [
|
|
434
|
-
"./dist/backgrounds/preview.d.ts"
|
|
435
|
-
],
|
|
436
|
-
"internal/measure": [
|
|
437
|
-
"./dist/measure/index.d.ts"
|
|
438
|
-
],
|
|
439
|
-
"measure": [
|
|
440
|
-
"./dist/measure/index.d.ts"
|
|
441
|
-
],
|
|
442
|
-
"internal/measure/preview": [
|
|
443
|
-
"./dist/measure/preview.d.ts"
|
|
444
|
-
],
|
|
445
|
-
"measure/preview": [
|
|
446
|
-
"./dist/measure/preview.d.ts"
|
|
447
|
-
],
|
|
448
|
-
"internal/outline": [
|
|
449
|
-
"./dist/outline/index.d.ts"
|
|
450
|
-
],
|
|
451
|
-
"outline": [
|
|
452
|
-
"./dist/outline/index.d.ts"
|
|
453
|
-
],
|
|
454
|
-
"internal/outline/preview": [
|
|
455
|
-
"./dist/outline/preview.d.ts"
|
|
456
|
-
],
|
|
457
|
-
"outline/preview": [
|
|
458
|
-
"./dist/outline/preview.d.ts"
|
|
459
|
-
],
|
|
460
318
|
"internal/highlight": [
|
|
461
319
|
"./dist/highlight/index.d.ts"
|
|
462
320
|
],
|
|
463
321
|
"highlight": [
|
|
464
322
|
"./dist/highlight/index.d.ts"
|
|
465
323
|
],
|
|
466
|
-
"internal/highlight/preview": [
|
|
467
|
-
"./dist/highlight/preview.d.ts"
|
|
468
|
-
],
|
|
469
|
-
"highlight/preview": [
|
|
470
|
-
"./dist/highlight/preview.d.ts"
|
|
471
|
-
],
|
|
472
324
|
"internal/actions": [
|
|
473
325
|
"./dist/actions/index.d.ts"
|
|
474
326
|
],
|
|
475
327
|
"actions": [
|
|
476
328
|
"./dist/actions/index.d.ts"
|
|
477
329
|
],
|
|
478
|
-
"internal/actions/preview": [
|
|
479
|
-
"./dist/actions/preview.d.ts"
|
|
480
|
-
],
|
|
481
|
-
"actions/preview": [
|
|
482
|
-
"./dist/actions/preview.d.ts"
|
|
483
|
-
],
|
|
484
330
|
"internal/actions/decorator": [
|
|
485
331
|
"./dist/actions/decorator.d.ts"
|
|
486
332
|
],
|
|
487
333
|
"actions/decorator": [
|
|
488
334
|
"./dist/actions/decorator.d.ts"
|
|
489
335
|
],
|
|
490
|
-
"internal/component-testing": [
|
|
491
|
-
"./dist/component-testing/index.d.ts"
|
|
492
|
-
],
|
|
493
|
-
"internal/component-testing/preview": [
|
|
494
|
-
"./dist/component-testing/preview.d.ts"
|
|
495
|
-
],
|
|
496
336
|
"internal/viewport": [
|
|
497
337
|
"./dist/viewport/index.d.ts"
|
|
498
338
|
],
|
|
499
339
|
"viewport": [
|
|
500
340
|
"./dist/viewport/index.d.ts"
|
|
501
341
|
],
|
|
502
|
-
"internal/viewport/preview": [
|
|
503
|
-
"./dist/viewport/preview.d.ts"
|
|
504
|
-
],
|
|
505
|
-
"viewport/preview": [
|
|
506
|
-
"./dist/viewport/preview.d.ts"
|
|
507
|
-
],
|
|
508
342
|
"internal/controls": [
|
|
509
343
|
"./dist/controls/index.d.ts"
|
|
510
344
|
],
|
|
511
|
-
"internal/controls/preview": [
|
|
512
|
-
"./dist/controls/preview.d.ts"
|
|
513
|
-
],
|
|
514
345
|
"internal/controls/decorator": [
|
|
515
346
|
"./dist/controls/decorator.d.ts"
|
|
516
347
|
],
|
|
@@ -589,12 +420,6 @@
|
|
|
589
420
|
"internal/instrumenter": [
|
|
590
421
|
"./dist/instrumenter/index.d.ts"
|
|
591
422
|
],
|
|
592
|
-
"internal/test/preview": [
|
|
593
|
-
"./dist/test/preview.d.ts"
|
|
594
|
-
],
|
|
595
|
-
"test/preview": [
|
|
596
|
-
"./dist/test/preview.d.ts"
|
|
597
|
-
],
|
|
598
423
|
"internal/test": [
|
|
599
424
|
"./dist/test/index.d.ts"
|
|
600
425
|
],
|
|
@@ -607,6 +432,7 @@
|
|
|
607
432
|
"files": [
|
|
608
433
|
"dist/**/*",
|
|
609
434
|
"assets/**/*",
|
|
435
|
+
"templates/**/*",
|
|
610
436
|
"README.md",
|
|
611
437
|
"!src/**/*"
|
|
612
438
|
],
|
|
@@ -621,8 +447,9 @@
|
|
|
621
447
|
"@storybook/global": "^5.0.0",
|
|
622
448
|
"@testing-library/jest-dom": "^6.6.3",
|
|
623
449
|
"@testing-library/user-event": "^14.6.1",
|
|
624
|
-
"@vitest/expect": "3.
|
|
625
|
-
"@vitest/
|
|
450
|
+
"@vitest/expect": "3.2.4",
|
|
451
|
+
"@vitest/mocker": "3.2.4",
|
|
452
|
+
"@vitest/spy": "3.2.4",
|
|
626
453
|
"better-opn": "^3.0.2",
|
|
627
454
|
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0",
|
|
628
455
|
"esbuild-register": "^3.5.0",
|
|
@@ -637,6 +464,7 @@
|
|
|
637
464
|
"@babel/parser": "^7.26.9",
|
|
638
465
|
"@babel/traverse": "^7.26.9",
|
|
639
466
|
"@babel/types": "^7.26.8",
|
|
467
|
+
"@clack/prompts": "^1.0.0-alpha.0",
|
|
640
468
|
"@devtools-ds/object-inspector": "^1.1.2",
|
|
641
469
|
"@discoveryjs/json-ext": "^0.5.3",
|
|
642
470
|
"@emotion/cache": "^11.14.0",
|
|
@@ -650,6 +478,7 @@
|
|
|
650
478
|
"@radix-ui/react-dialog": "^1.1.2",
|
|
651
479
|
"@radix-ui/react-scroll-area": "1.2.0-rc.7",
|
|
652
480
|
"@radix-ui/react-slot": "^1.0.2",
|
|
481
|
+
"@rolldown/pluginutils": "1.0.0-beta.18",
|
|
653
482
|
"@storybook/docs-mdx": "4.0.0-next.1",
|
|
654
483
|
"@storybook/icons": "^1.4.0",
|
|
655
484
|
"@tanstack/react-virtual": "^3.3.0",
|
|
@@ -661,6 +490,7 @@
|
|
|
661
490
|
"@types/ejs": "^3.1.1",
|
|
662
491
|
"@types/find-cache-dir": "^5.0.0",
|
|
663
492
|
"@types/js-yaml": "^4.0.5",
|
|
493
|
+
"@types/lodash": "^4.17.13",
|
|
664
494
|
"@types/node": "^22.0.0",
|
|
665
495
|
"@types/npmlog": "^7.0.0",
|
|
666
496
|
"@types/picomatch": "^2.3.0",
|
|
@@ -671,7 +501,7 @@
|
|
|
671
501
|
"@types/react-transition-group": "^4",
|
|
672
502
|
"@types/semver": "^7.5.8",
|
|
673
503
|
"@types/ws": "^8",
|
|
674
|
-
"@vitest/utils": "^3.
|
|
504
|
+
"@vitest/utils": "^3.2.4",
|
|
675
505
|
"@yarnpkg/esbuild-plugin-pnp": "^3.0.0-rc.10",
|
|
676
506
|
"@yarnpkg/fslib": "2.10.3",
|
|
677
507
|
"@yarnpkg/libzip": "2.3.0",
|
|
@@ -710,6 +540,7 @@
|
|
|
710
540
|
"jsdoc-type-pratt-parser": "^4.0.0",
|
|
711
541
|
"lazy-universal-dotenv": "^4.0.0",
|
|
712
542
|
"leven": "^4.0.0",
|
|
543
|
+
"lodash": "^4.17.21",
|
|
713
544
|
"memfs": "^4.11.1",
|
|
714
545
|
"memoizerific": "^1.11.3",
|
|
715
546
|
"nanoid": "^4.0.2",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { MockerRegistry } from '@vitest/mocker';
|
|
2
|
+
import { ModuleMocker, createCompilerHints } from '@vitest/mocker/browser';
|
|
3
|
+
|
|
4
|
+
/** An interceptor for module mocking. */
|
|
5
|
+
export class ModuleMockerInterceptor {
|
|
6
|
+
// A registry for runtime mocks (e.g., `sb.mock('path', () => ({}))`)
|
|
7
|
+
mocks = new MockerRegistry();
|
|
8
|
+
|
|
9
|
+
constructor() {}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Called by ModuleMocker when `sb.mock()` is executed. We just store the mock in our registry.
|
|
13
|
+
* The dynamic MSW handler will pick it up on the next relevant network request. Currently, we
|
|
14
|
+
* don't use this.mocks in any way. Mocks will be registered in the user's preview file and live
|
|
15
|
+
* until the end. There is no way to invalidate or delete them.
|
|
16
|
+
*/
|
|
17
|
+
async register(module) {
|
|
18
|
+
this.mocks.add(module);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async delete(url) {
|
|
22
|
+
this.mocks.delete(url);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async invalidate() {
|
|
26
|
+
this.mocks.clear();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Dummy implementation of the RPC interface, since it is not used in build mode.
|
|
31
|
+
const rpc = (method) => {
|
|
32
|
+
switch (method) {
|
|
33
|
+
case 'resolveId':
|
|
34
|
+
return Promise.resolve({
|
|
35
|
+
id: '',
|
|
36
|
+
url: '',
|
|
37
|
+
optimized: false,
|
|
38
|
+
});
|
|
39
|
+
case 'resolveMock':
|
|
40
|
+
return Promise.resolve({
|
|
41
|
+
mockType: 'dummy',
|
|
42
|
+
resolvedId: '',
|
|
43
|
+
resolvedUrl: '',
|
|
44
|
+
redirectUrl: '',
|
|
45
|
+
needsInterop: false,
|
|
46
|
+
});
|
|
47
|
+
case 'invalidate':
|
|
48
|
+
return Promise.resolve();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// In build mode, we don't need runtime handling of mocks.
|
|
53
|
+
// Everything is handled at build time and via the MSW interceptor.
|
|
54
|
+
class BuildModuleMocker extends ModuleMocker {
|
|
55
|
+
queueMock() {
|
|
56
|
+
// noop
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function registerModuleMocker(interceptor) {
|
|
61
|
+
const mocker = new BuildModuleMocker(
|
|
62
|
+
interceptor('__vitest_mocker__'),
|
|
63
|
+
{
|
|
64
|
+
resolveId(id, importer) {
|
|
65
|
+
return rpc('resolveId', { id, importer });
|
|
66
|
+
},
|
|
67
|
+
resolveMock(id, importer, options) {
|
|
68
|
+
return rpc('resolveMock', { id, importer, options });
|
|
69
|
+
},
|
|
70
|
+
async invalidate(ids) {
|
|
71
|
+
return rpc('invalidate', { ids });
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
(...args) => {
|
|
75
|
+
return globalThis.__STORYBOOK_MODULE_TEST__.spyOn(...args);
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
root: '',
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
globalThis['__vitest_mocker__'] = mocker;
|
|
83
|
+
|
|
84
|
+
return createCompilerHints({
|
|
85
|
+
globalThisKey: '__vitest_mocker__',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
globalThis.__STORYBOOK_MOCKER__ = registerModuleMocker(() => new ModuleMockerInterceptor());
|
package/dist/actions/preview.cjs
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var l = Object.defineProperty;
|
|
3
|
-
var F = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var C = Object.getOwnPropertyNames;
|
|
5
|
-
var W = Object.prototype.hasOwnProperty;
|
|
6
|
-
var i = (e, t) => l(e, "name", { value: t, configurable: !0 });
|
|
7
|
-
var y = (e, t) => {
|
|
8
|
-
for (var o in t)
|
|
9
|
-
l(e, o, { get: t[o], enumerable: !0 });
|
|
10
|
-
}, M = (e, t, o, r) => {
|
|
11
|
-
if (t && typeof t == "object" || typeof t == "function")
|
|
12
|
-
for (let n of C(t))
|
|
13
|
-
!W.call(e, n) && n !== o && l(e, n, { get: () => t[n], enumerable: !(r = F(t, n)) || r.enumerable });
|
|
14
|
-
return e;
|
|
15
|
-
};
|
|
16
|
-
var L = (e) => M(l({}, "__esModule", { value: !0 }), e);
|
|
17
|
-
|
|
18
|
-
// src/actions/preview.ts
|
|
19
|
-
var z = {};
|
|
20
|
-
y(z, {
|
|
21
|
-
default: () => K
|
|
22
|
-
});
|
|
23
|
-
module.exports = L(z);
|
|
24
|
-
var j = require("storybook/preview-api");
|
|
25
|
-
|
|
26
|
-
// src/actions/addArgs.ts
|
|
27
|
-
var A = {};
|
|
28
|
-
y(A, {
|
|
29
|
-
argsEnhancers: () => Y
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// src/actions/runtime/action.ts
|
|
33
|
-
var O = require("storybook/internal/preview-errors"), u = require("@storybook/global"), w = require("storybook/preview-api");
|
|
34
|
-
|
|
35
|
-
// src/actions/constants.ts
|
|
36
|
-
var f = "storybook/actions", q = `${f}/panel`, E = `${f}/action-event`, G = `${f}/action-clear`;
|
|
37
|
-
|
|
38
|
-
// src/actions/runtime/configureActions.ts
|
|
39
|
-
var R = {
|
|
40
|
-
depth: 10,
|
|
41
|
-
clearOnStoryChange: !0,
|
|
42
|
-
limit: 50
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
// src/actions/runtime/action.ts
|
|
46
|
-
var v = /* @__PURE__ */ i((e, t) => {
|
|
47
|
-
let o = Object.getPrototypeOf(e);
|
|
48
|
-
return !o || t(o) ? o : v(o, t);
|
|
49
|
-
}, "findProto"), N = /* @__PURE__ */ i((e) => !!(typeof e == "object" && e && v(e, (t) => /^Synthetic(?:Base)?Event$/.test(t.constructor.name)) &&
|
|
50
|
-
typeof e.persist == "function"), "isReactSyntheticEvent"), V = /* @__PURE__ */ i((e) => {
|
|
51
|
-
if (N(e)) {
|
|
52
|
-
let t = Object.create(
|
|
53
|
-
e.constructor.prototype,
|
|
54
|
-
Object.getOwnPropertyDescriptors(e)
|
|
55
|
-
);
|
|
56
|
-
t.persist();
|
|
57
|
-
let o = Object.getOwnPropertyDescriptor(t, "view"), r = o?.value;
|
|
58
|
-
return typeof r == "object" && r?.constructor.name === "Window" && Object.defineProperty(t, "view", {
|
|
59
|
-
...o,
|
|
60
|
-
value: Object.create(r.constructor.prototype)
|
|
61
|
-
}), t;
|
|
62
|
-
}
|
|
63
|
-
return e;
|
|
64
|
-
}, "serializeArg");
|
|
65
|
-
function g(e, t = {}) {
|
|
66
|
-
let o = {
|
|
67
|
-
...R,
|
|
68
|
-
...t
|
|
69
|
-
}, r = /* @__PURE__ */ i(function(...s) {
|
|
70
|
-
if (t.implicit) {
|
|
71
|
-
let x = ("__STORYBOOK_PREVIEW__" in u.global ? u.global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
72
|
-
(d) => d.phase === "playing" || d.phase === "rendering"
|
|
73
|
-
);
|
|
74
|
-
if (x) {
|
|
75
|
-
let d = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, b = new O.ImplicitActionsDuringRendering({
|
|
76
|
-
phase: x.phase,
|
|
77
|
-
name: e,
|
|
78
|
-
deprecated: d
|
|
79
|
-
});
|
|
80
|
-
if (d)
|
|
81
|
-
console.warn(b);
|
|
82
|
-
else
|
|
83
|
-
throw b;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
let a = w.addons.getChannel(), c = Date.now().toString(36) + Math.random().toString(36).substring(2), p = 5, m = s.map(V), P = s.length >
|
|
87
|
-
1 ? m : m[0], S = {
|
|
88
|
-
id: c,
|
|
89
|
-
count: 0,
|
|
90
|
-
data: { name: e, args: P },
|
|
91
|
-
options: {
|
|
92
|
-
...o,
|
|
93
|
-
maxDepth: p + (o.depth || 3)
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
a.emit(E, S);
|
|
97
|
-
}, "actionHandler");
|
|
98
|
-
return r.isAction = !0, r.implicit = t.implicit, r;
|
|
99
|
-
}
|
|
100
|
-
i(g, "action");
|
|
101
|
-
|
|
102
|
-
// src/actions/addArgsHelpers.ts
|
|
103
|
-
var T = /* @__PURE__ */ i((e, t) => typeof t[e] > "u" && !(e in t), "isInInitialArgs"), _ = /* @__PURE__ */ i((e) => {
|
|
104
|
-
let {
|
|
105
|
-
initialArgs: t,
|
|
106
|
-
argTypes: o,
|
|
107
|
-
id: r,
|
|
108
|
-
parameters: { actions: n }
|
|
109
|
-
} = e;
|
|
110
|
-
if (!n || n.disable || !n.argTypesRegex || !o)
|
|
111
|
-
return {};
|
|
112
|
-
let s = new RegExp(n.argTypesRegex);
|
|
113
|
-
return Object.entries(o).filter(
|
|
114
|
-
([c]) => !!s.test(c)
|
|
115
|
-
).reduce((c, [p, m]) => (T(p, t) && (c[p] = g(p, { implicit: !0, id: r })), c), {});
|
|
116
|
-
}, "inferActionsFromArgTypesRegex"), D = /* @__PURE__ */ i((e) => {
|
|
117
|
-
let {
|
|
118
|
-
initialArgs: t,
|
|
119
|
-
argTypes: o,
|
|
120
|
-
parameters: { actions: r }
|
|
121
|
-
} = e;
|
|
122
|
-
return r?.disable || !o ? {} : Object.entries(o).filter(([s, a]) => !!a.action).reduce((s, [a, c]) => (T(a, t) && (s[a] = g(typeof c.action ==
|
|
123
|
-
"string" ? c.action : a)), s), {});
|
|
124
|
-
}, "addActionsFromArgTypes");
|
|
125
|
-
|
|
126
|
-
// src/actions/addArgs.ts
|
|
127
|
-
var Y = [
|
|
128
|
-
D,
|
|
129
|
-
_
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
// src/actions/loaders.ts
|
|
133
|
-
var h = {};
|
|
134
|
-
y(h, {
|
|
135
|
-
loaders: () => B
|
|
136
|
-
});
|
|
137
|
-
var I = require("storybook/test");
|
|
138
|
-
var k = !1, $ = /* @__PURE__ */ i((e) => {
|
|
139
|
-
let { parameters: t } = e;
|
|
140
|
-
t?.actions?.disable || k || ((0, I.onMockCall)((o, r) => {
|
|
141
|
-
let n = o.getMockName();
|
|
142
|
-
n !== "spy" && (!/^next\/.*::/.test(n) || [
|
|
143
|
-
"next/router::useRouter()",
|
|
144
|
-
"next/navigation::useRouter()",
|
|
145
|
-
"next/navigation::redirect",
|
|
146
|
-
"next/cache::",
|
|
147
|
-
"next/headers::cookies().set",
|
|
148
|
-
"next/headers::cookies().delete",
|
|
149
|
-
"next/headers::headers().set",
|
|
150
|
-
"next/headers::headers().delete"
|
|
151
|
-
].some((s) => n.startsWith(s))) && g(n)(r);
|
|
152
|
-
}), k = !0);
|
|
153
|
-
}, "logActionsWhenMockCalled"), B = [$];
|
|
154
|
-
|
|
155
|
-
// src/actions/preview.ts
|
|
156
|
-
var K = /* @__PURE__ */ i(() => (0, j.definePreview)({
|
|
157
|
-
...A,
|
|
158
|
-
...h
|
|
159
|
-
}), "default");
|