generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Krzysztof Radomski
committed
Nov 2, 2023
1 parent
661ebea
commit aa06792
Showing
5 changed files
with
8,732 additions
and
35 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
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
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
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,54 @@ | ||
#!/usr/bin/env zx | ||
|
||
const packageJson = require("../package.json"); | ||
|
||
const name = packageJson.name; | ||
const displayName = packageJson.storybook.displayName; | ||
|
||
let exitCode = 0; | ||
$.verbose = false; | ||
|
||
/** | ||
* Check that meta data has been updated | ||
*/ | ||
if (name.includes("addon-kit") || displayName.includes("Addon Kit")) { | ||
console.error( | ||
boxen( | ||
dedent` | ||
${chalk.red.bold("Missing metadata")} | ||
|
||
${chalk.red(dedent`Your package name and/or displayName includes default values from the Addon Kit. | ||
The addon gallery filters out all such addons. | ||
|
||
Please configure appropriate metadata before publishing your addon. For more info, see: | ||
https://storybook.js.org/docs/react/addons/addon-catalog#addon-metadata`)}`, | ||
{ padding: 1, borderColor: "red" } | ||
) | ||
); | ||
|
||
exitCode = 1; | ||
} | ||
|
||
/** | ||
* Check that README has been updated | ||
*/ | ||
const readmeTestStrings = | ||
"# Storybook Addon Kit|Click the \\*\\*Use this template\\*\\* button to get started.|https://user-images.githubusercontent.com/42671/106809879-35b32000-663a-11eb-9cdc-89f178b5273f.gif"; | ||
|
||
if ((await $`cat README.md | grep -E ${readmeTestStrings}`.exitCode) == 0) { | ||
console.error( | ||
boxen( | ||
dedent` | ||
${chalk.red.bold("README not updated")} | ||
|
||
${chalk.red(dedent`You are using the default README.md file that comes with the addon kit. | ||
Please update it to provide info on what your addon does and how to use it.`)} | ||
`, | ||
{ padding: 1, borderColor: "red" } | ||
) | ||
); | ||
|
||
exitCode = 1; | ||
} | ||
|
||
process.exit(exitCode); |
Oops, something went wrong.