From 92b66f47d677a0ce3f96b762f79f28e2127edb9a Mon Sep 17 00:00:00 2001 From: Albert Lash Date: Sat, 9 May 2020 23:10:34 +0100 Subject: [PATCH 1/3] Adding new cli options for page optimization --- packages/gatsby-cli/src/create-cli.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 069093b783773..c007e856da4be 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -182,6 +182,16 @@ function buildLocalCommands(cli, isLocalSite) { default: false, describe: `Build site without uglifying JS bundles (for debugging).`, }) + .option(`log-pages`, { + type: `boolean`, + default: false, + describe: `Log the pages that changes since last build (for optimization).`, + }) + .option(`write-to-file`, { + type: `boolean`, + default: false, + describe: `Save the log of changed pages for future comparison (for optimization).`, + }) .option(`profile`, { type: `boolean`, default: false, From 36be9abf84c5b80ec3c62306506f0b9c7e6e7511 Mon Sep 17 00:00:00 2001 From: Albert Lash Date: Sun, 10 May 2020 00:22:14 +0100 Subject: [PATCH 2/3] prettier --- packages/gatsby-cli/src/create-cli.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index c007e856da4be..03909030bd67c 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -182,16 +182,16 @@ function buildLocalCommands(cli, isLocalSite) { default: false, describe: `Build site without uglifying JS bundles (for debugging).`, }) - .option(`log-pages`, { - type: `boolean`, - default: false, - describe: `Log the pages that changes since last build (for optimization).`, - }) - .option(`write-to-file`, { - type: `boolean`, - default: false, - describe: `Save the log of changed pages for future comparison (for optimization).`, - }) + .option(`log-pages`, { + type: `boolean`, + default: false, + describe: `Log the pages that changes since last build (for optimization).`, + }) + .option(`write-to-file`, { + type: `boolean`, + default: false, + describe: `Save the log of changed pages for future comparison (for optimization).`, + }) .option(`profile`, { type: `boolean`, default: false, From 2d870e8d4953e742bacc8c13a07b4132c37f3e5c Mon Sep 17 00:00:00 2001 From: Michal Piechowiak Date: Mon, 11 May 2020 12:09:39 +0200 Subject: [PATCH 3/3] make them hidden, add some description as well as comment about why they are hidden --- packages/gatsby-cli/src/create-cli.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/gatsby-cli/src/create-cli.js b/packages/gatsby-cli/src/create-cli.js index 03909030bd67c..9e76b78f75654 100644 --- a/packages/gatsby-cli/src/create-cli.js +++ b/packages/gatsby-cli/src/create-cli.js @@ -182,16 +182,6 @@ function buildLocalCommands(cli, isLocalSite) { default: false, describe: `Build site without uglifying JS bundles (for debugging).`, }) - .option(`log-pages`, { - type: `boolean`, - default: false, - describe: `Log the pages that changes since last build (for optimization).`, - }) - .option(`write-to-file`, { - type: `boolean`, - default: false, - describe: `Save the log of changed pages for future comparison (for optimization).`, - }) .option(`profile`, { type: `boolean`, default: false, @@ -200,6 +190,20 @@ function buildLocalCommands(cli, isLocalSite) { .option(`open-tracing-config-file`, { type: `string`, describe: `Tracer configuration file (OpenTracing compatible). See https://gatsby.dev/tracing`, + }) + // log-pages and write-to-file are specific to experimental GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES feature + // because of that they are hidden from `--help` but still defined so `yargs` know about them + .option(`log-pages`, { + type: `boolean`, + default: false, + describe: `Log the pages that changes since last build (only available when using GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES).`, + hidden: true, + }) + .option(`write-to-file`, { + type: `boolean`, + default: false, + describe: `Save the log of changed pages for future comparison (only available when using GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES).`, + hidden: true, }), handler: handlerP( getCommandHandler(`build`, (args, cmd) => {