Skip to content

Commit 9dcb66c

Browse files
author
Cédric Belin
committed
Update the build system [skip ci]
1 parent 578855d commit 9dcb66c

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

gulpfile.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import pkg from "./package.json" with {type: "json"};
66

77
/** Builds the project. */
88
export async function build() {
9-
await npx("tsc", "--build", "src/tsconfig.json");
9+
await run("npx", "tsc", "--build", "src/tsconfig.json");
1010
}
1111

1212
/** Deletes all generated files. */
@@ -17,41 +17,31 @@ export async function clean() {
1717

1818
/** Builds the documentation. */
1919
export async function doc() {
20-
await npx("typedoc", "--options", "etc/typedoc.js");
20+
await run("npx", "typedoc", "--options", "etc/typedoc.js");
2121
}
2222

2323
/** Performs the static analysis of source code. */
2424
export async function lint() {
25-
await npx("tsc", "--build", "tsconfig.json", "--noEmit");
26-
await npx("eslint", "--config=etc/eslint.js", "gulpfile.js", "example", "src", "test");
25+
await run("npx", "tsc", "--build", "tsconfig.json", "--noEmit");
26+
await run("npx", "eslint", "--config=etc/eslint.js", "gulpfile.js", "example", "src", "test");
2727
}
2828

2929
/** Publishes the package. */
3030
export async function publish() {
31-
await npx("gulp");
31+
await run("npx", "gulp");
3232
for (const registry of ["https://registry.npmjs.org", "https://npm.pkg.github.com"]) await run("npm", "publish", `--registry=${registry}`);
3333
for (const action of [["tag"], ["push", "origin"]]) await run("git", ...action, `v${pkg.version}`);
3434
}
3535

3636
/** Runs the test suite. */
3737
export async function test() {
38-
await npx("tsc", "--build", "src/tsconfig.json", "--sourceMap");
38+
await run("npx", "tsc", "--build", "src/tsconfig.json", "--sourceMap");
3939
await run("node", "--enable-source-maps", "--test");
4040
}
4141

4242
/** The default task. */
4343
export default gulp.series(clean, build);
4444

45-
/**
46-
* Executes a command from a local package.
47-
* @param {string} command The command to run.
48-
* @param {...string} args The command arguments.
49-
* @return {Promise<void>} Resolves when the command is terminated.
50-
*/
51-
function npx(command, ...args) {
52-
return run("npm", "exec", "--", command, ...args);
53-
}
54-
5545
/**
5646
* Spawns a new process using the specified command.
5747
* @param {string} command The command to run.

0 commit comments

Comments
 (0)