Skip to content
Closed
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
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AGENTS.md

This file gives coding agents concise guidance for working in this repository.

## Repository Overview

`rslog` is a small pure ESM logger package for Node.js. Source code lives in
`src/`, tests live in `tests/`, and Rslib emits the publishable package into
`dist/`.

## Commands

- Install dependencies: `corepack pnpm install --frozen-lockfile`
- Lint and format check: `corepack pnpm run lint`
- Auto-fix lint and formatting: `corepack pnpm run lint:write`
- Build the package: `corepack pnpm run build`
- Run tests: `corepack pnpm run test`
- Check package contents: `npm pack --dry-run`

## Package Contract

- Keep the package pure ESM: `type: "module"` with exports pointing to
`dist/index.js` and `dist/index.d.ts`.
- Keep runtime support aligned with `package.json#engines.node`.
- Public API should be exported from `src/index.ts`; avoid adding deep import
contracts unless they are intentionally documented.
- Rslib owns build output. Do not edit `dist/` by hand.

## Maintenance Notes

- Keep GitHub Actions third-party actions pinned to commit hashes.
- Run Knip locally when changing dependencies, but do not add Knip as a project
dependency unless the repository starts using it in scripts.
- Preserve log output behavior and snapshots unless a change intentionally
updates user-visible formatting.
7 changes: 5 additions & 2 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 @@ -20,7 +20,8 @@
"scripts": {
"build": "rslib",
"bump": "npx bumpp",
"lint": "rslint",
"lint": "rslint && prettier --check .",
"lint:write": "rslint --fix && prettier --write .",
"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",
"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,
},
},
],
});
3 changes: 2 additions & 1 deletion rslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig, ts } from '@rslint/core';
import { defineConfig, js, ts } from '@rslint/core';

export default defineConfig([
{ ignores: ['**/dist/**'] },
js.configs.recommended,
ts.configs.recommended,
]);
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