Skip to content

Commit 32c698e

Browse files
committed
Release v0.7.0: Brotli Compression and Protocol v4
1 parent 71c4680 commit 32c698e

20 files changed

Lines changed: 1345 additions & 780 deletions

File tree

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: pnpm/action-setup@v2
17+
with:
18+
version: 8
19+
20+
- name: Use Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
cache: 'pnpm'
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Generate Protocol
30+
run: pnpm --filter @entgldb/protocol run generate
31+
32+
- name: Build
33+
run: pnpm -r build
34+
35+
- name: Test
36+
run: pnpm -r test

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v2
19+
with:
20+
version: 8
21+
22+
- name: Use Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
- name: Install dependencies
29+
run: pnpm install
30+
31+
- name: Generate Protocol
32+
run: pnpm --filter @entgldb/protocol run generate
33+
34+
- name: Build
35+
run: pnpm -r build
36+
37+
- name: Publish
38+
run: pnpm publish -r --no-git-checks --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ See [walkthrough.md](file:///C:/Users/FABLUA/.gemini/antigravity/brain/95865bf1-
9191
-**Hybrid Logical Clocks (HLC)** for distributed ordering
9292
-**Last-Write-Wins (LWW)** conflict resolution
9393
-**SQLite** persistence with WAL mode
94-
-**P2P Sync** via TCP with Protocol Buffers
94+
-**P2P Sync** via TCP with Protocol Buffers (v4)
95+
-**Brotli Compression** for efficient bandwidth usage
9596
-**Multi-platform**: Node.js, Electron, React Native
9697
-**Type-safe** TypeScript API
9798

@@ -112,7 +113,8 @@ EntglDb.NodeJs/
112113

113114
## 🔗 Protocol Compatibility
114115

115-
Compatible with EntglDb.NET v0.4.0 - Can sync with .NET nodes!
116+
Compatible with EntglDb.NET v0.7.0, EntglDb.Kotlin v0.7.0
117+
Features: Brotli compression, Secure Handshake.
116118

117119
## 📄 License
118120

docs/_config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title: "EntglDb Node.js Documentation"
2+
description: A decentralized, offline-first peer-to-peer database for Node.js, Electron, and React Native.
3+
theme: jekyll-theme-cayman
4+
plugins:
5+
- jekyll-seo-tag

docs/_data/navigation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
v0.7.0:
2+
- title: Getting Started
3+
url: /v0.7.0/getting-started.html

docs/_includes/nav.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<nav class="site-nav">
2+
<a href="{{ '/' | relative_url }}">Home</a>
3+
<a href="{{ '/v0.7.0/getting-started.html' | relative_url }}">Docs (Latest)</a>
4+
<a href="https://github.com/EntglDb/EntglDb.NodeJs" target="_blank">GitHub</a>
5+
</nav>

docs/_layouts/default.html

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ site.lang | default: " en-US" }}">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="description" content="{{ site.description }}">
8+
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
9+
<title>{{ site.title }}</title>
10+
<style>
11+
/* Navbar */
12+
.site-nav {
13+
background: #159957;
14+
padding: 10px;
15+
text-align: center;
16+
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
17+
}
18+
19+
.site-nav a {
20+
color: rgba(255, 255, 255, 0.7);
21+
margin: 0 1rem;
22+
text-decoration: none;
23+
font-weight: bold;
24+
font-size: 1.1rem;
25+
}
26+
27+
.site-nav a:hover,
28+
.site-nav a.active {
29+
color: white;
30+
text-decoration: none;
31+
}
32+
33+
/* Layout Grid */
34+
.page-content {
35+
display: flex;
36+
flex-direction: column;
37+
max-width: 64rem;
38+
margin: 0 auto;
39+
padding: 2rem 1rem;
40+
}
41+
42+
@media (min-width: 64em) {
43+
.page-content {
44+
flex-direction: row;
45+
align-items: flex-start;
46+
}
47+
}
48+
49+
/* Sidebar */
50+
.sidebar {
51+
width: 100%;
52+
margin-bottom: 2rem;
53+
background: #f9f9f9;
54+
padding: 1rem;
55+
border-radius: 4px;
56+
border: 1px solid #e1e4e8;
57+
}
58+
59+
@media (min-width: 64em) {
60+
.sidebar {
61+
width: 250px;
62+
margin-right: 2rem;
63+
margin-bottom: 0;
64+
position: sticky;
65+
top: 1rem;
66+
flex-shrink: 0;
67+
}
68+
}
69+
70+
.sidebar ul {
71+
list-style: none;
72+
padding: 0;
73+
margin: 0;
74+
}
75+
76+
.sidebar li {
77+
margin-bottom: 0.5rem;
78+
}
79+
80+
.sidebar a {
81+
color: #159957;
82+
text-decoration: none;
83+
display: block;
84+
padding: 0.25rem 0;
85+
}
86+
87+
.sidebar a:hover {
88+
color: #1e6bb8;
89+
text-decoration: underline;
90+
}
91+
92+
/* Main Content */
93+
.main-content-wrapper {
94+
flex: 1;
95+
min-width: 0;
96+
/* Fix flex overflow */
97+
}
98+
</style>
99+
</head>
100+
101+
<body>
102+
{% include nav.html %}
103+
104+
<section class="page-header">
105+
<h1 class="project-name">{{ site.title }}</h1>
106+
<h2 class="project-tagline">{{ site.description }}</h2>
107+
<a href="https://github.com/EntglDb/EntglDb.NodeJs" class="btn">View on GitHub</a>
108+
</section>
109+
110+
<div class="page-content">
111+
<!-- Sidebar Logic -->
112+
{% assign version = page.url | split: '/' %}
113+
{% assign current_version = version[1] %}
114+
115+
{% if current_version == 'v0.7.0' %}
116+
<nav class="sidebar">
117+
<h3>Docs {{ current_version }}</h3>
118+
<ul>
119+
{% for item in site.data.navigation[current_version] %}
120+
<li><a href="{{ item.url | relative_url }}">{{ item.title }}</a></li>
121+
{% endfor %}
122+
</ul>
123+
</nav>
124+
{% endif %}
125+
126+
<div class="main-content-wrapper">
127+
<section class="main-content">
128+
{{ content }}
129+
</section>
130+
</div>
131+
</div>
132+
133+
<footer class="site-footer" style="text-align: center; padding: 2rem; border-top: 1px solid #eee; margin-top: 2rem;">
134+
<span class="site-footer-owner"><a href="https://github.com/EntglDb/EntglDb.NodeJs">EntglDb.NodeJs</a> is maintained by the EntglDb Team.</span>
135+
<span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub
136+
Pages</a>.</span>
137+
</footer>
138+
</body>
139+
140+
</html>

