Using Deno 2.0.6 on Windows 11
I'm using civet 0.8.7 to produce *.js files and civet doesn't yet support things like:
import {assert} from 'jsr:@std/assert'
import {globSync} from 'npm:glob'
NOTE: this is NOT an issue with civet itself - it's regarding imports in deno
i.e. the jsr: and npm: isn't allowed. I thought that the solution would be to add these to my deno.jsonc imports key:
"@std/assert": "jsr:@std/assert@^1.0.8",
"glob": "npm:glob@^11.0.0",
However, when I try to import a file containing:
import {assert} from '@std/assert'
import {globSync} from 'glob'
I get the error message:
error: Relative import path "@std/streams" not prefixed with / or ./ or ../
hint: If you want to use a JSR or npm package, try running `deno add jsr:@std/streams` or `deno add npm:@std/streams`
at file:///C:/Users/johnd/vllu/src/lib/llutils.js:7:30
I thought that with the entries for "@std/assert" and "glob" in my deno.jsonc file (inside the "imports" key), deno would realize that these are NOT relative imports?
FYI, I did try running 'deno add jsr:@std/streams' as suggested. It runs fine, but I still get the error message above, so it didn't help.
FYI, here is my entire deno.jsonc
file:
{
// --- Comments and trailing commas allowed!
"tasks": {
"build:llutils": "civet --js -o .js --inline-map -c src/lib/llutils.civet",
"build:compile": "civet --js -o .js --inline-map -c src/bin/compile.civet",
"install:compile": "deno install -fgA src/bin/compile.js",
"build": "deno task build:llutils && deno task build:compile && deno task install:compile && compile",
},
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.8",
"@std/async": "jsr:@std/async@^1.0.9",
"@std/cli": "jsr:@std/cli@^1.0.6",
"@std/path": "jsr:@std/path@^1.0.8",
"@std/streams": "jsr:@std/streams@^1.0.8",
"glob": "npm:glob@^11.0.0",
},
}