storybook 9.0.0-alpha.7 → 9.0.0-alpha.8

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.
@@ -1,7 +1,27 @@
1
1
  import { TypescriptOptions, StorybookConfig, PackageJson } from 'storybook/internal/types';
2
2
  import { BinaryLike } from 'crypto';
3
3
 
4
- declare type PM = "npm" | "yarn" | "pnpm" | "bun";
4
+ type Agent = 'npm' | 'yarn' | 'yarn@berry' | 'pnpm' | 'pnpm@6' | 'bun' | 'deno';
5
+ type AgentName = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'deno';
6
+ interface DetectResult {
7
+ /**
8
+ * Agent name without the specifier.
9
+ *
10
+ * Can be `npm`, `yarn`, `pnpm`, `bun`, or `deno`.
11
+ */
12
+ name: AgentName;
13
+ /**
14
+ * Agent specifier to resolve the command.
15
+ *
16
+ * May contain '@' to differentiate the version (e.g. 'yarn@berry').
17
+ * Use `name` for the agent name without the specifier.
18
+ */
19
+ agent: Agent;
20
+ /**
21
+ * Specific version of the agent, read from `packageManager` field in package.json.
22
+ */
23
+ version?: string;
24
+ }
5
25
 
6
26
  declare const monorepoConfigs: {
7
27
  readonly Nx: "nx.json";
@@ -33,8 +53,9 @@ type StorybookMetadata = {
33
53
  renderer?: string;
34
54
  monorepo?: MonorepoType;
35
55
  packageManager?: {
36
- type: PM;
37
- version: string;
56
+ type: DetectResult['name'];
57
+ version: DetectResult['version'];
58
+ agent: DetectResult['agent'];
38
59
  };
39
60
  typescriptOptions?: Partial<TypescriptOptions>;
40
61
  addons?: Record<string, StorybookAddon>;
@@ -82,7 +103,7 @@ declare const sanitizeAddonName: (name: string) => string;
82
103
  declare const computeStorybookMetadata: ({ packageJsonPath, packageJson, mainConfig, }: {
83
104
  packageJsonPath: string;
84
105
  packageJson: PackageJson;
85
- mainConfig: StorybookConfig & Record<string, any>;
106
+ mainConfig?: StorybookConfig & Record<string, any>;
86
107
  }) => Promise<StorybookMetadata>;
87
108
  declare const getStorybookMetadata: (_configDir?: string) => Promise<StorybookMetadata>;
88
109