Skip to content

convert to vite, typescript add some tests#282

Open
SharonStrats wants to merge 4 commits into
stagingfrom
feat/vite-migration
Open

convert to vite, typescript add some tests#282
SharonStrats wants to merge 4 commits into
stagingfrom
feat/vite-migration

Conversation

@SharonStrats

Copy link
Copy Markdown
Contributor

Migrate to vite.

There weren't really any tests so I just added a few so that I could setup the vite with the testing.

Also converted the other files that were still js to ts.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates the project’s build/dev/test toolchain from Webpack/Jest/Babel to Vite/Vitest, while completing the TypeScript conversion and adding a small Vitest-based unit test suite to validate core chat-creation behavior.

Changes:

  • Replace Webpack/Babel/Jest setup with Vite/Vitest configuration and scripts.
  • Convert remaining JS usage patterns to TypeScript-friendly code (notably in chat pane implementations).
  • Add initial Vitest unit tests for create.ts and longChatPane.mintNew.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
webpack.dev.config.mjs Removed legacy Webpack dev configuration as part of the Vite migration.
vite.config.mts Added Vite/Vitest configuration (build entry + jsdom test environment).
tsconfig.json Adjusted TS module resolution for bundler/Vite usage and simplified typeRoots.
test/unit/longChatPane.test.ts Removed placeholder Jest test.
test/longChatPane.test.ts Added Vitest coverage for longChatPane.mintNew (graph + ACL writes).
test/jest.setup.ts Removed Jest-specific setup.
test/helpers/setup.ts Added Vitest global test setup (mock cleanup).
test/create.test.ts Added Vitest coverage for getChat behavior (existing vs create/invite flows).
src/shortChatPane.ts Strengthened typing and error handling around message store detection.
src/longChatPane.ts Added TS types and refactors for side panels/options/thread handling.
src/index.ts Added default export for local dev environment usage.
src/create.ts Added return type assertion for mintNew result.
package.json Updated entrypoints/exports and switched scripts to Vite/Vitest toolchain.
jest.config.mjs Removed Jest configuration.
dev/index.js Removed legacy dev harness entrypoint (Webpack-era).
dev/index.html Removed legacy dev HTML (Webpack-era).
dev/context.ts Removed legacy dev context wiring (Webpack-era).
babel.config.mjs Removed Babel configuration (no longer used with Vite build).
Comments suppressed due to low confidence (2)

src/longChatPane.ts:333

  • HTMLElement.style is a CSSStyleDeclaration and isn’t meant to be assigned a CSS string. Assigning a string to area.style can throw at runtime (modules are strict mode) and/or silently do nothing; use area.style.cssText = ... or setAttribute('style', ...) instead.
    src/longChatPane.ts:366
  • If the user isn’t logged in, this handler returns after participantsArea has already been initialized, so subsequent clicks won’t rebuild the panel even after login (it will just toggle an empty panel). Also, the alert message contains typos. Check me before creating/assigning participantsArea, and set the initial styles via cssText rather than assigning to .style.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants