cli
cli copied to clipboard
Allow extensions to use deno std lib offline
Any extension that uses the deno std library will always fail to run if the user is not connected to the internet.
This means, for example, that while npm init can be run offline, phylum npm init cannot:
❯ phylum npm init
❗ Error: error sending request for url (https://deno.land/[email protected]/fmt/colors.ts): error trying to connect: dns error: failed to lookup address information: nodename nor servname provided, or not known
Caused by:
0: error trying to connect: dns error: failed to lookup address information: nodename nor servname provided, or not known
1: dns error: failed to lookup address information: nodename nor servname provided, or not known
2: failed to lookup address information: nodename nor servname provided, or not known
The Phylum behavior here is also different from the deno CLI, which makes heavy use of a cache to avoid unnecessary network access.
Of course, most Phylum extensions are written with an online usage in mind. And a simple workaround for this is to vendor or avoid these dependencies if offline usage is required. But this is still a limitation worth noting.