Skip to content

Commit 06a31c4

Browse files
authored
build(profiling-node): Fix output directory & caching (#15945)
This used to build into `/lib` which is not covered by nx (it was changed there but slightly incorrectly, covering `/build/lib` instead of `/lib`). But overall, the way to go here is to just use our standard structure, which is `build/`, then this should all just work :D
1 parent f0fc41f commit 06a31c4

File tree

8 files changed

+21
-24
lines changed

8 files changed

+21
-24
lines changed

nx.json

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
"outputs": [
3636
"{projectRoot}/build/esm",
3737
"{projectRoot}/build/cjs",
38-
"{projectRoot}/build/lib/esm",
39-
"{projectRoot}/build/lib/cjs",
4038
"{projectRoot}/build/npm/esm",
4139
"{projectRoot}/build/npm/cjs"
4240
]

packages/profiling-node/.eslintignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
node_modules/
22
build/
3-
lib/
3+
build/
44
coverage/

packages/profiling-node/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = {
44
},
55
extends: ['../../.eslintrc.js'],
66

7-
ignorePatterns: ['lib/**/*', 'examples/**/*', 'vitest.config.ts'],
7+
ignorePatterns: ['build/**/*', 'examples/**/*', 'vitest.config.ts'],
88
rules: {
99
'@sentry-internal/sdk/no-class-field-initializers': 'off',
1010
},

packages/profiling-node/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# compiled output
44
/node_modules/
5-
/lib/
5+
/build/
66

packages/profiling-node/package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,26 @@
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/profiling-node",
77
"author": "Sentry",
88
"license": "MIT",
9-
"main": "lib/cjs/index.js",
10-
"module": "lib/esm/index.js",
11-
"types": "lib/types/index.d.ts",
9+
"main": "build/cjs/index.js",
10+
"module": "build/esm/index.js",
11+
"types": "build/types/index.d.ts",
1212
"exports": {
1313
"./package.json": "./package.json",
1414
".": {
1515
"import": {
16-
"types": "./lib/types/index.d.ts",
17-
"default": "./lib/esm/index.js"
16+
"types": "./build/types/index.d.ts",
17+
"default": "./build/esm/index.js"
1818
},
1919
"require": {
20-
"types": "./lib/types/index.d.ts",
21-
"default": "./lib/cjs/index.js"
20+
"types": "./build/types/index.d.ts",
21+
"default": "./build/cjs/index.js"
2222
}
2323
}
2424
},
2525
"typesVersions": {
2626
"<5.0": {
27-
"lib/types/index.d.ts": [
28-
"lib/types-ts3.8/index.d.ts"
27+
"build/types/index.d.ts": [
28+
"build/types-ts3.8/index.d.ts"
2929
]
3030
}
3131
},
@@ -39,19 +39,18 @@
3939
"access": "public"
4040
},
4141
"files": [
42-
"/lib",
42+
"/build",
4343
"package.json",
4444
"/scripts/prune-profiler-binaries.js"
4545
],
4646
"scripts": {
47-
"clean": "rm -rf build && rm -rf lib",
47+
"clean": "rm -rf build",
4848
"lint": "eslint . --format stylish",
49-
"lint:es-compatibility": "es-check es2022 ./lib/cjs/*.js && es-check es2022 ./lib/esm/*.js --module",
49+
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
5050
"fix": "eslint . --format stylish --fix",
51-
"build": "yarn build:lib",
52-
"build:lib": "yarn build:types && rollup -c rollup.npm.config.mjs",
53-
"build:transpile": "yarn build:lib",
54-
"build:types:downlevel": "yarn downlevel-dts lib/types lib/types-ts3.8 --to ts3.8",
51+
"build": "yarn build:types && yarn build:transpile",
52+
"build:transpile": "yarn rollup -c rollup.npm.config.mjs",
53+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
5554
"build:types": "tsc -p tsconfig.types.json && yarn build:types:downlevel",
5655
"build:types:watch": "tsc -p tsconfig.types.json --watch",
5756
"build:dev": "yarn clean && yarn build",

packages/profiling-node/rollup.npm.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default makeNPMConfigVariants(
44
makeBaseNPMConfig({
55
packageSpecificConfig: {
66
output: {
7-
dir: 'lib',
7+
dir: 'build',
88
// set exports to 'named' or 'auto' so that rollup doesn't warn
99
exports: 'named',
1010
// set preserveModules to false because for profiling we actually want

packages/profiling-node/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"module": "esnext",
55
"lib": ["es2018"],
6-
"outDir": "lib",
6+
"outDir": "build",
77
"types": ["node"]
88
},
99
"include": ["src/**/*"]

packages/profiling-node/tsconfig.types.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"declaration": true,
55
"declarationMap": true,
66
"emitDeclarationOnly": true,
7-
"outDir": "lib/types",
7+
"outDir": "build/types",
88
"types": ["node"]
99
},
1010
"files": ["src/index.ts"]

0 commit comments

Comments
 (0)