- v1.0.0-alpha.8Latest
- v1.0.0-alpha.7
- v1.0.0-alpha.6
- v1.0.0-alpha.5
- v1.0.0-alpha.4
- v1.0.0-alpha.3
- v1.0.0-alpha.2
- v1.0.0-alpha.1
- v1.0.0-alpha
- v0.9.0-alpha.2
- v0.9.0-alpha.1
- v0.9.0-alpha
- v0.8.0
- v0.8.0-alpha.1
- v0.8.0-alpha
- v0.7.1
- v0.7.1-alpha
- v0.7.0
- v0.6.1
- v0.6.0
- v0.6.0-alpha
- v0.5.1
- v0.5.0
- v0.4.1
- v0.4.0
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
- v0.0.1
- v0.0.0
edcb
edcb is a build tool and task runner for Deno. It has support for formatting, linting, testing, code coverage, bundling, and more, and it can be used via command line or TypeScript import.
Configuration
edcb can be be invoked via TypeScript. The cli.ts module exports the
edcb CLI. The specified options will serve as defaults. For example, one
can specify the ignore
option for the check
command, which will then be used
if the --ignore
flag was not provided on the command-line.
edcb will look for the dev.ts module in the working directory and
run it if it exists. This allows one to lock a particular edcb version to a
project. The edcb
CLI then essentially becomes an alias for
deno run -A --unstable dev.ts [args]
.
// file: dev.ts
import { cli } from "./cli.ts";
await cli({
check: {
ignore: "deps",
},
serve: {
port: 1234,
bundles: [{
source: "index.ts",
target: "index.js",
}],
},
});
Commands can be used individually by importing them from mod.ts.
import { check } from "./mod.ts";
await check({
ignore: "deps",
});
CLI
The edcb CLI can be installed with Deno.
deno install -f -A --unstable https://deno.land/x/edcb/cli.ts
After installation, one may run commands in the project directory.
edcb <command>
Supported commands:
Common Flags
These are flags that are available for all commands.
--debug
Displays sub-process output. Per default, the output is only logged if the process failed. For example, a developer may use the flag to see the full code coverage report in order to write tests for the missing lines.
edcb <command> --debug
check
Formats, lints, and tests the project. Code coverage will be displayed and can optionally be uploaded to codecov.io.
edcb check
--ci
Changes the behavior as follows:
- Runs the Deno formatter with the
--check
flag. - Generates a test coverage file.
- Uploads the test coverage file to codecov.io. This step likely fails on local systems.
edcb check --ci
--ignore
Ignores files and directories during formatting and linting. It has the same
format as the --ignore
option of deno fmt
and deno lint
.
edcb check --ignore=deps,docs
--temp
Provides the directory that is used to store temporary files. If none is
specified, a directory will be created in the standard location for temporary
files (e.g. /tmp
).
edcb check --temp=some/path
--tests
Selects test files in a sub-directory. This option is limited to a single file pattern.
edcb check --tests=src/test/*
serve
Starts an HTTP server with an optional WebSocket server that broadcasts file
system changes. Note that the serve
command would usually be used in
conjunction with a edcb configuration file. The reason is that
the bundles
option cannot be specified via CLI.
edcb serve
--hostname
Specify the hostname used for the HTTP listener.
edcb serve --port=8080
--port
Specify the port number used for the HTTP listener.
edcb serve --hostname=localhost
--reload
Enable file change broadcasts via WebSocket.
edcb serve --reload
--root
Specify the root path for the file watcher.
edcb serve --root=.
--web-root
Specify the public directory from which static files are served.
edcb serve --web-root=docs