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

fix(cli): Support deno.lock with only package.json present + fix DENO_FUTURE install interactions with lockfile #23918

Merged

Conversation

nathanwhit
Copy link
Member

@nathanwhit nathanwhit commented May 21, 2024

Fixes #23571.

Previously, we required a deno.json to be present (or the --lock flag) in order for us to resolve a deno.lock file. This meant that if you were using deno in an npm-first project deno wouldn't use a lockfile.

Additionally, while I was fixing that, I discovered there were a couple bugs keeping the future install command from using a lockfile.

With this PR, install will actually resolve the lockfile (or create one if not present), and update it if it's not up-to-date. This also speeds up deno install, as we can use the lockfile to skip work during npm resolution.

@nathanwhit nathanwhit force-pushed the local-install-lockfile-plus-package-json branch 3 times, most recently from 2b3c28a to 39e093f Compare May 22, 2024 17:22
@nathanwhit nathanwhit force-pushed the local-install-lockfile-plus-package-json branch from 39e093f to 9ee91a0 Compare May 22, 2024 19:00
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.

Good catch. Overall looks good to me. Can you ensure we have a test that validates against a deno.lock when installing and errors out if a dependency is broken and hash doesn't match?

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, I wonder if @dsherret has any comments?

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

Nice. LGTM!

@nathanwhit nathanwhit merged commit 5de30c5 into denoland:main May 23, 2024
17 checks passed
@nathanwhit nathanwhit deleted the local-install-lockfile-plus-package-json branch May 23, 2024 19:31
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.

Support deno lockfile in projects with only package.json
3 participants