@gitkraken/core-gitlens 0.16.2 → 0.16.4

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +33 -1
  2. package/dist/git/cache.d.ts +64 -5
  3. package/dist/git/cache.js +75 -5
  4. package/dist/git/cache.js.map +1 -1
  5. package/dist/git/models/branch.d.ts +0 -6
  6. package/dist/git/models/branch.js.map +1 -1
  7. package/dist/git/providers/branches.d.ts +65 -1
  8. package/dist/git/providers/refs.d.ts +3 -2
  9. package/dist/git/providers/shared/remotes.js +5 -5
  10. package/dist/git/providers/shared/remotes.js.map +1 -1
  11. package/dist/git/watching/classifyChange.js +5 -2
  12. package/dist/git/watching/classifyChange.js.map +1 -1
  13. package/dist/git/watching/watchGroup.js +2 -1
  14. package/dist/git/watching/watchGroup.js.map +1 -1
  15. package/dist/git-cli/providers/branches.d.ts +151 -31
  16. package/dist/git-cli/providers/branches.js +918 -253
  17. package/dist/git-cli/providers/branches.js.map +1 -1
  18. package/dist/git-cli/providers/commits.js +37 -20
  19. package/dist/git-cli/providers/commits.js.map +1 -1
  20. package/dist/git-cli/providers/config.js +16 -10
  21. package/dist/git-cli/providers/config.js.map +1 -1
  22. package/dist/git-cli/providers/contributors.js +3 -3
  23. package/dist/git-cli/providers/contributors.js.map +1 -1
  24. package/dist/git-cli/providers/diff.js +15 -12
  25. package/dist/git-cli/providers/diff.js.map +1 -1
  26. package/dist/git-cli/providers/graph.js +17 -14
  27. package/dist/git-cli/providers/graph.js.map +1 -1
  28. package/dist/git-cli/providers/maintenance.js +3 -3
  29. package/dist/git-cli/providers/maintenance.js.map +1 -1
  30. package/dist/git-cli/providers/patch.js +4 -1
  31. package/dist/git-cli/providers/patch.js.map +1 -1
  32. package/dist/git-cli/providers/pausedOperations.js +2 -2
  33. package/dist/git-cli/providers/pausedOperations.js.map +1 -1
  34. package/dist/git-cli/providers/refs.js +16 -13
  35. package/dist/git-cli/providers/refs.js.map +1 -1
  36. package/dist/git-cli/providers/remotes.js +4 -1
  37. package/dist/git-cli/providers/remotes.js.map +1 -1
  38. package/dist/git-cli/providers/revision.js +14 -11
  39. package/dist/git-cli/providers/revision.js.map +1 -1
  40. package/dist/git-cli/providers/stash.js +2 -2
  41. package/dist/git-cli/providers/stash.js.map +1 -1
  42. package/dist/git-cli/providers/status.js +7 -7
  43. package/dist/git-cli/providers/status.js.map +1 -1
  44. package/dist/git-cli/providers/tags.js +6 -3
  45. package/dist/git-cli/providers/tags.js.map +1 -1
  46. package/dist/git-cli/providers/worktrees.js +3 -3
  47. package/dist/git-cli/providers/worktrees.js.map +1 -1
  48. package/dist/plus/git-github/providers/github/branches.d.ts +9 -1
  49. package/dist/plus/git-github/providers/github/branches.js +54 -8
  50. package/dist/plus/git-github/providers/github/branches.js.map +1 -1
  51. package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
  52. package/dist/plus/integrations/reads/drains.d.ts +1 -0
  53. package/dist/utils/decorators/log.d.ts +3 -1
  54. package/dist/utils/decorators/log.js +61 -45
  55. package/dist/utils/decorators/log.js.map +1 -1
  56. package/dist/utils/logger.d.ts +15 -1
  57. package/dist/utils/logger.js +30 -1
  58. package/dist/utils/logger.js.map +1 -1
  59. package/dist/utils/logger.scoped.d.ts +12 -1
  60. package/dist/utils/logger.scoped.js +38 -4
  61. package/dist/utils/logger.scoped.js.map +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"logger.scoped.js","names":["Logger"],"sources":["../../../utils/src/logger.scoped.ts"],"sourcesContent":["import { enterScope, exitScope, getCurrentScope, runInScope } from '#env/logScope.js';\nimport { getScopedCounter } from './counter.js';\nimport type { Counter } from './counter.js';\nimport { getDurationMilliseconds, hrtime } from './hrtime.js';\nimport type { LogLevel } from './logger.js';\nimport { Logger } from './logger.js';\n\n/** Runs a function within a log scope context. */\nexport { runInScope };\n\nexport const logScopeIdGenerator: Counter = getScopedCounter();\n\nexport interface ScopedLogger {\n\treadonly scopeId?: number;\n\treadonly prevScopeId?: number;\n\treadonly prefix: string;\n\n\tenabled(level: Exclude<LogLevel, 'off'>): boolean;\n\n\ttrace(message: string, ...params: any[]): void;\n\tdebug(message: string, ...params: any[]): void;\n\tinfo(message: string, ...params: any[]): void;\n\twarn(message: string, ...params: any[]): void;\n\terror(ex: Error | unknown, message?: string, ...params: any[]): void;\n\n\t/** Adds exit details for this scope. Details are automatically prefixed with ' \\u2022 ' and accumulate. */\n\taddExitInfo(...details: string[]): void;\n\t/** Sets the failure reason for this scope. Overwrites any previous failure. */\n\tsetFailed(reason: string): void;\n\n\t/** @internal Returns exit info for logging - used internally by the @log decorator */\n\tgetExitInfo(): { details: string | undefined; failed: string | undefined };\n}\n\nexport function createLogScope(scopeId: number, prevScopeId: number | undefined, prefix: string): ScopedLogger {\n\tlet exitDetails: string[] | undefined;\n\tlet exitFailed: string | undefined;\n\n\t// oxlint-disable-next-line typescript/consistent-type-assertions\n\tconst scope: ScopedLogger = {\n\t\tscopeId: scopeId,\n\t\tprevScopeId: prevScopeId,\n\t\tprefix: prefix,\n\t\tenabled: (level?: Exclude<LogLevel, 'off'>) => Logger.enabled(level),\n\t\taddExitInfo: function (...details: string[]): void {\n\t\t\t(exitDetails ??= []).push(...details);\n\t\t},\n\t\tsetFailed: function (reason: string): void {\n\t\t\texitFailed = reason;\n\t\t},\n\n\t\tgetExitInfo: function () {\n\t\t\treturn {\n\t\t\t\tdetails: exitDetails?.length ? ` \\u2022 ${exitDetails.join(', ')}` : undefined,\n\t\t\t\tfailed: exitFailed,\n\t\t\t};\n\t\t},\n\t} as ScopedLogger;\n\n\t// Lazy bind - getter replaces itself with bound function on first access\n\tdefineLazyBoundMethod(scope, 'trace', Logger.trace);\n\tdefineLazyBoundMethod(scope, 'debug', Logger.debug);\n\tdefineLazyBoundMethod(scope, 'info', Logger.info);\n\tdefineLazyBoundMethod(scope, 'warn', Logger.warn);\n\tdefineLazyBoundErrorMethod(scope);\n\n\treturn scope;\n}\n\nfunction defineLazyBoundMethod<K extends 'trace' | 'debug' | 'info' | 'warn'>(\n\tscope: ScopedLogger,\n\tname: K,\n\tmethod: (typeof Logger)[K],\n): void {\n\tObject.defineProperty(scope, name, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\tconst bound = method.bind(Logger, scope);\n\t\t\tObject.defineProperty(scope, name, { value: bound, writable: false, enumerable: true });\n\t\t\treturn bound;\n\t\t},\n\t});\n}\n\nfunction defineLazyBoundErrorMethod(scope: ScopedLogger): void {\n\tObject.defineProperty(scope, 'error', {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\tconst bound = (ex: Error | unknown, message?: string, ...params: any[]) =>\n\t\t\t\tLogger.error(ex, scope, message, ...params);\n\t\t\tObject.defineProperty(scope, 'error', { value: bound, writable: false, enumerable: true });\n\t\t\treturn bound;\n\t\t},\n\t});\n}\n\nexport function formatLoggableScopeBlock(prefix: string, suffix?: string): string {\n\tif (suffix == null) return `[${prefix.padEnd(13)}]`;\n\n\treturn `[${prefix}${suffix.padStart(13 - prefix.length)}]`;\n}\n\nexport function getLoggableScopeBlock(scopeId: number, prevScopeId?: number, label?: string): string {\n\tif (label != null) {\n\t\tconst suffix =\n\t\t\tprevScopeId == null ? scopeId.toString(16) : `${prevScopeId.toString(16)} \\u2192 ${scopeId.toString(16)}`;\n\t\treturn formatLoggableScopeBlock(label, suffix);\n\t}\n\n\treturn prevScopeId == null\n\t\t? `[${scopeId.toString(16).padStart(13)}]`\n\t\t: `[${prevScopeId.toString(16).padStart(5)} \\u2192 ${scopeId.toString(16).padStart(5)}]`;\n}\n\n/** Gets the current log scope */\nexport function getScopedLogger(): (ScopedLogger & Disposable) | undefined {\n\tconst scope = getCurrentScope();\n\tif (scope == null) return undefined;\n\n\t// Return a prototype wrapper with a no-op dispose so `using` won't exit a parent's scope\n\tconst wrapper = Object.create(scope) as ScopedLogger & Disposable;\n\twrapper[Symbol.dispose] = () => {};\n\treturn wrapper;\n}\n\n/**\n * @internal only exported for use in other logging-related modules, not for general use\n */\nexport function getNewLogScope(\n\tprefix: string,\n\tscope: ScopedLogger | boolean | undefined,\n\tlabel?: string,\n): ScopedLogger {\n\tif (scope != null && typeof scope !== 'boolean') {\n\t\treturn createLogScope(scope.scopeId!, scope.prevScopeId, `${scope.prefix}${prefix}`);\n\t}\n\n\tconst prevScopeId = scope ? getCurrentScope()?.scopeId : undefined;\n\tconst scopeId = logScopeIdGenerator.next();\n\treturn createLogScope(scopeId, prevScopeId, `${getLoggableScopeBlock(scopeId, prevScopeId, label)} ${prefix}`);\n}\n\n/** Starts a scoped logger for use with the `using` keyword */\nfunction startScopedLogger(\n\tprefix: string,\n\tscope: ScopedLogger | boolean | undefined,\n\tlabel?: string,\n): ScopedLogger & Disposable {\n\tconst prevScope = getCurrentScope();\n\tconst newScope = getNewLogScope(prefix, scope, label) as ScopedLogger & Disposable;\n\tenterScope(newScope);\n\n\t// Add dispose method directly to preserve lazy-bound logger methods\n\tnewScope[Symbol.dispose] = () => {\n\t\texitScope(prevScope, newScope);\n\t};\n\n\treturn newScope;\n}\n\n/**\n * Creates a scoped logger for standalone functions and code blocks\n * Returns `undefined` when all logging is disabled\n *\n * This is the non-decorator equivalent of `@log()` for standalone functions,\n * callbacks, and code blocks. Supports the `using` keyword for automatic cleanup.\n *\n * @param prefix - The log prefix (typically `ClassName.methodName`)\n * @param log - Controls automatic entry/exit logging with timing:\n * - omitted/falsy: scope tracking only (no auto-logging)\n * - `true`: auto entry + exit with timing at debug level\n * - `{ level?, message?, onlyExit? }`: fine-grained control\n */\nexport function maybeStartScopedLogger(\n\tprefix: string,\n\tlog?: boolean | { level?: Exclude<LogLevel, 'off' | 'error' | 'warn'>; message?: string; onlyExit?: true },\n\toptions?: { scopeLabel?: string; scope?: ScopedLogger },\n): (ScopedLogger & Disposable) | undefined {\n\tif (!Logger.enabled()) return undefined;\n\n\tconst scope = startScopedLogger(prefix, options?.scope ?? true, options?.scopeLabel);\n\n\tif (!log) return scope;\n\n\tlet level: Exclude<LogLevel, 'off' | 'error' | 'warn'> = 'debug';\n\tlet message: string | undefined;\n\tlet onlyExit = false;\n\tif (typeof log === 'object') {\n\t\tlevel = log.level ?? level;\n\t\tmessage = log.message;\n\t\tonlyExit = log.onlyExit === true;\n\t}\n\n\tconst start = hrtime();\n\n\tif (!onlyExit) {\n\t\tlogAtLevel(scope, level, message ?? '');\n\t}\n\n\tconst origDispose = scope[Symbol.dispose];\n\tscope[Symbol.dispose] = () => {\n\t\tconst duration = getDurationMilliseconds(start);\n\t\tconst timing = ` [${duration}ms]`;\n\t\tconst exitInfo = scope.getExitInfo();\n\t\tconst exit = exitInfo.failed ?? 'completed';\n\n\t\tif (exitInfo.failed != null) {\n\t\t\tLogger.error(null, scope, `${exit}${exitInfo.details ?? ''}${timing}`);\n\t\t} else {\n\t\t\tlogAtLevel(scope, level, `${exit}${exitInfo.details ?? ''}${timing}`);\n\t\t}\n\n\t\torigDispose();\n\t};\n\n\treturn scope;\n}\n\nfunction logAtLevel(\n\tscope: ScopedLogger,\n\tlevel: Exclude<LogLevel, 'off' | 'error' | 'warn'>,\n\tmessage: string,\n\t...params: any[]\n): void {\n\tswitch (level) {\n\t\tcase 'trace':\n\t\t\tLogger.trace(scope, message, ...params);\n\t\t\tbreak;\n\t\tcase 'info':\n\t\t\tLogger.info(scope, message, ...params);\n\t\t\tbreak;\n\t\tcase 'debug':\n\t\tdefault:\n\t\t\tLogger.debug(scope, message, ...params);\n\t}\n}\n"],"mappings":";;;;;AAUA,MAAa,sBAA+B,iBAAiB;AAwB7D,SAAgB,eAAe,SAAiB,aAAiC,QAA8B;CAC9G,IAAI;CACJ,IAAI;CAGJ,MAAM,QAAsB;EAClB;EACI;EACL;EACR,UAAU,UAAqCA,QAAO,QAAQ,KAAK;EACnE,aAAa,SAAU,GAAG,SAAyB;GAClD,CAAC,gBAAgB,CAAC,EAAA,CAAG,KAAK,GAAG,OAAO;EACr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,IAAI,SAAS;EACrB,UAAU,IAAI;EACd,WAAW,IAAI,aAAa;CAC7B;CAEA,MAAM,QAAQ,OAAO;CAErB,IAAI,CAAC,UACJ,WAAW,OAAO,OAAO,WAAW,EAAE;CAGvC,MAAM,cAAc,MAAM,OAAO;CACjC,MAAM,OAAO,iBAAiB;EAE7B,MAAM,SAAS,KADE,wBAAwB,KACd,EAAE;EAC7B,MAAM,WAAW,MAAM,YAAY;EACnC,MAAM,OAAO,SAAS,UAAU;EAEhC,IAAI,SAAS,UAAU,MACtB,QAAO,MAAM,MAAM,OAAO,GAAG,OAAO,SAAS,WAAW,KAAK,QAAQ;OAErE,WAAW,OAAO,OAAO,GAAG,OAAO,SAAS,WAAW,KAAK,QAAQ;EAGrE,YAAY;CACb;CAEA,OAAO;AACR;AAEA,SAAS,WACR,OACA,OACA,SACA,GAAG,QACI;CACP,QAAQ,OAAR;EACC,KAAK;GACJ,QAAO,MAAM,OAAO,SAAS,GAAG,MAAM;GACtC;EACD,KAAK;GACJ,QAAO,KAAK,OAAO,SAAS,GAAG,MAAM;GACrC;EAED,SACC,QAAO,MAAM,OAAO,SAAS,GAAG,MAAM;CACxC;AACD"}
