Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for TypeScript scripts #477

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Jul 6, 2024

  1. chore: Make test run names able to handle refactoring

    `fn.name` was introduced in Node 0.10.0, so this improves test suite maintainability without changing the minimum node version.
    
    Also added a test that for certain proves that Promises can be awaited.
    Ricky C committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    ccf1a8e View commit details
    Browse the repository at this point in the history
  2. feat: Add support for TypeScript scripts

    Both of the .cts and .mts flavors. Because this action is written in CommonJS both have to compile to CommonJS in order to execute.
    
    As it is TypeScript there's already an expectation of some slowness, so I went with the approach of running the script via the node VM module. While a cleaner approach, it has the caveat that root level await in the script doesn't work. That should become available if actions#457 is completed.
    Ricky C committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    d3f9a3b View commit details
    Browse the repository at this point in the history
  3. chore: Change back to the function-style operation

    We lose the more normal looking export in favor of the `return` statement already traditional to this action, and thus can handle await statements without an ESM conversion.
    
    This is a separate commit from the former because I think the next major version of this action should switch to ESM, revert this commit, and use the more standard export notation in all supported languages.
    Ricky C committed Jul 6, 2024
    Configuration menu
    Copy the full SHA
    f27b40e View commit details
    Browse the repository at this point in the history