Skip to content

Commit

Permalink
Merge pull request #1 from iggy-rs/migrate-repo
Browse files Browse the repository at this point in the history
Migrate repo
  • Loading branch information
spetz authored Nov 22, 2024
2 parents c86b832 + 8712b0f commit c477f65
Show file tree
Hide file tree
Showing 127 changed files with 13,741 additions and 121 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"scope-case": [2, "always", ["lower-case", "upper-case", "camel-case"]]
}
}
48 changes: 48 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# Non-build assets
*/cypress/
*/docs/
*/mocks/
*.md

# NPM
node_modules
.npm/

# scratch
*~

commitlint.config.js
.releaserc.json
.dockerignore

*.log

# Jest
coverage/
__snapshots__/

# Istanbul
.nyc_output/

# SonarQube
.scannerwork/

# Git
.git/
.gitignore

# Docker & CI
Dockerfile
.gitlab-ci.yml

# Other tooling config
.mockyeah.json
.prettierignore
.prettierrc
cypress.json

.env*

# Tests results for CI output file
junit.xml
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"ignorePatterns": ["dist/*", "./*.js"],
"root": true,
"env": {"node": true},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
}
}
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

name: build
on: [push]

jobs:

install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'

- uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- run: npm ci
# - run: npm run lint
- run: npm run build
- run: npm run test

semantic-release:
needs: install
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- run: npm ci
- run: npm run build
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.SR_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/cache@v4
with:
path: |
VERSION.txt
package.json
package-lock.json
CHANGELOG.md
key: ${{ runner.os }}-sr-version-${{ github.sha }}
136 changes: 17 additions & 119 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Optional stylelint cache
.stylelintcache
# dependencies
node_modules

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# scratch
*~

# Optional REPL history
.node_repl_history
# misc
.DS_Store
*.pem

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# dotenv environment variable files
.env
# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
# artefacts
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
.npm
46 changes: 46 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"branches": [ "main" ],
"plugins": [
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "refactor", "release": "patch" },
{ "type": "chore", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "build", "release": "patch" }
]
},
[
"@semantic-release/npm",
{
"npmPublish": true,
"tarballDir": "dist"
}
],
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "echo ${nextRelease.version} > VERSION.txt"
}
],
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json",
"package-lock.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
51 changes: 49 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,49 @@
# iggy-node-client
Official Node (TypeScript) client SDK for Iggy.rs message streaming.
# iggy node.js client

iggy node.js client for [iggy-rs](https://iggy.rs/)'s binary protocol, written in typescript. it currently only support tcp & tls transports.

diclaimer: although all iggy commands & basic client/stream are implemented this is still a WIP, provided as is, and has still a long way to go to be considered "battle tested".

note: previous works on node.js http client has been moved to [iggy-node-http-client](<https://github.com/iggy-rs/iggy-node-http-client) (moved on 04 July 2024)


## install
```
$ npm i iggy-bin
```

## basic usage

```ts
import { Client } from 'iggy-bin';

const credentials = { username: 'iggy', password: 'iggy' };

const c = new Client({
transport: 'TCP',
options: { port: 8090, host: '127.0.0.1' },
credentials
});

const stats = await c.system.getStats();
```


## use sources

### Install
```
$ npm ci
```

### build

```
$ npm run build
```

### test

```
$ npm run test
```
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.9'

services:

iggy-server:
image: iggyrs/iggy:latest
container_name: iggy-server
restart: unless-stopped
networks:
- iggy
ports:
- 3000:3000
- 8080:8080
- 8090:8090
volumes:
- iggy-server:/local_data

volumes:
iggy-server:
driver: local

networks:
iggy:
name: iggy-network
Loading

0 comments on commit c477f65

Please sign in to comment.