Skip to content

Commit faaacb8

Browse files
authored
ref(build): Add build/types to tarballs and adjust types entry points (#4824)
* All tarballs now include the `build/types` directory. All `.npmignore`s were adjusted to include this directory. * The `types` entry point in all `package.json`s are now adjusted to the new types directory Proper bugfix for 6.19.0 regression: With PR #4724, we introduced separate building of type declaration files which would be written to `<sdk>/build/types`. Furthermore, we adjusted the `types` entry point in the `package.json`s to this new directory. To avoid a breaking change, we kept type declarations in `dist` and `esm`. However, a bug in this PR caused a small regression in most of our SDKs: The new types directory was not included in most of our SDK tarballs. Subsequently, we released a hot fix via #4745 which simply reset the entry points back to their previous path (`dist/index.d.ts`) in all SDKs. Additional adjustments w.r.t. creating tarballs to improve consistency: * Browser: Adjusted `postbuild.sh` to copy `.npmignore` to `./build` * Gatsby: Use `.npmignore` instead of `files` property in `package.json` * Utils: Changed `.npmignore` to be more similar to our other packages * WASM: Changed `.npmignore` to be more similar to our other packages * Next.js: Added `.npmignore`
1 parent 8d9c2bf commit faaacb8

34 files changed

+50
-46
lines changed

packages/angular/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/browser/.npmignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# Info: the paths in this file are adjusted to match once this
2+
# file is copied to `./build`. This is done by a postbuild script
3+
# located in sentry-javascript/scripts/postbuild.sh
4+
15
*
6+
7+
# TODO remove bundles in v7
8+
!/bundles/**/*
9+
210
!/dist/**/*
3-
!/build/**/*
11+
!/types/**/*
412
!/esm/**/*
5-
*.tsbuildinfo

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "build/dist/index.js",
1313
"module": "build/esm/index.js",
14-
"types": "build/dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/core/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/gatsby/.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*
2+
!/dist/**/*
3+
!/esm/**/*
4+
!/build/types/**/*
5+
!gatsby-browser.js
6+
!gatsby-node.js

packages/gatsby/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,7 @@
1515
},
1616
"main": "dist/index.js",
1717
"module": "esm/index.js",
18-
"types": "dist/index.d.ts",
19-
"files": [
20-
"/dist",
21-
"/esm",
22-
"gatsby-browser.js",
23-
"gatsby-node.js"
24-
],
18+
"types": "build/types/index.d.ts",
2519
"publishConfig": {
2620
"access": "public"
2721
},

packages/hub/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/integrations/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
!/dist/**/*
33
!/build/**/*
44
!/esm/**/*
5-
*.tsbuildinfo

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"main": "dist/index.js",
1616
"module": "esm/index.js",
17-
"types": "dist/index.d.ts",
17+
"types": "build/types/index.d.ts",
1818
"dependencies": {
1919
"@sentry/types": "6.19.3",
2020
"@sentry/utils": "6.19.3",

packages/minimal/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/minimal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/nextjs/.npmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*
2+
!/dist/**/*
3+
!/esm/**/*
4+
!/build/types/**/*

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"main": "./dist/index.server.js",
1313
"module": "./esm/index.server.js",
1414
"browser": "./esm/index.client.js",
15-
"types": "./esm/index.server.d.ts",
15+
"types": "./build/types/index.server.d.ts",
1616
"publishConfig": {
1717
"access": "public"
1818
},

packages/node/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!build/types/**/*

packages/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/react/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/serverless/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/**/*

packages/serverless/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/tracing/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
!/dist/**/*
33
!/build/**/*
44
!/esm/**/*
5-
*.tsbuildinfo

packages/tracing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/types/.npmignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
*
22
!/dist/**/*
33
!/esm/**/*
4-
*.tsbuildinfo
4+
!/build/types/**/*

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/typescript/.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*
22
!/tsconfig.json
33
!/tslint.json
4-
*.tsbuildinfo

packages/utils/.npmignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
*
2-
!*.js.map
3-
!*.d.ts
4-
!*.js
52
!/esm/**/*
6-
jest.config.js
3+
!/dist/**/*
4+
!/build/types/**/*

packages/utils/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/vue/.npmignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
*
22
!/dist/**/*
3-
!/build/**/*
43
!/esm/**/*
5-
*.tsbuildinfo
4+
!/build/**/*

packages/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

packages/wasm/.npmignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
*
2-
!*.js.map
3-
!*.d.ts
4-
!*.js
2+
!/dist/**/*
53
!/esm/**/*
6-
jest.config.js
4+
!/build/types/**/*

packages/wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"main": "dist/index.js",
1313
"module": "esm/index.js",
14-
"types": "dist/index.d.ts",
14+
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
1717
},

scripts/postbuild.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ BUILD_DIR=build
99

1010
ASSETS="README.md
1111
LICENSE
12-
package.json"
12+
package.json
13+
.npmignore"
1314

1415
# check if build dir exists
1516
if [ ! -d $BUILD_DIR ]; then

0 commit comments

Comments
 (0)