Skip to content

ref(build): Add central build directory to packages without CDN bundles (Part 2) #4868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
# into it by the prepack script `scripts/prepack.ts`.

*

# TODO remove bundles (which in the tarball are inside `build`) in v7
!/build/**/*

!/dist/**/*
!/esm/**/*
!/types/**/*
4 changes: 2 additions & 2 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ module.exports = [
},
{
name: '@sentry/react - Webpack (gzipped + minified)',
path: 'packages/react/esm/index.js',
path: 'packages/react/build/esm/index.js',
import: '{ init }',
gzip: true,
limit: '100 KB',
},
{
name: '@sentry/nextjs Client - Webpack (gzipped + minified)',
path: 'packages/nextjs/esm/index.client.js',
path: 'packages/nextjs/build/esm/index.client.js',
import: '{ init }',
gzip: true,
limit: '100 KB',
Expand Down
12 changes: 0 additions & 12 deletions packages/browser/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"build:dev:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build/npm",
"build:npm": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage .rpt2_cache",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
9 changes: 0 additions & 9 deletions packages/core/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
5 changes: 2 additions & 3 deletions packages/gatsby/.npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Info: the paths in this file are specified so that they align with the file
# structure in `./build` where this file is copied to. This is done by the
# prepack script `sentry-javascript/scripts/prepack.ts`.
# The paths in this file are specified so that they align with the file structure in `./build` after this file is copied
# into it by the prepack script `scripts/prepack.ts`.

*

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
9 changes: 0 additions & 9 deletions packages/hub/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
12 changes: 0 additions & 12 deletions packages/integrations/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/integrations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build/npm",
"build:npm": "ts-node ../../scripts/prepack.ts --bundles && npm pack ./build/npm",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage .rpt2_cache",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
9 changes: 0 additions & 9 deletions packages/minimal/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion packages/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "ts-node ../../scripts/prepack.ts -noBundles && npm pack ./build",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
4 changes: 0 additions & 4 deletions packages/nextjs/.npmignore

This file was deleted.

12 changes: 6 additions & 6 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"engines": {
"node": ">=6"
},
"main": "./dist/index.server.js",
"module": "./esm/index.server.js",
"browser": "./esm/index.client.js",
"types": "./build/types/index.server.d.ts",
"main": "build/dist/index.server.js",
"module": "build/esm/index.server.js",
"browser": "build/esm/index.client.js",
"types": "build/types/index.server.d.ts",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -55,9 +55,9 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "npm pack",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"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",
"clean": "rimraf dist esm coverage *.js *.js.map *.d.ts",
"clean": "rimraf dist esm build coverage *.js *.js.map *.d.ts",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "commonjs",
"outDir": "dist"
"outDir": "build/dist"
}
}
2 changes: 1 addition & 1 deletion packages/nextjs/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "es6",
"outDir": "esm"
"outDir": "build/esm"
}
}
4 changes: 0 additions & 4 deletions packages/node/.npmignore

This file was deleted.

8 changes: 4 additions & 4 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"engines": {
"node": ">=6"
},
"main": "dist/index.js",
"module": "esm/index.js",
"main": "build/dist/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -46,9 +46,9 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "npm pack",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm coverage",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
"fix:eslint": "eslint . --format stylish --fix",
"fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/manual/apm-transaction/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const http = require('http');
const express = require('express');
const app = express();
const Sentry = require('../../../dist');
const Sentry = require('../../../build/dist');

Sentry.init({
debug: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const http = require('http');
const express = require('express');
const app = express();
const Sentry = require('../../../dist');
const Sentry = require('../../../build/dist');

function assertTags(actual, expected) {
if (JSON.stringify(actual) !== JSON.stringify(expected)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/manual/memory-leak/context-memory.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../dist');
const Sentry = require('../../../build/dist');

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

Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/manual/memory-leak/express-patient.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../dist');
const Sentry = require('../../../build/dist');

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const http = require('http');
const express = require('express');
const app = express();
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const { assertSessions, BaseDummyTransport } = require('../test-utils');

function cleanUpAndExitSuccessfully() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const {
assertSessions,
constructStrippedSessionObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const {
assertSessions,
constructStrippedSessionObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const {
assertSessions,
constructStrippedSessionObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const {
assertSessions,
constructStrippedSessionObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const { assertSessions, constructStrippedSessionObject, BaseDummyTransport } = require('../test-utils');

class DummyTransport extends BaseDummyTransport {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../../dist');
const Sentry = require('../../../../build/dist');
const {
assertSessions,
constructStrippedSessionObject,
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/manual/webpack-domain/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Sentry = require('../../../dist');
const Sentry = require('../../../build/dist');

let remaining = 2;

Expand Down
2 changes: 1 addition & 1 deletion packages/node/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "commonjs",
"outDir": "dist"
"outDir": "build/dist"
}
}
2 changes: 1 addition & 1 deletion packages/node/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "es6",
"outDir": "esm"
"outDir": "build/esm"
}
}
4 changes: 0 additions & 4 deletions packages/react/.npmignore

This file was deleted.

6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"engines": {
"node": ">=6"
},
"main": "dist/index.js",
"module": "esm/index.js",
"main": "build/dist/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -61,7 +61,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "npm pack",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/tsconfig.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "commonjs",
"outDir": "dist"
"outDir": "build/dist"
}
}
2 changes: 1 addition & 1 deletion packages/react/tsconfig.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

"compilerOptions": {
"module": "es6",
"outDir": "esm"
"outDir": "build/esm"
}
}
4 changes: 0 additions & 4 deletions packages/serverless/.npmignore

This file was deleted.

6 changes: 3 additions & 3 deletions packages/serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"engines": {
"node": ">=10"
},
"main": "dist/index.js",
"module": "esm/index.js",
"main": "build/dist/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -52,7 +52,7 @@
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:npm": "npm pack",
"build:npm": "ts-node ../../scripts/prepack.ts && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf dist esm build dist-awslambda-layer coverage",
"fix": "run-s fix:eslint fix:prettier",
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless/scripts/build-awslambda-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function collectPackages(cwd, packages = {}) {

async function main() {
const workDir = path.resolve(__dirname, '..'); // packages/serverless directory
const distRequirements = path.resolve(workDir, 'dist');
const distRequirements = path.resolve(workDir, 'build', 'dist');
if (!fs.existsSync(distRequirements)) {
console.log(`The path ${distRequirements} must exist.`);
return;
Expand Down
Loading