From d8101c055147a8e2d02616fb109cf79689d59218 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 30 Nov 2021 21:24:40 -0500 Subject: [PATCH 01/11] ref(tracing): Make integrations tree shakeable --- packages/nextjs/src/index.client.ts | 3 +-- packages/tracing/src/index.ts | 8 ++++---- packages/tracing/src/integrationsbundle.ts | 2 ++ 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 packages/tracing/src/integrationsbundle.ts diff --git a/packages/nextjs/src/index.client.ts b/packages/nextjs/src/index.client.ts index 970cadb00a06..e2423055a877 100644 --- a/packages/nextjs/src/index.client.ts +++ b/packages/nextjs/src/index.client.ts @@ -1,5 +1,5 @@ import { configureScope, init as reactInit, Integrations as BrowserIntegrations } from '@sentry/react'; -import { defaultRequestInstrumentationOptions, Integrations as TracingIntegrations } from '@sentry/tracing'; +import { BrowserTracing, defaultRequestInstrumentationOptions } from '@sentry/tracing'; import { nextRouterInstrumentation } from './performance/client'; import { MetadataBuilder } from './utils/metadataBuilder'; @@ -9,7 +9,6 @@ import { addIntegration, UserIntegrations } from './utils/userIntegrations'; export * from '@sentry/react'; export { nextRouterInstrumentation } from './performance/client'; -const { BrowserTracing } = TracingIntegrations; export const Integrations = { ...BrowserIntegrations, BrowserTracing }; /** Inits the Sentry NextJS SDK on the browser with the React SDK. */ diff --git a/packages/tracing/src/index.ts b/packages/tracing/src/index.ts index 608bd0630810..e97d7b76ad77 100644 --- a/packages/tracing/src/index.ts +++ b/packages/tracing/src/index.ts @@ -1,10 +1,10 @@ -import { BrowserTracing } from './browser'; import { addExtensionMethods } from './hubextensions'; -import * as TracingIntegrations from './integrations'; - -const Integrations = { ...TracingIntegrations, BrowserTracing }; +import * as Integrations from './integrationsbundle'; export { Integrations }; + +export { BrowserTracing } from './browser'; + export { Span } from './span'; export { Transaction } from './transaction'; export { diff --git a/packages/tracing/src/integrationsbundle.ts b/packages/tracing/src/integrationsbundle.ts new file mode 100644 index 000000000000..b1a40f6d634f --- /dev/null +++ b/packages/tracing/src/integrationsbundle.ts @@ -0,0 +1,2 @@ +export * from './integrations'; +export { BrowserTracing } from './browser'; From 8adf3ec14e37980cd511819c9991241bf1ccce95 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 1 Dec 2021 07:37:47 -0500 Subject: [PATCH 02/11] test: Add browser based scenarios (#4100) --- .eslintrc.js | 9 + .gitignore | 1 + packages/eslint-config-sdk/src/index.js | 7 + .../browser/basic-capture-exception/index.js | 7 + .../basic-capture-exception/package.json | 5 + .../browser/basic-capture-message/index.js | 7 + .../basic-capture-message/package.json | 5 + .../browser/basic-custom-integration/index.js | 23 + .../basic-custom-integration/package.json | 5 + .../browser/basic-custom-transport/index.js | 22 + .../basic-custom-transport/package.json | 5 + .../browser/basic-no-client-reports/index.js | 6 + .../basic-no-client-reports/package.json | 5 + .../basic-no-default-integrations/index.js | 6 + .../package.json | 5 + scenarios/browser/basic-no-dsn/index.js | 3 + scenarios/browser/basic-no-dsn/package.json | 5 + scenarios/browser/basic-no-sessions/index.js | 7 + .../browser/basic-no-sessions/package.json | 5 + scenarios/browser/basic-with-debug/index.js | 6 + .../browser/basic-with-debug/package.json | 5 + .../browser/basic-with-sessions/index.js | 6 + .../browser/basic-with-sessions/package.json | 5 + scenarios/browser/basic-with-tunnel/index.js | 6 + .../browser/basic-with-tunnel/package.json | 5 + scenarios/browser/basic/index.js | 5 + scenarios/browser/basic/package.json | 5 + scenarios/browser/nextjs-client/index.js | 5 + scenarios/browser/nextjs-client/package.json | 8 + scenarios/browser/package.json | 11 + scenarios/browser/perf-auto/index.js | 8 + scenarios/browser/perf-auto/package.json | 5 + scenarios/browser/perf-manual/index.js | 13 + scenarios/browser/perf-manual/package.json | 5 + scenarios/browser/react/index.js | 19 + scenarios/browser/react/package.json | 9 + scenarios/browser/webpack.js | 69 ++ scenarios/browser/yarn.lock | 817 ++++++++++++++++++ 38 files changed, 1150 insertions(+) create mode 100644 scenarios/browser/basic-capture-exception/index.js create mode 100644 scenarios/browser/basic-capture-exception/package.json create mode 100644 scenarios/browser/basic-capture-message/index.js create mode 100644 scenarios/browser/basic-capture-message/package.json create mode 100644 scenarios/browser/basic-custom-integration/index.js create mode 100644 scenarios/browser/basic-custom-integration/package.json create mode 100644 scenarios/browser/basic-custom-transport/index.js create mode 100644 scenarios/browser/basic-custom-transport/package.json create mode 100644 scenarios/browser/basic-no-client-reports/index.js create mode 100644 scenarios/browser/basic-no-client-reports/package.json create mode 100644 scenarios/browser/basic-no-default-integrations/index.js create mode 100644 scenarios/browser/basic-no-default-integrations/package.json create mode 100644 scenarios/browser/basic-no-dsn/index.js create mode 100644 scenarios/browser/basic-no-dsn/package.json create mode 100644 scenarios/browser/basic-no-sessions/index.js create mode 100644 scenarios/browser/basic-no-sessions/package.json create mode 100644 scenarios/browser/basic-with-debug/index.js create mode 100644 scenarios/browser/basic-with-debug/package.json create mode 100644 scenarios/browser/basic-with-sessions/index.js create mode 100644 scenarios/browser/basic-with-sessions/package.json create mode 100644 scenarios/browser/basic-with-tunnel/index.js create mode 100644 scenarios/browser/basic-with-tunnel/package.json create mode 100644 scenarios/browser/basic/index.js create mode 100644 scenarios/browser/basic/package.json create mode 100644 scenarios/browser/nextjs-client/index.js create mode 100644 scenarios/browser/nextjs-client/package.json create mode 100644 scenarios/browser/package.json create mode 100644 scenarios/browser/perf-auto/index.js create mode 100644 scenarios/browser/perf-auto/package.json create mode 100644 scenarios/browser/perf-manual/index.js create mode 100644 scenarios/browser/perf-manual/package.json create mode 100644 scenarios/browser/react/index.js create mode 100644 scenarios/browser/react/package.json create mode 100644 scenarios/browser/webpack.js create mode 100644 scenarios/browser/yarn.lock diff --git a/.eslintrc.js b/.eslintrc.js index f9309d2f0f34..e8f875b4bd27 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -31,5 +31,14 @@ module.exports = { 'jsdoc/require-jsdoc': 'off', }, }, + { + files: ["scenarios/**"], + parserOptions: { + sourceType: "module", + }, + rules: { + "no-console": "off", + }, + }, ], }; diff --git a/.gitignore b/.gitignore index 9b500ff2704d..01098a94ef9f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ coverage/ scratch/ *.pyc *.tsbuildinfo +scenarios/*/dist/ # logs yarn-error.log diff --git a/packages/eslint-config-sdk/src/index.js b/packages/eslint-config-sdk/src/index.js index 7695b2ae5ae3..8824f0540c18 100644 --- a/packages/eslint-config-sdk/src/index.js +++ b/packages/eslint-config-sdk/src/index.js @@ -186,6 +186,13 @@ module.exports = { ecmaVersion: 2018, }, }, + { + // Configuration for jsx and tsx files + files: ['*.tsx', '*.jsx', '*.test.tsx', '*.test.jsx'], + parserOptions: { + jsx: true, + }, + }, ], rules: { diff --git a/scenarios/browser/basic-capture-exception/index.js b/scenarios/browser/basic-capture-exception/index.js new file mode 100644 index 000000000000..d8f49c6e8f91 --- /dev/null +++ b/scenarios/browser/basic-capture-exception/index.js @@ -0,0 +1,7 @@ +import { init, captureException } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", +}); + +captureException(new Error("error here!")); diff --git a/scenarios/browser/basic-capture-exception/package.json b/scenarios/browser/basic-capture-exception/package.json new file mode 100644 index 000000000000..648f2811682c --- /dev/null +++ b/scenarios/browser/basic-capture-exception/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-capture-exception", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-capture-message/index.js b/scenarios/browser/basic-capture-message/index.js new file mode 100644 index 000000000000..cc1c36996db1 --- /dev/null +++ b/scenarios/browser/basic-capture-message/index.js @@ -0,0 +1,7 @@ +import { init, captureMessage } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", +}); + +captureMessage("this is a message"); diff --git a/scenarios/browser/basic-capture-message/package.json b/scenarios/browser/basic-capture-message/package.json new file mode 100644 index 000000000000..8ef15e0872fe --- /dev/null +++ b/scenarios/browser/basic-capture-message/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-capture-message", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-custom-integration/index.js b/scenarios/browser/basic-custom-integration/index.js new file mode 100644 index 000000000000..2ef4864e2c78 --- /dev/null +++ b/scenarios/browser/basic-custom-integration/index.js @@ -0,0 +1,23 @@ +import { init } from "@sentry/browser"; + +class CustomIntegration { + static id = 'CustomIntegration'; + + name = CustomIntegration.id; + options = undefined; + + constructor(options) { + this.options = options; + } + + setupOnce(addGlobalEventProcessor, getCurrentHub) { + addGlobalEventProcessor(event => event); + const hub = getCurrentHub(); + hub.captureMessage(options.name); + } +} + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + integrations: [new CustomIntegration()], +}); diff --git a/scenarios/browser/basic-custom-integration/package.json b/scenarios/browser/basic-custom-integration/package.json new file mode 100644 index 000000000000..0d65cdf1fd85 --- /dev/null +++ b/scenarios/browser/basic-custom-integration/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-custom-integration", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-custom-transport/index.js b/scenarios/browser/basic-custom-transport/index.js new file mode 100644 index 000000000000..7e453b13259d --- /dev/null +++ b/scenarios/browser/basic-custom-transport/index.js @@ -0,0 +1,22 @@ +import { init, Transports } from "@sentry/browser"; + +class CustomTransport extends Transports.BaseTransport { + constructor(options) { + super(options); + } + + sendEvent(event) { + console.log("Sending Event"); + return super.sendEvent(event); + } + + sendSession(session) { + console.log("Sending Session"); + return super.sendSession(session); + } +} + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + transport: CustomTransport +}); diff --git a/scenarios/browser/basic-custom-transport/package.json b/scenarios/browser/basic-custom-transport/package.json new file mode 100644 index 000000000000..55293071b717 --- /dev/null +++ b/scenarios/browser/basic-custom-transport/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-custom-transport", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-no-client-reports/index.js b/scenarios/browser/basic-no-client-reports/index.js new file mode 100644 index 000000000000..5c52e71e2518 --- /dev/null +++ b/scenarios/browser/basic-no-client-reports/index.js @@ -0,0 +1,6 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + sendClientReports: false, +}); diff --git a/scenarios/browser/basic-no-client-reports/package.json b/scenarios/browser/basic-no-client-reports/package.json new file mode 100644 index 000000000000..a43e8f57ee5e --- /dev/null +++ b/scenarios/browser/basic-no-client-reports/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-no-client-reports", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-no-default-integrations/index.js b/scenarios/browser/basic-no-default-integrations/index.js new file mode 100644 index 000000000000..fa0d50153682 --- /dev/null +++ b/scenarios/browser/basic-no-default-integrations/index.js @@ -0,0 +1,6 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + defaultIntegrations: false, +}); diff --git a/scenarios/browser/basic-no-default-integrations/package.json b/scenarios/browser/basic-no-default-integrations/package.json new file mode 100644 index 000000000000..cbbf97445002 --- /dev/null +++ b/scenarios/browser/basic-no-default-integrations/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-no-default-integrations", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-no-dsn/index.js b/scenarios/browser/basic-no-dsn/index.js new file mode 100644 index 000000000000..b1e65a541bc6 --- /dev/null +++ b/scenarios/browser/basic-no-dsn/index.js @@ -0,0 +1,3 @@ +import { init } from "@sentry/browser"; + +init(); diff --git a/scenarios/browser/basic-no-dsn/package.json b/scenarios/browser/basic-no-dsn/package.json new file mode 100644 index 000000000000..0d6d42459880 --- /dev/null +++ b/scenarios/browser/basic-no-dsn/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-no-dsn", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-no-sessions/index.js b/scenarios/browser/basic-no-sessions/index.js new file mode 100644 index 000000000000..6152ed8f4332 --- /dev/null +++ b/scenarios/browser/basic-no-sessions/index.js @@ -0,0 +1,7 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + release: "my-app@1.2.3", + autoSessionTracking: false, +}); diff --git a/scenarios/browser/basic-no-sessions/package.json b/scenarios/browser/basic-no-sessions/package.json new file mode 100644 index 000000000000..0aa83cd2012b --- /dev/null +++ b/scenarios/browser/basic-no-sessions/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-no-sessions", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-with-debug/index.js b/scenarios/browser/basic-with-debug/index.js new file mode 100644 index 000000000000..feb43c4afbee --- /dev/null +++ b/scenarios/browser/basic-with-debug/index.js @@ -0,0 +1,6 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + debug: true, +}); diff --git a/scenarios/browser/basic-with-debug/package.json b/scenarios/browser/basic-with-debug/package.json new file mode 100644 index 000000000000..11adf6b8d51e --- /dev/null +++ b/scenarios/browser/basic-with-debug/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-with-debug", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-with-sessions/index.js b/scenarios/browser/basic-with-sessions/index.js new file mode 100644 index 000000000000..9a346cf1be3a --- /dev/null +++ b/scenarios/browser/basic-with-sessions/index.js @@ -0,0 +1,6 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + release: "my-app@1.2.3", +}); diff --git a/scenarios/browser/basic-with-sessions/package.json b/scenarios/browser/basic-with-sessions/package.json new file mode 100644 index 000000000000..d8012e78fb3e --- /dev/null +++ b/scenarios/browser/basic-with-sessions/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-with-sessions", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic-with-tunnel/index.js b/scenarios/browser/basic-with-tunnel/index.js new file mode 100644 index 000000000000..2716574cc3d1 --- /dev/null +++ b/scenarios/browser/basic-with-tunnel/index.js @@ -0,0 +1,6 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + tunnel: "/errors", +}); diff --git a/scenarios/browser/basic-with-tunnel/package.json b/scenarios/browser/basic-with-tunnel/package.json new file mode 100644 index 000000000000..9d35d8e664f6 --- /dev/null +++ b/scenarios/browser/basic-with-tunnel/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic-with-tunnel", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/basic/index.js b/scenarios/browser/basic/index.js new file mode 100644 index 000000000000..4a17f885a9ed --- /dev/null +++ b/scenarios/browser/basic/index.js @@ -0,0 +1,5 @@ +import { init } from "@sentry/browser"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", +}); diff --git a/scenarios/browser/basic/package.json b/scenarios/browser/basic/package.json new file mode 100644 index 000000000000..da52f2cfdf84 --- /dev/null +++ b/scenarios/browser/basic/package.json @@ -0,0 +1,5 @@ +{ + "name": "basic", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/nextjs-client/index.js b/scenarios/browser/nextjs-client/index.js new file mode 100644 index 000000000000..2e1d4645c8dc --- /dev/null +++ b/scenarios/browser/nextjs-client/index.js @@ -0,0 +1,5 @@ +import { init } from "@sentry/nextjs/esm/index.client"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", +}); diff --git a/scenarios/browser/nextjs-client/package.json b/scenarios/browser/nextjs-client/package.json new file mode 100644 index 000000000000..638d816e2e70 --- /dev/null +++ b/scenarios/browser/nextjs-client/package.json @@ -0,0 +1,8 @@ +{ + "name": "nextjs-client", + "private": true, + "version": "0.0.0", + "dependencies": { + "next": "12" + } +} diff --git a/scenarios/browser/package.json b/scenarios/browser/package.json new file mode 100644 index 000000000000..ee724836ff5c --- /dev/null +++ b/scenarios/browser/package.json @@ -0,0 +1,11 @@ +{ + "name": "scenarios-browser", + "main": "webpack.js", + "private": true, + "version": "0.0.0", + "devDependencies": { + "html-webpack-plugin": "^5.5.0", + "webpack": "^5.62.1", + "webpack-bundle-analyzer": "^4.5.0" + } +} diff --git a/scenarios/browser/perf-auto/index.js b/scenarios/browser/perf-auto/index.js new file mode 100644 index 000000000000..ae46d8d7fb26 --- /dev/null +++ b/scenarios/browser/perf-auto/index.js @@ -0,0 +1,8 @@ +import { init } from "@sentry/browser"; +import { Integrations } from "@sentry/tracing"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + integrations: [new Integrations.BrowserTracing()], + tracesSampleRate: 1.0, +}); diff --git a/scenarios/browser/perf-auto/package.json b/scenarios/browser/perf-auto/package.json new file mode 100644 index 000000000000..83d2c54e9e99 --- /dev/null +++ b/scenarios/browser/perf-auto/package.json @@ -0,0 +1,5 @@ +{ + "name": "perf-auto", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/perf-manual/index.js b/scenarios/browser/perf-manual/index.js new file mode 100644 index 000000000000..ce0ecfe73746 --- /dev/null +++ b/scenarios/browser/perf-manual/index.js @@ -0,0 +1,13 @@ +import { init, startTransaction } from "@sentry/browser"; +import "@sentry/tracing"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", + tracesSampleRate: 1.0, +}); + +const transaction = startTransaction({ op: "task", name: "Important Stuff" }); + +setTimeout(() => { + transaction.finish(); +}, 1000); diff --git a/scenarios/browser/perf-manual/package.json b/scenarios/browser/perf-manual/package.json new file mode 100644 index 000000000000..e8e94f0dd61d --- /dev/null +++ b/scenarios/browser/perf-manual/package.json @@ -0,0 +1,5 @@ +{ + "name": "perf-manual", + "private": true, + "version": "0.0.0" +} diff --git a/scenarios/browser/react/index.js b/scenarios/browser/react/index.js new file mode 100644 index 000000000000..199a160d26a6 --- /dev/null +++ b/scenarios/browser/react/index.js @@ -0,0 +1,19 @@ +import React from "react"; +import ReactDOM from "react-dom" +import { init } from "@sentry/react"; + +init({ + dsn: "https://00000000000000000000000000000000@o000000.ingest.sentry.io/0000000", +}); + +class Hello extends React.Component { + render() { + return React.createElement('div', null, `Hello ${this.props.toWhat}`); + } +} + +ReactDOM.render( + React.createElement(Hello, { toWhat: 'World' }, null), + // eslint-disable-next-line no-undef + document.getElementById('root') +); diff --git a/scenarios/browser/react/package.json b/scenarios/browser/react/package.json new file mode 100644 index 000000000000..068e2fd2e168 --- /dev/null +++ b/scenarios/browser/react/package.json @@ -0,0 +1,9 @@ +{ + "name": "react", + "private": true, + "version": "0.0.0", + "dependencies": { + "react": "17", + "react-dom": "17" + } +} diff --git a/scenarios/browser/webpack.js b/scenarios/browser/webpack.js new file mode 100644 index 000000000000..ef1677a7d9c1 --- /dev/null +++ b/scenarios/browser/webpack.js @@ -0,0 +1,69 @@ +const path = require('path'); +const { promises } = require('fs'); + +const webpack = require('webpack'); +const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; +const HtmlWebpackPlugin = require('html-webpack-plugin'); + +async function init(scenario) { + if (!hasCurrentScenario(scenario)) { + throw new Error(`Scenario "${scenario}" does not exist`); + } + + console.log(`Bundling scenario: ${scenario}`); + + await runWebpack(scenario); +} + +async function runWebpack(scenario) { + const alias = await generateAlias(); + + webpack( + { + mode: 'production', + entry: path.resolve(__dirname, scenario), + output: { + filename: 'main.js', + path: path.resolve(__dirname, 'dist', scenario), + }, + plugins: [new BundleAnalyzerPlugin({ analyzerMode: 'static' }), new HtmlWebpackPlugin()], + resolve: { + alias, + }, + }, + (err, stats) => { + if (err || stats.hasErrors()) { + console.log(err); + } + console.log('DONE', stats); + }, + ); +} + +const PACKAGE_PATH = '../../packages'; + +/** + * Generate webpack aliases based on packages in monorepo + * Example of an alias: '@sentry/serverless': 'path/to/sentry-javascript/packages/serverless', + */ +async function generateAlias() { + const dirents = await promises.readdir(PACKAGE_PATH); + + return Object.fromEntries( + await Promise.all( + dirents.map(async d => { + const packageJSON = JSON.parse(await promises.readFile(path.resolve(PACKAGE_PATH, d, 'package.json'))); + return [packageJSON['name'], path.resolve(PACKAGE_PATH, d)]; + }), + ), + ); +} + +async function hasCurrentScenario(scenario) { + const dirents = await promises.readdir(__dirname, { withFileTypes: true }); + return dirents.filter(dir => dir.isDirectory()).find(dir => dir.name === scenario); +} + +const CURRENT_SCENARIO = 'basic'; + +init(CURRENT_SCENARIO); diff --git a/scenarios/browser/yarn.lock b/scenarios/browser/yarn.lock new file mode 100644 index 000000000000..cd66c8551311 --- /dev/null +++ b/scenarios/browser/yarn.lock @@ -0,0 +1,817 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@polka/url@^1.0.0-next.20": + version "1.0.0-next.21" + resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" + integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== + +"@types/eslint-scope@^3.7.0": + version "3.7.1" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.1.tgz#8dc390a7b4f9dd9f1284629efce982e41612116e" + integrity sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "7.28.2" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.28.2.tgz#0ff2947cdd305897c52d5372294e8c76f351db68" + integrity sha512-KubbADPkfoU75KgKeKLsFHXnU4ipH7wYg0TRT33NK3N3yiu7jlFAAoygIWBV+KbuHx/G+AvuGX6DllnK35gfJA== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^0.0.50": + version "0.0.50" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" + integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== + +"@types/html-minifier-terser@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-6.0.0.tgz#563c1c6c132cd204e71512f9c0b394ff90d3fae7" + integrity sha512-NZwaaynfs1oIoLAV1vg18e7QMVDvw+6SQrdJc8w3BwUaoroVSf6EBj/Sk4PBWGxsq0dzhA2drbsuMC1/6C6KgQ== + +"@types/json-schema@*", "@types/json-schema@^7.0.8": + version "7.0.9" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.9.tgz#97edc9037ea0c38585320b28964dde3b39e4660d" + integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ== + +"@types/node@*": + version "16.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" + integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== + +"@webassemblyjs/ast@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" + integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + +"@webassemblyjs/floating-point-hex-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" + integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== + +"@webassemblyjs/helper-api-error@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" + integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== + +"@webassemblyjs/helper-buffer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" + integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== + +"@webassemblyjs/helper-numbers@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" + integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" + integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== + +"@webassemblyjs/helper-wasm-section@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" + integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + +"@webassemblyjs/ieee754@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" + integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" + integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" + integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== + +"@webassemblyjs/wasm-edit@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" + integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-wasm-section" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-opt" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + "@webassemblyjs/wast-printer" "1.11.1" + +"@webassemblyjs/wasm-gen@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" + integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wasm-opt@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" + integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-buffer" "1.11.1" + "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + +"@webassemblyjs/wasm-parser@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" + integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/ieee754" "1.11.1" + "@webassemblyjs/leb128" "1.11.1" + "@webassemblyjs/utf8" "1.11.1" + +"@webassemblyjs/wast-printer@1.11.1": + version "1.11.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" + integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== + dependencies: + "@webassemblyjs/ast" "1.11.1" + "@xtuc/long" "4.2.2" + +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + +acorn-import-assertions@^1.7.6: + version "1.8.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" + integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== + +acorn-walk@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + +acorn@^8.0.4, acorn@^8.4.1: + version "8.5.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" + integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + +ajv-keywords@^3.5.2: + version "3.5.2" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" + integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== + +ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +boolbase@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + +browserslist@^4.14.5: + version "4.17.6" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" + integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== + dependencies: + caniuse-lite "^1.0.30001274" + electron-to-chromium "^1.3.886" + escalade "^3.1.1" + node-releases "^2.0.1" + picocolors "^1.0.0" + +buffer-from@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== + +camel-case@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a" + integrity sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw== + dependencies: + pascal-case "^3.1.2" + tslib "^2.0.3" + +caniuse-lite@^1.0.30001274: + version "1.0.30001278" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001278.tgz#51cafc858df77d966b17f59b5839250b24417fff" + integrity sha512-mpF9KeH8u5cMoEmIic/cr7PNS+F5LWBk0t2ekGT60lFf0Wq+n9LspAj0g3P+o7DQhD3sUdlMln4YFAWhFYn9jg== + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chrome-trace-event@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac" + integrity sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg== + +clean-css@^5.1.5: + version "5.2.2" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-5.2.2.tgz#d3a7c6ee2511011e051719838bdcf8314dc4548d" + integrity sha512-/eR8ru5zyxKzpBLv9YZvMXgTSSQn7AdkMItMYynsFgGwTveCRVam9IUPFloE85B4vAIj05IuKmmEoV7/AQjT0w== + dependencies: + source-map "~0.6.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +commander@^8.1.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" + integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== + +css-select@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-4.1.3.tgz#a70440f70317f2669118ad74ff105e65849c7067" + integrity sha512-gT3wBNd9Nj49rAbmtFHj1cljIAOLYSX1nZ8CB7TBO3INYckygm5B7LISU/szY//YmdiSLbJvDLOx9VnMVpMBxA== + dependencies: + boolbase "^1.0.0" + css-what "^5.0.0" + domhandler "^4.2.0" + domutils "^2.6.0" + nth-check "^2.0.0" + +css-what@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" + integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw== + +dom-converter@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" + integrity sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA== + dependencies: + utila "~0.4" + +dom-serializer@^1.0.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" + integrity sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.2.0" + entities "^2.0.0" + +domelementtype@^2.0.1, domelementtype@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57" + integrity sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A== + +domhandler@^4.0.0, domhandler@^4.2.0: + version "4.2.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.2.tgz#e825d721d19a86b8c201a35264e226c678ee755f" + integrity sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w== + dependencies: + domelementtype "^2.2.0" + +domutils@^2.5.2, domutils@^2.6.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" + integrity sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A== + dependencies: + dom-serializer "^1.0.1" + domelementtype "^2.2.0" + domhandler "^4.2.0" + +dot-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751" + integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +duplexer@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" + integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg== + +electron-to-chromium@^1.3.886: + version "1.3.891" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.891.tgz#51d7224e64157656276f152a0b3361708fde1bf9" + integrity sha512-3cpwR82QkIS01CN/dup/4Yr3BiOiRLlZlcAFn/5FbNCunMO9ojqDgEP9JEo1QNLflu3pEnPWve50gHOEKc7r6w== + +enhanced-resolve@^5.8.3: + version "5.8.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz#6d552d465cce0423f5b3d718511ea53826a7b2f0" + integrity sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + +entities@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" + integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== + +es-module-lexer@^0.9.0: + version "0.9.3" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" + integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + +fast-deep-equal@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + +graceful-fs@^4.1.2, graceful-fs@^4.2.4: + version "4.2.8" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" + integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + +gzip-size@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-6.0.0.tgz#065367fd50c239c0671cbcbad5be3e2eeb10e462" + integrity sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q== + dependencies: + duplexer "^0.1.2" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +he@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +html-minifier-terser@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-6.0.2.tgz#14059ad64b69bf9f8b8a33f25b53411d8321e75d" + integrity sha512-AgYO3UGhMYQx2S/FBJT3EM0ZYcKmH6m9XL9c1v77BeK/tYJxGPxT1/AtsdUi4FcP8kZGmqqnItCcjFPcX9hk6A== + dependencies: + camel-case "^4.1.2" + clean-css "^5.1.5" + commander "^8.1.0" + he "^1.2.0" + param-case "^3.0.4" + relateurl "^0.2.7" + terser "^5.7.2" + +html-webpack-plugin@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-5.5.0.tgz#c3911936f57681c1f9f4d8b68c158cd9dfe52f50" + integrity sha512-sy88PC2cRTVxvETRgUHFrL4No3UxvcH8G1NepGhqaTT+GXN2kTamqasot0inS5hXeg1cMbFDt27zzo9p35lZVw== + dependencies: + "@types/html-minifier-terser" "^6.0.0" + html-minifier-terser "^6.0.2" + lodash "^4.17.21" + pretty-error "^4.0.0" + tapable "^2.0.0" + +htmlparser2@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-6.1.0.tgz#c4d762b6c3371a05dbe65e94ae43a9f845fb8fb7" + integrity sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A== + dependencies: + domelementtype "^2.0.1" + domhandler "^4.0.0" + domutils "^2.5.2" + entities "^2.0.0" + +jest-worker@^27.0.6: + version "27.3.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.3.1.tgz#0def7feae5b8042be38479799aeb7b5facac24b2" + integrity sha512-ks3WCzsiZaOPJl/oMsDjaf0TRiSv7ctNgs0FqRr2nARsovz6AWWy4oLElwcquGSz692DzgZQrCLScPNs5YlC4g== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +json-parse-better-errors@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +loader-runner@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384" + integrity sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw== + +lodash@^4.17.20, lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +lower-case@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28" + integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg== + dependencies: + tslib "^2.0.3" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +mime-db@1.50.0: + version "1.50.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.50.0.tgz#abd4ac94e98d3c0e185016c67ab45d5fde40c11f" + integrity sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A== + +mime-types@^2.1.27: + version "2.1.33" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.33.tgz#1fa12a904472fafd068e48d9e8401f74d3f70edb" + integrity sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g== + dependencies: + mime-db "1.50.0" + +mime@^2.3.1: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" + integrity sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg== + +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + +no-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" + integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg== + dependencies: + lower-case "^2.0.2" + tslib "^2.0.3" + +node-releases@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" + integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== + +nth-check@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-2.0.1.tgz#2efe162f5c3da06a28959fbd3db75dbeea9f0fc2" + integrity sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w== + dependencies: + boolbase "^1.0.0" + +opener@^1.5.2: + version "1.5.2" + resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" + integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== + +param-case@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5" + integrity sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A== + dependencies: + dot-case "^3.0.4" + tslib "^2.0.3" + +pascal-case@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb" + integrity sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g== + dependencies: + no-case "^3.0.4" + tslib "^2.0.3" + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +pretty-error@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-4.0.0.tgz#90a703f46dd7234adb46d0f84823e9d1cb8f10d6" + integrity sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw== + dependencies: + lodash "^4.17.20" + renderkid "^3.0.0" + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +relateurl@^0.2.7: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= + +renderkid@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-3.0.0.tgz#5fd823e4d6951d37358ecc9a58b1f06836b6268a" + integrity sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg== + dependencies: + css-select "^4.1.3" + dom-converter "^0.2.0" + htmlparser2 "^6.1.0" + lodash "^4.17.21" + strip-ansi "^6.0.1" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +schema-utils@^3.1.0, schema-utils@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" + integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + +serialize-javascript@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== + dependencies: + randombytes "^2.1.0" + +sirv@^1.0.7: + version "1.0.18" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.18.tgz#105fab52fb656ce8a2bebbf36b11052005952899" + integrity sha512-f2AOPogZmXgJ9Ma2M22ZEhc1dNtRIzcEkiflMFeVTRq+OViOZMvH1IPMVOwrKaxpSaHioBJiDR0SluRqGa7atA== + dependencies: + "@polka/url" "^1.0.0-next.20" + mime "^2.3.1" + totalist "^1.0.0" + +source-map-support@~0.5.20: + version "0.5.20" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" + integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +source-map@~0.7.2: + version "0.7.3" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383" + integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ== + +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +tapable@^2.0.0, tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +terser-webpack-plugin@^5.1.3: + version "5.2.5" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.2.5.tgz#ce65b9880a0c36872555c4874f45bbdb02ee32c9" + integrity sha512-3luOVHku5l0QBeYS8r4CdHYWEGMmIj3H1U64jgkdZzECcSOJAyJ9TjuqcQZvw1Y+4AOBN9SeYJPJmFn2cM4/2g== + dependencies: + jest-worker "^27.0.6" + schema-utils "^3.1.1" + serialize-javascript "^6.0.0" + source-map "^0.6.1" + terser "^5.7.2" + +terser@^5.7.2: + version "5.9.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.9.0.tgz#47d6e629a522963240f2b55fcaa3c99083d2c351" + integrity sha512-h5hxa23sCdpzcye/7b8YqbE5OwKca/ni0RQz1uRX3tGh8haaGHqcuSqbGRybuAKNdntZ0mDgFNXPJ48xQ2RXKQ== + dependencies: + commander "^2.20.0" + source-map "~0.7.2" + source-map-support "~0.5.20" + +totalist@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" + integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== + +tslib@^2.0.3: + version "2.3.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" + integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + integrity sha1-ihagXURWV6Oupe7MWxKk+lN5dyw= + +watchpack@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce" + integrity sha512-up4YAn/XHgZHIxFBVCdlMiWDj6WaLKpwVeGQk2I5thdYxF/KmF0aaz6TfJZ/hfl1h/XlcDr7k1KH7ThDagpFaA== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + +webpack-bundle-analyzer@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.5.0.tgz#1b0eea2947e73528754a6f9af3e91b2b6e0f79d5" + integrity sha512-GUMZlM3SKwS8Z+CKeIFx7CVoHn3dXFcUAjT/dcZQQmfSZGvitPfMob2ipjai7ovFFqPvTqkEZ/leL4O0YOdAYQ== + dependencies: + acorn "^8.0.4" + acorn-walk "^8.0.0" + chalk "^4.1.0" + commander "^7.2.0" + gzip-size "^6.0.0" + lodash "^4.17.20" + opener "^1.5.2" + sirv "^1.0.7" + ws "^7.3.1" + +webpack-sources@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.1.tgz#251a7d9720d75ada1469ca07dbb62f3641a05b6d" + integrity sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA== + +webpack@^5.62.1: + version "5.62.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.62.1.tgz#06f09b56a7b1bb13ed5137ad4b118358a90c9505" + integrity sha512-jNLtnWChS2CMZ7vqWtztv0G6fYB5hz11Zsadp5tE7e4/66zVDj7/KUeQZOsOl8Hz5KrLJH1h2eIDl6AnlyE12Q== + dependencies: + "@types/eslint-scope" "^3.7.0" + "@types/estree" "^0.0.50" + "@webassemblyjs/ast" "1.11.1" + "@webassemblyjs/wasm-edit" "1.11.1" + "@webassemblyjs/wasm-parser" "1.11.1" + acorn "^8.4.1" + acorn-import-assertions "^1.7.6" + browserslist "^4.14.5" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.8.3" + es-module-lexer "^0.9.0" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.4" + json-parse-better-errors "^1.0.2" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.1.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.1.3" + watchpack "^2.2.0" + webpack-sources "^3.2.0" + +ws@^7.3.1: + version "7.5.5" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" + integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== From 71116ccf5cee5559a3f368c43597ed70a17bd4c9 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Wed, 1 Dec 2021 06:26:18 -0800 Subject: [PATCH 03/11] fix(ember): Restore local and PR tests (#4205) Given that ember tests take longer to run than most other tests (and have been known to fail for reasons having nothing to do with whatever PR we're working on), in https://github.com/getsentry/sentry-javascript/pull/3571 we stopped running them locally and on PRs*, instead only running them when merging to `master` or releasing. *Provided the PR didn't touch any of the `@sentry/ember` code As a result, we didn't catch a currently-failing ember test until later than we would have liked. To prevent that from happening again, this restores the running of ember tests (both locally and on PRs), but restricts which tests run in each circumstance, in order to prevent this change from slowing down the overall repo test suite more than necessary. Specifically: - Locally, we run tests only against the current version of ember. - In the context of a PR, we run tests against the current version, the LTS version, and a version using `embroider` (which is an optional ember compiler many people use). - When merging to `master` or creating a release, for greatest safety, we test against current, LTS, embroider, beta, and "classic" (a legacy ember version). Key changes: - Up until now, the logic controlling which set of ember tests to run has been split between a script (`run_tests.js`, which differentiated local runs from CI runs), and the GHA workflow config (`build.yml`, which differentiated PRs from merges into master and creation of releases). That work is now consolidated into the ember-try config (since ember-try is the runner which needs to know which tests to run in the first place!). - As a result of the above change, the method for forcing tests for all versions of ember to run needed to be modified. That option is now handled by a new script, `run-CI-tests.js`, which simply mimics the the third situation above by setting environment variables, thereby tricking ember-try into thinking it needs to run all tests. --- .github/workflows/build.yml | 8 ---- packages/ember/config/ember-try.js | 51 +++++++++++++++++++------- packages/ember/package.json | 5 +-- packages/ember/scripts/run-CI-tests.js | 17 +++++++++ packages/ember/scripts/run_tests.js | 15 -------- 5 files changed, 57 insertions(+), 39 deletions(-) create mode 100644 packages/ember/scripts/run-CI-tests.js delete mode 100644 packages/ember/scripts/run_tests.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ceda84c21acc..976a81c9035c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -231,17 +231,9 @@ jobs: with: path: ${{ env.CACHED_BUILD_PATHS }} key: ${{ env.BUILD_CACHE_KEY }} - - name: Check changed files - id: changed-files-specific - uses: tj-actions/changed-files@v6.2 - with: - files: .*packages\/ember($|/.*) - # Only run ember tests if the files above have changed - name: Run Ember tests - if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' run: yarn test --scope=@sentry/ember - name: Compute test coverage - if: steps.changed-files-specific.outputs.any_changed == 'true' || github.event_name == 'push' uses: codecov/codecov-action@v1 job_artifacts: diff --git a/packages/ember/config/ember-try.js b/packages/ember/config/ember-try.js index e54fd4886fbb..94f64eb39117 100644 --- a/packages/ember/config/ember-try.js +++ b/packages/ember/config/ember-try.js @@ -3,26 +3,47 @@ const getChannelURL = require('ember-source-channel-url'); const { embroiderSafe } = require('@embroider/test-setup'); +/** + * Pick which versions of ember against which to test based on whether the tests are running locally, as part of a PR, + * or when merging to `master` or creating a release. + * + * @returns The versions which should be tested, along with their respective config + */ module.exports = async function() { - return { - useYarn: true, - scenarios: [ - { - name: 'ember-lts-3.20', - npm: { - devDependencies: { - 'ember-source': '~3.20.0', - }, + // whenever and wherever we test, we want to at least test against the latest version of ember + let scenarios = [ + { + name: 'ember-release', + npm: { + devDependencies: { + 'ember-source': await getChannelURL('release'), }, }, + }, + ]; + + // in CI we add a few more tests - LTS and embroider (which is an ember compiler) + if (process.env.GITHUB_ACTIONS) { + scenarios = scenarios.concat([ { - name: 'ember-release', + name: 'ember-lts-3.20', npm: { devDependencies: { - 'ember-source': await getChannelURL('release'), + 'ember-source': '~3.24.0', }, }, }, + embroiderSafe(), + ]); + } + + // finally, just to be extra thorough when merging to master and releasing, we add the beta channel and ember + // "classic" (a legacy version which was last current in late 2019) + if ( + process.env.GITHUB_EVENT_NAME === 'push' && + (process.env.GITHUB_HEAD_REF === 'master' || process.env.GITHUB_HEAD_REF.startsWith('release')) + ) { + scenarios = scenarios.concat([ { name: 'ember-beta', npm: { @@ -32,7 +53,6 @@ module.exports = async function() { }, allowedToFail: true, }, - embroiderSafe(), { name: 'ember-classic', env: { @@ -48,6 +68,11 @@ module.exports = async function() { }, }, }, - ], + ]); + } + + return { + useYarn: true, + scenarios, }; }; diff --git a/packages/ember/package.json b/packages/ember/package.json index 3915b94ade45..02968b4161b7 100644 --- a/packages/ember/package.json +++ b/packages/ember/package.json @@ -26,9 +26,8 @@ "prepublishOnly": "ember ts:precompile", "postpublish": "ember ts:clean", "start": "ember serve", - "test": "node ./scripts/run_tests.js", - "test:ember": "ember test", - "test:ember-compatibility": "ember try:each" + "test": "ember try:each", + "test:all": "node ./scripts/run-CI-tests.js" }, "dependencies": { "@embroider/macros": "~0.47.2", diff --git a/packages/ember/scripts/run-CI-tests.js b/packages/ember/scripts/run-CI-tests.js new file mode 100644 index 000000000000..a521ecafd328 --- /dev/null +++ b/packages/ember/scripts/run-CI-tests.js @@ -0,0 +1,17 @@ +/*eslint-env node*/ +const { spawnSync } = require('child_process'); + +console.log('Mimicking the CI environment in order to run tests against multiple versions of Ember'); + +const result = spawnSync('yarn test', { + shell: true, + stdio: 'inherit', + env: { + ...process.env, + GITHUB_ACTIONS: true, + GITHUB_EVENT_NAME: 'push', + GITHUB_HEAD_REF: 'master', + }, +}); + +process.exit(result.status); diff --git a/packages/ember/scripts/run_tests.js b/packages/ember/scripts/run_tests.js deleted file mode 100644 index fb594689893a..000000000000 --- a/packages/ember/scripts/run_tests.js +++ /dev/null @@ -1,15 +0,0 @@ -// running compatibilty tests takes ~15 min on a 2019 2.6 GHz 6-Core Intel i7 16" MacBook Pro w 32 GB of RAM, vs ~25 sec -// for the regular tests - -/*eslint-env node*/ -const { spawnSync } = require('child_process'); - -if (process.env.TRAVIS || process.env.GITHUB_ACTIONS) { - console.log('In CI - running tests against multiple versions of Ember'); - const result = spawnSync('yarn npm-run-all lint:* test:*', { shell: true, stdio: 'inherit' }); - process.exit(result.status); -} else { - console.log('Tests running locally - will only run tests against default version of Ember'); - const result = spawnSync('yarn npm-run-all lint:* test:ember', { shell: true, stdio: 'inherit' }); - process.exit(result.status); -} From 39b5a754d426f02a8d76760d9b91f597c3b4e2e5 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 1 Dec 2021 10:35:46 -0500 Subject: [PATCH 04/11] add tests for new integration exports --- packages/tracing/test/index.bundle.test.ts | 8 +++--- packages/tracing/test/index.test.ts | 29 ++++++++++++++++++++++ packages/tracing/test/testutils.ts | 14 ----------- 3 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 packages/tracing/test/index.test.ts diff --git a/packages/tracing/test/index.bundle.test.ts b/packages/tracing/test/index.bundle.test.ts index d4cae383ab7f..319daa826ce6 100644 --- a/packages/tracing/test/index.bundle.test.ts +++ b/packages/tracing/test/index.bundle.test.ts @@ -1,11 +1,9 @@ import { Integrations } from '../src/index.bundle'; -import { testOnlyIfNodeVersionAtLeast } from './testutils'; describe('Integrations export', () => { - // TODO `Object.values` doesn't work on Node < 8 - testOnlyIfNodeVersionAtLeast(8)('is exported correctly', () => { - Object.values(Integrations).forEach(integration => { - expect(integration.id).toStrictEqual(expect.any(String)); + it('is exported correctly', () => { + Object.keys(Integrations).forEach(key => { + expect(Integrations[key as keyof typeof Integrations].id).toStrictEqual(expect.any(String)); }); }); }); diff --git a/packages/tracing/test/index.test.ts b/packages/tracing/test/index.test.ts new file mode 100644 index 000000000000..795a4ec57b5c --- /dev/null +++ b/packages/tracing/test/index.test.ts @@ -0,0 +1,29 @@ +import { getCurrentHub } from '@sentry/hub'; + +import { BrowserTracing, Integrations } from '../src'; + +describe('index', () => { + describe('Integrations', () => { + it('is exported correctly', () => { + Object.keys(Integrations).forEach(key => { + expect(Integrations[key as keyof typeof Integrations].id).toStrictEqual(expect.any(String)); + }); + }); + + it('contains BrowserTracing', () => { + expect(Integrations.BrowserTracing).toEqual(BrowserTracing); + }); + }); + + it('patches the global hub as a side effect', () => { + const hub = getCurrentHub(); + const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); + expect(transaction).toBeDefined(); + }); + + it('patches the global hub as a side effect', () => { + const hub = getCurrentHub(); + const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); + expect(transaction).toBeDefined(); + }); +}); diff --git a/packages/tracing/test/testutils.ts b/packages/tracing/test/testutils.ts index a8f42f84b9b8..0910b60ed2dd 100644 --- a/packages/tracing/test/testutils.ts +++ b/packages/tracing/test/testutils.ts @@ -42,17 +42,3 @@ export function getSymbolObjectKeyByName(obj: Record, desc return matches[0] || undefined; } - -export const testOnlyIfNodeVersionAtLeast = (minVersion: number): jest.It => { - const currentNodeVersion = process.env.NODE_VERSION; - - try { - if (Number(currentNodeVersion?.split('.')[0]) < minVersion) { - return it.skip; - } - } catch (oO) { - // we can't tell, so err on the side of running the test - } - - return it; -}; From 246ea110ee219f96d2d17e858d1aa73083532794 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 1 Dec 2021 10:54:51 -0500 Subject: [PATCH 05/11] woops --- packages/tracing/test/testutils.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/tracing/test/testutils.ts b/packages/tracing/test/testutils.ts index 0910b60ed2dd..a8f42f84b9b8 100644 --- a/packages/tracing/test/testutils.ts +++ b/packages/tracing/test/testutils.ts @@ -42,3 +42,17 @@ export function getSymbolObjectKeyByName(obj: Record, desc return matches[0] || undefined; } + +export const testOnlyIfNodeVersionAtLeast = (minVersion: number): jest.It => { + const currentNodeVersion = process.env.NODE_VERSION; + + try { + if (Number(currentNodeVersion?.split('.')[0]) < minVersion) { + return it.skip; + } + } catch (oO) { + // we can't tell, so err on the side of running the test + } + + return it; +}; From fd6c6083ea51836fd10d4ada844fa2c08a1e6edb Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 1 Dec 2021 13:20:27 -0500 Subject: [PATCH 06/11] Update packages/tracing/test/index.test.ts --- packages/tracing/test/index.test.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/tracing/test/index.test.ts b/packages/tracing/test/index.test.ts index 795a4ec57b5c..de29495688df 100644 --- a/packages/tracing/test/index.test.ts +++ b/packages/tracing/test/index.test.ts @@ -20,10 +20,4 @@ describe('index', () => { const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); expect(transaction).toBeDefined(); }); - - it('patches the global hub as a side effect', () => { - const hub = getCurrentHub(); - const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); - expect(transaction).toBeDefined(); - }); }); From 34d8376412f07563f3b8963ba374d697e54017a5 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 11:50:05 -0500 Subject: [PATCH 07/11] fix(react): Mark react package as having no side effects (#4213) --- packages/react/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/react/package.json b/packages/react/package.json index c3a895aa80cd..863b3f9d61b1 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -103,7 +103,5 @@ } } }, - "sideEffects": [ - "./src/index.ts" - ] + "sideEffects": false } From 751e054da6e0ecbafc68f52f468088ff0232d6e5 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 11:51:04 -0500 Subject: [PATCH 08/11] ref(integrations): Make ReportTypes a const enum (#4209) `ReportTypes` is an interally used enum, so we do not need the runtime support. The `ReportTypes` enum lives in `packages/integrations/src/reportingobserver.ts` and is used by the `ReportingObserver` integration to manage report types. According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html > Const enums can only use constant enum expressions and unlike regular enums they are completely removed during compilation. Const enum members are inlined at use sites. This is possible since const enums cannot have computed members. This helps save on bundle size. --- packages/integrations/src/reportingobserver.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integrations/src/reportingobserver.ts b/packages/integrations/src/reportingobserver.ts index 2e4a457e04bf..4ae8f0f2d5c1 100644 --- a/packages/integrations/src/reportingobserver.ts +++ b/packages/integrations/src/reportingobserver.ts @@ -11,7 +11,7 @@ interface Report { } /** JSDoc */ -enum ReportTypes { +const enum ReportTypes { /** JSDoc */ Crash = 'crash', /** JSDoc */ From e50a43fc330337ab9db22ae5a2f813e96b7b7610 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 12:04:23 -0500 Subject: [PATCH 09/11] ref(utils): Make States a const enum (#4210) `States` is an interally used enum, so we do not need the runtime support. The `States` enum lives in `packages/utils/src/syncpromise.ts` and is used by `SyncPromise` to manage state internally. According to the TS docs: https://www.typescriptlang.org/docs/handbook/enums.html > Const enums can only use constant enum expressions and unlike regular enums they are completely removed during compilation. Const enum members are inlined at use sites. This is possible since const enums cannot have computed members. This helps save on bundle size. --- packages/utils/src/syncpromise.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/utils/src/syncpromise.ts b/packages/utils/src/syncpromise.ts index 8612e494c8ca..3102a3b67d2b 100644 --- a/packages/utils/src/syncpromise.ts +++ b/packages/utils/src/syncpromise.ts @@ -5,7 +5,7 @@ import { isThenable } from './is'; /** SyncPromise internal states */ -enum States { +const enum States { /** Pending */ PENDING = 'PENDING', /** Resolved / OK */ From 65b40d904462fcb35223d2a050b7426fa7e48f9a Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 12:37:31 -0500 Subject: [PATCH 10/11] add clarifying comments around integrations export: --- packages/tracing/src/index.ts | 18 +++++++++++++++++- packages/tracing/src/integrations/index.ts | 4 ++++ packages/tracing/src/integrationsbundle.ts | 2 -- 3 files changed, 21 insertions(+), 3 deletions(-) delete mode 100644 packages/tracing/src/integrationsbundle.ts diff --git a/packages/tracing/src/index.ts b/packages/tracing/src/index.ts index e97d7b76ad77..1974227b2ff1 100644 --- a/packages/tracing/src/index.ts +++ b/packages/tracing/src/index.ts @@ -1,8 +1,24 @@ import { addExtensionMethods } from './hubextensions'; -import * as Integrations from './integrationsbundle'; +import * as Integrations from './integrations'; export { Integrations }; +// This is already exported as part of `Integrations` above (and for the moment will remain so for +// backwards compatibility), but that interferes with treeshaking, so we also export it separately +// here. +// +// Previously we expected users to import tracing integrations like +// +// import { Integrations } from '@sentry/tracing'; +// const instance = new Integrations.BrowserTracing(); +// +// This makes the integrations unable to be treeshaken though. To address this, we now have +// this individual export. We now expect users to consume BrowserTracing like so: +// +// import { BrowserTracing } from '@sentry/tracing'; +// const instance = new BrowserTracing(); +// +// For an example of of the new usage of BrowserTracing, see @sentry/nextjs index.client.ts export { BrowserTracing } from './browser'; export { Span } from './span'; diff --git a/packages/tracing/src/integrations/index.ts b/packages/tracing/src/integrations/index.ts index 4231abf350e6..b35eff6c495f 100644 --- a/packages/tracing/src/integrations/index.ts +++ b/packages/tracing/src/integrations/index.ts @@ -2,3 +2,7 @@ export { Express } from './node/express'; export { Postgres } from './node/postgres'; export { Mysql } from './node/mysql'; export { Mongo } from './node/mongo'; + +// TODO(v7): Remove this export +// Please see `src/index.ts` for more details. +export { BrowserTracing } from '../browser'; diff --git a/packages/tracing/src/integrationsbundle.ts b/packages/tracing/src/integrationsbundle.ts deleted file mode 100644 index b1a40f6d634f..000000000000 --- a/packages/tracing/src/integrationsbundle.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './integrations'; -export { BrowserTracing } from './browser'; From 933910115424731af3dcccbd061e0f412f7e7d9e Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 2 Dec 2021 12:47:43 -0500 Subject: [PATCH 11/11] move test around --- packages/tracing/test/index.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/tracing/test/index.test.ts b/packages/tracing/test/index.test.ts index de29495688df..8837e2063cc7 100644 --- a/packages/tracing/test/index.test.ts +++ b/packages/tracing/test/index.test.ts @@ -3,6 +3,12 @@ import { getCurrentHub } from '@sentry/hub'; import { BrowserTracing, Integrations } from '../src'; describe('index', () => { + it('patches the global hub to add an implementation for `Hub.startTransaction` as a side effect', () => { + const hub = getCurrentHub(); + const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); + expect(transaction).toBeDefined(); + }); + describe('Integrations', () => { it('is exported correctly', () => { Object.keys(Integrations).forEach(key => { @@ -14,10 +20,4 @@ describe('index', () => { expect(Integrations.BrowserTracing).toEqual(BrowserTracing); }); }); - - it('patches the global hub as a side effect', () => { - const hub = getCurrentHub(); - const transaction = hub.startTransaction({ name: 'test', endTimestamp: 123 }); - expect(transaction).toBeDefined(); - }); });