Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: suggest deno install --entrypoint instead of deno cache #25228

Merged
merged 18 commits into from
Sep 18, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Aug 27, 2024

Hides deno cache from --help output.

cli/args/flags.rs Outdated Show resolved Hide resolved
@iuioiua iuioiua marked this pull request as ready for review August 27, 2024 01:26
@bartlomieju bartlomieju added this to the 2.0.0-rc.0 milestone Aug 27, 2024
@marvinhagemeister
Copy link
Contributor

Note: We probably should point to the planned --entrypoint flag for the install command in those messages added in this PR once that lands.

@bartlomieju bartlomieju modified the milestones: 2.0.0-rc.0, 2.0.0-rc.1 Aug 27, 2024
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting on deno install -e support before landing this one, which @nathanwhit is working on.

@bartlomieju bartlomieju modified the milestones: 2.0.0-rc.1, 2.0.0-rc.2 Sep 6, 2024
@KnorpelSenf
Copy link
Contributor

I don't really understand why --entrypoint tells me “this thing now doesn't install anything but it populates the cache instead.” Seems like very poor naming to me. What am I missing?

Also, why do you think it's a great idea to overload deno install with more and more features? It recently proliferated from doing 1 thing and doing it well to now doing 3 things in less obvious ways, depending on the flags you pass.

I do agree that it's useful to have a single command that both adds and caches a module, but if you break everybody's workflow anyway, why not end up with less ambiguity?

@bartlomieju bartlomieju modified the milestones: 2.0.0-rc.2, 2.0.0 Sep 10, 2024
@greentore
Copy link

Yeah, I don't get this change at all. The new way is both less ergonomic and less descriptive. install --entrypoint tells me absolutely nothing.

@bartlomieju
Copy link
Member

FYI we are still discussing this internally if we should proceed. We are hearing your feedback.

@bartlomieju bartlomieju self-assigned this Sep 12, 2024
@bartlomieju
Copy link
Member

The decision has been made to keep deno cache as is - but it will be hidden from the help output and the error messages will suggest using deno install --entrypoint. In other words - don't worry, your existing workflows will keep working as before.

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
@iuioiua iuioiua marked this pull request as draft September 17, 2024 23:53
@iuioiua iuioiua changed the title feat: deprecate deno cache feat: suggest deno install --entrypoint instead of deno cache Sep 18, 2024
@iuioiua iuioiua marked this pull request as ready for review September 18, 2024 00:19
@uasi
Copy link

uasi commented Sep 18, 2024

The decision has been made to keep deno cache as is

Glad to hear that. Still don't get what --entrypoint means - why not --cache-only or --deps or something?

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bartlomieju bartlomieju enabled auto-merge (squash) September 18, 2024 19:24
@bartlomieju bartlomieju merged commit 5057f58 into denoland:main Sep 18, 2024
17 checks passed
@iuioiua iuioiua deleted the deprecate-cache branch September 18, 2024 20:11
@KnorpelSenf
Copy link
Contributor

Is deno cache mod.ts going to be exactly equivalent to deno install --entrypoint mod.ts? Like an alias? I'm still trying to understand what deno install is doing. My current understanding is that

  • it can modify the import map in deno.json (but not a separate import map file) in order to provide shorter imports,
  • it can create a very short bash script file that makes a Deno application available in the $PATH of the machine, and
  • it can cache modules

and sometimes it does various of these things at once. Is that correct? The docs currently only mention the second thing.

@bartlomieju
Copy link
Member

Is deno cache mod.ts going to be exactly equivalent to deno install --entrypoint mod.ts? Like an alias?

Yes

it can modify the import map in deno.json (but not a separate import map file) in order to provide shorter imports,

Correct

it can create a very short bash script file that makes a Deno application available in the $PATH of the machine, and

Yes, when you use -g flag

it can cache modules

Pretty much, which is the same as the first point, but instead of relying on deno.json you point it to a file that has the dependencies listed (like a single-file script).

and sometimes it does various of these things at once. Is that correct?

Not really, it's one of the three modes depending if you run deno install, deno install -g or deno install -e.

The docs currently only mention the second thing.

We are currently updating the docs

@nathanwhit
Copy link
Member

nathanwhit commented Sep 19, 2024

As a mental model, you can think of deno install as the command for installing dependencies.

So deno install --global <dep> installs a dependency globally, deno install (no arg) installs local dependencies of your project (ones listed in package.json, deno.json, or import map), deno install pkg installs a new dependency to your project (adding it to your config). deno install --entrypoint <file> is installing dependencies required by a file, treating that file as the entrypoint.

@uasi
Copy link

uasi commented Sep 19, 2024

deno install --entrypoint <file> is installing dependencies required by a file, treating that file as the entrypoint.

That clears up my question, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants