@storybook/cli 0.0.0-pr-29643-sha-7f596df3 → 0.0.0-pr-29643-sha-de6b1f23
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 +7 -7
- package/package.json +4 -4
package/dist/bin/index.cjs
CHANGED
|
@@ -100,13 +100,13 @@ ${packageVersions.join(", ")}`),acc},{critical:[],trivial:[]});return critical.l
|
|
|
100
100
|
`));else{let list=installationMetadata?getDuplicatedDepsWarnings(installationMetadata):getDuplicatedDepsWarnings();Array.isArray(list)&&list.length>0&&logDiagnostic("Duplicated dependencies found",list?.join(`
|
|
101
101
|
`))}}let commandMessage=`You can always recheck the health of your project by running:
|
|
102
102
|
${import_picocolors5.default.cyan("npx storybook doctor")}`;logger2.info(),foundIssues?(logger2.info(commandMessage),logger2.info(),logger2.info(`Full logs are available in ${import_picocolors5.default.cyan(LOG_FILE_PATH)}`),await(0,import_promises.rename)(TEMP_LOG_FILE_PATH,(0,import_node_path3.join)(process.cwd(),LOG_FILE_NAME))):(logger2.info("\u{1F973} Your Storybook project looks good!"),logger2.info(commandMessage),await(0,import_promises.rm)(TEMP_LOG_FILE_PATH,{recursive:!0,force:!0})),logger2.info(),cleanup()};var import_fs=require("fs"),jscodeshift=__toESM(require("jscodeshift"),1),import_path=__toESM(require("path"),1),import_picocolors6=__toESM(require_picocolors(),1),import_ts_dedent4=require("ts-dedent");var vitestFileExtensions=[".js",".ts",".cts",".mts",".cjs",".mjs"],addonA11yAddonTest={id:"addonA11yAddonTest",versionRange:["<8.5.0","*"],promptType(result){return result.setupFile===null?"manual":"auto"},async check({mainConfig,configDir}){let addons=getAddonNames(mainConfig),hasA11yAddon=!!addons.find(addon=>addon.includes("@storybook/addon-a11y")),hasTestAddon=!!addons.find(addon=>addon.includes("@storybook/experimental-addon-test"));if(!hasA11yAddon||!hasTestAddon||!configDir)return null;let vitestSetupFile=vitestFileExtensions.map(ext=>import_path.default.join(configDir,`vitest.setup${ext}`)).find(filePath=>(0,import_fs.existsSync)(filePath))??null;try{if(vitestSetupFile){let transformedSetupCode=transformSetupFile(vitestSetupFile);return{setupFile:vitestSetupFile,transformedSetupCode}}else return{setupFile:null,transformedSetupCode:null}}catch{return{setupFile:vitestSetupFile,transformedSetupCode:null}}},prompt({setupFile,transformedSetupCode}){let introduction=import_ts_dedent4.dedent`
|
|
103
|
-
We have detected that you have addon-a11y and experimental-addon-test installed.
|
|
103
|
+
We have detected that you have ${import_picocolors6.default.magenta("@storybook/addon-a11y")} and ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} installed.
|
|
104
104
|
|
|
105
|
-
${import_picocolors6.default.
|
|
105
|
+
${import_picocolors6.default.magenta("@storybook/addon-a11y")} integrates now with ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
|
|
106
106
|
`;if(setupFile===null||transformedSetupCode===null)return import_ts_dedent4.dedent`
|
|
107
107
|
${introduction}
|
|
108
108
|
|
|
109
|
-
We couldn't find or automatically update your .storybook/vitest.setup.<ts|js> in your project to smoothly set up project annotations from addon-a11y.
|
|
109
|
+
We couldn't find or automatically update your ${import_picocolors6.default.cyan(".storybook/vitest.setup.<ts|js>")} in your project to smoothly set up project annotations from ${import_picocolors6.default.magenta("@storybook/addon-a11y")}.
|
|
110
110
|
Please manually update your vitest.setup.ts file to include the following:
|
|
111
111
|
|
|
112
112
|
${import_picocolors6.default.gray("...")}
|
|
@@ -122,12 +122,12 @@ ${import_picocolors5.default.cyan("npx storybook doctor")}`;logger2.info(),found
|
|
|
122
122
|
For more information, please refer to the addon test documentation:
|
|
123
123
|
${import_picocolors6.default.cyan("https://storybook.js.org/docs/writing-tests/addon-test")}
|
|
124
124
|
`;let fileExtension=import_path.default.extname(setupFile);return import_ts_dedent4.dedent`
|
|
125
|
-
We have detected that you have addon-a11y and experimental-addon-test installed.
|
|
125
|
+
We have detected that you have ${import_picocolors6.default.magenta("@storybook/addon-a11y")} and ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} installed.
|
|
126
126
|
|
|
127
|
-
${import_picocolors6.default.
|
|
127
|
+
${import_picocolors6.default.magenta("@storybook/addon-a11y")} integrates now with ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
`},async run({result}){let{setupFile,transformedSetupCode}=result;!setupFile||!transformedSetupCode||(0,import_fs.writeFileSync)(setupFile,transformedSetupCode,"utf8")}};function transformSetupFile(setupFile){let source=(0,import_fs.readFileSync)(setupFile,"utf8"),j=jscodeshift.withParser("ts"),root=j(source),importDeclaration=j.importDeclaration([j.importNamespaceSpecifier(j.identifier("a11yAddonAnnotations"))],j.literal("@storybook/addon-a11y/preview")),setProjectAnnotationsCall=root.find(j.CallExpression,{callee:{type:"Identifier",name:"setProjectAnnotations"}});if(setProjectAnnotationsCall.length===0)throw new Error("Could not find setProjectAnnotations call in vitest.setup file");return setProjectAnnotationsCall.find(j.ArrayExpression).forEach(p=>{p.value.elements.
|
|
129
|
+
In order for these checks to be enabled we have to update your ${import_picocolors6.default.cyan(`.storybook/vitest.setup${fileExtension}`)} file.
|
|
130
|
+
`},async run({result}){let{setupFile,transformedSetupCode}=result;!setupFile||!transformedSetupCode||(0,import_fs.writeFileSync)(setupFile,transformedSetupCode,"utf8")}};function transformSetupFile(setupFile){let source=(0,import_fs.readFileSync)(setupFile,"utf8"),j=jscodeshift.withParser("ts"),root=j(source),importDeclaration=j.importDeclaration([j.importNamespaceSpecifier(j.identifier("a11yAddonAnnotations"))],j.literal("@storybook/addon-a11y/preview")),setProjectAnnotationsCall=root.find(j.CallExpression,{callee:{type:"Identifier",name:"setProjectAnnotations"}});if(setProjectAnnotationsCall.length===0)throw new Error("Could not find setProjectAnnotations call in vitest.setup file");return setProjectAnnotationsCall.find(j.ArrayExpression).forEach(p=>{p.value.elements.unshift(j.identifier("a11yAddonAnnotations"))}),root.get().node.program.body.unshift(importDeclaration),root.toSource()}var import_picocolors7=__toESM(require_picocolors(),1),import_ts_dedent5=require("ts-dedent");var addonPostCSS={id:"addon-postcss",versionRange:["*","*"],promptType:"notification",async check({mainConfig}){return!getAddonNames(mainConfig).find(addon=>addon.includes("@storybook/addon-postcss"))?null:{hasAddonPostcss:!0}},prompt(){return import_ts_dedent5.dedent`
|
|
131
131
|
${import_picocolors7.default.bold("Attention")}: We've detected that you're using the following package which is incompatible with Storybook 8 and beyond:
|
|
132
132
|
|
|
133
133
|
- ${import_picocolors7.default.cyan("@storybook/addon-postcss")}
|
package/dist/bin/index.js
CHANGED
|
@@ -85,13 +85,13 @@ ${packageVersions.join(", ")}`),acc},{critical:[],trivial:[]});return critical.l
|
|
|
85
85
|
`));else {let list=installationMetadata?getDuplicatedDepsWarnings(installationMetadata):getDuplicatedDepsWarnings();Array.isArray(list)&&list.length>0&&logDiagnostic("Duplicated dependencies found",list?.join(`
|
|
86
86
|
`));}}let commandMessage=`You can always recheck the health of your project by running:
|
|
87
87
|
${import_picocolors5.default.cyan("npx storybook doctor")}`;logger2.info(),foundIssues?(logger2.info(commandMessage),logger2.info(),logger2.info(`Full logs are available in ${import_picocolors5.default.cyan(LOG_FILE_PATH)}`),await rename(TEMP_LOG_FILE_PATH,join(process.cwd(),LOG_FILE_NAME))):(logger2.info("\u{1F973} Your Storybook project looks good!"),logger2.info(commandMessage),await rm(TEMP_LOG_FILE_PATH,{recursive:!0,force:!0})),logger2.info(),cleanup();};var import_picocolors6=__toESM(require_picocolors(),1);var vitestFileExtensions=[".js",".ts",".cts",".mts",".cjs",".mjs"],addonA11yAddonTest={id:"addonA11yAddonTest",versionRange:["<8.5.0","*"],promptType(result){return result.setupFile===null?"manual":"auto"},async check({mainConfig,configDir}){let addons=getAddonNames(mainConfig),hasA11yAddon=!!addons.find(addon=>addon.includes("@storybook/addon-a11y")),hasTestAddon=!!addons.find(addon=>addon.includes("@storybook/experimental-addon-test"));if(!hasA11yAddon||!hasTestAddon||!configDir)return null;let vitestSetupFile=vitestFileExtensions.map(ext=>path.join(configDir,`vitest.setup${ext}`)).find(filePath=>existsSync$1(filePath))??null;try{if(vitestSetupFile){let transformedSetupCode=transformSetupFile(vitestSetupFile);return {setupFile:vitestSetupFile,transformedSetupCode}}else return {setupFile:null,transformedSetupCode:null}}catch{return {setupFile:vitestSetupFile,transformedSetupCode:null}}},prompt({setupFile,transformedSetupCode}){let introduction=dedent`
|
|
88
|
-
We have detected that you have addon-a11y and experimental-addon-test installed.
|
|
88
|
+
We have detected that you have ${import_picocolors6.default.magenta("@storybook/addon-a11y")} and ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} installed.
|
|
89
89
|
|
|
90
|
-
${import_picocolors6.default.
|
|
90
|
+
${import_picocolors6.default.magenta("@storybook/addon-a11y")} integrates now with ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
|
|
91
91
|
`;if(setupFile===null||transformedSetupCode===null)return dedent`
|
|
92
92
|
${introduction}
|
|
93
93
|
|
|
94
|
-
We couldn't find or automatically update your .storybook/vitest.setup.<ts|js> in your project to smoothly set up project annotations from addon-a11y.
|
|
94
|
+
We couldn't find or automatically update your ${import_picocolors6.default.cyan(".storybook/vitest.setup.<ts|js>")} in your project to smoothly set up project annotations from ${import_picocolors6.default.magenta("@storybook/addon-a11y")}.
|
|
95
95
|
Please manually update your vitest.setup.ts file to include the following:
|
|
96
96
|
|
|
97
97
|
${import_picocolors6.default.gray("...")}
|
|
@@ -107,12 +107,12 @@ ${import_picocolors5.default.cyan("npx storybook doctor")}`;logger2.info(),found
|
|
|
107
107
|
For more information, please refer to the addon test documentation:
|
|
108
108
|
${import_picocolors6.default.cyan("https://storybook.js.org/docs/writing-tests/addon-test")}
|
|
109
109
|
`;let fileExtension=path.extname(setupFile);return dedent`
|
|
110
|
-
We have detected that you have addon-a11y and experimental-addon-test installed.
|
|
110
|
+
We have detected that you have ${import_picocolors6.default.magenta("@storybook/addon-a11y")} and ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} installed.
|
|
111
111
|
|
|
112
|
-
${import_picocolors6.default.
|
|
112
|
+
${import_picocolors6.default.magenta("@storybook/addon-a11y")} integrates now with ${import_picocolors6.default.magenta("@storybook/experimental-addon-test")} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
|
|
113
113
|
|
|
114
|
-
|
|
115
|
-
`},async run({result}){let{setupFile,transformedSetupCode}=result;!setupFile||!transformedSetupCode||writeFileSync(setupFile,transformedSetupCode,"utf8");}};function transformSetupFile(setupFile){let source=readFileSync(setupFile,"utf8"),j=jscodeshift.withParser("ts"),root=j(source),importDeclaration=j.importDeclaration([j.importNamespaceSpecifier(j.identifier("a11yAddonAnnotations"))],j.literal("@storybook/addon-a11y/preview")),setProjectAnnotationsCall=root.find(j.CallExpression,{callee:{type:"Identifier",name:"setProjectAnnotations"}});if(setProjectAnnotationsCall.length===0)throw new Error("Could not find setProjectAnnotations call in vitest.setup file");return setProjectAnnotationsCall.find(j.ArrayExpression).forEach(p=>{p.value.elements.
|
|
114
|
+
In order for these checks to be enabled we have to update your ${import_picocolors6.default.cyan(`.storybook/vitest.setup${fileExtension}`)} file.
|
|
115
|
+
`},async run({result}){let{setupFile,transformedSetupCode}=result;!setupFile||!transformedSetupCode||writeFileSync(setupFile,transformedSetupCode,"utf8");}};function transformSetupFile(setupFile){let source=readFileSync(setupFile,"utf8"),j=jscodeshift.withParser("ts"),root=j(source),importDeclaration=j.importDeclaration([j.importNamespaceSpecifier(j.identifier("a11yAddonAnnotations"))],j.literal("@storybook/addon-a11y/preview")),setProjectAnnotationsCall=root.find(j.CallExpression,{callee:{type:"Identifier",name:"setProjectAnnotations"}});if(setProjectAnnotationsCall.length===0)throw new Error("Could not find setProjectAnnotations call in vitest.setup file");return setProjectAnnotationsCall.find(j.ArrayExpression).forEach(p=>{p.value.elements.unshift(j.identifier("a11yAddonAnnotations"));}),root.get().node.program.body.unshift(importDeclaration),root.toSource()}var import_picocolors7=__toESM(require_picocolors(),1);var addonPostCSS={id:"addon-postcss",versionRange:["*","*"],promptType:"notification",async check({mainConfig}){return !getAddonNames(mainConfig).find(addon=>addon.includes("@storybook/addon-postcss"))?null:{hasAddonPostcss:!0}},prompt(){return dedent`
|
|
116
116
|
${import_picocolors7.default.bold("Attention")}: We've detected that you're using the following package which is incompatible with Storybook 8 and beyond:
|
|
117
117
|
|
|
118
118
|
- ${import_picocolors7.default.cyan("@storybook/addon-postcss")}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "0.0.0-pr-29643-sha-
|
|
3
|
+
"version": "0.0.0-pr-29643-sha-de6b1f23",
|
|
4
4
|
"description": "Storybook CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@babel/core": "^7.24.4",
|
|
44
44
|
"@babel/types": "^7.24.0",
|
|
45
|
-
"@storybook/codemod": "0.0.0-pr-29643-sha-
|
|
45
|
+
"@storybook/codemod": "0.0.0-pr-29643-sha-de6b1f23",
|
|
46
46
|
"@types/semver": "^7.3.4",
|
|
47
47
|
"commander": "^12.1.0",
|
|
48
|
-
"create-storybook": "0.0.0-pr-29643-sha-
|
|
48
|
+
"create-storybook": "0.0.0-pr-29643-sha-de6b1f23",
|
|
49
49
|
"cross-spawn": "^7.0.3",
|
|
50
50
|
"envinfo": "^7.7.3",
|
|
51
51
|
"fd-package-json": "^1.2.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"leven": "^3.1.0",
|
|
58
58
|
"prompts": "^2.4.0",
|
|
59
59
|
"semver": "^7.3.7",
|
|
60
|
-
"storybook": "0.0.0-pr-29643-sha-
|
|
60
|
+
"storybook": "0.0.0-pr-29643-sha-de6b1f23",
|
|
61
61
|
"tiny-invariant": "^1.3.1",
|
|
62
62
|
"ts-dedent": "^2.0.0"
|
|
63
63
|
},
|