Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .lintstagedrc

This file was deleted.

4 changes: 0 additions & 4 deletions .lintstagedrc.json

This file was deleted.

22 changes: 22 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 140,
"bracketSpacing": false,
"trailingComma": "none",
"arrowParens": "always",
"ignorePatterns": [
"node_modules",
"**/lib",
"**/dist",
"**/coverage",
"**/.nyc_output",
"**/node_modules",
"*-lock.json",
"*.lock",
"benchmarks.*",
"**/generated",
"docs/api",
"docs/.vitepress/cache",
"docs/.vitepress/dist"
]
}
47 changes: 47 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["vitest"],
"categories": {
"correctness": "off",
Comment thread
Romakita marked this conversation as resolved.
Resolved
"suspicious": "off",
"pedantic": "off",
"restriction": "off",
"style": "off",
"nursery": "off"
},
"ignorePatterns": [
"**/coverage",
"**/lib",
"**/dist",
"**/snapshots",
"**/templates",
"**/docs/**",
"**/.nyc_output",
"**/generated",
"**/node_modules",
"node_modules",
"processes.config.js",
"*-lock.json",
"*.lock",
"benchmarks.*"
],
"rules": {
"eslint/sort-imports": "off",
"vitest/expect-expect": "off"
},
"overrides": [
{
"files": ["**/*.spec.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
"rules": {
"vitest/consistent-test-it": [
"error",
{
"fn": "it",
"withinDescribe": "it"
}
],
"vitest/no-alias-methods": "error"
}
}
]
}
9 changes: 0 additions & 9 deletions .prettierignore

This file was deleted.

6 changes: 0 additions & 6 deletions .prettierrc

This file was deleted.

5 changes: 2 additions & 3 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default defineConfig({
{text: "What is Ts.ED?", link: "/introduction/what-is-tsed"},
{text: "Capabilities", link: "/introduction/capabilities"},
{text: "Installation", link: "/introduction/getting-started"},
{text: "Migrate to v8", link: "/introduction/migrate-to-v8"},
{text: "Migrate to v8", link: "/introduction/migrate-to-v8"}
]
},
{
Expand Down Expand Up @@ -283,5 +283,4 @@ export default defineConfig({
md.use(apiAnchor);
}
}
})
;
});
5 changes: 1 addition & 4 deletions docs/.vitepress/plugins/utils/markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import remarkStringify from "remark-stringify";
import unified from "unified";

const {readFile} = fsExtra;
const markdownProcessor = unified()
.use(remarkParse)
.use(remarkStringify, {fences: true, bullet: "-"})
.use(remarkCleanApiMarkdown);
const markdownProcessor = unified().use(remarkParse).use(remarkStringify, {fences: true, bullet: "-"}).use(remarkCleanApiMarkdown);
const INLINE_SNIPPET_RE = /^<<<\s+@\/([^\s]+?)(?:\s+\[(.+?)\])?\s*$/gm;
const SYMBOL_TOKEN_RE = /@@([A-Za-z0-9_.-]+)@@/g;

Expand Down
4 changes: 2 additions & 2 deletions docs/appenders/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ npm install --save @tsed/logger-connect
import {$log} from "@tsed/logger";
import "@tsed/logger-connect";

