Skip to content

Commit

Permalink
feat: skipUpdateCheck option
Browse files Browse the repository at this point in the history
  • Loading branch information
work933k committed Feb 22, 2024
1 parent 903b67d commit a7def3a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions node-src/lib/checkForUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const withTimeout = <T>(promise: Promise<T>, ms: number): Promise<T> =>
Promise.race([promise, rejectIn(ms)]);

export default async function checkForUpdates(ctx: InitialContext) {
if (ctx.extraOptions.skipUpdateCheck === true) {
ctx.log.info(`Skipping update check`);
return;
}

if (!semver.valid(ctx.pkg.version)) {
ctx.log.warn(`Invalid semver version in package.json: ${ctx.pkg.version}`);
return;
Expand Down
1 change: 1 addition & 0 deletions node-src/lib/getOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default function getOptions({
forceRebuild: undefined,
junitReport: undefined,
zip: undefined,
skipUpdateCheck: undefined,

ignoreLastBuildOnBranch: undefined,
preserveMissingSpecs: undefined,
Expand Down
1 change: 1 addition & 0 deletions node-src/lib/parseArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default function parseArgs(argv: string[]) {
--storybook-config-dir <dirname> Relative path from where you run Chromatic to your Storybook config directory ('.storybook'). Use with --only-changed and --storybook-build-dir when using a custom --config-dir (-c) flag for Storybook. [.storybook]
--untraced <filepath> Disregard these files and their dependencies when tracing dependent stories for TurboSnap. Globs are supported via picomatch. This flag can be specified multiple times. Requires --only-changed.
--zip Publish your Storybook to Chromatic as a single zip file instead of individual content files.
--skipUpdateCheck Skip checking for Chromatic update.
Debug options
--debug Output verbose debugging information. This option implies --no-interactive, --diagnostics-file, --log-file.
Expand Down
3 changes: 3 additions & 0 deletions node-src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface Flags {
storybookConfigDir?: string;
untraced?: string[];
zip?: boolean;
skipUpdateCheck?: boolean;

// Debug options
debug?: boolean;
Expand Down Expand Up @@ -140,6 +141,8 @@ export interface Options extends Configuration {

/** Environment variables */
env?: Env;

skipUpdateCheck: Flags['skipUpdateCheck'];
}

export { Configuration };
Expand Down

0 comments on commit a7def3a

Please sign in to comment.