From 9c3f7acae85fe16f36c1e7acf061be0166143669 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Wed, 11 Feb 2026 15:57:37 +0000 Subject: [PATCH] fix(imports): use node: built-in imports and remove dead smartpromise/smartdelay exports --- changelog.md | 8 ++++++++ readme.hints.md | 9 +++++++-- test/server/test.authenticator.ts | 2 +- test/server/test.chap.ts | 2 +- test/server/test.pap.ts | 2 +- ts/00_commitinfo_data.ts | 2 +- ts_client/plugins.ts | 10 ++-------- ts_server/plugins.ts | 4 ++-- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/changelog.md b/changelog.md index d2a2c33..df07cb2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2026-02-11 - 1.1.1 - fix(imports) +use node: built-in imports and remove dead smartpromise/smartdelay exports + +- Replaced bare Node.js built-in imports with node: prefix in ts_server/plugins.ts, ts_client/plugins.ts, and tests (crypto, dgram) for ESM/Deno/Bun compatibility. +- Removed dead smartpromise and smartdelay exports from ts_client/plugins.ts (packages remain in package.json). +- Updated readme.hints.md to document node: import requirement, note removal of dead imports, and record the change date/notes. +- No functional API changes expected — this is a compatibility/cleanup patch. + ## 2026-02-01 - 1.1.0 - feat(smartradius) Implement full RADIUS server and client with RFC 2865/2866 compliance, including packet handling, authenticators, attributes, secrets manager, client APIs, and comprehensive tests and documentation diff --git a/readme.hints.md b/readme.hints.md index fbff29a..95cb471 100644 --- a/readme.hints.md +++ b/readme.hints.md @@ -57,7 +57,7 @@ ts/ (order: 3) - Main exports (re-exports server + client) } ``` -Node.js built-ins: `dgram` (UDP), `crypto` (MD5/HMAC) +Node.js built-ins: `node:dgram` (UDP), `node:crypto` (MD5/HMAC) ## Build System - Uses `@git.zone/tsbuild` v4.x with tsfolders mode @@ -107,5 +107,10 @@ Downloaded to `./spec/`: - `rfc2865.txt` - RADIUS Authentication - `rfc2866.txt` - RADIUS Accounting +## Code Quality Notes +- All Node.js built-in imports use `node:` prefix (ESM/Deno/Bun compatible) +- Dead `smartpromise`/`smartdelay` imports removed from `ts_client/plugins.ts` (packages kept in package.json) +- Rust migration assessed as not cost-effective: crypto ops already delegate to OpenSSL C, RADIUS packets are small (max 4096 bytes), IPC overhead would negate any gains + ## Last Updated -2026-02-01 - Full implementation complete with RFC 2865/2866 compliance +2026-02-11 - Fixed bare node: imports, removed dead imports, assessed Rust migration diff --git a/test/server/test.authenticator.ts b/test/server/test.authenticator.ts index c075801..d3eb102 100644 --- a/test/server/test.authenticator.ts +++ b/test/server/test.authenticator.ts @@ -1,5 +1,5 @@ import { expect, tap } from '@git.zone/tstest/tapbundle'; -import * as crypto from 'crypto'; +import * as crypto from 'node:crypto'; import { RadiusAuthenticator, RadiusPacket, diff --git a/test/server/test.chap.ts b/test/server/test.chap.ts index 5204a5c..125991a 100644 --- a/test/server/test.chap.ts +++ b/test/server/test.chap.ts @@ -1,5 +1,5 @@ import { expect, tap } from '@git.zone/tstest/tapbundle'; -import * as crypto from 'crypto'; +import * as crypto from 'node:crypto'; import { RadiusAuthenticator } from '../../ts_server/index.js'; tap.test('should calculate CHAP response per RFC', async () => { diff --git a/test/server/test.pap.ts b/test/server/test.pap.ts index 12bbd42..1b8f8fb 100644 --- a/test/server/test.pap.ts +++ b/test/server/test.pap.ts @@ -1,5 +1,5 @@ import { expect, tap } from '@git.zone/tstest/tapbundle'; -import * as crypto from 'crypto'; +import * as crypto from 'node:crypto'; import { RadiusAuthenticator } from '../../ts_server/index.js'; tap.test('should encrypt and decrypt short password (< 16 chars)', async () => { diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 0b57764..2947ef5 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartradius', - version: '1.1.0', + version: '1.1.1', description: 'A RADIUS server and client implementation for Node.js with full RFC 2865/2866 compliance' } diff --git a/ts_client/plugins.ts b/ts_client/plugins.ts index d443eac..67b13ba 100644 --- a/ts_client/plugins.ts +++ b/ts_client/plugins.ts @@ -1,13 +1,7 @@ -import * as crypto from 'crypto'; -import * as dgram from 'dgram'; - -// Import from smartpromise for deferred promises -import * as smartpromise from '@push.rocks/smartpromise'; -import * as smartdelay from '@push.rocks/smartdelay'; +import * as crypto from 'node:crypto'; +import * as dgram from 'node:dgram'; export { crypto, dgram, - smartpromise, - smartdelay, }; diff --git a/ts_server/plugins.ts b/ts_server/plugins.ts index 718a472..67b13ba 100644 --- a/ts_server/plugins.ts +++ b/ts_server/plugins.ts @@ -1,5 +1,5 @@ -import * as crypto from 'crypto'; -import * as dgram from 'dgram'; +import * as crypto from 'node:crypto'; +import * as dgram from 'node:dgram'; export { crypto,