@storybook/addon-vitest 11.0.0-beta.4 → 11.0.0-beta.5
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,4 +1,4 @@
|
|
|
1
|
-
import { createRequire as
|
|
1
|
+
import { createRequire as CJS_COMPAT_CREATE_REQUIRE_k0tg52bvvu } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_k0tg52bvvu(import.meta.url);
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -2332,7 +2332,8 @@ import {
|
|
|
2332
2332
|
normalizeStories,
|
|
2333
2333
|
optionalEnvToBoolean,
|
|
2334
2334
|
resolvePathInStorybookCache as resolvePathInStorybookCache2,
|
|
2335
|
-
validateConfigurationFiles
|
|
2335
|
+
validateConfigurationFiles,
|
|
2336
|
+
versions
|
|
2336
2337
|
} from "storybook/internal/common";
|
|
2337
2338
|
import {
|
|
2338
2339
|
StoryIndexGenerator,
|
|
@@ -2350,7 +2351,10 @@ import {
|
|
|
2350
2351
|
telemetry as telemetry2,
|
|
2351
2352
|
setTelemetryEnabled
|
|
2352
2353
|
} from "storybook/internal/telemetry";
|
|
2353
|
-
var import_picocolors = __toESM(require_picocolors(), 1), import_sirv = __toESM(require_build(), 1),
|
|
2354
|
+
var import_picocolors = __toESM(require_picocolors(), 1), import_sirv = __toESM(require_build(), 1), import_ts_dedent2 = __toESM(require_dist(), 1);
|
|
2355
|
+
|
|
2356
|
+
// package.json
|
|
2357
|
+
var version = "11.0.0-beta.5";
|
|
2354
2358
|
|
|
2355
2359
|
// ../../builders/builder-vite/src/utils/without-vite-plugins.ts
|
|
2356
2360
|
var withoutVitePlugins = async (plugins = [], namesToRemove) => {
|
|
@@ -2452,6 +2456,19 @@ function isStorybookInternalFrame(file) {
|
|
|
2452
2456
|
return !!file && INTERNAL_FRAME_PATTERNS.some((pattern) => pattern.test(file));
|
|
2453
2457
|
}
|
|
2454
2458
|
|
|
2459
|
+
// src/vitest-plugin/version-check.ts
|
|
2460
|
+
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
2461
|
+
function getIncompatibleStorybookMessage(addonVersion, coreVersion) {
|
|
2462
|
+
let addonMajor = Number.parseInt(addonVersion, 10), coreMajor = Number.parseInt(coreVersion, 10);
|
|
2463
|
+
if (!(!addonMajor || !coreMajor || addonMajor === coreMajor))
|
|
2464
|
+
return import_ts_dedent.dedent`
|
|
2465
|
+
@storybook/addon-vitest@${addonVersion} is not compatible with storybook@${coreVersion}.
|
|
2466
|
+
|
|
2467
|
+
Several versions of Storybook are installed, for example when only some packages of a monorepo were upgraded.
|
|
2468
|
+
Run "npm ls storybook" to see which ones, then use the same version for every "storybook" and "@storybook/*" dependency.
|
|
2469
|
+
`;
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2455
2472
|
// src/vitest-plugin/index.ts
|
|
2456
2473
|
var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
2457
2474
|
storybookScript: void 0,
|
|
@@ -2526,6 +2543,9 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2526
2543
|
}, storybookTest = async (options) => {
|
|
2527
2544
|
if (!optionalEnvToBoolean(process.env.VITEST))
|
|
2528
2545
|
return [];
|
|
2546
|
+
let incompatible = getIncompatibleStorybookMessage(version, versions.storybook);
|
|
2547
|
+
if (incompatible)
|
|
2548
|
+
throw new HandledError(incompatible);
|
|
2529
2549
|
let finalOptions = {
|
|
2530
2550
|
...defaultOptions,
|
|
2531
2551
|
...options,
|
|
@@ -2690,7 +2710,7 @@ var WORKING_DIR = process.cwd(), defaultOptions = {
|
|
|
2690
2710
|
}
|
|
2691
2711
|
}, config = mergeConfig(baseConfig, viteConfigFromStorybook);
|
|
2692
2712
|
return (nonMutableInputConfig.test?.include?.length ?? 0) > 0 && (nonMutableInputConfig.test.include = [], console.log(
|
|
2693
|
-
import_picocolors.default.yellow(
|
|
2713
|
+
import_picocolors.default.yellow(import_ts_dedent2.dedent`
|
|
2694
2714
|
Warning: Starting in Storybook 8.5.0-alpha.18, the "test.include" option in Vitest is discouraged in favor of just using the "stories" field in your Storybook configuration.
|
|
2695
2715
|
|
|
2696
2716
|
The values you passed to "test.include" will be ignored, please remove them from your Vitest configuration where the Storybook plugin is applied.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-vitest",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.5",
|
|
4
4
|
"description": "Storybook Vitest addon: Blazing fast component testing using stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@storybook/icons": "^2.0.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@storybook/addon-a11y": "11.0.0-beta.
|
|
85
|
-
"@storybook/builder-vite": "11.0.0-beta.
|
|
84
|
+
"@storybook/addon-a11y": "11.0.0-beta.5",
|
|
85
|
+
"@storybook/builder-vite": "11.0.0-beta.5",
|
|
86
86
|
"@types/istanbul-lib-report": "^3.0.3",
|
|
87
87
|
"@types/micromatch": "^4.0.0",
|
|
88
88
|
"@types/node": "^22.19.1",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"peerDependencies": {
|
|
111
111
|
"@vitest/browser": "^4.0.0 || ^5.0.0",
|
|
112
112
|
"@vitest/browser-playwright": "^4.0.0 || ^5.0.0",
|
|
113
|
-
"storybook": "^11.0.0-beta.
|
|
113
|
+
"storybook": "^11.0.0-beta.5",
|
|
114
114
|
"vitest": "^4.0.0 || ^5.0.0"
|
|
115
115
|
},
|
|
116
116
|
"peerDependenciesMeta": {
|