fix(core): update

This commit is contained in:
Philipp Kunz 2023-07-21 03:53:41 +02:00
parent 9cfc41ace8
commit c8556355c0
19 changed files with 1446 additions and 1059 deletions

View File

@ -0,0 +1,66 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -0,0 +1,124 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @gitzone/tsdoc
npmci command tsdoc
continue-on-error: true

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:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ====================
# security stage
# ====================
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags:
- lossless
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci node install stable
- npmci npm install
- npmci npm 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 install
- npmci command npm run buildDocs
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -3,10 +3,10 @@
"projectType": "npm", "projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "push.rocks",
"gitrepo": "smartsocket", "gitrepo": "smartsocket",
"description": "easy and secure websocket communication", "description": "easy and secure websocket communication",
"npmPackagename": "@pushrocks/smartsocket", "npmPackagename": "@push.rocks/smartsocket",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks"
} }

View File

@ -1,5 +1,5 @@
{ {
"name": "@pushrocks/smartsocket", "name": "@push.rocks/smartsocket",
"version": "2.0.19", "version": "2.0.19",
"description": "easy and secure websocket communication", "description": "easy and secure websocket communication",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -22,28 +22,28 @@
"homepage": "https://gitlab.com/pushrocks/smartsocket#README", "homepage": "https://gitlab.com/pushrocks/smartsocket#README",
"dependencies": { "dependencies": {
"@apiglobal/typedrequest-interfaces": "^2.0.1", "@apiglobal/typedrequest-interfaces": "^2.0.1",
"@pushrocks/isohash": "^2.0.0", "@apiglobal/typedserver": "^2.0.65",
"@pushrocks/isounique": "^1.0.5", "@push.rocks/isohash": "^2.0.0",
"@pushrocks/lik": "^6.0.2", "@push.rocks/isounique": "^1.0.5",
"@pushrocks/smartdelay": "^2.0.13", "@push.rocks/lik": "^6.0.3",
"@pushrocks/smartenv": "^5.0.5", "@push.rocks/smartdelay": "^3.0.5",
"@pushrocks/smartexpress": "^4.0.34", "@push.rocks/smartenv": "^5.0.5",
"@pushrocks/smartjson": "^5.0.1", "@push.rocks/smartjson": "^5.0.1",
"@pushrocks/smartlog": "^3.0.1", "@push.rocks/smartlog": "^3.0.3",
"@pushrocks/smartpromise": "^3.1.7", "@push.rocks/smartpromise": "^4.0.3",
"@pushrocks/smartrx": "^3.0.0", "@push.rocks/smartrx": "^3.0.3",
"@pushrocks/smarttime": "^4.0.1", "@push.rocks/smarttime": "^4.0.1",
"engine.io": "6.3.1", "engine.io": "6.3.1",
"socket.io": "4.5.4", "socket.io": "4.5.4",
"socket.io-client": "4.5.4" "socket.io-client": "4.5.4"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.63", "@gitzone/tsbuild": "^2.1.66",
"@gitzone/tsbundle": "^2.0.7", "@gitzone/tsbundle": "^2.0.8",
"@gitzone/tsrun": "^1.2.37", "@gitzone/tsrun": "^1.2.44",
"@gitzone/tstest": "^1.0.72", "@gitzone/tstest": "^1.0.77",
"@pushrocks/tapbundle": "^5.0.4", "@push.rocks/tapbundle": "^5.0.12",
"@types/node": "^18.15.11" "@types/node": "^20.4.2"
}, },
"private": false, "private": false,
"files": [ "files": [

2056
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +1,26 @@
# @pushrocks/smartsocket # @push.rocks/smartsocket
easy and secure websocket communication easy and secure websocket communication
## Availabililty and Links ## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartsocket) * [npmjs.org (npm package)](https://www.npmjs.com/package/@push.rocks/smartsocket)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartsocket) * [gitlab.com (source)](https://gitlab.com/push.rocks/smartsocket)
* [github.com (source mirror)](https://github.com/pushrocks/smartsocket) * [github.com (source mirror)](https://github.com/push.rocks/smartsocket)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartsocket/) * [docs (typedoc)](https://push.rocks.gitlab.io/smartsocket/)
## Status for master ## Status for master
Status Category | Status Badge Status Category | Status Badge
-- | -- -- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartsocket/badges/master/pipeline.svg)](https://lossless.cloud) GitLab Pipelines | [![pipeline status](https://gitlab.com/push.rocks/smartsocket/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartsocket/badges/master/coverage.svg)](https://lossless.cloud) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/push.rocks/smartsocket/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartsocket)](https://lossless.cloud) npm | [![npm downloads per month](https://badgen.net/npm/dy/@push.rocks/smartsocket)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartsocket)](https://lossless.cloud) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/push.rocks/smartsocket)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartsocket)](https://lossless.cloud) PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@push.rocks/smartsocket)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartsocket)](https://lossless.cloud) PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@push.rocks/smartsocket)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartsocket)](https://lossless.cloud) BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@push.rocks/smartsocket)](https://lossless.cloud)
## Usage ## Usage

View File

@ -1,15 +1,15 @@
// tslint:disable-next-line:no-implicit-dependencies // tslint:disable-next-line:no-implicit-dependencies
import { expect, expectAsync, tap } from '@pushrocks/tapbundle'; import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as isohash from '@pushrocks/isohash'; import * as isohash from '@push.rocks/isohash';
import * as smartexpress from '@pushrocks/smartexpress'; import * as smartexpress from '@apiglobal/typedserver';
import * as smartsocket from '../ts/index.js'; import * as smartsocket from '../ts/index.js';
let testSmartsocket: smartsocket.Smartsocket; let testSmartsocket: smartsocket.Smartsocket;
let testSmartsocketClient: smartsocket.SmartsocketClient; let testSmartsocketClient: smartsocket.SmartsocketClient;
let testSocketFunction1: smartsocket.SocketFunction<any>; let testSocketFunction1: smartsocket.SocketFunction<any>;
let myseServer: smartexpress.Server; let myseServer: smartexpress.servertools.Server;
const testConfig = { const testConfig = {
port: 3000, port: 3000,
@ -22,7 +22,7 @@ tap.test('should create a new smartsocket', async () => {
}); });
tap.test('Should accept an smartExpressServer as server', async () => { tap.test('Should accept an smartExpressServer as server', async () => {
myseServer = new smartexpress.Server({ myseServer = new smartexpress.servertools.Server({
cors: true, cors: true,
forceSsl: false, forceSsl: false,
port: testConfig.port, port: testConfig.port,

View File

@ -1,5 +1,5 @@
// tslint:disable-next-line:no-implicit-dependencies // tslint:disable-next-line:no-implicit-dependencies
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@push.rocks/tapbundle';
import * as smartsocket from '../ts/index.js'; import * as smartsocket from '../ts/index.js';

View File

@ -1,5 +1,5 @@
// tslint:disable-next-line:no-implicit-dependencies // tslint:disable-next-line:no-implicit-dependencies
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@push.rocks/tapbundle';
import * as smartsocket from '../ts/index.js'; import * as smartsocket from '../ts/index.js';

View File

@ -2,7 +2,7 @@
* autocreated commitinfo by @pushrocks/commitinfo * autocreated commitinfo by @pushrocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@pushrocks/smartsocket', name: '@push.rocks/smartsocket',
version: '2.0.19', version: '2.0.20',
description: 'easy and secure websocket communication' description: 'easy and secure websocket communication'
} }

View File

@ -5,9 +5,9 @@ import * as interfaces from './interfaces/index.js';
// classes // classes
import { SocketConnection } from './smartsocket.classes.socketconnection.js'; import { SocketConnection } from './smartsocket.classes.socketconnection.js';
import { import {
ISocketFunctionCallDataRequest, type ISocketFunctionCallDataRequest,
SocketFunction, SocketFunction,
ISocketFunctionCallDataResponse, type ISocketFunctionCallDataResponse,
} from './smartsocket.classes.socketfunction.js'; } from './smartsocket.classes.socketfunction.js';
import { SocketRequest } from './smartsocket.classes.socketrequest.js'; import { SocketRequest } from './smartsocket.classes.socketrequest.js';
import { SocketServer } from './smartsocket.classes.socketserver.js'; import { SocketServer } from './smartsocket.classes.socketserver.js';
@ -54,7 +54,7 @@ export class Smartsocket {
allowedHeaders: '*', allowedHeaders: '*',
methods: '*', methods: '*',
origin: '*', origin: '*',
} },
}); });
await this.socketServer.start(); await this.socketServer.start();
this.io.on('connection', (socketArg) => { this.io.on('connection', (socketArg) => {

View File

@ -4,10 +4,10 @@ import * as interfaces from './interfaces/index.js';
import { SocketConnection } from './smartsocket.classes.socketconnection.js'; import { SocketConnection } from './smartsocket.classes.socketconnection.js';
import { import {
ISocketFunctionCallDataRequest, type ISocketFunctionCallDataRequest,
SocketFunction, SocketFunction,
} from './smartsocket.classes.socketfunction.js'; } from './smartsocket.classes.socketfunction.js';
import { ISocketRequestDataObject, SocketRequest } from './smartsocket.classes.socketrequest.js'; import { type ISocketRequestDataObject, SocketRequest } from './smartsocket.classes.socketrequest.js';
import { logger } from './smartsocket.logging.js'; import { logger } from './smartsocket.logging.js';
/** /**

View File

@ -5,7 +5,7 @@ import * as interfaces from './interfaces/index.js';
// import classes // import classes
import { Smartsocket } from './smartsocket.classes.smartsocket.js'; import { Smartsocket } from './smartsocket.classes.smartsocket.js';
import { SocketFunction } from './smartsocket.classes.socketfunction.js'; import { SocketFunction } from './smartsocket.classes.socketfunction.js';
import { SocketRequest, ISocketRequestDataObject } from './smartsocket.classes.socketrequest.js'; import { SocketRequest, type ISocketRequestDataObject } from './smartsocket.classes.socketrequest.js';
// socket.io // socket.io
import { SmartsocketClient } from './smartsocket.classes.smartsocketclient.js'; import { SmartsocketClient } from './smartsocket.classes.smartsocketclient.js';

View File

@ -3,8 +3,8 @@ import * as plugins from './smartsocket.plugins.js';
// import interfaces // import interfaces
import { import {
SocketFunction, SocketFunction,
ISocketFunctionCallDataRequest, type ISocketFunctionCallDataRequest,
ISocketFunctionCallDataResponse, type ISocketFunctionCallDataResponse,
} from './smartsocket.classes.socketfunction.js'; } from './smartsocket.classes.socketfunction.js';
// import classes // import classes

View File

@ -29,7 +29,7 @@ export class SocketServer {
*/ */
public async setExternalServer( public async setExternalServer(
serverType: 'smartexpress', serverType: 'smartexpress',
serverArg: pluginsTyped.smartexpress.Server serverArg: pluginsTyped.typedserver.servertools.Server
) { ) {
this.httpServerDeferred = plugins.smartpromise.defer(); this.httpServerDeferred = plugins.smartpromise.defer();
await serverArg.startedPromise; await serverArg.startedPromise;

View File

@ -4,16 +4,16 @@ import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
export { typedrequestInterfaces }; export { typedrequestInterfaces };
// pushrocks scope // pushrocks scope
import * as isohash from '@pushrocks/isohash'; import * as isohash from '@push.rocks/isohash';
import * as isounique from '@pushrocks/isounique'; import * as isounique from '@push.rocks/isounique';
import * as lik from '@pushrocks/lik'; import * as lik from '@push.rocks/lik';
import * as smartenv from '@pushrocks/smartenv'; import * as smartenv from '@push.rocks/smartenv';
import * as smartjson from '@pushrocks/smartjson'; import * as smartjson from '@push.rocks/smartjson';
import * as smartlog from '@pushrocks/smartlog'; import * as smartlog from '@push.rocks/smartlog';
import * as smartdelay from '@pushrocks/smartdelay'; import * as smartdelay from '@push.rocks/smartdelay';
import * as smartpromise from '@pushrocks/smartpromise'; import * as smartpromise from '@push.rocks/smartpromise';
import * as smarttime from '@pushrocks/smarttime'; import * as smarttime from '@push.rocks/smarttime';
import * as smartrx from '@pushrocks/smartrx'; import * as smartrx from '@push.rocks/smartrx';
export { export {
isohash, isohash,

View File

@ -2,12 +2,12 @@
import type * as http from 'http'; import type * as http from 'http';
import type * as https from 'https'; import type * as https from 'https';
export { http, https }; export type { http, https };
// pushrocks scope // pushrocks scope
import type * as smartexpress from '@pushrocks/smartexpress'; import type * as typedserver from '@apiglobal/typedserver';
export { smartexpress }; export type { typedserver };
// third party scope // third party scope
import type { Socket as ServerSocket, Server as ServerServer } from 'socket.io'; import type { Socket as ServerSocket, Server as ServerServer } from 'socket.io';

View File

@ -5,6 +5,7 @@
"target": "ES2022", "target": "ES2022",
"module": "ES2022", "module": "ES2022",
"moduleResolution": "nodenext", "moduleResolution": "nodenext",
"esModuleInterop": true "esModuleInterop": true,
"verbatimModuleSyntax": true,
} }
} }