@storybook/cli 8.3.0-beta.0 → 8.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/index.cjs +7 -7
- package/dist/bin/index.js +8 -8
- package/package.json +4 -4
package/dist/bin/index.cjs
CHANGED
|
@@ -48,11 +48,14 @@
|
|
|
48
48
|
Storybook needs Node.js 18 or higher.
|
|
49
49
|
|
|
50
50
|
${import_chalk41.default.yellow("https://nodejs.org/en/download")}
|
|
51
|
-
`}}}});var import_common20=require("storybook/internal/common"),import_core_server2=require("storybook/internal/core-server"),import_node_logger4=require("storybook/internal/node-logger"),import_telemetry2=require("storybook/internal/telemetry"),import_chalk44=__toESM(require("chalk"),1),import_commander=require("commander"),import_envinfo=__toESM(require("envinfo"),1),import_fd_package_json=require("fd-package-json"),import_leven=__toESM(require("leven"),1),import_tiny_invariant4=__toESM(require("tiny-invariant"),1);var import_node_path=require("path"),import_common=require("storybook/internal/common"),import_csf_tools=require("storybook/internal/csf-tools"),import_semver=__toESM(require("semver"),1),import_ts_dedent=require("ts-dedent");var
|
|
51
|
+
`}}}});var import_common20=require("storybook/internal/common"),import_core_server2=require("storybook/internal/core-server"),import_node_logger4=require("storybook/internal/node-logger"),import_telemetry2=require("storybook/internal/telemetry"),import_chalk44=__toESM(require("chalk"),1),import_commander=require("commander"),import_envinfo=__toESM(require("envinfo"),1),import_fd_package_json=require("fd-package-json"),import_leven=__toESM(require("leven"),1),import_tiny_invariant4=__toESM(require("tiny-invariant"),1);var import_node_path=require("path"),import_common=require("storybook/internal/common"),import_csf_tools=require("storybook/internal/csf-tools"),import_semver=__toESM(require("semver"),1),import_ts_dedent=require("ts-dedent");var import_babel=require("storybook/internal/babel"),defaultRequireWrapperName="getAbsolutePath";function doesVariableOrFunctionDeclarationExist(node,name){return import_babel.types.isVariableDeclaration(node)&&node.declarations.length===1&&import_babel.types.isVariableDeclarator(node.declarations[0])&&import_babel.types.isIdentifier(node.declarations[0].id)&&node.declarations[0].id?.name===name||import_babel.types.isFunctionDeclaration(node)&&import_babel.types.isIdentifier(node.id)&&node.id.name===name}function getReferenceToRequireWrapper(config,value){return import_babel.types.callExpression(import_babel.types.identifier(getRequireWrapperName(config)??defaultRequireWrapperName),[import_babel.types.stringLiteral(value)])}function getRequireWrapperName(config){let declarationName=config.getBodyDeclarations().flatMap(node=>doesVariableOrFunctionDeclarationExist(node,"wrapForPnp")?["wrapForPnp"]:doesVariableOrFunctionDeclarationExist(node,defaultRequireWrapperName)?[defaultRequireWrapperName]:[]);return declarationName.length?declarationName[0]:null}function isRequireWrapperNecessary(node,cb=()=>{}){if(import_babel.types.isStringLiteral(node))return cb(node),!0;if(import_babel.types.isObjectExpression(node)){let nameProperty=node.properties.find(property=>import_babel.types.isObjectProperty(property)&&import_babel.types.isIdentifier(property.key)&&property.key.name==="name");if(nameProperty&&import_babel.types.isStringLiteral(nameProperty.value))return cb(nameProperty),!0}return import_babel.types.isArrayExpression(node)&&node.elements.some(element=>element&&isRequireWrapperNecessary(element))?(cb(node),!0):!1}function getFieldsForRequireWrapper(config){let frameworkNode=config.getFieldNode(["framework"]),builderNode=config.getFieldNode(["core","builder"]),rendererNode=config.getFieldNode(["core","renderer"]),addons=config.getFieldNode(["addons"]);return[...frameworkNode?[frameworkNode]:[],...builderNode?[builderNode]:[],...rendererNode?[rendererNode]:[],...addons&&import_babel.types.isArrayExpression(addons)?[addons]:[]]}function getRequireWrapperAsCallExpression(isConfigTypescript){let functionDeclaration={...import_babel.types.functionDeclaration(import_babel.types.identifier(defaultRequireWrapperName),[{...import_babel.types.identifier("value"),...isConfigTypescript?{typeAnnotation:import_babel.types.tsTypeAnnotation(import_babel.types.tSStringKeyword())}:{}}],import_babel.types.blockStatement([import_babel.types.returnStatement(import_babel.types.callExpression(import_babel.types.identifier("dirname"),[import_babel.types.callExpression(import_babel.types.memberExpression(import_babel.types.identifier("require"),import_babel.types.identifier("resolve")),[import_babel.types.callExpression(import_babel.types.identifier("join"),[import_babel.types.identifier("value"),import_babel.types.stringLiteral("package.json")])])]))])),...isConfigTypescript?{returnType:import_babel.types.tSTypeAnnotation(import_babel.types.tsAnyKeyword())}:{}};return import_babel.types.addComment(functionDeclaration,"leading",`*
|
|
52
|
+
* This function is used to resolve the absolute path of a package.
|
|
53
|
+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
54
|
+
`),functionDeclaration}function wrapValueWithRequireWrapper(config,node){isRequireWrapperNecessary(node,n=>{if(import_babel.types.isStringLiteral(n)){let wrapperNode=getReferenceToRequireWrapper(config,n.value);Object.keys(n).forEach(k=>{delete n[k]}),Object.keys(wrapperNode).forEach(k=>{n[k]=wrapperNode[k]})}import_babel.types.isObjectProperty(n)&&import_babel.types.isStringLiteral(n.value)&&(n.value=getReferenceToRequireWrapper(config,n.value.value)),import_babel.types.isArrayExpression(n)&&n.elements.forEach((element,index,elements)=>{import_babel.types.isStringLiteral(element)&&(elements[index]=getReferenceToRequireWrapper(config,element.value))})})}var postinstallAddon=async(addonName,options)=>{try{let modulePath=require.resolve(`${addonName}/postinstall`,{paths:[process.cwd()]}),postinstall=require(modulePath);try{console.log(`Running postinstall script for ${addonName}`),await postinstall(options)}catch(e){console.error(`Error running postinstall script for ${addonName}`),console.error(e)}}catch{}};var getVersionSpecifier=addon=>{let groups=/^(@{0,1}[^@]+)(?:@(.+))?$/.exec(addon);return groups?[groups[1],groups[2]]:[addon,void 0]},requireMain=configDir=>{let absoluteConfigDir=(0,import_node_path.isAbsolute)(configDir)?configDir:(0,import_node_path.join)(process.cwd(),configDir),mainFile=(0,import_node_path.join)(absoluteConfigDir,"main");return(0,import_common.serverRequire)(mainFile)??{}},checkInstalled=(addonName,main)=>!!main.addons?.find(entry=>(typeof entry=="string"?entry:entry.name)?.endsWith(addonName)),isCoreAddon=addonName=>Object.hasOwn(import_common.versions,addonName);async function add(addon,{packageManager:pkgMgr,skipPostinstall,configDir:userSpecifiedConfigDir},logger28=console){let[addonName,inputVersion]=getVersionSpecifier(addon),packageManager=import_common.JsPackageManagerFactory.getPackageManager({force:pkgMgr}),packageJson=await packageManager.retrievePackageJson(),{mainConfig,configDir:inferredConfigDir}=(0,import_common.getStorybookInfo)(packageJson,userSpecifiedConfigDir),configDir=userSpecifiedConfigDir||inferredConfigDir||".storybook";if(typeof configDir>"u")throw new Error(import_ts_dedent.dedent`
|
|
52
55
|
Unable to find storybook config directory
|
|
53
56
|
`);if(!mainConfig){logger28.error("Unable to find storybook main.js config");return}if(checkInstalled(addonName,requireMain(configDir)))throw new Error(import_ts_dedent.dedent`
|
|
54
57
|
Addon ${addonName} is already installed; we skipped adding it to your ${mainConfig}.
|
|
55
|
-
`);let main=await(0,import_csf_tools.readConfig)(mainConfig);logger28.log(`Verifying ${addonName}`);let storybookVersion=await(0,import_common.getCoercedStorybookVersion)(packageManager),version=inputVersion;!version&&isCoreAddon(addonName)&&storybookVersion&&(version=storybookVersion),version||(version=await packageManager.latestVersion(addonName)),isCoreAddon(addonName)&&version!==storybookVersion&&logger28.warn(`The version of ${addonName} you are installing is not the same as the version of Storybook you are using. This may lead to unexpected behavior.`);let addonWithVersion=isValidVersion(version)?`${addonName}@^${version}`:`${addonName}@${version}`;logger28.log(`Installing ${addonWithVersion}`),await packageManager.addDependencies({installAsDevDependencies:!0},[addonWithVersion]),logger28.log(`Adding '${addon}' to main.js addons field.`),main.appendValueToArray(["addons"],addonName)
|
|
58
|
+
`);let main=await(0,import_csf_tools.readConfig)(mainConfig);logger28.log(`Verifying ${addonName}`);let storybookVersion=await(0,import_common.getCoercedStorybookVersion)(packageManager),version=inputVersion;!version&&isCoreAddon(addonName)&&storybookVersion&&(version=storybookVersion),version||(version=await packageManager.latestVersion(addonName)),isCoreAddon(addonName)&&version!==storybookVersion&&logger28.warn(`The version of ${addonName} you are installing is not the same as the version of Storybook you are using. This may lead to unexpected behavior.`);let addonWithVersion=isValidVersion(version)?`${addonName}@^${version}`:`${addonName}@${version}`;if(logger28.log(`Installing ${addonWithVersion}`),await packageManager.addDependencies({installAsDevDependencies:!0},[addonWithVersion]),logger28.log(`Adding '${addon}' to main.js addons field.`),main.getFieldNode(["addons"])&&getRequireWrapperName(main)!==null){let addonNode=main.valueToNode(addonName);main.appendNodeToArray(["addons"],addonNode),wrapValueWithRequireWrapper(main,addonNode)}else main.appendValueToArray(["addons"],addonName);await(0,import_csf_tools.writeConfig)(main),!skipPostinstall&&isCoreAddon(addonName)&&await postinstallAddon(addonName,{packageManager:packageManager.type,configDir})}function isValidVersion(version){return import_semver.default.valid(version)||version.match(/^\d+$/)}var import_node_path7=require("path"),import_common15=require("storybook/internal/common");var import_node_process=__toESM(require("process"),1);function ansiRegex({onlyFirst=!1}={}){let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")}var regex=ansiRegex();function stripAnsi(string){if(typeof string!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);return string.replace(regex,"")}var import_eastasianwidth=__toESM(require_eastasianwidth(),1),import_emoji_regex=__toESM(require_emoji_regex(),1);function stringWidth(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0,import_emoji_regex.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1}}return width}var import_chalk=__toESM(require("chalk"),1);var import_eastasianwidth2=__toESM(require_eastasianwidth(),1),import_emoji_regex2=__toESM(require_emoji_regex(),1);function stringWidth2(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0,import_emoji_regex2.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth2.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1}}return width}function widestLine(string){let lineWidth=0;for(let line of string.split(`
|
|
56
59
|
`))lineWidth=Math.max(lineWidth,stringWidth2(line));return lineWidth}var import_cli_boxes=__toESM(require_cli_boxes(),1);var UPPERCASE=/[\p{Lu}]/u,LOWERCASE=/[\p{Ll}]/u,LEADING_CAPITAL=/^[\p{Lu}](?![\p{Lu}])/gu,IDENTIFIER=/([\p{Alpha}\p{N}_]|$)/u,SEPARATORS=/[_.\- ]+/,LEADING_SEPARATORS=new RegExp("^"+SEPARATORS.source),SEPARATORS_AND_IDENTIFIER=new RegExp(SEPARATORS.source+IDENTIFIER.source,"gu"),NUMBERS_AND_IDENTIFIER=new RegExp("\\d+"+IDENTIFIER.source,"gu"),preserveCamelCase=(string,toLowerCase,toUpperCase,preserveConsecutiveUppercase2)=>{let isLastCharLower=!1,isLastCharUpper=!1,isLastLastCharUpper=!1,isLastLastCharPreserved=!1;for(let index=0;index<string.length;index++){let character=string[index];isLastLastCharPreserved=index>2?string[index-3]==="-":!0,isLastCharLower&&UPPERCASE.test(character)?(string=string.slice(0,index)+"-"+string.slice(index),isLastCharLower=!1,isLastLastCharUpper=isLastCharUpper,isLastCharUpper=!0,index++):isLastCharUpper&&isLastLastCharUpper&&LOWERCASE.test(character)&&(!isLastLastCharPreserved||preserveConsecutiveUppercase2)?(string=string.slice(0,index-1)+"-"+string.slice(index-1),isLastLastCharUpper=isLastCharUpper,isLastCharUpper=!1,isLastCharLower=!0):(isLastCharLower=toLowerCase(character)===character&&toUpperCase(character)!==character,isLastLastCharUpper=isLastCharUpper,isLastCharUpper=toUpperCase(character)===character&&toLowerCase(character)!==character)}return string},preserveConsecutiveUppercase=(input,toLowerCase)=>(LEADING_CAPITAL.lastIndex=0,input.replace(LEADING_CAPITAL,m1=>toLowerCase(m1))),postProcess=(input,toUpperCase)=>(SEPARATORS_AND_IDENTIFIER.lastIndex=0,NUMBERS_AND_IDENTIFIER.lastIndex=0,input.replace(SEPARATORS_AND_IDENTIFIER,(_,identifier)=>toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER,m=>toUpperCase(m)));function camelCase(input,options){if(!(typeof input=="string"||Array.isArray(input)))throw new TypeError("Expected the input to be `string | string[]`");if(options={pascalCase:!1,preserveConsecutiveUppercase:!1,...options},Array.isArray(input)?input=input.map(x=>x.trim()).filter(x=>x.length).join("-"):input=input.trim(),input.length===0)return"";let toLowerCase=options.locale===!1?string=>string.toLowerCase():string=>string.toLocaleLowerCase(options.locale),toUpperCase=options.locale===!1?string=>string.toUpperCase():string=>string.toLocaleUpperCase(options.locale);return input.length===1?SEPARATORS.test(input)?"":options.pascalCase?toUpperCase(input):toLowerCase(input):(input!==toLowerCase(input)&&(input=preserveCamelCase(input,toLowerCase,toUpperCase,options.preserveConsecutiveUppercase)),input=input.replace(LEADING_SEPARATORS,""),input=options.preserveConsecutiveUppercase?preserveConsecutiveUppercase(input,toLowerCase):toLowerCase(input),options.pascalCase&&(input=toUpperCase(input.charAt(0))+input.slice(1)),postProcess(input,toUpperCase))}var import_ansi_align=__toESM(require_ansi_align(),1);var import_eastasianwidth3=__toESM(require_eastasianwidth(),1),import_emoji_regex3=__toESM(require_emoji_regex(),1);function stringWidth3(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0,import_emoji_regex3.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth3.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1}}return width}var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},modifierNames=Object.keys(styles.modifier),foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor),colorNames=[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1})}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5),enumerable:!1},hexToRgb:{value:hex=>{let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return[0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return[integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value:code=>{if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else{code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var ESCAPES=new Set(["\x1B","\x9B"]),END_CODE=39,ANSI_ESCAPE_BELL="\x07",ANSI_CSI="[",ANSI_OSC="]",ANSI_SGR_TERMINATOR="m",ANSI_ESCAPE_LINK=`${ANSI_OSC}8;;`,wrapAnsiCode=code=>`${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`,wrapAnsiHyperlink=uri=>`${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`,wordLengths=string=>string.split(" ").map(character=>stringWidth3(character)),wrapWord=(rows,word,columns)=>{let characters=[...word],isInsideEscape=!1,isInsideLinkEscape=!1,visible=stringWidth3(stripAnsi(rows[rows.length-1]));for(let[index,character]of characters.entries()){let characterLength=stringWidth3(character);if(visible+characterLength<=columns?rows[rows.length-1]+=character:(rows.push(character),visible=0),ESCAPES.has(character)&&(isInsideEscape=!0,isInsideLinkEscape=characters.slice(index+1).join("").startsWith(ANSI_ESCAPE_LINK)),isInsideEscape){isInsideLinkEscape?character===ANSI_ESCAPE_BELL&&(isInsideEscape=!1,isInsideLinkEscape=!1):character===ANSI_SGR_TERMINATOR&&(isInsideEscape=!1);continue}visible+=characterLength,visible===columns&&index<characters.length-1&&(rows.push(""),visible=0)}!visible&&rows[rows.length-1].length>0&&rows.length>1&&(rows[rows.length-2]+=rows.pop())},stringVisibleTrimSpacesRight=string=>{let words=string.split(" "),last=words.length;for(;last>0&&!(stringWidth3(words[last-1])>0);)last--;return last===words.length?string:words.slice(0,last).join(" ")+words.slice(last).join("")},exec=(string,columns,options={})=>{if(options.trim!==!1&&string.trim()==="")return"";let returnValue="",escapeCode,escapeUrl,lengths=wordLengths(string),rows=[""];for(let[index,word]of string.split(" ").entries()){options.trim!==!1&&(rows[rows.length-1]=rows[rows.length-1].trimStart());let rowLength=stringWidth3(rows[rows.length-1]);if(index!==0&&(rowLength>=columns&&(options.wordWrap===!1||options.trim===!1)&&(rows.push(""),rowLength=0),(rowLength>0||options.trim===!1)&&(rows[rows.length-1]+=" ",rowLength++)),options.hard&&lengths[index]>columns){let remainingColumns=columns-rowLength,breaksStartingThisLine=1+Math.floor((lengths[index]-remainingColumns-1)/columns);Math.floor((lengths[index]-1)/columns)<breaksStartingThisLine&&rows.push(""),wrapWord(rows,word,columns);continue}if(rowLength+lengths[index]>columns&&rowLength>0&&lengths[index]>0){if(options.wordWrap===!1&&rowLength<columns){wrapWord(rows,word,columns);continue}rows.push("")}if(rowLength+lengths[index]>columns&&options.wordWrap===!1){wrapWord(rows,word,columns);continue}rows[rows.length-1]+=word}options.trim!==!1&&(rows=rows.map(row=>stringVisibleTrimSpacesRight(row)));let pre=[...rows.join(`
|
|
57
60
|
`)];for(let[index,character]of pre.entries()){if(returnValue+=character,ESCAPES.has(character)){let{groups}=new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join(""))||{groups:{}};if(groups.code!==void 0){let code2=Number.parseFloat(groups.code);escapeCode=code2===END_CODE?void 0:code2}else groups.uri!==void 0&&(escapeUrl=groups.uri.length===0?void 0:groups.uri)}let code=ansi_styles_default.codes.get(Number(escapeCode));pre[index+1]===`
|
|
58
61
|
`?(escapeUrl&&(returnValue+=wrapAnsiHyperlink("")),escapeCode&&code&&(returnValue+=wrapAnsiCode(code))):character===`
|
|
@@ -502,10 +505,7 @@ ${import_chalk6.default.cyan("npx storybook doctor")}`;logger2.info(),foundIssue
|
|
|
502
505
|
You can find more information here: ${import_chalk33.default.yellow("https://storybook.js.org/docs/8.0/builders/webpack#compiler-support")}
|
|
503
506
|
`),message.join(`
|
|
504
507
|
|
|
505
|
-
`)},async run({result,mainConfigPath,packageManager,skipInstall,dryRun}){let{defaultCompiler,shouldRemoveSWCFlag,isNextJs}=result;if(shouldRemoveSWCFlag&&await updateMainConfig({mainConfigPath,dryRun:!!dryRun},main=>{main.removeField(["framework","options","builder","useSWC"])}),!isNextJs){let compiler=defaultCompiler===import_cli13.CoreWebpackCompilers.Babel?await askUserForCompilerChoice():import_cli13.CoreWebpackCompilers.SWC,compilerPackageName=Object.entries(import_cli13.compilerNameToCoreCompiler).find(([,coreCompiler])=>coreCompiler===compiler)[0];await add(compilerPackageName,{packageManager:packageManager.type,skipPostinstall:!!skipInstall})}}};async function askUserForCompilerChoice(){return(await(0,import_prompts5.default)({type:"select",name:"compiler",message:"Which compiler would you like to use?",choices:[{title:"Babel",description:"Choose Babel for a vast ecosystem and battle-tested reliability.",value:import_cli13.CoreWebpackCompilers.Babel},{title:"SWC",description:"Choose SWC for fast builds and simple configuration.",value:import_cli13.CoreWebpackCompilers.SWC}],initial:0})).compiler}var import_cli14=require("storybook/internal/cli"),import_csf_tools8=require("storybook/internal/csf-tools"),import_chalk34=__toESM(require("chalk"),1),import_ts_dedent35=require("ts-dedent");var
|
|
506
|
-
* This function is used to resolve the absolute path of a package.
|
|
507
|
-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
508
|
-
`),functionDeclaration}function wrapValueWithRequireWrapper(config,node){isRequireWrapperNecessary(node,n=>{if(import_babel.types.isStringLiteral(n)){let wrapperNode=getReferenceToRequireWrapper(config,n.value);Object.keys(n).forEach(k=>{delete n[k]}),Object.keys(wrapperNode).forEach(k=>{n[k]=wrapperNode[k]})}import_babel.types.isObjectProperty(n)&&import_babel.types.isStringLiteral(n.value)&&(n.value=getReferenceToRequireWrapper(config,n.value.value)),import_babel.types.isArrayExpression(n)&&n.elements.forEach((element,index,elements)=>{import_babel.types.isStringLiteral(element)&&(elements[index]=getReferenceToRequireWrapper(config,element.value))})})}var wrapRequire={id:"wrap-require",versionRange:["*","*"],async check({packageManager,storybookVersion,mainConfigPath}){let isStorybookInMonorepo=await packageManager.isStorybookInMonorepo(),isPnp=await(0,import_cli14.detectPnp)();if(!mainConfigPath)return null;let config=await(0,import_csf_tools8.readConfig)(mainConfigPath);if(!isStorybookInMonorepo&&!isPnp||!getFieldsForRequireWrapper(config).some(node=>isRequireWrapperNecessary(node)))return null;let isConfigTypescript=mainConfigPath.endsWith(".ts")||mainConfigPath.endsWith(".tsx");return{storybookVersion,isStorybookInMonorepo,isPnp,isConfigTypescript}},prompt({storybookVersion,isStorybookInMonorepo}){let sbFormatted=import_chalk34.default.cyan(`Storybook ${storybookVersion}`);return import_ts_dedent35.dedent`We have detected that you're using ${sbFormatted} in a ${isStorybookInMonorepo?"monorepo":"PnP"} project.
|
|
508
|
+
`)},async run({result,mainConfigPath,packageManager,skipInstall,dryRun}){let{defaultCompiler,shouldRemoveSWCFlag,isNextJs}=result;if(shouldRemoveSWCFlag&&await updateMainConfig({mainConfigPath,dryRun:!!dryRun},main=>{main.removeField(["framework","options","builder","useSWC"])}),!isNextJs){let compiler=defaultCompiler===import_cli13.CoreWebpackCompilers.Babel?await askUserForCompilerChoice():import_cli13.CoreWebpackCompilers.SWC,compilerPackageName=Object.entries(import_cli13.compilerNameToCoreCompiler).find(([,coreCompiler])=>coreCompiler===compiler)[0];await add(compilerPackageName,{packageManager:packageManager.type,skipPostinstall:!!skipInstall})}}};async function askUserForCompilerChoice(){return(await(0,import_prompts5.default)({type:"select",name:"compiler",message:"Which compiler would you like to use?",choices:[{title:"Babel",description:"Choose Babel for a vast ecosystem and battle-tested reliability.",value:import_cli13.CoreWebpackCompilers.Babel},{title:"SWC",description:"Choose SWC for fast builds and simple configuration.",value:import_cli13.CoreWebpackCompilers.SWC}],initial:0})).compiler}var import_cli14=require("storybook/internal/cli"),import_csf_tools8=require("storybook/internal/csf-tools"),import_chalk34=__toESM(require("chalk"),1),import_ts_dedent35=require("ts-dedent");var wrapRequire={id:"wrap-require",versionRange:["*","*"],async check({packageManager,storybookVersion,mainConfigPath}){let isStorybookInMonorepo=await packageManager.isStorybookInMonorepo(),isPnp=await(0,import_cli14.detectPnp)();if(!mainConfigPath)return null;let config=await(0,import_csf_tools8.readConfig)(mainConfigPath);if(!isStorybookInMonorepo&&!isPnp||!getFieldsForRequireWrapper(config).some(node=>isRequireWrapperNecessary(node)))return null;let isConfigTypescript=mainConfigPath.endsWith(".ts")||mainConfigPath.endsWith(".tsx");return{storybookVersion,isStorybookInMonorepo,isPnp,isConfigTypescript}},prompt({storybookVersion,isStorybookInMonorepo}){let sbFormatted=import_chalk34.default.cyan(`Storybook ${storybookVersion}`);return import_ts_dedent35.dedent`We have detected that you're using ${sbFormatted} in a ${isStorybookInMonorepo?"monorepo":"PnP"} project.
|
|
509
509
|
For Storybook to work correctly, some fields in your main config must be updated. We can do this for you automatically.
|
|
510
510
|
|
|
511
511
|
More info: https://storybook.js.org/docs/react/faq#how-do-i-fix-module-resolution-in-special-environments`},async run({dryRun,mainConfigPath,result}){return new Promise((resolve,reject)=>{updateMainConfig({dryRun:!!dryRun,mainConfigPath},mainConfig=>{try{getFieldsForRequireWrapper(mainConfig).forEach(node=>{wrapValueWithRequireWrapper(mainConfig,node)}),getRequireWrapperName(mainConfig)===null&&(mainConfig?.fileName?.endsWith(".cjs")||mainConfig?.fileName?.endsWith(".cts")||mainConfig?.fileName?.endsWith(".cjsx")||mainConfig?.fileName?.endsWith(".ctsx")?mainConfig.setRequireImport(["dirname","join"],"path"):mainConfig.setImport(["dirname","join"],"path"),mainConfig.setBodyDeclaration(getRequireWrapperAsCallExpression(result.isConfigTypescript))),resolve()}catch(e){reject(e)}})})}};var allFixes=[missingStorybookDependencies,addonsAPI,newFrameworks,cra5,webpack5,vue3,addonPostCSS,viteConfigFile,eslintPlugin,builderVite,sbBinary,sbScripts,removeJestTestingLibrary,removeArgtypesRegex,removedGlobalClientAPIs,mdxgfm,mdxToCSF,autodocsTrue,angularBuildersMultiproject,angularBuilders,wrapRequire,reactDocgen,storyshotsMigration,removeReactDependency,removeLegacyMDX1,webpack5CompilerSetup,mdx1to3,upgradeStorybookRelatedDependencies,vta,autodocsTags,initialGlobals];var import_chalk35=__toESM(require("chalk"),1),import_ts_dedent36=require("ts-dedent");var messageDivider2=`
|
|
@@ -534,7 +534,7 @@ ${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_
|
|
|
534
534
|
npx create-react-app {{beforeDir}} && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
535
535
|
`,expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"],modifications:{mainConfig:config=>({stories:config.getFieldValue(["stories"])?.map(s=>typeof s=="string"?s.replace(/\|(tsx?|ts)\b|\b(tsx?|ts)\|/g,""):s)})}},"cra/default-ts":{name:"Create React App Latest (Webpack | TypeScript)",script:`
|
|
536
536
|
npx create-react-app {{beforeDir}} --template typescript && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
537
|
-
`,skipTasks:["smoke-test","bench","vitest-integration"],expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"}},"nextjs/13-ts":{name:"Next.js v13.5 (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^13.5.6" && yarn && git add . && git commit --amend --no-edit && cd ..',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-js":{name:"Next.js Latest (Webpack | JavaScript)",script:'yarn create next-app {{beforeDir}} --javascript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-ts":{name:"Next.js Latest (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/prerelease":{name:"Next.js Prerelease (Webpack | TypeScript)",script:'npx create-next-app@canary {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["server-only"],mainConfig:{features:{experimentalRSC:!0}}},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"experimental-nextjs-vite/default-ts":{name:"Next.js Latest (Vite | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/experimental-nextjs-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},modifications:{mainConfig:{framework:"@storybook/experimental-nextjs-vite",features:{experimentalRSC:!0}},extraDependencies:["server-only","
|
|
537
|
+
`,skipTasks:["smoke-test","bench","vitest-integration"],expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"}},"nextjs/13-ts":{name:"Next.js v13.5 (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^13.5.6" && yarn && git add . && git commit --amend --no-edit && cd ..',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-js":{name:"Next.js Latest (Webpack | JavaScript)",script:'yarn create next-app {{beforeDir}} --javascript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-ts":{name:"Next.js Latest (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/prerelease":{name:"Next.js Prerelease (Webpack | TypeScript)",script:'npx create-next-app@canary {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["server-only"],mainConfig:{features:{experimentalRSC:!0}}},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"experimental-nextjs-vite/default-ts":{name:"Next.js Latest (Vite | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/experimental-nextjs-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},modifications:{mainConfig:{framework:"@storybook/experimental-nextjs-vite",features:{experimentalRSC:!0}},extraDependencies:["server-only","@storybook/experimental-nextjs-vite","vite"]},skipTasks:["e2e-tests-dev","bench"]},"react-vite/default-js":{name:"React Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template react",expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"react-vite/default-ts":{name:"React Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template react-ts",expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["bench"]},"react-vite/prerelease-ts":{name:"React Prerelease (Vite | TypeScript)",script:`
|
|
538
538
|
npm create vite --yes {{beforeDir}} -- --template react-ts && cd {{beforeDir}} && yarn add react@beta react-dom@beta && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
|
539
539
|
`,expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"react-webpack/18-ts":{name:"React Latest (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}}",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/17-ts":{name:"React v17 (Webpack | TypeScript)",script:'yarn create webpack5-react {{beforeDir}} --version-react="17" --version-react-dom="17"',expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/prerelease-ts":{name:"React Prerelease (Webpack | TypeScript)",script:`
|
|
540
540
|
yarn create webpack5-react {{beforeDir}} --version-react="beta" --version-react-dom="beta" && cd {{beforeDir}} && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
package/dist/bin/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { join, basename, extname, isAbsolute, normalize } from 'node:path';
|
|
|
13
13
|
import { readConfig, writeConfig, loadConfig, formatConfig, babelParse } from 'storybook/internal/csf-tools';
|
|
14
14
|
import semver, { prerelease, lt, gt, eq, clean } from 'semver';
|
|
15
15
|
import { dedent } from 'ts-dedent';
|
|
16
|
+
import { types } from 'storybook/internal/babel';
|
|
16
17
|
import process2 from 'node:process';
|
|
17
18
|
import fse2, { move, remove, existsSync, readdir, createWriteStream, readFile, writeFile } from 'fs-extra';
|
|
18
19
|
import prompts5, { prompt } from 'prompts';
|
|
@@ -23,18 +24,20 @@ import { glob } from 'glob';
|
|
|
23
24
|
import { readFile as readFile$1 } from 'node:fs/promises';
|
|
24
25
|
import findUp from 'find-up';
|
|
25
26
|
import * as babel from '@babel/core';
|
|
26
|
-
import { types } from 'storybook/internal/babel';
|
|
27
27
|
import { sync, spawn } from 'cross-spawn';
|
|
28
28
|
import { initiate } from 'create-storybook';
|
|
29
29
|
import { downloadTemplate } from 'giget';
|
|
30
30
|
import { UpgradeStorybookInWrongWorkingDirectory, UpgradeStorybookToLowerVersionError, UpgradeStorybookToSameVersionError, UpgradeStorybookUnknownCurrentVersionError } from 'storybook/internal/server-errors';
|
|
31
31
|
|
|
32
32
|
var require_eastasianwidth=__commonJS({"../../node_modules/eastasianwidth/eastasianwidth.js"(exports,module){var eaw={};typeof module>"u"?window.eastasianwidth=eaw:module.exports=eaw;eaw.eastAsianWidth=function(character){var x=character.charCodeAt(0),y=character.length==2?character.charCodeAt(1):0,codePoint=x;return 55296<=x&&x<=56319&&56320<=y&&y<=57343&&(x&=1023,y&=1023,codePoint=x<<10|y,codePoint+=65536),codePoint==12288||65281<=codePoint&&codePoint<=65376||65504<=codePoint&&codePoint<=65510?"F":codePoint==8361||65377<=codePoint&&codePoint<=65470||65474<=codePoint&&codePoint<=65479||65482<=codePoint&&codePoint<=65487||65490<=codePoint&&codePoint<=65495||65498<=codePoint&&codePoint<=65500||65512<=codePoint&&codePoint<=65518?"H":4352<=codePoint&&codePoint<=4447||4515<=codePoint&&codePoint<=4519||4602<=codePoint&&codePoint<=4607||9001<=codePoint&&codePoint<=9002||11904<=codePoint&&codePoint<=11929||11931<=codePoint&&codePoint<=12019||12032<=codePoint&&codePoint<=12245||12272<=codePoint&&codePoint<=12283||12289<=codePoint&&codePoint<=12350||12353<=codePoint&&codePoint<=12438||12441<=codePoint&&codePoint<=12543||12549<=codePoint&&codePoint<=12589||12593<=codePoint&&codePoint<=12686||12688<=codePoint&&codePoint<=12730||12736<=codePoint&&codePoint<=12771||12784<=codePoint&&codePoint<=12830||12832<=codePoint&&codePoint<=12871||12880<=codePoint&&codePoint<=13054||13056<=codePoint&&codePoint<=19903||19968<=codePoint&&codePoint<=42124||42128<=codePoint&&codePoint<=42182||43360<=codePoint&&codePoint<=43388||44032<=codePoint&&codePoint<=55203||55216<=codePoint&&codePoint<=55238||55243<=codePoint&&codePoint<=55291||63744<=codePoint&&codePoint<=64255||65040<=codePoint&&codePoint<=65049||65072<=codePoint&&codePoint<=65106||65108<=codePoint&&codePoint<=65126||65128<=codePoint&&codePoint<=65131||110592<=codePoint&&codePoint<=110593||127488<=codePoint&&codePoint<=127490||127504<=codePoint&&codePoint<=127546||127552<=codePoint&&codePoint<=127560||127568<=codePoint&&codePoint<=127569||131072<=codePoint&&codePoint<=194367||177984<=codePoint&&codePoint<=196605||196608<=codePoint&&codePoint<=262141?"W":32<=codePoint&&codePoint<=126||162<=codePoint&&codePoint<=163||165<=codePoint&&codePoint<=166||codePoint==172||codePoint==175||10214<=codePoint&&codePoint<=10221||10629<=codePoint&&codePoint<=10630?"Na":codePoint==161||codePoint==164||167<=codePoint&&codePoint<=168||codePoint==170||173<=codePoint&&codePoint<=174||176<=codePoint&&codePoint<=180||182<=codePoint&&codePoint<=186||188<=codePoint&&codePoint<=191||codePoint==198||codePoint==208||215<=codePoint&&codePoint<=216||222<=codePoint&&codePoint<=225||codePoint==230||232<=codePoint&&codePoint<=234||236<=codePoint&&codePoint<=237||codePoint==240||242<=codePoint&&codePoint<=243||247<=codePoint&&codePoint<=250||codePoint==252||codePoint==254||codePoint==257||codePoint==273||codePoint==275||codePoint==283||294<=codePoint&&codePoint<=295||codePoint==299||305<=codePoint&&codePoint<=307||codePoint==312||319<=codePoint&&codePoint<=322||codePoint==324||328<=codePoint&&codePoint<=331||codePoint==333||338<=codePoint&&codePoint<=339||358<=codePoint&&codePoint<=359||codePoint==363||codePoint==462||codePoint==464||codePoint==466||codePoint==468||codePoint==470||codePoint==472||codePoint==474||codePoint==476||codePoint==593||codePoint==609||codePoint==708||codePoint==711||713<=codePoint&&codePoint<=715||codePoint==717||codePoint==720||728<=codePoint&&codePoint<=731||codePoint==733||codePoint==735||768<=codePoint&&codePoint<=879||913<=codePoint&&codePoint<=929||931<=codePoint&&codePoint<=937||945<=codePoint&&codePoint<=961||963<=codePoint&&codePoint<=969||codePoint==1025||1040<=codePoint&&codePoint<=1103||codePoint==1105||codePoint==8208||8211<=codePoint&&codePoint<=8214||8216<=codePoint&&codePoint<=8217||8220<=codePoint&&codePoint<=8221||8224<=codePoint&&codePoint<=8226||8228<=codePoint&&codePoint<=8231||codePoint==8240||8242<=codePoint&&codePoint<=8243||codePoint==8245||codePoint==8251||codePoint==8254||codePoint==8308||codePoint==8319||8321<=codePoint&&codePoint<=8324||codePoint==8364||codePoint==8451||codePoint==8453||codePoint==8457||codePoint==8467||codePoint==8470||8481<=codePoint&&codePoint<=8482||codePoint==8486||codePoint==8491||8531<=codePoint&&codePoint<=8532||8539<=codePoint&&codePoint<=8542||8544<=codePoint&&codePoint<=8555||8560<=codePoint&&codePoint<=8569||codePoint==8585||8592<=codePoint&&codePoint<=8601||8632<=codePoint&&codePoint<=8633||codePoint==8658||codePoint==8660||codePoint==8679||codePoint==8704||8706<=codePoint&&codePoint<=8707||8711<=codePoint&&codePoint<=8712||codePoint==8715||codePoint==8719||codePoint==8721||codePoint==8725||codePoint==8730||8733<=codePoint&&codePoint<=8736||codePoint==8739||codePoint==8741||8743<=codePoint&&codePoint<=8748||codePoint==8750||8756<=codePoint&&codePoint<=8759||8764<=codePoint&&codePoint<=8765||codePoint==8776||codePoint==8780||codePoint==8786||8800<=codePoint&&codePoint<=8801||8804<=codePoint&&codePoint<=8807||8810<=codePoint&&codePoint<=8811||8814<=codePoint&&codePoint<=8815||8834<=codePoint&&codePoint<=8835||8838<=codePoint&&codePoint<=8839||codePoint==8853||codePoint==8857||codePoint==8869||codePoint==8895||codePoint==8978||9312<=codePoint&&codePoint<=9449||9451<=codePoint&&codePoint<=9547||9552<=codePoint&&codePoint<=9587||9600<=codePoint&&codePoint<=9615||9618<=codePoint&&codePoint<=9621||9632<=codePoint&&codePoint<=9633||9635<=codePoint&&codePoint<=9641||9650<=codePoint&&codePoint<=9651||9654<=codePoint&&codePoint<=9655||9660<=codePoint&&codePoint<=9661||9664<=codePoint&&codePoint<=9665||9670<=codePoint&&codePoint<=9672||codePoint==9675||9678<=codePoint&&codePoint<=9681||9698<=codePoint&&codePoint<=9701||codePoint==9711||9733<=codePoint&&codePoint<=9734||codePoint==9737||9742<=codePoint&&codePoint<=9743||9748<=codePoint&&codePoint<=9749||codePoint==9756||codePoint==9758||codePoint==9792||codePoint==9794||9824<=codePoint&&codePoint<=9825||9827<=codePoint&&codePoint<=9829||9831<=codePoint&&codePoint<=9834||9836<=codePoint&&codePoint<=9837||codePoint==9839||9886<=codePoint&&codePoint<=9887||9918<=codePoint&&codePoint<=9919||9924<=codePoint&&codePoint<=9933||9935<=codePoint&&codePoint<=9953||codePoint==9955||9960<=codePoint&&codePoint<=9983||codePoint==10045||codePoint==10071||10102<=codePoint&&codePoint<=10111||11093<=codePoint&&codePoint<=11097||12872<=codePoint&&codePoint<=12879||57344<=codePoint&&codePoint<=63743||65024<=codePoint&&codePoint<=65039||codePoint==65533||127232<=codePoint&&codePoint<=127242||127248<=codePoint&&codePoint<=127277||127280<=codePoint&&codePoint<=127337||127344<=codePoint&&codePoint<=127386||917760<=codePoint&&codePoint<=917999||983040<=codePoint&&codePoint<=1048573||1048576<=codePoint&&codePoint<=1114109?"A":"N"};eaw.characterLength=function(character){var code=this.eastAsianWidth(character);return code=="F"||code=="W"||code=="A"?2:1};function stringToArray(string){return string.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}eaw.length=function(string){for(var characters=stringToArray(string),len=0,i=0;i<characters.length;i++)len=len+this.characterLength(characters[i]);return len};eaw.slice=function(text,start,end){textLen=eaw.length(text),start=start||0,end=end||1,start<0&&(start=textLen+start),end<0&&(end=textLen+end);for(var result="",eawLen=0,chars=stringToArray(text),i=0;i<chars.length;i++){var char=chars[i],charLen=eaw.length(char);if(eawLen>=start-(charLen==2?1:0))if(eawLen+charLen<=end)result+=char;else break;eawLen+=charLen;}return result};}});var require_emoji_regex=__commonJS({"../../node_modules/emoji-regex/index.js"(exports,module){module.exports=function(){return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};}});var require_boxes=__commonJS({"../../node_modules/cli-boxes/boxes.json"(exports,module){module.exports={single:{topLeft:"\u250C",top:"\u2500",topRight:"\u2510",right:"\u2502",bottomRight:"\u2518",bottom:"\u2500",bottomLeft:"\u2514",left:"\u2502"},double:{topLeft:"\u2554",top:"\u2550",topRight:"\u2557",right:"\u2551",bottomRight:"\u255D",bottom:"\u2550",bottomLeft:"\u255A",left:"\u2551"},round:{topLeft:"\u256D",top:"\u2500",topRight:"\u256E",right:"\u2502",bottomRight:"\u256F",bottom:"\u2500",bottomLeft:"\u2570",left:"\u2502"},bold:{topLeft:"\u250F",top:"\u2501",topRight:"\u2513",right:"\u2503",bottomRight:"\u251B",bottom:"\u2501",bottomLeft:"\u2517",left:"\u2503"},singleDouble:{topLeft:"\u2553",top:"\u2500",topRight:"\u2556",right:"\u2551",bottomRight:"\u255C",bottom:"\u2500",bottomLeft:"\u2559",left:"\u2551"},doubleSingle:{topLeft:"\u2552",top:"\u2550",topRight:"\u2555",right:"\u2502",bottomRight:"\u255B",bottom:"\u2550",bottomLeft:"\u2558",left:"\u2502"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"\u2198",top:"\u2193",topRight:"\u2199",right:"\u2190",bottomRight:"\u2196",bottom:"\u2191",bottomLeft:"\u2197",left:"\u2192"}};}});var require_cli_boxes=__commonJS({"../../node_modules/cli-boxes/index.js"(exports,module){var cliBoxes2=require_boxes();module.exports=cliBoxes2;module.exports.default=cliBoxes2;}});var require_ansi_regex=__commonJS({"../../node_modules/string-width/node_modules/ansi-regex/index.js"(exports,module){module.exports=({onlyFirst=!1}={})=>{let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")};}});var require_strip_ansi=__commonJS({"../../node_modules/string-width/node_modules/strip-ansi/index.js"(exports,module){var ansiRegex3=require_ansi_regex();module.exports=string=>typeof string=="string"?string.replace(ansiRegex3(),""):string;}});var require_is_fullwidth_code_point=__commonJS({"../../node_modules/is-fullwidth-code-point/index.js"(exports,module){var isFullwidthCodePoint=codePoint=>Number.isNaN(codePoint)?!1:codePoint>=4352&&(codePoint<=4447||codePoint===9001||codePoint===9002||11904<=codePoint&&codePoint<=12871&&codePoint!==12351||12880<=codePoint&&codePoint<=19903||19968<=codePoint&&codePoint<=42182||43360<=codePoint&&codePoint<=43388||44032<=codePoint&&codePoint<=55203||63744<=codePoint&&codePoint<=64255||65040<=codePoint&&codePoint<=65049||65072<=codePoint&&codePoint<=65131||65281<=codePoint&&codePoint<=65376||65504<=codePoint&&codePoint<=65510||110592<=codePoint&&codePoint<=110593||127488<=codePoint&&codePoint<=127569||131072<=codePoint&&codePoint<=262141);module.exports=isFullwidthCodePoint;module.exports.default=isFullwidthCodePoint;}});var require_emoji_regex2=__commonJS({"../../node_modules/string-width/node_modules/emoji-regex/index.js"(exports,module){module.exports=function(){return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};}});var require_string_width=__commonJS({"../../node_modules/string-width/index.js"(exports,module){var stripAnsi2=require_strip_ansi(),isFullwidthCodePoint=require_is_fullwidth_code_point(),emojiRegex4=require_emoji_regex2(),stringWidth4=string=>{if(typeof string!="string"||string.length===0||(string=stripAnsi2(string),string.length===0))return 0;string=string.replace(emojiRegex4()," ");let width=0;for(let i=0;i<string.length;i++){let code=string.codePointAt(i);code<=31||code>=127&&code<=159||code>=768&&code<=879||(code>65535&&i++,width+=isFullwidthCodePoint(code)?2:1);}return width};module.exports=stringWidth4;module.exports.default=stringWidth4;}});var require_ansi_align=__commonJS({"../../node_modules/ansi-align/index.js"(exports,module){var stringWidth4=require_string_width();function ansiAlign2(text,opts){if(!text)return text;opts=opts||{};let align=opts.align||"center";if(align==="left")return text;let split=opts.split||`
|
|
33
|
-
`,pad=opts.pad||" ",widthDiffFn=align!=="right"?halfDiff:fullDiff,returnString=!1;Array.isArray(text)||(returnString=!0,text=String(text).split(split));let width,maxWidth=0;return text=text.map(function(str){return str=String(str),width=stringWidth4(str),maxWidth=Math.max(width,maxWidth),{str,width}}).map(function(obj){return new Array(widthDiffFn(maxWidth,obj.width)+1).join(pad)+obj.str}),returnString?text.join(split):text}ansiAlign2.left=function(text){return ansiAlign2(text,{align:"left"})};ansiAlign2.center=function(text){return ansiAlign2(text,{align:"center"})};ansiAlign2.right=function(text){return ansiAlign2(text,{align:"right"})};module.exports=ansiAlign2;function halfDiff(maxWidth,curWidth){return Math.floor((maxWidth-curWidth)/2)}function fullDiff(maxWidth,curWidth){return maxWidth-curWidth}}});var
|
|
33
|
+
`,pad=opts.pad||" ",widthDiffFn=align!=="right"?halfDiff:fullDiff,returnString=!1;Array.isArray(text)||(returnString=!0,text=String(text).split(split));let width,maxWidth=0;return text=text.map(function(str){return str=String(str),width=stringWidth4(str),maxWidth=Math.max(width,maxWidth),{str,width}}).map(function(obj){return new Array(widthDiffFn(maxWidth,obj.width)+1).join(pad)+obj.str}),returnString?text.join(split):text}ansiAlign2.left=function(text){return ansiAlign2(text,{align:"left"})};ansiAlign2.center=function(text){return ansiAlign2(text,{align:"center"})};ansiAlign2.right=function(text){return ansiAlign2(text,{align:"right"})};module.exports=ansiAlign2;function halfDiff(maxWidth,curWidth){return Math.floor((maxWidth-curWidth)/2)}function fullDiff(maxWidth,curWidth){return maxWidth-curWidth}}});var defaultRequireWrapperName="getAbsolutePath";function doesVariableOrFunctionDeclarationExist(node,name){return types.isVariableDeclaration(node)&&node.declarations.length===1&&types.isVariableDeclarator(node.declarations[0])&&types.isIdentifier(node.declarations[0].id)&&node.declarations[0].id?.name===name||types.isFunctionDeclaration(node)&&types.isIdentifier(node.id)&&node.id.name===name}function getReferenceToRequireWrapper(config,value){return types.callExpression(types.identifier(getRequireWrapperName(config)??defaultRequireWrapperName),[types.stringLiteral(value)])}function getRequireWrapperName(config){let declarationName=config.getBodyDeclarations().flatMap(node=>doesVariableOrFunctionDeclarationExist(node,"wrapForPnp")?["wrapForPnp"]:doesVariableOrFunctionDeclarationExist(node,defaultRequireWrapperName)?[defaultRequireWrapperName]:[]);return declarationName.length?declarationName[0]:null}function isRequireWrapperNecessary(node,cb=()=>{}){if(types.isStringLiteral(node))return cb(node),!0;if(types.isObjectExpression(node)){let nameProperty=node.properties.find(property=>types.isObjectProperty(property)&&types.isIdentifier(property.key)&&property.key.name==="name");if(nameProperty&&types.isStringLiteral(nameProperty.value))return cb(nameProperty),!0}return types.isArrayExpression(node)&&node.elements.some(element=>element&&isRequireWrapperNecessary(element))?(cb(node),!0):!1}function getFieldsForRequireWrapper(config){let frameworkNode=config.getFieldNode(["framework"]),builderNode=config.getFieldNode(["core","builder"]),rendererNode=config.getFieldNode(["core","renderer"]),addons=config.getFieldNode(["addons"]);return [...frameworkNode?[frameworkNode]:[],...builderNode?[builderNode]:[],...rendererNode?[rendererNode]:[],...addons&&types.isArrayExpression(addons)?[addons]:[]]}function getRequireWrapperAsCallExpression(isConfigTypescript){let functionDeclaration={...types.functionDeclaration(types.identifier(defaultRequireWrapperName),[{...types.identifier("value"),...isConfigTypescript?{typeAnnotation:types.tsTypeAnnotation(types.tSStringKeyword())}:{}}],types.blockStatement([types.returnStatement(types.callExpression(types.identifier("dirname"),[types.callExpression(types.memberExpression(types.identifier("require"),types.identifier("resolve")),[types.callExpression(types.identifier("join"),[types.identifier("value"),types.stringLiteral("package.json")])])]))])),...isConfigTypescript?{returnType:types.tSTypeAnnotation(types.tsAnyKeyword())}:{}};return types.addComment(functionDeclaration,"leading",`*
|
|
34
|
+
* This function is used to resolve the absolute path of a package.
|
|
35
|
+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
36
|
+
`),functionDeclaration}function wrapValueWithRequireWrapper(config,node){isRequireWrapperNecessary(node,n=>{if(types.isStringLiteral(n)){let wrapperNode=getReferenceToRequireWrapper(config,n.value);Object.keys(n).forEach(k=>{delete n[k];}),Object.keys(wrapperNode).forEach(k=>{n[k]=wrapperNode[k];});}types.isObjectProperty(n)&&types.isStringLiteral(n.value)&&(n.value=getReferenceToRequireWrapper(config,n.value.value)),types.isArrayExpression(n)&&n.elements.forEach((element,index,elements)=>{types.isStringLiteral(element)&&(elements[index]=getReferenceToRequireWrapper(config,element.value));});});}var postinstallAddon=async(addonName,options)=>{try{let modulePath=__require.resolve(`${addonName}/postinstall`,{paths:[process.cwd()]}),postinstall=__require(modulePath);try{console.log(`Running postinstall script for ${addonName}`),await postinstall(options);}catch(e){console.error(`Error running postinstall script for ${addonName}`),console.error(e);}}catch{}};var getVersionSpecifier=addon=>{let groups=/^(@{0,1}[^@]+)(?:@(.+))?$/.exec(addon);return groups?[groups[1],groups[2]]:[addon,void 0]},requireMain=configDir=>{let absoluteConfigDir=isAbsolute(configDir)?configDir:join(process.cwd(),configDir),mainFile=join(absoluteConfigDir,"main");return serverRequire(mainFile)??{}},checkInstalled=(addonName,main)=>!!main.addons?.find(entry=>(typeof entry=="string"?entry:entry.name)?.endsWith(addonName)),isCoreAddon=addonName=>Object.hasOwn(versions,addonName);async function add(addon,{packageManager:pkgMgr,skipPostinstall,configDir:userSpecifiedConfigDir},logger28=console){let[addonName,inputVersion]=getVersionSpecifier(addon),packageManager=JsPackageManagerFactory.getPackageManager({force:pkgMgr}),packageJson=await packageManager.retrievePackageJson(),{mainConfig,configDir:inferredConfigDir}=getStorybookInfo(packageJson,userSpecifiedConfigDir),configDir=userSpecifiedConfigDir||inferredConfigDir||".storybook";if(typeof configDir>"u")throw new Error(dedent`
|
|
34
37
|
Unable to find storybook config directory
|
|
35
38
|
`);if(!mainConfig){logger28.error("Unable to find storybook main.js config");return}if(checkInstalled(addonName,requireMain(configDir)))throw new Error(dedent`
|
|
36
39
|
Addon ${addonName} is already installed; we skipped adding it to your ${mainConfig}.
|
|
37
|
-
`);let main=await readConfig(mainConfig);logger28.log(`Verifying ${addonName}`);let storybookVersion=await getCoercedStorybookVersion(packageManager),version=inputVersion;!version&&isCoreAddon(addonName)&&storybookVersion&&(version=storybookVersion),version||(version=await packageManager.latestVersion(addonName)),isCoreAddon(addonName)&&version!==storybookVersion&&logger28.warn(`The version of ${addonName} you are installing is not the same as the version of Storybook you are using. This may lead to unexpected behavior.`);let addonWithVersion=isValidVersion(version)?`${addonName}@^${version}`:`${addonName}@${version}`;logger28.log(`Installing ${addonWithVersion}`),await packageManager.addDependencies({installAsDevDependencies:!0},[addonWithVersion]),logger28.log(`Adding '${addon}' to main.js addons field.`),main.appendValueToArray(["addons"],addonName)
|
|
40
|
+
`);let main=await readConfig(mainConfig);logger28.log(`Verifying ${addonName}`);let storybookVersion=await getCoercedStorybookVersion(packageManager),version=inputVersion;!version&&isCoreAddon(addonName)&&storybookVersion&&(version=storybookVersion),version||(version=await packageManager.latestVersion(addonName)),isCoreAddon(addonName)&&version!==storybookVersion&&logger28.warn(`The version of ${addonName} you are installing is not the same as the version of Storybook you are using. This may lead to unexpected behavior.`);let addonWithVersion=isValidVersion(version)?`${addonName}@^${version}`:`${addonName}@${version}`;if(logger28.log(`Installing ${addonWithVersion}`),await packageManager.addDependencies({installAsDevDependencies:!0},[addonWithVersion]),logger28.log(`Adding '${addon}' to main.js addons field.`),main.getFieldNode(["addons"])&&getRequireWrapperName(main)!==null){let addonNode=main.valueToNode(addonName);main.appendNodeToArray(["addons"],addonNode),wrapValueWithRequireWrapper(main,addonNode);}else main.appendValueToArray(["addons"],addonName);await writeConfig(main),!skipPostinstall&&isCoreAddon(addonName)&&await postinstallAddon(addonName,{packageManager:packageManager.type,configDir});}function isValidVersion(version){return semver.valid(version)||version.match(/^\d+$/)}function ansiRegex({onlyFirst=!1}={}){let pattern=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(pattern,onlyFirst?void 0:"g")}var regex=ansiRegex();function stripAnsi(string){if(typeof string!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);return string.replace(regex,"")}var import_eastasianwidth=__toESM(require_eastasianwidth(),1),import_emoji_regex=__toESM(require_emoji_regex(),1);function stringWidth(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0, import_emoji_regex.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1;}}return width}var import_eastasianwidth2=__toESM(require_eastasianwidth(),1),import_emoji_regex2=__toESM(require_emoji_regex(),1);function stringWidth2(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0, import_emoji_regex2.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth2.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1;}}return width}function widestLine(string){let lineWidth=0;for(let line of string.split(`
|
|
38
41
|
`))lineWidth=Math.max(lineWidth,stringWidth2(line));return lineWidth}var import_cli_boxes=__toESM(require_cli_boxes(),1);var UPPERCASE=/[\p{Lu}]/u,LOWERCASE=/[\p{Ll}]/u,LEADING_CAPITAL=/^[\p{Lu}](?![\p{Lu}])/gu,IDENTIFIER=/([\p{Alpha}\p{N}_]|$)/u,SEPARATORS=/[_.\- ]+/,LEADING_SEPARATORS=new RegExp("^"+SEPARATORS.source),SEPARATORS_AND_IDENTIFIER=new RegExp(SEPARATORS.source+IDENTIFIER.source,"gu"),NUMBERS_AND_IDENTIFIER=new RegExp("\\d+"+IDENTIFIER.source,"gu"),preserveCamelCase=(string,toLowerCase,toUpperCase,preserveConsecutiveUppercase2)=>{let isLastCharLower=!1,isLastCharUpper=!1,isLastLastCharUpper=!1,isLastLastCharPreserved=!1;for(let index=0;index<string.length;index++){let character=string[index];isLastLastCharPreserved=index>2?string[index-3]==="-":!0,isLastCharLower&&UPPERCASE.test(character)?(string=string.slice(0,index)+"-"+string.slice(index),isLastCharLower=!1,isLastLastCharUpper=isLastCharUpper,isLastCharUpper=!0,index++):isLastCharUpper&&isLastLastCharUpper&&LOWERCASE.test(character)&&(!isLastLastCharPreserved||preserveConsecutiveUppercase2)?(string=string.slice(0,index-1)+"-"+string.slice(index-1),isLastLastCharUpper=isLastCharUpper,isLastCharUpper=!1,isLastCharLower=!0):(isLastCharLower=toLowerCase(character)===character&&toUpperCase(character)!==character,isLastLastCharUpper=isLastCharUpper,isLastCharUpper=toUpperCase(character)===character&&toLowerCase(character)!==character);}return string},preserveConsecutiveUppercase=(input,toLowerCase)=>(LEADING_CAPITAL.lastIndex=0,input.replace(LEADING_CAPITAL,m1=>toLowerCase(m1))),postProcess=(input,toUpperCase)=>(SEPARATORS_AND_IDENTIFIER.lastIndex=0,NUMBERS_AND_IDENTIFIER.lastIndex=0,input.replace(SEPARATORS_AND_IDENTIFIER,(_,identifier)=>toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER,m=>toUpperCase(m)));function camelCase(input,options){if(!(typeof input=="string"||Array.isArray(input)))throw new TypeError("Expected the input to be `string | string[]`");if(options={pascalCase:!1,preserveConsecutiveUppercase:!1,...options},Array.isArray(input)?input=input.map(x=>x.trim()).filter(x=>x.length).join("-"):input=input.trim(),input.length===0)return "";let toLowerCase=options.locale===!1?string=>string.toLowerCase():string=>string.toLocaleLowerCase(options.locale),toUpperCase=options.locale===!1?string=>string.toUpperCase():string=>string.toLocaleUpperCase(options.locale);return input.length===1?SEPARATORS.test(input)?"":options.pascalCase?toUpperCase(input):toLowerCase(input):(input!==toLowerCase(input)&&(input=preserveCamelCase(input,toLowerCase,toUpperCase,options.preserveConsecutiveUppercase)),input=input.replace(LEADING_SEPARATORS,""),input=options.preserveConsecutiveUppercase?preserveConsecutiveUppercase(input,toLowerCase):toLowerCase(input),options.pascalCase&&(input=toUpperCase(input.charAt(0))+input.slice(1)),postProcess(input,toUpperCase))}var import_ansi_align=__toESM(require_ansi_align(),1);var import_eastasianwidth3=__toESM(require_eastasianwidth(),1),import_emoji_regex3=__toESM(require_emoji_regex(),1);function stringWidth3(string,options={}){if(typeof string!="string"||string.length===0||(options={ambiguousIsNarrow:!0,...options},string=stripAnsi(string),string.length===0))return 0;string=string.replace((0, import_emoji_regex3.default)()," ");let ambiguousCharacterWidth=options.ambiguousIsNarrow?1:2,width=0;for(let character of string){let codePoint=character.codePointAt(0);if(codePoint<=31||codePoint>=127&&codePoint<=159||codePoint>=768&&codePoint<=879)continue;switch(import_eastasianwidth3.default.eastAsianWidth(character)){case"F":case"W":width+=2;break;case"A":width+=ambiguousCharacterWidth;break;default:width+=1;}}return width}var wrapAnsi16=(offset=0)=>code=>`\x1B[${code+offset}m`,wrapAnsi256=(offset=0)=>code=>`\x1B[${38+offset};5;${code}m`,wrapAnsi16m=(offset=0)=>(red,green,blue)=>`\x1B[${38+offset};2;${red};${green};${blue}m`,styles={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(styles.modifier);var foregroundColorNames=Object.keys(styles.color),backgroundColorNames=Object.keys(styles.bgColor);[...foregroundColorNames,...backgroundColorNames];function assembleStyles(){let codes=new Map;for(let[groupName,group]of Object.entries(styles)){for(let[styleName,style]of Object.entries(group))styles[styleName]={open:`\x1B[${style[0]}m`,close:`\x1B[${style[1]}m`},group[styleName]=styles[styleName],codes.set(style[0],style[1]);Object.defineProperty(styles,groupName,{value:group,enumerable:!1});}return Object.defineProperty(styles,"codes",{value:codes,enumerable:!1}),styles.color.close="\x1B[39m",styles.bgColor.close="\x1B[49m",styles.color.ansi=wrapAnsi16(),styles.color.ansi256=wrapAnsi256(),styles.color.ansi16m=wrapAnsi16m(),styles.bgColor.ansi=wrapAnsi16(10),styles.bgColor.ansi256=wrapAnsi256(10),styles.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(styles,{rgbToAnsi256:{value:(red,green,blue)=>red===green&&green===blue?red<8?16:red>248?231:Math.round((red-8)/247*24)+232:16+36*Math.round(red/255*5)+6*Math.round(green/255*5)+Math.round(blue/255*5),enumerable:!1},hexToRgb:{value:hex=>{let matches=/[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));if(!matches)return [0,0,0];let[colorString]=matches;colorString.length===3&&(colorString=[...colorString].map(character=>character+character).join(""));let integer=Number.parseInt(colorString,16);return [integer>>16&255,integer>>8&255,integer&255]},enumerable:!1},hexToAnsi256:{value:hex=>styles.rgbToAnsi256(...styles.hexToRgb(hex)),enumerable:!1},ansi256ToAnsi:{value:code=>{if(code<8)return 30+code;if(code<16)return 90+(code-8);let red,green,blue;if(code>=232)red=((code-232)*10+8)/255,green=red,blue=red;else {code-=16;let remainder=code%36;red=Math.floor(code/36)/5,green=Math.floor(remainder/6)/5,blue=remainder%6/5;}let value=Math.max(red,green,blue)*2;if(value===0)return 30;let result=30+(Math.round(blue)<<2|Math.round(green)<<1|Math.round(red));return value===2&&(result+=60),result},enumerable:!1},rgbToAnsi:{value:(red,green,blue)=>styles.ansi256ToAnsi(styles.rgbToAnsi256(red,green,blue)),enumerable:!1},hexToAnsi:{value:hex=>styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),enumerable:!1}}),styles}var ansiStyles=assembleStyles(),ansi_styles_default=ansiStyles;var ESCAPES=new Set(["\x1B","\x9B"]),END_CODE=39,ANSI_ESCAPE_BELL="\x07",ANSI_CSI="[",ANSI_OSC="]",ANSI_SGR_TERMINATOR="m",ANSI_ESCAPE_LINK=`${ANSI_OSC}8;;`,wrapAnsiCode=code=>`${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`,wrapAnsiHyperlink=uri=>`${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`,wordLengths=string=>string.split(" ").map(character=>stringWidth3(character)),wrapWord=(rows,word,columns)=>{let characters=[...word],isInsideEscape=!1,isInsideLinkEscape=!1,visible=stringWidth3(stripAnsi(rows[rows.length-1]));for(let[index,character]of characters.entries()){let characterLength=stringWidth3(character);if(visible+characterLength<=columns?rows[rows.length-1]+=character:(rows.push(character),visible=0),ESCAPES.has(character)&&(isInsideEscape=!0,isInsideLinkEscape=characters.slice(index+1).join("").startsWith(ANSI_ESCAPE_LINK)),isInsideEscape){isInsideLinkEscape?character===ANSI_ESCAPE_BELL&&(isInsideEscape=!1,isInsideLinkEscape=!1):character===ANSI_SGR_TERMINATOR&&(isInsideEscape=!1);continue}visible+=characterLength,visible===columns&&index<characters.length-1&&(rows.push(""),visible=0);}!visible&&rows[rows.length-1].length>0&&rows.length>1&&(rows[rows.length-2]+=rows.pop());},stringVisibleTrimSpacesRight=string=>{let words=string.split(" "),last=words.length;for(;last>0&&!(stringWidth3(words[last-1])>0);)last--;return last===words.length?string:words.slice(0,last).join(" ")+words.slice(last).join("")},exec=(string,columns,options={})=>{if(options.trim!==!1&&string.trim()==="")return "";let returnValue="",escapeCode,escapeUrl,lengths=wordLengths(string),rows=[""];for(let[index,word]of string.split(" ").entries()){options.trim!==!1&&(rows[rows.length-1]=rows[rows.length-1].trimStart());let rowLength=stringWidth3(rows[rows.length-1]);if(index!==0&&(rowLength>=columns&&(options.wordWrap===!1||options.trim===!1)&&(rows.push(""),rowLength=0),(rowLength>0||options.trim===!1)&&(rows[rows.length-1]+=" ",rowLength++)),options.hard&&lengths[index]>columns){let remainingColumns=columns-rowLength,breaksStartingThisLine=1+Math.floor((lengths[index]-remainingColumns-1)/columns);Math.floor((lengths[index]-1)/columns)<breaksStartingThisLine&&rows.push(""),wrapWord(rows,word,columns);continue}if(rowLength+lengths[index]>columns&&rowLength>0&&lengths[index]>0){if(options.wordWrap===!1&&rowLength<columns){wrapWord(rows,word,columns);continue}rows.push("");}if(rowLength+lengths[index]>columns&&options.wordWrap===!1){wrapWord(rows,word,columns);continue}rows[rows.length-1]+=word;}options.trim!==!1&&(rows=rows.map(row=>stringVisibleTrimSpacesRight(row)));let pre=[...rows.join(`
|
|
39
42
|
`)];for(let[index,character]of pre.entries()){if(returnValue+=character,ESCAPES.has(character)){let{groups}=new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join(""))||{groups:{}};if(groups.code!==void 0){let code2=Number.parseFloat(groups.code);escapeCode=code2===END_CODE?void 0:code2;}else groups.uri!==void 0&&(escapeUrl=groups.uri.length===0?void 0:groups.uri);}let code=ansi_styles_default.codes.get(Number(escapeCode));pre[index+1]===`
|
|
40
43
|
`?(escapeUrl&&(returnValue+=wrapAnsiHyperlink("")),escapeCode&&code&&(returnValue+=wrapAnsiCode(code))):character===`
|
|
@@ -484,10 +487,7 @@ ${chalk22.cyan("npx storybook doctor")}`;logger2.info(),foundIssues?(logger2.inf
|
|
|
484
487
|
You can find more information here: ${chalk22.yellow("https://storybook.js.org/docs/8.0/builders/webpack#compiler-support")}
|
|
485
488
|
`),message.join(`
|
|
486
489
|
|
|
487
|
-
`)},async run({result,mainConfigPath,packageManager,skipInstall,dryRun}){let{defaultCompiler,shouldRemoveSWCFlag,isNextJs}=result;if(shouldRemoveSWCFlag&&await updateMainConfig({mainConfigPath,dryRun:!!dryRun},main=>{main.removeField(["framework","options","builder","useSWC"]);}),!isNextJs){let compiler=defaultCompiler===CoreWebpackCompilers.Babel?await askUserForCompilerChoice():CoreWebpackCompilers.SWC,compilerPackageName=Object.entries(compilerNameToCoreCompiler).find(([,coreCompiler])=>coreCompiler===compiler)[0];await add(compilerPackageName,{packageManager:packageManager.type,skipPostinstall:!!skipInstall});}}};async function askUserForCompilerChoice(){return (await prompts5({type:"select",name:"compiler",message:"Which compiler would you like to use?",choices:[{title:"Babel",description:"Choose Babel for a vast ecosystem and battle-tested reliability.",value:CoreWebpackCompilers.Babel},{title:"SWC",description:"Choose SWC for fast builds and simple configuration.",value:CoreWebpackCompilers.SWC}],initial:0})).compiler}var
|
|
488
|
-
* This function is used to resolve the absolute path of a package.
|
|
489
|
-
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
|
|
490
|
-
`),functionDeclaration}function wrapValueWithRequireWrapper(config,node){isRequireWrapperNecessary(node,n=>{if(types.isStringLiteral(n)){let wrapperNode=getReferenceToRequireWrapper(config,n.value);Object.keys(n).forEach(k=>{delete n[k];}),Object.keys(wrapperNode).forEach(k=>{n[k]=wrapperNode[k];});}types.isObjectProperty(n)&&types.isStringLiteral(n.value)&&(n.value=getReferenceToRequireWrapper(config,n.value.value)),types.isArrayExpression(n)&&n.elements.forEach((element,index,elements)=>{types.isStringLiteral(element)&&(elements[index]=getReferenceToRequireWrapper(config,element.value));});});}var wrapRequire={id:"wrap-require",versionRange:["*","*"],async check({packageManager,storybookVersion,mainConfigPath}){let isStorybookInMonorepo=await packageManager.isStorybookInMonorepo(),isPnp=await detectPnp();if(!mainConfigPath)return null;let config=await readConfig(mainConfigPath);if(!isStorybookInMonorepo&&!isPnp||!getFieldsForRequireWrapper(config).some(node=>isRequireWrapperNecessary(node)))return null;let isConfigTypescript=mainConfigPath.endsWith(".ts")||mainConfigPath.endsWith(".tsx");return {storybookVersion,isStorybookInMonorepo,isPnp,isConfigTypescript}},prompt({storybookVersion,isStorybookInMonorepo}){let sbFormatted=chalk22.cyan(`Storybook ${storybookVersion}`);return dedent`We have detected that you're using ${sbFormatted} in a ${isStorybookInMonorepo?"monorepo":"PnP"} project.
|
|
490
|
+
`)},async run({result,mainConfigPath,packageManager,skipInstall,dryRun}){let{defaultCompiler,shouldRemoveSWCFlag,isNextJs}=result;if(shouldRemoveSWCFlag&&await updateMainConfig({mainConfigPath,dryRun:!!dryRun},main=>{main.removeField(["framework","options","builder","useSWC"]);}),!isNextJs){let compiler=defaultCompiler===CoreWebpackCompilers.Babel?await askUserForCompilerChoice():CoreWebpackCompilers.SWC,compilerPackageName=Object.entries(compilerNameToCoreCompiler).find(([,coreCompiler])=>coreCompiler===compiler)[0];await add(compilerPackageName,{packageManager:packageManager.type,skipPostinstall:!!skipInstall});}}};async function askUserForCompilerChoice(){return (await prompts5({type:"select",name:"compiler",message:"Which compiler would you like to use?",choices:[{title:"Babel",description:"Choose Babel for a vast ecosystem and battle-tested reliability.",value:CoreWebpackCompilers.Babel},{title:"SWC",description:"Choose SWC for fast builds and simple configuration.",value:CoreWebpackCompilers.SWC}],initial:0})).compiler}var wrapRequire={id:"wrap-require",versionRange:["*","*"],async check({packageManager,storybookVersion,mainConfigPath}){let isStorybookInMonorepo=await packageManager.isStorybookInMonorepo(),isPnp=await detectPnp();if(!mainConfigPath)return null;let config=await readConfig(mainConfigPath);if(!isStorybookInMonorepo&&!isPnp||!getFieldsForRequireWrapper(config).some(node=>isRequireWrapperNecessary(node)))return null;let isConfigTypescript=mainConfigPath.endsWith(".ts")||mainConfigPath.endsWith(".tsx");return {storybookVersion,isStorybookInMonorepo,isPnp,isConfigTypescript}},prompt({storybookVersion,isStorybookInMonorepo}){let sbFormatted=chalk22.cyan(`Storybook ${storybookVersion}`);return dedent`We have detected that you're using ${sbFormatted} in a ${isStorybookInMonorepo?"monorepo":"PnP"} project.
|
|
491
491
|
For Storybook to work correctly, some fields in your main config must be updated. We can do this for you automatically.
|
|
492
492
|
|
|
493
493
|
More info: https://storybook.js.org/docs/react/faq#how-do-i-fix-module-resolution-in-special-environments`},async run({dryRun,mainConfigPath,result}){return new Promise((resolve,reject)=>{updateMainConfig({dryRun:!!dryRun,mainConfigPath},mainConfig=>{try{getFieldsForRequireWrapper(mainConfig).forEach(node=>{wrapValueWithRequireWrapper(mainConfig,node);}),getRequireWrapperName(mainConfig)===null&&(mainConfig?.fileName?.endsWith(".cjs")||mainConfig?.fileName?.endsWith(".cts")||mainConfig?.fileName?.endsWith(".cjsx")||mainConfig?.fileName?.endsWith(".ctsx")?mainConfig.setRequireImport(["dirname","join"],"path"):mainConfig.setImport(["dirname","join"],"path"),mainConfig.setBodyDeclaration(getRequireWrapperAsCallExpression(result.isConfigTypescript))),resolve();}catch(e){reject(e);}});})}};var allFixes=[missingStorybookDependencies,addonsAPI,newFrameworks,cra5,webpack5,vue3,addonPostCSS,viteConfigFile,eslintPlugin,builderVite,sbBinary,sbScripts,removeJestTestingLibrary,removeArgtypesRegex,removedGlobalClientAPIs,mdxgfm,mdxToCSF,autodocsTrue,angularBuildersMultiproject,angularBuilders,wrapRequire,reactDocgen,storyshotsMigration,removeReactDependency,removeLegacyMDX1,webpack5CompilerSetup,mdx1to3,upgradeStorybookRelatedDependencies,vta,autodocsTags,initialGlobals];var messageDivider2=`
|
|
@@ -516,7 +516,7 @@ ${error.stack}`),fixSummary.failed[f.id]=error.message),fixResults[f.id]="check_
|
|
|
516
516
|
npx create-react-app {{beforeDir}} && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
517
517
|
`,expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"],modifications:{mainConfig:config=>({stories:config.getFieldValue(["stories"])?.map(s=>typeof s=="string"?s.replace(/\|(tsx?|ts)\b|\b(tsx?|ts)\|/g,""):s)})}},"cra/default-ts":{name:"Create React App Latest (Webpack | TypeScript)",script:`
|
|
518
518
|
npx create-react-app {{beforeDir}} --template typescript && cd {{beforeDir}} && jq '.browserslist.production[0] = ">0.9%"' package.json > tmp.json && mv tmp.json package.json
|
|
519
|
-
`,skipTasks:["smoke-test","bench","vitest-integration"],expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"}},"nextjs/13-ts":{name:"Next.js v13.5 (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^13.5.6" && yarn && git add . && git commit --amend --no-edit && cd ..',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-js":{name:"Next.js Latest (Webpack | JavaScript)",script:'yarn create next-app {{beforeDir}} --javascript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-ts":{name:"Next.js Latest (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/prerelease":{name:"Next.js Prerelease (Webpack | TypeScript)",script:'npx create-next-app@canary {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["server-only"],mainConfig:{features:{experimentalRSC:!0}}},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"experimental-nextjs-vite/default-ts":{name:"Next.js Latest (Vite | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/experimental-nextjs-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},modifications:{mainConfig:{framework:"@storybook/experimental-nextjs-vite",features:{experimentalRSC:!0}},extraDependencies:["server-only","
|
|
519
|
+
`,skipTasks:["smoke-test","bench","vitest-integration"],expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"}},"nextjs/13-ts":{name:"Next.js v13.5 (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} -e https://github.com/vercel/next.js/tree/next-13/examples/hello-world && cd {{beforeDir}} && npm pkg set "dependencies.next"="^13.5.6" && yarn && git add . && git commit --amend --no-edit && cd ..',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-js":{name:"Next.js Latest (Webpack | JavaScript)",script:'yarn create next-app {{beforeDir}} --javascript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/default-ts":{name:"Next.js Latest (Webpack | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{mainConfig:{features:{experimentalRSC:!0}},extraDependencies:["server-only"]},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"nextjs/prerelease":{name:"Next.js Prerelease (Webpack | TypeScript)",script:'npx create-next-app@canary {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/nextjs",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},modifications:{extraDependencies:["server-only"],mainConfig:{features:{experimentalRSC:!0}}},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"experimental-nextjs-vite/default-ts":{name:"Next.js Latest (Vite | TypeScript)",script:'yarn create next-app {{beforeDir}} --typescript --eslint --tailwind --app --import-alias="@/*" --src-dir',expected:{framework:"@storybook/experimental-nextjs-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},modifications:{mainConfig:{framework:"@storybook/experimental-nextjs-vite",features:{experimentalRSC:!0}},extraDependencies:["server-only","@storybook/experimental-nextjs-vite","vite"]},skipTasks:["e2e-tests-dev","bench"]},"react-vite/default-js":{name:"React Latest (Vite | JavaScript)",script:"npm create vite --yes {{beforeDir}} -- --template react",expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"react-vite/default-ts":{name:"React Latest (Vite | TypeScript)",script:"npm create vite --yes {{beforeDir}} -- --template react-ts",expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["bench"]},"react-vite/prerelease-ts":{name:"React Prerelease (Vite | TypeScript)",script:`
|
|
520
520
|
npm create vite --yes {{beforeDir}} -- --template react-ts && cd {{beforeDir}} && yarn add react@beta react-dom@beta && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
|
521
521
|
`,expected:{framework:"@storybook/react-vite",renderer:"@storybook/react",builder:"@storybook/builder-vite"},skipTasks:["e2e-tests-dev","bench"]},"react-webpack/18-ts":{name:"React Latest (Webpack | TypeScript)",script:"yarn create webpack5-react {{beforeDir}}",expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/17-ts":{name:"React v17 (Webpack | TypeScript)",script:'yarn create webpack5-react {{beforeDir}} --version-react="17" --version-react-dom="17"',expected:{framework:"@storybook/react-webpack5",renderer:"@storybook/react",builder:"@storybook/builder-webpack5"},skipTasks:["e2e-tests-dev","bench","vitest-integration"]},"react-webpack/prerelease-ts":{name:"React Prerelease (Webpack | TypeScript)",script:`
|
|
522
522
|
yarn create webpack5-react {{beforeDir}} --version-react="beta" --version-react-dom="beta" && cd {{beforeDir}} && jq '.resolutions += {"@types/react": "npm:types-react@beta", "@types/react-dom": "npm:types-react-dom@beta"}' package.json > tmp.json && mv tmp.json package.json && yarn add --dev @types/react@npm:types-react@beta @types/react-dom@npm:types-react-dom@beta
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "8.3.0-beta.
|
|
3
|
+
"version": "8.3.0-beta.2",
|
|
4
4
|
"description": "Storybook CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/core": "^7.24.4",
|
|
44
44
|
"@babel/types": "^7.24.0",
|
|
45
|
-
"@storybook/codemod": "8.3.0-beta.
|
|
45
|
+
"@storybook/codemod": "8.3.0-beta.2",
|
|
46
46
|
"@types/semver": "^7.3.4",
|
|
47
47
|
"chalk": "^4.1.0",
|
|
48
48
|
"commander": "^12.1.0",
|
|
49
|
-
"create-storybook": "8.3.0-beta.
|
|
49
|
+
"create-storybook": "8.3.0-beta.2",
|
|
50
50
|
"cross-spawn": "^7.0.3",
|
|
51
51
|
"envinfo": "^7.7.3",
|
|
52
52
|
"fd-package-json": "^1.2.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"leven": "^3.1.0",
|
|
60
60
|
"prompts": "^2.4.0",
|
|
61
61
|
"semver": "^7.3.7",
|
|
62
|
-
"storybook": "8.3.0-beta.
|
|
62
|
+
"storybook": "8.3.0-beta.2",
|
|
63
63
|
"tiny-invariant": "^1.3.1",
|
|
64
64
|
"ts-dedent": "^2.0.0"
|
|
65
65
|
},
|