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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ updates:
time: "08:00"
timezone: "Europe/Chisinau"
open-pull-requests-limit: 10
ignore:
# @types/node tracks the minimum supported Node (see engines.node), not the newest
# release — otherwise the compiler would accept APIs missing at runtime on the
# oldest version we support. Raise this deliberately when the floor moves.
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
labels:
- "dependencies"
groups:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
strategy:
fail-fast: false
matrix:
# 20.6 is the floor (the dev scripts use --env-file); 24 is current.
node-version: ["20", "22", "24"]
# Node 20 reached end of life in April 2026, so 22 is the floor.
node-version: ["22", "24"]

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v6
with:
version: 10

- uses: actions/setup-node@v5
- uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: "pnpm"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
id-token: write # npm provenance

steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
with:
fetch-depth: 0

- uses: pnpm/action-setup@v4
- uses: pnpm/action-setup@v6
with:
version: 10

- uses: actions/setup-node@v5
- uses: actions/setup-node@v7
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
body_path: /tmp/release-notes.md
generate_release_notes: false
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.2.0] - 2026-09-10

### Changed

- **The minimum supported Node.js version is now 22.** Node 20 reached end of life on
30 April 2026. This also fixes a latent bug: `@inquirer/prompts` v8 is ESM-only, and
`require()` of an ES module only works from Node 20.19 onward — so interactive mode was
broken on Node 20.0 through 20.18, which the previous `>=20` range claimed to support.
- TypeScript 7. It removes the legacy `node10` module resolution, so the projects moved to
`nodenext`, which is what correctly models Node 22+ being able to `require()` an ES
module. `@types/node` is pinned to the supported floor rather than the newest release, so
the compiler rejects APIs that would not exist at runtime.
- Updated `ioredis` to 6, `mongodb` to 7, `pg`, `@inquirer/prompts` and `@biomejs/biome`,
and the GitHub Actions to their current majors. Each was verified against a real database
container, not just a green type-check.

## [1.1.0] - 2026-09-10

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributions are welcome. Here is how to get started in under 5 minutes.

## Prerequisites

- Node.js >= 20
- Node.js 22+
- pnpm >= 10
- A running PostgreSQL instance

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PostgreSQL Database Analyzer

[![Node.js 20+](https://img.shields.io/badge/node-20%2B-339933?logo=node.js)](https://nodejs.org/)
[![Node.js 22+](https://img.shields.io/badge/node-20%2B-339933?logo=node.js)](https://nodejs.org/)
[![npm version](https://img.shields.io/npm/v/@deniscuciuc/pg-analyzer?logo=npm&color=cb3837)](https://www.npmjs.com/package/@deniscuciuc/pg-analyzer)
[![npm downloads](https://img.shields.io/npm/dm/@deniscuciuc/pg-analyzer)](https://www.npmjs.com/package/@deniscuciuc/pg-analyzer)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
Expand Down Expand Up @@ -81,7 +81,7 @@ pg-analyzer -h your-host -d mydb -U postgres -c health

## Requirements

- Node.js >= 20
- Node.js 22+
- pnpm >= 10
- PostgreSQL 12+
- (Optional but recommended) `pg_stat_statements` extension for slow-query analysis
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@deniscuciuc/pg-analyzer",
"version": "1.1.0",
"description": "CLI tool that analyzes PostgreSQL databases for performance issues \u2014 indexes, slow queries, table bloat, connections and cache health.",
"version": "1.2.0",
"description": "CLI tool that analyzes PostgreSQL databases for performance issues — indexes, slow queries, table bloat, connections and cache health.",
"keywords": [
"postgresql",
"postgres",
Expand Down Expand Up @@ -75,13 +75,13 @@
},
"devDependencies": {
"@biomejs/biome": "2.3.11",
"@types/node": "^22.15.0",
"@types/node": "^22.19.3",
"@types/pg": "^8.16.0",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
},
"engines": {
"node": ">=20",
"node": ">=22",
"pnpm": ">=10"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class PostgresAnalyzer {
async vacuum(options: { full?: boolean } = {}): Promise<VacuumSummary> {
await this.connect();

const { TableAnalyzer } = await import("./analyzers/table-analyzer");
const { TableAnalyzer } = await import("./analyzers/table-analyzer.js");
const tables = new TableAnalyzer(this.requirePool(), this.analyzerOptions);

return tables.autoVacuum({ analyze: true, full: options.full });
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "CommonJS",
"module": "nodenext",
"lib": [
"ES2022"
],
Expand All @@ -15,7 +15,7 @@
"declaration": true,
"declarationMap": true,
"sourceMap": false,
"moduleResolution": "node",
"moduleResolution": "nodenext",
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noFallthroughCasesInSwitch": true,
Expand Down