Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
37ac8d2
WIP
valentinpalkovic Jun 24, 2025
539f149
Build-Mode: Module automocking manifest generation
valentinpalkovic Jun 30, 2025
2fa1747
Support build mode for mocking
valentinpalkovic Jul 7, 2025
74b1ea4
Support mocking in build and serve mode without msw
valentinpalkovic Jul 9, 2025
09d0526
Invalidate mocks and affected files on change
valentinpalkovic Jul 9, 2025
ae7ccbb
Cleanup
valentinpalkovic Jul 9, 2025
6ed46dc
Fix type assertion for global CHANNEL_OPTIONS
valentinpalkovic Jul 9, 2025
d421269
Merge remote-tracking branch 'origin/next' into valentin/storybook-mock
valentinpalkovic Jul 9, 2025
507b895
Remove msw dependency
valentinpalkovic Jul 9, 2025
452b1b1
Revert accidential addition of import
valentinpalkovic Jul 9, 2025
f3a7a3f
Fix build
valentinpalkovic Jul 9, 2025
64db30c
Update lock file
valentinpalkovic Jul 9, 2025
b7f804d
Merge branch 'next' into valentin/storybook-mock
valentinpalkovic Jul 10, 2025
51739bd
Dynamically load vite-based dependencies
valentinpalkovic Jul 10, 2025
85da36e
Renamings
valentinpalkovic Jul 10, 2025
94d6004
Renamings
valentinpalkovic Jul 10, 2025
969c6b6
Further renamings
valentinpalkovic Jul 10, 2025
d0134d0
Remove unused imports
valentinpalkovic Jul 10, 2025
2117325
Fix pnpm related issues where dependencies in virtual files cannot be…
valentinpalkovic Jul 10, 2025
0be57b8
Readd storybook/test global
valentinpalkovic Jul 10, 2025
a6e7285
Ignore ts error due to wrong types
valentinpalkovic Jul 10, 2025
ddeb032
Finetune stories
valentinpalkovic Jul 10, 2025
2d8331d
Simplify configuration
valentinpalkovic Jul 10, 2025
0467d3d
Move storybook vitest config to root
valentinpalkovic Jul 10, 2025
8a16325
Fix indentation
valentinpalkovic Jul 10, 2025
d8bfaf6
Merge remote-tracking branch 'origin/next' into valentin/storybook-mock
valentinpalkovic Jul 10, 2025
ba39684
Add telemetry
valentinpalkovic Jul 11, 2025
7f9ccd1
Add E2E tests
valentinpalkovic Jul 11, 2025
0200199
Optimize @vitest/spy dependency
valentinpalkovic Jul 11, 2025
1bc7f56
Fix event checker
valentinpalkovic Jul 11, 2025
2529308
Implement module mocking for Webpack
valentinpalkovic Jul 13, 2025
a7f833f
Update event log checker to find main event by event type when noBoot…
valentinpalkovic Jul 13, 2025
8757901
Enable mocking E2E tests for all frameworks
valentinpalkovic Jul 13, 2025
ec1721e
Update package.json
valentinpalkovic Jul 13, 2025
ddcc52e
Refactor sandbox-parts.ts to always include mocking setup for Vitest …
valentinpalkovic Jul 13, 2025
0d381f1
Add temporary resolution field for rollup
valentinpalkovic Jul 13, 2025
e5cd418
Adjust event-log-checker to consider mocking event
valentinpalkovic Jul 14, 2025
91374d1
Don't setup mocks for bench sandboxes
valentinpalkovic Jul 14, 2025
e5b3b3b
Add rollup version resolution to package.json
valentinpalkovic Jul 14, 2025
4bfdfee
Update sandbox task conditions to check for 'Bench' instead of 'bench'
valentinpalkovic Jul 14, 2025
c806bf0
Rewrite mock modules to be framework agnostic
valentinpalkovic Jul 14, 2025
198b15c
Adjust sb-module-mocking e2e tests
valentinpalkovic Jul 14, 2025
f84e398
Fix mocking when preserveSymlink is true
valentinpalkovic Jul 14, 2025
c00e0c2
Refactor event-log-checker to exclude mocking events from log assertions
valentinpalkovic Jul 14, 2025
368b902
Simplify mock stories
valentinpalkovic Jul 14, 2025
6c006cf
Fix module mocking stories
valentinpalkovic Jul 14, 2025
c7b2846
Transform NodeModuleMocking into JavaScript
valentinpalkovic Jul 14, 2025
77f6c71
Update storybook mock stories to use 'text' instead of 'object' for a…
valentinpalkovic Jul 14, 2025
2770930
Fix Windows-related issues
valentinpalkovic Jul 15, 2025
200c6d3
Change transform order in viteMockPlugin from 'post' to 'pre'
valentinpalkovic Jul 15, 2025
1c0e813
Fix creation of react-webpack/prerelease-ts in linked mode
valentinpalkovic Jul 16, 2025
a5d24df
Implement watcher for mocking in Webpack-based projects
valentinpalkovic Jul 16, 2025
5b4f063
Use babel for parsing mocks
valentinpalkovic Jul 16, 2025
668f2d2
Improve error logging in viteMockPlugin to include error details
valentinpalkovic Jul 16, 2025
6d5499b
Revert change
valentinpalkovic Jul 16, 2025
bb66c83
Support sb.mock(import(x), ...) syntax
valentinpalkovic Jul 17, 2025
7ac5042
Use spyOn from storybook/test
valentinpalkovic Jul 17, 2025
f54c196
Use proper type for sb.mock
valentinpalkovic Jul 17, 2025
4ecd08f
Remove unnecessary try/catch block
valentinpalkovic Jul 17, 2025
88961b7
Add Todo comments
valentinpalkovic Jul 17, 2025
e47c289
Remove unnecessary code
valentinpalkovic Jul 17, 2025
d358bfc
Cleanup
valentinpalkovic Jul 18, 2025
7f7556c
Merge branch 'next' into valentin/storybook-mock
valentinpalkovic Jul 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renamings
  • Loading branch information
