chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
17 lines (14 loc) • 2.96 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]="d5c17a6c-6c64-5641-a939-9de151a83d8c")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./v1-CrSWFliR.cjs`),n=require(`./statsPaths-DxOPEGB1.cjs`),r=require(`./log-kvNRZrIg.cjs`),i=require(`./meowImportMeta-C1QmuJuk.cjs`),a=require(`./readStatsFile-DY1vHZYN.cjs`);let o=require(`path`);o=e.a(o);const{STORYBOOK_BASE_DIR:s,STORYBOOK_CONFIG_DIR:c,WEBPACK_STATS_FILE:l}=process.env;async function u(e){let{flags:u,input:d}=i.n(`
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, either relative to repository root or absolute.
--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.
`,{importMeta:i.t,argv:e,description:`Trace utility for TurboSnap`,flags:{statsFile:{type:`string`,shortFlag:`s`,default:l||`storybook-static/preview-stats.json`},storybookBaseDir:{type:`string`,shortFlag:`b`,default:s||`.`},storybookConfigDir:{type:`string`,shortFlag:`c`,default:c||`.storybook`},untraced:{type:`string`,shortFlag:`u`,isMultiple:!0},mode:{type:`string`,shortFlag:`m`}}}),f=r.t({},{logPrefix:``,logLevel:`info`}),p=await n.k({log:f}),m=o.default.resolve(p,u.storybookBaseDir),h={log:f,options:{storybookBaseDir:u.storybookBaseDir,storybookConfigDir:u.storybookConfigDir,untraced:u.untraced,traceChanged:u.mode||!0},git:{rootPath:p},storybook:{projectRoot:m,configDir:o.default.resolve(m,u.storybookConfigDir),staticDirs:[]}},g=await a.t(u.statsFile),_=d.map(e=>n.l(o.default.relative(p,o.default.resolve(p,e)))),v=_.find(e=>r.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,u.statsFile,_)}exports.main=u;
//# sourceMappingURL=trace-D7pBAWMP.cjs.map
//# debugId=d5c17a6c-6c64-5641-a939-9de151a83d8c