Dependency tree not resolving properly for deno modules in local filesystem.
Background:
I'm working on an application with many custom utilities as dependencies. I have these utilities divided out into smaller
Given these imports in the
deno.json
packages for better organization. All of these utility packages are on my local filesystem, and since I'm still working on development and planning still I'm unlikely to publish them at the moment. Some of these utilities depend on eachother and form a tree of package dependencies; all on my local filesystem. Some of the utilities are shared between multiple projects and are kept in a separate generic libs
folder on my filesystem.
Issue
For some reason I'm getting an error when trying to test my application with deno run
:Given these imports in the
deno.json
files for each package i'd expect it to work as expected:
- for @meep/kms
(the app which was run)
- for @meep/tsx
Any advice on what I'm doing wrong?5 Replies
As a note; I've also tried workspaces but they don't work because the utility packages aren't nested sadly
It's hard to say without seeing a whole project, but it looks like you're trying to use a separate import map in ea h directory
This is not supported outside of workspaces
So... Wait maybe I'm misunderstanding; Doesn't that mean Deno itself can't support nested dependencies for its own native type of packages?
If that's true I'm not sure how to work around this tbh ..
I guess I should ask then; how is one expected to manage a tree of local dependencies when developing an app in Deno?
I'm not saying that, I can't really advise here unless I can see the project structure and what you're trying to do
Most likely you want to use a workspace, but I can't be sure rn
Thanks for the reply to provide more info: The issue is workspaces seem to require a nested folder structure. Here is an example of my folder structure if that helps:
My issue with workspaces comes when both meep/projects/kms/libs/core and meep/projects/bbnf/libs/parser need to use the packages in the meep/libs/deno folder.
The only way I could see it working without some kind of nested workspaces or allowing workspace folders to be non-nested is if I make a deno.json file for each project but put it in the root meep/ folder which seems like an incorrect place for project files~