From 9fd2e23dbe578bef62812f34cebaeb535bb8f9e2 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 4 Apr 2022 23:02:14 -0700 Subject: [PATCH 1/3] use `build:rollup` in `build` --- packages/browser/package.json | 2 +- packages/core/package.json | 2 +- packages/gatsby/package.json | 2 +- packages/hub/package.json | 2 +- packages/integrations/package.json | 2 +- packages/nextjs/package.json | 2 +- packages/node/package.json | 2 +- packages/react/package.json | 2 +- packages/serverless/package.json | 2 +- packages/tracing/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- packages/vue/package.json | 2 +- packages/wasm/package.json | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/browser/package.json b/packages/browser/package.json index 9ca3ad829d88..b2e8add68174 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -43,7 +43,7 @@ "webpack": "^4.30.0" }, "scripts": { - "build": "run-p build:cjs build:esm build:bundle build:types", + "build": "run-p build:rollup build:bundle build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", diff --git a/packages/core/package.json b/packages/core/package.json index 104ca8c24a13..be4629490380 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -22,7 +22,7 @@ "tslib": "^1.9.3" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 504b34015793..0f727e8470df 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -35,7 +35,7 @@ "react": "^18.0.0" }, "scripts": { - "build": "run-p build:cjs build:esm build:types build:plugin", + "build": "run-p build:rollup build:types build:plugin", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/hub/package.json b/packages/hub/package.json index 7903d295158d..7c86c6e8a223 100644 --- a/packages/hub/package.json +++ b/packages/hub/package.json @@ -21,7 +21,7 @@ "tslib": "^1.9.3" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/integrations/package.json b/packages/integrations/package.json index 9c012e616cbe..68261f7e6bdc 100644 --- a/packages/integrations/package.json +++ b/packages/integrations/package.json @@ -25,7 +25,7 @@ "chai": "^4.1.2" }, "scripts": { - "build": "run-p build:cjs build:esm build:types build:bundle", + "build": "run-p build:rollup build:types build:bundle", "build:bundle": "bash scripts/buildBundles.sh", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 266239365938..afc12c499a49 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -43,7 +43,7 @@ } }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/node/package.json b/packages/node/package.json index a1d82575277a..bf2bd6ffbad8 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -34,7 +34,7 @@ "nock": "^13.0.5" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/react/package.json b/packages/react/package.json index 03f1873aa436..4c4c15444d67 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -47,7 +47,7 @@ "redux": "^4.0.5" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/serverless/package.json b/packages/serverless/package.json index ab2c00d479dc..eaf8d9e5fb3b 100644 --- a/packages/serverless/package.json +++ b/packages/serverless/package.json @@ -38,7 +38,7 @@ "read-pkg": "^5.2.0" }, "scripts": { - "build": "run-p build:cjs build:esm build:types && yarn build:awslambda-layer", + "build": "run-p build:rollup build:types && yarn build:awslambda-layer", "build:awslambda-layer": "node scripts/build-awslambda-layer.js", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", diff --git a/packages/tracing/package.json b/packages/tracing/package.json index c5098efa4880..a2954aadc8c4 100644 --- a/packages/tracing/package.json +++ b/packages/tracing/package.json @@ -26,7 +26,7 @@ "@types/express": "^4.17.1" }, "scripts": { - "build": "run-p build:cjs build:esm build:types build:bundle && ts-node ../../scripts/prepack.ts --bundles #necessary for integration tests", + "build": "run-p build:rollup build:types build:bundle && ts-node ../../scripts/prepack.ts --bundles #necessary for integration tests", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", diff --git a/packages/types/package.json b/packages/types/package.json index 823868e048fd..e18e95165281 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -16,7 +16,7 @@ "access": "public" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/utils/package.json b/packages/utils/package.json index 94e477d16fbd..f57d714f0ffb 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -25,7 +25,7 @@ "chai": "^4.1.2" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-s build", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", diff --git a/packages/vue/package.json b/packages/vue/package.json index a29eb014518a..46291c5f452e 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -26,7 +26,7 @@ "vue": "2.x || 3.x" }, "scripts": { - "build": "run-p build:cjs build:esm build:types", + "build": "run-p build:rollup build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 0dfffd50df12..62843c358af6 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -30,7 +30,7 @@ "puppeteer": "^5.5.0" }, "scripts": { - "build": "run-p build:cjs build:esm build:bundle build:types", + "build": "run-p build:rollup build:bundle build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", "build:dev": "run-p build:cjs build:esm build:types", From aec1499eb6be6c820b9a2c2b7c8b6ae190a43913 Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 4 Apr 2022 23:04:36 -0700 Subject: [PATCH 2/3] use `build:rollup` in `build:dev` --- packages/browser/package.json | 2 +- packages/integrations/package.json | 2 +- packages/serverless/package.json | 2 +- packages/tracing/package.json | 2 +- packages/vue/package.json | 2 +- packages/wasm/package.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/browser/package.json b/packages/browser/package.json index b2e8add68174..90a1287f0a9c 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -46,7 +46,7 @@ "build": "run-p build:rollup build:bundle build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", diff --git a/packages/integrations/package.json b/packages/integrations/package.json index 68261f7e6bdc..95c179312a95 100644 --- a/packages/integrations/package.json +++ b/packages/integrations/package.json @@ -28,7 +28,7 @@ "build": "run-p build:rollup build:types build:bundle", "build:bundle": "bash scripts/buildBundles.sh", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", diff --git a/packages/serverless/package.json b/packages/serverless/package.json index eaf8d9e5fb3b..f306491323fb 100644 --- a/packages/serverless/package.json +++ b/packages/serverless/package.json @@ -41,7 +41,7 @@ "build": "run-p build:rollup build:types && yarn build:awslambda-layer", "build:awslambda-layer": "node scripts/build-awslambda-layer.js", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", diff --git a/packages/tracing/package.json b/packages/tracing/package.json index a2954aadc8c4..7b6c2f81a226 100644 --- a/packages/tracing/package.json +++ b/packages/tracing/package.json @@ -29,7 +29,7 @@ "build": "run-p build:rollup build:types build:bundle && ts-node ../../scripts/prepack.ts --bundles #necessary for integration tests", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", diff --git a/packages/vue/package.json b/packages/vue/package.json index 46291c5f452e..c29002fd3b70 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -29,7 +29,7 @@ "build": "run-p build:rollup build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 62843c358af6..10f1b9570fed 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -33,7 +33,7 @@ "build": "run-p build:rollup build:bundle build:types", "build:bundle": "rollup --config rollup.bundle.config.js", "build:cjs": "tsc -p tsconfig.cjs.json", - "build:dev": "run-p build:cjs build:esm build:types", + "build:dev": "run-p build:rollup build:types", "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***", "build:esm": "tsc -p tsconfig.esm.json", "build:rollup": "rollup -c rollup.npm.config.js", From aa78a9f3efffde47db1459c898d73de6602ffcca Mon Sep 17 00:00:00 2001 From: Katie Byers Date: Mon, 9 May 2022 18:01:01 -0700 Subject: [PATCH 3/3] remove sucrase test hack --- .github/workflows/build.yml | 277 ----------------------------------- rollup/npmHelpers.js | 18 +-- scripts/sucrase-test-hack.ts | 49 ------- 3 files changed, 3 insertions(+), 341 deletions(-) delete mode 100644 scripts/sucrase-test-hack.ts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e88cd491876..155126752160 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -256,8 +256,6 @@ jobs: NODE_VERSION: ${{ matrix.node }} run: | [[ $NODE_VERSION == 8 ]] && yarn add --dev --ignore-engines --ignore-scripts --ignore-workspace-root-check ts-node@8.x - # TODO remove this when we switch to sucrase - yarn ts-node scripts/sucrase-test-hack.ts yarn test-ci - name: Compute test coverage uses: codecov/codecov-action@v1 @@ -494,278 +492,3 @@ jobs: run: | cd packages/node-integration-tests yarn test - - job_unit_test_sucrase: - name: Sucrase Test (Node ${{ matrix.node }}) - needs: job_build - continue-on-error: true - timeout-minutes: 30 - runs-on: ubuntu-latest - strategy: - matrix: - node: [8, 10, 12, 14, 16] - steps: - - name: Check out current commit (${{ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run tests - env: - NODE_VERSION: ${{ matrix.node }} - SUCRASE: true - run: | - [[ $NODE_VERSION == 8 ]] && yarn add --dev --ignore-engines --ignore-scripts --ignore-workspace-root-check ts-node@8.x rollup@2.2.0 @rollup/plugin-node-resolve@10.x rollup-plugin-terser@5.0.0 rollup-plugin-typescript2@0.30.0 - yarn ts-node scripts/sucrase-test-hack.ts - yarn test-ci - - name: Compute test coverage - uses: codecov/codecov-action@v1 - - job_nextjs_integration_test_sucrase: - name: Sucrase Test @sentry/nextjs on (Node ${{ matrix.node }}) - needs: job_build - continue-on-error: true - timeout-minutes: 30 - runs-on: ubuntu-latest - strategy: - matrix: - node: [10, 12, 14, 16] - steps: - - name: Check out current commit (${{ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run tests - env: - NODE_VERSION: ${{ matrix.node }} - run: | - yarn ts-node scripts/sucrase-test-hack.ts - cd packages/nextjs - yarn test:integration - - # Ember tests are separate from the rest because they are the slowest part of the test suite, and making them a - # separate job allows them to run in parallel with the other tests. - job_ember_tests_sucrase: - name: Sucrase Test @sentry/ember - needs: job_build - continue-on-error: true - timeout-minutes: 30 - runs-on: ubuntu-latest - steps: - - name: Check out current commit (${{ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - # TODO: removing `fetch-depth` below seems to have no effect, and the commit which added it had no description, - # so it's not clear why it's necessary. That said, right now ember tests are xfail, so it's a little hard to - # tell if it's safe to remove. Once ember tests are fixed, let's try again with it turned off, and if all goes - # well, we can pull it out. - fetch-depth: 0 - - name: Set up Node - uses: actions/setup-node@v1 - with: - # The only danger with Ember in terms of Node versions is that the build tool, ember-cli, won't work if Node - # is too old. Since Oct 2019, Node 10 has been the oldest version supported by ember-cli, so test against - # that. If it passes, newer versions of Node should also be fine. This saves us from having to run the Ember - # tests in our Node matrix above. - node-version: '10' - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run Ember tests - run: | - yarn ts-node scripts/sucrase-test-hack.ts - yarn test --scope=@sentry/ember - - name: Compute test coverage - uses: codecov/codecov-action@v1 - - job_browser_playwright_tests_sucrase: - name: Sucrase Playwright - ${{ (matrix.tracing_only && 'Browser + Tracing') || 'Browser' }} (${{ matrix.bundle }}) - needs: job_build - runs-on: ubuntu-latest - strategy: - matrix: - bundle: - - esm - - cjs - tracing_only: - - true - - false - exclude: - # `tracing_only` only makes a difference for bundles - tests of the esm and cjs builds always include the - # tracing tests - - bundle: esm - tracing_only: false - - bundle: cjs - tracing_only: false - steps: - - name: Check out current commit (${{ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '16' - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run Playwright tests - env: - PW_BUNDLE: ${{ matrix.bundle }} - PW_TRACING_ONLY: ${{ matrix.tracing_only }} - run: | - yarn ts-node scripts/sucrase-test-hack.ts - cd packages/integration-tests - yarn run playwright install-deps webkit - yarn test:ci - - job_browser_integration_tests_sucrase: - name: Sucrase Old Browser Integration Tests (${{ matrix.browser }}) - needs: job_build - runs-on: ubuntu-latest - timeout-minutes: 10 - continue-on-error: true - strategy: - matrix: - browser: - - ChromeHeadless - - FirefoxHeadless - - WebkitHeadless - steps: - - name: Check out current commit (${{ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run integration tests - env: - KARMA_BROWSER: ${{ matrix.browser }} - run: | - yarn ts-node scripts/sucrase-test-hack.ts - cd packages/browser - [[ $KARMA_BROWSER == WebkitHeadless ]] && yarn run playwright install-deps webkit - yarn test:integration - - job_browser_build_tests_sucrase: - name: Sucrase Browser Build Tests - needs: job_build - runs-on: ubuntu-latest - timeout-minutes: 5 - continue-on-error: true - steps: - - name: Check out current commit (${ env.HEAD_COMMIT }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '16' - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run browser build tests - run: | - yarn ts-node scripts/sucrase-test-hack.ts - cd packages/browser - yarn test:package - - name: Run utils build tests - run: | - cd packages/utils - yarn test:package - - job_node_integration_tests_sucrase: - name: Sucrase Node SDK Integration Tests (${{ matrix.node }}) - needs: job_build - runs-on: ubuntu-latest - timeout-minutes: 10 - continue-on-error: true - strategy: - matrix: - node: [10, 12, 14, 16] - steps: - - name: Check out current commit (${{ github.sha }}) - uses: actions/checkout@v2 - with: - ref: ${{ env.HEAD_COMMIT }} - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node }} - - name: Check dependency cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_DEPENDENCY_PATHS }} - key: ${{ needs.job_build.outputs.dependency_cache_key }} - - name: Check build cache - uses: actions/cache@v2 - with: - path: ${{ env.CACHED_BUILD_PATHS }} - key: ${{ env.BUILD_CACHE_KEY }} - - name: Run integration tests - env: - NODE_VERSION: ${{ matrix.node }} - run: | - yarn ts-node scripts/sucrase-test-hack.ts - cd packages/node-integration-tests - yarn test diff --git a/rollup/npmHelpers.js b/rollup/npmHelpers.js index 0ac0ad33a01b..40d9499f75a7 100644 --- a/rollup/npmHelpers.js +++ b/rollup/npmHelpers.js @@ -33,8 +33,7 @@ export function makeBaseNPMConfig(options = {}) { const removeBlankLinesPlugin = makeRemoveBlankLinesPlugin(); const extractPolyfillsPlugin = makeExtractPolyfillsPlugin(); - // return { - const config = { + return { input: entrypoints, output: { @@ -44,10 +43,10 @@ export function makeBaseNPMConfig(options = {}) { sourcemap: true, // output individual files rather than one big bundle - // preserveModules: true, + preserveModules: true, // any wrappers or helper functions generated by rollup can use ES6 features - // generatedCode: 'es2015', + generatedCode: 'es2015', // don't add `"use strict"` to the top of cjs files strict: false, @@ -101,17 +100,6 @@ export function makeBaseNPMConfig(options = {}) { // treeshake: 'smallest', treeshake: false, }; - - // temporary hack for testing sucrase bundles before we switch over - if (!process.version.startsWith('v8')) { - console.log('Doing normal preserveModules'); - config.output.preserveModules = true; - } else { - console.log('Doing node 8 preserveModules'); - config.preserveModules = true; - } - - return config; } export function makeNPMConfigVariants(baseConfig) { diff --git a/scripts/sucrase-test-hack.ts b/scripts/sucrase-test-hack.ts deleted file mode 100644 index e697145abbdb..000000000000 --- a/scripts/sucrase-test-hack.ts +++ /dev/null @@ -1,49 +0,0 @@ -// A temporary hack to use sucrase versions of packages for testing in CI. - -import * as childProcess from 'child_process'; -import * as fs from 'fs'; -import * as path from 'path'; - -function run(cmd: string, options?: childProcess.ExecSyncOptions): unknown { - return childProcess.execSync(cmd, { stdio: 'inherit', ...options }); -} - -const ignorePackages = process.version.startsWith('v8') - ? [ - '@sentry/ember', - '@sentry-internal/eslint-plugin-sdk', - '@sentry/react', - '@sentry/wasm', - '@sentry/gatsby', - '@sentry/serverless', - '@sentry/nextjs', - '@sentry/angular', - ] - : ['@sentry/serverless']; - -// clear current builds and rebuild with rollup/sucrase (this way, all of the extra, random stuff which gets built in -// the main build job remains, and only the part affected by this project gets overwritten) -if (process.env.SUCRASE) { - // just to be super sure - fs.readdirSync(path.join(process.cwd(), 'packages')).forEach(dir => { - if (fs.existsSync(path.join(process.cwd(), 'packages', dir, 'build', 'npm'))) { - run(`rm -rf packages/${dir}/build/npm/cjs`); - run(`rm -rf packages/${dir}/build/npm/esm`); - } else if (fs.existsSync(path.join(process.cwd(), 'packages', dir, 'build', 'cjs'))) { - run(`rm -rf packages/${dir}/build/cjs`); - run(`rm -rf packages/${dir}/build/esm`); - } - }); - - // rebuild the packages we're going to test with rollup/sucrase - run(`yarn build:rollup ${ignorePackages.map(dep => `--ignore="${dep}"`).join(' ')}`); -} -// if we're in tsc-land, rebuild using es5 - temporary until switch to sucrase -else { - const baseTSConfigPath = 'packages/typescript/tsconfig.json'; - fs.writeFileSync( - baseTSConfigPath, - String(fs.readFileSync(baseTSConfigPath)).replace('"target": "es6"', '"target": "es5"'), - ); - run(`yarn build:dev ${ignorePackages.map(dep => `--ignore="${dep}"`).join(' ')}`); -}