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

deno vendor import map should keep the entries of the existing import map #16037

Open
oscarotero opened this issue Sep 26, 2022 · 2 comments
Open
Labels
bug Something isn't working correctly vendor related to the vendor subcommand

Comments

@oscarotero
Copy link
Contributor

oscarotero commented Sep 26, 2022

The import_map.json file generated by deno vendor doesn't contain the imports of the existing import_map.json. This makes script to fail because these import entries are missing.

As an example, Lume uses the following import map:

{
  "imports": {
    "lume/": "https://deno.land/x/[email protected]/"
  }
}

To vendor a Lume project, the script take 2 lume files and the _config.ts file:

deno vendor \
https://deno.land/x/[email protected]/task.ts \
https://deno.land/x/[email protected]/cli.ts \
./_config.ts

The vendor/import_map.json file doesn't include the lume/ import, so it fails.

Lume has a lume vendor command to run deno vendor and fix the new import_map.json file by adding automatically the missing imports (https://github.com/lumeland/lume/blob/f9866692391ed4d7500494b9d2b29de0921f9f26/cli/vendor.ts#L55-L63) but I think this is something that Deno should do.

@dsherret dsherret added bug Something isn't working correctly vendor related to the vendor subcommand labels Sep 28, 2022
@dsherret
Copy link
Member

I think it maybe doesn't keep the entry because it can't find the import entry in the code. I'm not sure though.

@oscarotero
Copy link
Contributor Author

I think it should keep all entries, even those not found in the code, because it may be present in other places. For example dynamic imports or, like in the Lume case, a task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly vendor related to the vendor subcommand
Projects
None yet
Development

No branches or pull requests

2 participants