CookieMonster
CookieMonster•16mo ago

Manual | Deno

Sorry for the delayed response. My deno.json looks like the following inside the package directory mono-repo/packages/packageA inside our monorepo.
"imports": {
"fs": "node:fs",
"path": "node:path",
"dotenv": "https://deno.land/std@0.194.0/dotenv/mod.ts",
"flags": "https://deno.land/std@0.194.0/flags/mod.ts",
"@google-cloud/storage": "npm:@google-cloud/storage",
"@google-cloud/secret-manager": "https://esm.sh/@google-cloud/secret-manager@4.2.2/?exports=v1",
"windmill": "https://deno.land/x/windmill@v1.130.0/mod.ts"
}
"imports": {
"fs": "node:fs",
"path": "node:path",
"dotenv": "https://deno.land/std@0.194.0/dotenv/mod.ts",
"flags": "https://deno.land/std@0.194.0/flags/mod.ts",
"@google-cloud/storage": "npm:@google-cloud/storage",
"@google-cloud/secret-manager": "https://esm.sh/@google-cloud/secret-manager@4.2.2/?exports=v1",
"windmill": "https://deno.land/x/windmill@v1.130.0/mod.ts"
}
Inside the f/scripts/main.ts module I am trying to do an import like
import * as fs from 'fs';
import * as fs from 'fs';
using deno import maps similar to https://deno.land/manual@v1.35.1/basics/import_maps.
19 Replies
Sindre
Sindre•16mo ago
I do not believe windmill is using your import maps. If it works locally you have set it up correctly
CookieMonster
CookieMonster•16mo ago
@Sindre do you know if windmill supports deno import maps? not seeing anything in the docs. Import maps are important I think for intellisense using IDEs like JetBrains Webstorm or VS Code.
Sindre
Sindre•16mo ago
so i have set it up locally, but only for windmill path, I'm not sure I understand what your need is. you get intellisense in vscode without import maps. Could you descripe what you are trying to achive a bit more? with windmill path, I mean that I can ref "/f/<folder>/<script>" or the user path, and get intellisense on that. But if I import from "node:fs" I still get help from vscode
CookieMonster
CookieMonster•16mo ago
gotcha let me see if i can be more clear
CookieMonster
CookieMonster•16mo ago
trying to understand why VS Code and Webstorm does not reconize the the following import maps from deno.json
No description
No description
CookieMonster
CookieMonster•16mo ago
The script runs fine locally, but when i push up to to our windmill instance it says it cannot find the import path definition.
No description
Sindre
Sindre•16mo ago
I do not think windmill loads your deno.json. But to alias "npm:*" and set versions make a lot of sense. I think ruben will fix this for you. But currently I'm 95% sure it is not supported by windmill
CookieMonster
CookieMonster•16mo ago
gotcha. The issue I then have is if I don't use import maps, My intellisense does not work because I believe deno installs / caches them locally only if you are using import maps for local development but maybe i am mistaken
Sindre
Sindre•16mo ago
do you have the deno extention from denoland in vscode? if that is what you are using ?
CookieMonster
CookieMonster•16mo ago
Also I think supporting import maps would be super important for larger projects where a team is trying to pin or alias a version of a package dependency
Sindre
Sindre•16mo ago
if vscode: in the bottom right corner it should not say "typescript" but "deno" if deno is enabled and setup is correct.
CookieMonster
CookieMonster•16mo ago
I am using webstorm ATM but yes i have the deno plugin installed for IntelliJ https://plugins.jetbrains.com/plugin/14382-deno
JetBrains Marketplace
Deno - IntelliJ IDEs Plugin | Marketplace
Adds support for Deno in WebStorm and other JetBrains IDEs, including PhpStorm, and IntelliJ IDEA Ultimate. To learn more about how to get started with Deno, check out...
Sindre
Sindre•16mo ago
yeah, a super valid use case you have
CookieMonster
CookieMonster•16mo ago
I can tell my intellIJ think the package is deno because of the deno warnings
Sindre
Sindre•16mo ago
not used webstorm so cant help you with that. It's not working even if you are clicking on the import and choosing to cache them?
CookieMonster
CookieMonster•16mo ago
No description
CookieMonster
CookieMonster•16mo ago
let me do a bit more research on the import mechanics for deno plugin using JetBrains IDEs
Sindre
Sindre•16mo ago
need to leave, but would just continue with other problem I'm sure you have, developemen is just from one error to the next one 🙂 And this will prop be fixed for you 🙂
CookieMonster
CookieMonster•16mo ago
awesome, thanks for responding Sindre! have an awesome day