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 8 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
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
7 changes: 6 additions & 1 deletion packages/nextjs/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*

!/dist/**/*
!/esm/**/*
!/build/types/**/*
!/types/**/*
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 -noBundles && 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"
}
}
7 changes: 6 additions & 1 deletion packages/node/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*

!/dist/**/*
!/esm/**/*
!build/types/**/*
!/types/**/*
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 -noBundles && 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"
}
}
7 changes: 6 additions & 1 deletion packages/react/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*

!/dist/**/*
!/esm/**/*
!/build/types/**/*
!/types/**/*
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 -noBundles && 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"
}
}
7 changes: 6 additions & 1 deletion packages/serverless/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*

!/dist/**/*
!/esm/**/*
!/build/**/*
!/types/**/*
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 -noBundles && 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
2 changes: 1 addition & 1 deletion packages/serverless/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/serverless/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"
}
}
7 changes: 6 additions & 1 deletion packages/types/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*

!/dist/**/*
!/esm/**/*
!/build/types/**/*
!/types/**/*
7 changes: 4 additions & 3 deletions packages/types/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 All @@ -28,7 +28,8 @@
"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 -noBundles && npm pack ./build",
"clean": "rimraf dist esm build",
"link:yarn": "yarn link",
"lint": "run-s lint:prettier lint:eslint",
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
Expand Down
2 changes: 1 addition & 1 deletion packages/types/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/types/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"
}
}
9 changes: 7 additions & 2 deletions packages/utils/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 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`.

*
!/esm/**/*

!/dist/**/*
!/build/types/**/*
!/esm/**/*
!/types/**/*
8 changes: 4 additions & 4 deletions packages/utils/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 All @@ -36,9 +36,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 -noBundles && npm pack ./build",
"circularDepCheck": "madge --circular src/index.ts",
"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/utils/test/types/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');

const testStrings = ['/// <reference types="node" />'];

const paths = [path.join('./dist'), path.join('./esm')];
const paths = [path.join('./build/dist'), path.join('./build/esm')];

paths.forEach(dir => {
if (!fs.existsSync(dir)) {
Expand Down
Loading