-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Porting an action created this way to ESM #883
Comments
At some point I am going to probably pull the trigger and either convert this repo to ESM or create a separate template that is ESM...suffice to say I ran into a lot of the same headaches, especially since a number of the Unfortunately all the repos I have that do use TypeScript ESM actions are private, so I put one together quickly as a fork of this repo (https://github.com/ncalteen/typescript-esm-action). If you check the commit diff you can see the following need to be updated.
After that, |
Heyo! I'm going to go ahead and close this out now, but if you need anything please feel free to reopen :) |
Hi @ncalteen - thanks for providing the example. Linting and packaging is passing but JEST is failing |
Hey @karpikpl, sorry to hear that! I went down a bit of a rabbit hole on this one and think I found a few fixes. Check out the repo again for the changes! A few highlights on the changes:
|
Thanks @ncalteen All I want is to call graph from typescript, run tests and eslint - but because of those ESM modules that seems impossible I tried your recent changes but tests failed - looks like |
Yeah not gonna lie, ESM makes things very challenging. I've been tinkering with this in a similar project and found a few other things to update that seem to help. I updated the other ESM example repo and included an API call using the |
Hi there @ncalteen thanks for helping on this rabbit hole... It seems your repo is now closed/private https://github.com/ncalteen/typescript-esm-action I'm in the middle of trying to upgrade our github action to ESM and I'm fighting the whole toolchain right now 😞. If you could share that again it would be great! Thanks a lot |
Hey sorry about that! Yes I closed it since I had submitted this PR to this repo. If you pull this repo and check out the |
Oh sorry I missed #969. I'll check into it. Thanks a lot 🙇 |
Has anybody had success adapting an action created with this template to ESM (
"type": "module"
)? I'm finding that some modules I want to use as dependencies are only shipped as ESM these days, but it's not as simple as just adding"type": "module"
to package.json. When I do that:and run
npm run all
, the bundler fails withIf I then edit the imports in index.ts and main.ts to add
.js
to the end:I find that eslint fails with
While there's probably a real fix for this, I worked around it by disabling the lint rule:
But now Jest fails:
and that's where I get stuck.
Has anyone done this successfully?
The text was updated successfully, but these errors were encountered: