You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
annervisser
changed the title
deno.json not used as config by default when installing local file as global script
deno.json not used as config by default when installing global script
Oct 14, 2024
I've realized this is also the case when installing a package globally from deno.land,
which is a bigger problem since you can't work around it by specifying --config.
Deno never auto-discovers configuration files in https dependencies. I'd recommend publishing to JSR instead because it handles publishing code with the config inlined.
When installing a local typescript file as a global script,
the default behaviour is to not take the deno.json in the same folder into account.
This is unexpected, since the documentation for the
--config
options says:This results in confusing behaviour, and discrepancies between
deno run main.ts
anddeno install --global --name my-script main.ts && my-script
Example:
Expected behaviour
my-script
should run~/my-script-repo/main.ts
it using~/my-script-repo/deno.json
Actual behaviour:
my-script
runs~/my-script-repo/main.ts
with no/the global deno configuration.I've uploaded a reproduction at https://github.com/annervisser/deno-relative-import-repro
Version: deno 2.0.0 (stable, release, x86_64-unknown-linux-gnu)
v8 12.9.202.13-rusty
typescript 5.6.2
The text was updated successfully, but these errors were encountered: