I'm developing a Deno framework, let's call it Argos. Like Oak/Express/Koa/etc., it is used to build applications on top of. I have another project (let's call it Deimos) that uses Argos.
Argos uses NPM specifiers for imports declared in an import map, and an alias for the lib folder, similar to this:
{
"imports": {
"~/": "./lib/",
"envalid": "npm:envalid"
}
}
My file heirarchy looks like this:
- projects
- argos
- mod.ts
- import_map.json
- deimos
- mod.ts
- import_map.json
I'm having trouble importing Argos inside of Deimos. If I try the following inside Deimos:
import * as argos from "../argos/mod.ts";
... that "works" but none of my imports are typed; as in, Deno can find the file at that location, but it cannot resolve any of the imports in Argos' import_map.json (eg., all of the "~/" import statements inside Argos) because they aren't declared in Deimos' import map. Anything I import has the type "any".
If this were a Node project, I might use a library like Yalc to do a "local publish" of Argos, but it's unclear to me what the Deno equivalent might be. I'm rapidly developing Argos and find it very useful to design the public API by frequently integrating it into Deimos.
Is there a pattern in Deno to support this type of development that I'm missing?