@blocksuite/global
Advanced tools
Comparing version 0.4.0-20230122122652-66c7874 to 0.4.0-20230123163855-e0a9d63
@@ -15,4 +15,8 @@ import color from 'ansi-colors'; | ||
const message = stackInfo[callerIdx].trim(); | ||
const method = /(?<=at\s)(\S*)(?=\s)/.exec(message)?.[0] ?? message; | ||
const subsystem = /(?<=\/packages\/)[a-z]+/.exec(message)?.[0] ?? 'unknown'; | ||
// For example, the message is: | ||
// at handleBlockEndEnter (http://localhost:5173/@fs/Users/username/blocksuite/packages/blocks/src/__internal__/rich-text/rich-text-operations.ts?t=1674485091790:41:44) | ||
// method will match `handleBlockEndEnter` | ||
// subsystem will match `blocks` | ||
const method = /at\s(\S*)(?=\s)/.exec(message)?.[1] ?? message; | ||
const subsystem = /\/packages\/([a-z]+)/.exec(message)?.[1] ?? 'unknown'; | ||
console.log(`[packages/${color.blue(subsystem)}] ${color.magenta(method)}(${info.arguments.map(() => '%o').join(', ')})\n`, ...info.arguments, showStack ? upperStackInfo : ''); | ||
@@ -19,0 +23,0 @@ }; |
{ | ||
"name": "@blocksuite/global", | ||
"version": "0.4.0-20230122122652-66c7874", | ||
"version": "0.4.0-20230123163855-e0a9d63", | ||
"types": "./index.d.ts", | ||
@@ -9,3 +9,4 @@ "type": "module", | ||
"./utils": "./dist/utils.js", | ||
"./debug": "./dist/debug.js" | ||
"./debug": "./dist/debug.js", | ||
"./config": "./dist/config/index.js" | ||
}, | ||
@@ -12,0 +13,0 @@ "author": "toeverything", |
@@ -24,4 +24,8 @@ import color from 'ansi-colors'; | ||
const message = stackInfo[callerIdx].trim(); | ||
const method = /(?<=at\s)(\S*)(?=\s)/.exec(message)?.[0] ?? message; | ||
const subsystem = /(?<=\/packages\/)[a-z]+/.exec(message)?.[0] ?? 'unknown'; | ||
// For example, the message is: | ||
// at handleBlockEndEnter (http://localhost:5173/@fs/Users/username/blocksuite/packages/blocks/src/__internal__/rich-text/rich-text-operations.ts?t=1674485091790:41:44) | ||
// method will match `handleBlockEndEnter` | ||
// subsystem will match `blocks` | ||
const method = /at\s(\S*)(?=\s)/.exec(message)?.[1] ?? message; | ||
const subsystem = /\/packages\/([a-z]+)/.exec(message)?.[1] ?? 'unknown'; | ||
console.log( | ||
@@ -28,0 +32,0 @@ `[packages/${color.blue(subsystem)}] ${color.magenta( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
214117
2472