staytuned_team
staytuned_team
DDeno
Created by staytuned_team on 5/8/2025 in #help
Support for tags in custom Deno lint plugins
Hi everyone! I’m working on a custom Deno lint plugin that currently defines about ten rules. I’d like to be able to group those rules into named “tags” (for example, frontend, backend, performance, etc.) so that in one project I can enable only the rules tagged frontend and in another project only those tagged backend. Right now, Deno’s built-in lint rules support tagging and allow you to enable or disable rules by tag, but custom plugins don’t expose that same functionality. Would it be possible to add tag support for custom lint plugins so we can define and consume tags just like the built-in rules? Any guidance on how to implement this or interest in adding it to the core would be greatly appreciated thanks!
1 replies
DDeno
Created by staytuned_team on 3/25/2025 in #help
Problems with Nested deno.json in Deno Workspaces
Hello , I'm encountering an issue in Deno workspaces with nested deno.json files. As reported in my GitHub issue [https://github.com/StaytunedLLP/open_poc/issues/4], adding deno.json inside subfolders (like feature folders fe_ and sy_ within workspace packages) leads to red squiggles and broken import navigation in VS Code (using the Deno extension). The code runs correctly, but the editor experience is really suffering. I'm wondering if anyone can offer guidance on: * Is this a known limitation or bug in the Deno VS Code extension or Deno itself? * Is there a recommended workaround or configuration to avoid this issue when using nested deno.json in workspaces? I've provided detailed reproduction steps, example folders (deno-workspace-working and deno-workspace-not-working in the linked issue), and screenshots in the GitHub issue. Any help or direction would be greatly appreciated! Thanks in advance for your support!
13 replies
DDeno
Created by staytuned_team on 2/12/2025 in #help
Resolving Dependencies for Local ESM NPM Packages in Deno
Hi Deno Community, I'm seeking guidance on the best approach for a setup involving a Deno application and a local, unpublished npm package using ESM. I'm having trouble with Deno automatically resolving the npm package's dependencies without explicit declarations in Deno's config file. Here's the project structure:
local_module/
├── package1/ (NodeJS package using CJS)
│ ├── index.js
│ └── package.json
│ └── package-lock.json
├── package2/ (NPM package using ESM)
│ ├── dist/
│ │ └── index.js
│ ├── src/
│ │ └── index.ts
│ ├── package.json
│ ├── package-lock.json
│ └── tsconfig.json
└── deno-app/ (The Main Deno Application)
├── main.ts
└── deno.json
local_module/
├── package1/ (NodeJS package using CJS)
│ ├── index.js
│ └── package.json
│ └── package-lock.json
├── package2/ (NPM package using ESM)
│ ├── dist/
│ │ └── index.js
│ ├── src/
│ │ └── index.ts
│ ├── package.json
│ ├── package-lock.json
│ └── tsconfig.json
└── deno-app/ (The Main Deno Application)
├── main.ts
└── deno.json
package2 Structure: * package2/src/index.ts:
import { v4 as uuidv4 } from 'uuid';
import { marked } from 'marked';

function hello(): string {
return "Hello from package 2 !" + uuidv4();
}

function processText(text: string){
const upper = text.toUpperCase();
return marked.parse(upper);
}

export { hello, processText };

import { v4 as uuidv4 } from 'uuid';
import { marked } from 'marked';

function hello(): string {
return "Hello from package 2 !" + uuidv4();
}

function processText(text: string){
const upper = text.toUpperCase();
return marked.parse(upper);
}

export { hello, processText };

* package2/package.json:
{
"name": "package2",
"version": "1.0.0",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc"
},
"dependencies": {
"lodash": "^4.17.21",
"marked": "^15.0.6",
"uuid": "^11.0.5"
},
"devDependencies": {
"@types/node": "^22.12.0",
"typescript": "^5.7.3"
}
}

{
"name": "package2",
"version": "1.0.0",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc"
},
"dependencies": {
"lodash": "^4.17.21",
"marked": "^15.0.6",
"uuid": "^11.0.5"
},
"devDependencies": {
"@types/node": "^22.12.0",
"typescript": "^5.7.3"
}
}

* deno-app/main.ts:
import * as p2 from "package2";

console.log(p2.hello());
console.log(p2.processText("test string to process"));

import * as p2 from "package2";

console.log(p2.hello());
console.log(p2.processText("test string to process"));

* deno-app/deno.json:
{
"imports": {
"package2": "../package2/dist/index.js",
},
"tasks": {
"run" : "deno run --allow-read main.ts "
}
}

{
"imports": {
"package2": "../package2/dist/index.js",
},
"tasks": {
"run" : "deno run --allow-read main.ts "
}
}

7 replies
DDeno
Created by staytuned_team on 11/15/2024 in #help
Issue with deno emit bundle in Workspaces - Need Help and Documentation
Hi everyone, I'm having trouble with deno emit bundle function, when my project is in workspaces. It seems like the bundling process doesn't support workspaces. Has anyone encountered this issue before and can provide an example of how to handle this use case? Are there any official docs available that address this? taking example from the official deno workspace docs: https://docs.deno.com/runtime/fundamentals/workspaces/ and deno/emit docs: https://jsr.io/@deno/emit after creating the files mentioned in the doc, i.e.:
/
├── deno.json
├── main.ts
├── add/
│ ├── deno.json
│ └── mod.ts
└── subtract/
├── deno.json
└── mod.ts
/
├── deno.json
├── main.ts
├── add/
│ ├── deno.json
│ └── mod.ts
└── subtract/
├── deno.json
└── mod.ts
add two files 1. import_map.json 2. bundle.ts // bundle.ts:
import { bundle } from "jsr:@deno/emit";
const result = await bundle(
"./main.ts",
{
importMap: "./import_map.json"
}
);

const { code } = result;
console.log(code);
import { bundle } from "jsr:@deno/emit";
const result = await bundle(
"./main.ts",
{
importMap: "./import_map.json"
}
);

const { code } = result;
console.log(code);
the following error occures which bundling:
error: Uncaught (in promise) Error: Unable to output during bundling: load_transformed failed: failed to analyze module: failed to resolve @scope/add from file:///C:/Users/ASUS/Downloads/emit/main.ts: Cannot resolve "@scope/add" from "file:///C:/Users/ASUS/Downloads/emit/main.ts".
error: Uncaught (in promise) Error: Unable to output during bundling: load_transformed failed: failed to analyze module: failed to resolve @scope/add from file:///C:/Users/ASUS/Downloads/emit/main.ts: Cannot resolve "@scope/add" from "file:///C:/Users/ASUS/Downloads/emit/main.ts".
Thanks in advance for your help!
7 replies
DDeno
Created by staytuned_team on 11/13/2024 in #help
does deno_graph natively resolve the path of workspaces?
Hi everyone, I'm working on a project that includes multiple workspace members defined in my deno.json file using the workspaces field. I'm using deno_graph to resolve dependencies, but I noticed that while it allows specifying an import_map, there's no option to include the deno.json file directly. Does deno_graph natively understand and resolve workspaces specified in deno.json? If so, how can I configure it to resolve dependencies across all workspace members? If not, what would be the recommended approach to handle dependencies in a multi-workspace setup using deno_graph? Any guidance would be greatly appreciated! reference: deno_grpah jsr Thank you.
6 replies