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
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
with:
run_install: true

- name: Install Playwright
run: npx playwright install

- name: Run Lint
run: pnpm run lint

Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
dist
pnpm-lock.yaml
39 changes: 39 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# AGENTS.md

## Stack

- Node.js `^20.19.0 || >=22.12.0`
- `pnpm` single-package workspace
- TypeScript pure ESM package
- Build: `rslib` with tsgo declarations and publint
- Test runner: `rstest`

## Commands (run early)

```bash
# setup
corepack enable && pnpm install

# dev checks
pnpm lint
pnpm test

# build / package
pnpm build
npm pack --dry-run
```

## Project structure

```text
src/ # logger source and public exports
tests/ # rstest tests and snapshots
preview/ # local manual preview that imports dist
dist/ # generated package output
```

## Code style

- Use single quotes and existing format conventions.
- Keep TypeScript strict-safe; avoid `any`.
- Naming: camelCase (functions/files), PascalCase (types/classes).
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.1.3",
"repository": {
"type": "git",
"url": "https://github.com/rstackjs/rslog.git"
"url": "git+https://github.com/rstackjs/rslog.git"
},
"license": "MIT",
"type": "module",
Expand All @@ -19,8 +19,9 @@
],
"scripts": {
"build": "rslib",
"bump": "npx bumpp",
"lint": "rslint",
"bump": "pnpx bumpp",
"lint": "rslint && prettier --check .",
"lint:write": "rslint --fix && prettier --write .",
Comment thread
SoonIter marked this conversation as resolved.
"dev": "rslib --watch",
"preview": "node ./preview/index.ts",
"test": "rstest"
Expand All @@ -30,8 +31,10 @@
"@rslint/core": "^0.6.1",
"@rstest/core": "^0.10.4",
"@types/node": "^24.13.2",
"@typescript/native-preview": "7.0.0-dev.20260615.1",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
"path-serializer": "^0.6.0",
"prettier": "^3.8.4",
"rsbuild-plugin-publint": "^1.0.0",
"strip-ansi": "^7.2.0",
"supports-color": "^10.2.2",
"typescript": "^6.0.3"
Expand Down
150 changes: 146 additions & 4 deletions pnpm-lock.yaml

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

11 changes: 10 additions & 1 deletion rslib.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { defineConfig } from '@rslib/core';
import { pluginPublint } from 'rsbuild-plugin-publint';

export default defineConfig({
lib: [{ syntax: 'es2023', dts: true }],
plugins: [pluginPublint()],
lib: [
{
syntax: 'es2023',
dts: {
tsgo: true,
},
},
],
Comment thread
SoonIter marked this conversation as resolved.
});
4 changes: 1 addition & 3 deletions src/createLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ import type { Options, LogMessage, Logger, LogMethods } from './types.js';
const normalizeErrorMessage = (err: Error) => {
if (err.stack) {
const [rawName, ...rest] = err.stack.split('\n');
const name = rawName.startsWith('Error: ')
? rawName.slice(7)
: rawName;
const name = rawName.startsWith('Error: ') ? rawName.slice(7) : rawName;
return `${name}\n${color.gray(rest.join('\n'))}`;
}

Expand Down