UNPKG

chromatic

Version:

Automate visual testing across browsers. Gather UI feedback. Versioned documentation.

17 lines (14 loc) 2.85 kB
!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]="218b05fe-10d0-5da6-b7a7-bfb00b9af1d0")}catch(e){}}(); const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./v1-B5XHfelt.cjs`),n=require(`./meow-CbdXCBsh.cjs`),r=require(`./log-Dm7rQH3m.cjs`),i=require(`./readStatsFile-CwBmK3gM.cjs`);let a=require(`path`);a=e.a(a);var o=e.a(n.t());const{STORYBOOK_BASE_DIR:s,STORYBOOK_CONFIG_DIR:c,WEBPACK_STATS_FILE:l}=process.env;async function u(e){let{flags:n,input:u}=(0,o.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:l||`storybook-static/preview-stats.json`},storybookBaseDir:{type:`string`,alias:`b`,default:s||`.`},storybookConfigDir:{type:`string`,alias:`c`,default:c||`.storybook`},untraced:{type:`string`,alias:`u`,isMultiple:!0},mode:{type:`string`,alias:`m`}}}),d=r.t({},{logPrefix:``,logLevel:`info`}),f=await t.G({log:d}),p=a.default.resolve(f,n.storybookBaseDir),m={log:d,options:{storybookBaseDir:n.storybookBaseDir,storybookConfigDir:n.storybookConfigDir,untraced:n.untraced,traceChanged:n.mode||!0},git:{rootPath:f},storybook:{projectRoot:p,configDir:a.default.resolve(p,n.storybookConfigDir),staticDirs:[]}},h=await i.t(n.statsFile),g=u.map(e=>e.replace(/^\.\//,``)),_=g.find(e=>t.f(e));if(_)throw Error(`Unable to trace package manifest file (${_}) as that would require diffing file contents.`);await t.n(m,h,n.statsFile,g)}exports.main=u; //# sourceMappingURL=trace-DXIWr9Yu.cjs.map //# debugId=218b05fe-10d0-5da6-b7a7-bfb00b9af1d0