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: Run yarn-deduplicate #5951

Merged
merged 3 commits into from
Oct 13, 2022
Merged

build: Run yarn-deduplicate #5951

merged 3 commits into from
Oct 13, 2022

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Oct 13, 2022

Retry of #5747

Use https://github.com/atlassian/yarn-deduplicate to make sure we dedupe deps properly. This should help speed up CI times since we don't have to cache as much stuff.

Had to adjust Svelte tests because was getting the follow error:

FAIL  test/sdk.test.ts
  ● Test suite failed to run

    Failed to get mock metadata: /Users/abhijeetprasad/workspace/sentry-javascript/packages/browser/build/npm/cjs/index.js

    See: https://jestjs.io/docs/manual-mocks#content

    > 1 | import { addGlobalEventProcessor, init as browserInitRaw, SDK_VERSION } from '@sentry/browser';
        | ^
      2 | import { EventProcessor } from '@sentry/types';
      3 |
      4 | import { detectAndReportSvelteKit, init as svelteInit, isSvelteKitApp } from '../src/sdk';

      at Runtime._generateMock (../../node_modules/jest-runtime/build/index.js:1901:15)
      at Object.<anonymous> (test/sdk.test.ts:1:1)
      at TestScheduler.scheduleTests (../../node_modules/@jest/core/build/TestScheduler.js:333:13)
      at runJest (../../node_modules/@jest/core/build/runJest.js:404:19)
      at _run10000 (../../node_modules/@jest/core/build/cli/index.js:320:7)
      at runCLI (../../node_modules/@jest/core/build/cli/index.js:173:3)

Edit: also had to adjust the Gatsby tests because of the same.

Prev: #3798

@getsentry getsentry deleted a comment from github-actions bot Oct 13, 2022
@AbhiPrasad AbhiPrasad merged commit 80dd0e1 into master Oct 13, 2022
@AbhiPrasad AbhiPrasad deleted the abhi-npx-dedup-oct-2022 branch October 13, 2022 21:12
AbhiPrasad pushed a commit that referenced this pull request Oct 27, 2022
…'` to CJS files (#6043)

As of version 2.69.0, setting `output.generatedCode` to `'es2015'` (as we do) causes Rollup to [add `[Symbol.toStringTag]: 'Module'` to generated CJS files](rollup/rollup#4378 (comment)). Though this is valid ES6, it causes Jest to be unable to mock our generated packages.

Though [a PR](jestjs/jest#13513) has been opened to fix this, the change almost certainly won't be backported, so anyone using Jest 29.2.2 or under will run into [this problem](#5994) if they try to mock `@sentry/xxx` 7.16. (The relevant change was introduced in #5951, when we (semi-)accidentally upgraded Rollup from 2.67.1 to 2.78.0, and was first included in version 7.16.) 

This PR prevents the new Rollup behavior, since it has no known benefit. (The [Rollup docs](https://rollupjs.org/guide/en/#outputgeneratedcode) say that presence of the `'Module'` toStringTag "is used for feature detection in certain libraries and frameworks," but not having it hasn't seemed to hurt us so far.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants