better-console-group 1.1.4 → 1.1.6

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,37 @@
1
+ ---
2
+ description: Setup and validation commands required for this repository.
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # Agent Instructions
7
+
8
+ These instructions apply to all coding agents in this repository (Cursor, Claude Code, Codex).
9
+
10
+ ## Required setup command
11
+
12
+ After opening or setting up the project, run:
13
+
14
+ ```bash
15
+ yarn
16
+ ```
17
+
18
+ ## Required validation command
19
+
20
+ After making changes, run:
21
+
22
+ ```bash
23
+ yarn format && yarn lint --fix && yarn build && yarn flow && yarn test
24
+ ```
25
+
26
+ Do not treat work as complete until the validation command succeeds. If it fails, fix the issues and run it again.
27
+
28
+ ## Pull Request issues
29
+
30
+ **Failed tests**: When the user mentions failed tests, fetch the PR's failed checks and inspect the relevant workflow runs. The `link` field contains the run ID in the format `.../actions/runs/<RUN_ID>/jobs/...`:
31
+
32
+ ```bash
33
+ gh pr checks <PR_NUMBER> --json name,state,link
34
+ gh run view <RUN_ID> --log-failed
35
+ ```
36
+
37
+ **Review comments**: When the user mentions comments, use `gh api graphql` to query `pullRequest.reviewThreads` and focus on threads where `isResolved` is `false`. The REST API does not expose resolution state — GraphQL `PullRequestReviewThread.isResolved` is required.
Binary file
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
package/AGENTS.md ADDED
@@ -0,0 +1,32 @@
1
+ # Agent Instructions
2
+
3
+ These instructions apply to all coding agents in this repository (Cursor, Claude Code, Codex).
4
+
5
+ ## Required setup command
6
+
7
+ After opening or setting up the project, run:
8
+
9
+ ```bash
10
+ yarn
11
+ ```
12
+
13
+ ## Required validation command
14
+
15
+ After making changes, run:
16
+
17
+ ```bash
18
+ yarn format && yarn lint --fix && yarn build && yarn flow && yarn test
19
+ ```
20
+
21
+ Do not treat work as complete until the validation command succeeds. If it fails, fix the issues and run it again.
22
+
23
+ ## Pull Request issues
24
+
25
+ **Failed tests**: When the user mentions failed tests, fetch the PR's failed checks and inspect the relevant workflow runs. The `link` field contains the run ID in the format `.../actions/runs/<RUN_ID>/jobs/...`:
26
+
27
+ ```bash
28
+ gh pr checks <PR_NUMBER> --json name,state,link
29
+ gh run view <RUN_ID> --log-failed
30
+ ```
31
+
32
+ **Review comments**: When the user mentions comments, use `gh api graphql` to query `pullRequest.reviewThreads` and focus on threads where `isResolved` is `false`. The REST API does not expose resolution state — GraphQL `PullRequestReviewThread.isResolved` is required.
package/CLAUDE.md ADDED
@@ -0,0 +1,32 @@
1
+ # Agent Instructions
2
+
3
+ These instructions apply to all coding agents in this repository (Cursor, Claude Code, Codex).
4
+
5
+ ## Required setup command
6
+
7
+ After opening or setting up the project, run:
8
+
9
+ ```bash
10
+ yarn
11
+ ```
12
+
13
+ ## Required validation command
14
+
15
+ After making changes, run:
16
+
17
+ ```bash
18
+ yarn format && yarn lint --fix && yarn build && yarn flow && yarn test
19
+ ```
20
+
21
+ Do not treat work as complete until the validation command succeeds. If it fails, fix the issues and run it again.
22
+
23
+ ## Pull Request issues
24
+
25
+ **Failed tests**: When the user mentions failed tests, fetch the PR's failed checks and inspect the relevant workflow runs. The `link` field contains the run ID in the format `.../actions/runs/<RUN_ID>/jobs/...`:
26
+
27
+ ```bash
28
+ gh pr checks <PR_NUMBER> --json name,state,link
29
+ gh run view <RUN_ID> --log-failed
30
+ ```
31
+
32
+ **Review comments**: When the user mentions comments, use `gh api graphql` to query `pullRequest.reviewThreads` and focus on threads where `isResolved` is `false`. The REST API does not expose resolution state — GraphQL `PullRequestReviewThread.isResolved` is required.
package/README.md CHANGED
@@ -134,7 +134,7 @@ for (let imageURL in imageURLs) {
134
134
  });
135
135
  }
136
136
 
137
- group.log('Finish processing image.');=
137
+ group.log('Finish processing image.');
138
138
  });
139
139
  processingPromises.push(processingPromise);
140
140
  }
package/index.js.flow CHANGED
@@ -1,5 +1,30 @@
1
+ declare class AsyncConsoleGroup {
2
+ asyncGroup<T>(
3
+ label: string,
4
+ callbackFn: (group: AsyncConsoleGroup) => Promise<T>,
5
+ thisArg?: any,
6
+ ): Promise<T>;
7
+ log(message?: any, ...optionalParams: any[]): void;
8
+ warn(message?: any, ...optionalParams: any[]): void;
9
+ error(message?: any, ...optionalParams: any[]): void;
10
+ debug(message?: any, ...optionalParams: any[]): void;
11
+ info(message?: any, ...optionalParams: any[]): void;
12
+ table(tabularData?: any, properties?: Array<string>): void;
13
+ trace(...data: any[]): void;
14
+ assert(condition?: boolean, message?: string, ...optionalParams: any[]): void;
15
+ time(label?: string): void;
16
+ timeEnd(label?: string): void;
17
+ dir(item?: any, options?: { ... }): void;
18
+ }
19
+
1
20
  declare export function betterGroup<T>(
2
21
  label: string,
3
22
  callbackFn: () => T,
4
23
  thisArg?: any,
5
24
  ): T;
25
+
26
+ declare export function asyncGroup<T>(
27
+ label: string,
28
+ callbackFn: (group: AsyncConsoleGroup) => Promise<T>,
29
+ thisArg?: any,
30
+ ): Promise<T>;
@@ -0,0 +1,2 @@
1
+ export * from './betterGroup.ts';
2
+ export * from './asyncGroup.ts';
@@ -0,0 +1,2 @@
1
+ export * from "./betterGroup.js";
2
+ export * from "./asyncGroup.js";
package/lib/asyncGroup.js CHANGED
@@ -1,24 +1,3 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
- if (kind === "m") throw new TypeError("Private method is not writable");
12
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
- };
16
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
- };
21
- var _AsyncConsoleGroup_instances, _AsyncConsoleGroup_buffer, _AsyncConsoleGroup_ended, _AsyncConsoleGroup_push;
22
1
  /**
23
2
  * A private class. Each of its instance represents a grouping of console messages.
24
3
  * You will receive an instance of this class when you call asyncGroup.
@@ -29,11 +8,15 @@ var _AsyncConsoleGroup_instances, _AsyncConsoleGroup_buffer, _AsyncConsoleGroup_
29
8
  * @param buffer The buffer that stores the console messages.
30
9
  */
31
10
  class AsyncConsoleGroup {
11
+ #buffer;
12
+ #ended = false;
32
13
  constructor(buffer) {
33
- _AsyncConsoleGroup_instances.add(this);
34
- _AsyncConsoleGroup_buffer.set(this, void 0);
35
- _AsyncConsoleGroup_ended.set(this, false);
36
- __classPrivateFieldSet(this, _AsyncConsoleGroup_buffer, buffer, "f");
14
+ this.#buffer = buffer;
15
+ }
16
+ #push(method, ...params) {
17
+ if (!this.#ended) {
18
+ this.#buffer.push([method, ...params]);
19
+ }
37
20
  }
38
21
  /**
39
22
  * Creates a new group nested inside the current group.
@@ -43,16 +26,14 @@ class AsyncConsoleGroup {
43
26
  * @template T The type of the value returned from the callback function.
44
27
  * @returns Anything returned from the callback function.
45
28
  */
46
- asyncGroup(label, callbackFn, thisArg) {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- const group = new AsyncConsoleGroup([]);
49
- const result = yield callbackFn.call(thisArg !== null && thisArg !== void 0 ? thisArg : globalThis, group); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
50
- const buffer = group.end();
51
- __classPrivateFieldGet(this, _AsyncConsoleGroup_buffer, "f").push(['group', label]);
52
- __classPrivateFieldGet(this, _AsyncConsoleGroup_buffer, "f").push(...buffer);
53
- __classPrivateFieldGet(this, _AsyncConsoleGroup_buffer, "f").push(['groupEnd']);
54
- return result;
55
- });
29
+ async asyncGroup(label, callbackFn, thisArg) {
30
+ const group = new AsyncConsoleGroup([]);
31
+ const result = await callbackFn.call(thisArg ?? globalThis, group);
32
+ const buffer = group.end();
33
+ this.#buffer.push(['group', label]);
34
+ this.#buffer.push(...buffer);
35
+ this.#buffer.push(['groupEnd']);
36
+ return result;
56
37
  }
57
38
  /**
58
39
  * Equivalent of console.log when used inside a group.
@@ -60,7 +41,7 @@ class AsyncConsoleGroup {
60
41
  * @param optionalParams Optional parameters to log.
61
42
  */
62
43
  log(message, ...optionalParams) {
63
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'log', message, ...optionalParams);
44
+ this.#push('log', message, ...optionalParams);
64
45
  }
65
46
  /**
66
47
  * Equivalent of console.warn when used inside a group.
@@ -68,7 +49,7 @@ class AsyncConsoleGroup {
68
49
  * @param optionalParams Optional parameters to log.
69
50
  */
70
51
  warn(message, ...optionalParams) {
71
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'warn', message, ...optionalParams);
52
+ this.#push('warn', message, ...optionalParams);
72
53
  }
73
54
  /**
74
55
  * Equivalent of console.error when used inside a group.
@@ -76,7 +57,7 @@ class AsyncConsoleGroup {
76
57
  * @param optionalParams Optional parameters to log.
77
58
  */
78
59
  error(message, ...optionalParams) {
79
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'error', message, ...optionalParams);
60
+ this.#push('error', message, ...optionalParams);
80
61
  }
81
62
  /**
82
63
  * Equivalent of console.debug when used inside a group.
@@ -84,7 +65,7 @@ class AsyncConsoleGroup {
84
65
  * @param optionalParams Optional parameters to log.
85
66
  */
86
67
  debug(message, ...optionalParams) {
87
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'debug', message, ...optionalParams);
68
+ this.#push('debug', message, ...optionalParams);
88
69
  }
89
70
  /**
90
71
  * Equivalent of console.info when used inside a group.
@@ -92,7 +73,7 @@ class AsyncConsoleGroup {
92
73
  * @param optionalParams Optional parameters to log.
93
74
  */
94
75
  info(message, ...optionalParams) {
95
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'info', message, ...optionalParams);
76
+ this.#push('info', message, ...optionalParams);
96
77
  }
97
78
  /**
98
79
  * Equivalent of console.table when used inside a group.
@@ -100,14 +81,14 @@ class AsyncConsoleGroup {
100
81
  * @param properties Optional list of property names to include in the table.
101
82
  */
102
83
  table(tabularData, properties) {
103
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'table', tabularData, properties);
84
+ this.#push('table', tabularData, properties);
104
85
  }
105
86
  /**
106
87
  * Equivalent of console.trace when used inside a group.
107
88
  * @param data Optional values to include with the stack trace output.
108
89
  */
109
90
  trace(...data) {
110
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'trace', ...data);
91
+ this.#push('trace', ...data);
111
92
  }
112
93
  /**
113
94
  * Equivalent of console.assert when used inside a group.
@@ -116,21 +97,21 @@ class AsyncConsoleGroup {
116
97
  * @param optionalParams Optional parameters to log when the assertion fails.
117
98
  */
118
99
  assert(condition, message, ...optionalParams) {
119
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'assert', condition, message, ...optionalParams);
100
+ this.#push('assert', condition, message, ...optionalParams);
120
101
  }
121
102
  /**
122
103
  * Equivalent of console.time when used inside a group.
123
104
  * @param label Optional timer label.
124
105
  */
125
106
  time(label) {
126
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'time', label);
107
+ this.#push('time', label);
127
108
  }
128
109
  /**
129
110
  * Equivalent of console.timeEnd when used inside a group.
130
111
  * @param label Optional timer label.
131
112
  */
132
113
  timeEnd(label) {
133
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'timeEnd', label);
114
+ this.#push('timeEnd', label);
134
115
  }
135
116
  /**
136
117
  * Equivalent of console.dir when used inside a group.
@@ -138,7 +119,7 @@ class AsyncConsoleGroup {
138
119
  * @param options Optional inspection options.
139
120
  */
140
121
  dir(item, options) {
141
- __classPrivateFieldGet(this, _AsyncConsoleGroup_instances, "m", _AsyncConsoleGroup_push).call(this, 'dir', item, options);
122
+ this.#push('dir', item, options);
142
123
  }
143
124
  /**
144
125
  * You should not call this method directly. It is called automatically when the async callback finishes.
@@ -146,15 +127,10 @@ class AsyncConsoleGroup {
146
127
  * @returns The buffer that stores the console messages.
147
128
  */
148
129
  end() {
149
- __classPrivateFieldSet(this, _AsyncConsoleGroup_ended, true, "f");
150
- return __classPrivateFieldGet(this, _AsyncConsoleGroup_buffer, "f");
130
+ this.#ended = true;
131
+ return this.#buffer;
151
132
  }
152
133
  }
153
- _AsyncConsoleGroup_buffer = new WeakMap(), _AsyncConsoleGroup_ended = new WeakMap(), _AsyncConsoleGroup_instances = new WeakSet(), _AsyncConsoleGroup_push = function _AsyncConsoleGroup_push(method, ...params) {
154
- if (!__classPrivateFieldGet(this, _AsyncConsoleGroup_ended, "f")) {
155
- __classPrivateFieldGet(this, _AsyncConsoleGroup_buffer, "f").push([method, ...params]);
156
- }
157
- };
158
134
  /**
159
135
  * The async version of betterGroup, which is a better version of console.group and console.groupEnd pair.
160
136
  * It allows you to use async/await inside the group and still have the console output correctly grouped together.
@@ -164,85 +140,30 @@ _AsyncConsoleGroup_buffer = new WeakMap(), _AsyncConsoleGroup_ended = new WeakMa
164
140
  * @template T The type of the value returned from the callback function.
165
141
  * @returns Anything returned from the callback function.
166
142
  */
167
- export function asyncGroup(label, callbackFn, thisArg) {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- const group = new AsyncConsoleGroup([]);
170
- try {
171
- const result = yield callbackFn.call(thisArg !== null && thisArg !== void 0 ? thisArg : globalThis, group); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
172
- return result;
173
- }
174
- finally {
175
- const buffer = group.end();
176
- console.group(label);
177
- while (buffer.length > 0) {
178
- const [...methodAndParams] = buffer.shift(); // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
179
- switch (methodAndParams[0]) {
180
- case 'group': {
181
- const [, nestedLabel] = methodAndParams;
182
- console.group(nestedLabel);
183
- break;
184
- }
185
- case 'groupEnd':
186
- console.groupEnd();
187
- break;
188
- case 'log': {
189
- const [, ...params] = methodAndParams;
190
- console.log(...params);
191
- break;
192
- }
193
- case 'warn': {
194
- const [, ...params] = methodAndParams;
195
- console.warn(...params);
196
- break;
197
- }
198
- case 'error': {
199
- const [, ...params] = methodAndParams;
200
- console.error(...params);
201
- break;
202
- }
203
- case 'debug': {
204
- const [, ...params] = methodAndParams;
205
- console.debug(...params);
206
- break;
207
- }
208
- case 'info': {
209
- const [, ...params] = methodAndParams;
210
- console.info(...params);
211
- break;
212
- }
213
- case 'table': {
214
- const [, ...params] = methodAndParams;
215
- console.table(...params);
216
- break;
217
- }
218
- case 'trace': {
219
- const [, ...params] = methodAndParams;
220
- console.trace(...params);
221
- break;
222
- }
223
- case 'assert': {
224
- const [, ...params] = methodAndParams;
225
- console.assert(...params);
226
- break;
227
- }
228
- case 'time': {
229
- const [, ...params] = methodAndParams;
230
- console.time(...params);
231
- break;
232
- }
233
- case 'timeEnd': {
234
- const [, ...params] = methodAndParams;
235
- console.timeEnd(...params);
236
- break;
237
- }
238
- case 'dir': {
239
- const [, ...params] = methodAndParams;
240
- console.dir(...params);
241
- break;
242
- }
143
+ export async function asyncGroup(label, callbackFn, thisArg) {
144
+ const group = new AsyncConsoleGroup([]);
145
+ try {
146
+ const result = await callbackFn.call(thisArg ?? globalThis, group);
147
+ return result;
148
+ }
149
+ finally {
150
+ const buffer = group.end();
151
+ console.group(label);
152
+ while (buffer.length > 0) {
153
+ const methodAndParams = buffer.shift();
154
+ switch (methodAndParams[0]) {
155
+ case 'group':
156
+ console.group(methodAndParams[1]);
157
+ break;
158
+ case 'groupEnd':
159
+ console.groupEnd();
160
+ break;
161
+ default: {
162
+ const [method, ...params] = methodAndParams;
163
+ console[method](...params);
243
164
  }
244
165
  }
245
- console.groupEnd();
246
166
  }
247
- });
167
+ console.groupEnd();
168
+ }
248
169
  }
@@ -9,7 +9,7 @@
9
9
  export function betterGroup(label, callbackFn, thisArg) {
10
10
  console.group(label);
11
11
  try {
12
- const result = callbackFn.call(thisArg !== null && thisArg !== void 0 ? thisArg : globalThis); // eslint-disable-line @typescript-eslint/no-unsafe-assignment
12
+ const result = callbackFn.call(thisArg ?? globalThis);
13
13
  return result;
14
14
  }
15
15
  finally {
package/package.json CHANGED
@@ -1,66 +1,76 @@
1
1
  {
2
2
  "name": "better-console-group",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Better API for console.group.",
5
- "funding": "https://github.com/CatChen/versioned-storage?sponsor=1",
6
- "type": "module",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/CatChen/better-console-group"
9
+ },
10
+ "author": "catchen",
11
+ "homepage": "https://github.com/CatChen/better-console-group#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/CatChen/better-console-group/issues"
14
+ },
7
15
  "main": "index.js",
8
- "types": "index.d.ts",
16
+ "type": "module",
17
+ "exports": {
18
+ ".": {
19
+ "import": "./index.js",
20
+ "types": "./index.d.ts"
21
+ }
22
+ },
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
9
26
  "scripts": {
10
- "test": "jest",
11
27
  "build": "tsc",
12
- "registry:github": "cat package.json | json -e 'this.name = \"@CatChen/\" + this.name; this.publishConfig = {}; this.publishConfig.registry = \"https://npm.pkg.github.com/\"' > package.github.json && mv -f package.github.json package.json",
13
- "registry:npm": "cat package.json | json -e 'this.name = this.name.replace(new RegExp(\"^@CatChen/\"), \"\"); this.publishConfig = undefined' > package.npm.json && mv -f package.npm.json package.json",
14
- "prepublish": "rm -rf lib && yarn build",
28
+ "format": "prettier --write .",
29
+ "lint": "eslint -c eslint.config.js",
30
+ "postpublish": "pinst --enable",
15
31
  "prepare": "is-ci || husky",
32
+ "prepublish": "rm -rf lib && yarn build",
16
33
  "prepublishOnly": "pinst --disable",
17
- "postpublish": "pinst --enable"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/CatChen/better-console-group"
34
+ "registry:github": "cat package.json | json -e 'this.name = \"@CatChen/\" + this.name; this.publishConfig = {}; this.publishConfig.registry = \"https://npm.pkg.github.com/\"' > package.github.json && mv -f package.github.json package.json",
35
+ "registry:npm": "cat package.json | json -e 'this.name = this.name.replace(new RegExp(\"^@CatChen/\"), \"\"); this.publishConfig = undefined' > package.npm.json && mv -f package.npm.json package.json",
36
+ "test": "jest"
22
37
  },
23
38
  "keywords": [
24
39
  "console",
25
40
  "group"
26
41
  ],
27
- "author": "catchen",
28
- "license": "MIT",
29
- "bugs": {
30
- "url": "https://github.com/CatChen/better-console-group/issues"
42
+ "optionalDependencies": {
43
+ "husky": "^9.1.4",
44
+ "lint-staged": "^16.0.0"
31
45
  },
32
- "homepage": "https://github.com/CatChen/better-console-group#readme",
33
46
  "devDependencies": {
34
47
  "@eslint/eslintrc": "^3.2.0",
35
48
  "@eslint/js": "^10.0.1",
36
- "@serverless-guru/prettier-plugin-import-order": "^0.4.1",
49
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
37
50
  "@types/jest": "^30.0.0",
38
51
  "codecov": "^3.6.1",
39
52
  "eslint": "^10.0.0",
40
53
  "eslint-config-prettier": "^10.0.1",
41
- "eslint-plugin-flowtype": "^8.0.2",
42
54
  "eslint-plugin-prettier": "^5.2.1",
43
- "flow-bin": "^0.307.0",
55
+ "flow-bin": "^0.309.0",
44
56
  "is-ci": "^4.1.0",
45
57
  "jest": "^30.0.0",
46
58
  "json": "^11.0.0",
47
59
  "pinst": "^3.0.0",
48
60
  "prettier": "^3.0.2",
61
+ "prettier-plugin-package": "^2.0.0",
49
62
  "ts-jest": "^29.2.5",
50
63
  "typescript": "^6.0.2",
51
64
  "typescript-eslint": "^8.15.0"
52
65
  },
53
- "optionalDependencies": {
54
- "husky": "^9.1.4",
55
- "lint-staged": "^16.0.0"
56
- },
57
- "engines": {
58
- "node": ">=20"
59
- },
66
+ "types": "index.d.ts",
67
+ "funding": "https://github.com/CatChen/versioned-storage?sponsor=1",
60
68
  "lint-staged": {
61
- "*.(js,ts,js.flow)": "yarn eslint --fix",
62
- "*.json": "yarn eslint --fix",
63
- "*.(yml,yaml)": "yarn prettier -w",
64
- "*.(md,markdown)": "yarn prettier -w"
65
- }
69
+ "*.{ts,js}": [
70
+ "yarn format",
71
+ "yarn lint --fix"
72
+ ],
73
+ "*.{json,yml,yaml,md,markdown}": "yarn format"
74
+ },
75
+ "packageManager": "yarn@4.13.0"
66
76
  }
package/tsconfig.json CHANGED
@@ -3,11 +3,12 @@
3
3
  "rootDir": "src",
4
4
  "outDir": "lib",
5
5
  "declaration": true,
6
- "target": "ES2015",
7
6
  "lib": ["es2015", "dom"],
8
- "module": "es2022",
9
- "moduleResolution": "bundler",
7
+ "module": "nodenext",
8
+ "moduleResolution": "nodenext",
10
9
  "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "rewriteRelativeImportExtensions": true,
11
12
  "types": ["jest"]
12
13
  },
13
14
  "include": ["src"],
@@ -1,2 +0,0 @@
1
- export * from './src/betterGroup.ts';
2
- export * from './src/asyncGroup.ts';