Skip to content

v0.7.14

Choose a tag to compare

@github-actions github-actions released this 05 Oct 18:12
· 28 commits to main since this release

ExisJS Release v0.7.14

Release Date: 2026-10-05
Type: Stability, CLI & Runtime Hardening
Affected Packages: exisjs, create-exisjs


Highlights

  • Windows Subprocess & CLI Spawning Hardening (exis run / exis exec):

    • Resolved C:\Program is not recognized as an internal or external command error on Windows systems with space-containing Node.js installation paths (e.g., C:\Program Files\nodejs\node.exe).
    • Switched direct Node binary execution to shell: false and windowsHide: true, preventing security deprecation warnings and CLI execution failures.
  • File-System Route Specificity & Radix Tree Segment Ordering:

    • Enhanced fs-scanner.ts sorting to guarantee static routes always take precedence over dynamic wildcard [id] and catch-all [...slug] segments regardless of directory traversal order.
    • Prevents accidental shadowing between static endpoints (e.g. /api/stock/kpis) and co-located parameterized routes (e.g. /api/stock/[id]).
  • Enhanced Binary, Buffer & Stream File Responses (res.download()):

    • Extended res.download() to accept Node.js Readable streams, Web ReadableStream, Buffer, strings, and file paths with unified signature and automatic streaming.
    • Automatically configures Content-Disposition: attachment; filename="..." and Content-Type headers with support for custom headers.
  • Graceful Shutdown & Windows Libuv Assertion Resolution:

    • Fixed Windows Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 94 and write EPIPE during server termination/hot-reloading.
    • Safely disconnects IPC channels via process.disconnect() before closing HTTP servers and database connection pools.
    • Added quiet EPIPE and EOF error handling on process.stdout and process.stderr during the termination phase.
    • Ensured coordinated shutdown for cron.stopAll() and DatabaseManager.disconnectAll().
  • Strict Type Inference & Route Type Preservation:

    • Hardened IsOptional<T> and IsNullable<T> type flags in TexEngine to prevent union type collapse.
    • Ensured createRouter and route definitions strictly preserve handler parameter and response types without requiring manual type assertions.

Detailed Improvements & Usage Examples

1. First-Class Binary & Stream Downloads

import { route } from 'exisjs/router'
import { createReadStream } from 'node:fs'

export const getExport = route.get({
  path: '/export/csv',
  async handle(req, res) {
    const csvBuffer = Buffer.from('id,name,role\n1,Alice,Admin')
    return res.download(csvBuffer, 'users.csv', {
      contentType: 'text/csv',
    })
  },
})

export const getLogStream = route.get({
  path: '/export/logs',
  async handle(req, res) {
    const stream = createReadStream('./logs/app.log')
    return res.download(stream, 'audit.log')
  },
})

2. Route Specificity Resolution

Directory structure:

src/http/
├── stock/
│   ├── [id]/
│   │   └── route.ts     # Matches /stock/123
│   └── kpis/
│       └── route.ts     # Explicitly prioritized over /stock/[id]

Static route segments are registered ahead of parameterized routes in the radix tree, preventing dynamic shadowing.

Full Changelog: v0.7.13...v0.7.14