chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
17 lines (14 loc) • 2.99 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]="ad504b1a-fe05-5211-9e48-b5a7389c9101")}catch(e){}}();
const e=require("./rolldown-runtime-DMt3xDJx.cjs"),t=require("./v1-DYg5fzlf.cjs"),n=require("./meowImportMeta-ATHx7qtc.cjs"),r=require("./e2ePackage-Osg93awL.cjs"),i=require("./log-CBUJ6DPe.cjs"),a=require("./readStatsFile-B5yEbDcl.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}=n.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 potentially affected story files.
`,{importMeta:n.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=i.t({},{logPrefix:``,logLevel:`info`}),p=await r.K({log:f,options:{}}),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=>r.d(o.default.relative(p,o.default.resolve(p,e)))),v=_.find(e=>i.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-B5Wf68rj.cjs.map
//# debugId=ad504b1a-fe05-5211-9e48-b5a7389c9101