-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show actionable error message when hitting upload limits
- Loading branch information
1 parent
87fa18c
commit 910483c
Showing
5 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
node-src/ui/messages/errors/maxFileCountExceeded.stories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { maxFileCountExceeded } from './maxFileCountExceeded'; | ||
|
||
export default { | ||
title: 'CLI/Messages/Errors', | ||
}; | ||
|
||
export const MaxFileCountExceeded = () => | ||
maxFileCountExceeded({ | ||
fileCount: 54_321, | ||
maxFileCount: 20_000, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import chalk from 'chalk'; | ||
import { dedent } from 'ts-dedent'; | ||
|
||
import { error } from '../../components/icons'; | ||
|
||
export const maxFileCountExceeded = ({ | ||
fileCount, | ||
maxFileCount, | ||
}: { | ||
fileCount: number; | ||
maxFileCount: number; | ||
}) => | ||
dedent(chalk` | ||
${error} {bold Attempted to upload too many files} | ||
You're not allowed to upload more than ${maxFileCount} files per build. | ||
Your Storybook contains ${fileCount} files. This is a very high number. | ||
Do you have files in a static/public directory that shouldn't be there? | ||
Contact customer support if you need to increase this limit. | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { maxFileSizeExceeded } from './maxFileSizeExceeded'; | ||
|
||
export default { | ||
title: 'CLI/Messages/Errors', | ||
}; | ||
|
||
export const MaxFileSizeExceeded = () => | ||
maxFileSizeExceeded({ filePaths: ['index.js', 'main.js'], maxFileSize: 12345 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import chalk from 'chalk'; | ||
import { dedent } from 'ts-dedent'; | ||
|
||
import { error } from '../../components/icons'; | ||
|
||
export const maxFileSizeExceeded = ({ | ||
filePaths, | ||
maxFileSize, | ||
}: { | ||
filePaths: string[]; | ||
maxFileSize: number; | ||
}) => | ||
dedent(chalk` | ||
${error} {bold Attempted to exceed maximum file size} | ||
You're attempting to upload files that exceed the maximum file size of ${maxFileSize} bytes. | ||
Contact customer support if you need to increase this limit. | ||
- ${filePaths.map((path) => path).join('\n- ')} | ||
`); |