Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗 Clean up a few things in gulpfile.js #32359

Merged
merged 2 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions build-system/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,11 @@ const {
const {buildExtensions} = require('./extension-helpers');
const {compileCss} = require('./css');
const {compileJison} = require('./compile-jison');
const {cyan, green, yellow} = require('ansi-colors');
const {log} = require('../common/logging');
const {maybeUpdatePackages} = require('./update-packages');
const {parseExtensionFlags} = require('./extension-helpers');

const argv = require('minimist')(process.argv.slice(2));

/**
* Deprecated. Use `gulp build --watch` or `gulp dist --watch`.
*
* TODO(rsimha, #27471): Remove this after several weeks.
*/
async function watch() {
log(yellow('WARNING:'), cyan('gulp watch'), 'has been deprecated.');
log(
green('INFO:'),
'Use',
cyan('gulp build --watch'),
'or',
cyan('gulp dist --watch'),
'instead.'
);
log(
green('INFO:'),
'Run',
cyan('gulp help'),
'for a full list of commands and flags.'
);
}

/**
* Perform the prerequisite steps before starting the unminified build.
* Used by `gulp` and `gulp build`.
Expand Down Expand Up @@ -110,7 +85,6 @@ module.exports = {
build,
doBuild,
runPreBuildSteps,
watch,
};

/* eslint "google-camelcase/google-camelcase": 0 */
Expand All @@ -129,5 +103,3 @@ build.flags = {
define_experiment_constant:
' Builds runtime with the EXPERIMENT constant set to true',
};

watch.description = 'Deprecated. Use gulp build --watch or gulp dist --watch';
3 changes: 2 additions & 1 deletion build-system/tasks/default-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ defaultTask.flags = {
version_override: ' Overrides the version written to AMP_CONFIG',
host: ' Host to serve the project on. localhost by default.',
port: ' Port to serve the project on. 8000 by default.',
https: ' Use https server. http by default.',
https: ' Use https server. http by default.',
define_experiment_constant:
' Builds runtime with the EXPERIMENT constant set to true',
tasks: ' Show a list of all gulp tasks with their flags',
};
6 changes: 0 additions & 6 deletions build-system/tasks/presubmit-checks.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ const forbiddenTerms = {
'[^.]user\\(\\)\\.assert\\(': 'Use the userAssert function instead.',
'it\\.only': '',
'Math.random[^;()]*=': 'Use Sinon to stub!!!',
'gulp-util': {
message:
'`gulp-util` will be deprecated soon. See ' +
'https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 ' +
'for a list of alternatives.',
},
'sinon\\.(spy|stub|mock)\\(': {
message: 'Use a sandbox instead to avoid repeated `#restore` calls',
},
Expand Down
2 changes: 1 addition & 1 deletion build-system/tasks/runtime-test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function maybePrintArgvMessages() {

log(
green('Run'),
cyan('gulp help'),
cyan('gulp --tasks'),
green('to see a list of all test flags.')
);
log(green('⤷ Use'), cyan('--nohelp'), green('to silence these messages.'));
Expand Down
6 changes: 3 additions & 3 deletions build-system/tasks/sweep-experiments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,8 @@ sweepExperiments.description =

sweepExperiments.flags = {
'days_ago':
' How old experiment configuration flips must be for an experiment to be removed. Default is 365 days. This is ignored when using --experiment.',
' How old experiment configuration flips must be for an experiment to be removed. Default is 365 days. This is ignored when using --experiment.',
'dry_run':
" Don't write, but only list the experiments that would be removed by this command.",
'experiment': ' Remove a specific experiment id.',
" Don't write, but only list the experiments that would be removed by this command.",
'experiment': ' Remove a specific experiment id.',
};
2 changes: 1 addition & 1 deletion contributing/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This document provides details for testing and building your AMP code.

Before running these commands, make sure you have Node.js and Gulp installed. For installation instructions, see the [One-time setup](getting-started-quick.md#one-time-setup) section in the Quick Start guide.

**Pro tip:** To see a full listing of `gulp` commands and their flags, run `gulp help`.
**Pro tip:** To see a full listing of `gulp` commands and their flags, run `gulp --tasks`.

| Command | Description |
| --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
Expand Down
7 changes: 3 additions & 4 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/* global require, process */

const argv = require('minimist')(process.argv.slice(2));
const gulp = require('gulp-help')(require('gulp'));
const gulp = require('gulp');
const {cyan, red} = require('ansi-colors');
const {isCiBuild} = require('./build-system/common/ci');
const {log} = require('./build-system/common/logging');
Expand All @@ -37,7 +37,7 @@ const {
const {a4a} = require('./build-system/tasks/a4a');
const {ava} = require('./build-system/tasks/ava');
const {babelPluginTests} = require('./build-system/tasks/babel-plugin-tests');
const {build, watch} = require('./build-system/tasks/build');
const {build} = require('./build-system/tasks/build');
const {bundleSize} = require('./build-system/tasks/bundle-size');
const {cachesJson} = require('./build-system/tasks/caches-json');
const {checkLinks} = require('./build-system/tasks/check-links');
Expand Down Expand Up @@ -120,7 +120,7 @@ function checkFlags(name, taskFunc) {
cyan(`gulp ${name}`) + ':',
cyan(invalidFlags.join(', '))
);
log('For detailed usage information, run', cyan('gulp help') + '.');
log('For detailed usage information, run', cyan('gulp --tasks') + '.');
if (validFlags.length > 0) {
log('Valid flags for', cyan(`gulp ${name}`) + ':');
validFlags.forEach((key) => {
Expand Down Expand Up @@ -185,4 +185,3 @@ createTask('validator', validator);
createTask('validator-webui', validatorWebui);
createTask('analytics-vendor-configs', analyticsVendorConfigs);
createTask('visual-diff', visualDiff);
createTask('watch', watch);
57 changes: 0 additions & 57 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
"gulp-eslint": "6.0.0",
"gulp-eslint-if-fixed": "1.0.0",
"gulp-file": "0.4.0",
"gulp-help": "chmontgomery/gulp-help#gulp4",
"gulp-if": "3.0.0",
"gulp-jsonlint": "1.3.2",
"gulp-jsonminify": "1.1.0",
Expand Down