Open gr2m opened 3 years ago
Something like this would be cool
deno run --allow-net=api.github.com https://octoherd.dev/scripts/star-or-unstar
Isn't running a script from a url generally frowned on tho?
not with deno
. It has a similar sandbox as browsers do.
It's probably more secure than running
npx my-star-or-unstar-cli
Awesome, I didn't know that about deno. :)
The first step will be to create a deno version of the CLI.
Node introduced the convention of conditional exports. And skypack seems to support exports for different environments such as deno, they mention it at https://docs.skypack.dev/package-authors/package-checks#export-map
Changing
{
"exports": "./bin/octoherd.js"
}
to
{
"exports": {
"node": "./bin/octoherd-node.js",
"node": "./bin/octoherd-deno.js"
}
}
Maybe we can also make the current CLI just work with Deno out of the box, but I'm not familiar enough with Deno to debug the errors I currently see.
Once we have a valid Deno export and Skypack supports it, a script such as the above mentiond https://octoherd.dev/scripts/star-or-unstar
could
https://cdn.skypack.dev/@octoherd/cli
https://cdn.skypack.de/@octoherd/script-star-or-unstar
I'd love help with this.
I think the CLI would be a great use case to use Deno. Scripts and dependencies could be loaded directly from a remote URL, and Deno has a better security system.