Skip to content

Commit b17ac2e

Browse files
author
Jonas Gauffin
committed
Bug fixes required for nodejs, expressjs and angular
1 parent 6cb5a7d commit b17ac2e

27 files changed

+811
-1176
lines changed

.eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ module.exports = {
88
'eslint:recommended',
99
'plugin:@typescript-eslint/recommended',
1010
],
11+
rules: {
12+
"@typescript-eslint/no-explicit-any": "off",
13+
"@typescript-eslint/explicit-module-boundary-types": "off"
14+
},
1115
};

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
dist
33
/.rpt2_cache/*
4+
/*.tgz

README.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This library is currently available as a release candidate. Feel free to try it, and please give us feedback.
44

5-
![](./docs/telemetry.gif)
5+
![](https://coderr.io/docs/images/libraries/js/core/error.gif)
66

77
https://coderr.io
88

@@ -13,24 +13,24 @@ This library supports NodeJS and the browser (es6 module). There are also integr
1313

1414
Download this package:
1515

16-
```js
16+
```javascript
1717
npm -I coderr.client
1818
```
1919

2020
Add it to your application:
2121

22-
```js
23-
import * as coderr from "coderr.client";
22+
```javascript
23+
import { err } from "coderr.client";
2424

25-
coderr.configure("https://reporting.coderr.io", "yourAppKey");
25+
err.configuration.credentials("https://reporting.coderr.io", "yourAppKey");
2626
```
2727

2828
DOM errors will now automatically be reported (for browser-based applications).
2929

3030
To report errors:
3131

32-
```js
33-
import * as coderr from "coderr.client";
32+
```javascript
33+
import { err } from "coderr.client";
3434

3535
try {
3636
// Do something
@@ -39,7 +39,7 @@ try {
3939
}
4040
catch (e) {
4141
// You can attach any kind of data.
42-
coderr.report(e, {userId: 11, address: { City: "Falun" }});
42+
err.report(e, {userId: 11, address: { City: "Falun" }});
4343
}
4444
```
4545

@@ -48,43 +48,44 @@ catch (e) {
4848
Coderr detects the environment (production/development) automatically when running in node,
4949
for all other types of applications, specify it:
5050

51-
```js
52-
import * as coderr from "coderr.client";
51+
```javascript
52+
import { err } from "coderr.client";
5353

54-
coderr.configuration.environment = 'production';
54+
err.configuration.environment = 'production';
5555
```
5656

5757
### Application version
5858

5959
To see which application version an error exist, specify it:
6060

61-
```js
62-
import * as coderr from "coderr.client";
61+
```javascript
62+
import { err } from "coderr.client";
6363

64-
coderr.configuration.applicationVersion = '1.1.3';
64+
err.configuration.applicationVersion = '1.1.3';
6565
```
6666

6767

6868
# Example, integration library
6969

7070
You can, for instance, install the Express package:
7171

72-
```js
72+
```javascript
7373
npm -I coderr.client.expressjs
7474
```
7575

7676
And then activate it:
7777

78-
```js
79-
import { credentials } from "coderr.client";
80-
import { HttpError, errorMiddleware } from "coderr.client.expressjs";
78+
```javascript
79+
import { err } from "coderr.client";
80+
import { activatePlugin, errorMiddleware } from "coderr.client.expressjs";
8181

8282

83-
credentials("https://coderr.io", "yourAppKey", "yourSharedSecret");
83+
activatePlugin(err.configuration);
84+
err.configuration.credentials("https://coderr.io", "yourAppKey", "yourSharedSecret");
8485
```
8586

8687
Finally, activate the error middleware as the last middleware:
8788

88-
```
89+
```javascript
8990
app.use(errorMiddleware);
9091
```

docs/assets/css/main.css

-865
This file was deleted.

docs/telemetry.gif

-3.02 MB
Binary file not shown.

jest.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1+
//const {defaults} = require('jest-config');
12
module.exports = {
23
roots: ['<rootDir>'],
34
testMatch: [
45
"tests/**/*.+(ts|tsx|js)",
56
"**/?(*.)+(spec|test).+(ts|tsx|js)"
67
],
8+
// presets: [
9+
// ['@babel/preset-env', {targets: {node: 'current'}}],
10+
// '@babel/preset-typescript',
11+
// ],
712
transform: {
813
"^.+\\.(ts|tsx)$": "ts-jest"
914
},
15+
//moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
16+
"moduleDirectories": [
17+
"node_modules",
18+
"src"
19+
],
20+
"moduleFileExtensions": [
21+
"ts",
22+
"tsx",
23+
"js",
24+
"jsx"
25+
],
1026
"verbose": true,
1127
"testURL": "http://localhost/"
1228
}

0 commit comments

Comments
 (0)