Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SYS-197 sync up with other changes and add unit tests #5

Merged
merged 2 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"plugin:security/recommended",
"prettier"
],
"ignorePatterns": ["index.ts", "types.ts", "src/util/*.ts", "test/*"],
"ignorePatterns": ["index.ts", "src/util/*.ts", "test/*"],
"rules": {
"no-empty": [
1,
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Node CI Workflow

on:
push:
branches:
- dev
pull_request:
branches:
- dev
workflow_dispatch:
inputs:
workflowBranch:
description: 'Select the branch to run the workflow on'
required: true
default: 'main'
type: choice
options:
- dev
- main
jobs:
ci-dev:
if: ${{ github.event.inputs.workflowBranch == 'dev' }}
uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@dev

ci-main:
if: ${{ github.event.inputs.workflowBranch == 'main' || !github.event.inputs.workflowBranch }}
uses: shardeum/github-automation/.github/workflows/node-ci-shared.yml@main
66 changes: 0 additions & 66 deletions .gitlab-ci.yml

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
"release": "np --no-cleanup --no-yarn --any-branch",
"prepack": "npm run build-node",
"postinstall": "npm run build-rust",
"test": "cargo test",
"test": "npm run test:cargo",
"test2": "ts-node test/test_lru.ts -p 44001 -c 2",
"test:cargo": "cargo test",
"build:rust": "cargo build --workspace && npm run postbuild-cargo",
"postbuild-cargo": "node scripts/copy-rename.js",
"lint": "eslint ./src/**/*.ts --quiet",
"lint-windows": "eslint ./src/**/*.ts --quiet",
"format-check": "prettier --check './src/**/*.ts'",
"lint": "eslint \"./src/**/*.ts\"",
"format-check": "prettier --check \"./src/**/*.ts\"",
"clean": "cargo clean"
},
"repository": {
"type": "git",
"url": "https://gitlab.com/Shardus/shardus-net.git"
"url": "https://github.com/shardeum/lib-net.git"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const Sn = (opts: SnOpts) => {
sendCallback
)
}
} else{
} else {
/* prettier-ignore */ if(logFlags.net_verbose) console.log('sending without header')
_net.send(port, address, stringifiedData, sendCallback)
}
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export type SnOpts = {
* @param opts - The options object to validate.
* @throws An error if the options object is not valid.
*/
export const validateSnOpts = (opts: SnOpts) => {
export const validateSnOpts = (opts: SnOpts): void => {
if (!opts) throw new Error('snq: must supply options')

if (!opts.port || typeof opts.port !== 'number') throw new Error('snq: must supply port')
Expand Down
Loading