Upgrade Storybook to version 9

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2025-09-14 14:37:55 +01:00
parent f58e7f1d0d
commit ffac5071fe
38 changed files with 506 additions and 729 deletions
+47
View File
@@ -0,0 +1,47 @@
// MSW v2 http compatibility shim for @vitest/mocker
// This provides MSW v2 http exports using MSW v1 APIs
try {
// Try to import from MSW v1
const { rest } = require('msw');
// Export MSW v1 'rest' as MSW v2 'http' for @vitest/mocker compatibility
module.exports = {
http: rest,
// Provide individual methods that @vitest/mocker might expect
get: rest.get,
post: rest.post,
put: rest.put,
delete: rest.delete,
patch: rest.patch,
head: rest.head,
options: rest.options,
all: rest.all,
};
} catch (error) {
// Fallback if MSW is not available
console.warn(
'MSW not available, providing minimal http mock for @vitest/mocker compatibility',
);
const noop = () => {};
module.exports = {
http: {
get: noop,
post: noop,
put: noop,
delete: noop,
patch: noop,
head: noop,
options: noop,
all: noop,
},
get: noop,
post: noop,
put: noop,
delete: noop,
patch: noop,
head: noop,
options: noop,
all: noop,
};
}