fix(deps): bump dependencies, adjust build script and npmextra publish config, and refresh documentation

This commit is contained in:
2026-02-13 22:21:55 +00:00
parent 9cf33ab850
commit aad9d65a96
7 changed files with 2625 additions and 1446 deletions

View File

@@ -1,5 +1,14 @@
# Changelog
## 2026-02-13 - 3.0.8 - fix(deps)
bump dependencies, adjust build script and npmextra publish config, and refresh documentation
- Bumped runtime deps: @push.rocks/lik ^6.0.0 -> ^6.2.2, @push.rocks/smartenv ^5.0.2 -> ^6.0.0, @push.rocks/smartnetwork ^3.0.0 -> ^4.4.0, @push.rocks/smartpromise ^4.0.2 -> ^4.2.3, systeminformation ^5.12.1 -> ^5.30.7
- Updated devDependencies: @git.zone/tsbuild ^2.1.63 -> ^4.1.2, @git.zone/tsrun ^1.3.3 -> ^2.0.1, @git.zone/tstest ^1.0.72 -> ^3.1.8; removed tslint and tslint-config-prettier
- Changed build script to remove --allowimplicitany ("build": "(tsbuild tsfolders)")
- Updated npmextra.json: migrated keys to scoped entries (@git.zone/cli, @git.zone/tsdoc, @ship.zone/szci), added release registries (verdaccio + npm) and accessLevel
- Documentation updates: expanded readme.md with examples, runtime detection, network and system usage, legal/licensing clarifications; added readme.hints.md
## 2025-08-29 - 3.0.7 - fix(build)
Switch build script to run tsbuild on tsfolders instead of using the --web flag

View File

@@ -1,9 +1,5 @@
{
"npmci": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
@@ -23,9 +19,19 @@
"async",
"cross-platform"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"tsdoc": {
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
},
"@ship.zone/szci": {
"npmGlobalTools": []
}
}

View File

