abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

Typescript Migration

Open AntoineBalaine opened this issue 2 years ago • 3 comments

Absolutely don't merge this YET!

Hello Mr. Rosen,

Sorry to have been so MIA these past few months. I finally found some time to work on the switch to TS this week.

Here's the migration to typescript we had discussed. It's still in draft state, but I wanted to submit it to you asap, so you'd be able to object to anything that doesn't fly.

  • I used ts-migrate for the migration.
  • updated webpack and babel to compile (mostly working, except for the abcjs-plugin, which has some issues)
  • switched requires and modules.exports to imports and exports
  • added prettier and eslint to the project - eslint is disabled for now, as the current setup has conflicts between the two. This was a necessary addition to do the migration
  • in package.json: project's "type" has been set to "module" in order to use imports and exports. I don't know if this potentially breaks anything for users of the library? The output still uses es5, though.
  • tests haven't been updated yet: links to js files are broken and I believe that <script> imports in the html files of the tests might require an "type=module" tag

That's all I have for now, I hope you'll find this PR useful!

Cheers

AntoineBalaine avatar Nov 20 '22 00:11 AntoineBalaine

Hi Antoine, the first thing I notice is that you've requested a merge to main. Please merge to dev instead. I push to main only when I'm creating a release.

I'll look at the actual code this week.

paulrosen avatar Nov 26 '22 01:11 paulrosen

Sounds good, I changed the destination!

AntoineBalaine avatar Nov 28 '22 01:11 AntoineBalaine

First thing I noticed is that the copyright notice is not on top of the abcjs-basic.min.js file.

paulrosen avatar Dec 03 '22 15:12 paulrosen