Uh oh!
There was an error while loading. Please reload this page.
fix: dedupe extensions array in JS-converted solid-v2 vite config - #84
Merged
Conversation
The blanket `.tsx` -> `.jsx` retarget regex in createSolidV2JS rewrote both entries of `extensions: ['.jsx', '.tsx']` to the same value, leaving `['.jsx', '.jsx']` in the converted vite.config.js. Dedupe the array after the rewrite, and also retarget `.ts`/`.tsx` filename mentions in config comments and the README (`.d.ts` mentions are left alone since those files are deleted, not transpiled). Co-authored-by: Cursor <cursoragent@cursor.com>
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
basictemplate with--jsproducedextensions: ['.jsx', '.jsx']in the convertedvite.config.js. The TS template listsextensions: ['.jsx', '.tsx'], and the blanket.tsx→.jsxretarget regex added in feat: Solid 2.0 template support #82 rewrites the second entry into a duplicate of the first.retargetTSFilenameshelper that dedupes theextensionsarray after the rewrite — the converted config now readsextensions: ['.jsx']..ts/.tsxfilename mentions in the config's comments and the template README (e.g.src/App.tsx→src/App.jsx,`vite.config.ts`→`vite.config.js`), since every such file is renamed by the conversion..d.tsmentions are excluded — those files are deleted, not transpiled..tsxmentions inside transpiledsrc/sources (JSX text/comments in the route files) are intentionally left as is; rewriting sucrase output in the shared conversion path is out of scope for this fix.solid-v2-templateschangeset for 0.9.0.Test plan
pnpm test— 18/18 passing (16 existing + 2 new unit tests for the retarget against thesolid-v2-basicfixture)solid-v2basic with JS conversion from the local build: config isextensions: ['.jsx'], no stale.tsxin config/READMEnpm run devon the converted app:/and/usersserve 200, and/src/routes/index.jsx?pick=default&pick=routecompiles through the Solid transform (theextensionsoption's purpose)Made with Cursor