Skip to content

Commit

Permalink
docs: Include external types and improve typedocs
Browse files Browse the repository at this point in the history
* Use typedoc plugin to include Pino types in typedocs
* Use media to include screenshot in typedocs
  • Loading branch information
FoxxMD committed Mar 7, 2024
1 parent d4fca38 commit 8dedb77
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/typedoc_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- run: npm run build

- name: Create the docs directory locally in CI
run: npx typedoc
run: npm run typedoc

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.4
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Features:
* Add or use your own streams for destinations
* All pino-pretty configs are exposed and extensible

<img src="/example/example.png"
alt="log output example" height="500">
<img src="/assets/example.png"
alt="log output example">
<img src="media://example.png"
alt="log output example">

# Install

Expand Down
File renamed without changes
101 changes: 101 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "https://github.com/foxxmd/logging",
"description": "",
"scripts": {
"typedoc": "typedoc",
"typedoc": "typedoc --plugin typedoc-plugin-missing-exports --media ./assets",
"build": "tsc",
"prepare": "tshy",
"test": "mocha --reporter spec --recursive ./tests/*.test.ts",
Expand Down Expand Up @@ -50,6 +50,8 @@
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"tshy": "^1.7.0",
"typedoc": "^0.25.11",
"typedoc-plugin-missing-exports": "^2.2.0",
"typescript": "^5.3.3",
"with-local-tmp-dir": "^5.0.1",
"yaml": "^2.3.4"
Expand Down
6 changes: 6 additions & 0 deletions src/factory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {prettyConsole, prettyFile, prettyOptsFactory} from "./pretty.js";
import {buildDestinationStream, buildDestinationRollingFile, buildDestinationStdout, buildDestinationStderr, buildDestinationFile} from "./destinations.js";
import {buildLogger} from './loggers.js';
import {FileDestination, StreamDestination} from './types.js'

export {
prettyConsole,
Expand All @@ -13,3 +14,8 @@ export {
buildDestinationRollingFile,
buildLogger
}

export type {
FileDestination,
StreamDestination
}
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface LogOptions {
*
* May also be specified using env LOG_PATH or a function that returns a string
*
* @default 'CWD/logs/app.log
* @default 'CWD/logs/app.log'
* */
filePath?: string | (() => string)
/**
Expand Down

0 comments on commit 8dedb77

Please sign in to comment.