Closed
Conversation
Co-authored-by: cmraible <5412422+cmraible@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rewrite logging package in TypeScript
feat: Rewrite packages/logging in TypeScript
Feb 20, 2026
Contributor
|
This was just a little experiment with Copilot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites
@tryghost/loggingfrom JavaScript to TypeScript, following established monorepo conventions (errors,prometheus-metrics).Structure
src/GhostLogger.ts— typed rewrite with exported interfaces (GhostLoggerOptions,LogLevel,TransportName, per-transport config types)src/index.ts— typed entry point; loadsloggingrc, exports logger instance viaexport =for backwards-compatible CJS shapesrc/types/declarations.d.ts— ambient declarations for untyped deps:gelf-stream,@tryghost/pretty-stream,@tryghost/http-stream,@tryghost/elasticsearch,@tryghost/bunyan-rotating-filestream,@tryghost/root-utilstest/logging.test.ts— test file converted to TypeScriptConfig
tsconfig.jsonextends the monorepo root: strict,noImplicitAny, ES2022 target, CommonJS output tobuild/. ESLint rules updated toplugin:ghost/ts/plugin:ghost/ts-test.Package
main→build/index.js,types→build/index.d.ts. Addedtypescript,ts-node, and@types/*devDependencies. Build runs viatsc;preparescript ensuresbuild/is always present on install.Public API example
Old JS
require('@tryghost/logging')consumers are unaffected — theexport =pattern preserves the originalmodule.exports = loggerInstanceCJS shape.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.