Skip to content

Commit

Permalink
🏗 Temporarily disable Storybook AMP environment (#36780)
Browse files Browse the repository at this point in the history
`@ampproject/storybook-addon` has outdated peer dependencies that conflict with the main install. Disable the AMP environment for now so that the Preact environment can run.

We'll update the addon soon: ampproject/storybook-addon-amp#57

Additionally, we were relying on `@storybook/client-api` as a transitive dependency from the addon. Install it so that Storybook can run.
  • Loading branch information
alanorozco committed Nov 4, 2021
1 parent ce5decd commit 7e5fe13
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 1,223 deletions.
16 changes: 16 additions & 0 deletions build-system/tasks/storybook/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const {isCiBuild} = require('../../common/ci');
const {isPullRequestBuild} = require('../../common/ci');
const {log} = require('../../common/logging');
const {writeFileSync} = require('fs-extra');
const {yellow} = require('kleur/colors');

const ENV_PORTS = {
amp: 9001,
Expand All @@ -29,6 +30,13 @@ const envConfigDir = (env) => path.join(__dirname, `${env}-env`);
* @param {string} env 'amp' or 'preact'
*/
function launchEnv(env) {
if (env === 'amp') {
log(
yellow('AMP environment for storybook is temporarily disabled.\n') +
'See https://github.com/ampproject/storybook-addon-amp/issues/57'
);
return;
}
log(`Launching storybook for the ${cyan(env)} environment...`);
const {'storybook_port': port = ENV_PORTS[env]} = argv;
execScriptAsync(
Expand All @@ -50,6 +58,14 @@ function launchEnv(env) {
* @param {string} env 'amp' or 'preact'
*/
function buildEnv(env) {
if (env === 'amp') {
log(
yellow('AMP environment for storybook is temporarily disabled.\n') +
'See https://github.com/ampproject/storybook-addon-amp/issues/57'
);
return;
}

const configDir = envConfigDir(env);

if (env === 'amp' && isPullRequestBuild()) {
Expand Down

0 comments on commit 7e5fe13

Please sign in to comment.