sift.js icon indicating copy to clipboard operation
sift.js copied to clipboard

Publish to deno.land

Open marshallswain opened this issue 3 years ago • 5 comments

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 avatar Nov 15 '21 05:11 marshallswain

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.

marshallswain avatar Nov 18 '21 15:11 marshallswain

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.

crcn avatar Dec 31 '21 14:12 crcn

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.

marshallswain avatar Dec 31 '21 15:12 marshallswain

awesome, looking forward to it!

crcn avatar Dec 31 '21 16:12 crcn