Skip to content

Commit

Permalink
feat(logger): outdent
Browse files Browse the repository at this point in the history
  • Loading branch information
paularmstrong committed Dec 18, 2024
1 parent 10944e1 commit a1af38a
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
40 changes: 36 additions & 4 deletions docs/src/content/docs/plugins/docgen.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,46 @@
---
title: '@onerepo/plugin-docgen'
sidebar:
label: Documentation generation
label: Documentation generation
description: Official plugin for generating documentation in the oneRepo JavaScript and TypeScript monorepo toolchain.
meta:
version: 1.0.1
stability: stable
version: 1.0.1
stability: stable
---

# import { Tabs, TabItem } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';

## Installation

<Tabs syncKey="pkgmanager">
<TabItem label="npm">

```sh title="Install via npm"
npm install --save-dev @onerepo/plugin-docgen
```

</TabItem>
<TabItem label="yarn">

```sh title="Install via Yarn"
yarn add --dev @onerepo/plugin-docgen
```

</TabItem>
<TabItem label="pnpm">

```sh title="Install via pnpm"
pnpm install --save-dev @onerepo/plugin-docgen
```

</TabItem>
</Tabs>

:::tip[Example]
Check out our very own source level [example](example/) generated directly from the oneRepo source code using this plugin.
:::

## Configuration

{/* start-auto-generated-from-cli-docgen */}
{/* @generated SignedSource<<eae31dc5c19ef17bf4fe8e4d9ee63db2>> */}
Expand Down
2 changes: 1 addition & 1 deletion modules/logger/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Buffered extends Transform {
.toString()
.trim()
.split('\n')
.map((line) => (line.startsWith(prefix.end) ? `${line}` : ` ${line.trim()}`))
.map((line) => `${line.trim()}`)
.join('\n')}\n`,
);
callback();
Expand Down
2 changes: 1 addition & 1 deletion modules/logger/src/transforms/LogProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class LogProgress extends Transform {
clearTimeout(this.#updaterTimeout);
this.#updaterTimeout = setTimeout(() => {
// this.push(new Error().stack);
this.write(` ${frames[this.#frame % frames.length]}`);
this.write(`└ ${frames[this.#frame % frames.length]}`);
this.#written = true;
this.#frame += 1;
// this.#runUpdater();
Expand Down
6 changes: 3 additions & 3 deletions modules/logger/src/transforms/LogStepToString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class LogStepToString extends Transform {
}
return output
.split('\n')
.map((line) => ` ${group ? '│ ' : ''}${prefix[type]}${line}`)
.map((line) => `${group ? '│ ' : ''}${prefix[type]}${line}`)
.join('\n');
}
}
Expand All @@ -60,8 +60,8 @@ const typeMinVerbosity: Record<LineType, number> = {

export const prefix: Record<LineType, string> = {
timing: pc.red('⏳'),
start: ' ┌ ',
end: ' └ ',
start: '┌ ',
end: '└ ',
error: pc.red(pc.bold('ERR ')),
warn: pc.yellow(pc.bold('WRN ')),
log: pc.cyan(pc.bold('LOG ')),
Expand Down

0 comments on commit a1af38a

Please sign in to comment.