mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-07 07:21:17 +08:00
Introduse --ci option
This commit is contained in:
parent
631228441c
commit
5364ac7f02
@ -21,6 +21,12 @@ Here are all those options:
|
|||||||
-h, --host [string] Host to run Storybook
|
-h, --host [string] Host to run Storybook
|
||||||
-s, --static-dir <dir-names> Directory where to load static files from, comma-separated list
|
-s, --static-dir <dir-names> Directory where to load static files from, comma-separated list
|
||||||
-c, --config-dir [dir-name] Directory where to load Storybook configurations from
|
-c, --config-dir [dir-name] Directory where to load Storybook configurations from
|
||||||
|
--https Serve Storybook over HTTPS. Note: You must provide your own certificate information.
|
||||||
|
--ssl-ca <ca> Provide an SSL certificate authority. (Optional with --https, required if using a self-signed certificate)
|
||||||
|
--ssl-cert <cert> Provide an SSL certificate. (Required with --https)
|
||||||
|
--ssl-key <key> Provide an SSL key. (Required with --https)
|
||||||
|
--smoke-test Exit after successful start
|
||||||
|
--ci CI mode (skip interactive prompts, don't open browser)
|
||||||
--quiet Suppress verbose build output
|
--quiet Suppress verbose build output
|
||||||
|
|
||||||
## For build-storybook
|
## For build-storybook
|
||||||
|
@ -43,6 +43,7 @@ export async function buildDev({ packageJson, ...loadOptions }) {
|
|||||||
.option('--ssl-cert <cert>', 'Provide an SSL certificate. (Required with --https)')
|
.option('--ssl-cert <cert>', 'Provide an SSL certificate. (Required with --https)')
|
||||||
.option('--ssl-key <key>', 'Provide an SSL key. (Required with --https)')
|
.option('--ssl-key <key>', 'Provide an SSL key. (Required with --https)')
|
||||||
.option('--smoke-test', 'Exit after successful start')
|
.option('--smoke-test', 'Exit after successful start')
|
||||||
|
.option('--ci', "CI mode (skip interactive prompts, don't open browser")
|
||||||
.option('--quiet', 'Suppress verbose build output')
|
.option('--quiet', 'Suppress verbose build output')
|
||||||
.parse(process.argv);
|
.parse(process.argv);
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ export async function buildDev({ packageJson, ...loadOptions }) {
|
|||||||
|
|
||||||
const port = await getFreePort(program.port);
|
const port = await getFreePort(program.port);
|
||||||
|
|
||||||
if (!program.smokeTest && program.port != null && port !== program.port) {
|
if (!program.ci && !program.smokeTest && program.port != null && port !== program.port) {
|
||||||
const { shouldChangePort } = await inquirer.prompt({
|
const { shouldChangePort } = await inquirer.prompt({
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
default: true,
|
default: true,
|
||||||
@ -155,7 +156,7 @@ Would you like to run Storybook on port ${port} instead?`,
|
|||||||
logger.info(`Storybook started on => ${chalk.cyan(address)}\n`);
|
logger.info(`Storybook started on => ${chalk.cyan(address)}\n`);
|
||||||
if (program.smokeTest) {
|
if (program.smokeTest) {
|
||||||
process.exit(stats.toJson().warnings.length ? 1 : 0);
|
process.exit(stats.toJson().warnings.length ? 1 : 0);
|
||||||
} else {
|
} else if (!program.ci) {
|
||||||
opn(address);
|
opn(address);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user