Skip to content

Commit 22a7523

Browse files
authored
Merge pull request #21 from alienfast/tooling
Migrate tooling: ESLint/Prettier → Biome, Vite → tsdown
2 parents 8524ce2 + d0e3135 commit 22a7523

50 files changed

Lines changed: 2613 additions & 3524 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.markdownlint.jsonc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"default": true,
3+
"MD013": false
4+
}

.markdownlintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
**/CHANGELOG.md

.ncurc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
packageFile: './package.json',
33
packageManager: 'yarn',
4-
workspaces: true,
54
root: true,
5+
workspaces: true,
66
}

.prettierignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
2+
"recommendations": ["biomejs.biome", "davidanson.vscode-markdownlint"]
33
}

.vscode/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"search.exclude": {
3-
"**/.yarn": true,
4-
"**/.pnp.*": true
3+
"**/.pnp.*": true,
4+
"**/.yarn": true
55
},
6-
"eslint.useFlatConfig": true,
76
"typescript.enablePromptUseWorkspaceTsdk": true,
8-
"testing.automaticallyOpenPeekView": "never"
7+
"typescript.tsdk": "node_modules/typescript/lib",
8+
"vitest.maximumConfigs": 15
99
}

.vscode/tasks.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
// See https://go.microsoft.com/fwlink/?LinkId=733558
3-
// for the documentation about the tasks.json format
4-
"version": "2.0.0",
52
"tasks": [
63
{
7-
"type": "npm",
8-
"script": "typecheck",
9-
"problemMatcher": ["$tsc"],
4+
"detail": "echo 'tsc -p tsconfig.json --pretty' && tsc -p tsconfig.json --pretty",
105
"group": {
11-
"kind": "build",
12-
"isDefault": true
13-
}
6+
"isDefault": true,
7+
"kind": "build"
8+
},
9+
"label": "npm: check-types",
10+
"problemMatcher": ["$tsc"],
11+
"script": "check-types",
12+
"type": "npm"
1413
}
15-
]
14+
],
15+
"version": "2.0.0"
1616
}

CLAUDE.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
This is a TypeScript monorepo for AlienFast logger packages, managed with Lerna and built with Vite. The project provides logging functionality across three main packages:
7+
This is a TypeScript monorepo for AlienFast logger packages, managed with Lerna and built with tsdown. The project provides logging functionality across three main packages:
88

99
- `@alienfast/logger` - Core logging interfaces and functionality
1010
- `@alienfast/logger-browser` - Browser-specific logging implementation
@@ -15,9 +15,17 @@ This is a TypeScript monorepo for AlienFast logger packages, managed with Lerna
1515
### Development
1616

1717
- `yarn build` - Build all packages (clean → prep → individual builds)
18-
- `yarn typecheck` - TypeScript compilation only (`tsc -b`)
19-
- `yarn test` - Run all tests across packages (builds first, then runs in parallel)
20-
- `yarn lint:fix` - Run ESLint with auto-fix
18+
- `yarn check-types` - TypeScript type-checking only (`tsc -p tsconfig.json --pretty`)
19+
- `yarn test` - Run all tests across packages (type-checks first, then runs tests in parallel)
20+
- `yarn lint-fix` - Run Biome with auto-fix for code formatting and linting
21+
22+
### Quality Checks
23+
24+
- `yarn check` - Run all quality checks (types, Biome, circular dependencies, markdown)
25+
- `yarn check-types` - TypeScript type-checking without emitting files
26+
- `yarn check-biome` - Run Biome checks with auto-fixing
27+
- `yarn check-circular` - Detect circular dependencies using madge
28+
- `yarn check-markdown` - Lint markdown files with markdownlint
2129

2230
### Package Management
2331

@@ -28,7 +36,7 @@ This is a TypeScript monorepo for AlienFast logger packages, managed with Lerna
2836

2937
All packages support these commands (run from package directory or with `lerna exec`):
3038

31-
- `yarn build` - Build individual package using shared Vite config
39+
- `yarn build` - Build individual package using shared tsdown config
3240
- `yarn test` - Run package-specific tests with Vitest
3341

