- v1.6.16Latest
- v1.6.15
- v1.6.15-rc.1
- v1.6.15-rc.0
- v1.6.14
- v1.6.13
- v1.6.12
- v1.6.11
- v1.6.10
- v1.6.9
- v1.6.8
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.1
- v1.6.0
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.6
- v1.1.5
- v1.2.0-beta.0
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.16.0
- v0.15.2
- v0.15.1
- v0.15.0
- v0.14.1
- v0.14.0
- v0.13.1
- v0.13.0
- v0.12.0
- v0.11.7
- v0.11.6
- v0.11.5
- v0.11.4
- v0.11.3
- v0.11.2
- v0.11.1
- v0.11.0
- v0.10.6
- v0.10.5
- v0.10.4
- v0.10.3
- v0.10.2
- v0.10.1
- v0.10.0
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.5
- v0.6.4
- v0.6.3
- v0.6.2
- v0.6.1
- v0.6.0
- v0.5.12
- v0.5.11
- v0.5.10
- v0.5.9
- v0.5.8
- v0.5.7
- v0.5.5
- v0.5.4
- v0.5.3
- v0.5.2
- v0.5.1
- v0.4.14
- v0.4.13
- v0.4.12
- v0.4.11
- v0.4.10
- v0.4.9
- v0.4.8
- v0.4.7
- v0.4.6
š¦ Support Deno and release on NPM with a single codebase.š¦
NEW IN v0.5 Breaking changes
-All Denoify parameters are now gathered under a uniq "denoify"
field.
-Possibility to specify which files should be copied to the deno_dist
directory (Previously only README.md
vas copied).
Valid config example
What it is
A build tool that takes as input a TypeScript codebase that was meant to target node and/or the web and spits out a modified version of the source files ready to be deployed as a Deno module.
NOTE: Denoify wonāt run on Deno, it is a Node module.
If you are just looking for a quick way to load NPM modules in your Deno project
you can check out CommonJS module Loading,
unlike Denoify, it wonāt give you types definitions, it will involve node_modules/
and require --allow-read
but it will also be easier to get working.
Some NPM modules can also be imported into Deno using CDN like Skypack (ex Pika) or jspm
checkout Soremwar/deno_types for some examples.
This tool is mainly for NPM module maintainer, to enable them to bring first-class citizen Deno support to their modules and doing so without introducing breaking changes.
Motivations
- Although it is quite easy to port a module to Deno no one wants to maintain two codebase.
- Wouldnāt it be great to have a tool able to bring Deno support to NPM modules?
Example of modules using Denoify
Modules that have been made cross-runtime using Denoify:
Introduction video
NOTE: New features have been introduced since this meeting was hold
Limitations
Coming up next is a detailed guide on how to set up denoify with your project and how to publish on deno.land/x but before anything here are the current limitations you need to be aware of.
- If your module is vanilla JS it needs to be ported to TypeScript first. (1)
- Not all Nodeās builtin are supported yet. (2) But thanks to the new mechanism,
Ć la React Native,
that let you have specific deno implementation for some of your files, the
lack of support for
"https"
or"net"
, while being annoying, is no longer a dead end. - If your module has dependencies you will have to enable those dependencies to run on Deno. While well documented, be aware that it is a time consuming process.
require()
is not yet supported.- You canāt (yet)
fs.readFile()
files that are part of the module ( files inside ares/
directory for example ). (4)
(1) Donāt be afraid, renaming your source with .ts
and dropping some any
here
and there will do the trick.
You will be able to pull it off even if you arenāt familiar with typescript. Ref
(2) You can consult here the current state of the Nodeās builtin support.
(4) In Deno the files that forms your module wonāt be pre-fetched and
placed in node_module
like in node so you wonāt be able to access files that are not
on the disk.
GUIDES
Setting up an existing project
Check out this repo to see in practice how to set up Denoify in your project.
Starting a project from scratch
denoify_ci is a template repo that automates the boring and tedious tasks of:
- Filling up the
package.json
- Setting up TypeScript and Denoify.
- Writing a README.md with decent presentation and instructions on how to install/import your module in different environments.
- Testing with multiple
Node
andDeno
versions before publishing. - Publishing on NPM and deno.land/x ( via GitHub releases ).
NEW v0.4.0: Now that deno.land/x allows to publish modules under a subdirectory of a GitHub repo
denoify no longer generate a mod.ts
at the root of the project but under deno_dist
. deno_dist
should be stipulated
as subdirectory when registering your module on deno.land/x.
TODO LIST / Things that need to change
- Support
baseUrl
tsConfig option. (Import non relative path relative tobaseUrl
) - Support
myModule.deno.ts
alongsidemyModule.ts
for deno specific implementation of part of the code. (Like in React Native) - Support custom
import/export
statements replacer. - š„ Leverage CDNs like Skypack (ex Pika) or jspm to support more NPM modules out of the box, feature side loading of type definitions.
- Support
.tsx
The sticker