1
+ {"version":3,"file":"logger.scoped.js","names":["Logger"],"sources":["../../../utils/src/logger.scoped.ts"],"sourcesContent":["import { enterScope, exitScope, getCurrentScope, runInScope } from '#env/logScope.js';\nimport { getScopedCounter } from './counter.js';\nimport type { Counter } from './counter.js';\nimport { getDurationMilliseconds, hrtime } from './hrtime.js';\nimport type { LogLevel } from './logger.js';\nimport { Logger } from './logger.js';\n\n/** Runs a function within a log scope context. */\nexport { runInScope };\n\nexport const logScopeIdGenerator: Counter = getScopedCounter();\n\nexport interface ScopedLogger {\n\treadonly scopeId?: number;\n\treadonly prevScopeId?: number;\n\treadonly prefix: string;\n\n\tenabled(level: Exclude<LogLevel, 'off'>): boolean;\n\n\ttrace(message: string, ...params: any[]): void;\n\tdebug(message: string, ...params: any[]): void;\n\tinfo(message: string, ...params: any[]): void;\n\twarn(message: string, ...params: any[]): void;\n\terror(ex: Error | unknown, message?: string, ...params: any[]): void;\n\n\t/** Adds exit details for this scope. Details are automatically prefixed with ' \\u2022 ' and accumulate. */\n\taddExitInfo(...details: string[]): void;\n\t/** Sets the failure reason for this scope. Overwrites any previous failure. */\n\tsetFailed(reason: string): void;\n\n\t/** @internal Returns exit info for logging - used internally by the @log decorator */\n\tgetExitInfo(): { details: string | undefined; failed: string | undefined };\n\t/** @internal Whether a line was written inside this scope or any scope under it */\n\treadonly logged: boolean;\n\t/** @internal Records that a line was written inside this scope, and so inside every scope above it */\n\tmarkLogged(): void;\n\t/** @internal Called when the scope's call returns, so a line written after it no longer triggers `onFirstLogged` */\n\texited(): void;\n}\n\n/**\n * @param prefix The scope's line prefix, or a function that builds it on first use\n * @param parent The scope this one runs inside, which a line written here also marks as logged\n * @param onFirstLogged Runs when the first line is written inside this scope, after its parent's own `onFirstLogged`\n */\nexport function createLogScope(\n\tscopeId: number,\n\tprevScopeId: number | undefined,\n\tprefix: string | (() => string),\n\tparent?: ScopedLogger,\n\tonFirstLogged?: (scope: ScopedLogger) => void,\n): ScopedLogger {\n\tlet exitDetails: string[] | undefined;\n\tlet exitFailed: string | undefined;\n\tlet logged = false;\n\n\t// oxlint-disable-next-line typescript/consistent-type-assertions\n\tconst scope: ScopedLogger = {\n\t\tscopeId: scopeId,\n\t\tprevScopeId: prevScopeId,\n\t\tprefix: prefix as string,\n\t\tenabled: (level?: Exclude<LogLevel, 'off'>) => Logger.enabled(level),\n\t\tget logged() {\n\t\t\treturn logged;\n\t\t},\n\t\tmarkLogged: function (): void {\n\t\t\tif (logged) return;\n\n\t\t\tlogged = true;\n\t\t\tparent?.markLogged();\n\n\t\t\tconst fn = onFirstLogged;\n\t\t\tonFirstLogged = undefined;\n\t\t\tfn?.(scope);\n\t\t},\n\t\texited: function (): void {\n\t\t\tonFirstLogged = undefined;\n\t\t},\n\t\taddExitInfo: function (...details: string[]): void {\n\t\t\t(exitDetails ??= []).push(...details);\n\t\t},\n\t\tsetFailed: function (reason: string): void {\n\t\t\texitFailed = reason;\n\t\t},\n\n\t\tgetExitInfo: function () {\n\t\t\treturn {\n\t\t\t\tdetails: exitDetails?.length ? ` \\u2022 ${exitDetails.join(', ')}` : undefined,\n\t\t\t\tfailed: exitFailed,\n\t\t\t};\n\t\t},\n\t} as ScopedLogger;\n\n\tif (typeof prefix === 'function') {\n\t\tObject.defineProperty(scope, 'prefix', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tget: function () {\n\t\t\t\tconst value = prefix();\n\t\t\t\tObject.defineProperty(scope, 'prefix', { value: value, writable: false, enumerable: true });\n\t\t\t\treturn value;\n\t\t\t},\n\t\t});\n\t}\n\n\t// Lazy bind - getter replaces itself with bound function on first access\n\tdefineLazyBoundMethod(scope, 'trace', Logger.trace);\n\tdefineLazyBoundMethod(scope, 'debug', Logger.debug);\n\tdefineLazyBoundMethod(scope, 'info', Logger.info);\n\tdefineLazyBoundMethod(scope, 'warn', Logger.warn);\n\tdefineLazyBoundErrorMethod(scope);\n\n\treturn scope;\n}\n\nfunction defineLazyBoundMethod<K extends 'trace' | 'debug' | 'info' | 'warn'>(\n\tscope: ScopedLogger,\n\tname: K,\n\tmethod: (typeof Logger)[K],\n): void {\n\tObject.defineProperty(scope, name, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\tconst bound = method.bind(Logger, scope);\n\t\t\tObject.defineProperty(scope, name, { value: bound, writable: false, enumerable: true });\n\t\t\treturn bound;\n\t\t},\n\t});\n}\n\nfunction defineLazyBoundErrorMethod(scope: ScopedLogger): void {\n\tObject.defineProperty(scope, 'error', {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget: function () {\n\t\t\tconst bound = (ex: Error | unknown, message?: string, ...params: any[]) =>\n\t\t\t\tLogger.error(ex, scope, message, ...params);\n\t\t\tObject.defineProperty(scope, 'error', { value: bound, writable: false, enumerable: true });\n\t\t\treturn bound;\n\t\t},\n\t});\n}\n\nexport function formatLoggableScopeBlock(prefix: string, suffix?: string): string {\n\tif (suffix == null) return `[${prefix.padEnd(13)}]`;\n\n\treturn `[${prefix}${suffix.padStart(13 - prefix.length)}]`;\n}\n\nexport function getLoggableScopeBlock(scopeId: number, prevScopeId?: number, label?: string): string {\n\tif (label != null) {\n\t\tconst suffix =\n\t\t\tprevScopeId == null ? scopeId.toString(16) : `${prevScopeId.toString(16)} \\u2192 ${scopeId.toString(16)}`;\n\t\treturn formatLoggableScopeBlock(label, suffix);\n\t}\n\n\treturn prevScopeId == null\n\t\t? `[${scopeId.toString(16).padStart(13)}]`\n\t\t: `[${prevScopeId.toString(16).padStart(5)} \\u2192 ${scopeId.toString(16).padStart(5)}]`;\n}\n\n/** Gets the current log scope */\nexport function getScopedLogger(): (ScopedLogger & Disposable) | undefined {\n\tconst scope = getCurrentScope();\n\tif (scope == null) return undefined;\n\n\t// Return a prototype wrapper with a no-op dispose so `using` won't exit a parent's scope\n\tconst wrapper = Object.create(scope) as ScopedLogger & Disposable;\n\twrapper[Symbol.dispose] = () => {};\n\treturn wrapper;\n}\n\n/**\n * @internal only exported for use in other logging-related modules, not for general use\n */\nexport function getNewLogScope(\n\tprefix: string,\n\tscope: ScopedLogger | boolean | undefined,\n\tlabel?: string,\n): ScopedLogger {\n\tif (scope != null && typeof scope !== 'boolean') {\n\t\treturn createLogScope(scope.scopeId!, scope.prevScopeId, `${scope.prefix}${prefix}`, scope);\n\t}\n\n\tconst parent = scope ? getCurrentScope() : undefined;\n\tconst prevScopeId = parent?.scopeId;\n\tconst scopeId = logScopeIdGenerator.next();\n\treturn createLogScope(\n\t\tscopeId,\n\t\tprevScopeId,\n\t\t`${getLoggableScopeBlock(scopeId, prevScopeId, label)} ${prefix}`,\n\t\tparent,\n\t);\n}\n\n/** Starts a scoped logger for use with the `using` keyword */\nfunction startScopedLogger(\n\tprefix: string,\n\tscope: ScopedLogger | boolean | undefined,\n\tlabel?: string,\n): ScopedLogger & Disposable {\n\tconst prevScope = getCurrentScope();\n\tconst newScope = getNewLogScope(prefix, scope, label) as ScopedLogger & Disposable;\n\tenterScope(newScope);\n\n\t// Add dispose method directly to preserve lazy-bound logger methods\n\tnewScope[Symbol.dispose] = () => {\n\t\texitScope(prevScope, newScope);\n\t};\n\n\treturn newScope;\n}\n\n/**\n * Creates a scoped logger for standalone functions and code blocks\n * Returns `undefined` when all logging is disabled\n *\n * This is the non-decorator equivalent of `@log()` for standalone functions,\n * callbacks, and code blocks. Supports the `using` keyword for automatic cleanup.\n *\n * @param prefix - The log prefix (typically `ClassName.methodName`)\n * @param log - Controls automatic entry/exit logging with timing:\n * - omitted/falsy: scope tracking only (no auto-logging)\n * - `true`: auto entry + exit with timing at debug level\n * - `{ level?, message?, onlyExit? }`: fine-grained control\n */\nexport function maybeStartScopedLogger(\n\tprefix: string,\n\tlog?: boolean | { level?: Exclude<LogLevel, 'off' | 'error' | 'warn'>; message?: string; onlyExit?: true },\n\toptions?: { scopeLabel?: string; scope?: ScopedLogger },\n): (ScopedLogger & Disposable) | undefined {\n\tif (!Logger.enabled()) return undefined;\n\n\tconst scope = startScopedLogger(prefix, options?.scope ?? true, options?.scopeLabel);\n\n\tif (!log) return scope;\n\n\tlet level: Exclude<LogLevel, 'off' | 'error' | 'warn'> = 'debug';\n\tlet message: string | undefined;\n\tlet onlyExit = false;\n\tif (typeof log === 'object') {\n\t\tlevel = log.level ?? level;\n\t\tmessage = log.message;\n\t\tonlyExit = log.onlyExit === true;\n\t}\n\n\tconst start = hrtime();\n\n\tif (!onlyExit) {\n\t\tlogAtLevel(scope, level, message ?? '');\n\t}\n\n\tconst origDispose = scope[Symbol.dispose];\n\tscope[Symbol.dispose] = () => {\n\t\tconst duration = getDurationMilliseconds(start);\n\t\tconst timing = ` [${duration}ms]`;\n\t\tconst exitInfo = scope.getExitInfo();\n\t\tconst exit = exitInfo.failed ?? 'completed';\n\n\t\tif (exitInfo.failed != null) {\n\t\t\tLogger.error(null, scope, `${exit}${exitInfo.details ?? ''}${timing}`);\n\t\t} else {\n\t\t\tlogAtLevel(scope, level, `${exit}${exitInfo.details ?? ''}${timing}`);\n\t\t}\n\n\t\torigDispose();\n\t};\n\n\treturn scope;\n}\n\nfunction logAtLevel(\n\tscope: ScopedLogger,\n\tlevel: Exclude<LogLevel, 'off' | 'error' | 'warn'>,\n\tmessage: string,\n\t...params: any[]\n): void {\n\tswitch (level) {\n\t\tcase 'trace':\n\t\t\tLogger.trace(scope, message, ...params);\n\t\t\tbreak;\n\t\tcase 'info':\n\t\t\tLogger.info(scope, message, ...params);\n\t\t\tbreak;\n\t\tcase 'debug':\n\t\tdefault:\n\t\t\tLogger.debug(scope, message, ...params);\n\t}\n}\n"],"mappings":";;;;;AAUA,MAAa,sBAA+B,iBAAiB;;;;;;AAmC7D,SAAgB,eACf,SACA,aACA,QACA,QACA,eACe;CACf,IAAI;CACJ,IAAI;CACJ,IAAI,SAAS;CAGb,MAAM,QAAsB;EAClB;EACI;EACL;EACR,UAAU,UAAqCA,QAAO,QAAQ,KAAK;EACnE,IAAI,SAAS;GACZ,OAAO;EACR;EACA,YAAY,WAAkB;GAC7B,IAAI,QAAQ;GAEZ,SAAS;GACT,QAAQ,WAAW;GAEnB,MAAM,KAAK;GACX,gBAAgB,KAAA;GAChB,KAAK,KAAK;EACX;EACA,QAAQ,WAAkB;GACzB,gBAAgB,KAAA;EACjB;EACA,aAAa,SAAU,GAAG,SAAyB;GAClD,CAAC,gBAAgB,CAAC,EAAA,CAAG,KAAK,GAAG,OAAO;EACrC;EACA,WAAW,SAAU,QAAsB;GAC1C,aAAa;EACd;EAEA,aAAa,WAAY;GACxB,OAAO;IACN,SAAS,aAAa,SAAS,WAAW,YAAY,KAAK,IAAI,MAAM,KAAA;IACrE,QAAQ;GACT;EACD;CACD;CAEA,IAAI,OAAO,WAAW,YACrB,OAAO,eAAe,OAAO,UAAU;EACtC,cAAc;EACd,YAAY;EACZ,KAAK,WAAY;GAChB,MAA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AAI;EACd,WAAW,IAAI,aAAa;CAC7B;CAEA,MAAM,QAAQ,OAAO;CAErB,IAAI,CAAC,UACJ,WAAW,OAAO,OAAO,WAAW,EAAE;CAGvC,MAAM,cAAc,MAAM,OAAO;CACjC,MAAM,OAAO,iBAAiB;EAE7B,MAAM,SAAS,KADE,wBAAwB,KACd,EAAE;EAC7B,MAAM,WAAW,MAAM,YAAY;EACnC,MAAM,OAAO,SAAS,UAAU;EAEhC,IAAI,SAAS,UAAU,MACtB,QAAO,MAAM,MAAM,OAAO,GAAG,OAAO,SAAS,WAAW,KAAK,QAAQ;OAErE,WAAW,OAAO,OAAO,GAAG,OAAO,SAAS,WAAW,KAAK,QAAQ;EAGrE,YAAY;CACb;CAEA,OAAO;AACR;AAEA,SAAS,WACR,OACA,OACA,SACA,GAAG,QACI;CACP,QAAQ,OAAR;EACC,KAAK;GACJ,QAAO,MAAM,OAAO,SAAS,GAAG,MAAM;GACtC;EACD,KAAK;GACJ,QAAO,KAAK,OAAO,SAAS,GAAG,MAAM;GACrC;EAED,SACC,QAAO,MAAM,OAAO,SAAS,GAAG,MAAM;CACxC;AACD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitkraken/core-gitlens",
3
3
  "description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
4
- "version": "0.16.2",
4
+ "version": "0.16.4",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": {
7
7
  "name": "GitKraken",