fix(package): modernize package configuration and stabilize ping typings and tests

This commit is contained in:
2026-05-01 21:44:49 +00:00
parent 2632bf2082
commit 1477ceda5d
12 changed files with 7001 additions and 17554 deletions
+37
View File
@@ -0,0 +1,37 @@
{
"@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
},
"@git.zone/cli": {
"projectType": "npm",
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartping",
"shortDescription": "Node.js ping utility",
"description": "A utility for performing ping operations in Node.js environments.",
"npmPackagename": "@push.rocks/smartping",
"license": "MIT",
"keywords": [
"ping",
"network",
"connectivity",
"Node.js",
"utility",
"async",
"promise"
]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
},
"@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"
}
}
+34
View File
@@ -0,0 +1,34 @@
# Changelog
## 2026-05-01 - 1.0.9 - fix(package)
modernize package configuration and stabilize ping typings and tests
- add package exports and include project metadata files in published package
- update build and test tooling to current @git.zone packages and newer ping dependency
- replace external host-based tests with localhost node tests for more reliable execution
- derive ping response type from the ping library and simplify pingAlive error handling
## 2026-03-01 - 1.0.8 - maintenance
Project maintenance and repository metadata updates across the 1.0.8 line.
- Removed the `.gitlab-ci.yml` configuration
- Updated package metadata and repository hosting configuration
- Refreshed TypeScript configuration and project description
- Consolidates trivial maintenance changes from 2023-07-10 through 2026-03-01
## 2023-04-19 - 1.0.8 - core
Core update release.
- Applied a core update
## 2022-10-21 - 1.0.7 - core
Patch release continuing a series of core fixes.
- Applied a core update
- Summarizes repeated trivial patch releases across 1.0.4 to 1.0.7
## 2018-11-18 - 1.0.1 - core
Initial recorded core patch release.
- Applied a core update
- Includes the initial version tagging activity through 1.0.2
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2022 Lossless GmbH (hello@lossless.com) Copyright (c) 2026 Task Venture Capital GmbH <hello@task.vc>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
+14 -6
View File
@@ -1,10 +1,15 @@
{ {
"gitzone": { "@ship.zone/szci": {
"npmGlobalTools": [],
"npmRegistryUrl": "registry.npmjs.org"
},
"@git.zone/cli": {
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "code.foss.global", "githost": "code.foss.global",
"gitscope": "push.rocks", "gitscope": "push.rocks",
"gitrepo": "smartping", "gitrepo": "smartping",
"shortDescription": "Node.js ping utility",
"description": "A utility for performing ping operations in Node.js environments.", "description": "A utility for performing ping operations in Node.js environments.",
"npmPackagename": "@push.rocks/smartping", "npmPackagename": "@push.rocks/smartping",
"license": "MIT", "license": "MIT",
@@ -18,13 +23,16 @@
"async", "async",
"promise" "promise"
] ]
},
"release": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
} }
}, },
"npmci": { "@git.zone/tsdoc": {
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"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" "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"
} }
} }
-13432
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -3,28 +3,26 @@
"version": "1.0.8", "version": "1.0.8",
"private": false, "private": false,
"description": "A utility for performing ping operations in Node.js environments.", "description": "A utility for performing ping operations in Node.js environments.",
"exports": {
".": "./dist_ts/index.js"
},
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist_ts/index.d.ts",
"type": "module", "type": "module",
"author": "Lossless GmbH", "author": "Task Venture Capital GmbH <hello@task.vc>",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "tstest test/",
"build": "(tsbuild --web --allowimplicitany)", "build": "tsbuild",
"buildDocs": "(tsdoc)" "buildDocs": "tsdoc"
}, },
"dependencies": { "dependencies": {
"@types/ping": "^0.4.1", "ping": "^1.0.0"
"ping": "^0.4.4"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@git.zone/tsbuild": "^4.4.0",
"@gitzone/tsbundle": "^2.0.5", "@git.zone/tstest": "^3.6.3",
"@gitzone/tsdoc": "^1.1.10", "@types/node": "^25.6.0"
"@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.74",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^18.15.11"
}, },
"browserslist": [ "browserslist": [
"last 1 chrome versions" "last 1 chrome versions"
@@ -38,6 +36,8 @@
"dist_ts_web/**/*", "dist_ts_web/**/*",
"assets/**/*", "assets/**/*",
"cli.js", "cli.js",
".smartconfig.json",
"license",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
], ],
+6886 -4087
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1,4 +1,4 @@
import { expect, expectAsync, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as smartping from '../ts/index.js'; import * as smartping from '../ts/index.js';
let testPing: smartping.Smartping; let testPing: smartping.Smartping;
@@ -9,12 +9,12 @@ tap.test('should create an instance of Smartping', async () => {
}); });
tap.test('should deliver a ping result', async () => { tap.test('should deliver a ping result', async () => {
const result = await testPing.ping('lossless.com', 1000); const result = await testPing.ping('127.0.0.1', 1);
console.log(result); expect(result.alive).toBeTrue();
}) });
tap.test('should detect alive', async () => { tap.test('should detect alive', async () => {
await expectAsync(testPing.pingAlive('lossless.com', 1000)).toBeTrue(); expect(await testPing.pingAlive('127.0.0.1', 1)).toBeTrue();
}) });
tap.start(); export default tap.start();
+4 -4
View File
@@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @push.rocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartping', name: '@push.rocks/smartping',
version: '1.0.8', version: '1.0.9',
description: 'a ping utility' description: 'A utility for performing ping operations in Node.js environments.'
} }
+8 -9
View File
@@ -1,21 +1,20 @@
import * as plugins from './smartping.plugins.js'; import * as plugins from './smartping.plugins.js';
export type TPingResponse = Awaited<ReturnType<typeof plugins.ping.promise.probe>>;
export class Smartping { export class Smartping {
public async ping(hostArg: string, timeoutArg: number = 500): Promise<plugins.ping.PingResponse> { public async ping(hostArg: string, timeoutArg: number = 500): Promise<TPingResponse> {
const result = await plugins.ping.promise.probe(hostArg, { const result = await plugins.ping.promise.probe(hostArg, {
timeout: timeoutArg timeout: timeoutArg
}) });
return result; return result;
} }
public async pingAlive(hostArg: string, timeoutArg: number = 500): Promise<boolean> { public async pingAlive(hostArg: string, timeoutArg: number = 500): Promise<boolean> {
const result = await plugins.ping.promise.probe(hostArg, { try {
timeout: timeoutArg const result = await this.ping(hostArg, timeoutArg);
}).catch(); return result.alive;
//console.log(result); } catch {
if (result.alive) {
return true;
} else {
return false; return false;
} }
} }
+1 -1
View File
@@ -2,4 +2,4 @@ import ping from 'ping';
export { export {
ping ping
} };
+3 -1
View File
@@ -5,8 +5,10 @@
"target": "ES2022", "target": "ES2022",
"module": "NodeNext", "module": "NodeNext",
"moduleResolution": "NodeNext", "moduleResolution": "NodeNext",
"noImplicitAny": true,
"esModuleInterop": true, "esModuleInterop": true,
"verbatimModuleSyntax": true "verbatimModuleSyntax": true,
"types": ["node"]
}, },
"exclude": [ "exclude": [
"dist_*/**/*.d.ts" "dist_*/**/*.d.ts"