diff --git a/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs new file mode 100644 index 000000000000..911cd235e83c --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs @@ -0,0 +1,28 @@ +/* eslint-disable */ +//prettier-ignore +module.exports = { +name: "@yarnpkg/plugin-workspace-tools", +factory: function (require) { +var plugin=(()=>{var wr=Object.create,me=Object.defineProperty,Sr=Object.defineProperties,vr=Object.getOwnPropertyDescriptor,Hr=Object.getOwnPropertyDescriptors,$r=Object.getOwnPropertyNames,et=Object.getOwnPropertySymbols,kr=Object.getPrototypeOf,tt=Object.prototype.hasOwnProperty,Tr=Object.prototype.propertyIsEnumerable;var rt=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,B=(e,t)=>{for(var r in t||(t={}))tt.call(t,r)&&rt(e,r,t[r]);if(et)for(var r of et(t))Tr.call(t,r)&&rt(e,r,t[r]);return e},Q=(e,t)=>Sr(e,Hr(t)),Lr=e=>me(e,"__esModule",{value:!0});var K=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Or=(e,t)=>{for(var r in t)me(e,r,{get:t[r],enumerable:!0})},Nr=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $r(t))!tt.call(e,n)&&n!=="default"&&me(e,n,{get:()=>t[n],enumerable:!(r=vr(t,n))||r.enumerable});return e},X=e=>Nr(Lr(me(e!=null?wr(kr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var $e=K(te=>{"use strict";te.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;te.find=(e,t)=>e.nodes.find(r=>r.type===t);te.exceedsLimit=(e,t,r=1,n)=>n===!1||!te.isInteger(e)||!te.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;te.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];!n||(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};te.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):!1;te.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0==0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;te.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;te.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);te.flatten=(...e)=>{let t=[],r=n=>{for(let s=0;s{"use strict";var it=$e();at.exports=(e,t={})=>{let r=(n,s={})=>{let a=t.escapeInvalid&&it.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o="";if(n.value)return(a||i)&&it.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let h of n.nodes)o+=r(h);return o};return r(e)}});var ct=K((os,ot)=>{"use strict";ot.exports=function(e){return typeof e=="number"?e-e==0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var At=K((cs,ut)=>{"use strict";var lt=ct(),pe=(e,t,r)=>{if(lt(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(lt(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n=B({relaxZeros:!0},r);typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),a=String(n.shorthand),i=String(n.capture),o=String(n.wrap),h=e+":"+t+"="+s+a+i+o;if(pe.cache.hasOwnProperty(h))return pe.cache[h].result;let g=Math.min(e,t),f=Math.max(e,t);if(Math.abs(g-f)===1){let R=e+"|"+t;return n.capture?`(${R})`:n.wrap===!1?R:`(?:${R})`}let A=ft(e)||ft(t),p={min:e,max:t,a:g,b:f},k=[],y=[];if(A&&(p.isPadded=A,p.maxLen=String(p.max).length),g<0){let R=f<0?Math.abs(f):1;y=pt(R,Math.abs(g),p,n),g=p.a=0}return f>=0&&(k=pt(g,f,p,n)),p.negatives=y,p.positives=k,p.result=Ir(y,k,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&k.length+y.length>1&&(p.result=`(?:${p.result})`),pe.cache[h]=p,p.result};function Ir(e,t,r){let n=Pe(e,t,"-",!1,r)||[],s=Pe(t,e,"",!1,r)||[],a=Pe(e,t,"-?",!0,r)||[];return n.concat(a).concat(s).join("|")}function Mr(e,t){let r=1,n=1,s=ht(e,r),a=new Set([t]);for(;e<=s&&s<=t;)a.add(s),r+=1,s=ht(e,r);for(s=dt(t+1,n)-1;e1&&o.count.pop(),o.count.push(f.count[0]),o.string=o.pattern+gt(o.count),i=g+1;continue}r.isPadded&&(A=Gr(g,r,n)),f.string=A+f.pattern+gt(f.count),a.push(f),i=g+1,o=f}return a}function Pe(e,t,r,n,s){let a=[];for(let i of e){let{string:o}=i;!n&&!mt(t,"string",o)&&a.push(r+o),n&&mt(t,"string",o)&&a.push(r+o)}return a}function Pr(e,t){let r=[];for(let n=0;nt?1:t>e?-1:0}function mt(e,t,r){return e.some(n=>n[t]===r)}function ht(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function dt(e,t){return e-e%Math.pow(10,t)}function gt(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Dr(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function ft(e){return/^-?(0+)\d/.test(e)}function Gr(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}pe.cache={};pe.clearCache=()=>pe.cache={};ut.exports=pe});var Ge=K((us,Rt)=>{"use strict";var qr=require("util"),yt=At(),bt=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Kr=e=>t=>e===!0?Number(t):String(t),De=e=>typeof e=="number"||typeof e=="string"&&e!=="",Re=e=>Number.isInteger(+e),Ue=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Wr=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,jr=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},_t=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length{e.negatives.sort((i,o)=>io?1:0),e.positives.sort((i,o)=>io?1:0);let r=t.capture?"":"?:",n="",s="",a;return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n&&s?a=`${n}|${s}`:a=n||s,t.wrap?`(${r}${a})`:a},Et=(e,t,r,n)=>{if(r)return yt(e,t,B({wrap:!1},n));let s=String.fromCharCode(e);if(e===t)return s;let a=String.fromCharCode(t);return`[${s}-${a}]`},xt=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${e.join("|")})`:e.join("|")}return yt(e,t,r)},Ct=(...e)=>new RangeError("Invalid range arguments: "+qr.inspect(...e)),wt=(e,t,r)=>{if(r.strictRanges===!0)throw Ct([e,t]);return[]},Qr=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},Xr=(e,t,r=1,n={})=>{let s=Number(e),a=Number(t);if(!Number.isInteger(s)||!Number.isInteger(a)){if(n.strictRanges===!0)throw Ct([e,t]);return[]}s===0&&(s=0),a===0&&(a=0);let i=s>a,o=String(e),h=String(t),g=String(r);r=Math.max(Math.abs(r),1);let f=Ue(o)||Ue(h)||Ue(g),A=f?Math.max(o.length,h.length,g.length):0,p=f===!1&&Wr(e,t,n)===!1,k=n.transform||Kr(p);if(n.toRegex&&r===1)return Et(_t(e,A),_t(t,A),!0,n);let y={negatives:[],positives:[]},R=T=>y[T<0?"negatives":"positives"].push(Math.abs(T)),_=[],x=0;for(;i?s>=a:s<=a;)n.toRegex===!0&&r>1?R(s):_.push(jr(k(s,x),A,p)),s=i?s-r:s+r,x++;return n.toRegex===!0?r>1?Fr(y,n):xt(_,null,B({wrap:!1},n)):_},Zr=(e,t,r=1,n={})=>{if(!Re(e)&&e.length>1||!Re(t)&&t.length>1)return wt(e,t,n);let s=n.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),o=a>i,h=Math.min(a,i),g=Math.max(a,i);if(n.toRegex&&r===1)return Et(h,g,!1,n);let f=[],A=0;for(;o?a>=i:a<=i;)f.push(s(a,A)),a=o?a-r:a+r,A++;return n.toRegex===!0?xt(f,null,{wrap:!1,options:n}):f},Te=(e,t,r,n={})=>{if(t==null&&De(e))return[e];if(!De(e)||!De(t))return wt(e,t,n);if(typeof r=="function")return Te(e,t,1,{transform:r});if(bt(r))return Te(e,t,0,r);let s=B({},n);return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Re(r)?Re(e)&&Re(t)?Xr(e,t,r,s):Zr(e,t,Math.max(Math.abs(r),1),s):r!=null&&!bt(r)?Qr(r,s):Te(e,t,1,r)};Rt.exports=Te});var Ht=K((ls,St)=>{"use strict";var Yr=Ge(),vt=$e(),zr=(e,t={})=>{let r=(n,s={})=>{let a=vt.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o=a===!0||i===!0,h=t.escapeInvalid===!0?"\\":"",g="";if(n.isOpen===!0||n.isClose===!0)return h+n.value;if(n.type==="open")return o?h+n.value:"(";if(n.type==="close")return o?h+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":o?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let f=vt.reduce(n.nodes),A=Yr(...f,Q(B({},t),{wrap:!1,toRegex:!0}));if(A.length!==0)return f.length>1&&A.length>1?`(${A})`:A}if(n.nodes)for(let f of n.nodes)g+=r(f,n);return g};return r(e)};St.exports=zr});var Tt=K((ps,$t)=>{"use strict";var Vr=Ge(),kt=ke(),he=$e(),fe=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?he.flatten(t).map(s=>`{${s}}`):t;for(let s of e)if(Array.isArray(s))for(let a of s)n.push(fe(a,t,r));else for(let a of t)r===!0&&typeof a=="string"&&(a=`{${a}}`),n.push(Array.isArray(a)?fe(s,a,r):s+a);return he.flatten(n)},Jr=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(s,a={})=>{s.queue=[];let i=a,o=a.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,o=i.queue;if(s.invalid||s.dollar){o.push(fe(o.pop(),kt(s,t)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){o.push(fe(o.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let A=he.reduce(s.nodes);if(he.exceedsLimit(...A,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=Vr(...A,t);p.length===0&&(p=kt(s,t)),o.push(fe(o.pop(),p)),s.nodes=[];return}let h=he.encloseBrace(s),g=s.queue,f=s;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,g=f.queue;for(let A=0;A{"use strict";Lt.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Pt=K((hs,Nt)=>{"use strict";var en=ke(),{MAX_LENGTH:It,CHAR_BACKSLASH:qe,CHAR_BACKTICK:tn,CHAR_COMMA:rn,CHAR_DOT:nn,CHAR_LEFT_PARENTHESES:sn,CHAR_RIGHT_PARENTHESES:an,CHAR_LEFT_CURLY_BRACE:on,CHAR_RIGHT_CURLY_BRACE:cn,CHAR_LEFT_SQUARE_BRACKET:Bt,CHAR_RIGHT_SQUARE_BRACKET:Mt,CHAR_DOUBLE_QUOTE:un,CHAR_SINGLE_QUOTE:ln,CHAR_NO_BREAK_SPACE:pn,CHAR_ZERO_WIDTH_NOBREAK_SPACE:fn}=Ot(),hn=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(It,r.maxLength):It;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let s={type:"root",input:e,nodes:[]},a=[s],i=s,o=s,h=0,g=e.length,f=0,A=0,p,k={},y=()=>e[f++],R=_=>{if(_.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&_.type==="text"){o.value+=_.value;return}return i.nodes.push(_),_.parent=i,_.prev=o,o=_,_};for(R({type:"bos"});f0){if(i.ranges>0){i.ranges=0;let _=i.nodes.shift();i.nodes=[_,{type:"text",value:en(i)}]}R({type:"comma",value:p}),i.commas++;continue}if(p===nn&&A>0&&i.commas===0){let _=i.nodes;if(A===0||_.length===0){R({type:"text",value:p});continue}if(o.type==="dot"){if(i.range=[],o.value+=p,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){_.pop();let x=_[_.length-1];x.value+=o.value+p,o=x,i.ranges--;continue}R({type:"dot",value:p});continue}R({type:"text",value:p})}do if(i=a.pop(),i.type!=="root"){i.nodes.forEach(T=>{T.nodes||(T.type==="open"&&(T.isOpen=!0),T.type==="close"&&(T.isClose=!0),T.nodes||(T.type="text"),T.invalid=!0)});let _=a[a.length-1],x=_.nodes.indexOf(i);_.nodes.splice(x,1,...i.nodes)}while(a.length>0);return R({type:"eos"}),s};Nt.exports=hn});var Gt=K((ds,Dt)=>{"use strict";var Ut=ke(),dn=Ht(),gn=Tt(),mn=Pt(),V=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let s=V.create(n,t);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(V.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};V.parse=(e,t={})=>mn(e,t);V.stringify=(e,t={})=>typeof e=="string"?Ut(V.parse(e,t),t):Ut(e,t);V.compile=(e,t={})=>(typeof e=="string"&&(e=V.parse(e,t)),dn(e,t));V.expand=(e,t={})=>{typeof e=="string"&&(e=V.parse(e,t));let r=gn(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};V.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?V.compile(e,t):V.expand(e,t);Dt.exports=V});var ye=K((gs,qt)=>{"use strict";var An=require("path"),ie="\\\\/",Kt=`[^${ie}]`,ce="\\.",Rn="\\+",yn="\\?",Le="\\/",bn="(?=.)",Wt="[^/]",Ke=`(?:${Le}|$)`,jt=`(?:^|${Le})`,We=`${ce}{1,2}${Ke}`,_n=`(?!${ce})`,En=`(?!${jt}${We})`,xn=`(?!${ce}{0,1}${Ke})`,Cn=`(?!${We})`,wn=`[^.${Le}]`,Sn=`${Wt}*?`,Ft={DOT_LITERAL:ce,PLUS_LITERAL:Rn,QMARK_LITERAL:yn,SLASH_LITERAL:Le,ONE_CHAR:bn,QMARK:Wt,END_ANCHOR:Ke,DOTS_SLASH:We,NO_DOT:_n,NO_DOTS:En,NO_DOT_SLASH:xn,NO_DOTS_SLASH:Cn,QMARK_NO_DOT:wn,STAR:Sn,START_ANCHOR:jt},vn=Q(B({},Ft),{SLASH_LITERAL:`[${ie}]`,QMARK:Kt,STAR:`${Kt}*?`,DOTS_SLASH:`${ce}{1,2}(?:[${ie}]|$)`,NO_DOT:`(?!${ce})`,NO_DOTS:`(?!(?:^|[${ie}])${ce}{1,2}(?:[${ie}]|$))`,NO_DOT_SLASH:`(?!${ce}{0,1}(?:[${ie}]|$))`,NO_DOTS_SLASH:`(?!${ce}{1,2}(?:[${ie}]|$))`,QMARK_NO_DOT:`[^.${ie}]`,START_ANCHOR:`(?:^|[${ie}])`,END_ANCHOR:`(?:[${ie}]|$)`}),Hn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Hn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:An.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?vn:Ft}}});var be=K(Z=>{"use strict";var $n=require("path"),kn=process.platform==="win32",{REGEX_BACKSLASH:Tn,REGEX_REMOVE_BACKSLASH:Ln,REGEX_SPECIAL_CHARS:On,REGEX_SPECIAL_CHARS_GLOBAL:Nn}=ye();Z.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);Z.hasRegexChars=e=>On.test(e);Z.isRegexChar=e=>e.length===1&&Z.hasRegexChars(e);Z.escapeRegex=e=>e.replace(Nn,"\\$1");Z.toPosixSlashes=e=>e.replace(Tn,"/");Z.removeBackslashes=e=>e.replace(Ln,t=>t==="\\"?"":t);Z.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};Z.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:kn===!0||$n.sep==="\\";Z.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?Z.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};Z.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};Z.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",a=`${n}(?:${e})${s}`;return t.negated===!0&&(a=`(?:^(?!${a}).*$)`),a}});var er=K((As,Qt)=>{"use strict";var Xt=be(),{CHAR_ASTERISK:je,CHAR_AT:In,CHAR_BACKWARD_SLASH:_e,CHAR_COMMA:Bn,CHAR_DOT:Fe,CHAR_EXCLAMATION_MARK:Qe,CHAR_FORWARD_SLASH:Zt,CHAR_LEFT_CURLY_BRACE:Xe,CHAR_LEFT_PARENTHESES:Ze,CHAR_LEFT_SQUARE_BRACKET:Mn,CHAR_PLUS:Pn,CHAR_QUESTION_MARK:Yt,CHAR_RIGHT_CURLY_BRACE:Dn,CHAR_RIGHT_PARENTHESES:zt,CHAR_RIGHT_SQUARE_BRACKET:Un}=ye(),Vt=e=>e===Zt||e===_e,Jt=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?Infinity:1)},Gn=(e,t)=>{let r=t||{},n=e.length-1,s=r.parts===!0||r.scanToEnd===!0,a=[],i=[],o=[],h=e,g=-1,f=0,A=0,p=!1,k=!1,y=!1,R=!1,_=!1,x=!1,T=!1,O=!1,W=!1,G=!1,ne=0,E,b,C={value:"",depth:0,isGlob:!1},M=()=>g>=n,l=()=>h.charCodeAt(g+1),H=()=>(E=b,h.charCodeAt(++g));for(;g0&&(j=h.slice(0,f),h=h.slice(f),A-=f),w&&y===!0&&A>0?(w=h.slice(0,A),c=h.slice(A)):y===!0?(w="",c=h):w=h,w&&w!==""&&w!=="/"&&w!==h&&Vt(w.charCodeAt(w.length-1))&&(w=w.slice(0,-1)),r.unescape===!0&&(c&&(c=Xt.removeBackslashes(c)),w&&T===!0&&(w=Xt.removeBackslashes(w)));let u={prefix:j,input:e,start:f,base:w,glob:c,isBrace:p,isBracket:k,isGlob:y,isExtglob:R,isGlobstar:_,negated:O,negatedExtglob:W};if(r.tokens===!0&&(u.maxDepth=0,Vt(b)||i.push(C),u.tokens=i),r.parts===!0||r.tokens===!0){let I;for(let $=0;${"use strict";var Oe=ye(),J=be(),{MAX_LENGTH:Ne,POSIX_REGEX_SOURCE:qn,REGEX_NON_SPECIAL_CHARS:Kn,REGEX_SPECIAL_CHARS_BACKREF:Wn,REPLACEMENTS:rr}=Oe,jn=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(s=>J.escapeRegex(s)).join("..")}return r},de=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,nr=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=rr[e]||e;let r=B({},t),n=typeof r.maxLength=="number"?Math.min(Ne,r.maxLength):Ne,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let a={type:"bos",value:"",output:r.prepend||""},i=[a],o=r.capture?"":"?:",h=J.isWindows(t),g=Oe.globChars(h),f=Oe.extglobChars(g),{DOT_LITERAL:A,PLUS_LITERAL:p,SLASH_LITERAL:k,ONE_CHAR:y,DOTS_SLASH:R,NO_DOT:_,NO_DOT_SLASH:x,NO_DOTS_SLASH:T,QMARK:O,QMARK_NO_DOT:W,STAR:G,START_ANCHOR:ne}=g,E=m=>`(${o}(?:(?!${ne}${m.dot?R:A}).)*?)`,b=r.dot?"":_,C=r.dot?O:W,M=r.bash===!0?E(r):G;r.capture&&(M=`(${M})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let l={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=J.removePrefix(e,l),s=e.length;let H=[],w=[],j=[],c=a,u,I=()=>l.index===s-1,$=l.peek=(m=1)=>e[l.index+m],ee=l.advance=()=>e[++l.index]||"",se=()=>e.slice(l.index+1),z=(m="",L=0)=>{l.consumed+=m,l.index+=L},Ce=m=>{l.output+=m.output!=null?m.output:m.value,z(m.value)},xr=()=>{let m=1;for(;$()==="!"&&($(2)!=="("||$(3)==="?");)ee(),l.start++,m++;return m%2==0?!1:(l.negated=!0,l.start++,!0)},we=m=>{l[m]++,j.push(m)},ue=m=>{l[m]--,j.pop()},v=m=>{if(c.type==="globstar"){let L=l.braces>0&&(m.type==="comma"||m.type==="brace"),d=m.extglob===!0||H.length&&(m.type==="pipe"||m.type==="paren");m.type!=="slash"&&m.type!=="paren"&&!L&&!d&&(l.output=l.output.slice(0,-c.output.length),c.type="star",c.value="*",c.output=M,l.output+=c.output)}if(H.length&&m.type!=="paren"&&(H[H.length-1].inner+=m.value),(m.value||m.output)&&Ce(m),c&&c.type==="text"&&m.type==="text"){c.value+=m.value,c.output=(c.output||"")+m.value;return}m.prev=c,i.push(m),c=m},Se=(m,L)=>{let d=Q(B({},f[L]),{conditions:1,inner:""});d.prev=c,d.parens=l.parens,d.output=l.output;let S=(r.capture?"(":"")+d.open;we("parens"),v({type:m,value:L,output:l.output?"":y}),v({type:"paren",extglob:!0,value:ee(),output:S}),H.push(d)},Cr=m=>{let L=m.close+(r.capture?")":""),d;if(m.type==="negate"){let S=M;m.inner&&m.inner.length>1&&m.inner.includes("/")&&(S=E(r)),(S!==M||I()||/^\)+$/.test(se()))&&(L=m.close=`)$))${S}`),m.inner.includes("*")&&(d=se())&&/^\.[^\\/.]+$/.test(d)&&(L=m.close=`)${d})${S})`),m.prev.type==="bos"&&(l.negatedExtglob=!0)}v({type:"paren",extglob:!0,value:u,output:L}),ue("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let m=!1,L=e.replace(Wn,(d,S,P,F,q,Me)=>F==="\\"?(m=!0,d):F==="?"?S?S+F+(q?O.repeat(q.length):""):Me===0?C+(q?O.repeat(q.length):""):O.repeat(P.length):F==="."?A.repeat(P.length):F==="*"?S?S+F+(q?M:""):M:S?d:`\\${d}`);return m===!0&&(r.unescape===!0?L=L.replace(/\\/g,""):L=L.replace(/\\+/g,d=>d.length%2==0?"\\\\":d?"\\":"")),L===e&&r.contains===!0?(l.output=e,l):(l.output=J.wrapOutput(L,l,t),l)}for(;!I();){if(u=ee(),u==="\0")continue;if(u==="\\"){let d=$();if(d==="/"&&r.bash!==!0||d==="."||d===";")continue;if(!d){u+="\\",v({type:"text",value:u});continue}let S=/^\\+/.exec(se()),P=0;if(S&&S[0].length>2&&(P=S[0].length,l.index+=P,P%2!=0&&(u+="\\")),r.unescape===!0?u=ee():u+=ee(),l.brackets===0){v({type:"text",value:u});continue}}if(l.brackets>0&&(u!=="]"||c.value==="["||c.value==="[^")){if(r.posix!==!1&&u===":"){let d=c.value.slice(1);if(d.includes("[")&&(c.posix=!0,d.includes(":"))){let S=c.value.lastIndexOf("["),P=c.value.slice(0,S),F=c.value.slice(S+2),q=qn[F];if(q){c.value=P+q,l.backtrack=!0,ee(),!a.output&&i.indexOf(c)===1&&(a.output=y);continue}}}(u==="["&&$()!==":"||u==="-"&&$()==="]")&&(u=`\\${u}`),u==="]"&&(c.value==="["||c.value==="[^")&&(u=`\\${u}`),r.posix===!0&&u==="!"&&c.value==="["&&(u="^"),c.value+=u,Ce({value:u});continue}if(l.quotes===1&&u!=='"'){u=J.escapeRegex(u),c.value+=u,Ce({value:u});continue}if(u==='"'){l.quotes=l.quotes===1?0:1,r.keepQuotes===!0&&v({type:"text",value:u});continue}if(u==="("){we("parens"),v({type:"paren",value:u});continue}if(u===")"){if(l.parens===0&&r.strictBrackets===!0)throw new SyntaxError(de("opening","("));let d=H[H.length-1];if(d&&l.parens===d.parens+1){Cr(H.pop());continue}v({type:"paren",value:u,output:l.parens?")":"\\)"}),ue("parens");continue}if(u==="["){if(r.nobracket===!0||!se().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(de("closing","]"));u=`\\${u}`}else we("brackets");v({type:"bracket",value:u});continue}if(u==="]"){if(r.nobracket===!0||c&&c.type==="bracket"&&c.value.length===1){v({type:"text",value:u,output:`\\${u}`});continue}if(l.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(de("opening","["));v({type:"text",value:u,output:`\\${u}`});continue}ue("brackets");let d=c.value.slice(1);if(c.posix!==!0&&d[0]==="^"&&!d.includes("/")&&(u=`/${u}`),c.value+=u,Ce({value:u}),r.literalBrackets===!1||J.hasRegexChars(d))continue;let S=J.escapeRegex(c.value);if(l.output=l.output.slice(0,-c.value.length),r.literalBrackets===!0){l.output+=S,c.value=S;continue}c.value=`(${o}${S}|${c.value})`,l.output+=c.value;continue}if(u==="{"&&r.nobrace!==!0){we("braces");let d={type:"brace",value:u,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};w.push(d),v(d);continue}if(u==="}"){let d=w[w.length-1];if(r.nobrace===!0||!d){v({type:"text",value:u,output:u});continue}let S=")";if(d.dots===!0){let P=i.slice(),F=[];for(let q=P.length-1;q>=0&&(i.pop(),P[q].type!=="brace");q--)P[q].type!=="dots"&&F.unshift(P[q].value);S=jn(F,r),l.backtrack=!0}if(d.comma!==!0&&d.dots!==!0){let P=l.output.slice(0,d.outputIndex),F=l.tokens.slice(d.tokensIndex);d.value=d.output="\\{",u=S="\\}",l.output=P;for(let q of F)l.output+=q.output||q.value}v({type:"brace",value:u,output:S}),ue("braces"),w.pop();continue}if(u==="|"){H.length>0&&H[H.length-1].conditions++,v({type:"text",value:u});continue}if(u===","){let d=u,S=w[w.length-1];S&&j[j.length-1]==="braces"&&(S.comma=!0,d="|"),v({type:"comma",value:u,output:d});continue}if(u==="/"){if(c.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",i.pop(),c=a;continue}v({type:"slash",value:u,output:k});continue}if(u==="."){if(l.braces>0&&c.type==="dot"){c.value==="."&&(c.output=A);let d=w[w.length-1];c.type="dots",c.output+=u,c.value+=u,d.dots=!0;continue}if(l.braces+l.parens===0&&c.type!=="bos"&&c.type!=="slash"){v({type:"text",value:u,output:A});continue}v({type:"dot",value:u,output:A});continue}if(u==="?"){if(!(c&&c.value==="(")&&r.noextglob!==!0&&$()==="("&&$(2)!=="?"){Se("qmark",u);continue}if(c&&c.type==="paren"){let S=$(),P=u;if(S==="<"&&!J.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(c.value==="("&&!/[!=<:]/.test(S)||S==="<"&&!/<([!=]|\w+>)/.test(se()))&&(P=`\\${u}`),v({type:"text",value:u,output:P});continue}if(r.dot!==!0&&(c.type==="slash"||c.type==="bos")){v({type:"qmark",value:u,output:W});continue}v({type:"qmark",value:u,output:O});continue}if(u==="!"){if(r.noextglob!==!0&&$()==="("&&($(2)!=="?"||!/[!=<:]/.test($(3)))){Se("negate",u);continue}if(r.nonegate!==!0&&l.index===0){xr();continue}}if(u==="+"){if(r.noextglob!==!0&&$()==="("&&$(2)!=="?"){Se("plus",u);continue}if(c&&c.value==="("||r.regex===!1){v({type:"plus",value:u,output:p});continue}if(c&&(c.type==="bracket"||c.type==="paren"||c.type==="brace")||l.parens>0){v({type:"plus",value:u});continue}v({type:"plus",value:p});continue}if(u==="@"){if(r.noextglob!==!0&&$()==="("&&$(2)!=="?"){v({type:"at",extglob:!0,value:u,output:""});continue}v({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);let d=Kn.exec(se());d&&(u+=d[0],l.index+=d[0].length),v({type:"text",value:u});continue}if(c&&(c.type==="globstar"||c.star===!0)){c.type="star",c.star=!0,c.value+=u,c.output=M,l.backtrack=!0,l.globstar=!0,z(u);continue}let m=se();if(r.noextglob!==!0&&/^\([^?]/.test(m)){Se("star",u);continue}if(c.type==="star"){if(r.noglobstar===!0){z(u);continue}let d=c.prev,S=d.prev,P=d.type==="slash"||d.type==="bos",F=S&&(S.type==="star"||S.type==="globstar");if(r.bash===!0&&(!P||m[0]&&m[0]!=="/")){v({type:"star",value:u,output:""});continue}let q=l.braces>0&&(d.type==="comma"||d.type==="brace"),Me=H.length&&(d.type==="pipe"||d.type==="paren");if(!P&&d.type!=="paren"&&!q&&!Me){v({type:"star",value:u,output:""});continue}for(;m.slice(0,3)==="/**";){let ve=e[l.index+4];if(ve&&ve!=="/")break;m=m.slice(3),z("/**",3)}if(d.type==="bos"&&I()){c.type="globstar",c.value+=u,c.output=E(r),l.output=c.output,l.globstar=!0,z(u);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&!F&&I()){l.output=l.output.slice(0,-(d.output+c.output).length),d.output=`(?:${d.output}`,c.type="globstar",c.output=E(r)+(r.strictSlashes?")":"|$)"),c.value+=u,l.globstar=!0,l.output+=d.output+c.output,z(u);continue}if(d.type==="slash"&&d.prev.type!=="bos"&&m[0]==="/"){let ve=m[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(d.output+c.output).length),d.output=`(?:${d.output}`,c.type="globstar",c.output=`${E(r)}${k}|${k}${ve})`,c.value+=u,l.output+=d.output+c.output,l.globstar=!0,z(u+ee()),v({type:"slash",value:"/",output:""});continue}if(d.type==="bos"&&m[0]==="/"){c.type="globstar",c.value+=u,c.output=`(?:^|${k}|${E(r)}${k})`,l.output=c.output,l.globstar=!0,z(u+ee()),v({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-c.output.length),c.type="globstar",c.output=E(r),c.value+=u,l.output+=c.output,l.globstar=!0,z(u);continue}let L={type:"star",value:u,output:M};if(r.bash===!0){L.output=".*?",(c.type==="bos"||c.type==="slash")&&(L.output=b+L.output),v(L);continue}if(c&&(c.type==="bracket"||c.type==="paren")&&r.regex===!0){L.output=u,v(L);continue}(l.index===l.start||c.type==="slash"||c.type==="dot")&&(c.type==="dot"?(l.output+=x,c.output+=x):r.dot===!0?(l.output+=T,c.output+=T):(l.output+=b,c.output+=b),$()!=="*"&&(l.output+=y,c.output+=y)),v(L)}for(;l.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing","]"));l.output=J.escapeLast(l.output,"["),ue("brackets")}for(;l.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing",")"));l.output=J.escapeLast(l.output,"("),ue("parens")}for(;l.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(de("closing","}"));l.output=J.escapeLast(l.output,"{"),ue("braces")}if(r.strictSlashes!==!0&&(c.type==="star"||c.type==="bracket")&&v({type:"maybe_slash",value:"",output:`${k}?`}),l.backtrack===!0){l.output="";for(let m of l.tokens)l.output+=m.output!=null?m.output:m.value,m.suffix&&(l.output+=m.suffix)}return l};nr.fastpaths=(e,t)=>{let r=B({},t),n=typeof r.maxLength=="number"?Math.min(Ne,r.maxLength):Ne,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);e=rr[e]||e;let a=J.isWindows(t),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:h,DOTS_SLASH:g,NO_DOT:f,NO_DOTS:A,NO_DOTS_SLASH:p,STAR:k,START_ANCHOR:y}=Oe.globChars(a),R=r.dot?A:f,_=r.dot?p:f,x=r.capture?"":"?:",T={negated:!1,prefix:""},O=r.bash===!0?".*?":k;r.capture&&(O=`(${O})`);let W=b=>b.noglobstar===!0?O:`(${x}(?:(?!${y}${b.dot?g:i}).)*?)`,G=b=>{switch(b){case"*":return`${R}${h}${O}`;case".*":return`${i}${h}${O}`;case"*.*":return`${R}${O}${i}${h}${O}`;case"*/*":return`${R}${O}${o}${h}${_}${O}`;case"**":return R+W(r);case"**/*":return`(?:${R}${W(r)}${o})?${_}${h}${O}`;case"**/*.*":return`(?:${R}${W(r)}${o})?${_}${O}${i}${h}${O}`;case"**/.*":return`(?:${R}${W(r)}${o})?${i}${h}${O}`;default:{let C=/^(.*?)\.(\w+)$/.exec(b);if(!C)return;let M=G(C[1]);return M?M+i+C[2]:void 0}}},ne=J.removePrefix(e,T),E=G(ne);return E&&r.strictSlashes!==!0&&(E+=`${o}?`),E};tr.exports=nr});var ir=K((ys,ar)=>{"use strict";var Fn=require("path"),Qn=er(),Ye=sr(),ze=be(),Xn=ye(),Zn=e=>e&&typeof e=="object"&&!Array.isArray(e),D=(e,t,r=!1)=>{if(Array.isArray(e)){let f=e.map(p=>D(p,t,r));return p=>{for(let k of f){let y=k(p);if(y)return y}return!1}}let n=Zn(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=t||{},a=ze.isWindows(t),i=n?D.compileRe(e,t):D.makeRe(e,t,!1,!0),o=i.state;delete i.state;let h=()=>!1;if(s.ignore){let f=Q(B({},t),{ignore:null,onMatch:null,onResult:null});h=D(s.ignore,f,r)}let g=(f,A=!1)=>{let{isMatch:p,match:k,output:y}=D.test(f,i,t,{glob:e,posix:a}),R={glob:e,state:o,regex:i,posix:a,input:f,output:y,match:k,isMatch:p};return typeof s.onResult=="function"&&s.onResult(R),p===!1?(R.isMatch=!1,A?R:!1):h(f)?(typeof s.onIgnore=="function"&&s.onIgnore(R),R.isMatch=!1,A?R:!1):(typeof s.onMatch=="function"&&s.onMatch(R),A?R:!0)};return r&&(g.state=o),g};D.test=(e,t,r,{glob:n,posix:s}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let a=r||{},i=a.format||(s?ze.toPosixSlashes:null),o=e===n,h=o&&i?i(e):e;return o===!1&&(h=i?i(e):e,o=h===n),(o===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?o=D.matchBase(e,t,r,s):o=t.exec(h)),{isMatch:Boolean(o),match:o,output:h}};D.matchBase=(e,t,r,n=ze.isWindows(r))=>(t instanceof RegExp?t:D.makeRe(t,r)).test(Fn.basename(e));D.isMatch=(e,t,r)=>D(t,r)(e);D.parse=(e,t)=>Array.isArray(e)?e.map(r=>D.parse(r,t)):Ye(e,Q(B({},t),{fastpaths:!1}));D.scan=(e,t)=>Qn(e,t);D.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let s=t||{},a=s.contains?"":"^",i=s.contains?"":"$",o=`${a}(?:${e.output})${i}`;e&&e.negated===!0&&(o=`^(?!${o}).*$`);let h=D.toRegex(o,t);return n===!0&&(h.state=e),h};D.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(s.output=Ye.fastpaths(e,t)),s.output||(s=Ye(e,t)),D.compileRe(s,t,r,n)};D.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};D.constants=Xn;ar.exports=D});var cr=K((bs,or)=>{"use strict";or.exports=ir()});var hr=K((_s,ur)=>{"use strict";var lr=require("util"),pr=Gt(),oe=cr(),Ve=be(),fr=e=>e===""||e==="./",N=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,s=new Set,a=new Set,i=0,o=f=>{a.add(f.output),r&&r.onResult&&r.onResult(f)};for(let f=0;f!n.has(f));if(r&&g.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(f=>f.replace(/\\/g,"")):t}return g};N.match=N;N.matcher=(e,t)=>oe(e,t);N.isMatch=(e,t,r)=>oe(t,r)(e);N.any=N.isMatch;N.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,s=[],a=o=>{r.onResult&&r.onResult(o),s.push(o.output)},i=N(e,t,Q(B({},r),{onResult:a}));for(let o of s)i.includes(o)||n.add(o);return[...n]};N.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${lr.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>N.contains(e,n,r));if(typeof t=="string"){if(fr(e)||fr(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return N.isMatch(e,t,Q(B({},r),{contains:!0}))};N.matchKeys=(e,t,r)=>{if(!Ve.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=N(Object.keys(e),t,r),s={};for(let a of n)s[a]=e[a];return s};N.some=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=oe(String(s),r);if(n.some(i=>a(i)))return!0}return!1};N.every=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=oe(String(s),r);if(!n.every(i=>a(i)))return!1}return!0};N.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${lr.inspect(e)}"`);return[].concat(t).every(n=>oe(n,r)(e))};N.capture=(e,t,r)=>{let n=Ve.isWindows(r),a=oe.makeRe(String(e),Q(B({},r),{capture:!0})).exec(n?Ve.toPosixSlashes(t):t);if(a)return a.slice(1).map(i=>i===void 0?"":i)};N.makeRe=(...e)=>oe.makeRe(...e);N.scan=(...e)=>oe.scan(...e);N.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let s of pr(String(n),t))r.push(oe.parse(s,t));return r};N.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!/\{.*\}/.test(e)?[e]:pr(e,t)};N.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return N.braces(e,Q(B({},t),{expand:!0}))};ur.exports=N});var gr=K((Es,dr)=>{"use strict";dr.exports=(e,...t)=>new Promise(r=>{r(e(...t))})});var Ar=K((xs,Je)=>{"use strict";var Yn=gr(),mr=e=>{if(e<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=[],r=0,n=()=>{r--,t.length>0&&t.shift()()},s=(o,h,...g)=>{r++;let f=Yn(o,...g);h(f),f.then(n,n)},a=(o,h,...g)=>{rnew Promise(g=>a(o,g,...h));return Object.defineProperties(i,{activeCount:{get:()=>r},pendingCount:{get:()=>t.length}}),i};Je.exports=mr;Je.exports.default=mr});var Vn={};Or(Vn,{default:()=>es});var He=X(require("@yarnpkg/cli")),ae=X(require("@yarnpkg/core")),nt=X(require("@yarnpkg/core")),le=X(require("clipanion")),Ae=class extends He.BaseCommand{constructor(){super(...arguments);this.json=le.Option.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.production=le.Option.Boolean("--production",!1,{description:"Only install regular dependencies by omitting dev dependencies"});this.all=le.Option.Boolean("-A,--all",!1,{description:"Install the entire project"});this.workspaces=le.Option.Rest()}async execute(){let t=await ae.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await ae.Project.find(t,this.context.cwd),s=await ae.Cache.find(t);await r.restoreInstallState({restoreResolutions:!1});let a;if(this.all)a=new Set(r.workspaces);else if(this.workspaces.length===0){if(!n)throw new He.WorkspaceRequiredError(r.cwd,this.context.cwd);a=new Set([n])}else a=new Set(this.workspaces.map(o=>r.getWorkspaceByIdent(nt.structUtils.parseIdent(o))));for(let o of a)for(let h of this.production?["dependencies"]:ae.Manifest.hardDependencies)for(let g of o.manifest.getForScope(h).values()){let f=r.tryWorkspaceByDescriptor(g);f!==null&&a.add(f)}for(let o of r.workspaces)a.has(o)?this.production&&o.manifest.devDependencies.clear():(o.manifest.installConfig=o.manifest.installConfig||{},o.manifest.installConfig.selfReferences=!1,o.manifest.dependencies.clear(),o.manifest.devDependencies.clear(),o.manifest.peerDependencies.clear(),o.manifest.scripts.clear());return(await ae.StreamReport.start({configuration:t,json:this.json,stdout:this.context.stdout,includeLogs:!0},async o=>{await r.install({cache:s,report:o,persistProject:!1})})).exitCode()}};Ae.paths=[["workspaces","focus"]],Ae.usage=le.Command.Usage({category:"Workspace-related commands",description:"install a single workspace and its dependencies",details:"\n This command will run an install as if the specified workspaces (and all other workspaces they depend on) were the only ones in the project. If no workspaces are explicitly listed, the active one will be assumed.\n\n Note that this command is only very moderately useful when using zero-installs, since the cache will contain all the packages anyway - meaning that the only difference between a full install and a focused install would just be a few extra lines in the `.pnp.cjs` file, at the cost of introducing an extra complexity.\n\n If the `-A,--all` flag is set, the entire project will be installed. Combine with `--production` to replicate the old `yarn install --production`.\n "});var st=Ae;var Ie=X(require("@yarnpkg/cli")),ge=X(require("@yarnpkg/core")),Ee=X(require("@yarnpkg/core")),Y=X(require("@yarnpkg/core")),Rr=X(require("@yarnpkg/plugin-git")),U=X(require("clipanion")),Be=X(hr()),yr=X(require("os")),br=X(Ar()),re=X(require("typanion")),xe=class extends Ie.BaseCommand{constructor(){super(...arguments);this.recursive=U.Option.Boolean("-R,--recursive",!1,{description:"Find packages via dependencies/devDependencies instead of using the workspaces field"});this.from=U.Option.Array("--from",[],{description:"An array of glob pattern idents from which to base any recursion"});this.all=U.Option.Boolean("-A,--all",!1,{description:"Run the command on all workspaces of a project"});this.verbose=U.Option.Boolean("-v,--verbose",!1,{description:"Prefix each output line with the name of the originating workspace"});this.parallel=U.Option.Boolean("-p,--parallel",!1,{description:"Run the commands in parallel"});this.interlaced=U.Option.Boolean("-i,--interlaced",!1,{description:"Print the output of commands in real-time instead of buffering it"});this.jobs=U.Option.String("-j,--jobs",{description:"The maximum number of parallel tasks that the execution will be limited to; or `unlimited`",validator:re.isOneOf([re.isEnum(["unlimited"]),re.applyCascade(re.isNumber(),[re.isInteger(),re.isAtLeast(1)])])});this.topological=U.Option.Boolean("-t,--topological",!1,{description:"Run the command after all workspaces it depends on (regular) have finished"});this.topologicalDev=U.Option.Boolean("--topological-dev",!1,{description:"Run the command after all workspaces it depends on (regular + dev) have finished"});this.include=U.Option.Array("--include",[],{description:"An array of glob pattern idents; only matching workspaces will be traversed"});this.exclude=U.Option.Array("--exclude",[],{description:"An array of glob pattern idents; matching workspaces won't be traversed"});this.publicOnly=U.Option.Boolean("--no-private",{description:"Avoid running the command on private workspaces"});this.since=U.Option.String("--since",{description:"Only include workspaces that have been changed since the specified ref.",tolerateBoolean:!0});this.commandName=U.Option.String();this.args=U.Option.Proxy()}async execute(){let t=await ge.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await ge.Project.find(t,this.context.cwd);if(!this.all&&!n)throw new Ie.WorkspaceRequiredError(r.cwd,this.context.cwd);await r.restoreInstallState();let s=this.cli.process([this.commandName,...this.args]),a=s.path.length===1&&s.path[0]==="run"&&typeof s.scriptName!="undefined"?s.scriptName:null;if(s.path.length===0)throw new U.UsageError("Invalid subcommand name for iteration - use the 'run' keyword if you wish to execute a script");let i=this.all?r.topLevelWorkspace:n,o=this.since?Array.from(await Rr.gitUtils.fetchChangedWorkspaces({ref:this.since,project:r})):[i,...this.from.length>0?i.getRecursiveWorkspaceChildren():[]],h=E=>Be.default.isMatch(Y.structUtils.stringifyIdent(E.locator),this.from),g=this.from.length>0?o.filter(h):o,f=new Set([...g,...g.map(E=>[...this.recursive?this.since?E.getRecursiveWorkspaceDependents():E.getRecursiveWorkspaceDependencies():E.getRecursiveWorkspaceChildren()]).flat()]),A=[],p=!1;if(a==null?void 0:a.includes(":")){for(let E of r.workspaces)if(E.manifest.scripts.has(a)&&(p=!p,p===!1))break}for(let E of f)a&&!E.manifest.scripts.has(a)&&!p&&!(await ge.scriptUtils.getWorkspaceAccessibleBinaries(E)).has(a)||a===process.env.npm_lifecycle_event&&E.cwd===n.cwd||this.include.length>0&&!Be.default.isMatch(Y.structUtils.stringifyIdent(E.locator),this.include)||this.exclude.length>0&&Be.default.isMatch(Y.structUtils.stringifyIdent(E.locator),this.exclude)||this.publicOnly&&E.manifest.private===!0||A.push(E);let k=this.parallel?this.jobs==="unlimited"?Infinity:Number(this.jobs)||Math.max(1,(0,yr.cpus)().length/2):1,y=k===1?!1:this.parallel,R=y?this.interlaced:!0,_=(0,br.default)(k),x=new Map,T=new Set,O=0,W=null,G=!1,ne=await Ee.StreamReport.start({configuration:t,stdout:this.context.stdout},async E=>{let b=async(C,{commandIndex:M})=>{if(G)return-1;!y&&this.verbose&&M>1&&E.reportSeparator();let l=zn(C,{configuration:t,verbose:this.verbose,commandIndex:M}),[H,w]=_r(E,{prefix:l,interlaced:R}),[j,c]=_r(E,{prefix:l,interlaced:R});try{this.verbose&&E.reportInfo(null,`${l} Process started`);let u=Date.now(),I=await this.cli.run([this.commandName,...this.args],{cwd:C.cwd,stdout:H,stderr:j})||0;H.end(),j.end(),await w,await c;let $=Date.now();if(this.verbose){let ee=t.get("enableTimers")?`, completed in ${Y.formatUtils.pretty(t,$-u,Y.formatUtils.Type.DURATION)}`:"";E.reportInfo(null,`${l} Process exited (exit code ${I})${ee}`)}return I===130&&(G=!0,W=I),I}catch(u){throw H.end(),j.end(),await w,await c,u}};for(let C of A)x.set(C.anchoredLocator.locatorHash,C);for(;x.size>0&&!E.hasErrors();){let C=[];for(let[H,w]of x){if(T.has(w.anchoredDescriptor.descriptorHash))continue;let j=!0;if(this.topological||this.topologicalDev){let c=this.topologicalDev?new Map([...w.manifest.dependencies,...w.manifest.devDependencies]):w.manifest.dependencies;for(let u of c.values()){let I=r.tryWorkspaceByDescriptor(u);if(j=I===null||!x.has(I.anchoredLocator.locatorHash),!j)break}}if(!!j&&(T.add(w.anchoredDescriptor.descriptorHash),C.push(_(async()=>{let c=await b(w,{commandIndex:++O});return x.delete(H),T.delete(w.anchoredDescriptor.descriptorHash),c})),!y))break}if(C.length===0){let H=Array.from(x.values()).map(w=>Y.structUtils.prettyLocator(t,w.anchoredLocator)).join(", ");E.reportError(Ee.MessageName.CYCLIC_DEPENDENCIES,`Dependency cycle detected (${H})`);return}let l=(await Promise.all(C)).find(H=>H!==0);W===null&&(W=typeof l!="undefined"?1:W),(this.topological||this.topologicalDev)&&typeof l!="undefined"&&E.reportError(Ee.MessageName.UNNAMED,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return W!==null?W:ne.exitCode()}};xe.paths=[["workspaces","foreach"]],xe.usage=U.Command.Usage({category:"Workspace-related commands",description:"run a command on all workspaces",details:"\n This command will run a given sub-command on current and all its descendant workspaces. Various flags can alter the exact behavior of the command:\n\n - If `-p,--parallel` is set, the commands will be ran in parallel; they'll by default be limited to a number of parallel tasks roughly equal to half your core number, but that can be overridden via `-j,--jobs`, or disabled by setting `-j unlimited`.\n\n - If `-p,--parallel` and `-i,--interlaced` are both set, Yarn will print the lines from the output as it receives them. If `-i,--interlaced` wasn't set, it would instead buffer the output from each process and print the resulting buffers only after their source processes have exited.\n\n - If `-t,--topological` is set, Yarn will only run the command after all workspaces that it depends on through the `dependencies` field have successfully finished executing. If `--topological-dev` is set, both the `dependencies` and `devDependencies` fields will be considered when figuring out the wait points.\n\n - If `-A,--all` is set, Yarn will run the command on all the workspaces of a project. By default yarn runs the command only on current and all its descendant workspaces.\n\n - If `-R,--recursive` is set, Yarn will find workspaces to run the command on by recursively evaluating `dependencies` and `devDependencies` fields, instead of looking at the `workspaces` fields.\n\n - If `--from` is set, Yarn will use the packages matching the 'from' glob as the starting point for any recursive search.\n\n - If `--since` is set, Yarn will only run the command on workspaces that have been modified since the specified ref. By default Yarn will use the refs specified by the `changesetBaseRefs` configuration option.\n\n - The command may apply to only some workspaces through the use of `--include` which acts as a whitelist. The `--exclude` flag will do the opposite and will be a list of packages that mustn't execute the script. Both flags accept glob patterns (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.\n\n Adding the `-v,--verbose` flag will cause Yarn to print more information; in particular the name of the workspace that generated the output will be printed at the front of each line.\n\n If the command is `run` and the script being run does not exist the child workspace will be skipped without error.\n ",examples:[["Publish current and all descendant packages","yarn workspaces foreach npm publish --tolerate-republish"],["Run build script on current and all descendant packages","yarn workspaces foreach run build"],["Run build script on current and all descendant packages in parallel, building package dependencies first","yarn workspaces foreach -pt run build"],["Run build script on several packages and all their dependencies, building dependencies first","yarn workspaces foreach -ptR --from '{workspace-a,workspace-b}' run build"]]});var Er=xe;function _r(e,{prefix:t,interlaced:r}){let n=e.createStreamReporter(t),s=new Y.miscUtils.DefaultStream;s.pipe(n,{end:!1}),s.on("finish",()=>{n.end()});let a=new Promise(o=>{n.on("finish",()=>{o(s.active)})});if(r)return[s,a];let i=new Y.miscUtils.BufferStream;return i.pipe(s,{end:!1}),i.on("finish",()=>{s.end()}),[i,a]}function zn(e,{configuration:t,commandIndex:r,verbose:n}){if(!n)return null;let s=Y.structUtils.convertToIdent(e.locator),i=`[${Y.structUtils.stringifyIdent(s)}]:`,o=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],h=o[r%o.length];return Y.formatUtils.pretty(t,i,h)}var Jn={commands:[st,Er]},es=Jn;return Vn;})(); +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ +return plugin; +} +}; diff --git a/code/.yarnrc.yml b/code/.yarnrc.yml index 69145279b416..1afcac545f96 100644 --- a/code/.yarnrc.yml +++ b/code/.yarnrc.yml @@ -23,6 +23,8 @@ plugins: spec: '@yarnpkg/plugin-typescript' - path: ../.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs spec: '@yarnpkg/plugin-interactive-tools' + - path: ../.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs + spec: '@yarnpkg/plugin-workspace-tools' unsafeHttpWhitelist: - localhost diff --git a/code/addons/a11y/package.json b/code/addons/a11y/package.json index 975226757183..3c3987a2670d 100644 --- a/code/addons/a11y/package.json +++ b/code/addons/a11y/package.json @@ -63,7 +63,6 @@ }, "dependencies": { "@storybook/addon-highlight": "7.0.0-alpha.53", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/channels": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", diff --git a/code/addons/a11y/src/manager.test.tsx b/code/addons/a11y/src/manager.test.tsx index 241bfbd19697..be9f23541285 100644 --- a/code/addons/a11y/src/manager.test.tsx +++ b/code/addons/a11y/src/manager.test.tsx @@ -1,13 +1,11 @@ -import { addons } from '@storybook/addons'; import * as api from '@storybook/manager-api'; import { PANEL_ID } from './constants'; import './manager'; jest.mock('@storybook/manager-api'); -jest.mock('@storybook/addons'); const mockedApi = api as unknown as jest.Mocked; mockedApi.getAddonState = jest.fn(); -const mockedAddons = addons as jest.Mocked; +const mockedAddons = api.addons as jest.Mocked; const registrationImpl = mockedAddons.register.mock.calls[0][1]; describe('A11yManager', () => { diff --git a/code/addons/a11y/src/manager.tsx b/code/addons/a11y/src/manager.tsx index 3d863b3eb1b6..718766ab07b8 100644 --- a/code/addons/a11y/src/manager.tsx +++ b/code/addons/a11y/src/manager.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID, PANEL_ID, PARAM_KEY } from './constants'; import { VisionSimulator } from './components/VisionSimulator'; import { A11YPanel } from './components/A11YPanel'; diff --git a/code/addons/actions/package.json b/code/addons/actions/package.json index d1c58519ebd3..255691da0c7a 100644 --- a/code/addons/actions/package.json +++ b/code/addons/actions/package.json @@ -76,7 +76,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/actions/src/manager.tsx b/code/addons/actions/src/manager.tsx index bd024620ac5e..147968d2860a 100644 --- a/code/addons/actions/src/manager.tsx +++ b/code/addons/actions/src/manager.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { STORY_CHANGED } from '@storybook/core-events'; import ActionLogger from './containers/ActionLogger'; import { ADDON_ID, EVENT_ID, PANEL_ID, PARAM_KEY } from './constants'; diff --git a/code/addons/backgrounds/package.json b/code/addons/backgrounds/package.json index a0d0fb12f184..63a635717c06 100644 --- a/code/addons/backgrounds/package.json +++ b/code/addons/backgrounds/package.json @@ -75,7 +75,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/backgrounds/src/manager.tsx b/code/addons/backgrounds/src/manager.tsx index d3b8d095ec97..ecd36b0bb618 100644 --- a/code/addons/backgrounds/src/manager.tsx +++ b/code/addons/backgrounds/src/manager.tsx @@ -1,5 +1,5 @@ import React, { Fragment } from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID } from './constants'; import { BackgroundSelector } from './containers/BackgroundSelector'; diff --git a/code/addons/controls/package.json b/code/addons/controls/package.json index 2a5763962211..4f56ce520ffb 100644 --- a/code/addons/controls/package.json +++ b/code/addons/controls/package.json @@ -67,7 +67,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/blocks": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", diff --git a/code/addons/controls/src/manager.tsx b/code/addons/controls/src/manager.tsx index 430dadd56432..1db002ae853f 100644 --- a/code/addons/controls/src/manager.tsx +++ b/code/addons/controls/src/manager.tsx @@ -1,7 +1,6 @@ import React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types, type API, useArgTypes } from '@storybook/manager-api'; import { AddonPanel } from '@storybook/components'; -import { type API, useArgTypes } from '@storybook/manager-api'; import { ControlsPanel } from './ControlsPanel'; import { ADDON_ID, PARAM_KEY } from './constants'; diff --git a/code/addons/docs/docs/multiframework.md b/code/addons/docs/docs/multiframework.md index a70a59d14533..aeaa394ea3ba 100644 --- a/code/addons/docs/docs/multiframework.md +++ b/code/addons/docs/docs/multiframework.md @@ -113,7 +113,7 @@ This dynamic rendering is framework-specific, meaning it needs a custom implemen Let's take a look at the React framework implementation of `dynamic` snippets as a reference for implementing this feature in other frameworks: ```tsx -import { addons, StoryContext } from '@storybook/addons'; +import { addons, StoryContext } from '@storybook/preview-api'; import { SNIPPET_RENDERED } from '../../shared'; export const jsxDecorator = (storyFn: any, context: StoryContext) => { diff --git a/code/addons/docs/docs/theming.md b/code/addons/docs/docs/theming.md index 58424e647280..a570ba61073a 100644 --- a/code/addons/docs/docs/theming.md +++ b/code/addons/docs/docs/theming.md @@ -14,7 +14,7 @@ Storybook theming is the **recommended way** to theme your docs. Docs uses the s Supposing you have a Storybook theme defined for the main UI in `.storybook/manager.js`: ```js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; // or a custom theme import { themes } from '@storybook/theming'; diff --git a/code/addons/essentials/package.json b/code/addons/essentials/package.json index 01c2dc43ea67..31ae0f086e04 100644 --- a/code/addons/essentials/package.json +++ b/code/addons/essentials/package.json @@ -120,7 +120,6 @@ "@storybook/addon-outline": "7.0.0-alpha.53", "@storybook/addon-toolbars": "7.0.0-alpha.53", "@storybook/addon-viewport": "7.0.0-alpha.53", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-common": "7.0.0-alpha.53", "@storybook/manager-api": "7.0.0-alpha.53", "@storybook/node-logger": "7.0.0-alpha.53", diff --git a/code/addons/highlight/README.md b/code/addons/highlight/README.md index 85e435f744ba..b881349ef6f0 100644 --- a/code/addons/highlight/README.md +++ b/code/addons/highlight/README.md @@ -28,7 +28,7 @@ Highlight DOM nodes by emitting the `HIGHLIGHT` event from within a story or an ```js import React, { useEffect } from 'react'; -import { useChannel } from '@storybook/addons'; +import { useChannel } from '@storybook/preview-api'; import { HIGHLIGHT, RESET_HIGHLIGHT } from '@storybook/addon-highlight'; import { MyComponent } form './MyComponent'; diff --git a/code/addons/highlight/package.json b/code/addons/highlight/package.json index 720f184e2ae1..28d1644d609e 100644 --- a/code/addons/highlight/package.json +++ b/code/addons/highlight/package.json @@ -60,7 +60,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", "global": "^4.4.0" diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index b5a472a753f8..ac4a98d48f8b 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -72,7 +72,6 @@ }, "dependencies": { "@devtools-ds/object-inspector": "^1.1.2", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-common": "7.0.0-alpha.53", diff --git a/code/addons/interactions/src/manager.tsx b/code/addons/interactions/src/manager.tsx index 454945d6c44a..909eeb3b8e6d 100644 --- a/code/addons/interactions/src/manager.tsx +++ b/code/addons/interactions/src/manager.tsx @@ -1,4 +1,4 @@ -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID, PANEL_ID } from './constants'; import { Panel } from './Panel'; diff --git a/code/addons/jest/package.json b/code/addons/jest/package.json index c4465b1bce0b..2019c5f3c074 100644 --- a/code/addons/jest/package.json +++ b/code/addons/jest/package.json @@ -69,7 +69,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/jest/src/manager.tsx b/code/addons/jest/src/manager.tsx index 19a1e46f115a..dbf43e9eb1f0 100644 --- a/code/addons/jest/src/manager.tsx +++ b/code/addons/jest/src/manager.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import { ADDON_ID, PANEL_ID, PARAM_KEY } from './shared'; import Panel from './components/Panel'; diff --git a/code/addons/links/package.json b/code/addons/links/package.json index d89190df7983..3054b4ea20eb 100644 --- a/code/addons/links/package.json +++ b/code/addons/links/package.json @@ -76,10 +76,10 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", "@storybook/csf": "next", + "@storybook/manager-api": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", "@storybook/router": "7.0.0-alpha.53", "@storybook/types": "7.0.0-alpha.53", diff --git a/code/addons/links/src/manager.ts b/code/addons/links/src/manager.ts index bf7b59d99407..9107c8c61904 100644 --- a/code/addons/links/src/manager.ts +++ b/code/addons/links/src/manager.ts @@ -1,4 +1,4 @@ -import { addons } from '@storybook/preview-api'; +import { addons } from '@storybook/manager-api'; import EVENTS, { ADDON_ID } from './constants'; diff --git a/code/addons/measure/package.json b/code/addons/measure/package.json index fc230c0fb84c..91eb00cd51e4 100644 --- a/code/addons/measure/package.json +++ b/code/addons/measure/package.json @@ -74,7 +74,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/measure/src/manager.tsx b/code/addons/measure/src/manager.tsx index 162e7ce43ecd..53bca4d0b716 100644 --- a/code/addons/measure/src/manager.tsx +++ b/code/addons/measure/src/manager.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID, TOOL_ID } from './constants'; import { Tool } from './Tool'; diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 33029c1d319e..19b7767b3edd 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -77,7 +77,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/outline/src/manager.tsx b/code/addons/outline/src/manager.tsx index 3f3f96ae3b06..384ea24c07c6 100644 --- a/code/addons/outline/src/manager.tsx +++ b/code/addons/outline/src/manager.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID } from './constants'; import { OutlineSelector } from './OutlineSelector'; diff --git a/code/addons/storyshots/storyshots-core/package.json b/code/addons/storyshots/storyshots-core/package.json index 8f4caad21919..db95e6209da6 100644 --- a/code/addons/storyshots/storyshots-core/package.json +++ b/code/addons/storyshots/storyshots-core/package.json @@ -38,7 +38,6 @@ }, "dependencies": { "@jest/transform": "^29.3.1", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/babel-plugin-require-context-hook": "1.0.1", "@storybook/client-api": "7.0.0-alpha.53", "@storybook/core-common": "7.0.0-alpha.53", diff --git a/code/addons/storyshots/storyshots-core/src/api/index.ts b/code/addons/storyshots/storyshots-core/src/api/index.ts index ae22540ccc97..c05c2f23a210 100644 --- a/code/addons/storyshots/storyshots-core/src/api/index.ts +++ b/code/addons/storyshots/storyshots-core/src/api/index.ts @@ -1,5 +1,5 @@ import global from 'global'; -import { addons, mockChannel } from '@storybook/addons'; +import { addons, mockChannel } from '@storybook/preview-api'; import ensureOptionsDefaults from './ensureOptionsDefaults'; import snapshotsTests from './snapshotsTestsTemplate'; import integrityTest from './integrityTestTemplate'; diff --git a/code/addons/storysource/package.json b/code/addons/storysource/package.json index a967d4fcf0b1..cbf7e30be0ce 100644 --- a/code/addons/storysource/package.json +++ b/code/addons/storysource/package.json @@ -53,7 +53,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/manager-api": "7.0.0-alpha.53", diff --git a/code/addons/storysource/src/manager.tsx b/code/addons/storysource/src/manager.tsx index 7de7e8845f06..7a7769275ead 100644 --- a/code/addons/storysource/src/manager.tsx +++ b/code/addons/storysource/src/manager.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import { StoryPanel } from './StoryPanel'; import { ADDON_ID, PANEL_ID } from './index'; diff --git a/code/addons/toolbars/package.json b/code/addons/toolbars/package.json index b1bb60323a47..c3e12bbb149c 100644 --- a/code/addons/toolbars/package.json +++ b/code/addons/toolbars/package.json @@ -67,7 +67,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/manager-api": "7.0.0-alpha.53", diff --git a/code/addons/toolbars/src/manager.tsx b/code/addons/toolbars/src/manager.tsx index c6681e989354..c87d3fbf2d80 100644 --- a/code/addons/toolbars/src/manager.tsx +++ b/code/addons/toolbars/src/manager.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ToolbarManager } from './components/ToolbarManager'; import { ADDON_ID } from './constants'; diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index d280893aeede..5f458caa9582 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -72,7 +72,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/addons/viewport/src/manager.tsx b/code/addons/viewport/src/manager.tsx index 81b1b17e588c..e42e3fba40e1 100644 --- a/code/addons/viewport/src/manager.tsx +++ b/code/addons/viewport/src/manager.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { addons, types } from '@storybook/addons'; +import { addons, types } from '@storybook/manager-api'; import { ADDON_ID } from './constants'; diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 0cbb8693ede4..32ad88cc9d3c 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -34,7 +34,6 @@ "prep": "rimraf dist && ../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\"" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-webpack5": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index a23a904da758..ba509e59d2c7 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -59,7 +59,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-webpack5": "7.0.0-alpha.53", "@storybook/core-common": "7.0.0-alpha.53", "@storybook/node-logger": "7.0.0-alpha.53", diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 329891be4c51..7cd90755025c 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -53,7 +53,6 @@ "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "^0.0.5", "@rollup/pluginutils": "^4.2.0", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-vite": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index 2371462058ed..ea42f177a82d 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -52,7 +52,6 @@ }, "dependencies": { "@storybook/addon-svelte-csf": "^2.0.0", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-vite": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", diff --git a/code/frameworks/vue-vite/package.json b/code/frameworks/vue-vite/package.json index 443f74db2ae9..9b2a545d4933 100644 --- a/code/frameworks/vue-vite/package.json +++ b/code/frameworks/vue-vite/package.json @@ -50,7 +50,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-vite": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index a1a684c8a63a..5b5418cd58f1 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-vite": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 6eaf134b1c33..78814937fab0 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/builder-vite": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", diff --git a/code/lib/addons/README.md b/code/lib/addons/README.md index b6e379b3ff21..012fe827ddbd 100644 --- a/code/lib/addons/README.md +++ b/code/lib/addons/README.md @@ -1,9 +1,3 @@ -# Storybook Addons +The contents of this package have moved to `@storybook/preview-api` and `@storybook/manager-api`. Please update your import depending on where are are using this API. -Storybook Addons is a node module which is used to load custom addons to storybook. - -It stores addon loaders, communication channel and other resources which can be used by storybook implementations where required. - ---- - -For more information visit: [storybook.js.org](https://storybook.js.org) +This package will no longer be released as part of the 8.0 release of storybook. diff --git a/code/lib/addons/package.json b/code/lib/addons/package.json index 506ab6150ca1..7d63853ef46c 100644 --- a/code/lib/addons/package.json +++ b/code/lib/addons/package.json @@ -42,14 +42,9 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/channels": "7.0.0-alpha.53", - "@storybook/client-logger": "7.0.0-alpha.53", - "@storybook/core-events": "7.0.0-alpha.53", "@storybook/manager-api": "7.0.0-alpha.53", - "@storybook/router": "7.0.0-alpha.53", - "@storybook/theming": "7.0.0-alpha.53", - "@storybook/types": "7.0.0-alpha.53", - "global": "^4.4.0" + "@storybook/preview-api": "7.0.0-alpha.53", + "@storybook/types": "7.0.0-alpha.53" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0", diff --git a/code/lib/addons/src/index.ts b/code/lib/addons/src/index.ts index a0f33a8e965b..2dee3d2d2ea4 100644 --- a/code/lib/addons/src/index.ts +++ b/code/lib/addons/src/index.ts @@ -1,18 +1,26 @@ -/// +import { type Addon_Type, Addon_TypesEnum } from '@storybook/types'; -// There can only be 1 default export per entry point and it has to be directly from index -// Exporting this twice in order to to be able to import it like { addons } instead of 'addons' -// prefer import { addons } from '@storybook/addons' over import addons from '@storybook/addons' -// -// See main.ts +export { type Addon_Type as Addon, Addon_TypesEnum as types }; -import { addons } from './main'; +export { addons, type AddonStore, mockChannel } from '@storybook/manager-api'; -export * from './make-decorator'; - -export * from './main'; -export * from './storybook-channel-mock'; -// eslint-disable-next-line import/no-cycle -export * from './hooks'; - -export default addons; +export { + type EventMap, + HooksContext, + type Listener, + type MakeDecoratorOptions, + type MakeDecoratorResult, + applyHooks, + makeDecorator, + useArgs, + useCallback, + useChannel, + useEffect, + useGlobals, + useMemo, + useParameter, + useReducer, + useRef, + useState, + useStoryContext, +} from '@storybook/preview-api/dist/addons'; diff --git a/code/lib/addons/src/typings.d.ts b/code/lib/addons/src/typings.d.ts deleted file mode 100644 index afbc638db2fa..000000000000 --- a/code/lib/addons/src/typings.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare module 'global'; -declare module '@hypnosphi/jscodeshift/dist/testUtils'; diff --git a/code/lib/builder-vite/package.json b/code/lib/builder-vite/package.json index b1215c377689..34e889aee0ed 100644 --- a/code/lib/builder-vite/package.json +++ b/code/lib/builder-vite/package.json @@ -43,6 +43,7 @@ "dependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.5", + "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-api": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-common": "7.0.0-alpha.53", diff --git a/code/lib/channels/README.md b/code/lib/channels/README.md index 73583f55bca7..0076f33230bf 100644 --- a/code/lib/channels/README.md +++ b/code/lib/channels/README.md @@ -29,14 +29,4 @@ class Transport { } ``` -Currently, channels are baked into storybook implementations and therefore this module is not designed to be used directly by addon developers. When developing addons, use the `getChannel` method exported by `@storybook/addons` module. For this to work, Storybook implementations should use the `setChannel` method before loading addons. - -```js -import { addons } from '@storybook/addons'; - -const channel = addons.getChannel(); -``` - ---- - For more information visit: [storybook.js.org](https://storybook.js.org) diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 3c5cda5a11b8..c00e401cc7dc 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -68,9 +68,7 @@ "pretty-hrtime": "^1.0.3", "resolve-from": "^5.0.0", "slash": "^3.0.0", - "telejson": "^6.0.8", - "ts-dedent": "^2.0.0", - "util-deprecate": "^1.0.2" + "ts-dedent": "^2.0.0" }, "devDependencies": { "@types/mock-fs": "^4.13.1", diff --git a/code/lib/instrumenter/package.json b/code/lib/instrumenter/package.json index c6a7833ba456..8250f7db151c 100644 --- a/code/lib/instrumenter/package.json +++ b/code/lib/instrumenter/package.json @@ -42,7 +42,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/channels": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", diff --git a/code/lib/instrumenter/src/instrumenter.test.ts b/code/lib/instrumenter/src/instrumenter.test.ts index 367915be5499..17b4bd2ddc3f 100644 --- a/code/lib/instrumenter/src/instrumenter.test.ts +++ b/code/lib/instrumenter/src/instrumenter.test.ts @@ -1,7 +1,7 @@ /// ; /* eslint-disable no-underscore-dangle */ -import { addons, mockChannel } from '@storybook/addons'; +import { addons, mockChannel } from '@storybook/preview-api'; import { logger } from '@storybook/client-logger'; import { FORCE_REMOUNT, diff --git a/code/lib/manager-api/package.json b/code/lib/manager-api/package.json index 62698a3428a4..6f780dd5952e 100644 --- a/code/lib/manager-api/package.json +++ b/code/lib/manager-api/package.json @@ -55,11 +55,10 @@ "semver": "^7.3.7", "store2": "^2.12.0", "telejson": "^6.0.8", - "ts-dedent": "^2.0.0", - "util-deprecate": "^1.0.2" + "ts-dedent": "^2.0.0" }, "devDependencies": { - "@storybook/core-common": "7.0.0-alpha.53", + "@jest/globals": "^29.3.1", "@types/lodash": "^4.14.167", "@types/qs": "^6", "flush-promises": "^1.0.2", diff --git a/code/lib/manager-api/src/index.tsx b/code/lib/manager-api/src/index.tsx index 7038d9b8254b..04e4251f91ff 100644 --- a/code/lib/manager-api/src/index.tsx +++ b/code/lib/manager-api/src/index.tsx @@ -483,3 +483,8 @@ export function useArgTypes(): API_ArgTypes { } export { eventToShortcut, shortcutToHumanString, shortcutMatchesShortcut }; + +export { addons } from './lib/addons'; + +/* deprecated */ +export { mockChannel, types, type Addon, type AddonStore } from './lib/addons'; diff --git a/code/lib/addons/src/main.ts b/code/lib/manager-api/src/lib/addons.ts similarity index 91% rename from code/lib/addons/src/main.ts rename to code/lib/manager-api/src/lib/addons.ts index a4f4e8d06bd8..fa3c202ebbc8 100644 --- a/code/lib/addons/src/main.ts +++ b/code/lib/manager-api/src/lib/addons.ts @@ -2,7 +2,6 @@ import global from 'global'; import type { Channel } from '@storybook/channels'; import { SET_CONFIG } from '@storybook/core-events'; -import type { API } from '@storybook/manager-api'; import type { Addon_Collection, Addon_Config, @@ -13,6 +12,7 @@ import type { } from '@storybook/types'; import { Addon_TypesEnum } from '@storybook/types'; import { logger } from '@storybook/client-logger'; +import type { API } from '../index'; import { mockChannel } from './storybook-channel-mock'; export { Addon_Type as Addon, Addon_TypesEnum as types }; @@ -116,7 +116,7 @@ export class AddonStore { } // Enforce addons store to be a singleton -const KEY = '__STORYBOOK_ADDONS'; +const KEY = '__STORYBOOK_ADDONS_MANAGER'; function getAddonsStore(): AddonStore { if (!global[KEY]) { @@ -125,9 +125,6 @@ function getAddonsStore(): AddonStore { return global[KEY]; } -// Exporting this twice in order to to be able to import it like { addons } instead of 'addons' -// prefer import { addons } from '@storybook/addons' over import addons from '@storybook/addons' -// -// See public_api.ts - export const addons = getAddonsStore(); + +export { mockChannel }; diff --git a/code/lib/addons/src/storybook-channel-mock.ts b/code/lib/manager-api/src/lib/storybook-channel-mock.ts similarity index 100% rename from code/lib/addons/src/storybook-channel-mock.ts rename to code/lib/manager-api/src/lib/storybook-channel-mock.ts diff --git a/code/lib/preview-api/README-addons.md b/code/lib/preview-api/README-addons.md new file mode 100644 index 000000000000..b6e379b3ff21 --- /dev/null +++ b/code/lib/preview-api/README-addons.md @@ -0,0 +1,9 @@ +# Storybook Addons + +Storybook Addons is a node module which is used to load custom addons to storybook. + +It stores addon loaders, communication channel and other resources which can be used by storybook implementations where required. + +--- + +For more information visit: [storybook.js.org](https://storybook.js.org) diff --git a/code/lib/preview-api/README.md b/code/lib/preview-api/README.md index d2dbbf7ab4cd..864bbbb11e7f 100644 --- a/code/lib/preview-api/README.md +++ b/code/lib/preview-api/README.md @@ -6,6 +6,7 @@ TODO write proper documentation of this package This package used to be multiple packages (they have been combined into this one): +- `@storybook/addons` [read (old) docs](./README-addons.md) - `@storybook/client-api` [read (old) docs](./README-client-api.md) - `@storybook/core-client` [read (old) docs](./README-core-client.md) - `@storybook/preview-web` [read (old) docs](./README-preview-web.md) diff --git a/code/lib/preview-api/package.json b/code/lib/preview-api/package.json index 9f1ea6315562..fb92a024b3d0 100644 --- a/code/lib/preview-api/package.json +++ b/code/lib/preview-api/package.json @@ -26,6 +26,11 @@ "require": "./dist/index.js", "types": "./dist/index.d.ts" }, + "./dist/addons": { + "import": "./dist/addons.mjs", + "require": "./dist/addons.js", + "types": "./dist/addons.d.ts" + }, "./dist/store": { "import": "./dist/store.mjs", "require": "./dist/store.js", @@ -62,7 +67,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channels": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", @@ -70,7 +74,6 @@ "@storybook/csf": "next", "@storybook/types": "7.0.0-alpha.53", "@types/qs": "^6.9.5", - "@types/webpack-env": "^1.16.4", "dequal": "^2.0.2", "global": "^4.4.0", "lodash": "^4.17.21", @@ -83,7 +86,9 @@ }, "devDependencies": { "@jest/globals": "^26.6.2", - "ansi-to-html": "^0.6.11" + "@storybook/core-common": "7.0.0-alpha.53", + "ansi-to-html": "^0.6.11", + "react": "^16.14.0" }, "publishConfig": { "access": "public" @@ -91,10 +96,11 @@ "bundler": { "entries": [ "./src/index.ts", - "./src/store.ts", + "./src/addons.ts", "./src/client-api.ts", "./src/core-client.ts", - "./src/preview-web.ts" + "./src/preview-web.ts", + "./src/store.ts" ] }, "gitHead": "3ef14366115c56c1d45c0359ff681cc47ed50532" diff --git a/code/lib/preview-api/src/addons.ts b/code/lib/preview-api/src/addons.ts new file mode 100644 index 000000000000..eab6cf52d111 --- /dev/null +++ b/code/lib/preview-api/src/addons.ts @@ -0,0 +1 @@ +export * from './modules/addons'; diff --git a/code/lib/preview-api/src/index.ts b/code/lib/preview-api/src/index.ts index 7b16a286dd9b..21244054800a 100644 --- a/code/lib/preview-api/src/index.ts +++ b/code/lib/preview-api/src/index.ts @@ -15,18 +15,18 @@ export { useStoryContext, applyHooks, HooksContext, -} from '@storybook/addons'; +} from './addons'; /** * DECORATORS API */ -export { makeDecorator } from '@storybook/addons'; +export { makeDecorator } from './addons'; /** * ADDON API * @deprecated */ -export { addons } from '@storybook/addons'; +export { addons, mockChannel } from './addons'; /** * DOCS API diff --git a/code/lib/addons/src/hooks.test.js b/code/lib/preview-api/src/modules/addons/hooks.test.js similarity index 100% rename from code/lib/addons/src/hooks.test.js rename to code/lib/preview-api/src/modules/addons/hooks.test.js diff --git a/code/lib/addons/src/hooks.ts b/code/lib/preview-api/src/modules/addons/hooks.ts similarity index 95% rename from code/lib/addons/src/hooks.ts rename to code/lib/preview-api/src/modules/addons/hooks.ts index 55ec838f995f..1135c25bf9b2 100644 --- a/code/lib/addons/src/hooks.ts +++ b/code/lib/preview-api/src/modules/addons/hooks.ts @@ -16,8 +16,7 @@ import { RESET_STORY_ARGS, UPDATE_GLOBALS, } from '@storybook/core-events'; -// eslint-disable-next-line import/no-cycle -import { addons } from './index'; +import { addons } from './main'; interface Hook { name: string; @@ -33,30 +32,32 @@ interface Effect { type AbstractFunction = (...args: any[]) => any; export class HooksContext { - hookListsMap: WeakMap; + hookListsMap: WeakMap = undefined as any; - mountedDecorators: Set; + mountedDecorators: Set = undefined as any; - prevMountedDecorators: Set; + prevMountedDecorators: Set = undefined as any; - currentHooks: Hook[]; + currentHooks: Hook[] = undefined as any; - nextHookIndex: number; + nextHookIndex: number = undefined as any; - currentPhase: 'MOUNT' | 'UPDATE' | 'NONE'; + currentPhase: 'MOUNT' | 'UPDATE' | 'NONE' = undefined as any; - currentEffects: Effect[]; + currentEffects: Effect[] = undefined as any; - prevEffects: Effect[]; + prevEffects: Effect[] = undefined as any; - currentDecoratorName: string | null; + currentDecoratorName: string | null = undefined as any; - hasUpdates: boolean; + hasUpdates: boolean = undefined as any; - currentContext: StoryContext | null; + currentContext: StoryContext | null = undefined as any; renderListener = (storyId: StoryId) => { - if (storyId !== this.currentContext.id) return; + if (storyId !== this.currentContext?.id) { + return; + } this.triggerEffects(); this.currentContext = null; this.removeRenderListeners(); diff --git a/code/lib/preview-api/src/modules/addons/index.ts b/code/lib/preview-api/src/modules/addons/index.ts new file mode 100644 index 000000000000..b32933b0c1c9 --- /dev/null +++ b/code/lib/preview-api/src/modules/addons/index.ts @@ -0,0 +1,4 @@ +export * from './main'; +export * from './hooks'; +export * from './make-decorator'; +export * from './storybook-channel-mock'; diff --git a/code/lib/preview-api/src/modules/addons/main.ts b/code/lib/preview-api/src/modules/addons/main.ts new file mode 100644 index 000000000000..d312af273af1 --- /dev/null +++ b/code/lib/preview-api/src/modules/addons/main.ts @@ -0,0 +1,71 @@ +import global from 'global'; + +import type { Channel } from '@storybook/channels'; +import { mockChannel } from './storybook-channel-mock'; + +export class AddonStore { + constructor() { + this.promise = new Promise((res) => { + this.resolve = () => res(this.getChannel()); + }) as Promise; + } + + private channel: Channel | undefined; + + private serverChannel: Channel | undefined; + + private promise: any; + + private resolve: any; + + getChannel = (): Channel => { + // this.channel should get overwritten by setChannel. If it wasn't called (e.g. in non-browser environment), set a mock instead. + if (!this.channel) { + const channel = mockChannel(); + this.setChannel(channel); + return channel; + } + + return this.channel; + }; + + getServerChannel = (): Channel => { + if (!this.serverChannel) { + throw new Error('Accessing non-existent serverChannel'); + } + + return this.serverChannel; + }; + + ready = (): Promise => this.promise; + + hasChannel = (): boolean => !!this.channel; + + hasServerChannel = (): boolean => !!this.serverChannel; + + setChannel = (channel: Channel): void => { + this.channel = channel; + this.resolve(); + }; + + setServerChannel = (channel: Channel): void => { + this.serverChannel = channel; + }; +} + +// Enforce addons store to be a singleton +const KEY = '__STORYBOOK_ADDONS_PREVIEW'; + +function getAddonsStore(): AddonStore { + if (!global[KEY]) { + global[KEY] = new AddonStore(); + } + return global[KEY]; +} + +// Exporting this twice in order to to be able to import it like { addons } instead of 'addons' +// prefer import { addons } from '@storybook/addons' over import addons from '@storybook/addons' +// +// See public_api.ts + +export const addons = getAddonsStore(); diff --git a/code/lib/addons/src/make-decorator.test.ts b/code/lib/preview-api/src/modules/addons/make-decorator.test.ts similarity index 100% rename from code/lib/addons/src/make-decorator.test.ts rename to code/lib/preview-api/src/modules/addons/make-decorator.test.ts diff --git a/code/lib/addons/src/make-decorator.ts b/code/lib/preview-api/src/modules/addons/make-decorator.ts similarity index 100% rename from code/lib/addons/src/make-decorator.ts rename to code/lib/preview-api/src/modules/addons/make-decorator.ts diff --git a/code/lib/preview-api/src/modules/addons/storybook-channel-mock.ts b/code/lib/preview-api/src/modules/addons/storybook-channel-mock.ts new file mode 100644 index 000000000000..cde396320da0 --- /dev/null +++ b/code/lib/preview-api/src/modules/addons/storybook-channel-mock.ts @@ -0,0 +1,10 @@ +import { Channel } from '@storybook/channels'; + +export function mockChannel() { + const transport = { + setHandler: () => {}, + send: () => {}, + }; + + return new Channel({ transport }); +} diff --git a/code/lib/preview-api/src/modules/client-api/ClientApi.test.ts b/code/lib/preview-api/src/modules/client-api/ClientApi.test.ts index 18e96557ad36..65f4d718a9ed 100644 --- a/code/lib/preview-api/src/modules/client-api/ClientApi.test.ts +++ b/code/lib/preview-api/src/modules/client-api/ClientApi.test.ts @@ -1,4 +1,4 @@ -import { addons, mockChannel } from '@storybook/addons'; +import { addons, mockChannel } from '../addons'; import { ClientApi } from './ClientApi'; beforeEach(() => { diff --git a/code/lib/preview-api/src/modules/core-client/start.ts b/code/lib/preview-api/src/modules/core-client/start.ts index 5a6c12814b7d..75b96e7d0063 100644 --- a/code/lib/preview-api/src/modules/core-client/start.ts +++ b/code/lib/preview-api/src/modules/core-client/start.ts @@ -2,8 +2,8 @@ import global from 'global'; import type { Renderer, ArgsStoryFn, Loadable, Path, ProjectAnnotations } from '@storybook/types'; import { createChannel } from '@storybook/channel-postmessage'; -import { addons } from '@storybook/addons'; import { FORCE_RE_RENDER } from '@storybook/core-events'; +import { addons } from '../addons'; import { PreviewWeb } from '../../preview-web'; import { ClientApi } from '../../client-api'; diff --git a/code/lib/preview-api/src/modules/preview-web/Preview.tsx b/code/lib/preview-api/src/modules/preview-web/Preview.tsx index a233afdafce5..24c81d51e065 100644 --- a/code/lib/preview-api/src/modules/preview-web/Preview.tsx +++ b/code/lib/preview-api/src/modules/preview-web/Preview.tsx @@ -15,7 +15,6 @@ import { } from '@storybook/core-events'; import { logger, deprecate } from '@storybook/client-logger'; import type { Channel } from '@storybook/channels'; -import { addons } from '@storybook/addons'; import type { Renderer, Args, @@ -29,6 +28,7 @@ import type { StoryId, StoryRenderOptions, } from '@storybook/types'; +import { addons } from '../addons'; import { StoryStore } from '../../store'; import { StoryRender } from './render/StoryRender'; diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts index ae4dc52f54a3..87c9bc6983b3 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.integration.test.ts @@ -5,9 +5,8 @@ import React from 'react'; import global from 'global'; import type { Store_RenderContext } from '@storybook/types'; -import { addons, mockChannel as createMockChannel } from '@storybook/addons'; - import { expect } from '@jest/globals'; +import { addons, mockChannel as createMockChannel } from '../addons'; import { PreviewWeb } from './PreviewWeb'; import { WebView } from './WebView'; diff --git a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts index 46b651379fa1..a6973c7697c3 100644 --- a/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts +++ b/code/lib/preview-api/src/modules/preview-web/PreviewWeb.test.ts @@ -31,8 +31,8 @@ import { UPDATE_STORY_ARGS, } from '@storybook/core-events'; import { logger } from '@storybook/client-logger'; -import { addons, mockChannel as createMockChannel } from '@storybook/addons'; import type { Renderer, Store_ModuleImportFn, ProjectAnnotations } from '@storybook/types'; +import { addons, mockChannel as createMockChannel } from '../addons'; import { PreviewWeb } from './PreviewWeb'; import { diff --git a/code/lib/preview-api/src/modules/store/StoryStore.ts b/code/lib/preview-api/src/modules/store/StoryStore.ts index 1cca0afd842b..c57992d3b94b 100644 --- a/code/lib/preview-api/src/modules/store/StoryStore.ts +++ b/code/lib/preview-api/src/modules/store/StoryStore.ts @@ -27,7 +27,7 @@ import mapValues from 'lodash/mapValues'; import pick from 'lodash/pick'; import { SynchronousPromise } from 'synchronous-promise'; -import { HooksContext } from '@storybook/addons'; +import { HooksContext } from '../addons'; import { StoryIndexStore } from './StoryIndexStore'; import { ArgsStore } from './ArgsStore'; import { GlobalsStore } from './GlobalsStore'; diff --git a/code/lib/preview-api/src/modules/store/csf/prepareStory.test.ts b/code/lib/preview-api/src/modules/store/csf/prepareStory.test.ts index a724ea7879cc..bccf030a7bba 100644 --- a/code/lib/preview-api/src/modules/store/csf/prepareStory.test.ts +++ b/code/lib/preview-api/src/modules/store/csf/prepareStory.test.ts @@ -2,7 +2,6 @@ import global from 'global'; import { expect } from '@jest/globals'; -import { addons, HooksContext } from '@storybook/addons'; import type { Renderer, ArgsEnhancer, @@ -10,6 +9,7 @@ import type { SBObjectType, SBScalarType, } from '@storybook/types'; +import { addons, HooksContext } from '../../addons'; import { NO_TARGET_NAME } from '../args'; import { prepareStory } from './prepareStory'; diff --git a/code/lib/preview-api/src/modules/store/csf/prepareStory.ts b/code/lib/preview-api/src/modules/store/csf/prepareStory.ts index ba7ccc6320de..c580e739bce5 100644 --- a/code/lib/preview-api/src/modules/store/csf/prepareStory.ts +++ b/code/lib/preview-api/src/modules/store/csf/prepareStory.ts @@ -22,7 +22,7 @@ import type { } from '@storybook/types'; import { includeConditionalArg } from '@storybook/csf'; -import { applyHooks } from '@storybook/addons'; +import { applyHooks } from '../../addons'; import { combineParameters } from '../parameters'; import { defaultDecorateStory } from '../decorators'; import { groupArgsByTarget, NO_TARGET_NAME } from '../args'; diff --git a/code/lib/preview-api/src/modules/store/csf/testing-utils/index.ts b/code/lib/preview-api/src/modules/store/csf/testing-utils/index.ts index 9097679f0081..49269c25b6c9 100644 --- a/code/lib/preview-api/src/modules/store/csf/testing-utils/index.ts +++ b/code/lib/preview-api/src/modules/store/csf/testing-utils/index.ts @@ -12,7 +12,7 @@ import type { Parameters, } from '@storybook/types'; -import { HooksContext } from '@storybook/addons'; +import { HooksContext } from '../../../addons'; import { composeConfigs } from '../composeConfigs'; import { prepareStory } from '../prepareStory'; import { normalizeStory } from '../normalizeStory'; diff --git a/code/lib/preview-api/src/modules/store/hooks.test.ts b/code/lib/preview-api/src/modules/store/hooks.test.ts index 069c4d3b3819..bbd72f95b0a5 100644 --- a/code/lib/preview-api/src/modules/store/hooks.test.ts +++ b/code/lib/preview-api/src/modules/store/hooks.test.ts @@ -6,6 +6,7 @@ import { RESET_STORY_ARGS, UPDATE_GLOBALS, } from '@storybook/core-events'; +import type { DecoratorFunction, StoryContext } from '@storybook/types'; import { addons, applyHooks, @@ -21,8 +22,7 @@ import { HooksContext, useArgs, useGlobals, -} from '@storybook/addons'; -import type { DecoratorFunction, StoryContext } from '@storybook/types'; +} from '../addons'; import { defaultDecorateStory } from './decorators'; diff --git a/code/lib/preview-api/src/modules/store/hooks.ts b/code/lib/preview-api/src/modules/store/hooks.ts index 69ad8b95e691..0fee97ba8893 100644 --- a/code/lib/preview-api/src/modules/store/hooks.ts +++ b/code/lib/preview-api/src/modules/store/hooks.ts @@ -15,7 +15,7 @@ import { useParameter, useArgs, useGlobals, -} from '@storybook/addons'; +} from '../addons'; export { HooksContext, diff --git a/code/lib/preview/package.json b/code/lib/preview/package.json index 8b04abe5fd00..42f43be413fd 100644 --- a/code/lib/preview/package.json +++ b/code/lib/preview/package.json @@ -56,39 +56,19 @@ "check": "../../../scripts/node_modules/.bin/tsc --noEmit", "prep": "../../../scripts/prepare/bundle.ts" }, - "dependencies": { - "@types/shelljs": "^0.8.7", - "fs-extra": "^9.0.1", - "shelljs": "^0.8.5" - }, "devDependencies": { + "@fal-works/esbuild-plugin-global-externals": "^2.1.2", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", "@storybook/channels": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", - "@storybook/core-common": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", - "@storybook/csf": "next", - "@storybook/manager-api": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", - "@storybook/router": "7.0.0-alpha.53", - "@storybook/theming": "7.0.0-alpha.53", - "@storybook/types": "7.0.0-alpha.53", - "@types/qs": "^6.9.5", - "@types/webpack-env": "^1.16.4", - "ansi-to-html": "^0.6.11", - "dequal": "^2.0.2", - "global": "^4.4.0", - "lodash": "^4.17.21", - "memoizerific": "^1.11.3", - "qs": "^6.10.0", - "react": "16.14.0", - "slash": "^3.0.0", - "synchronous-promise": "^2.0.15", + "@types/shelljs": "^0.8.7", + "fs-extra": "^9.0.1", + "shelljs": "^0.8.5", "ts-dedent": "^2.0.0", - "ts-jest": "^28.0.8", - "typescript": "~4.6.3", - "util-deprecate": "^1.0.2" + "typescript": "~4.6.3" }, "publishConfig": { "access": "public" diff --git a/code/lib/preview/src/globals/exports.ts b/code/lib/preview/src/globals/exports.ts index 8e728bee2365..416c5cf169a1 100644 --- a/code/lib/preview/src/globals/exports.ts +++ b/code/lib/preview/src/globals/exports.ts @@ -8,10 +8,8 @@ export default { 'HooksContext', 'addons', 'applyHooks', - 'isSupportedType', 'makeDecorator', 'mockChannel', - 'types', 'useArgs', 'useCallback', 'useChannel', @@ -165,6 +163,7 @@ export default { 'getQueryParams', 'inferControls', 'makeDecorator', + 'mockChannel', 'normalizeStory', 'prepareStory', 'sanitizeStoryContextUpdate', diff --git a/code/lib/preview/src/modules/addons.ts b/code/lib/preview/src/modules/addons.ts index 610dab5bfd22..a6e93c0af143 100644 --- a/code/lib/preview/src/modules/addons.ts +++ b/code/lib/preview/src/modules/addons.ts @@ -1,2 +1,2 @@ /* eslint-disable import/no-extraneous-dependencies */ -export * from '@storybook/addons'; +export * from '@storybook/preview-api/dist/addons'; diff --git a/code/lib/store/template/stories/hooks.stories.ts b/code/lib/store/template/stories/hooks.stories.ts index 7f952c3b760f..d09c21af2115 100644 --- a/code/lib/store/template/stories/hooks.stories.ts +++ b/code/lib/store/template/stories/hooks.stories.ts @@ -1,6 +1,6 @@ import globalThis from 'global'; import type { PartialStoryFn, PlayFunctionContext } from '@storybook/types'; -import { useEffect, useState } from '@storybook/addons'; +import { useEffect, useState } from '@storybook/preview-api'; import { within, userEvent } from '@storybook/testing-library'; export default { diff --git a/code/renderers/html/package.json b/code/renderers/html/package.json index 6a111484562b..63720bcbf488 100644 --- a/code/renderers/html/package.json +++ b/code/renderers/html/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", diff --git a/code/renderers/preact/package.json b/code/renderers/preact/package.json index ce1a1bceddb8..f7135aa60d39 100644 --- a/code/renderers/preact/package.json +++ b/code/renderers/preact/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", "@storybook/types": "7.0.0-alpha.53", diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 4a4505a0590d..87f260e755d8 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -52,7 +52,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", diff --git a/code/renderers/server/package.json b/code/renderers/server/package.json index b7eb8a4683db..83a9f8de4203 100644 --- a/code/renderers/server/package.json +++ b/code/renderers/server/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", "@storybook/types": "7.0.0-alpha.53", diff --git a/code/renderers/svelte/package.json b/code/renderers/svelte/package.json index b0023eefe170..b4f1fd3d4cb1 100644 --- a/code/renderers/svelte/package.json +++ b/code/renderers/svelte/package.json @@ -55,7 +55,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", diff --git a/code/renderers/vue/package.json b/code/renderers/vue/package.json index 62df0934c827..31463a201427 100644 --- a/code/renderers/vue/package.json +++ b/code/renderers/vue/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", diff --git a/code/renderers/vue3/package.json b/code/renderers/vue3/package.json index 44286f8c0267..9750528b1976 100644 --- a/code/renderers/vue3/package.json +++ b/code/renderers/vue3/package.json @@ -51,7 +51,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", "@storybook/preview-api": "7.0.0-alpha.53", diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index df94a70b73f5..35d2fc8aeb24 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -53,7 +53,6 @@ "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { - "@storybook/addons": "7.0.0-alpha.53", "@storybook/client-logger": "7.0.0-alpha.53", "@storybook/core-client": "7.0.0-alpha.53", "@storybook/docs-tools": "7.0.0-alpha.53", diff --git a/code/ui/.storybook/manager.ts b/code/ui/.storybook/manager.ts index ece01ccdfaee..047f4ba86918 100644 --- a/code/ui/.storybook/manager.ts +++ b/code/ui/.storybook/manager.ts @@ -1,4 +1,4 @@ -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import startCase from 'lodash/startCase'; addons.setConfig({ diff --git a/code/ui/.storybook/preview.tsx b/code/ui/.storybook/preview.tsx index fde9a77b7a4b..308837ed5bb3 100644 --- a/code/ui/.storybook/preview.tsx +++ b/code/ui/.storybook/preview.tsx @@ -10,10 +10,9 @@ import { styled, useTheme, } from '@storybook/theming'; -import { useArgs } from '@storybook/addons'; +import { useArgs, DocsContext } from '@storybook/preview-api'; import { Symbols } from '@storybook/components'; import type { PreviewWeb } from '@storybook/preview-api'; -import { DocsContext } from '@storybook/preview-api'; import type { ReactRenderer } from '@storybook/react'; import type { Channel } from '@storybook/channels'; diff --git a/code/ui/blocks/package.json b/code/ui/blocks/package.json index b8ce7a020e1c..f2e8cf19fd2d 100644 --- a/code/ui/blocks/package.json +++ b/code/ui/blocks/package.json @@ -66,7 +66,6 @@ }, "devDependencies": { "@storybook/addon-actions": "7.0.0-alpha.53", - "@storybook/addons": "7.0.0-alpha.53", "@types/color-convert": "^2.0.0" }, "peerDependencies": { diff --git a/code/ui/blocks/src/blocks/Story.stories.tsx b/code/ui/blocks/src/blocks/Story.stories.tsx index 38ad9646acf8..05a743469143 100644 --- a/code/ui/blocks/src/blocks/Story.stories.tsx +++ b/code/ui/blocks/src/blocks/Story.stories.tsx @@ -104,11 +104,17 @@ export const WithDefaultInteractions: Story = { args: { of: BooleanStories.Toggling, }, + parameters: { + chromatic: { delay: 500 }, + }, }; export const WithInteractionsAutoplayInStory: Story = { args: { of: BooleanStories.TogglingInDocs, }, + parameters: { + chromatic: { delay: 500 }, + }, }; // TODO: types suggest that can take ProjectAnnotations, but it doesn't seem to do anything with them diff --git a/code/ui/blocks/src/controls/Boolean.stories.tsx b/code/ui/blocks/src/controls/Boolean.stories.tsx index 82458c745a4b..958a9b7b3595 100644 --- a/code/ui/blocks/src/controls/Boolean.stories.tsx +++ b/code/ui/blocks/src/controls/Boolean.stories.tsx @@ -1,7 +1,7 @@ import { expect } from '@storybook/jest'; import type { Meta, StoryObj } from '@storybook/react'; import { within, fireEvent } from '@storybook/testing-library'; -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/preview-api'; import { RESET_STORY_ARGS, STORY_ARGS_UPDATED } from '@storybook/core-events'; import { BooleanControl } from './Boolean'; diff --git a/code/ui/manager/package.json b/code/ui/manager/package.json index 0fd9214baf93..0dd2d80f8626 100644 --- a/code/ui/manager/package.json +++ b/code/ui/manager/package.json @@ -53,7 +53,6 @@ }, "devDependencies": { "@fal-works/esbuild-plugin-global-externals": "^2.1.2", - "@storybook/addons": "7.0.0-alpha.53", "@storybook/channel-postmessage": "7.0.0-alpha.53", "@storybook/channel-websocket": "7.0.0-alpha.53", "@storybook/channels": "7.0.0-alpha.53", @@ -61,7 +60,6 @@ "@storybook/components": "7.0.0-alpha.53", "@storybook/core-events": "7.0.0-alpha.53", "@storybook/manager-api": "7.0.0-alpha.53", - "@storybook/preview-api": "7.0.0-alpha.53", "@storybook/router": "7.0.0-alpha.53", "@storybook/theming": "7.0.0-alpha.53", "@storybook/types": "7.0.0-alpha.53", diff --git a/code/ui/manager/paths.js b/code/ui/manager/paths.js index 099ee75a6cad..0ad1bef88de3 100644 --- a/code/ui/manager/paths.js +++ b/code/ui/manager/paths.js @@ -6,14 +6,14 @@ const resolve = resolveFrom.bind(null, __dirname); // These paths need to be aliased in the manager webpack config to ensure that all // code running inside the manager uses the *same* version of react[-dom] that we use. module.exports = { - '@storybook/preview-api': dirname(resolve('@storybook/preview-api/package.json')), - '@storybook/manager-api': dirname(resolve('@storybook/manager-api/package.json')), + '@storybook/addons': dirname(resolve('@storybook/addons/package.json')), '@storybook/channels': dirname(resolve('@storybook/channels/package.json')), '@storybook/components': dirname(resolve('@storybook/components/package.json')), '@storybook/core-events': dirname(resolve('@storybook/core-events/package.json')), + '@storybook/manager-api': dirname(resolve('@storybook/manager-api/package.json')), + '@storybook/manager': dirname(resolve('@storybook/manager/package.json')), '@storybook/router': dirname(resolve('@storybook/router/package.json')), '@storybook/theming': dirname(resolve('@storybook/theming/package.json')), - '@storybook/manager': dirname(resolve('@storybook/manager/package.json')), react: dirname(resolve('react/package.json')), 'react-dom': dirname(resolve('react-dom/package.json')), }; diff --git a/code/ui/manager/src/FakeProvider.tsx b/code/ui/manager/src/FakeProvider.tsx index 5f009340e96e..647e1ad81b06 100644 --- a/code/ui/manager/src/FakeProvider.tsx +++ b/code/ui/manager/src/FakeProvider.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { styled } from '@storybook/theming'; -import { addons } from '@storybook/preview-api'; +import { addons } from '@storybook/manager-api'; import Provider from './provider'; export class FakeProvider extends Provider { diff --git a/code/ui/manager/src/components/preview/preview.mockdata.tsx b/code/ui/manager/src/components/preview/preview.mockdata.tsx index 73c368fa1836..463dc97a08a6 100644 --- a/code/ui/manager/src/components/preview/preview.mockdata.tsx +++ b/code/ui/manager/src/components/preview/preview.mockdata.tsx @@ -1,4 +1,4 @@ -import { types, type Addon } from '@storybook/addons'; +import { types, type Addon } from '@storybook/manager-api'; import type { API, State } from '@storybook/manager-api'; import type { PreviewProps } from './utils/types'; diff --git a/code/ui/manager/src/components/preview/preview.tsx b/code/ui/manager/src/components/preview/preview.tsx index 3373dca0f19d..41f3f64dcc7e 100644 --- a/code/ui/manager/src/components/preview/preview.tsx +++ b/code/ui/manager/src/components/preview/preview.tsx @@ -2,9 +2,16 @@ import React, { Fragment, useMemo, useEffect, useRef, useState } from 'react'; import { Helmet } from 'react-helmet-async'; import global from 'global'; -import { type API, Consumer, type Combo, merge } from '@storybook/manager-api'; +import { + type API, + Consumer, + type Combo, + merge, + addons, + types, + type Addon, +} from '@storybook/manager-api'; import { PREVIEW_BUILDER_PROGRESS, SET_CURRENT_STORY } from '@storybook/core-events'; -import { addons, types, type Addon } from '@storybook/addons'; import { Loader } from '@storybook/components'; import { Location } from '@storybook/router'; diff --git a/code/ui/manager/src/components/preview/toolbar.tsx b/code/ui/manager/src/components/preview/toolbar.tsx index ce34f19fbba3..1e84d249bfcc 100644 --- a/code/ui/manager/src/components/preview/toolbar.tsx +++ b/code/ui/manager/src/components/preview/toolbar.tsx @@ -12,8 +12,10 @@ import { type State, merge, type LeafEntry, + addons, + type Addon, + types, } from '@storybook/manager-api'; -import { addons, type Addon, types } from '@storybook/addons'; import { Location, type RenderData } from '@storybook/router'; import { zoomTool } from './tools/zoom'; diff --git a/code/ui/manager/src/components/preview/tools/addons.tsx b/code/ui/manager/src/components/preview/tools/addons.tsx index 5a3fff2382b7..d9412ed2d679 100644 --- a/code/ui/manager/src/components/preview/tools/addons.tsx +++ b/code/ui/manager/src/components/preview/tools/addons.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { IconButton, Icons } from '@storybook/components'; import { Consumer, type Combo } from '@storybook/manager-api'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; const menuMapper = ({ api, state }: Combo) => ({ isVisible: state.layout.showPanel, diff --git a/code/ui/manager/src/components/preview/tools/copy.tsx b/code/ui/manager/src/components/preview/tools/copy.tsx index 69959f67cc36..82b42596faba 100644 --- a/code/ui/manager/src/components/preview/tools/copy.tsx +++ b/code/ui/manager/src/components/preview/tools/copy.tsx @@ -3,7 +3,7 @@ import React from 'react'; import copy from 'copy-to-clipboard'; import { getStoryHref, IconButton, Icons } from '@storybook/components'; import { Consumer, type Combo } from '@storybook/manager-api'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; const { PREVIEW_URL, document } = global; diff --git a/code/ui/manager/src/components/preview/tools/eject.tsx b/code/ui/manager/src/components/preview/tools/eject.tsx index 152637183338..2c638e219e7d 100644 --- a/code/ui/manager/src/components/preview/tools/eject.tsx +++ b/code/ui/manager/src/components/preview/tools/eject.tsx @@ -2,7 +2,7 @@ import global from 'global'; import React from 'react'; import { getStoryHref, IconButton, Icons } from '@storybook/components'; import { Consumer, type Combo } from '@storybook/manager-api'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; const { PREVIEW_URL } = global; diff --git a/code/ui/manager/src/components/preview/tools/menu.tsx b/code/ui/manager/src/components/preview/tools/menu.tsx index 5c1fd5b7472e..b0f60c9e28ba 100644 --- a/code/ui/manager/src/components/preview/tools/menu.tsx +++ b/code/ui/manager/src/components/preview/tools/menu.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { IconButton, Icons, Separator } from '@storybook/components'; import { Consumer, type Combo } from '@storybook/manager-api'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; const menuMapper = ({ api, state }: Combo) => ({ isVisible: state.layout.showNav, diff --git a/code/ui/manager/src/components/preview/tools/remount.tsx b/code/ui/manager/src/components/preview/tools/remount.tsx index 437adab4c1a8..cccf34c5bd56 100644 --- a/code/ui/manager/src/components/preview/tools/remount.tsx +++ b/code/ui/manager/src/components/preview/tools/remount.tsx @@ -2,7 +2,7 @@ import type { ComponentProps } from 'react'; import React, { useState } from 'react'; import { IconButton, Icons } from '@storybook/components'; import { Consumer, type Combo } from '@storybook/manager-api'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; import { styled } from '@storybook/theming'; import { FORCE_REMOUNT } from '@storybook/core-events'; diff --git a/code/ui/manager/src/components/preview/tools/zoom.tsx b/code/ui/manager/src/components/preview/tools/zoom.tsx index 1ab5cc879e96..fe6530b96d17 100644 --- a/code/ui/manager/src/components/preview/tools/zoom.tsx +++ b/code/ui/manager/src/components/preview/tools/zoom.tsx @@ -2,7 +2,7 @@ import type { SyntheticEvent, MouseEventHandler } from 'react'; import React, { Component, useCallback } from 'react'; import { Icons, IconButton, Separator } from '@storybook/components'; -import type { Addon } from '@storybook/addons'; +import type { Addon } from '@storybook/manager-api'; const initialZoom = 1 as const; diff --git a/code/ui/manager/src/globals/exports.ts b/code/ui/manager/src/globals/exports.ts index 2578e4a25d10..92c4a0c4820c 100644 --- a/code/ui/manager/src/globals/exports.ts +++ b/code/ui/manager/src/globals/exports.ts @@ -200,11 +200,14 @@ export default { 'Consumer', 'ManagerContext', 'Provider', + 'addons', 'combineParameters', 'eventToShortcut', 'merge', + 'mockChannel', 'shortcutMatchesShortcut', 'shortcutToHumanString', + 'types', 'useAddonState', 'useArgTypes', 'useArgs', @@ -217,57 +220,6 @@ export default { 'useStorybookApi', 'useStorybookState', ], - '@storybook/preview-api': [ - 'ClientApi', - 'DocsContext', - 'HooksContext', - 'Preview', - 'PreviewWeb', - 'StoryStore', - 'addArgTypes', - 'addArgTypesEnhancer', - 'addArgs', - 'addArgsEnhancer', - 'addDecorator', - 'addLoader', - 'addParameters', - 'addStepRunner', - 'addons', - 'applyHooks', - 'combineArgs', - 'combineParameters', - 'composeConfigs', - 'composeStepRunners', - 'composeStories', - 'composeStory', - 'decorateStory', - 'defaultDecorateStory', - 'filterArgTypes', - 'getQueryParam', - 'getQueryParams', - 'inferControls', - 'makeDecorator', - 'normalizeStory', - 'prepareStory', - 'sanitizeStoryContextUpdate', - 'setGlobalRender', - 'setProjectAnnotations', - 'simulateDOMContentLoaded', - 'simulatePageLoad', - 'sortStoriesV7', - 'start', - 'useArgs', - 'useCallback', - 'useChannel', - 'useEffect', - 'useGlobals', - 'useMemo', - 'useParameter', - 'useReducer', - 'useRef', - 'useState', - 'useStoryContext', - 'userOrAutoTitleFromSpecifier', - ], + '@storybook/addons': ['addons', 'types', 'mockChannel'], '@storybook/client-logger': ['deprecate', 'logger', 'once', 'pretty'], } as const; diff --git a/code/ui/manager/src/globals/runtime.ts b/code/ui/manager/src/globals/runtime.ts index d83f92754859..b09db0bdf2b7 100644 --- a/code/ui/manager/src/globals/runtime.ts +++ b/code/ui/manager/src/globals/runtime.ts @@ -6,8 +6,7 @@ import * as STORYBOOKCHANNELS from '@storybook/channels'; import * as STORYBOOKEVENTS from '@storybook/core-events'; import * as STORYBOOKROUTER from '@storybook/router'; import * as STORYBOOKTHEMING from '@storybook/theming'; -import * as STORYBOOKAPI from '@storybook/manager-api'; -import * as STORYBOOKADDONS from '@storybook/preview-api'; +import * as STORYBOOKMANAGERAPI from '@storybook/manager-api'; import * as STORYBOOKCLIENTLOGGER from '@storybook/client-logger'; import type { Keys } from './types'; @@ -21,7 +20,12 @@ export const values: Required> = { '@storybook/core-events': STORYBOOKEVENTS, '@storybook/router': STORYBOOKROUTER, '@storybook/theming': STORYBOOKTHEMING, - '@storybook/manager-api': STORYBOOKAPI, - '@storybook/preview-api': STORYBOOKADDONS, + '@storybook/manager-api': STORYBOOKMANAGERAPI, + // backwards compatibility + '@storybook/addons': { + addons: STORYBOOKMANAGERAPI.addons, + types: STORYBOOKMANAGERAPI.types, + mockChannel: STORYBOOKMANAGERAPI.mockChannel, + }, '@storybook/client-logger': STORYBOOKCLIENTLOGGER, }; diff --git a/code/ui/manager/src/globals/types.ts b/code/ui/manager/src/globals/types.ts index 238f4c2dc8f4..40c09508a642 100644 --- a/code/ui/manager/src/globals/types.ts +++ b/code/ui/manager/src/globals/types.ts @@ -10,7 +10,7 @@ export enum Keys { '@storybook/router' = '__STORYBOOKROUTER__', '@storybook/theming' = '__STORYBOOKTHEMING__', '@storybook/manager-api' = '__STORYBOOKAPI__', - '@storybook/preview-api' = '__STORYBOOKADDONS__', + '@storybook/addons' = '__STORYBOOKADDONS__', '@storybook/client-logger' = '__STORYBOOKCLIENTLOGGER__', } diff --git a/code/ui/manager/src/runtime.ts b/code/ui/manager/src/runtime.ts index f0bd5588cadc..55b35f7c3927 100644 --- a/code/ui/manager/src/runtime.ts +++ b/code/ui/manager/src/runtime.ts @@ -1,8 +1,8 @@ import global from 'global'; import type { Channel } from '@storybook/channels'; -import type { AddonStore } from '@storybook/addons'; -import { addons } from '@storybook/addons'; +import type { AddonStore } from '@storybook/manager-api'; +import { addons } from '@storybook/manager-api'; import type { Addon_Types, Addon_Config } from '@storybook/types'; import * as postMessage from '@storybook/channel-postmessage'; import * as webSocket from '@storybook/channel-websocket'; diff --git a/code/yarn.lock b/code/yarn.lock index 4c805d44a865..0f2b6106db2b 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5124,7 +5124,6 @@ __metadata: resolution: "@storybook/addon-a11y@workspace:addons/a11y" dependencies: "@storybook/addon-highlight": 7.0.0-alpha.53 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 @@ -5154,7 +5153,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-actions@workspace:addons/actions" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5188,7 +5186,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-backgrounds@workspace:addons/backgrounds" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5215,7 +5212,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-controls@workspace:addons/controls" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/blocks": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 @@ -5287,7 +5283,6 @@ __metadata: "@storybook/addon-outline": 7.0.0-alpha.53 "@storybook/addon-toolbars": 7.0.0-alpha.53 "@storybook/addon-viewport": 7.0.0-alpha.53 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-common": 7.0.0-alpha.53 "@storybook/manager-api": 7.0.0-alpha.53 "@storybook/node-logger": 7.0.0-alpha.53 @@ -5304,7 +5299,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-highlight@workspace:addons/highlight" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 "@types/webpack-env": ^1.16.0 @@ -5318,7 +5312,6 @@ __metadata: resolution: "@storybook/addon-interactions@workspace:addons/interactions" dependencies: "@devtools-ds/object-inspector": ^1.1.2 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-common": 7.0.0-alpha.53 @@ -5352,7 +5345,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-jest@workspace:addons/jest" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5378,10 +5370,10 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-links@workspace:addons/links" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 "@storybook/csf": next + "@storybook/manager-api": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 "@storybook/router": 7.0.0-alpha.53 "@storybook/types": 7.0.0-alpha.53 @@ -5404,7 +5396,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-measure@workspace:addons/measure" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5428,7 +5419,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-outline@workspace:addons/outline" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5479,7 +5469,6 @@ __metadata: "@emotion/jest": ^11.8.0 "@jest/transform": ^29.3.1 "@storybook/addon-docs": 7.0.0-alpha.53 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/angular": 7.0.0-alpha.53 "@storybook/babel-plugin-require-context-hook": 1.0.1 "@storybook/client-api": 7.0.0-alpha.53 @@ -5563,7 +5552,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-storysource@workspace:addons/storysource" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/manager-api": 7.0.0-alpha.53 @@ -5608,7 +5596,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-toolbars@workspace:addons/toolbars" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/manager-api": 7.0.0-alpha.53 @@ -5630,7 +5617,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addon-viewport@workspace:addons/viewport" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -5656,14 +5642,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/addons@workspace:lib/addons" dependencies: - "@storybook/channels": 7.0.0-alpha.53 - "@storybook/client-logger": 7.0.0-alpha.53 - "@storybook/core-events": 7.0.0-alpha.53 "@storybook/manager-api": 7.0.0-alpha.53 - "@storybook/router": 7.0.0-alpha.53 - "@storybook/theming": 7.0.0-alpha.53 + "@storybook/preview-api": 7.0.0-alpha.53 "@storybook/types": 7.0.0-alpha.53 - global: ^4.4.0 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5708,7 +5689,6 @@ __metadata: "@angular/platform-browser": ^13.3.6 "@angular/platform-browser-dynamic": ^13.3.6 "@nrwl/workspace": 14.6.1 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-webpack5": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 @@ -5822,7 +5802,6 @@ __metadata: resolution: "@storybook/blocks@workspace:ui/blocks" dependencies: "@storybook/addon-actions": 7.0.0-alpha.53 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/components": 7.0.0-alpha.53 @@ -5880,6 +5859,7 @@ __metadata: dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.5 + "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-api": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-common": 7.0.0-alpha.53 @@ -6191,11 +6171,9 @@ __metadata: pretty-hrtime: ^1.0.3 resolve-from: ^5.0.0 slash: ^3.0.0 - telejson: ^6.0.8 ts-dedent: ^2.0.0 type-fest: ^2.19.0 typescript: ^4.9.3 - util-deprecate: ^1.0.2 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6446,7 +6424,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/html@workspace:renderers/html" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 @@ -6465,7 +6442,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/instrumenter@workspace:lib/instrumenter" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 @@ -6560,9 +6536,9 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/manager-api@workspace:lib/manager-api" dependencies: + "@jest/globals": ^29.3.1 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 - "@storybook/core-common": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 "@storybook/csf": next "@storybook/router": 7.0.0-alpha.53 @@ -6581,7 +6557,6 @@ __metadata: telejson: ^6.0.8 ts-dedent: ^2.0.0 typescript: ^4.9.3 - util-deprecate: ^1.0.2 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -6593,7 +6568,6 @@ __metadata: resolution: "@storybook/manager@workspace:ui/manager" dependencies: "@fal-works/esbuild-plugin-global-externals": ^2.1.2 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 @@ -6601,7 +6575,6 @@ __metadata: "@storybook/components": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 "@storybook/manager-api": 7.0.0-alpha.53 - "@storybook/preview-api": 7.0.0-alpha.53 "@storybook/router": 7.0.0-alpha.53 "@storybook/theming": 7.0.0-alpha.53 "@storybook/types": 7.0.0-alpha.53 @@ -6646,7 +6619,6 @@ __metadata: resolution: "@storybook/nextjs@workspace:frameworks/nextjs" dependencies: "@storybook/addon-actions": 7.0.0-alpha.53 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-webpack5": 7.0.0-alpha.53 "@storybook/core-common": 7.0.0-alpha.53 "@storybook/node-logger": 7.0.0-alpha.53 @@ -6733,7 +6705,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preact@workspace:renderers/preact" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 "@storybook/types": 7.0.0-alpha.53 @@ -6935,21 +6906,21 @@ __metadata: resolution: "@storybook/preview-api@workspace:lib/preview-api" dependencies: "@jest/globals": ^26.6.2 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 + "@storybook/core-common": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 "@storybook/csf": next "@storybook/types": 7.0.0-alpha.53 "@types/qs": ^6.9.5 - "@types/webpack-env": ^1.16.4 ansi-to-html: ^0.6.11 dequal: ^2.0.2 global: ^4.4.0 lodash: ^4.17.21 memoizerific: ^1.11.3 qs: ^6.10.0 + react: ^16.14.0 slash: ^3.0.0 synchronous-promise: ^2.0.15 ts-dedent: ^2.0.0 @@ -6970,36 +6941,18 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/preview@workspace:lib/preview" dependencies: + "@fal-works/esbuild-plugin-global-externals": ^2.1.2 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 "@storybook/channels": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 - "@storybook/core-common": 7.0.0-alpha.53 "@storybook/core-events": 7.0.0-alpha.53 - "@storybook/csf": next - "@storybook/manager-api": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 - "@storybook/router": 7.0.0-alpha.53 - "@storybook/theming": 7.0.0-alpha.53 - "@storybook/types": 7.0.0-alpha.53 - "@types/qs": ^6.9.5 "@types/shelljs": ^0.8.7 - "@types/webpack-env": ^1.16.4 - ansi-to-html: ^0.6.11 - dequal: ^2.0.2 fs-extra: ^9.0.1 - global: ^4.4.0 - lodash: ^4.17.21 - memoizerific: ^1.11.3 - qs: ^6.10.0 - react: 16.14.0 shelljs: ^0.8.5 - slash: ^3.0.0 - synchronous-promise: ^2.0.15 ts-dedent: ^2.0.0 - ts-jest: ^28.0.8 typescript: ~4.6.3 - util-deprecate: ^1.0.2 languageName: unknown linkType: soft @@ -7027,7 +6980,6 @@ __metadata: dependencies: "@joshwooding/vite-plugin-react-docgen-typescript": ^0.0.5 "@rollup/pluginutils": ^4.2.0 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-vite": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 @@ -7073,7 +7025,6 @@ __metadata: resolution: "@storybook/react@workspace:renderers/react" dependencies: "@babel/core": ^7.20.2 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 @@ -7438,7 +7389,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/server@workspace:renderers/server" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 "@storybook/types": 7.0.0-alpha.53 @@ -7481,7 +7431,6 @@ __metadata: resolution: "@storybook/svelte-vite@workspace:frameworks/svelte-vite" dependencies: "@storybook/addon-svelte-csf": ^2.0.0 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-vite": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 @@ -7527,7 +7476,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/svelte@workspace:renderers/svelte" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 @@ -7639,7 +7587,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue-vite@workspace:frameworks/vue-vite" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-vite": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 @@ -7686,7 +7633,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue3-vite@workspace:frameworks/vue3-vite" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-vite": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 @@ -7729,7 +7675,6 @@ __metadata: resolution: "@storybook/vue3@workspace:renderers/vue3" dependencies: "@digitak/esrun": ^3.2.2 - "@storybook/addons": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 "@storybook/preview-api": 7.0.0-alpha.53 @@ -7757,7 +7702,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/vue@workspace:renderers/vue" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 @@ -7786,7 +7730,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/web-components-vite@workspace:frameworks/web-components-vite" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/builder-vite": 7.0.0-alpha.53 "@storybook/channel-postmessage": 7.0.0-alpha.53 "@storybook/channel-websocket": 7.0.0-alpha.53 @@ -7824,7 +7767,6 @@ __metadata: version: 0.0.0-use.local resolution: "@storybook/web-components@workspace:renderers/web-components" dependencies: - "@storybook/addons": 7.0.0-alpha.53 "@storybook/client-logger": 7.0.0-alpha.53 "@storybook/core-client": 7.0.0-alpha.53 "@storybook/docs-tools": 7.0.0-alpha.53 @@ -8932,7 +8874,7 @@ __metadata: languageName: node linkType: hard -"@types/webpack-env@npm:^1.16.0, @types/webpack-env@npm:^1.16.4, @types/webpack-env@npm:^1.17.0, @types/webpack-env@npm:^1.18.0": +"@types/webpack-env@npm:^1.16.0, @types/webpack-env@npm:^1.17.0, @types/webpack-env@npm:^1.18.0": version: 1.18.0 resolution: "@types/webpack-env@npm:1.18.0" checksum: ac2e91b025ea31b98b0271ccb40da789c5b54693c1efb18265a54c03b303b750501f080a44e99d7ce0a5422d68d535e600e851df4b8f2240444eca7ac3159719 @@ -31919,7 +31861,7 @@ __metadata: languageName: node linkType: hard -"ts-jest@npm:^28.0.0, ts-jest@npm:^28.0.8": +"ts-jest@npm:^28.0.0": version: 28.0.8 resolution: "ts-jest@npm:28.0.8" dependencies: diff --git a/docs/snippets/common/storybook-config-layout.js.mdx b/docs/snippets/common/storybook-config-layout.js.mdx index c36446aebea2..fb0043fd42c3 100644 --- a/docs/snippets/common/storybook-config-layout.js.mdx +++ b/docs/snippets/common/storybook-config-layout.js.mdx @@ -1,7 +1,7 @@ ```js // .storybook/manager.js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; addons.setConfig({ isFullscreen: false, diff --git a/docs/snippets/common/storybook-manager-custom-theme.js.mdx b/docs/snippets/common/storybook-manager-custom-theme.js.mdx index 5affde341713..f1c8ba7fad4d 100644 --- a/docs/snippets/common/storybook-manager-custom-theme.js.mdx +++ b/docs/snippets/common/storybook-manager-custom-theme.js.mdx @@ -1,7 +1,7 @@ ```js // .storybook/manager.js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import yourTheme from './YourTheme'; addons.setConfig({ diff --git a/docs/snippets/common/storybook-manager-dark-theme.js.mdx b/docs/snippets/common/storybook-manager-dark-theme.js.mdx index 2f31e53b7575..b7667afc4444 100644 --- a/docs/snippets/common/storybook-manager-dark-theme.js.mdx +++ b/docs/snippets/common/storybook-manager-dark-theme.js.mdx @@ -1,7 +1,7 @@ ```js // .storybook/manager.js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import { themes } from '@storybook/theming'; addons.setConfig({ diff --git a/docs/snippets/common/storybook-manager-disable-roots.js.mdx b/docs/snippets/common/storybook-manager-disable-roots.js.mdx index 3297d85d7a1c..2ad4a99a4490 100644 --- a/docs/snippets/common/storybook-manager-disable-roots.js.mdx +++ b/docs/snippets/common/storybook-manager-disable-roots.js.mdx @@ -1,7 +1,7 @@ ```js // ./storybook/manager.js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; addons.setConfig({ sidebar: { diff --git a/docs/snippets/common/storybook-manager-render-label-stories.js.mdx b/docs/snippets/common/storybook-manager-render-label-stories.js.mdx index 91538b415957..cfbc658cfc03 100644 --- a/docs/snippets/common/storybook-manager-render-label-stories.js.mdx +++ b/docs/snippets/common/storybook-manager-render-label-stories.js.mdx @@ -1,7 +1,7 @@ ```js // .storybook/manager.js -import { addons } from '@storybook/addons'; +import { addons } from '@storybook/manager-api'; import startCase from 'lodash/startCase'; diff --git a/scripts/combine-compodoc.ts b/scripts/combine-compodoc.ts index 7dd04a7f509b..87dd58d03069 100755 --- a/scripts/combine-compodoc.ts +++ b/scripts/combine-compodoc.ts @@ -3,10 +3,10 @@ // then combine the results into one large documentation.json import { join, resolve } from 'path'; -import { execaCommand } from './utils/exec'; import { realpath, readFile, writeFile, lstat } from 'fs-extra'; import glob from 'glob'; import { directory } from 'tempy'; +import { execaCommand } from './utils/exec'; const logger = console; diff --git a/scripts/next-repro-generators/generate-repros.ts b/scripts/next-repro-generators/generate-repros.ts index c4a48350a0a7..3c8ac086b862 100755 --- a/scripts/next-repro-generators/generate-repros.ts +++ b/scripts/next-repro-generators/generate-repros.ts @@ -16,6 +16,7 @@ import { JsPackageManagerFactory } from '../../code/lib/cli/src/js-package-manag import { maxConcurrentTasks } from '../utils/maxConcurrentTasks'; +// eslint-disable-next-line import/no-cycle import { localizeYarnConfigFiles, setupYarn } from './utils/yarn'; import type { GeneratorConfig } from './utils/types'; import { getStackblitzUrl, renderTemplate } from './utils/template'; diff --git a/scripts/next-repro-generators/publish.ts b/scripts/next-repro-generators/publish.ts index 75bf2a606570..37d864613b4f 100755 --- a/scripts/next-repro-generators/publish.ts +++ b/scripts/next-repro-generators/publish.ts @@ -1,11 +1,12 @@ import program from 'commander'; import { join } from 'path'; import { existsSync } from 'fs'; -import { execaCommand } from '../utils/exec'; import * as tempy from 'tempy'; import { copy, emptyDir, readdir, remove, stat, writeFile } from 'fs-extra'; +import { execaCommand } from '../utils/exec'; import { getTemplatesData, renderTemplate } from './utils/template'; +// eslint-disable-next-line import/no-cycle import { commitAllToGit } from './utils/git'; export const logger = console; diff --git a/scripts/next-repro-generators/utils/git.ts b/scripts/next-repro-generators/utils/git.ts index bb828a7b6858..cbd1aa505e04 100644 --- a/scripts/next-repro-generators/utils/git.ts +++ b/scripts/next-repro-generators/utils/git.ts @@ -1,4 +1,5 @@ import { execaCommand } from '../../utils/exec'; +// eslint-disable-next-line import/no-cycle import { logger } from '../publish'; export async function commitAllToGit(cwd: string) { diff --git a/scripts/next-repro-generators/utils/template.ts b/scripts/next-repro-generators/utils/template.ts index bd979c9dae52..7b38df2c30ff 100644 --- a/scripts/next-repro-generators/utils/template.ts +++ b/scripts/next-repro-generators/utils/template.ts @@ -1,7 +1,7 @@ import { render } from 'ejs'; import { readFile } from 'fs-extra'; import { format } from 'prettier'; -import { GeneratorConfig } from './types'; +import type { GeneratorConfig } from './types'; import { allTemplates as reproTemplates } from '../../../code/lib/cli/src/repro-templates'; export async function renderTemplate(templatePath: string, templateData: Record) { diff --git a/scripts/next-repro-generators/utils/yarn.ts b/scripts/next-repro-generators/utils/yarn.ts index e1035993cfaf..05615a127850 100644 --- a/scripts/next-repro-generators/utils/yarn.ts +++ b/scripts/next-repro-generators/utils/yarn.ts @@ -1,5 +1,6 @@ import { join } from 'path'; import { move, remove } from 'fs-extra'; +// eslint-disable-next-line import/no-cycle import { runCommand } from '../generate-repros'; interface SetupYarnOptions { diff --git a/scripts/utils/options.ts b/scripts/utils/options.ts index 2601c8452c9c..b1a2dea7f0c0 100644 --- a/scripts/utils/options.ts +++ b/scripts/utils/options.ts @@ -2,8 +2,8 @@ * Use commander and prompts to gather a list of options for a script */ -import prompts, { Falsy, PrevCaller, PromptType } from 'prompts'; -import type { PromptObject } from 'prompts'; +import prompts from 'prompts'; +import type { PromptObject, Falsy, PrevCaller, PromptType } from 'prompts'; import program from 'commander'; import dedent from 'ts-dedent'; import chalk from 'chalk'; diff --git a/scripts/utils/workspace.ts b/scripts/utils/workspace.ts index 40fa0d159f19..ac3dbfc5d959 100644 --- a/scripts/utils/workspace.ts +++ b/scripts/utils/workspace.ts @@ -1,6 +1,6 @@ -import { execaCommand } from './exec'; import memoize from 'memoizerific'; import { resolve } from 'path'; +import { execaCommand } from './exec'; export type Workspace = { name: string; location: string };