@storybook/cli 0.0.0-pr-28288-sha-f4b255c5 → 0.0.0-pr-28255-sha-b988fb35
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/bin/index.js +1 -14
- package/dist/{block-storystorev6-2V4XGHW2.mjs → block-storystorev6-N6QNOLBD.mjs} +1 -1
- package/dist/generate.js +90 -95
- package/dist/generate.mjs +52 -57
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +9 -6
- package/dist/check.d.ts +0 -3
- package/dist/check.js +0 -24
- package/dist/check.mjs +0 -35
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var import_node_logger=require("@storybook/
|
|
1
|
+
"use strict";var import_node_logger=require("@storybook/node-logger");(0,import_node_logger.deprecate)("Exports from @storybook/cli are removed. Please import from @storybook/core-common instead.");
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/cli",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-28255-sha-b988fb35",
|
|
4
4
|
"description": "Storybook's CLI - install, dev, build, upgrade, and more",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -59,7 +59,14 @@
|
|
|
59
59
|
"@babel/core": "^7.24.4",
|
|
60
60
|
"@babel/types": "^7.24.0",
|
|
61
61
|
"@ndelangen/get-tarball": "^3.0.7",
|
|
62
|
-
"@storybook/codemod": "0.0.0-pr-
|
|
62
|
+
"@storybook/codemod": "0.0.0-pr-28255-sha-b988fb35",
|
|
63
|
+
"@storybook/core-common": "0.0.0-pr-28255-sha-b988fb35",
|
|
64
|
+
"@storybook/core-events": "0.0.0-pr-28255-sha-b988fb35",
|
|
65
|
+
"@storybook/core-server": "0.0.0-pr-28255-sha-b988fb35",
|
|
66
|
+
"@storybook/csf-tools": "0.0.0-pr-28255-sha-b988fb35",
|
|
67
|
+
"@storybook/node-logger": "0.0.0-pr-28255-sha-b988fb35",
|
|
68
|
+
"@storybook/telemetry": "0.0.0-pr-28255-sha-b988fb35",
|
|
69
|
+
"@storybook/types": "0.0.0-pr-28255-sha-b988fb35",
|
|
63
70
|
"@types/semver": "^7.3.4",
|
|
64
71
|
"@yarnpkg/fslib": "2.10.3",
|
|
65
72
|
"@yarnpkg/libzip": "2.3.0",
|
|
@@ -96,15 +103,11 @@
|
|
|
96
103
|
"strip-json-comments": "^3.1.1",
|
|
97
104
|
"typescript": "^5.3.2"
|
|
98
105
|
},
|
|
99
|
-
"peerDependencies": {
|
|
100
|
-
"@storybook/core": "^0.0.0-pr-28288-sha-f4b255c5"
|
|
101
|
-
},
|
|
102
106
|
"publishConfig": {
|
|
103
107
|
"access": "public"
|
|
104
108
|
},
|
|
105
109
|
"bundler": {
|
|
106
110
|
"entries": [
|
|
107
|
-
"./src/check.ts",
|
|
108
111
|
"./src/generate.ts",
|
|
109
112
|
"./src/index.ts"
|
|
110
113
|
],
|
package/dist/check.d.ts
DELETED
package/dist/check.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var check_exports={};__export(check_exports,{check:()=>check});module.exports=__toCommonJS(check_exports);var import_node_path=require("path"),import_prompts=__toESM(require("prompts")),import_find_up=__toESM(require("find-up")),import_node_os=require("os"),import_ts_dedent=require("ts-dedent"),import_execa=__toESM(require("execa")),import_fs_extra=require("fs-extra");function tryFindCore(){try{let found=require.resolve("@storybook/core");if(console.log("debugging: ",__dirname),console.log((0,import_node_os.tmpdir)()),!found.includes("node_modules")||found.includes("npx")||found.includes("pnpm/dlx"))return!0;let topLevelNodeModulesPath=found.split("node_modules")[0],projectPackageJsonPath=import_find_up.default.sync("package.json",{cwd:topLevelNodeModulesPath});if(!projectPackageJsonPath)return!0;let projectPackageJsonContents=(0,import_fs_extra.readJsonSync)(projectPackageJsonPath);return!![...Object.keys(projectPackageJsonContents?.devDependencies||{}),...Object.keys(projectPackageJsonContents?.dependencies||{}),...Object.keys(projectPackageJsonContents?.peerDependencies||{})].includes("@storybook/core")}catch{return console.log("debugging: ",__dirname),console.log((0,import_node_os.tmpdir)()),!1}}async function maybePrompt(){if(process.env.CI)return!1;let{runMigration}=await(0,import_prompts.default)({type:"confirm",initial:!0,name:"runMigration",message:import_ts_dedent.dedent`
|
|
2
|
-
We detected you have not installed storybook core. Did you upgrade storybook recently without running the upgrade command?
|
|
3
|
-
|
|
4
|
-
At the very least we need to have the @storybook/core package installed in the project.
|
|
5
|
-
We recommend running the following command to upgrade storybook:
|
|
6
|
-
> npx storybook@latest upgrade
|
|
7
|
-
|
|
8
|
-
If that is for some reason not an option for you, follow this guide:
|
|
9
|
-
https://storybook.js.org/docs/react/workflows/migrating-to-8-2/
|
|
10
|
-
|
|
11
|
-
Would you want to run the migration now?
|
|
12
|
-
(answering no will exit the process)
|
|
13
|
-
`});return runMigration}async function check(){let packageJson=await(0,import_fs_extra.readJSON)((0,import_node_path.join)(__dirname,"..","package.json"));if(tryFindCore())return!0;if(!await maybePrompt())return console.log(import_ts_dedent.dedent`
|
|
14
|
-
You opted not to run the automatic migration. Please install @storybook/core manually.
|
|
15
|
-
|
|
16
|
-
To understand this change, and why it was needed, read this guide:
|
|
17
|
-
https://storybook.js.org/docs/react/workflows/migrating-to-8-2/
|
|
18
|
-
`),!1;try{await(0,import_execa.default)("npx",["-p",`sb@${packageJson.version}`,"sb","automigrate"],{stdio:"inherit",env:{CI:"true"}})}catch{return console.log(import_ts_dedent.dedent`
|
|
19
|
-
The migration has failed. Please install @storybook/core manually.
|
|
20
|
-
`),!1}return console.log(import_ts_dedent.dedent`
|
|
21
|
-
Success! The migration has been completed. Please commit the changes to your project.
|
|
22
|
-
|
|
23
|
-
Then run the command again.
|
|
24
|
-
`),!1}0&&(module.exports={check});
|
package/dist/check.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { __require } from './chunk-LGGOBZAG.mjs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import prompts from 'prompts';
|
|
4
|
-
import findUp from 'find-up';
|
|
5
|
-
import { tmpdir } from 'node:os';
|
|
6
|
-
import { dedent } from 'ts-dedent';
|
|
7
|
-
import execa from 'execa';
|
|
8
|
-
import { readJSON, readJsonSync } from 'fs-extra';
|
|
9
|
-
|
|
10
|
-
function tryFindCore(){try{let found=__require.resolve("@storybook/core");if(console.log("debugging: ",__dirname),console.log(tmpdir()),!found.includes("node_modules")||found.includes("npx")||found.includes("pnpm/dlx"))return !0;let topLevelNodeModulesPath=found.split("node_modules")[0],projectPackageJsonPath=findUp.sync("package.json",{cwd:topLevelNodeModulesPath});if(!projectPackageJsonPath)return !0;let projectPackageJsonContents=readJsonSync(projectPackageJsonPath);return !![...Object.keys(projectPackageJsonContents?.devDependencies||{}),...Object.keys(projectPackageJsonContents?.dependencies||{}),...Object.keys(projectPackageJsonContents?.peerDependencies||{})].includes("@storybook/core")}catch{return console.log("debugging: ",__dirname),console.log(tmpdir()),!1}}async function maybePrompt(){if(process.env.CI)return !1;let{runMigration}=await prompts({type:"confirm",initial:!0,name:"runMigration",message:dedent`
|
|
11
|
-
We detected you have not installed storybook core. Did you upgrade storybook recently without running the upgrade command?
|
|
12
|
-
|
|
13
|
-
At the very least we need to have the @storybook/core package installed in the project.
|
|
14
|
-
We recommend running the following command to upgrade storybook:
|
|
15
|
-
> npx storybook@latest upgrade
|
|
16
|
-
|
|
17
|
-
If that is for some reason not an option for you, follow this guide:
|
|
18
|
-
https://storybook.js.org/docs/react/workflows/migrating-to-8-2/
|
|
19
|
-
|
|
20
|
-
Would you want to run the migration now?
|
|
21
|
-
(answering no will exit the process)
|
|
22
|
-
`});return runMigration}async function check(){let packageJson=await readJSON(join(__dirname,"..","package.json"));if(tryFindCore())return !0;if(!await maybePrompt())return console.log(dedent`
|
|
23
|
-
You opted not to run the automatic migration. Please install @storybook/core manually.
|
|
24
|
-
|
|
25
|
-
To understand this change, and why it was needed, read this guide:
|
|
26
|
-
https://storybook.js.org/docs/react/workflows/migrating-to-8-2/
|
|
27
|
-
`),!1;try{await execa("npx",["-p",`sb@${packageJson.version}`,"sb","automigrate"],{stdio:"inherit",env:{CI:"true"}});}catch{return console.log(dedent`
|
|
28
|
-
The migration has failed. Please install @storybook/core manually.
|
|
29
|
-
`),!1}return console.log(dedent`
|
|
30
|
-
Success! The migration has been completed. Please commit the changes to your project.
|
|
31
|
-
|
|
32
|
-
Then run the command again.
|
|
33
|
-
`),!1}
|
|
34
|
-
|
|
35
|
-
export { check };
|