Reputation: 10826
I've seen that deno
does not anymore require package.json
(supported by npm/yarn) to describe its dependencies.
But for build/run scripts, is package.json
the proposed descriptor or is there any other build tool/descriptor format that better suits?
Upvotes: 2
Views: 515
Reputation: 8540
Deno has a built-in Task Runner since v1.20 (released Mar 17, 2022).
Commands are defined in the project's Deno configuration file under a "tasks"
key. For example:
{
"tasks": {
"data": "deno task collect && deno task analyze",
"collect": "deno run --allow-read=. --allow-write=. scripts/collect.js",
"analyze": "deno run --allow-read=. scripts/analyze.js"
}
}
Tasks are listed with deno task
and run with deno task task-name [additional-args]...
. E.g. the data
task would be run with deno task data
.
More details in the Task Runner docs. (This link points to the latest version's docs.)
However, in the v1.26.1 (the latest version as of Oct 16, 2022) docs, the Task Runner is still considered unstable:
⚠️
deno task
was introduced in Deno v1.20 and is unstable. It may drastically change in the future.
I don't know which build tool is recommended with Deno, but my hunch is that it would be the Task Runner, at least once it becomes stable, as it's built-in to Deno.
Upvotes: 1
Reputation: 900
Take a look at Drake (https://deno.land/x/drake), a Make-like task runner I wrote for Deno, inspired by Make, Rake and Jake.
Upvotes: 1
Reputation: 40414
Deno doesn't support package.json
.
Currently, there's no built-in nor recommended build tool, but you can use any build tool of your preference: Make
, npm scripts
, etc.
There are some packages that aim to be a alternative to npm scripts
for Deno, such as
Upvotes: 2