valentinpalkovic committed Jul 10, 2025
commit 85da36e4daa3f029747bab4875c0a3bd9eb40a1c
2 changes: 1 addition & 1 deletion code/core/src/core-server/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ export const viteFinal = async (
): Promise<import('vite').UserConfig> => {
const previewConfigPath = findConfigFile('preview', options.configDir);
const { viteInjectMockerRuntime } = await import('./vitePlugins/vite-inject-mocker/plugin');
const { viteMockPlugin } = await import('./vitePlugins/vite-mock-build-manifest/plugin');
const { viteMockPlugin } = await import('./vitePlugins/vite-mock/plugin');
return {
...existing,
plugins: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Plugin, ResolvedConfig } from 'vite';
import { __STORYBOOK_GLOBAL_THIS_ACCESSOR__ } from '../vite-inject-mocker/constants';
import { type MockCall, extractMockCalls, getCleanId, invalidateAllRelatedModules } from './utils';

interface MockBuildManifestPluginOptions {
interface MockPluginOptions {
/** The absolute path to the preview.tsx file where mocks are defined. */
previewConfigPath: string;
}
Expand All @@ -26,9 +26,9 @@ let parse: PluginContext['parse'];
* - Resolve and emit mock/automock chunks
* - Generate a manifest mapping original modules to their mocks
*
* @see MockBuildManifestPluginOptions
* @see MockPluginOptions
*/
export function viteMockPlugin(options: MockBuildManifestPluginOptions): Plugin[] {
export function viteMockPlugin(options: MockPluginOptions): Plugin[] {
// --- Plugin State ---
let viteConfig: ResolvedConfig;
let mockCalls: MockCall[] = [];
Expand Down
Loading