Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: Bundle lib/telemetry with ts-up #19317

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

tolkadot
Copy link
Contributor

@tolkadot tolkadot commented Oct 2, 2022

Issue:

Reference: #18732

This is my first contribution to this repo.
If possible could you add the "hacktoberfest -accepted" label to this pr?

What I did

update to /code/lib/telemetry/package.json in line with instructions here

After re-building the telemetry package, I verified that the three index files were present.

After updates to package.json here are the outputs of :

yarn build 

✔ Select the packages to build › @storybook/telemetry
@storybook/telemetry:
skipping generating types for ./src/index.ts
@storybook/telemetry:
CLI Building entry: /storybook/code/lib/telemetry/src/index.ts
@storybook/telemetry:
CLI Using tsconfig: tsconfig.json
@storybook/telemetry:
CLI tsup v6.2.3
@storybook/telemetry:
CLI Target: node14
@storybook/telemetry:
CLI Building entry: /storybook/code/lib/telemetry/src/index.ts
@storybook/telemetry:
CLI Using tsconfig: tsconfig.json
@storybook/telemetry:
CLI tsup v6.2.3
@storybook/telemetry:
CLI Target: chrome100
@storybook/telemetry:
CLI Cleaning output folder
@storybook/telemetry:
CLI Cleaning output folder
@storybook/telemetry:
CJS Build start
@storybook/telemetry:
CJS You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
@storybook/telemetry:
ESM Build start
@storybook/telemetry:
ESM You have emitDecoratorMetadata enabled but @swc/core was not installed, skipping swc plugin
@storybook/telemetry:
CJS dist/index.js 13.85 KB
@storybook/telemetry:
CJS ⚡️ Build success in 44ms
@storybook/telemetry:
ESM dist/index.mjs 11.66 KB
@storybook/telemetry:
ESM ⚡️ Build success in 36ms
yarn check 
@storybook/telemetry:
16:05:08 - Starting compilation in watch mode...

@storybook/telemetry:

16:05:12 - Found 0 errors. Watching for file changes.
/storybook/code   update-lib-telemetry  yarn test
Test Suites: 1 skipped, 169 passed, 169 of 170 total
Tests:       10 skipped, 2087 passed, 2097 total
Snapshots:   477 passed, 477 total
Time:        18.111 s
Ran all test suites.
/storybook/code   update-lib-telemetry  yarn test telemetry
 PASS  lib/telemetry/src/telemetry.test.ts
 PASS  lib/telemetry/src/storybook-metadata.test.ts
 PASS  lib/telemetry/src/get-monorepo-type.test.ts
 PASS  lib/telemetry/src/sanitize.test.ts

Test Suites: 4 passed, 4 total
Tests:       32 passed, 32 total
Snapshots:   2 passed, 2 total
Time:        1.979 s
Ran all test suites matching /telemetry/i.

I then verified that the telemetry is being generated in /code/examples/react-ts

STORYBOOK_DEBUG_TELEMETRY=true yarn storybook

@storybook/cli v7.0.0-alpha.34

info => Loading presets
info => Loading presets
info => Loading presets
info => Starting manager..
info Addon-docs: using MDX2
info => Using implicit CSS loaders
info => Using default Webpack5 setup
<i> [webpack-dev-middleware] wait until bundle finished
37% building 1/2 entries 81/118 dependencies 11/48 modules
[telemetry]
{
  "eventType": "start",
  "payload": {
    "storyIndex": {
      "storyCount": 28,
      "version": 4
    }
  },
  "metadata": {
    "generatedAt": 1664687535191,
    "builder": {
      "name": "webpack5"
    },
    "hasCustomBabel": false,
    "hasCustomWebpack": false,
    "hasStaticDirs": false,
    "hasStorybookEslint": false,
    "refCount": 0,
    "packageManager": {
      "type": "yarn",
      "version": "3.2.1"
    },
    "typescriptOptions": {
      "check": true,
      "checkOptions": {},
      "reactDocgenTypescriptOptions": {}
    },
    "features": {
      "postcss": false,
      "storyStoreV7": true,
      "buildStoriesJson": true,
      "babelModeV7": true,
      "warnOnLegacyHierarchySeparator": false,
      "previewMdx2": true,
      "breakingChangesV7": true
    },
    "storybookVersion": "7.0.0-alpha.34",
    "language": "typescript",
    "storybookPackages": {
      "@storybook/addons": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/cli": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/components": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/react": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/react-webpack5": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/theming": {
        "version": "7.0.0-alpha.34"
      },
      "storybook": {
        "version": "7.0.0-alpha.34"
      }
    },
    "framework": {
      "name": "react"
    },
    "addons": {
      "@storybook/addon-essentials": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/addon-storysource": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/addon-storyshots": {
        "version": "7.0.0-alpha.34"
      },
      "@storybook/addon-a11y": {
        "version": "7.0.0-alpha.34"
      }
    }
  }
}

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@tolkadot tolkadot marked this pull request as ready for review October 2, 2022 05:44
@IanVS IanVS added maintenance User-facing maintenance tasks hacktoberfest-accepted labels Oct 2, 2022
Copy link
Member

@IanVS IanVS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@ndelangen ndelangen changed the title chore(telemetry): update package.json paths for compatibility with ts-up Build: Bundle lib/telemetry with ts-up Oct 3, 2022
@ndelangen ndelangen self-assigned this Oct 3, 2022
@ndelangen ndelangen merged commit b2ad45c into storybookjs:next Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants