Skip to content

Commit f01e884

Browse files
authored
build(profiling-node): make sure debug build plugin is used (#10534)
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.
1 parent 81a5b4f commit f01e884

File tree

4 files changed

+161
-29
lines changed

4 files changed

+161
-29
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,12 @@ jobs:
8787
id: changed
8888
with:
8989
filters: |
90+
workflow: &workflow
91+
- '.github/**'
9092
shared: &shared
93+
- *workflow
9194
- '*.{js,ts,json,yml,lock}'
9295
- 'CHANGELOG.md'
93-
- '.github/**'
9496
- 'jest/**'
9597
- 'scripts/**'
9698
- 'packages/core/**'
@@ -137,8 +139,11 @@ jobs:
137139
- *shared
138140
- 'packages/node/**'
139141
- 'packages/profiling-node/**'
142+
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
140143
profiling_node_bindings:
144+
- *workflow
141145
- 'packages/profiling-node/bindings/**'
146+
- 'dev-packages/e2e-tests/test-applications/node-profiling/**'
142147
deno:
143148
- *shared
144149
- *browser
@@ -1120,11 +1125,6 @@ jobs:
11201125

11211126
- name: Build Profiling tarball
11221127
run: yarn build:tarball --scope @sentry/profiling-node
1123-
1124-
- name: Install esbuild
1125-
if: ${{ matrix.test-application == 'node-profiling' }}
1126-
working-directory: dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}
1127-
run: yarn add [email protected]
11281128
# End rebuild profiling
11291129

11301130
- name: Restore tarball cache

dev-packages/e2e-tests/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"dotenv": "16.0.3",
2323
"glob": "8.0.3",
2424
"ts-node": "10.9.1",
25-
"yaml": "2.2.2"
25+
"yaml": "2.2.2",
26+
"esbuild": "0.20.0"
2627
},
2728
"volta": {
2829
"node": "18.17.1",
Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
import commonjs from '@rollup/plugin-commonjs';
22
import resolve from '@rollup/plugin-node-resolve';
33
import typescript from '@rollup/plugin-typescript';
4-
import { makeBaseNPMConfig, makeNPMConfigVariants, plugins } from '@sentry-internal/rollup-utils';
5-
6-
const configs = makeNPMConfigVariants(makeBaseNPMConfig());
7-
const cjsConfig = configs.find(config => config.output.format === 'cjs');
8-
9-
if (!cjsConfig) {
10-
throw new Error('CJS config is required for profiling-node.');
11-
}
12-
13-
const config = {
14-
...cjsConfig,
15-
input: 'src/index.ts',
16-
output: { ...cjsConfig.output, file: 'lib/index.js', format: 'cjs', dir: undefined, preserveModules: false },
17-
plugins: [
18-
plugins.makeLicensePlugin('Sentry Node Profiling'),
19-
resolve(),
20-
commonjs(),
21-
typescript({ tsconfig: './tsconfig.json' }),
22-
],
23-
};
24-
25-
export default config;
4+
import { makeBaseNPMConfig } from '@sentry-internal/rollup-utils';
5+
6+
export default makeBaseNPMConfig({
7+
packageSpecificConfig: {
8+
input: 'src/index.ts',
9+
output: { file: 'lib/index.js', format: 'cjs', dir: undefined, preserveModules: false },
10+
plugins: [resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' })],
11+
},
12+
});

0 commit comments

Comments
 (0)