You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1008 B
JavaScript
48 lines
1008 B
JavaScript
"use strict";
|
|
|
|
const { run } = require( "@futagoza/child-process" );
|
|
const { series, src, task } = require( "@futagoza/gulpx" );
|
|
const eslint = require( "gulp-eslint" );
|
|
const del = require( "del" );
|
|
|
|
// Run ESLint on all JavaScript files.
|
|
task( "lint", () => [
|
|
|
|
src( [
|
|
"**/.*rc.js",
|
|
"packages/**/*.js",
|
|
"test/spec/**/*.js",
|
|
"tools/**/*.js",
|
|
"src/*.js",
|
|
"rollup.config.js",
|
|
"gulpfile.js",
|
|
"server.js",
|
|
] ),
|
|
eslint( { dotfiles: true } ),
|
|
eslint.format(),
|
|
eslint.failAfterError(),
|
|
|
|
] );
|
|
|
|
// Run tests.
|
|
task( "test", () =>
|
|
|
|
run( "node node_modules/mocha/bin/mocha test/spec/**/*.spec.js" )
|
|
|
|
);
|
|
|
|
// Generate the grammar parser.
|
|
task( "build:parser", () =>
|
|
|
|
run( "node packages/pegjs/bin/peg -c src/pegjs.config.js" )
|
|
|
|
);
|
|
|
|
// Delete the generated files.
|
|
task( "clean", () =>
|
|
del( [ "packages/pegjs/dist", "website/js/*-bundle.js", "examples/*.js" ] )
|
|
);
|
|
|
|
// Default task.
|
|
task( "default", series( "lint", "test" ) );
|