Denoify
HomeGitHub
  • 🚀Quick start
  • 🔀.deno.ts files
  • 🔧Build options
  • 🪄Special comments
  • 🔍Automatic discovery of ports
  • 📤Publishing on deno.land/x
  • 🆘Deal with GitHub API rate limit exceeded
  • 📚Other resources
Powered by GitBook
On this page
  • Examples of resolutions that denoify can perform automatically
  • Input
  • Output
  • Troubleshooting

Was this helpful?

Edit on GitHub
Export as PDF

Automatic discovery of ports

PreviousSpecial commentsNextPublishing on deno.land/x

Last updated 2 years ago

Was this helpful?

If you have published your module both on and NPM Denoify should be able to automatically resolve your Deno distribution, what do I mean by that?

Examples of resolutions that denoify can perform automatically

Let's assume we are in a project, in our node_modules directory we have the following three Denoified modules:

  • in version 0.10.1

  • in version 0.4.3

  • in version 0.6.0

Input

// src/foo.ts
import { assert } from "tsafe/assert";
import type { Equals } from "tsafe";
import * as ns from "my-dummy-npm-and-deno-module";
import { Cat } from "my-dummy-npm-and-deno-module/dist/lib/Cat";
import { createLexer } from "leac";

Output

Now if we run npx denoify it will generates this:

// deno_dist/foo.ts
import { assert } from "https://deno.land/x/tsafe@v0.10.1/assert.ts";
import type { Equals } from "https://deno.land/x/tsafe@v0.10.1/mod.ts";
import * as ns from "https://deno.land/x/my_dummy_npm_and_deno_module@v0.4.3/mod.ts";
import { Cat } from "https://deno.land/x/my_dummy_npm_and_deno_module@v0.4.3/lib/Cat.ts";
import { createLexer } from "https://deno.land/x/leac/v0.6.0/mod.ts";

If tsafe wasn't published on deno.land/x instead of https://deno.land/x/tsafe@v0.10.1/assert.ts we would have https://raw.githubusercontent.com/garronej/tsafe/v0.10.1/deno_dist/assert.ts.

Denoify always find the files on GitHub first and then try to see if it can get the same file with a deno.land/x url on a best effort basis.

If you want it to work your repo should have the same name as the deno module you have published ( we replace the - by _ ).

Troubleshooting

For some reason, automatic resolution dosen't work well with your module?

Please reach out by opening a discussion!

If you want to check for common problem before contacting the community here are some things you might want to check out:

If you are using define instead.

Makes sure you do not get when you run npx denoify. If you do make sur your is correct.

Makes sure you have a repository field in your package.json that points to the correct repo.

Make sure you for . (A git tag is created when you create a GitHub Release)

Make sure there is always a tsconfig.json file at the root of your repo, on every version tag, and that it specifies the option .

🔍
deno.land/x
tsafe
my-dummy-npm-and-deno-module
leac
the --out CLI parameter
denoify.out in your package.json
this message
main property of your package.json
Example
create a git Tag
every NPM version you release
compilerOptions.outDir
LogoDiscussions · garronej/denoifyGitHub