Skip to content

ref(build): Use rollup/sucrase for non-watch npm builds #5035

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
277 changes: 0 additions & 277 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,6 @@ jobs:
NODE_VERSION: ${{ matrix.node }}
run: |
[[ $NODE_VERSION == 8 ]] && yarn add --dev --ignore-engines --ignore-scripts --ignore-workspace-root-check [email protected]
# 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
Expand Down Expand Up @@ -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 [email protected] [email protected] @rollup/[email protected] [email protected] [email protected]
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
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
"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",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
2 changes: 1 addition & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
4 changes: 2 additions & 2 deletions packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
"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",
"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",
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand Down
4 changes: 2 additions & 2 deletions packages/serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"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",
"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",
Expand Down
4 changes: 2 additions & 2 deletions packages/tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@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",
"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",
Expand Down
Loading