@alessiofrittoli/exception 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -6
- package/package.json +35 -12
package/README.md
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
# Exception 🚦
|
|
2
2
|
|
|
3
|
-
[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
|
|
3
|
+
[![NPM Latest Version][version-badge]][npm-url] [![Coverage Status][coverage-badge]][coverage-url] [![Socket Status][socket-badge]][socket-url] [![NPM Monthly Downloads][downloads-badge]][npm-url] [![Dependencies][deps-badge]][deps-url]
|
|
4
|
+
|
|
5
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
4
6
|
|
|
5
7
|
[version-badge]: https://img.shields.io/npm/v/%40alessiofrittoli%2Fexception
|
|
6
8
|
[npm-url]: https://npmjs.org/package/%40alessiofrittoli%2Fexception
|
|
7
9
|
[coverage-badge]: https://coveralls.io/repos/github/alessiofrittoli/exception/badge.svg
|
|
8
10
|
[coverage-url]: https://coveralls.io/github/alessiofrittoli/exception
|
|
11
|
+
[socket-badge]: https://socket.dev/api/badge/npm/package/@alessiofrittoli/exception
|
|
12
|
+
[socket-url]: https://socket.dev/npm/package/@alessiofrittoli/exception/overview
|
|
9
13
|
[downloads-badge]: https://img.shields.io/npm/dm/%40alessiofrittoli%2Fexception.svg
|
|
10
14
|
[deps-badge]: https://img.shields.io/librariesio/release/npm/%40alessiofrittoli%2Fexception
|
|
11
15
|
[deps-url]: https://libraries.io/npm/%40alessiofrittoli%2Fexception
|
|
12
16
|
|
|
17
|
+
[sponsor-badge]: https://img.shields.io/static/v1?label=Fund%20this%20package&message=%E2%9D%A4&logo=GitHub&color=%23DB61A2
|
|
18
|
+
[sponsor-url]: https://github.com/sponsors/alessiofrittoli
|
|
19
|
+
|
|
13
20
|
## Handle errors with ease
|
|
14
21
|
|
|
15
22
|
This documentation describes the `Exception` class, which provides a structured way to handle errors in TypeScript. It includes custom properties such as `code`, `name`, and `status` for more detailed error reporting and debugging.
|
|
@@ -22,6 +29,8 @@ This documentation describes the `Exception` class, which provides a structured
|
|
|
22
29
|
- [Exception Class](#exception-class)
|
|
23
30
|
- [Usage Scenarios](#usage-scenarios)
|
|
24
31
|
- [Development](#development)
|
|
32
|
+
- [Install depenendencies](#install-depenendencies)
|
|
33
|
+
- [Build the source code](#build-the-source-code)
|
|
25
34
|
- [ESLint](#eslint)
|
|
26
35
|
- [Jest](#jest)
|
|
27
36
|
- [Contributing](#contributing)
|
|
@@ -273,9 +282,9 @@ or using `pnpm`
|
|
|
273
282
|
pnpm i
|
|
274
283
|
```
|
|
275
284
|
|
|
276
|
-
#### Build
|
|
285
|
+
#### Build the source code
|
|
277
286
|
|
|
278
|
-
Run the following command to build code for distribution.
|
|
287
|
+
Run the following command to test and build code for distribution.
|
|
279
288
|
|
|
280
289
|
```bash
|
|
281
290
|
pnpm build
|
|
@@ -295,7 +304,7 @@ Run all the defined test suites by running the following:
|
|
|
295
304
|
|
|
296
305
|
```bash
|
|
297
306
|
# Run tests and watch file changes.
|
|
298
|
-
pnpm test
|
|
307
|
+
pnpm test:watch
|
|
299
308
|
|
|
300
309
|
# Run tests and watch file changes with jest-environment-jsdom.
|
|
301
310
|
pnpm test:jsdom
|
|
@@ -309,6 +318,8 @@ pnpm test:ci:jsdom
|
|
|
309
318
|
|
|
310
319
|
You can eventually run specific suits like so:
|
|
311
320
|
|
|
321
|
+
- See [`package.json`](./package.json) file scripts for more info.
|
|
322
|
+
|
|
312
323
|
```bash
|
|
313
324
|
pnpm test:jest
|
|
314
325
|
pnpm test:jest:jsdom
|
|
@@ -321,16 +332,21 @@ An HTTP server is then started to serve coverage files from `./coverage` folder.
|
|
|
321
332
|
⚠️ You may see a blank page the first time you run this command. Simply refresh the browser to see the updates.
|
|
322
333
|
|
|
323
334
|
```bash
|
|
324
|
-
|
|
335
|
+
test:coverage:serve
|
|
325
336
|
```
|
|
326
337
|
|
|
327
338
|
---
|
|
328
339
|
|
|
329
340
|
### Contributing
|
|
330
341
|
|
|
331
|
-
Contributions are truly welcome
|
|
342
|
+
Contributions are truly welcome!
|
|
343
|
+
|
|
332
344
|
Please refer to the [Contributing Doc](./CONTRIBUTING.md) for more information on how to start contributing to this project.
|
|
333
345
|
|
|
346
|
+
Help keep this project up to date with [GitHub Sponsor][sponsor-url].
|
|
347
|
+
|
|
348
|
+
[![GitHub Sponsor][sponsor-badge]][sponsor-url]
|
|
349
|
+
|
|
334
350
|
---
|
|
335
351
|
|
|
336
352
|
### Security
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/exception",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Handle errors with ease",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alessio Frittoli",
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
"url": "https://alessiofrittoli.it"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
|
+
"funding": [
|
|
12
|
+
{
|
|
13
|
+
"type": "github",
|
|
14
|
+
"url": "https://github.com/sponsors/alessiofrittoli"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
11
17
|
"keywords": [
|
|
12
18
|
"exceptions",
|
|
13
19
|
"errors"
|
|
@@ -41,43 +47,60 @@
|
|
|
41
47
|
},
|
|
42
48
|
"sideEffects": false,
|
|
43
49
|
"scripts": {
|
|
50
|
+
"//1a": "*********************************************************************",
|
|
51
|
+
"//1b": "*********************** BUILD - LINT - RELEASE **********************",
|
|
52
|
+
"//1c": "*********************************************************************",
|
|
44
53
|
"build": "pnpm lint && pnpm test:ci && tsup",
|
|
45
54
|
"build:watch": "tsup --watch",
|
|
46
55
|
"lint": "eslint",
|
|
47
56
|
"release": "node scripts/publish.js --verbose --npm",
|
|
48
|
-
"
|
|
57
|
+
"//2a": "*********************************************************************",
|
|
58
|
+
"//2b": "***************************** UNIT TESTS ****************************",
|
|
59
|
+
"//2c": "*********************************************************************",
|
|
60
|
+
"test": "jest --verbose",
|
|
49
61
|
"test:watch": "jest --watchAll --verbose",
|
|
50
62
|
"test:jsdom": "JSDOM=true pnpm test:watch",
|
|
51
63
|
"test:ci": "jest --ci --verbose",
|
|
52
64
|
"test:ci:jsdom": "JSDOM=true pnpm test:ci",
|
|
65
|
+
"//3a": "*********************************************************************",
|
|
66
|
+
"//3b": "************************ UNIT TESTS COVERAGE ************************",
|
|
67
|
+
"//3c": "*********************************************************************",
|
|
53
68
|
"test:coverage": "pnpm test:watch --coverage",
|
|
54
69
|
"test:ci:coverage": "pnpm test:ci --coverage",
|
|
55
70
|
"test:serve-coverage": "http-server ./coverage/lcov-report --gzip true -p 0 -o --silent",
|
|
56
71
|
"test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\"",
|
|
57
72
|
"test:coverage:jsdom": "JSDOM=true pnpm test:coverage",
|
|
58
73
|
"test:coverage:jsdom:serve": "JSDOM=true pnpm test:coverage:serve",
|
|
74
|
+
"//4a": "*********************************************************************",
|
|
75
|
+
"//4b": "************************ TARGETED UNIT TESTS ************************",
|
|
76
|
+
"//4c": "*********************************************************************",
|
|
59
77
|
"test:jest": "pnpm test:watch jest.test.ts",
|
|
60
78
|
"test:jest:jsdom": "JSDOM=true pnpm test:jest",
|
|
61
79
|
"test:exception": "pnpm test:watch exception.test.ts"
|
|
62
80
|
},
|
|
63
81
|
"devDependencies": {
|
|
64
|
-
"@alessiofrittoli/node-scripts": "^2.
|
|
65
|
-
"@eslint/js": "^9.
|
|
82
|
+
"@alessiofrittoli/node-scripts": "^2.3.1",
|
|
83
|
+
"@eslint/js": "^9.22.0",
|
|
66
84
|
"@jest/globals": "^29.7.0",
|
|
67
85
|
"@types/jest": "^29.5.14",
|
|
68
|
-
"@types/node": "^22.10
|
|
86
|
+
"@types/node": "^22.13.10",
|
|
69
87
|
"concurrently": "^9.1.2",
|
|
70
88
|
"dotenv": "^16.4.7",
|
|
71
|
-
"esbuild": "0.
|
|
72
|
-
"eslint": "^9.
|
|
73
|
-
"globals": "^
|
|
89
|
+
"esbuild": "0.25.1",
|
|
90
|
+
"eslint": "^9.22.0",
|
|
91
|
+
"globals": "^16.0.0",
|
|
74
92
|
"http-server": "^14.1.1",
|
|
75
93
|
"jest": "^29.7.0",
|
|
76
94
|
"jest-environment-jsdom": "^29.7.0",
|
|
77
|
-
"ts-jest": "^29.2.
|
|
95
|
+
"ts-jest": "^29.2.6",
|
|
78
96
|
"ts-node": "^10.9.2",
|
|
79
|
-
"tsup": "^8.
|
|
80
|
-
"typescript": "^5.
|
|
81
|
-
"typescript-eslint": "^8.
|
|
97
|
+
"tsup": "^8.4.0",
|
|
98
|
+
"typescript": "^5.8.2",
|
|
99
|
+
"typescript-eslint": "^8.27.0"
|
|
100
|
+
},
|
|
101
|
+
"pnpm": {
|
|
102
|
+
"onlyBuiltDependencies": [
|
|
103
|
+
"esbuild"
|
|
104
|
+
]
|
|
82
105
|
}
|
|
83
106
|
}
|