Skip to content

Commit 3151d0d

Browse files
authored
feat: add debug capabilities
2 parents 6ac1ff4 + cd22911 commit 3151d0d

File tree

28 files changed

+2747
-4088
lines changed

28 files changed

+2747
-4088
lines changed

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/BUG_REPORT.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: 🐛 Bug Report
22
description: Help us improve this repository by filing a detailed bug report.
33
title: '[bug]: '
4-
labels: [ 'issue: bug', 'status: to be confirmed' ]
4+
labels: ['issue: bug', 'status: to be confirmed']
55
body:
66
- type: textarea
77
attributes:

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
npx --no-install lint-staged
22
pnpm run ts:check
3-
pnpm run test --verbose=false
3+
pnpm run test --coverage --verbose=false

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"src/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run prettier:write", "pnpm run lint"]
2+
"{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}": ["pnpm run prettier:write", "pnpm run lint:fix"]
33
}

eslint.config.mjs

Lines changed: 57 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,64 @@ import pluginEslintImport from 'eslint-plugin-import';
22
import pluginTypescriptEslint from '@typescript-eslint/eslint-plugin';
33
import tsParser from '@typescript-eslint/parser';
44

5-
export default {
6-
languageOptions: {
7-
parser: tsParser,
8-
parserOptions: {
9-
project: ['./tsconfig.eslint.json'],
10-
},
11-
},
12-
files: ['{src,tests}/**/*.{js,ts,jsx,tsx,yml,yaml}'],
13-
plugins: {
14-
'@typescript-eslint': pluginTypescriptEslint,
15-
import: pluginEslintImport,
5+
export default [
6+
{
7+
// the "ignores" patterns have to be defined as the only key of a config object
8+
// see: https://eslint.org/docs/latest/use/configure/ignore#ignoring-directories
9+
ignores: ['dist', '.coverage', '.vscode', '.idea'],
1610
},
17-
rules: {
18-
// Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
19-
// while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
20-
// https://typescript-eslint.io/rules/no-unused-vars/
21-
'no-unused-vars': 'off',
22-
'@typescript-eslint/no-unused-vars': [
23-
'error',
24-
{
25-
args: 'all',
26-
argsIgnorePattern: '^_',
27-
caughtErrors: 'all',
28-
caughtErrorsIgnorePattern: '^_',
29-
destructuredArrayIgnorePattern: '^_',
30-
varsIgnorePattern: '^_',
31-
ignoreRestSiblings: true,
11+
{
12+
languageOptions: {
13+
parser: tsParser,
14+
parserOptions: {
15+
project: ['./tsconfig.eslint.json'],
3216
},
33-
],
17+
},
18+
files: ['{src,tests}/**/*.{js,ts,yml,yaml}'],
19+
plugins: {
20+
'@typescript-eslint': pluginTypescriptEslint,
21+
import: pluginEslintImport,
22+
},
23+
rules: {
24+
// Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
25+
// while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
26+
// https://typescript-eslint.io/rules/no-unused-vars/
27+
'no-unused-vars': 'off',
28+
'@typescript-eslint/no-unused-vars': [
29+
'error',
30+
{
31+
args: 'all',
32+
argsIgnorePattern: '^_',
33+
caughtErrors: 'all',
34+
caughtErrorsIgnorePattern: '^_',
35+
destructuredArrayIgnorePattern: '^_',
36+
varsIgnorePattern: '^_',
37+
ignoreRestSiblings: true,
38+
},
39+
],
3440

35-
// eslint-plugin-import
36-
'import/no-default-export': 'error',
37-
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
38-
'import/first': ['error'],
39-
'import/exports-last': ['error'],
40-
'import/order': [
41-
'error',
42-
{
43-
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'],
44-
'newlines-between': 'always',
45-
alphabetize: { order: 'asc', caseInsensitive: true },
46-
},
47-
],
41+
// eslint-plugin-import
42+
'import/no-default-export': 'error',
43+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
44+
'import/first': ['error'],
45+
'import/exports-last': ['error'],
46+
'import/order': [
47+
'error',
48+
{
49+
groups: [
50+
'builtin',
51+
'external',
52+
'internal',
53+
'parent',
54+
'sibling',
55+
'index',
56+
'object',
57+
'type',
58+
],
59+
'newlines-between': 'always',
60+
alphabetize: { order: 'asc', caseInsensitive: true },
61+
},
62+
],
63+
},
4864
},
49-
};
65+
];

package.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,16 @@
2424
"url": "https://strapi.io"
2525
}
2626
],
27+
"browser": "./dist/bundle.browser.min.js",
2728
"exports": {
2829
".": {
2930
"types": "./dist/index.d.ts",
3031
"require": "./dist/bundle.cjs.js",
31-
"import": "./dist/bundle.esm.js"
32+
"import": "./dist/bundle.esm.js",
33+
"browser": {
34+
"import": "./dist/bundle.browser.min.js",
35+
"require": "./dist/bundle.browser.min.js"
36+
}
3237
},
3338
"./package.json": "./package.json"
3439
},
@@ -42,6 +47,7 @@
4247
"clean": "pnpm exec rimraf ./dist",
4348
"lint": "eslint .",
4449
"lint:fix": "eslint . --fix",
50+
"lint:fix:dry": "eslint . --fix-dry-run",
4551
"prepare": "husky",
4652
"prettier:check": "prettier --check .",
4753
"prettier:write": "prettier --write .",
@@ -55,28 +61,33 @@
5561
"@commitlint/cli": "19.6.0",
5662
"@commitlint/config-conventional": "19.6.0",
5763
"@commitlint/types": "19.5.0",
58-
"@rollup/plugin-commonjs": "^28.0.1",
59-
"@rollup/plugin-node-resolve": "^15.3.0",
64+
"@rollup/plugin-commonjs": "28.0.1",
65+
"@rollup/plugin-node-resolve": "15.3.0",
66+
"@rollup/plugin-replace": "6.0.2",
67+
"@rollup/plugin-terser": "0.4.4",
6068
"@rollup/plugin-typescript": "12.1.1",
6169
"@strapi/eslint-config": "0.2.1",
62-
"@types/jest": "^29.5.14",
70+
"@types/debug": "4.1.12",
71+
"@types/jest": "29.5.14",
6372
"@typescript-eslint/eslint-plugin": "8.15.0",
6473
"@typescript-eslint/parser": "8.15.0",
6574
"eslint": "8.57.1",
6675
"eslint-plugin-import": "2.31.0",
6776
"husky": "9.1.7",
68-
"jest": "^29.7.0",
77+
"jest": "29.7.0",
6978
"lint-staged": "15.2.10",
7079
"prettier": "3.3.3",
7180
"rimraf": "6.0.1",
7281
"rollup": "4.27.3",
73-
"ts-jest": "^29.2.5",
82+
"ts-jest": "29.2.5",
7483
"typescript": "5.6.3"
7584
},
7685
"packageManager": "[email protected]",
7786
"engines": {
7887
"node": ">=18.0.0 <=22.x.x",
7988
"npm": ">=6.0.0"
8089
},
81-
"dependencies": {}
90+
"dependencies": {
91+
"debug": "4.4.0"
92+
}
8293
}

0 commit comments

Comments
 (0)