Skip to content

Commit

Permalink
Telemetry: Add test packages
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed May 22, 2024
1 parent 0616c33 commit 16bea95
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions code/lib/telemetry/src/storybook-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ export const computeStorybookMetadata = async ({
};
}

const testPackages = [
'playwright',
'vitest',
'jest',
'cypress',
'nightwatch',
'webdriver',
'@web/test-runner',
'puppeteer',
'karma',
'jasmine',
'chai',
'testing-library',
'@ngneat/spectator',
'wdio',
];
const testPackageDeps = Object.keys(allDependencies).filter((dep) =>
testPackages.find((pkg) => dep.includes(pkg))
);
metadata.testPackages = Object.fromEntries(
await Promise.all(
testPackageDeps.map(async (dep) => [dep, (await getActualPackageVersion(dep))?.version])
)
);

const monorepoType = getMonorepoType();
if (monorepoType) {
metadata.monorepo = monorepoType;
Expand Down
1 change: 1 addition & 0 deletions code/lib/telemetry/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type StorybookMetadata = {
packageName: string;
version: string;
};
testPackages?: Record<string, string | undefined>;
hasStorybookEslint?: boolean;
hasStaticDirs?: boolean;
hasCustomWebpack?: boolean;
Expand Down
1 change: 1 addition & 0 deletions docs/configure/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Specifically, we track the following information in our telemetry events:
- Builder (e.g., Webpack5, Vite).
- Meta framework (e.g., [Next](https://nextjs.org/), [Gatsby](https://www.gatsbyjs.com/), [CRA](https://create-react-app.dev/)).
- [Addons](https://storybook.js.org/integrations) (e.g., [Essentials](../essentials/index.md), [Accessibility](https://storybook.js.org/addons/@storybook/addon-a11y/)).
- Testing tools (e.g. [Jest](https://jestjs.io/), [Vitest](https://vitest.dev/), [Playwright](https://playwright.dev/)).
- Package manager information (e.g., `npm`, `yarn`).
- Monorepo information (e.g., [NX](https://nx.dev/), [Turborepo](https://turborepo.org/)).
- In-app events (e.g., [Storybook guided tour](https://github.com/storybookjs/addon-onboarding)).
Expand Down

0 comments on commit 16bea95

Please sign in to comment.