3442
## Architecture
@@ -37,15 +45,19 @@ All packages support these commands (run from package directory or with `lerna e
3745

3846
- **Workspace Root**: Contains shared configuration and build tools
3947
- **packages/logger**: Core logging abstractions (`Logger`, `Log`, `LogWriter`, etc.)
48+
- Includes `diagnostics.ts` module for circular dependency diagnostic utilities
4049
- **packages/logger-browser**: Browser-specific implementations (`BrowserLogWriter`)
4150
- **packages/logger-node**: Node.js implementations with colored console output (`NodeLogWriter`)
4251

4352
### Build System
4453

45-
- **Vite** for library builds with TypeScript declaration generation
46-
- **Shared configuration** in `vite.config.lib.ts` used by all packages
47-
- **ESM-only** output format with tree-shaking support
54+
- **tsdown** for library builds with TypeScript declaration generation
55+
- **Shared configuration** in `tsdown.config.base.ts` used by all packages
56+
- **ESM-only unbundled** output format with automatic exports generation
4857
- **Type preservation** with source maps for debugging
58+
- **Vite** still used for testing via Vitest
59+
- Each package has `tsconfig.build.json` for build-specific configuration
60+
- Root `tsconfig.json` has `noEmit: true` for type-checking only
4961

5062
### Key Dependencies
5163

@@ -54,23 +66,31 @@ All packages support these commands (run from package directory or with `lerna e
5466
- Node package adds `chalk` for colored output
5567
- All packages use `clean-package` for publishing optimizations
5668

69+
### Code Quality
70+
71+
- **Biome** for code formatting and linting (replaces ESLint/Prettier)
72+
- **markdownlint** for markdown file linting
73+
- **madge** for circular dependency detection
74+
- **TypeScript** strict mode with comprehensive type-checking
75+
5776
### Testing
5877

5978
- **Vitest** for unit testing across all packages
60-
- Tests run in parallel after TypeScript compilation
79+
- Tests run in parallel after TypeScript type-checking
6180
- Individual package testing supported
6281

6382
### Release Process
6483

6584
- **Auto** for automated releases with conventional commits
6685
- **Lerna** for coordinated package versioning
6786
- **GitHub Packages** registry for publishing
68-
- Pre-commit hooks with lint-staged for code quality
87+
- Pre-commit hooks with lint-staged running Biome checks
6988

7089
## Development Workflow
7190

7291
1. Make changes in relevant package(s) under `packages/`
73-
2. Run `yarn typecheck` for quick type checking
74-
3. Run `yarn test` to ensure all tests pass
75-
4. Use `yarn lint:fix` to format code
76-
5. Commit follows conventional commit format for auto-releases
92+
2. Run `yarn check-types` for quick type checking
93+
3. Run `yarn test` to ensure all tests pass (includes type-checking)
94+
4. Use `yarn lint-fix` to format code with Biome
95+
5. Run `yarn check` to verify all quality checks pass
96+
6. Commit follows conventional commit format for auto-releases

PERFORMANCE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ LogWriter implementations check log levels before expensive operations like time
2121
## Performance Characteristics
2222

2323
**When log levels are set to WARN/ERROR:**
24+
2425
- Debug/info calls have near-zero overhead (< 0.001ms per call)
2526
- Spread operator overhead eliminated for disabled log levels
2627
- Object serialization optimized with efficient cycle detection
2728
- Timestamp and formatting operations skipped when not needed
2829

2930
**Backward Compatibility:**
31+
3032
- All existing APIs work unchanged
3133
- No migration required
3234
- Performance improvements are automatic
@@ -45,4 +47,4 @@ The optimizations work at three levels:
4547
- **Production configuration**: Set system threshold to WARN or ERROR for optimal performance
4648
- **Complex objects**: Benefits are automatic when logging objects with circular references
4749

48-
The optimizations ensure that production applications with logging set to WARN+ experience minimal performance impact from debug/info logging statements.
50+
The optimizations ensure that production applications with logging set to WARN+ experience minimal performance impact from debug/info logging statements.

biome.jsonc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
3+
"extends": ["@alienfast/biome-config/base"],
4+
"files": {
5+
"experimentalScannerIgnores": [
6+
"node_modules/**",
7+
"**/dist/**",
8+
"**/node_modules/**",
9+
"packages/*/dist/**"
10+
],
11+
"includes": ["**/*"]
12+
},
13+
"linter": {
14+
"rules": {
15+
"complexity": {
16+
"noStaticOnlyClass": "off"
17+
}
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)