-
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.
Skip empty files when uploading individual files
- Loading branch information
1 parent
a373f1f
commit a36bcdb
Showing
3 changed files
with
39 additions
and
1 deletion.
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
14 changes: 14 additions & 0 deletions
14
node-src/ui/messages/warnings/skippingEmptyFiles.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,14 @@ | ||
import skippingEmptyFiles from './skippingEmptyFiles'; | ||
|
||
export default { | ||
title: 'CLI/Messages/Warnings', | ||
}; | ||
|
||
export const SkippingEmptyFiles = () => | ||
skippingEmptyFiles({ | ||
emptyFiles: Array.from({ length: 3 }, (_, i) => ({ | ||
contentLength: 0, | ||
localPath: `file${i}.js`, | ||
targetPath: `file${i}.js`, | ||
})), | ||
}); |
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,17 @@ | ||
import chalk from 'chalk'; | ||
import pluralize from 'pluralize'; | ||
import { dedent } from 'ts-dedent'; | ||
|
||
import { warning } from '../../components/icons'; | ||
import { FileDesc } from '../../../types'; | ||
|
||
export default ({ emptyFiles }: { emptyFiles: FileDesc[] }) => { | ||
const listing = chalk`\n{dim →} ${emptyFiles.map((f) => f.targetPath).join(chalk`\n{dim →} `)}`; | ||
return dedent(chalk` | ||
${warning} {bold Not uploading empty files} | ||
Found ${pluralize('empty files', emptyFiles.length, true)} in your built Storybook:${listing} | ||
Uploading empty files is not supported except when using a zip file. | ||
You can ignore this warning if your Storybook doesn't need these files. | ||
Otherwise, configure Chromatic with the {bold zip} option. | ||
`); | ||
}; |