Skip to content

Commit c0b315d

Browse files
committed
add central build dir to @sentry/integrations
1 parent 0045b5c commit c0b315d

File tree

8 files changed

+20
-12
lines changed

8 files changed

+20
-12
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ jobs:
204204
name: ${{ github.sha }}
205205
path: |
206206
${{ github.workspace }}/packages/browser/build/bundles/**
207-
${{ github.workspace }}/packages/integrations/build/**
207+
${{ github.workspace }}/packages/integrations/build/bundles/**
208208
${{ github.workspace }}/packages/tracing/build/**
209209
${{ github.workspace }}/packages/**/*.tgz
210210
${{ github.workspace }}/packages/serverless/dist-awslambda-layer/*.zip

packages/browser/test/integration/run.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function build() {
7373

7474
writeFile(
7575
'artifacts/dedupe.js',
76-
readFile('../../../integrations/build/dedupe.js').replace('//# sourceMappingURL=dedupe.js.map', '')
76+
readFile('../../../integrations/build/bundles/dedupe.js').replace('//# sourceMappingURL=dedupe.js.map', '')
7777
);
7878
concatFiles('artifacts/setup.js', ['artifacts/dedupe.js', 'common/utils.js', 'common/triggers.js', 'common/init.js']);
7979
rmdir('artifacts/dedupe.js');

packages/integrations/.npmignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
# Info: the paths in this file are specified so that they align with the file
2+
# structure in `./build` where this file is copied to. This is done by the
3+
# postbuild script `sentry-javascript/scripts/postbuild.ts`.
4+
15
*
2-
!/dist/**/*
6+
7+
# TODO remove bundles (which in the tarball are inside `build`) in v7
38
!/build/**/*
9+
10+
!/dist/**/*
411
!/esm/**/*
12+
!/types/**/*

packages/integrations/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"publishConfig": {
1313
"access": "public"
1414
},
15-
"main": "dist/index.js",
16-
"module": "esm/index.js",
17-
"types": "build/types/index.d.ts",
15+
"main": "build/npm/dist/index.js",
16+
"module": "build/npm/esm/index.js",
17+
"types": "build/npm/types/index.d.ts",
1818
"dependencies": {
1919
"@sentry/types": "6.19.4",
2020
"@sentry/utils": "6.19.4",
@@ -25,7 +25,7 @@
2525
"chai": "^4.1.2"
2626
},
2727
"scripts": {
28-
"build": "run-p build:cjs build:esm build:types build:bundle",
28+
"build": "run-p build:cjs build:esm build:types build:bundle && ts-node ../../scripts/postbuild.ts",
2929
"build:bundle": "bash scripts/buildBundles.sh",
3030
"build:cjs": "tsc -p tsconfig.cjs.json",
3131
"build:dev": "run-p build:cjs build:esm build:types",
@@ -38,7 +38,7 @@
3838
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3939
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4040
"build:types:watch": "tsc -p tsconfig.types.json --watch",
41-
"build:npm": "npm pack",
41+
"build:npm": "npm pack ./build/npm",
4242
"circularDepCheck": "madge --circular src/index.ts",
4343
"clean": "rimraf dist esm build coverage .rpt2_cache",
4444
"fix": "run-s fix:eslint fix:prettier",

packages/integrations/rollup.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const baseBundleConfig = makeBaseBundleConfig({
1212
isAddOn: true,
1313
jsVersion,
1414
licenseTitle: '@sentry/integrations',
15-
outputFileBase: `${file.replace('.ts', '')}${jsVersion === 'ES6' ? '.es6' : ''}`,
15+
outputFileBase: `bundles/${file.replace('.ts', '')}${jsVersion === 'ES6' ? '.es6' : ''}`,
1616
});
1717

1818
// TODO We only need `commonjs` for localforage (used in the offline plugin). Once that's fixed, this can come out.

packages/integrations/tsconfig.cjs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
"compilerOptions": {
55
"module": "commonjs",
6-
"outDir": "dist"
6+
"outDir": "build/npm/dist"
77
}
88
}

packages/integrations/tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
"compilerOptions": {
55
"module": "es6",
6-
"outDir": "esm"
6+
"outDir": "build/npm/esm"
77
}
88
}

packages/integrations/tsconfig.types.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true,
8-
"outDir": "build/types"
8+
"outDir": "build/npm/types"
99
}
1010
}

0 commit comments

Comments
 (0)