hasundue / molt

Update dependencies the Deno way
https://jsr.io/@molt
MIT License
60 stars 5 forks source link

Local imports are ignored when coexisting with mapped imports #180

Closed hasundue closed 1 month ago

hasundue commented 1 month ago

For example, suppose we have a following mod.ts:

export { createGraph } from "https://deno.land/x/deno_graph@0.50.0/mod.ts";

And molt can update deno_graph with the following mod_test.ts:

import { assertEquals } from "jsr:@std/assert@0.222.0";
import { describe, it } from "jsr:@std/testing@0.222.0/bdd";
import { createGraph } from "./mod.ts";

describe("createGraph", () => {
  it("should be a function", () => {
    assertEquals(typeof createGraph, "function");
  });
});

But skips it unexpectedly with the following mod_test.ts and deno.json:

import { assertEquals } from "@std/assert";
import { describe, it } from "@std/assert/bdd";
import { createGraph } from "./mod.ts";

// ...
{
  "imports": {
    "@std/assert": "jsr:@std/assert@0.222.0",
    "@std/testing/bdd": "jsr:@std/testing@0.222.0/bdd"
  }
}
hasundue commented 1 month ago

My bad. The truth was that the import map contained a mapping from / to ./. But we should warn if a mapped local dependency is not found.