Merge pull request #15114 from storybookjs/15085-disable-react-in-yarn-workspace

CLI: Disable `react_in_yarn_workspace` template for users, keep in e2e
This commit is contained in:
Michael Shilman 2021-06-01 16:19:36 +08:00 committed by GitHub
commit 1e84896c87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,9 @@ import path from 'path';
import chalk from 'chalk';
import boxen from 'boxen';
import dedent from 'ts-dedent';
import { createAndInit, Parameters, exec } from './repro-generators/scripts';
import { createAndInit, exec } from './repro-generators/scripts';
import * as configs from './repro-generators/configs';
import type { Parameters } from './repro-generators/configs';
import { SupportedFrameworks } from './project_types';
const logger = console;
@ -20,9 +21,12 @@ interface ReproOptions {
pnp?: boolean;
}
const TEMPLATES = configs as Record<string, Parameters>;
// react_in_yarn_workspace is only for e2e tests not users
const TEMPLATES = Object.fromEntries(
Object.entries(configs).filter((entry) => entry[0] !== 'react_in_yarn_workspace')
) as Record<string, Parameters>;
const FRAMEWORKS = Object.values(configs).reduce<Record<SupportedFrameworks, Parameters[]>>(
const FRAMEWORKS = Object.values(TEMPLATES).reduce<Record<SupportedFrameworks, Parameters[]>>(
(acc, cur) => {
acc[cur.framework] = [...(acc[cur.framework] || []), cur];
return acc;