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

Lock file not supported by deno bundle #6491

Closed
implicitdef opened this issue Jun 26, 2020 · 4 comments · Fixed by #6624
Closed

Lock file not supported by deno bundle #6491

implicitdef opened this issue Jun 26, 2020 · 4 comments · Fixed by #6624
Labels
good first issue Good for newcomers

Comments

@implicitdef
Copy link
Contributor

--lock <FILE> and --lock-write options are supported by deno run, deno cache, but not deno bundle.
I don't see why, I think it should. Probably deno test too, maybe deno doc as well ?
In short, all methods that may fetch remote modules should offer to check the lock-file or overwrite it.

This is the workflow I had in mind :

# Create lock file the first time
deno cache --lock=lock.json --lock-write index.ts

# Then work locally everyday with this command
deno run --lock=lock.json index.ts

# then I want to create a bundle that I'll send in production
# I'll use the lock file to be sure of what I'm bundling
deno bundle --lock=lock.json index.ts dist/bundle.js
# error: Found argument '--lock' which wasn't expected, or isn't valid in this context

# For now we can do this in two steps, I thinks it's equivalent ?
deno cache --lock=lock.json index.ts
deno bundle index.ts dist/bundle.js
@kitsonk kitsonk mentioned this issue Jun 27, 2020
18 tasks
@kitsonk
Copy link
Contributor

kitsonk commented Jun 27, 2020

We should support consumption of lock files with bundle.

@bartlomieju bartlomieju added the good first issue Good for newcomers label Jul 3, 2020
@bartlomieju
Copy link
Member

Marking as "good first issue". Here's a gist of what needs to be done to implement this feature:

  • in cli/flags.rs add lock_arg() and lock_write_arg() to bundle command - see cache_subcommand for example
  • add test in cli/flags.rs exercising these flags
  • add integration test in cli/tests/integration_tests.rs that exercises failure to bundle when integrity check fails - see lock_dynamic_imports test for example

@TETRA2000
Copy link
Contributor

Hi! Can I take this?

@bartlomieju
Copy link
Member

@TETRA2000 sure, go ahead

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

Successfully merging a pull request may close this issue.

4 participants