Skip to content

Commit a7ba3db

Browse files
committed
ref(angular): re-introduce tsc compile option for "legacy" package
re-add tsconfig for cjs and esm builds as well as a npm pack script to produce a "legacy" package that builds the SDK with `tsc`.
1 parent c690c50 commit a7ba3db

File tree

3 files changed

+34
-13
lines changed

3 files changed

+34
-13
lines changed

packages/angular/package.json

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"@angular/router": "10.x || 11.x || 12.x || 13.x"
2222
},
2323
"dependencies": {
24-
"@sentry/browser": "^6.18.0",
25-
"@sentry/types": "^6.18.0",
26-
"@sentry/utils": "^6.18.0",
24+
"@sentry/browser": "6.18.0",
25+
"@sentry/types": "6.18.0",
26+
"@sentry/utils": "6.18.0",
2727
"rxjs": "^6.6.0",
2828
"tslib": "^2.0.0"
2929
},
@@ -44,17 +44,21 @@
4444
"zone.js": "~0.10.2"
4545
},
4646
"scripts": {
47-
"build": "run-p build:esm #**not necessary** build:cjs",
48-
"build:cjs": "#**not necessary** tsc -p tsconfig.cjs.json",
47+
"build": "run-p build:ngc",
48+
"build:legacy": "run-p build:esm build:cjs",
49+
"build:cjs": "tsc -p tsconfig.cjs.json",
4950
"build:dev": "run-s build",
50-
"build:es5": "#**not necessary** yarn build:cjs # *** backwards compatibility - remove in v7 ***",
51-
"build:esm": "ng build --prod",
52-
"build:watch": "run-p build:esm:watch #build:cjs:watch",
53-
"build:cjs:watch": "#**not necessary** tsc -p tsconfig.cjs.json --watch",
51+
"build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
52+
"build:esm": "tsc -p tsconfig.esm.json",
53+
"build:ngc": "ng build --prod",
54+
"build:watch": "run-p build:ngc:watch",
55+
"build:legacy:watch": "run-p build:esm:watch build:cjs:watch",
56+
"build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
5457
"build:dev:watch": "run-s build:watch",
55-
"build:es5:watch": "#**not necessary** yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
56-
"build:esm:watch": "ng build --prod --watch",
57-
"circularDepCheck": "madge --circular projects/sentry-angular/src/index.ts #TODO change to final index path!!",
58+
"build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
59+
"build:esm:watch": "tsc -p tsconfig.esm.json --watch",
60+
"build:ngc:watch": "ng build --prod --watch",
61+
"circularDepCheck": "madge --circular src/index.ts",
5862
"clean": "rimraf dist esm build coverage",
5963
"fix": "run-s fix:eslint fix:prettier",
6064
"fix:eslint": "eslint . --format stylish --fix",
@@ -63,7 +67,8 @@
6367
"lint": "run-s lint:prettier lint:eslint",
6468
"lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
6569
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
66-
"pack": "cd ./dist && npm pack"
70+
"pack": "cd ./dist && npm pack",
71+
"pack:legacy": "npm pack"
6772
},
6873
"volta": {
6974
"extends": "../../package.json"

packages/angular/tsconfig.cjs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "dist"
7+
}
8+
}

packages/angular/tsconfig.esm.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
4+
"compilerOptions": {
5+
"module": "es6",
6+
"outDir": "esm"
7+
}
8+
}

0 commit comments

Comments
 (0)