$log.appenders.clear()
$log.appenders.clear();
$log.appenders.set("channel", {
type: "connect",
options: {
Expand All @@ -26,7 +26,7 @@ $log.appenders.set("channel", {
warn: (obj) => console.warn(obj),
debug: (obj) => console.debug(obj),
trace: (obj) => console.trace(obj),
error: (obj) => console.error(obj),
error: (obj) => console.error(obj)
}
}
});
Expand Down
1 change: 0 additions & 1 deletion docs/appenders/stderr.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ bun add @tsed/logger-std

:::


## Configuration

type - `stderr`
Expand Down
14 changes: 7 additions & 7 deletions docs/introduction/capabilities.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Capabilities

Ts.ED Logger is a Node.js and TypeScript multi-chanel logger.
Ts.ED Logger is a Node.js and TypeScript multi-chanel logger.
It provides plugins to log on the console, files, remote services, and more. The logger is designed to be extensible and easy to use.

You can use the logger in your Node.js and browser applications without a complex configuration.
Expand All @@ -9,16 +9,16 @@ You can find below the list of features and plugins provided by Ts.ED Logger and

## Appenders

[Appenders](/appenders/index.md) serialise log events to some form of output.
They can write to files, send emails, send data over the network.
[Appenders](/appenders/index.md) serialise log events to some form of output.
They can write to files, send emails, send data over the network.
It's basically a plugin that allows you to define where your logs will be written.

Here are the appenders list provided by Ts.ED logger and the compatibility with the different environments:

<div class="table-features">

| Features | Node.js/Bun.js | Browser |
|---------------------------------------------------------------|----------------------------------------------------|-----------------------------------------------------|
| ------------------------------------------------------------- | -------------------------------------------------- | --------------------------------------------------- |
| [Console](/appenders/console.md) | <img src="/icons/valid.svg" width="15" alt="yes"/> | <img src="/icons/valid.svg" width="15" alt="yes"/> |
| [Connect](/appenders/connect.md) | <img src="/icons/valid.svg" width="15" alt="yes"/> | <img src="/icons/invalid.svg" width="15" alt="no"/> |
| [File](/appenders/file.md) | <img src="/icons/valid.svg" width="15" alt="yes"/> | <img src="/icons/invalid.svg" width="15" alt="no"/> |
Expand All @@ -44,16 +44,16 @@ If none of the above appenders meet your needs, you can create your own appender

[Layouts](/layouts/index.md) are functions used by [appenders](/appenders/index.md) to format log events for output. They take a log event as an argument and return a string. TsLogDebug comes with several layouts built-in, and provides ways to create your own if these are not suitable.

For most use cases you will not need to configure layouts - there are some appenders which do not need layouts defined (for example, logstash-UDP);
For most use cases you will not need to configure layouts - there are some appenders which do not need layouts defined (for example, logstash-UDP);
all the appenders that use layouts will have a sensible default defined.

Most appender configuration will take a field called layout, which is an object - typically with a single field type which is the name of a layout defined below.
Most appender configuration will take a field called layout, which is an object - typically with a single field type which is the name of a layout defined below.
Some layouts require extra configuration options, which should be included in the same object.

<div class="table-features">

| Features | Description |
|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [Basic](/layouts/basic.md) | Basic layout will output the timestamp, level, category, followed by the formatted log event data. |
| [Colored](/layouts/colored.md) | Colored layout is the same as basic, except that the timestamp, level and category will be colored according to the log event's level. |
| [Dummy](/layouts/dummy.md) | Dummy only outputs the first value in the log event's data. |
Expand Down
10 changes: 5 additions & 5 deletions docs/introduction/migrate-to-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In v7, Appenders and Layouts were bundled with the main `@tsed/logger` package a

```typescript
// v7 (old)
import { JsonLayout } from "@tsed/logger";
import {JsonLayout} from "@tsed/logger";

// v8 (new)
import "@tsed/logger/layouts/JsonLayout.js";
Expand All @@ -37,10 +37,10 @@ Then import and use it:

```typescript
// v7 (old)
import { StdoutAppender, StdErrAppender } from "@tsed/logger";
import {StdoutAppender, StdErrAppender} from "@tsed/logger";

// v8 (new)
import { StdoutAppender, StdErrAppender } from "@tsed/logger-std";
import {StdoutAppender, StdErrAppender} from "@tsed/logger-std";
```

#### Using PatternLayout
Expand All @@ -57,10 +57,10 @@ Then import and use it:

```typescript
// v7 (old)
import { PatternLayout } from "@tsed/logger";
import {PatternLayout} from "@tsed/logger";

// v8 (new)
import { PatternLayout } from "@tsed/logger-pattern-layout";
import {PatternLayout} from "@tsed/logger-pattern-layout";
```

## Migration Steps
Expand Down
3 changes: 1 addition & 2 deletions docs/layouts/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ export class JsonLayout extends BaseLayout {
}
}

layout("customJson", JsonLayout)
layout("customJson", JsonLayout);
```

:::


This layout can be use like this:

```typescript
Expand Down
69 changes: 0 additions & 69 deletions eslint.config.js

This file was deleted.

10 changes: 3 additions & 7 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"npmClient": "yarn",
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"version": "8.0.5",
"command": {
"bootstrap": {
"npmClientArgs": [
"--no-package-lock"
]
"npmClientArgs": ["--no-package-lock"]
}
}
}
}
Loading
Loading