fix(smartsystem): Normalize package scopes, update dev dependencies and tooling, add pnpm workspace and packageManager, remove GitLab CI, and update imports/docs/tests

This commit is contained in:
2025-08-29 12:33:51 +00:00
parent f87fa3bf2b
commit 3eac579317
10 changed files with 9219 additions and 804 deletions

View File

@@ -1,128 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
before_script:
- npm install -g @shipzone/npmci
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g typescript
- npmci npm prepare
- npmci npm install
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install stable
- npmci npm prepare
- npmci npm install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

46
changelog.md Normal file
View File

@@ -0,0 +1,46 @@
# Changelog
## 2025-08-29 - 3.0.2 - fix(smartsystem)
Normalize package scopes, update dev dependencies and tooling, add pnpm workspace and packageManager, remove GitLab CI, and update imports/docs/tests
- Normalize package scope names from @pushrocks/* to @push.rocks/* across source, commit info and README
- Update dependency versions: bump @push.rocks/smartpromise to ^4.0.2 and ensure other @push.rocks packages use caret ranges
- Switch dev tooling namespaces to @git.zone (tsbuild/tsrun/tstest) and add @git.zone/tsrun
- Enhance npm scripts: make test run with verbose, logfile and increased timeout
- Add packageManager field (pnpm@10.14.0+sha512...) to package.json and add pnpm-workspace.yaml with onlyBuiltDependencies: [esbuild]
- Remove legacy .gitlab-ci.yml CI configuration
- Update imports in ts and test files to match new package namespaces
## 2024-05-29 - 3.0.1 - chore
Update of package metadata and TypeScript configuration.
- update description
- update tsconfig (adjustments to TypeScript config)
- update npmextra.json: githost (fixes to githost entries)
## 2022-07-28 - 3.0.0 - fix(core)
Minor core fixes and release of 3.0.0.
- fix(core): update
## 2022-07-28 - 2.0.10 - BREAKING (core)
Breaking change: module format switched to ESM.
- BREAKING CHANGE(core): switch to esm
- misc maintenance and fixes leading up to this release
## 2017-07-31 - 2.0.1..2.0.9 - maintenance
Series of patch releases with small fixes and upkeep across the 2.0.x line.
- Multiple patch releases (2.0.1 → 2.0.9) containing repeated core fixes
- Updates to README and repository metadata
- update yarn lock (notably in 2.0.1)
## 2017-07-31 - 1.0.0..1.0.18 - initial development & improvements
Initial development, feature additions and documentation improvements across 1.0.x.
- initial releases and basic module structure; first working version
- add npm as default module loader (1.0.6)
- improve path resolution and add keywords (1.0.41.0.5)
- add docs, improve README and tests across multiple 1.0.x releases
- CI updates and general streamlining of the project

1308
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@
"typings": "dist_ts/index.d.ts",
"type": "module",
"scripts": {
"test": "(tstest test/)",
"test": "(tstest test/ --verbose --logfile --timeout 60)",
"build": "(tsbuild --web --allowimplicitany)",
"buildDocs": "tsdoc"
},
@@ -32,16 +32,16 @@
},
"homepage": "https://code.foss.global/push.rocks/smartsystem",
"dependencies": {
"@pushrocks/lik": "^6.0.0",
"@pushrocks/smartenv": "^5.0.2",
"@pushrocks/smartnetwork": "^3.0.0",
"@pushrocks/smartpromise": "^3.1.7",
"@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"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.63",
"@gitzone/tstest": "^1.0.72",
"@pushrocks/tapbundle": "^5.0.4",
"@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"
},
@@ -60,5 +60,6 @@
],
"browserslist": [
"last 1 chrome versions"
]
],
"packageManager": "pnpm@10.14.0+sha512.ad27a79641b49c3e481a16a805baa71817a04bbe06a38d17e60e2eaee83f6a146c6a688125f5792e48dd5ba30e7da52a5cda4c3992b9ccf333f9ce223af84748"
}

8474
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,2 @@
onlyBuiltDependencies:
- esbuild

View File

@@ -1,5 +1,14 @@
# @push.rocks/smartsystem
interact with the system you are running on
Interact with the system your Node.js app runs on.
## Features
- Simple class: expose system info through a single `Smartsystem` instance
- Env access: read and manage env vars via `@push.rocks/smartenv`
- CPU info: get `os.cpus()` without importing `os`
- Network utilities: high-level helpers from `@push.rocks/smartnetwork`
- Deep stats: tap into `systeminformation` for OS, hardware, and load data
- TypeScript-first: typed API, works great from TS and JS
## Install
@@ -31,9 +40,20 @@ To use the functionalities provided by `@push.rocks/smartsystem`, you need to cr
const mySystem = new Smartsystem();
```
## API Overview
- `Smartsystem.env`: instance of `Smartenv` from `@push.rocks/smartenv`
Useful for reading and validating environment variables.
- `Smartsystem.cpus`: result of `os.cpus()`
Array of CPU core descriptions from Nodes builtin `os` module.
- `Smartsystem.network`: instance of `SmartNetwork` from `@push.rocks/smartnetwork`
Inspect interfaces, addresses, and network details.
- `Smartsystem.information`: re-export of `systeminformation`
Call any method, e.g. `osInfo()`, `system()`, `currentLoad()`, `networkStats()`.
### Accessing Environment Variables
`@push.rocks/smartsystem` integrates with `@pushrocks/smartenv` to provide an easy way to handle environment variables.
`@push.rocks/smartsystem` integrates with `@push.rocks/smartenv` to provide an easy way to handle environment variables.
```typescript
console.log(mySystem.env.getEnvVars());
@@ -49,7 +69,7 @@ console.log(mySystem.cpus[0]); // Logs details about the first CPU
### Working with Network Interfaces
The module allows you to work with network interfaces, making use of `@pushrocks/smartnetwork`:
The module allows you to work with network interfaces, making use of `@push.rocks/smartnetwork`:
```typescript
(async () => {

View File

@@ -1,4 +1,4 @@
import { tap, expect } from '@pushrocks/tapbundle';
import { tap, expect } from '@git.zone/tstest/tapbundle';
import * as smartsystem from '../ts/index.js';
import { systeminformation } from '../ts/smartsystem.plugins.js';

View File

@@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartsystem',
version: '3.0.1',
description: 'interact with the system you are running on'
name: '@push.rocks/smartsystem',
version: '3.0.2',
description: 'A TypeScript library for interacting with the system it's running on, including environment, network, and hardware information.'
}

View File

@@ -3,10 +3,10 @@ import os from 'os';
export { os };
import * as lik from '@pushrocks/lik';
import * as smartenv from '@pushrocks/smartenv';
import * as smartnetwork from '@pushrocks/smartnetwork';
import * as smartpromise from '@pushrocks/smartpromise';
import * as lik from '@push.rocks/lik';
import * as smartenv from '@push.rocks/smartenv';
import * as smartnetwork from '@push.rocks/smartnetwork';
import * as smartpromise from '@push.rocks/smartpromise';
export { lik, smartenv, smartnetwork, smartpromise };