chromatic
Version:
Automate visual testing across browsers. Gather UI feedback. Versioned documentation.
14 lines (10 loc) • 1.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]="07731d14-2b8e-5f1f-8247-b0e221c8c4c7")}catch(e){}}();
const e=require(`./chunk-gGpyby2o.cjs`),t=require(`./meowImportMeta-C1QmuJuk.cjs`),n=require(`./lib-w-eJNhbN.cjs`),r=require(`./readStatsFile-DY1vHZYN.cjs`);var i=e.r({main:()=>l,trimStatsFile:()=>c}),a=n.t();const o=e=>[...new Set(e)],s=({name:e,moduleName:t=e})=>t&&!t.startsWith(`(webpack)`)&&!/(node_modules|webpack\/runtime)\//.test(t);async function c(e){let t=(await r.t(e)).modules.filter(e=>s(e)).map(({id:e,name:t,modules:n,reasons:r})=>{let i=o(r?.filter(e=>s(e)).map(e=>e.moduleName)||[]).filter(e=>e!==t).map(e=>({moduleName:e}));return{id:e,name:t,modules:n&&n.map(e=>({name:e.name})),reasons:i}}).filter(Boolean),n=e.replace(/(\.json)?$/,`.trimmed.json`);return await(0,a.outputFile)(n,JSON.stringify({modules:t},void 0,2).replaceAll(/{\n {10}/g,`{ `).replaceAll(/\n {8}}/g,` }`)),console.log(`Wrote ${n}`),n}async function l(e){let{input:n}=t.n(`
Usage
$ chromatic trim-stats-file [<stats file>]
Options
<stats file> Path to preview-stats.json. (default: './storybook-static/preview-stats.json')
Writes <stats file> with a .trimmed.json extension next to the input.
`,{importMeta:t.t,argv:e,allowUnknownFlags:!1,description:`Trim a stats file down to user code, for debugging TurboSnap`,flags:{help:{type:`boolean`}}});try{await c(n[0]??`./storybook-static/preview-stats.json`)}catch(e){console.error(e instanceof Error?e.message:e),process.exitCode=1}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return c}});
//# sourceMappingURL=trimStatsFile-CjS2IdwO.cjs.map
//# debugId=07731d14-2b8e-5f1f-8247-b0e221c8c4c7