Skip to content

Conversation

@guy-borderless
Copy link
Contributor

@guy-borderless guy-borderless commented Oct 3, 2023

Closes #515

This is WIP branch that refactors the dev and init commands to centralize all JS runtime references and add deno support. This also adds a reference deno project using Deno's built in HTTP server.

✅ Checklist

  • ✅ I have followed every step in the contributing guide
  • ✅ The PR title follows the convention.
  • ✅ I ran and tested the code works

Testing

[Describe the steps you took to test this change]


Changelog

[Short description of what has changed]


Screenshots

[Screenshots]

💯

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2023

⚠️ No Changeset found

Latest commit: 007a015

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@guy-borderless
Copy link
Contributor Author

guy-borderless commented Oct 3, 2023

@matt-aitken Hi matt, looks good so far?

@guy-borderless
Copy link
Contributor Author

OK, tested what I can and everything works. It's not a big change, just all runtime-specific functions now go through a JsRuntime class, other than that code is unchanged.

The deno JsRuntime does not implement

  async checkForOutdatedPackages() {
    // not implemented currently
  }
  async getUserPackageManager() {
    return undefined;
  }
  async getFramework() {
    // not implemented currently
    return undefined;
  }
  • getUserPackageManager: deno uses the ESM modules standard so no need for a package manager (we can return "ESM" in the future if it'll make sense).
  • getFramework: can be implemented, but I think it's best to wait for deno 2.0 to do so as it would be much easier
  • checkForOutdatedPackages: can also be implemented but I think best to wait for deno 2.0

docs:
deno is indeed just a runtime, and the express trigger-integration works on deno as expected. So I'm not sure that besided the reference project we should add "deno" or "deno built in Http Server" to the "frameworks" section of the docs, although if you think otherwise I'll be happy to do it. Maybe just add a FAQ question like "Can I use deno to build trigger.dev workflows".
what do you think?

@guy-borderless guy-borderless changed the title feat(wip): enable deno feat: enable deno Oct 4, 2023
@guy-borderless
Copy link
Contributor Author

Regarding, docs, once we'll get this in I'll contribute a fresh integration. Any update on this?

@matt-aitken matt-aitken changed the base branch from main to cli-deno-support October 13, 2023 14:27
Copy link
Member

@matt-aitken matt-aitken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @guy-borderless. Thanks a lot!

@matt-aitken
Copy link
Member

Regarding, docs, once we'll get this in I'll contribute a fresh integration. Any update on this?

It would be great to add support for fresh.

@matt-aitken matt-aitken merged commit 1a7df3f into triggerdotdev:cli-deno-support Oct 13, 2023
matt-aitken added a commit that referenced this pull request Oct 13, 2023
commit c028db2
Author: Matt Aitken <[email protected]>
Date:   Fri Oct 13 16:04:54 2023 +0100

    Some fixes for getting the endpoint id

commit e31b7ac
Author: Matt Aitken <[email protected]>
Date:   Fri Oct 13 15:39:18 2023 +0100

    Added a link in the instructions if Node isn’t detected

commit 1a59cce
Author: Matt Aitken <[email protected]>
Date:   Fri Oct 13 15:39:05 2023 +0100

    Fixed some conflict issues

commit 77263ed
Author: Matt Aitken <[email protected]>
Date:   Fri Oct 13 15:38:56 2023 +0100

    Added a changeset

commit 1a7df3f
Author: GuyBorderless <[email protected]>
Date:   Fri Oct 13 17:31:01 2023 +0300

    feat: enable deno  (#531)

    * adding deno reference project and JSRuntime file

    * accessing runtime specific functions through JsRuntime

    * adding support for both deno.json and deno.jsonc

    * no automatic setup for deno projects currently

    ---------

    Co-authored-by: Guy Kedem <[email protected]>
    Co-authored-by: Matt Aitken <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TRI-1310] Add a Deno adaptor

2 participants