Modification Cornucopia
See original GitHub issueHi. I recently used ts-migrate, in conjunction with my own codemod runner, to migrate large portions of my codebase to TS. It was fun!
Along the way, I made a series of modifications to make ts-migrate work for my repo. Some of them are likely specific to my idiosyncrasies, but some may be generally applicable. I’ll list them here, and you can tell me which, if any, you’re interested in. I’ll then carve individual PRs for the pieces you want.
Change List
Here’s the full set of changes, but it’s a bit noisy because some of it is things I’d never recommend merging / it’s not cleaned up for you. So I’ll also link to individual commits in the list below, but it’s not always a 1:1 mapping 🤪 .
- Upgrade from TS 4.2 to TS 4.6
- Reignore: Add ability to specify a custom message for inserted
ts-expect-error
comments - Reignore: Add ability to skip the
eslint fix
step - Reignore: Add ability to skip the “strip
ts-ignore
” step - Rename: Pass back a list of files that were modified. I used this for downstream tooling that would do further processing on those files.
- ts-migrate-server: Fix bug where absolute paths were treated as relative paths
- ts-migrate-server: Return a list of modified files
- Rename: “Improve” JSX detection
- Rename: Don’t rename
foo.js
tofoo.ts
if afoo.d.ts
already exists.
Anyway, lmk if you’re interested in any of this. 😄
Task Tracking
Completed Changes
- TS update to 4.7 – looks like someone got there before me. 😄
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Vintage 60's Mod Cornucopia Rhinestone Ring Two Tone Horn
This Rings item by SultanaVintageJewels has 6 favorites from Etsy shoppers. Ships from Tucson, AZ. Listed on Oct 30, 2022.
Read more >Organics' Relationship to Climate Change - Cornucopia Institute
Scientists and experts studying climate agree that climate change is a serious problem for current and future populations.
Read more >"Designing Food, Owning the Cornucopia" by Thomas C ...
Imagine for purposes of discussion that the technology for designing and building an actual cornucopia—something that embodies code, genetically modified ...
Read more >OWASP Cornucopia
Cornucopia Ecommerce Website Edition is based the concepts and game ideas in EoP, but those have been modified to be more relevant to...
Read more >Cornucopia Educator Guide - California Academy of Sciences
Cornucopia is a game about food systems, ... Digital games like Cornucopia allow students to apply the content they've ... D Global Climate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool – I’ll probably have time to do some of these PRs in a month or so. Or anyone else is welcome to make an attempt in the meantime. 😄
Also, I recently ran into issues that I think are attributable to a stale
tsbuildinfo
after updating thecompilerOptions
intsconfig
. This may account for some instances wherets-migrate
insertedts-expect-error
s unnecessarily, or failed to insert some that were needed. I don’t have a bulletproof repro yet, but it may be safer forts-migrate
to deletetsbuildinfo
before building the TS project, to avoid any such risks.@NickHeiner all those setup steps ran without warnings or errors, but when I finally ran
yarn run ts-migrate
locally, it was as if ts-migrate was not actually installed.I did have success using verdaccio instead:
Publish forked package locally:
finally: