Ways to automatically discover Deno ports
See original GitHub issueIt’s not something that affects me directly yet, but I find it a curious and underexplored problem.
The situation may get exponentially better as more packages expose their Deno port in some way suitable for automation. Much better than trying to keep a hand-filled dictionary of ports.
I was considering make-deno-edition
along with Denoify, and their attempts to address this problem is what made me aware and curious about this problem. Although their solutions don’t fill me with confidence:
-
“deno” field in
package.json
pointing to an entry module takes the very basic and lucrative name and uses it for something very limited. I have a package with multiple exports and I wouldn’t be able to describe it properly. Extended spec would be needed.Somehow I feel extending the “exports” section to accept “deno” key besides “import”, “require”, etc. would make much more sense. Although that may have compatibility issues.
Much simpler use for “deno” field (if ever needed) would be just to serve in the same way as “denoify.out” does - to point at the folder where Deno-targeted code resides, without specifying an entry point (that can potentially be recovered from “exports” section). Or it could be an url to the port.
-
“editions” section seems descriptive for humans but not very actionable for automation. Extra layer of conventions would require on top of what already feels taking much more cognitive load compared to what it offers. (Maybe I just don’t work with frontend to fully appreciate it though.)
Things that I think Denoify could do on it’s own with package.json
of dependency packages:
- Check the presence of “denoify” section and “repository” section;
- If https://deno.land/x can be searched by a repository name then you’ve got the port;
- Or https://deno.land/x can be checked for the package name and then validated by the repository name to make sure it’s the same package;
- If “denoify.out” is available then it might be possible to check the repo for the presence of that folder and make use of it.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
@KillyMXI You are right, it’s fixed in 1.0.1
It shouldn’t break anything. If it dose please report. Best regards