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

fix(storybook): optional chain all includes #9707

Merged
merged 1 commit into from Apr 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/storybook/src/executors/utils.ts
Expand Up @@ -280,7 +280,7 @@ function normalizeTargetString(
appName: string,
defaultTarget: string = 'build'
) {
if (appName.includes(':')) {
if (appName?.includes(':')) {
return appName;
}
return `${appName}:${defaultTarget}`;
Expand Down Expand Up @@ -308,7 +308,7 @@ export function customProjectBuildConfigIsValid(
tree: Tree,
projectBuildConfig: string
): boolean {
if (projectBuildConfig.includes(':')) {
if (projectBuildConfig?.includes(':')) {
const { project, target } = parseTargetString(projectBuildConfig);
const projectConfig = readProjectConfiguration(tree, project);
if (projectConfig?.targets?.[target]) {
Expand Down
Expand Up @@ -231,8 +231,8 @@ function configureTsProjectConfig(
}

if (
!tsConfigContent.exclude.includes('**/*.stories.ts') &&
!tsConfigContent.exclude.includes('**/*.stories.js')
!tsConfigContent?.exclude?.includes('**/*.stories.ts') &&
!tsConfigContent?.exclude?.includes('**/*.stories.js')
) {
tsConfigContent.exclude = [
...(tsConfigContent.exclude || []),
Expand Down Expand Up @@ -260,7 +260,7 @@ function configureTsSolutionConfig(
if (
!tsConfigContent?.references
?.map((reference) => reference.path)
.includes('./.storybook/tsconfig.json')
?.includes('./.storybook/tsconfig.json')
) {
tsConfigContent.references = [
...(tsConfigContent.references || []),
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/src/generators/init/init.ts
Expand Up @@ -203,7 +203,7 @@ export function addCacheableOperation(tree: Tree) {
workspace.tasksRunnerOptions.default.options.cacheableOperations =
workspace.tasksRunnerOptions.default.options.cacheableOperations || [];
if (
!workspace.tasksRunnerOptions.default.options.cacheableOperations.includes(
!workspace.tasksRunnerOptions.default.options.cacheableOperations?.includes(
'build-storybook'
)
) {
Expand Down