chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
17 lines (14 loc) • 2.91 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cd38db10-9ea9-5f6c-8c6f-b49d04451dc9")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./v1-BPL0QeOt.cjs`),n=require(`./meow-CbdXCBsh.cjs`),r=require(`./getStorybookProjectRoot-DlbLndZv.cjs`),i=require(`./log-ECzXUtHc.cjs`),a=require(`./readStatsFile-4CPsbHL1.cjs`);let o=require(`path`);o=e.a(o);var s=e.a(n.t());const{STORYBOOK_BASE_DIR:c,STORYBOOK_CONFIG_DIR:l,WEBPACK_STATS_FILE:u}=process.env;async function d(e){let{flags:n,input:d}=(0,s.default)(`
Usage
$ chromatic trace [-b|--base-dir] [-c|--config-dir] [-s|--stats-file] [-u|--untraced] [-m|--mode] [<changed files>...]
Options
<changed files>... List of changed files relative to repository root.
--stats-file, -s <filepath> Path to preview-stats.json. Alternatively, set WEBPACK_STATS_FILE. (default: 'storybook-static/preview-stats.json')
--storybook-base-dir, -b <dirname> Relative path from repository root to Storybook project root. Alternatively, set STORYBOOK_BASE_DIR. Use when your Storybook is located in a subdirectory of your repository.
--storybook-config-dir, -c <dirname> Directory where to load Storybook configurations from. Alternatively, set STORYBOOK_CONFIG_DIR. (default: '.storybook')
--untraced, -u <filepath> Disregard these files and their dependencies. Globs are supported via picomatch. This flag can be specified multiple times.
--mode, -m <mode> Set to 'expanded' to reveal the underlying list of files for each bundle, or set to 'compact' to only show a flat list of affected story files.
`,{argv:e,description:`Trace utility for TurboSnap`,flags:{statsFile:{type:`string`,alias:`s`,default:u||`storybook-static/preview-stats.json`},storybookBaseDir:{type:`string`,alias:`b`,default:c||`.`},storybookConfigDir:{type:`string`,alias:`c`,default:l||`.storybook`},untraced:{type:`string`,alias:`u`,isMultiple:!0},mode:{type:`string`,alias:`m`}}}),f=i.t({},{logPrefix:``,logLevel:`info`}),p=await r.C({log:f}),m=o.default.resolve(p,n.storybookBaseDir),h={log:f,options:{storybookBaseDir:n.storybookBaseDir,storybookConfigDir:n.storybookConfigDir,untraced:n.untraced,traceChanged:n.mode||!0},git:{rootPath:p},storybook:{projectRoot:m,configDir:o.default.resolve(m,n.storybookConfigDir),staticDirs:[]}},g=await a.t(n.statsFile),_=d.map(e=>e.replace(/^\.\//,``)),v=_.find(e=>t.l(e));if(v)throw Error(`Unable to trace package manifest file (${v}) as that would require diffing file contents.`);await t.n(h,g,n.statsFile,_)}exports.main=d;
//# sourceMappingURL=trace-C2r8DB6k.cjs.map
//# debugId=cd38db10-9ea9-5f6c-8c6f-b49d04451dc9