docs/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
layout: default
3+
---
4+
5+
# EntglDb Node.js Documentation
6+
7+
Welcome to the documentation for **EntglDb Node.js**.
8+
9+
## Active Versions
10+
11+
* [**v0.7.0 (Latest)**](v0.7.0/getting-started.html) - Brotli Compression, Protocol v4.
12+
13+
## Links
14+
15+
* [GitHub Repository](https://github.com/EntglDb/EntglDb.NodeJs)

docs/v0.7.0/getting-started.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: default
3+
title: Getting Started with EntglDb.NodeJs
4+
---
5+
6+
# Getting Started with EntglDb.NodeJs v0.7.0
7+
8+
## Installation
9+
10+
EntglDb is modular. Install the core package and necessary adapters:
11+
12+
```bash
13+
pnpm add @entgldb/core @entgldb/persistence-sqlite @entgldb/network
14+
```
15+
16+
## Quick Start
17+
18+
```typescript
19+
import { PeerDb } from '@entgldb/core';
20+
import { SqlitePeerStore } from '@entgldb/persistence-sqlite';
21+
import { TcpSyncServer, TcpSyncClient } from '@entgldb/network';
22+
23+
// 1. Initialize Storage
24+
const store = new SqlitePeerStore('./my-db.sqlite');
25+
await store.init();
26+
27+
// 2. Initialize Database
28+
const db = new PeerDb(store);
29+
30+
// 3. Start Server (Optional)
31+
const server = new TcpSyncServer({
32+
store,
33+
nodeId: 'node-1',
34+
port: 3000
35+
});
36+
server.start();
37+
38+
// 4. Sync with Peer
39+
const client = new TcpSyncClient({
40+
nodeId: 'node-2',
41+
host: 'localhost',
42+
port: 3000
43+
});
44+
await client.connect();
45+
await client.pullChanges(db.getLastSyncTime());
46+
```
47+
48+
## New in v0.7.0
49+
50+
### Brotli Compression
51+
EntglDb now supports Brotli compression for network synchronization. This is automatically negotiated and applied if both peers support it.
52+
53+
### Security
54+
Secure Handshake using ECDH is available.

packages/core/package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
{
22
"name": "@entgldb/core",
3-
"version": "0.1.0",
3+
"version": "0.7.0",
44
"description": "EntglDb core database engine",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/EntglDb/EntglDb.NodeJs.git"
8+
},
9+
"publishConfig": {
10+
"access": "public"
11+
},
12+
"author": "EntglDb Team",
513
"main": "./dist/index.js",
614
"types": "./dist/index.d.ts",
715
"files": [

0 commit comments

Comments
 (0)