diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js index 71a6d7c6805..0bcfc432d64 100644 --- a/.storybook/webpack.config.js +++ b/.storybook/webpack.config.js @@ -115,7 +115,7 @@ module.exports = ({config, mode}) => { config.plugins.push({ apply: (compiler) => { compiler.hooks.afterEmit.tap('AfterEmitPlugin', (compilation) => { - const spawnedProcess = spawn('yarn splash', { + spawn('yarn splash --show-disable-tip', { shell: true, stdio: 'inherit', }); diff --git a/UNRELEASED.md b/UNRELEASED.md index 650bc540297..a62012fdac2 100644 --- a/UNRELEASED.md +++ b/UNRELEASED.md @@ -16,6 +16,8 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f ### Development workflow +- Enabled maintainers running `yarn dev` to hide [`yarn splash`](https://github.com/Shopify/polaris-react/tree/master/scripts/splash) reports from the console by running `DISABLE_SPLASH=1 yarn dev` ([#2372](https://github.com/Shopify/polaris-react/pull/2372)) + ### Dependency upgrades ### Code quality diff --git a/scripts/splash/README.md b/scripts/splash/README.md index 3b4084ed5e5..8f52cf688a2 100644 --- a/scripts/splash/README.md +++ b/scripts/splash/README.md @@ -11,6 +11,8 @@ It answers the question: 1. Edit files in `src/`, such as components 🧩 and style sheets 🎨. 2. As you run `yarn dev`, `yarn splash` will run in the background. Keep an eye on the terminal to see the splash zone of your changes in the working directory. + 💡 Tip: to disable these reports, run `DISABLE_SPLASH=1 yarn dev` + 💡 Tip: command + click a file path to open it in your text editor ## Feedback and bug reports diff --git a/scripts/splash/index.tsx b/scripts/splash/index.tsx index 0edcfc70459..82caaaf3fd2 100644 --- a/scripts/splash/index.tsx +++ b/scripts/splash/index.tsx @@ -4,6 +4,10 @@ import {Box, Text, Color, render} from 'ink'; import sortBy from 'lodash/sortBy'; import {getGitStagedFiles, getDependencies} from './treebuilder'; +if (process.env.DISABLE_SPLASH) { + process.exit(0); +} + const excludedFileNames = (fileName) => !fileName.includes('test') && !fileName.includes('types'); @@ -193,6 +197,17 @@ const App = () => { + {process.argv.includes('--show-disable-tip') && ( + + + 💡 + + Tip: to disable these reports, run{' '} + DISABLE_SPLASH=1 yarn dev + + + + )} ); };