feathers icon indicating copy to clipboard operation
feathers copied to clipboard

WIP: Dove deno new

Open apollo79 opened this issue 3 years ago • 4 comments

Summary

Important: This PR is not finished, it is a WIP!

This PR updates the packages ported in #2531 to the newest versions.

I used the dove branch and copied most things. The main things I changed are using the events library as EventEmitter and the std bdd testing library for tests

And finally, as it is somewhat of a convention in deno, I added mod.ts files to every module.

Other Information

I mentioned this PR on the discord yesterday, there was some conversation about how to go with deno before: https://discord.com/channels/509848480760725514/930352418179391528/1033008949252857987

apollo79 avatar Oct 22 '22 10:10 apollo79

Deploy request for feathers-dove pending review.

Visit the deploys page to approve it

Name Link
Latest commit 9864dfc0fb159c96e335ba9ea3a75667d640878b

netlify[bot] avatar Oct 22 '22 10:10 netlify[bot]

One thing to talk about would be which formatter to use as the formatter included in the VSCode deno extension doesn't format in the same way as running deno fmt does. Currently I used the deno extension, but if we'll maybe check formatting via a GitHub Action in the future we should use deno fmt

apollo79 avatar Oct 22 '22 10:10 apollo79

I had a quick look and this look great, thank you for doing that. My initial questions would be:

  • Can we use the build script from @feathersjs/hooks to build the Deno packages into the packages/ folder (and then .gitignore those because we will only need them for publishing)?
  • What's the best way to run tests with Deno here?
  • Can we open this PR against the latest Dove branch. I'm assuming eventually we can remove the deno/ folder.

daffl avatar Nov 05 '22 03:11 daffl

Thanks for the feedback! About the questions:

* Can we use the build script from `@feathersjs/hooks` to build the Deno packages into the `packages/` folder (and then `.gitignore` those because we will only need them for publishing)?

I hope so, I think, it should be possible with a few changes. The problem isthat I am not able to run the build script in @feathersjs/hooks and neither the one I created for this PR which is quite similar. The build script of @feathersjs/hooks throws the error

error: Uncaught (in promise) 'Module not found "file:///C:/C:/Users/<path_to_feathersjs_hooks>/main/hooks/src/index.ts".'

I am on Windows and it seems that there is a problem with the URL, that represents __dirname or path.join or something like that (notice the C:/C:/ in the file path).

What's the best way to run tests with Deno here? To run the tests just run

deno test

in the folder of the module / package you want to test or in main to test all modules

Can we open this PR against the latest Dove branch. I'm assuming eventually we can remove the deno/ folder.

Yes, of course. Should I do this right now or later when some more packages are ported?

apollo79 avatar Nov 06 '22 14:11 apollo79