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

Publish to deno.land #238

Open
marshallswain opened this issue Nov 15, 2021 · 4 comments
Open

Publish to deno.land #238

marshallswain opened this issue Nov 15, 2021 · 4 comments

Comments

@marshallswain
Copy link

marshallswain commented Nov 15, 2021

Since the code is already written in TypeScript and it has no dependencies, this would be a great tool to have published in https://deno.land/x. The process is pretty straightforward. After setting up, it uses Github hooks to auto-publish, so it shouldn't be much burden.

I noticed that the sift name is already being used by a request routing package, so maybe this one can use the name deno_sift.

@marshallswain
Copy link
Author

This might be a bit more involved than I thought, all thanks to Deno requiring the .ts extension in the ESM syntax, and TypeScript itself requiring it to be absent.

@crcn
Copy link
Owner

crcn commented Dec 31, 2021

Halfway there! Sift is now published as deno_sift, thanks for the suggestion. The only thing that's left outstanding is to figure out how to publish to NPM & Deno -- looks like this is a bit tricky as you mentioned.

@marshallswain
Copy link
Author

marshallswain commented Dec 31, 2021

Awesome! Thanks for working on this! We're really excited for FeathersJS to work on Deno and Node.

To share what progress we've made for dual publishing with FeathersJS, we've switched one repo so far to be Deno-focused, by default. We then use Deno's DNT package to build: https://github.com/denoland/dnt

We've only finished one repo, so far. Here's the config: https://github.com/feathersjs/hooks/blob/main/main/build.ts

It works decently well, the npm package is now published with both an esm and a umd version:
Screen Shot 2021-12-31 at 8 34 08 AM

The last thing to figure out is how to configure front-end tools to automatically use the ESM version. Currently, they try to use the umd version and throw an error. I imagine we will find a package.json configuration that will do this automatically, but for now I have to setup alias to the ESM version. Here's how it looks in a Vite project:

Screen Shot 2021-12-31 at 8 36 41 AM

It feels like we're really close to perfecting this workflow. We've even got it working well in our main /feathersjs repo, which is a lerna monorepo. I'll let you know once we figure out the last bit.

@crcn
Copy link
Owner

crcn commented Dec 31, 2021

awesome, looking forward to it!

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

No branches or pull requests

2 participants