From 37698d8981c6bb8ad44236458dc6336081142164 Mon Sep 17 00:00:00 2001 From: Futago-za Ryuu Date: Tue, 28 Nov 2017 17:49:51 +0000 Subject: [PATCH] Updated NPM scripts & Gulp tasks - updated names & ordering - set "gulp clean" to also remove generated examples - added "gulp lint" to list of default tasks --- gulpfile.js | 18 ++++++++++-------- package.json | 10 +++++----- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7dbe078..4d6428a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,8 +51,13 @@ task( "test", () => gulp // Run benchmarks. task( "benchmark", () => node( "test/benchmark/run" ) ); +// Generate the grammar parser. +task( "build:parser", () => + node( "bin/peg src/parser.pegjs -o lib/parser.js" ) +); + // Create the browser build. -task( "browser:build", () => { +task( "build:browser", () => { const HEADER = dedent` @@ -82,15 +87,12 @@ task( "browser:build", () => { } ); -// Delete the browser build. -task( "browser:clean", () => del( "browser" ) ); - -// Generate the grammar parser. -task( "parser", () => - node( "bin/peg src/parser.pegjs -o lib/parser.js" ) +// Delete the generated files. +task( "clean", () => + del( [ "browser", "examples/*.js" ] ) ); // Default task. task( "default", cb => - runSequence( "benchmark", "test", cb ) + runSequence( "lint", "benchmark", "test", cb ) ); diff --git a/package.json b/package.json index 10f3258..aff4e31 100644 --- a/package.json +++ b/package.json @@ -48,13 +48,13 @@ "scripts": { "lint": "gulp lint", "spec": "gulp test", - "test": "gulp", + "benchmark": "gulp benchmark", + "build:parser": "gulp build:parser", + "build:browser": "gulp build:browser", + "clean": "gulp clean", "test:impact": "node test/impact", "test:server": "node test/server/run", - "benchmark": "gulp benchmark", - "browser:build": "gulp browser:build", - "browser:clean": "gulp browser:build", - "parser": "gulp parser" + "test": "gulp" }, "devDependencies": { "babel-preset-es2015": "6.24.1",