ruahman9mo ago

How can I get deno to access internal packages from a workspace in npm or bun?

I have the following workspace setup. I would like to have a deno/oak/kv project in the same folder that can also reference the packages in the workspace. is that possible with deno?
No description
1 Reply
Deno AI Helper
Deno AI Helper9mo ago
Based on the documentation, Deno does support package.json and can resolve dependencies based on it. This means that if your internal packages are listed as dependencies in your package.json, Deno should be able to resolve them. However, the documentation does not provide a specific example of using Deno with npm or yarn workspaces, so I can't provide a definitive answer. Here's an example of how you might import a package from package.json:
import express from "express";
import express from "express";
And you can run scripts defined in the scripts section of your package.json with deno task:
deno task dev
deno task dev
However, please note that the support for scripts is currently limited to simple scripts. Programs like rimraf or cross-env will not work, but support for such programs will be added in an upcoming release. If you're having trouble with this setup, it might be helpful to check if Deno is enabled on your project, as the documentation mentions that errors like An import path cannot end with a '.ts' extension. or Cannot find name 'Deno'. usually indicate that Deno is not enabled. If you're still having issues, I would recommend checking your configuration and ensuring that the deno.enable setting is true. If you're still having trouble, it might be helpful to provide more information about the specific issue you're encountering. 🦕