Skip to content

Commit 57f4832

Browse files
authored
ref(build): Add central build directory to packages without CDN bundles (Part 2) (#4868)
1 parent b1f4fbc commit 57f4832

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+86
-172
lines changed

.npmignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
2+
# into it by the prepack script `scripts/prepack.ts`.
3+
4+
*
5+
6+
# TODO remove bundles (which in the tarball are inside `build`) in v7
7+
!/build/**/*
8+
9+
!/dist/**/*
10+
!/esm/**/*
11+
!/types/**/*

.size-limit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ module.exports = [
3939
},
4040
{
4141
name: '@sentry/react - Webpack (gzipped + minified)',
42-
path: 'packages/react/esm/index.js',
42+
path: 'packages/react/build/esm/index.js',
4343
import: '{ init }',
4444
gzip: true,
4545
limit: '100 KB',
4646
},
4747
{
4848
name: '@sentry/nextjs Client - Webpack (gzipped + minified)',
49-
path: 'packages/nextjs/esm/index.client.js',
49+
path: 'packages/nextjs/build/esm/index.client.js',
5050
import: '{ init }',
5151
gzip: true,
5252
limit: '100 KB',

packages/browser/.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/browser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"build:dev:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
5959
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
6060
"build:types:watch": "tsc -p tsconfig.types.json --watch",
61-
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build/npm",
61+
"build:npm": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm",
6262
"circularDepCheck": "madge --circular src/index.ts",
6363
"clean": "rimraf build coverage .rpt2_cache",
6464
"fix": "run-s fix:eslint fix:prettier",

packages/core/.npmignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3636
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
3737
"build:types:watch": "tsc -p tsconfig.types.json --watch",
38-
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
38+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
3939
"circularDepCheck": "madge --circular src/index.ts",
4040
"clean": "rimraf dist esm build coverage",
4141
"fix": "run-s fix:eslint fix:prettier",

packages/gatsby/.npmignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
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-
# prepack script `sentry-javascript/scripts/prepack.ts`.
1+
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
2+
# into it by the prepack script `scripts/prepack.ts`.
43

54
*
65

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4747
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4848
"build:types:watch": "tsc -p tsconfig.types.json --watch",
49-
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
49+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
5050
"circularDepCheck": "madge --circular src/index.ts",
5151
"clean": "rimraf dist esm build coverage",
5252
"fix": "run-s fix:eslint fix:prettier",

packages/hub/.npmignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3434
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
3535
"build:types:watch": "tsc -p tsconfig.types.json --watch",
36-
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
36+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
3737
"circularDepCheck": "madge --circular src/index.ts",
3838
"clean": "rimraf dist esm coverage",
3939
"fix": "run-s fix:eslint fix:prettier",

packages/integrations/.npmignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/integrations/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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": "ts-node ../../scripts/prepack.ts && npm pack ./build/npm",
41+
"build:npm": "ts-node ../../scripts/prepack.ts --bundles && 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/minimal/.npmignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/minimal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
3434
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
3535
"build:types:watch": "tsc -p tsconfig.types.json --watch",
36-
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
36+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
3737
"circularDepCheck": "madge --circular src/index.ts",
3838
"clean": "rimraf dist esm build coverage",
3939
"fix": "run-s fix:eslint fix:prettier",

packages/nextjs/.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/nextjs/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"engines": {
1010
"node": ">=6"
1111
},
12-
"main": "./dist/index.server.js",
13-
"module": "./esm/index.server.js",
14-
"browser": "./esm/index.client.js",
15-
"types": "./build/types/index.server.d.ts",
12+
"main": "build/dist/index.server.js",
13+
"module": "build/esm/index.server.js",
14+
"browser": "build/esm/index.client.js",
15+
"types": "build/types/index.server.d.ts",
1616
"publishConfig": {
1717
"access": "public"
1818
},
@@ -55,9 +55,9 @@
5555
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5656
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
5757
"build:types:watch": "tsc -p tsconfig.types.json --watch",
58-
"build:npm": "npm pack",
58+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
5959
"circularDepCheck": "madge --circular src/index.client.ts && madge --circular --exclude 'config/types\\.ts' src/index.server.ts # see https://github.com/pahen/madge/issues/306",
60-
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
60+
"clean": "rimraf dist esm build coverage *.js *.js.map *.d.ts",
6161
"fix": "run-s fix:eslint fix:prettier",
6262
"fix:eslint": "eslint . --format stylish --fix",
6363
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",

packages/nextjs/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/nextjs/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/node/.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/node/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"engines": {
1010
"node": ">=6"
1111
},
12-
"main": "dist/index.js",
13-
"module": "esm/index.js",
12+
"main": "build/dist/index.js",
13+
"module": "build/esm/index.js",
1414
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
@@ -46,9 +46,9 @@
4646
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
4747
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
4848
"build:types:watch": "tsc -p tsconfig.types.json --watch",
49-
"build:npm": "npm pack",
49+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
5050
"circularDepCheck": "madge --circular src/index.ts",
51-
"clean": "rimraf dist esm coverage",
51+
"clean": "rimraf dist esm build coverage",
5252
"fix": "run-s fix:eslint fix:prettier",
5353
"fix:eslint": "eslint . --format stylish --fix",
5454
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",

packages/node/test/manual/apm-transaction/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const http = require('http');
22
const express = require('express');
33
const app = express();
4-
const Sentry = require('../../../dist');
4+
const Sentry = require('../../../build/dist');
55

66
Sentry.init({
77
debug: true,

packages/node/test/manual/express-scope-separation/start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const http = require('http');
22
const express = require('express');
33
const app = express();
4-
const Sentry = require('../../../dist');
4+
const Sentry = require('../../../build/dist');
55

66
function assertTags(actual, expected) {
77
if (JSON.stringify(actual) !== JSON.stringify(expected)) {

packages/node/test/manual/memory-leak/context-memory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../dist');
1+
const Sentry = require('../../../build/dist');
22

33
Sentry.init({ dsn: 'https://[email protected]/12345' });
44

packages/node/test/manual/memory-leak/express-patient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../dist');
1+
const Sentry = require('../../../build/dist');
22

33
Sentry.init({ dsn: 'https://[email protected]/12345' });
44

packages/node/test/manual/release-health/session-aggregates/aggregates-disable-single-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const http = require('http');
22
const express = require('express');
33
const app = express();
4-
const Sentry = require('../../../../dist');
4+
const Sentry = require('../../../../build/dist');
55
const { assertSessions, BaseDummyTransport } = require('../test-utils');
66

77
function cleanUpAndExitSuccessfully() {

packages/node/test/manual/release-health/single-session/caught-exception-errored-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const {
33
assertSessions,
44
constructStrippedSessionObject,

packages/node/test/manual/release-health/single-session/errors-in-session-capped-to-one.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const {
33
assertSessions,
44
constructStrippedSessionObject,

packages/node/test/manual/release-health/single-session/healthy-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const {
33
assertSessions,
44
constructStrippedSessionObject,

packages/node/test/manual/release-health/single-session/terminal-state-sessions-sent-once.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const {
33
assertSessions,
44
constructStrippedSessionObject,

packages/node/test/manual/release-health/single-session/uncaught-exception-crashed-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const { assertSessions, constructStrippedSessionObject, BaseDummyTransport } = require('../test-utils');
33

44
class DummyTransport extends BaseDummyTransport {

packages/node/test/manual/release-health/single-session/unhandled-rejection-crashed-session.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../../dist');
1+
const Sentry = require('../../../../build/dist');
22
const {
33
assertSessions,
44
constructStrippedSessionObject,

packages/node/test/manual/webpack-domain/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Sentry = require('../../../dist');
1+
const Sentry = require('../../../build/dist');
22

33
let remaining = 2;
44

packages/node/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/node/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/react/.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"engines": {
1010
"node": ">=6"
1111
},
12-
"main": "dist/index.js",
13-
"module": "esm/index.js",
12+
"main": "build/dist/index.js",
13+
"module": "build/esm/index.js",
1414
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
@@ -61,7 +61,7 @@
6161
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
6262
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
6363
"build:types:watch": "tsc -p tsconfig.types.json --watch",
64-
"build:npm": "npm pack",
64+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
6565
"circularDepCheck": "madge --circular src/index.ts",
6666
"clean": "rimraf dist esm build coverage",
6767
"fix": "run-s fix:eslint fix:prettier",

packages/react/tsconfig.cjs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/react/tsconfig.esm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

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

packages/serverless/.npmignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/serverless/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"engines": {
1010
"node": ">=10"
1111
},
12-
"main": "dist/index.js",
13-
"module": "esm/index.js",
12+
"main": "build/dist/index.js",
13+
"module": "build/esm/index.js",
1414
"types": "build/types/index.d.ts",
1515
"publishConfig": {
1616
"access": "public"
@@ -52,7 +52,7 @@
5252
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
5353
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
5454
"build:types:watch": "tsc -p tsconfig.types.json --watch",
55-
"build:npm": "npm pack",
55+
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
5656
"circularDepCheck": "madge --circular src/index.ts",
5757
"clean": "rimraf dist esm build dist-awslambda-layer coverage",
5858
"fix": "run-s fix:eslint fix:prettier",

packages/serverless/scripts/build-awslambda-layer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async function collectPackages(cwd, packages = {}) {
6969

7070
async function main() {
7171
const workDir = path.resolve(__dirname, '..'); // packages/serverless directory
72-
const distRequirements = path.resolve(workDir, 'dist');
72+
const distRequirements = path.resolve(workDir, 'build', 'dist');
7373
if (!fs.existsSync(distRequirements)) {
7474
console.log(`The path ${distRequirements} must exist.`);
7575
return;

0 commit comments

Comments
 (0)