A template repo for developing modules with deno.
- DO NOT use import_map.json imports for actual library code! (That is, code that is exported from
mod.ts)
Reason: Once it's consumed by another programmer off of, for example, deno.land/x, the import_map.json file of the imported module WILL NOT BE LOADED! - However, you CAN use import_map.json import in tests or example code, which i find very useful, because it enables me to simply pull in my testing dependencies with a concise, absolut import.
- Your test code should import all of your classes and functions from the mod.ts entrypoint. This ensures that you only test the API Surface of your module and not implementation details. If you absolutely need to validate some internal functionality, do it, but know what you do!
.vscode= A folder,- containing a
settings.jsonwhich activates the deno language server for this workspace - containing a
extensions.jsonwith recommended vscode extensions for this workspace
- containing a
example= A folder, containing entry deno files for demonstrating the modules functionalities- contains
main.ts- the default file for examples
- contains
importMap.json= A file, including dependency mappings to urldeps- a folder to re-export dependencies (for example to group testing dependencies into one import)lib= A folder containing more source files which are exported bymod.ts- Hint: you may create multiple of them to structure your module.
.gitignore= A normal gitingore filedeno.jsonc- a config file for the deno cli- includes tasks (a.k.a aliases for long commands) with
deno task
- includes tasks (a.k.a aliases for long commands) with
LICENSEmod.ts= the entrypoint for this deno module, which exports all functionality of this moduleReadme.md= A normal Readme file
see tasks property in deno.jsonc
Run each key there with deno task <task-key>