Merge pull request #18285 from storybookjs/fix/framework-version-telemetry

Core: Use correct framework version in telemetry
This commit is contained in:
Michael Shilman 2022-05-20 17:53:03 +08:00 committed by GitHub
commit 8d3a7b6149
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { PackageJson } from '../types';
interface StorybookInfo {
framework: string;
version: string;
frameworkPackage: string;
configDir?: string;
mainConfig?: string;
previewConfig?: string;
@ -57,7 +58,7 @@ const getFrameworkInfo = (packageJson: PackageJson) => {
);
}
return { framework, version };
return { framework, version, frameworkPackage: pkg };
};
const validConfigExtensions = ['ts', 'js', 'tsx', 'jsx', 'mjs', 'cjs'];

View File

@ -187,9 +187,13 @@ export const computeStorybookMetadata = async ({
const hasStorybookEslint = !!allDependencies['eslint-plugin-storybook'];
const storybookInfo = getStorybookInfo(packageJson);
const storybookVersion =
storybookPackages[storybookInfo.frameworkPackage]?.version || storybookInfo.version;
return {
...metadata,
storybookVersion: storybookInfo.version,
storybookVersion,
language,
storybookPackages,
framework: {