@@ -7,7 +7,7 @@
"type": "module",
"scripts": {
"test": "(tstest test/ --verbose --logfile --timeout 60)",
"build": "(tsbuild tsfolders --allowimplicitany)",
"build": "(tsbuild tsfolders)",
"buildDocs": "tsdoc"
},
"repository": {
@@ -32,18 +32,16 @@
},
"homepage": "https://code.foss.global/push.rocks/smartsystem",
"dependencies": {
"@push.rocks/lik": "^6.0.0",
"@push.rocks/smartenv": "^5.0.2",
"@push.rocks/smartnetwork": "^3.0.0",
"@push.rocks/smartpromise": "^4.0.2",
"systeminformation": "^5.12.1"
"@push.rocks/lik": "^6.2.2",
"@push.rocks/smartenv": "^6.0.0",
"@push.rocks/smartnetwork": "^4.4.0",
"@push.rocks/smartpromise": "^4.2.3",
"systeminformation": "^5.30.7"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.63",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.72",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
"@git.zone/tsbuild": "^4.1.2",
"@git.zone/tsrun": "^2.0.1",
"@git.zone/tstest": "^3.1.8"
},
"private": false,
"files": [

3797
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1 +1,26 @@
# @push.rocks/smartsystem - Project Hints
## Project Overview
A TypeScript library providing a unified interface for system interaction: environment detection, CPU info, network utilities, and deep system information.
## Architecture
- Single main class `Smartsystem` in `ts/index.ts`
- Plugins file `ts/smartsystem.plugins.ts` imports all dependencies
- Dependencies: `@push.rocks/smartenv`, `@push.rocks/smartnetwork`, `@push.rocks/lik`, `@push.rocks/smartpromise`, `systeminformation`, plus Node.js `os`
## Build & Test
- Build: `pnpm build` (uses `tsbuild tsfolders`)
- Test: `pnpm test` (uses `tstest test/ --verbose --logfile --timeout 60`)
- All 3 tests passing as of last check
## Dependencies (all at latest as of 2026-02-12)
- `@push.rocks/lik`: ^6.2.2
- `@push.rocks/smartenv`: ^6.0.0
- `@push.rocks/smartnetwork`: ^4.4.0
- `@push.rocks/smartpromise`: ^4.2.3
- `systeminformation`: ^5.30.7
- Dev: `@git.zone/tsbuild`: ^4.1.2, `@git.zone/tsrun`: ^2.0.1, `@git.zone/tstest`: ^3.1.8
## Notes
- No license file at project root (readme references `./LICENSE`)
- No tspublish-based submodules

198
readme.md
View File

@@ -1,32 +1,32 @@
# @push.rocks/smartsystem 🚀
**Smart System Interaction for Node.js**
Smart System Interaction for Node.js — your unified gateway to hardware, OS, environment, and network intelligence.
> Zero-hassle system information and environment management for modern Node.js applications.
## Issue Reporting and Security
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
## 🌟 Features
`@push.rocks/smartsystem` consolidates system interaction into a single, elegant TypeScript-first API:
- 🔧 **Unified System Interface** - One `Smartsystem` instance to rule them all
- 🌍 **Environment Management** - Smart env variable handling via [@push.rocks/smartenv](https://www.npmjs.com/package/@push.rocks/smartenv)
- 💻 **CPU Information** - Direct access to CPU specs without the boilerplate
- 🌐 **Network Intelligence** - Advanced networking utilities from [@push.rocks/smartnetwork](https://www.npmjs.com/package/@push.rocks/smartnetwork)
- 📊 **Deep System Insights** - Comprehensive hardware and OS data via [systeminformation](https://www.npmjs.com/package/systeminformation)
-**TypeScript Native** - Built with TypeScript, for TypeScript (but works great with JS too!)
- 🔧 **Unified System Interface** One `Smartsystem` instance to rule them all
- 🌍 **Runtime Detection** — Identify Node.js, Deno, Bun, or browser environments via [@push.rocks/smartenv](https://www.npmjs.com/package/@push.rocks/smartenv)
- 💻 **CPU Information** Direct access to CPU core specs without the boilerplate
- 🌐 **Network Intelligence** — Port scanning, speed tests, DNS resolution, traceroutes, and more via [@push.rocks/smartnetwork](https://www.npmjs.com/package/@push.rocks/smartnetwork)
- 📊 **Deep System Insights** Comprehensive hardware, OS, Docker, and performance data via [systeminformation](https://www.npmjs.com/package/systeminformation)
-**TypeScript Native** Built with TypeScript, for TypeScript (but works great with JS too!)
## 📦 Installation
Get started with your package manager of choice:
```bash
# Using npm
npm install @push.rocks/smartsystem
# Using pnpm (recommended)
pnpm add @push.rocks/smartsystem
# Using yarn
yarn add @push.rocks/smartsystem
# Using npm
npm install @push.rocks/smartsystem
```
## 🚀 Quick Start
@@ -37,7 +37,12 @@ import { Smartsystem } from '@push.rocks/smartsystem';
// Create your system interface
const mySystem = new Smartsystem();
// You're ready to rock! 🎸
// CPU cores at a glance
console.log(`Running on ${mySystem.cpus.length} CPU cores`);
// Deep system data
const osInfo = await mySystem.information.osInfo();
console.log(`OS: ${osInfo.distro} ${osInfo.release}`);
```
## 📖 API Overview
@@ -46,48 +51,92 @@ The `Smartsystem` class provides these powerful properties:
| Property | Type | Description |
|----------|------|-------------|
| `env` | `Smartenv` | Environment variable management with validation and type safety |
| `cpus` | `os.CpuInfo[]` | Direct access to CPU core information |
| `network` | `SmartNetwork` | Network interface inspection and utilities |
| `information` | `systeminformation` | Full access to the systeminformation library |
| `env` | `Smartenv` | Runtime environment detection — identify Node.js, Deno, Bun, browser, CI, and OS platform |
| `cpus` | `os.CpuInfo[]` | Direct access to CPU core information (model, speed, times) |
| `network` | `SmartNetwork` | Network utilities — port scanning, speed tests, DNS, ping, traceroute |
| `information` | `systeminformation` | Full access to 50+ system data functions (CPU, memory, disk, GPU, Docker, etc.) |
## 💡 Usage Examples
### Environment Variables Made Easy
### 🌍 Runtime Environment Detection
Detect where your code is running and adapt accordingly:
```typescript
const mySystem = new Smartsystem();
// Get all environment variables
const envVars = mySystem.env.getEnvVars();
// Runtime identification
console.log(`Runtime: ${mySystem.env.runtimeEnv}`); // 'node', 'deno', 'bun', or 'browser'
console.log(`Is Node.js: ${mySystem.env.isNode}`);
console.log(`Is CI: ${mySystem.env.isCI}`);
// Access specific variables with type safety
const apiKey = mySystem.env.getEnvVarOnDemand('API_KEY');
// OS detection
if (await mySystem.env.isLinuxAsync()) {
console.log('🐧 Running on Linux');
} else if (await mySystem.env.isMacAsync()) {
console.log('🍎 Running on macOS');
}
// Conditionally load modules based on runtime
const fsModule = await mySystem.env.getSafeModuleFor<typeof import('fs')>('node', 'fs');
```
### CPU Information at Your Fingertips
### 💻 CPU Information at Your Fingertips
```typescript
const mySystem = new Smartsystem();
// Get CPU details
console.log(`Running on ${mySystem.cpus.length} CPU cores`);
console.log(`CPU Cores: ${mySystem.cpus.length}`);
console.log(`Primary CPU: ${mySystem.cpus[0].model}`);
console.log(`Speed: ${mySystem.cpus[0].speed} MHz`);
```
### Network Intelligence
### 🌐 Network Intelligence
Leverage the full power of `SmartNetwork`:
```typescript
const mySystem = new Smartsystem();
// Get comprehensive network information
const networkInfo = await mySystem.network.getNetworkInfo();
console.log('Network interfaces:', networkInfo);
// Check if a local port is available
const portFree = await mySystem.network.isLocalPortUnused(3000);
console.log(`Port 3000 available: ${portFree}`);
// Find a free port in a range
const freePort = await mySystem.network.findFreePort(8000, 9000);
console.log(`Free port found: ${freePort}`);
// Check remote port availability
const isReachable = await mySystem.network.isRemotePortAvailable('example.com', { port: 443 });
console.log(`Remote HTTPS reachable: ${isReachable}`);
// DNS resolution
const dns = await mySystem.network.resolveDns('example.com');
console.log(`A records: ${dns.A.join(', ')}`);
// Ping a host
const pingResult = await mySystem.network.ping('8.8.8.8', { count: 3 });
// Get public IP addresses
const publicIps = await mySystem.network.getPublicIps();
console.log(`Public IPv4: ${publicIps.v4}`);
// Run a speed test
const speed = await mySystem.network.getSpeed();
console.log(`Download: ${speed.downloadSpeed} | Upload: ${speed.uploadSpeed}`);
// HTTP endpoint health check
const health = await mySystem.network.checkEndpoint('https://example.com');
console.log(`Status: ${health.status}, RTT: ${health.rtt}ms`);
// Traceroute
const hops = await mySystem.network.traceroute('example.com', { maxHops: 15 });
hops.forEach(hop => console.log(`TTL ${hop.ttl}: ${hop.ip} (${hop.rtt}ms)`));
```
### Deep System Insights
### 📊 Deep System Insights
Access detailed system information for advanced use cases:
Access detailed system information via `systeminformation`:
```typescript
const mySystem = new Smartsystem();
@@ -100,20 +149,32 @@ console.log(`System: ${systemInfo.manufacturer} ${systemInfo.model}`);
const osInfo = await mySystem.information.osInfo();
console.log(`OS: ${osInfo.distro} ${osInfo.release}`);
// Real-time system metrics
// Real-time CPU metrics
const load = await mySystem.information.currentLoad();
console.log(`CPU Load: ${load.currentLoad.toFixed(2)}%`);
// Memory usage
const mem = await mySystem.information.mem();
console.log(`Memory: ${(mem.used / mem.total * 100).toFixed(2)}% used`);
// Disk information
const disk = await mySystem.information.fsSize();
disk.forEach(fs => console.log(`${fs.mount}: ${fs.use.toFixed(1)}% used`));
// GPU details
const gpu = await mySystem.information.graphics();
gpu.controllers.forEach(c => console.log(`GPU: ${c.model} (${c.vram}MB VRAM)`));
// Network interfaces
const defaultIface = await mySystem.information.networkInterfaceDefault();
console.log(`Default network interface: ${defaultIface}`);
```
## 🎯 Real-World Use Cases
### System Health Monitoring
Create a simple health check for your application:
Build a health check endpoint for your application:
```typescript
const mySystem = new Smartsystem();
@@ -122,7 +183,7 @@ async function healthCheck() {
const load = await mySystem.information.currentLoad();
const mem = await mySystem.information.mem();
const disk = await mySystem.information.fsSize();
return {
status: 'healthy',
metrics: {
@@ -137,31 +198,30 @@ async function healthCheck() {
}
```
### Network Traffic Analysis
### Network Traffic Monitoring
Monitor network activity for debugging or performance optimization:
Track bandwidth in real time:
```typescript
const mySystem = new Smartsystem();
async function monitorNetwork() {
const defaultInterface = await mySystem.information.networkInterfaceDefault();
const baseline = await mySystem.information.networkStats(defaultInterface);
// Check again after 1 second
await mySystem.information.networkStats(defaultInterface); // baseline
await new Promise(resolve => setTimeout(resolve, 1000));
const current = await mySystem.information.networkStats(defaultInterface);
const rxSpeed = (current[0].rx_sec / 1024 / 1024).toFixed(2);
const txSpeed = (current[0].tx_sec / 1024 / 1024).toFixed(2);
console.log(`📥 Download: ${rxSpeed} MB/s | 📤 Upload: ${txSpeed} MB/s`);
}
```
### Smart Resource Scaling
Make intelligent decisions based on system resources:
Dynamically scale workers based on available resources:
```typescript
const mySystem = new Smartsystem();
@@ -170,47 +230,41 @@ async function getOptimalWorkerCount() {
const cpuCount = mySystem.cpus.length;
const load = await mySystem.information.currentLoad();
const mem = await mySystem.information.mem();
// Scale workers based on available resources
const memoryConstraint = Math.floor(mem.available / (512 * 1024 * 1024)); // 512MB per worker
const cpuConstraint = Math.max(1, Math.floor(cpuCount * (1 - load.currentLoad / 100)));
return Math.min(memoryConstraint, cpuConstraint, cpuCount);
}
```
## 🔧 Advanced Features
### 🐳 Docker & Container Awareness
### Cross-Platform Compatibility
`@push.rocks/smartsystem` works seamlessly across different operating systems:
Inspect Docker state from within your app:
```typescript
const mySystem = new Smartsystem();
const osInfo = await mySystem.information.osInfo();
const platform = osInfo.platform; // 'linux', 'darwin', 'win32', etc.
const dockerInfo = await mySystem.information.dockerInfo();
console.log(`Docker containers: ${dockerInfo.containers} (${dockerInfo.containersRunning} running)`);
// Platform-specific logic
if (platform === 'linux') {
// Linux-specific operations
} else if (platform === 'darwin') {
// macOS-specific operations
} else if (platform === 'win32') {
// Windows-specific operations
}
const containers = await mySystem.information.dockerContainers();
containers.forEach(c => console.log(` ${c.name}: ${c.state}`));
```
### Docker & Container Detection
### Cross-Platform Logic
Detect if your application is running in a containerized environment:
Write platform-aware code cleanly:
```typescript
const mySystem = new Smartsystem();
const virt = await mySystem.information.dockerInfo();
if (virt.dockerContainers && virt.dockerContainers.length > 0) {
console.log('🐳 Running in Docker');
if (await mySystem.env.isLinuxAsync()) {
// Linux-specific setup
} else if (await mySystem.env.isMacAsync()) {
// macOS-specific setup
} else if (await mySystem.env.isWindowsAsync()) {
// Windows-specific setup
}
```
@@ -235,19 +289,21 @@ For complete API documentation, visit: [https://code.foss.global/push.rocks/smar
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
Registered at District Court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
For any legal inquiries or further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartsystem',
version: '3.0.7',
version: '3.0.8',
description: 'A TypeScript library for interacting with the system it is running on, including environment, network, and hardware information.'
}