@alessiofrittoli/exception 3.5.0 → 4.1.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.
@@ -0,0 +1,177 @@
1
+ import { ErrorCode } from "./code/index.cjs";
2
+ //#region src/error-names.d.ts
3
+ /**
4
+ * Exception Name.
5
+ *
6
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/DOMException#error_names)
7
+ */
8
+ export declare const ExceptionName: {
9
+ readonly Exception: "Exception";
10
+ readonly AbortError: "AbortError";
11
+ readonly NotAllowedError: "NotAllowedError";
12
+ readonly NotFoundError: "NotFoundError";
13
+ readonly NotSupportedError: "NotSupportedError";
14
+ readonly InvalidStateError: "InvalidStateError";
15
+ readonly InvalidAccessError: "InvalidAccessError";
16
+ readonly NetworkError: "NetworkError";
17
+ readonly SecurityError: "SecurityError";
18
+ readonly TimeoutError: "TimeoutError";
19
+ readonly QuotaExceededError: "QuotaExceededError";
20
+ readonly DataError: "DataError";
21
+ readonly EncodingError: "EncodingError";
22
+ readonly OperationError: "OperationError";
23
+ readonly ConstraintError: "ConstraintError";
24
+ readonly TransactionInactiveError: "TransactionInactiveError";
25
+ readonly ReadOnlyError: "ReadOnlyError";
26
+ readonly VersionError: "VersionError";
27
+ readonly NoModificationAllowedError: "NoModificationAllowedError";
28
+ readonly HierarchyRequestError: "HierarchyRequestError";
29
+ readonly WrongDocumentError: "WrongDocumentError";
30
+ readonly InvalidCharacterError: "InvalidCharacterError";
31
+ readonly NamespaceError: "NamespaceError";
32
+ readonly SyntaxError: "SyntaxError";
33
+ readonly DataCloneError: "DataCloneError";
34
+ readonly URLMismatchError: "URLMismatchError";
35
+ readonly InvalidModificationError: "InvalidModificationError";
36
+ readonly NotReadableError: "NotReadableError";
37
+ };
38
+ export type ExceptionName = (typeof ExceptionName)[keyof typeof ExceptionName];
39
+ //#endregion
40
+ //#region src/index.d.ts
41
+ /**
42
+ * Interface representing the options for an Exception.
43
+ *
44
+ * @template T The type of the error code.
45
+ *
46
+ * @extends ErrorOptions
47
+ */
48
+ export interface ExceptionOptions<T = ErrorCode> extends ErrorOptions {
49
+ /**
50
+ * The error interface name.
51
+ *
52
+ * @see {@link ExceptionName} for a list of possible standard values.
53
+ *
54
+ * @default ExceptionName.Exception
55
+ */
56
+ name?: string;
57
+ /**
58
+ * The error message containing technical informations about the error.
59
+ *
60
+ * It shouldn't be rendered to the user.
61
+ */
62
+ message?: string;
63
+ /**
64
+ * The error title.
65
+ *
66
+ */
67
+ title?: string;
68
+ /**
69
+ * The error description.
70
+ *
71
+ */
72
+ description?: string;
73
+ /**
74
+ * The error code associated with the Exception.
75
+ *
76
+ */
77
+ code: T;
78
+ /**
79
+ * Indicates whether the error is a critical error.
80
+ *
81
+ * @default false
82
+ */
83
+ isCritical?: boolean;
84
+ /**
85
+ * The HTTP status code associated with the Exception.
86
+ *
87
+ */
88
+ status?: number;
89
+ /**
90
+ * The error cause.
91
+ *
92
+ */
93
+ cause?: unknown;
94
+ }
95
+ /**
96
+ * Exception Class.
97
+ *
98
+ * @template T The type of the code property of the Exception. Defaults to `ErrorCode`.
99
+ *
100
+ * @extends Error
101
+ * @implements ExceptionOptions<T>
102
+ */
103
+ export declare class Exception<T = ErrorCode> extends Error {
104
+ private readonly __typename;
105
+ /**
106
+ * The error interface name.
107
+ *
108
+ */
109
+ readonly name: string;
110
+ /**
111
+ * The error message containing technical informations about the error.
112
+ *
113
+ * ⚠️ do not render `Exception.message` to the user.
114
+ */
115
+ readonly message: string;
116
+ /**
117
+ * The error title that can be rendered to the user.
118
+ *
119
+ */
120
+ readonly title: string | undefined;
121
+ /**
122
+ * The error description that can be rendered to the user.
123
+ *
124
+ */
125
+ readonly description: string | undefined;
126
+ /**
127
+ * The error code.
128
+ *
129
+ */
130
+ readonly code: T;
131
+ /**
132
+ * Indicates whether the error is a critical error.
133
+ *
134
+ */
135
+ readonly isCritical: boolean;
136
+ /**
137
+ * The HTTP status code associated with the Exception.
138
+ *
139
+ */
140
+ readonly status: number | undefined;
141
+ /**
142
+ * The error cause.
143
+ *
144
+ */
145
+ readonly cause: unknown;
146
+ /**
147
+ * Constructs a new Exception instance.
148
+ *
149
+ * @param options An object defining Exception options. See {@link ExceptionOptions} for more info.
150
+ */
151
+ constructor(options: ExceptionOptions<T>);
152
+ /**
153
+ * Determines if the provided error is an instance of the Exception class.
154
+ *
155
+ * @template T The type of the code property of the Exception.
156
+ *
157
+ * @param error The error to check.
158
+ * @returns `true` if the error is an instance of Exception or has a `__typename` property equal to 'Exception', `false` otherwise.
159
+ */
160
+ static isException<T = ErrorCode>(error: any): error is Exception<T>;
161
+ /**
162
+ * Determines if the provided error is an instance of the Exception class and has the ABORT ErrorCode.
163
+ *
164
+ * @template T The type of the code property of the Exception.
165
+ *
166
+ * @param error The error to check.
167
+ * @returns `true` if the error is an `Exception` and has the ABORT ErrorCode, `false` otherwise.
168
+ */
169
+ static isAbortError<T = ErrorCode>(error: any, code?: T): error is Exception<T>;
170
+ /**
171
+ * Converts the instance to a JSON object.
172
+ *
173
+ * @returns A JSON representation of the instance, including the message property.
174
+ */
175
+ toJSON(): this;
176
+ }
177
+ //#endregion
package/dist/index.d.mts CHANGED
@@ -1,71 +1,177 @@
1
- import { ErrorCode } from './code.mjs';
2
-
1
+ import { ErrorCode } from "./code/index.mjs";
2
+ //#region src/error-names.d.ts
3
+ /**
4
+ * Exception Name.
5
+ *
6
+ * [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/DOMException#error_names)
7
+ */
8
+ export declare const ExceptionName: {
9
+ readonly Exception: "Exception";
10
+ readonly AbortError: "AbortError";
11
+ readonly NotAllowedError: "NotAllowedError";
12
+ readonly NotFoundError: "NotFoundError";
13
+ readonly NotSupportedError: "NotSupportedError";
14
+ readonly InvalidStateError: "InvalidStateError";
15
+ readonly InvalidAccessError: "InvalidAccessError";
16
+ readonly NetworkError: "NetworkError";
17
+ readonly SecurityError: "SecurityError";
18
+ readonly TimeoutError: "TimeoutError";
19
+ readonly QuotaExceededError: "QuotaExceededError";
20
+ readonly DataError: "DataError";
21
+ readonly EncodingError: "EncodingError";
22
+ readonly OperationError: "OperationError";
23
+ readonly ConstraintError: "ConstraintError";
24
+ readonly TransactionInactiveError: "TransactionInactiveError";
25
+ readonly ReadOnlyError: "ReadOnlyError";
26
+ readonly VersionError: "VersionError";
27
+ readonly NoModificationAllowedError: "NoModificationAllowedError";
28
+ readonly HierarchyRequestError: "HierarchyRequestError";
29
+ readonly WrongDocumentError: "WrongDocumentError";
30
+ readonly InvalidCharacterError: "InvalidCharacterError";
31
+ readonly NamespaceError: "NamespaceError";
32
+ readonly SyntaxError: "SyntaxError";
33
+ readonly DataCloneError: "DataCloneError";
34
+ readonly URLMismatchError: "URLMismatchError";
35
+ readonly InvalidModificationError: "InvalidModificationError";
36
+ readonly NotReadableError: "NotReadableError";
37
+ };
38
+ export type ExceptionName = (typeof ExceptionName)[keyof typeof ExceptionName];
39
+ //#endregion
40
+ //#region src/index.d.ts
3
41
  /**
4
42
  * Interface representing the options for an Exception.
5
43
  *
6
- * @template TCode The type of the error code.
44
+ * @template T The type of the error code.
45
+ *
7
46
  * @extends ErrorOptions
8
47
  */
