Pochi is an project developed using following technologies:
- always use kebab-case for filenames.
- always use camelCase for variables, functions.
- use PascalCase for classes, interfaces, types.
We use vitest framework.
our test use vitest framework.
test command: bun run test
coverage test command: bun run test -- --coverage
We use mocha framework, when creating test, do not use mocks for filesystem, just use vscode.workspace.fs to create files and folders, and only use mocha primitives for testing. use sinon for mocks.
(assuming cwd is packages/vscode)
test command: bun run test
coverage test command: bun run test:coverage
e2e test command: bun turbo test:integration, always run it with background job
When encountering issues like TypeError: Descriptor for property readFile is non-configurable and non-writable, please use proxyquire to mock the module.
- Architecture: Follow Page Object Model. Page objects are in
packages/vscode/test/pageobjects. - WebViews: Pochi runs in a WebView. Always handle frame switching (enter/exit) when interacting with Pochi UI.
- Session Safety: Do NOT use
vscode.openFolderwithforceNewWindow: falseinsidebrowser.executeWorkbench. This reloads the window and invalidates the WebDriver session. UseforceNewWindow: true, wait for the new window handle, and switch to it. - Internal API: Use
browser.executeWorkbenchfor setup/teardown (e.g. commands, file creation) instead of UI interactions where possible. - Debugging: Add verbose logging with
[Test Debug]prefix to help trace issues in CI/headless modes. - Test Command:
bun turbo test:integration, always run it with background job. - Selector Stability: Add/use
aria-labelordata-testidattributes for stable selectors. Don't use taiwind classes to locate element. - Await Operations: Always
awaitbrowser operations. - Test Granularity: One behavior per test when possible.
- Cleanup: Clean up after tests (close views, reset state).
- use
bun checkto format / linting the code, usebun fixto automatically apply the fix. - use
bun tscto check the types. - For packages/code it uses
inkfor react terminal ui. - Prefer
@/libover../libfor imports. - For global variable in typescript, prefer using PascalCase, e.g
GlobalVariableName, instead ofGLOBAL_VARIABLE_NAME. - For biome related warning / errors, prefer using
bun fixin the root directory to fix the issues. packages/db/src/schema.d.tsis auto generated with script 'db:genschema'. Do not modify it directly.- To add new vscode host method, we need register the method in 4 files
- packages/common/src/vscode-webui-bridge/webview.ts
- packages/common/src/vscode-webui-bridge/webview-stub.ts
- packages/vscode/src/integrations/webview/vscode-host-impl.ts
- packages/vscode-webui/src/lib/vscode.ts
- Reuse UI componnent in packages/vscode-webui/src/components
- When you need to look up information about LiveStore, always use the
docsdirectory that's shipped as part of the@livestore/livestorepackage innode_modules/@livestore/livestore/docs.