Skip to content

[WIP] Add a Vite-based manual test server#1374

Open
filipsobol wants to merge 5 commits into
masterfrom
vite-manual-test-server
Open

[WIP] Add a Vite-based manual test server#1374
filipsobol wants to merge 5 commits into
masterfrom
vite-manual-test-server

Conversation

@filipsobol
Copy link
Copy Markdown
Member

🚀 Summary

Add a Vite-based manual test server.


📌 Related issues


💡 Additional information

Still WIP.

panel.classList.toggle( 'shell-instructions--open', isOpen );
panel.setAttribute( 'aria-hidden', String( !isOpen ) );
panel.toggleAttribute( 'inert', !isOpen );
trigger!.setAttribute( 'aria-expanded', String( isOpen ) );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing null guard for trigger in toggleInstructions

Medium Severity

The toggleInstructions function checks if panel is null and returns early, but uses trigger! without any null guard. If panel is found in the DOM but trigger isn't (e.g., due to unexpected DOM mutations by a manual test script), trigger!.setAttribute(...) throws a runtime error. The null check pattern is inconsistent — panel is properly guarded, but trigger relies on a non-null assertion that silences the type checker while leaving a potential crash path.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 638bdb3. Configure here.


next();
} );
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated middleware setup across server hooks

Low Severity

The configureServer and configurePreviewServer hooks contain byte-for-byte identical middleware registration code. Extracting the shared setup into a helper function would reduce duplication and ensure future changes to middleware ordering or logic are applied consistently to both the dev and preview servers.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 638bdb3. Configure here.

const MANUAL_SHELL_TEMPLATE_FILE_PATH = path.resolve( MANUAL_THEME_ROOT, 'shell.html' );
const MANUAL_SHELL_SCRIPT_FILE_PATH = path.resolve( MANUAL_THEME_ROOT, 'shell.ts' );
const MANUAL_CATALOG_PUBLIC_PATH = toPublicFilePath( MANUAL_CATALOG_FILE_PATH, WORKSPACE_ROOT );
const MANUAL_SHELL_SCRIPT_PUBLIC_PATH = toPublicFilePath( MANUAL_SHELL_SCRIPT_FILE_PATH, WORKSPACE_ROOT );
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module-level constants capture process.cwd() at import time

Low Severity

WORKSPACE_ROOT and all derived constants (MANUAL_CATALOG_PUBLIC_PATH, MANUAL_SHELL_SCRIPT_PUBLIC_PATH) are computed as module-level constants using process.cwd() at import time, rather than inside the createManualTestsPlugin() factory function. This means the workspace root is frozen the moment the module is first imported, making the plugin impossible to test with different working directories and fragile if the module is imported before process.cwd() reflects the intended project root.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 47862c8. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 4 total unresolved issues (including 3 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e54c259. Configure here.


import type { HotPayload, Plugin } from 'vite';

const MANUAL_REFRESH_EVENT_NAME = 'ckeditor5-manual:refresh-available';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated event name constant across server and client

Low Severity

The MANUAL_REFRESH_EVENT_NAME string 'ckeditor5-manual:refresh-available' is independently defined in both the server-side plugin (src/manual-refresh-plugin/plugin.ts) and the client-side shell (theme/shell.ts). If one is updated without the other, the manual refresh feature silently breaks with no error. Since theme/shell.ts already imports types from src/, a lightweight shared constants module could eliminate this duplication.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e54c259. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant