better-console-group 1.1.3 → 1.1.5
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/.cursor/rules/agent-workflow.mdc +37 -0
- package/AGENTS.md +32 -0
- package/CLAUDE.md +32 -0
- package/lib/BetterConsoleGroup.d.ts +2 -0
- package/lib/BetterConsoleGroup.js +2 -0
- package/lib/asyncGroup.js +105 -131
- package/lib/betterGroup.js +1 -1
- package/package.json +44 -33
- package/tsconfig.json +6 -4
- package/BetterConsoleGroup.ts +0 -2
|
@@ -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.
|
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/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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
150
|
-
return
|
|
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,83 @@ _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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
+
const [, nestedLabel] = methodAndParams;
|
|
157
|
+
console.group(nestedLabel);
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
case 'groupEnd':
|
|
161
|
+
console.groupEnd();
|
|
162
|
+
break;
|
|
163
|
+
case 'log': {
|
|
164
|
+
const [, ...params] = methodAndParams;
|
|
165
|
+
console.log(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 'warn': {
|
|
169
|
+
const [, ...params] = methodAndParams;
|
|
170
|
+
console.warn(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case 'error': {
|
|
174
|
+
const [, ...params] = methodAndParams;
|
|
175
|
+
console.error(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
case 'debug': {
|
|
179
|
+
const [, ...params] = methodAndParams;
|
|
180
|
+
console.debug(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
case 'info': {
|
|
184
|
+
const [, ...params] = methodAndParams;
|
|
185
|
+
console.info(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
case 'table': {
|
|
189
|
+
const [, ...params] = methodAndParams;
|
|
190
|
+
console.table(...params);
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case 'trace': {
|
|
194
|
+
const [, ...params] = methodAndParams;
|
|
195
|
+
console.trace(...params); // eslint-disable-line @typescript-eslint/no-unsafe-argument
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
case 'assert': {
|
|
199
|
+
const [, ...params] = methodAndParams;
|
|
200
|
+
console.assert(...params);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case 'time': {
|
|
204
|
+
const [, ...params] = methodAndParams;
|
|
205
|
+
console.time(...params);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case 'timeEnd': {
|
|
209
|
+
const [, ...params] = methodAndParams;
|
|
210
|
+
console.timeEnd(...params);
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case 'dir': {
|
|
214
|
+
const [, ...params] = methodAndParams;
|
|
215
|
+
console.dir(...params);
|
|
216
|
+
break;
|
|
243
217
|
}
|
|
244
218
|
}
|
|
245
|
-
console.groupEnd();
|
|
246
219
|
}
|
|
247
|
-
|
|
220
|
+
console.groupEnd();
|
|
221
|
+
}
|
|
248
222
|
}
|
package/lib/betterGroup.js
CHANGED
|
@@ -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
|
|
12
|
+
const result = callbackFn.call(thisArg ?? globalThis);
|
|
13
13
|
return result;
|
|
14
14
|
}
|
|
15
15
|
finally {
|
package/package.json
CHANGED
|
@@ -1,66 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-console-group",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "Better API for console.group.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
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
|
-
"
|
|
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
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
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
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
"@
|
|
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
54
|
"eslint-plugin-flowtype": "^8.0.2",
|
|
42
55
|
"eslint-plugin-prettier": "^5.2.1",
|
|
43
|
-
"flow-bin": "^0.
|
|
56
|
+
"flow-bin": "^0.307.0",
|
|
44
57
|
"is-ci": "^4.1.0",
|
|
45
58
|
"jest": "^30.0.0",
|
|
46
59
|
"json": "^11.0.0",
|
|
47
60
|
"pinst": "^3.0.0",
|
|
48
61
|
"prettier": "^3.0.2",
|
|
62
|
+
"prettier-plugin-package": "^2.0.0",
|
|
49
63
|
"ts-jest": "^29.2.5",
|
|
50
|
-
"typescript": "^
|
|
64
|
+
"typescript": "^6.0.2",
|
|
51
65
|
"typescript-eslint": "^8.15.0"
|
|
52
66
|
},
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
"lint-staged": "^16.0.0"
|
|
56
|
-
},
|
|
57
|
-
"engines": {
|
|
58
|
-
"node": ">=20"
|
|
59
|
-
},
|
|
67
|
+
"types": "index.d.ts",
|
|
68
|
+
"funding": "https://github.com/CatChen/versioned-storage?sponsor=1",
|
|
60
69
|
"lint-staged": {
|
|
61
|
-
"*.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
"*.{ts,js}": [
|
|
71
|
+
"yarn format",
|
|
72
|
+
"yarn lint --fix"
|
|
73
|
+
],
|
|
74
|
+
"*.{json,yml,yaml,md,markdown}": "yarn format"
|
|
75
|
+
},
|
|
76
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
66
77
|
}
|
package/tsconfig.json
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
"rootDir": "src",
|
|
4
4
|
"outDir": "lib",
|
|
5
5
|
"declaration": true,
|
|
6
|
-
"target": "ES2015",
|
|
7
6
|
"lib": ["es2015", "dom"],
|
|
8
|
-
"module": "
|
|
9
|
-
"moduleResolution": "
|
|
10
|
-
"esModuleInterop": true
|
|
7
|
+
"module": "nodenext",
|
|
8
|
+
"moduleResolution": "nodenext",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"rewriteRelativeImportExtensions": true,
|
|
12
|
+
"types": ["jest"]
|
|
11
13
|
},
|
|
12
14
|
"include": ["src"],
|
|
13
15
|
"exclude": ["node_modules", "lib"]
|
package/BetterConsoleGroup.ts
DELETED