9
- interface ExceptionOptions<TCode = ErrorCode> extends ErrorOptions {
10
- /** The error code associated with the Exception. */
11
- code: TCode;
12
- /** The name of the Exception. */
13
- name?: string;
14
- /** The HTTP status code associated with the Exception. */
15
- status?: number;
48
+ export interface ExceptionOptions<T = ErrorCode> extends ErrorOptions {
49
+ /**
50
+ * The error interface name.
51
+ *
52
+ * @see {@link ExceptionName} for a list of possible standard values.
53
+ *
54
+ * @default ExceptionName.Exception
55
+ */
56
+ name?: string;
57
+ /**
58
+ * The error message containing technical informations about the error.
59
+ *
60
+ * It shouldn't be rendered to the user.
61
+ */
62
+ message?: string;
63
+ /**
64
+ * The error title.
65
+ *
66
+ */
67
+ title?: string;
68
+ /**
69
+ * The error description.
70
+ *
71
+ */
72
+ description?: string;
73
+ /**
74
+ * The error code associated with the Exception.
75
+ *
76
+ */
77
+ code: T;
78
+ /**
79
+ * Indicates whether the error is a critical error.
80
+ *
81
+ * @default false
82
+ */
83
+ isCritical?: boolean;
84
+ /**
85
+ * The HTTP status code associated with the Exception.
86
+ *
87
+ */
88
+ status?: number;
89
+ /**
90
+ * The error cause.
91
+ *
92
+ */
93
+ cause?: unknown;
16
94
  }
17
95
  /**
18
96
  * Exception Class.
19
97
  *
20
- * @template TMessage The type of the message property of the Exception. Defaults to `string`.
21
- * @template TCode The type of the code property of the Exception. Defaults to `ErrorCode`.
98
+ * @template T The type of the code property of the Exception. Defaults to `ErrorCode`.
22
99
  *
23
100
  * @extends Error
24
- * @implements ExceptionOptions<TCode>
101
+ * @implements ExceptionOptions<T>
25
102
  */
26
- declare class Exception<TMessage = string, TCode = ErrorCode> extends Error implements ExceptionOptions<TCode> {
27
- message: TMessage;
28
- status: number | undefined;
29
- name: string;
30
- private __typename;
31
- code: TCode;
32
- /**
33
- * Constructs a new Exception instance.
34
- *
35
- * @param message The message describing the exception.
36
- * @param options Additional options for the exception.
37
- */
38
- constructor(message: TMessage, options: ExceptionOptions<TCode>);
39
- /**
40
- * Determines if the provided error is an instance of the Exception class.
41
- *
42
- * @template TMessage The type of the message property of the Exception.
43
- * @template TCode The type of the code property of the Exception.
44
- *
45
- * @param error The error to check.
46
- * @returns `true` if the error is an instance of Exception or has a `__typename` property equal to 'Exception', `false` otherwise.
47
- */
48
- static isException<TMessage = string, TCode = ErrorCode>(error: any): error is Exception<TMessage, TCode>;
49
- /**
50
- * Determines if the provided error is an instance of the Exception class and has the ABORT ErrorCode.
51
- *
52
- * This won't work for `new DOMException( 'Abort reason', 'AbortError' )` since we type guard the checked value to `Exception<TMessage, ErrorCode.ABORT>`.
53
- *
54
- * @template TMessage The type of the message property of the Exception.
55
- *
56
- * @param error The error to check.
57
- * @returns `true` if the error is an `Exception` and has the ABORT ErrorCode, `false` otherwise.
58
- */
59
- static isAbortError<TMessage = string, TCode = ErrorCode>(error: any, code?: TCode): error is Exception<TMessage, TCode>;
60
- /**
61
- * Converts the instance to a JSON object.
62
- *
63
- * @returns A JSON representation of the instance, including the message property.
64
- */
65
- toJSON(): this & {
66
- message: TMessage;
67
- cause: unknown;
68
- };
103
+ export declare class Exception<T = ErrorCode> extends Error {
104
+ private readonly __typename;
105
+ /**
106
+ * The error interface name.
107
+ *
108
+ */
109
+ readonly name: string;
110
+ /**
111
+ * The error message containing technical informations about the error.
112
+ *
113
+ * ⚠️ do not render `Exception.message` to the user.
114
+ */
115
+ readonly message: string;
116
+ /**
117
+ * The error title that can be rendered to the user.
118
+ *
119
+ */
120
+ readonly title: string | undefined;
121
+ /**
122
+ * The error description that can be rendered to the user.
123
+ *
124
+ */
125
+ readonly description: string | undefined;
126
+ /**
127
+ * The error code.
128
+ *
129
+ */
130
+ readonly code: T;
131
+ /**
132
+ * Indicates whether the error is a critical error.
133
+ *
134
+ */
135
+ readonly isCritical: boolean;
136
+ /**
137
+ * The HTTP status code associated with the Exception.
138
+ *
139
+ */
140
+ readonly status: number | undefined;
141
+ /**
142
+ * The error cause.
143
+ *
144
+ */
145
+ readonly cause: unknown;
146
+ /**
147
+ * Constructs a new Exception instance.
148
+ *
149
+ * @param options An object defining Exception options. See {@link ExceptionOptions} for more info.
150
+ */
151
+ constructor(options: ExceptionOptions<T>);
152
+ /**
153
+ * Determines if the provided error is an instance of the Exception class.
154
+ *
155
+ * @template T The type of the code property of the Exception.
156
+ *
157
+ * @param error The error to check.
158
+ * @returns `true` if the error is an instance of Exception or has a `__typename` property equal to 'Exception', `false` otherwise.
159
+ */
160
+ static isException<T = ErrorCode>(error: any): error is Exception<T>;
161
+ /**
162
+ * Determines if the provided error is an instance of the Exception class and has the ABORT ErrorCode.
163
+ *
164
+ * @template T The type of the code property of the Exception.
165
+ *
166
+ * @param error The error to check.
167
+ * @returns `true` if the error is an `Exception` and has the ABORT ErrorCode, `false` otherwise.
168
+ */
169
+ static isAbortError<T = ErrorCode>(error: any, code?: T): error is Exception<T>;
170
+ /**
171
+ * Converts the instance to a JSON object.
172
+ *
173
+ * @returns A JSON representation of the instance, including the message property.
174
+ */
175
+ toJSON(): this;
69
176
  }
70
-
71
- export { Exception, type ExceptionOptions };
177
+ //#endregion
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a}from"./chunk-RAHIXT6K.mjs";import"./chunk-VBWDYSF3.mjs";export{a as Exception};
1
+ import{ErrorCode as e}from"./code/index.mjs";const t={Exception:`Exception`,AbortError:`AbortError`,NotAllowedError:`NotAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InvalidStateError:`InvalidStateError`,InvalidAccessError:`InvalidAccessError`,NetworkError:`NetworkError`,SecurityError:`SecurityError`,TimeoutError:`TimeoutError`,QuotaExceededError:`QuotaExceededError`,DataError:`DataError`,EncodingError:`EncodingError`,OperationError:`OperationError`,ConstraintError:`ConstraintError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,NoModificationAllowedError:`NoModificationAllowedError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NamespaceError:`NamespaceError`,SyntaxError:`SyntaxError`,DataCloneError:`DataCloneError`,URLMismatchError:`URLMismatchError`,InvalidModificationError:`InvalidModificationError`,NotReadableError:`NotReadableError`};var n=class n extends Error{__typename=t.Exception;name=this.__typename;message;title;description;code;isCritical;status;cause;constructor(e){let{message:t=`Unknown error.`}=e;super(t),e.name&&(this.name=e.name),this.message=t,this.title=e.title,this.description=e.description,this.code=e.code,this.isCritical=e.isCritical??!1,this.status=e.status,this.cause=n.isException(e.cause)?new n(e.cause):e.cause}static isException(e){return e instanceof n||typeof e==`object`&&`__typename`in e&&e.__typename===t.Exception}static isAbortError(r,i=e.ABORT){return n.isException(r)&&(r.name===t.AbortError||r.code===i)}toJSON(){return{...this,message:this.message,cause:this.cause}}};export{n as Exception,t as ExceptionName};
package/license.md CHANGED
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,112 +1,101 @@
1
1
  {
2
- "name": "@alessiofrittoli/exception",
3
- "version": "3.5.0",
4
- "description": "Handle errors with ease",
5
- "author": {
6
- "name": "Alessio Frittoli",
7
- "email": "info@alessiofrittoli.it",
8
- "url": "https://alessiofrittoli.it"
9
- },
10
- "license": "MIT",
11
- "funding": [
12
- {
13
- "type": "github",
14
- "url": "https://github.com/sponsors/alessiofrittoli"
15
- }
16
- ],
17
- "keywords": [
18
- "exceptions",
19
- "errors"
20
- ],
21
- "homepage": "https://github.com/alessiofrittoli/exception#readme",
22
- "bugs": {
23
- "url": "https://github.com/alessiofrittoli/exception/issues",
24
- "email": "info@alessiofrittoli.it"
25
- },
26
- "repository": {
27
- "type": "git",
28
- "url": "git+https://github.com/alessiofrittoli/exception.git"
29
- },
30
- "main": "./dist/index.js",
31
- "module": "./dist/index.mjs",
32
- "types": "./dist/index.d.ts",
33
- "files": [
34
- "dist"
35
- ],
36
- "exports": {
37
- ".": {
38
- "import": {
39
- "types": "./dist/index.d.mts",
40
- "default": "./dist/index.mjs"
41
- },
42
- "require": {
43
- "types": "./dist/index.d.ts",
44
- "default": "./dist/index.js"
45
- }
46
- },
47
- "./code": {
48
- "import": {
49
- "types": "./dist/code.d.mts",
50
- "default": "./dist/code.mjs"
51
- },
52
- "require": {
53
- "types": "./dist/code.d.ts",
54
- "default": "./dist/code.js"
55
- }
56
- },
57
- "./abort": {
58
- "import": {
59
- "types": "./dist/abort.d.mts",
60
- "default": "./dist/abort.mjs"
61
- },
62
- "require": {
63
- "types": "./dist/abort.d.ts",
64
- "default": "./dist/abort.js"
65
- }
66
- }
67
- },
68
- "sideEffects": false,
69
- "scripts": {
70
- "//1a": "*********************************************************************",
71
- "//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
72
- "//1c": "*********************************************************************",
73
- "dev": "cross-env NODE_ENV=development tsup --watch",
74
- "build:prod": "cross-env NODE_ENV=production tsup",
75
- "build": "pnpm lint && pnpm test:ci && pnpm build:prod",
76
- "lint": "eslint",
77
- "release": "node scripts/release.js --verbose --npm",
78
- "//2a": "*********************************************************************",
79
- "//2b": "***************************** UNIT TESTS ****************************",
80
- "//2c": "*********************************************************************",
81
- "test": "jest --verbose",
82
- "test:watch": "jest --watchAll --verbose",
83
- "test:ci": "jest --ci --verbose",
84
- "//3a": "*********************************************************************",
85
- "//3b": "************************ UNIT TESTS COVERAGE ************************",
86
- "//3c": "*********************************************************************",
87
- "test:coverage": "pnpm test:watch --coverage",
88
- "test:coverage:ci": "pnpm test:ci --coverage",
89
- "test:serve-coverage": "http-server ./coverage/lcov-report --gzip true -p 0 -o --silent",
90
- "test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""
91
- },
92
- "devDependencies": {
93
- "@alessiofrittoli/node-scripts": "^3.3.0",
94
- "@eslint/js": "^9.39.1",
95
- "@jest/globals": "^30.2.0",
96
- "@types/jest": "^30.0.0",
97
- "@types/node": "^24.10.1",
98
- "concurrently": "^9.2.1",
99
- "cross-env": "^10.1.0",
100
- "dotenv": "^17.2.3",
101
- "esbuild": "0.27.1",
102
- "eslint": "^9.39.1",
103
- "globals": "^16.5.0",
104
- "http-server": "^14.1.1",
105
- "jest": "^30.2.0",
106
- "ts-jest": "^29.4.6",
107
- "ts-node": "^10.9.2",
108
- "tsup": "^8.5.1",
109
- "typescript": "^5.9.3",
110
- "typescript-eslint": "^8.48.1"
111
- }
112
- }
2
+ "name": "@alessiofrittoli/exception",
3
+ "version": "4.1.0",
4
+ "description": "Handle errors with ease",
5
+ "type": "module",
6
+ "author": {
7
+ "name": "Alessio Frittoli",
8
+ "email": "info@alessiofrittoli.it",
9
+ "url": "https://alessiofrittoli.it"
10
+ },
11
+ "license": "MIT",
12
+ "funding": [
13
+ {
14
+ "type": "github",
15
+ "url": "https://github.com/sponsors/alessiofrittoli"
16
+ }
17
+ ],
18
+ "keywords": [
19
+ "exceptions",
20
+ "errors"
21
+ ],
22
+ "homepage": "https://github.com/alessiofrittoli/exception#readme",
23
+ "bugs": {
24
+ "url": "https://github.com/alessiofrittoli/exception/issues",
25
+ "email": "info@alessiofrittoli.it"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "git+https://github.com/alessiofrittoli/exception.git"
30
+ },
31
+ "engines": {
32
+ "node": ">=24.15.0",
33
+ "pnpm": ">=11.27.1"
34
+ },
35
+ "main": "./dist/index.cjs",
36
+ "module": "./dist/index.mjs",
37
+ "types": "./dist/index.d.mts",
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "exports": {
42
+ ".": {
43
+ "import": {
44
+ "types": "./dist/index.d.mts",
45
+ "default": "./dist/index.mjs"
46
+ },
47
+ "require": {
48
+ "types": "./dist/index.d.cts",
49
+ "default": "./dist/index.cjs"
50
+ }
51
+ },
52
+ "./*": {
53
+ "import": {
54
+ "types": "./dist/*/index.d.mts",
55
+ "default": "./dist/*/index.mjs"
56
+ },
57
+ "require": {
58
+ "types": "./dist/*/index.d.cts",
59
+ "default": "./dist/*/index.cjs"
60
+ }
61
+ }
62
+ },
63
+ "sideEffects": false,
64
+ "devDependencies": {
65
+ "@alessiofrittoli/node-scripts": "4.0.0-alpha.3",
66
+ "@alessiofrittoli/package-configs": "1.6.0",
67
+ "@types/node": "^24.19.1",
68
+ "@vitest/coverage-v8": "^5.0.3",
69
+ "concurrently": "^9.2.1",
70
+ "http-server": "^14.1.1",
71
+ "oxlint": "^1.86.0",
72
+ "prettier": "^3.9.9",
73
+ "prettier-plugin-sort-imports": "^1.8.11",
74
+ "tsdown": "^0.23.0",
75
+ "typescript": "^6.0.3",
76
+ "vite": "^8.3.2",
77
+ "vitest": "^5.0.3"
78
+ },
79
+ "scripts": {
80
+ "//1a": "*********************************************************************",
81
+ "//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
82
+ "//1c": "*********************************************************************",
83
+ "dev": "tsdown --watch",
84
+ "build": "pnpm lint && pnpm tsc && pnpm tsdown",
85
+ "lint": "oxlint --report-unused-disable-directives --max-warnings 0",
86
+ "release": "node scripts/release.ts --verbose --npm",
87
+ "//2a": "*********************************************************************",
88
+ "//2b": "***************************** UNIT TESTS ****************************",
89
+ "//2c": "*********************************************************************",
90
+ "test": "vitest --reporter=tree",
91
+ "test:watch": "pnpm test watch",
92
+ "test:ci": "pnpm test run",
93
+ "//3a": "*********************************************************************",
94
+ "//3b": "************************ UNIT TESTS COVERAGE ************************",
95
+ "//3c": "*********************************************************************",
96
+ "test:coverage": "pnpm test:watch --coverage",
97
+ "test:coverage:ci": "pnpm test:ci --coverage",
98
+ "test:serve-coverage": "http-server ./coverage --gzip true -p 0 -o /index.html --silent",
99
+ "test:coverage:serve": "concurrently --prefix none --kill-others \"pnpm test:coverage\" \"pnpm test:serve-coverage\""
100
+ }
101
+ }