vscode-mjml icon indicating copy to clipboard operation
vscode-mjml copied to clipboard

Mass updates and related code migrations/type fixes

Open rosskevin opened this issue 1 year ago • 9 comments

I tried to keep all intents the same. I note there is no eslint config.

  • update all libraries
  • migrate away from deprecated vscode to vscode-test and @types/vscode
  • update type errors
  • remove some deprecated code to fix warnings

Scripts:

  • add build script (no watch)
  • move compile to build:watch
  • add package scripts to use vsce in a way that allows for modern yarn use
  • add convenience package:install for local dev use
  • add deploy scripts

#49

I'm not familiar with writing/testing vscode extensions, so this should be reviewed before merging.

Related:

  • yarn v2+ not supported by vsce https://github.com/microsoft/vscode-vsce/issues/517
  • draw yarn fix inspiration and packaging scripts from abcradabra (linked in above issue) https://github.com/nicoespeon/abracadabra/commit/10e0c3d0a5a5a88c01fae62b6bf92318d33f6bc1 https://github.com/nicoespeon/abracadabra

rosskevin avatar Sep 06 '24 16:09 rosskevin

👋 Thanks for this, can you check to remove that .yarn stuff you've commited ?

iRyusa avatar Sep 06 '24 16:09 iRyusa

Hey @iRyusa - I just pushed more changes, let me update the OP...one moment

rosskevin avatar Sep 06 '24 17:09 rosskevin

@iRyusa I think this is good to review now. I bumped the version just for safety, you can revert that or change as needed.

In our open repos, we always ship the .yarn stuff (no cache) so everyone is always on the same page. I believe the script additions makes this feasible.

Of course you are free to change that, but I think the overall package now is buildable, packageable and deployable as long as long as someone is using a yarn 2+.

There are different ways to accomplish the same thing though...I'm just wanting to see this easily contributed to by many.

rosskevin avatar Sep 06 '24 17:09 rosskevin

@iRyusa currently if you locally package:install the vsix - the old (deployed) plugin disappears and the new does not appear at all - so not all is quite well.

rosskevin avatar Sep 06 '24 17:09 rosskevin

Wondering if this needs to further similar to abcracadabra and use esbuild https://code.visualstudio.com/api/working-with-extensions/bundling-extension

?

rosskevin avatar Sep 06 '24 17:09 rosskevin

.yarn is out, the ignores remain.

rosskevin avatar Sep 06 '24 17:09 rosskevin

I'm going to leave this branch/PR as-is but branch from here and try the recommended esbuild path.

rosskevin avatar Sep 06 '24 17:09 rosskevin

NOTE: the esbuild path is raising good errors - showing things that will break at runtime (likely the problem) such as:

▲ [WARNING] Calling "mjml2html" will crash at run-time because it's an import namespace object, not a function [call-import-namespace]

    src/helper.ts:66:15:
      66 │         return mjml2html(mjml, {

so I'll keep pursuing that on that newer branch.

rosskevin avatar Sep 06 '24 18:09 rosskevin

@iRyusa any chance you can try to run this and let me know where I should look to fix it?

rosskevin avatar Sep 06 '24 20:09 rosskevin

I'm trying to get this merge and deployed today + some cleaning on the repo (removing phantomJS, MJML5,...)

iRyusa avatar Oct 22 '24 08:10 iRyusa

@rosskevin Massive thanks for this I had to remove some of old deps that cause some issue (ESModule 😬)

This is published as 2.0.0 with MJML5 branch on it, and some older command are removed. Again, sorry for the late merge and reply

iRyusa avatar Oct 22 '24 15:10 iRyusa