https://github.com/codemonument/deno_module_template
A template made for publishing a module to deno.land/x
https://github.com/codemonument/deno_module_template
Last synced: about 1 month ago
JSON representation
A template made for publishing a module to deno.land/x
- Host: GitHub
- URL: https://github.com/codemonument/deno_module_template
- Owner: codemonument
- License: other
- Created: 2022-04-20T18:56:59.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T10:17:11.000Z (almost 3 years ago)
- Last Synced: 2025-01-25T15:41:24.659Z (over 1 year ago)
- Language: TypeScript
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Deno Module Template
A template repo for developing modules with deno.
## CAUTION!
- 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, 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!
- The "examples" folder has it's own deno.jsonc file with an import map to separate it from the main import map
## How to work with this template
TODO @bjesuiter
## Folder Structure
- `.vscode` = A folder,
- containing a `settings.json` which activates the deno language server for this workspace
- containing a `extensions.json` with recommended vscode extensions for this workspace
- `examples` = A folder, containing entry deno files for demonstrating the modules functionalities
- contains `main.ts` - the default file for examples
- `importMap.json` = A file, including dependency mappings to url
- `src` = A folder containing more source files which are exported by `mod.ts`
- Hint: you may create multiple of them to structure your module.
- `src/deps` - a folder to re-export dependencies for your library code
- `.gitignore` = A normal gitingore file
- `deno.jsonc` - a config file for the deno cli
- includes tasks (a.k.a aliases for long commands) with `deno task`
- `LICENSE`
- `mod.ts` = the entrypoint for this deno module, which exports all functionality of this module
- `Readme.md` = A normal Readme file
## Running examples
see `tasks` property in `deno.jsonc`
Run each key there with `deno task `
## Configure Deployments to deno.land/x
see https://deno.land/add_module