Mqx
import_map.json not working
I am currently trying to checkout an project in Deno 2.0.0 and when I try to run a task I get a warning and error:
My deno.json looks like this:
My import_map.json is placed at:
Does anyone know why I get this warning and error?
6 replies
Using SolidJS with Deno
Hey I am currently trying to set up a template for SolidJS development with Deno and I am unable to figure out how to set the deno.json configuration correctly. Especially the compilerOptions.
Can someone please give me an example on how to setup the JSX stuff? I am always getting errors that my config is invalid.
Thanks.
14 replies
Binary files in jsr package
Hey I am currently trying to understand the „new“ (for me) package format (
jsr.json
) for Deno packages and I was wandering how binary files are handled in such a package when using the package.
For example if I have a DLL file for my ffi module can I just include it in the include
statement inside the jsr.io
file so that it gets cached when I use the package? Or do I need relay on a library like plug that downloads non ts/js files that I need?11 replies
Use ESLint with Deno
Is it possible to use ESLint with Deno? I know that Deno has a build in formatter and linter but the ruleset is kinda small and plug-ins are not supported yet.
Are there any guides out there on how to use ESLint with Deno?
Thanks
21 replies
`declare module` doesn’t work
I was trying to declare a module like so:
But this simply doesn’t have any effect whatsoever.
I also tried this:
None of this worked. I don’t know if .d.ts file are simply ignored by Deno or if this is a bug, or I have done something wrong.
This is the GitHub Issue: https://github.com/denoland/deno/issues/23007
I appreciate any help 👍🏻 Thanks
35 replies
Import SCSS in TS files
Hey, I am currently building a template for web development and I want to use ESBuild as a bundler. I use lit in combination with SASS. For SASS files I use the esbuild-sass-plugin from npm in Deno. This works fine and ESBuild successfully resolves and bundles the .scss files imported into the .ts files. However deno-ts marks the default import as red because it is not valid js/ts how can I specify this in the config for Deno so that the files get recognized as SCSS files/plain text?
51 replies
Creating custom GitHub Action using Deno
Hey, I am currently trying to develop my first own custom GitHub Action. I have some trouble setting up my environment. I really don't want to use Node and try to stick to Deno, but this is easier said than done.
Can someone help me setting a basic action up? Thanks!
This is my current repo where I try to set everything up: https://github.com/Datapack-Registry/minecraft-manifest
7 replies
walk() include only last directory...
Hey, I'm currently trying to write a replacer for file names, file content and folder names. My goal is to crawl over a certain directory and then replace a certain pattern in file names, file content and folder names. Currently I use the walk() function from the std library. My problem now is that walk() returns every single directory and not just the last one. In other words, walk() does not just give me:
but:
What is the best way to filter this?
There may also be a better method...
This is what my current attempt looks like:
6 replies
ESBuild SASS Plugin
Hey,
I have developed this Plugin: https://github.com/DenoPlayground/esbuild-plugin-sass
But I have some problems with the import paths from the SASS module. Maybe someone can help me to debug this, since ESBuild does not have an official community server.
The problem at the moment is that when the SASS module tries to resolve an import it does that by assuming that the path is relative to the root directory and not the file that is currently processed. Maybe there is a way to account for this issue. For example if we would assume that this is our file structure and we import
colors.scss
into style.scss
.
When the SASS module resolves the import it is trying to load the colors.scss
from:
Because this is where the initial task gets started. But I can not simply set the new root to:
Because then all my other tasks would not work.28 replies
How to uploading images from frontend to Deno.serve()
Hey,
can someone please give me a vanilla code example on how to upload files from my frontend application to the server that uses
Deno.serve()
.
I know how to upload the image in the frontend and send it to the Deno backend using a POST request, but how can I work with this image on the server side?
Currently my backend is set up without any framework.
Thanks!9 replies
Deno lint custom rules
Hey is there currently a way to create custom rules for Deno lint? And if so how can I specify a custom rule?
If there is no way to create custom rules, can I use ESLint with Deno without having to install Node?
And I know I can install ESLint as a global „script“ but that still requires Node to be installed.
Thanks ~Mqx
3 replies
Using ESBuild with Deno
Hey, is anyone more familiar with ESBuild? I am currently trying to transpile my Deno TypeScript project with ESBuild in JavaScript. But I don't want to bundle the files. I just want to transpile them and put them under the same path instead of
src
in dist
. I'm currently doing the whole thing like this:
Problem with this is that it does not resolve the import paths properly. At the end there is still the .ts
extension in the import. Another problem is, for example, the ESBuild tries to convert the .d.ts
files into .d.js
which are then simply empty.38 replies
Using Deno in Frontend.
Hey, I was wandering if it is possible to use Deno for Vanilla Frontend development. I dont want to use a Framework like Oak or Fresh, I just want to use Vanilla TypeScript instead of JavaScript in my Frontend. As an example I just want types/typechecking for developing, build my Frontend and then transpile the whole thing to a JS-Bundle that I can then load in the Frontend. Now I have 2 problems. First is how to transpile my TypeScript to a JS-Bundle (I can do that with the emit module), and the second is how can I get the DOM in TypeScript. I have found this in the manual but I am not really sure how to use it.
Can someone explain to me how to setup the DOM for TypeScript development in the Frontend. And also whats about Deno.* APIs? How does the emit module handle this?
Thanks! ~Mqx
20 replies
dlopen() from web url
Hey, is it possible to provide a url to the dll file from a cdn server?
For example if I want to dlopen the dll from this url:
„https://raw.githubusercontent.com/TypeScripPlayground/Serial/main/ts/bin/windows.dll “ I get an error:
Could not open library, module not found
3 replies
Deno type enforcement
Hey, I have a question about the type checking.
This should throw an error when trying to run it, but apparently it does not. But why? We tried using the tsc compiler from Node and it clearly throws an error, saying that the type string is not assignable to type number.
Is there something I need to change in the config for Deno to get the same error result?
Thanks ~Mqx
2 replies
VS-Code auto import local modules
Hey is there a way to enable some sort of auto import for local modules/files in VS-Code? Currently it only works if the file is opened in an other tab. When I close the tab an try to use autocomplete an exported module from that file it does not auto import. Is there a fix to this? Or some settings?
Thanks for any help!
3 replies