Migrate to Vite #314#315
Conversation
fa301e2 to
da8e62c
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the solid-logic build and test tooling from Webpack/Babel/Jest to Vite/Vitest, updating packaging metadata and refactoring tests to run under Vitest with a new fetch-mocking approach.
Changes:
- Replace Webpack/Babel/Jest configuration with a Vite + Vitest setup (
vite.config.mts) and update TypeScript resolution for bundlers. - Update
package.jsonscripts/entrypoints/exports to align with the new build output model. - Refactor test suite from Jest APIs to Vitest APIs, introducing a custom fetch-mock implementation and updated test setup.
Reviewed changes
Copilot reviewed 23 out of 25 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| webpack.config.mjs | Removed Webpack build configuration as part of the migration to Vite. |
| vite.config.mts | Added Vite build config and Vitest configuration (jsdom + setup + coverage). |
| tsconfig.json | Switched to moduleResolution: bundler to better match bundler behavior. |
| test/utils.test.ts | Migrated test runner imports to Vitest. |
| test/utilityLogic.test.ts | Migrated to Vitest and updated fetch mocking/typing within tests. |
| test/unit/setup.ts | Added shared mock-web and request-capture helper used by test setup. |
| test/typeIndexLogic.test.ts | Migrated Jest environment directives to Vitest imports. |
| test/testBundles/test-umd.html | Removed legacy UMD bundle browser test file. |
| test/solidAuthLogic.test.ts | Replaced Jest module mocking with an inline stub + Vitest imports. |
| test/profileLogic.test.ts | Migrated Jest environment directives to Vitest imports. |
| test/mocks/solid-oidc-client-browser.ts | Removed Jest-specific module mock implementation. |
| test/logic.test.ts | Migrated to Vitest and updated fetch mocking usage. |
| test/inboxLogic.test.ts | Migrated to Vitest; updated fetch mock matchers and typings. |
| test/helpers/setup.ts | Updated global test setup for Vitest, including fetch/TextEncoder/TextDecoder setup. |
| test/helpers/fetch-mock.ts | Added a custom fetch-mock implementation to replace jest-fetch-mock. |
| test/helpers/debugger.ts | Migrated debug silencing from Jest spies to Vitest spies. |
| test/container.test.ts | Migrated to Vitest and updated typings/mocking patterns. |
| test/chatLogic.test.ts | Migrated to Vitest and updated time mocking and typings. |
| test/authUtil.test.ts | Migrated to Vitest imports. |
| test/aclLogic.test.ts | Migrated to Vitest imports and improved typing. |
| README.md | Updated documentation to reflect Vite/Vitest usage and updated dependency guidance. |
| package.json | Updated scripts, entrypoints/exports, and dependencies for Vite/Vitest-based workflow. |
| jest.config.mjs | Removed Jest configuration as part of the migration. |
| babel.config.mjs | Removed Babel configuration as part of the migration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "dependencies": { | ||
| "@uvdsl/solid-oidc-client-browser": "^0.2.3", | ||
| "solid-namespace": "^0.5.4" | ||
| "solid-namespace": "^0.5.4", | ||
| "vite": "^8.0.16", | ||
| "vitest": "^4.1.9" | ||
| }, |
There was a problem hiding this comment.
this is how it was in the package i copied it from. @NoelDeMartin should i change this
Prompt: help me change the fetch mock and tests from Jest to Vite Co-authored-by: GPT-5.4 Mini <gpt-5.4-mini@openai.com>
0c556f6 to
698e89e
Compare
|
In order to migrate this to staging, I believe that we have to remove the overrides for solid-ui and solid-logic in profile-pane. Maybe someone else could test this as well to see if I'm correct or if there is something else we can do. |
Migrate from Webpack/babel/jest to Vite
I have tested this in my local solidos setup with most branches pointing at the staging branch (only a couple pane repos were not, but they were created off of the staging branch).
When i ran this for the first time I had trouble with overrides again in solid-panes and actually this time in profile-pane this time as well. I had to remove the override for pane-registry and solid-logic in solid-panes and solid-logic in profile-pane.
Note: the next time I just tested it and I only had to remove the overrides for solid-logic and solid-ui in profile-pane.