UNPKG

chromatic

Version:

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

14 lines (10 loc) • 1.89 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]="6b4a207c-efc1-5dbb-977a-0ee519bfe5a1")}catch(e){}}(); const e=require("./rolldown-runtime-DMt3xDJx.cjs"),t=require("./lib-BvaMHbms.cjs"),n=require("./meowImportMeta-ATHx7qtc.cjs"),r=require("./readStatsFile-B5yEbDcl.cjs");var i=/* @__PURE__ */ e.r({main:()=>l}),a=t.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:t}=n.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:n.t,argv:e,allowUnknownFlags:!1,description:`Trim a stats file down to user code, for debugging TurboSnap`,flags:{help:{type:`boolean`}}});await c(t[0]??`./storybook-static/preview-stats.json`)}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}); //# sourceMappingURL=trimStatsFile-CUG9YVKA.cjs.map //# debugId=6b4a207c-efc1-5dbb-977a-0ee519bfe5a1