Skip to content

Commit

Permalink
build(profiling-node): make sure debug build plugin is used (#10534)
Browse files Browse the repository at this point in the history
Fixes #10525

When writing the rollup config, we didn't include the debug build
plugin. This led to things not be replaced properly as `profiling-node`
bundles everything into a single file.

This was also causing issues in our CI:
https://github.com/getsentry/sentry-javascript/actions/runs/7804351046/job/21287026518?pr=10527

Backporting this fix to v7 so we can do a `7.100.1` release after we
merge this in.
  • Loading branch information
AbhiPrasad authored and mydea committed Feb 7, 2024
1 parent 821537c commit 17a5d38
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 29 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ jobs:
id: changed
with:
filters: |
workflow: &workflow
- '.github/**'
shared: &shared
- *workflow
- '*.{js,ts,json,yml,lock}'
- 'CHANGELOG.md'
- '.github/**'
- 'jest/**'
- 'scripts/**'
- 'packages/core/**'
Expand Down Expand Up @@ -137,8 +139,11 @@ jobs:
- *shared
- 'packages/node/**'
- 'packages/profiling-node/**'
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
profiling_node_bindings:
- *workflow
- 'packages/profiling-node/bindings/**'
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
deno:
- *shared
- *browser
Expand Down Expand Up @@ -1128,11 +1133,6 @@ jobs:

- name: Build Profiling tarball
run: yarn build:tarball --scope @sentry/profiling-node

- name: Install esbuild
if: ${{ matrix.test-application == 'node-profiling' }}
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
run: yarn add esbuild@0.19.11
# End rebuild profiling

- name: Restore tarball cache
Expand Down
3 changes: 2 additions & 1 deletion dev-packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"dotenv": "16.0.3",
"glob": "8.0.3",
"ts-node": "10.9.1",
"yaml": "2.2.2"
"yaml": "2.2.2",
"esbuild": "0.20.0"
},
"volta": {
"node": "18.17.1",
Expand Down
31 changes: 9 additions & 22 deletions packages/profiling-node/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import { makeBaseNPMConfig, makeNPMConfigVariants, plugins } from '@sentry-internal/rollup-utils';

const configs = makeNPMConfigVariants(makeBaseNPMConfig());
const cjsConfig = configs.find(config => config.output.format === 'cjs');

if (!cjsConfig) {
throw new Error('CJS config is required for profiling-node.');
}

const config = {
...cjsConfig,
input: 'src/index.ts',
output: { ...cjsConfig.output, file: 'lib/index.js', format: 'cjs', dir: undefined, preserveModules: false },
plugins: [
plugins.makeLicensePlugin('Sentry Node Profiling'),
resolve(),
commonjs(),
typescript({ tsconfig: './tsconfig.json' }),
],
};

export default config;
import { makeBaseNPMConfig } from '@sentry-internal/rollup-utils';

export default makeBaseNPMConfig({
packageSpecificConfig: {
input: 'src/index.ts',
output: { file: 'lib/index.js', format: 'cjs', dir: undefined, preserveModules: false },
plugins: [resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' })],
},
});
Loading

0 comments on commit 17a5d38

Please sign in to comment.