chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
18 lines (15 loc) • 3.54 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]="294da767-a8b0-53da-a287-dbd7380164cb")}catch(e){}}();
const e=require("./rolldown-runtime-DMt3xDJx.cjs"),t=require("./e2ePackage-Osg93awL.cjs"),n=require("./projectFiles-1_t6i9OT.cjs"),r=require("./meowImportMeta-ATHx7qtc.cjs"),i=require("./log-CBUJ6DPe.cjs"),a=require("./readStatsFile-B5yEbDcl.cjs");let o=require("fs"),s=require("path");s=e.a(s);const{STORYBOOK_BASE_DIR:c}=process.env;async function l(e){t.b();let l=r.n(`
Usage
$ chromatic turbosnap-manifest [-s|--stats-file] [-b|--storybook-base-dir] [-c|--config-dir] [--static-dir] [--externals] [-u|--untraced] [--vitest]
Options
--stats-file, -s <filepath> Path to preview-stats.json, relative to the Storybook project root. (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. (default: the current directory)
--config-dir, -c <dirname> Storybook config directory, relative to the Storybook project root. (default: '.storybook')
--static-dir <dirnames> Comma-separated static directories, relative to the Storybook project root. (default: none)
--externals <glob> Glob of files that disable TurboSnap when changed, relative to the repository root. Can be specified multiple times. (default: none)
--untraced, -u <glob> Glob of files to disregard, with their dependencies, when tracing dependent stories, relative to the repository root. Can be specified multiple times. (default: none)
--vitest Build the manifest of a 'chromatic --vitest' build, whose Storybook ships inside @chromatic-com/vitest. Does not sweep --config-dir, but still counts files under it in the graph as preview. Run 'build-archive-storybook --stats-json=storybook-static' first: the stats Vitest writes to .vitest/chromatic have no story files. (default: false)
`,{importMeta:r.t,argv:e,description:`Build the TurboSnap 2.0 manifest from a stats file`,flags:{statsFile:{type:`string`,shortFlag:`s`,default:`storybook-static/preview-stats.json`},storybookBaseDir:{type:`string`,shortFlag:`b`,...c&&{default:c}},configDir:{type:`string`,shortFlag:`c`,default:`.storybook`},staticDir:{type:`string`},externals:{type:`string`,isMultiple:!0},untraced:{type:`string`,shortFlag:`u`,isMultiple:!0},vitest:{type:`boolean`,default:!1}}}),u=i.t({},{logPrefix:``,logLevel:`error`}),d=await t.K({log:u,options:{}}),f=t.l({storybookBaseDir:l.flags.storybookBaseDir,gitRootPath:d}),p=s.default.resolve(f,l.flags.statsFile);if(!(0,o.existsSync)(p))throw Error(`No stats file at ${p}\n\n${l.help}`);let m=await n.a(await a.t(p),{log:u,projectRoot:f,gitRoot:d,untraced:l.flags.untraced??[],configDir:s.default.resolve(f,l.flags.configDir),e2ePackage:t.t({vitest:l.flags.vitest}),staticDirs:(l.flags.staticDir?.split(`,`)??[]).map(e=>s.default.resolve(f,e)),externals:l.flags.externals??[],projectFiles:n.t({log:u,options:{}})});process.stdout.write(JSON.stringify(n.s(m),void 0,2))}exports.main=l;
//# sourceMappingURL=turbosnapManifest-DxqEF8M4.cjs.map
//# debugId=294da767-a8b0-53da-a287-dbd7380164cb