Skip to content

Commit 69195bd

Browse files
Initial commit
Signed-off-by: teodordelibasic-db <teodor.delibasic@databricks.com>
1 parent d86f22a commit 69195bd

31 files changed

+7122
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or improvement for the TypeScript SDK for Zerobus.
4+
title: "[FEATURE] "
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Problem Statement**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Proposed Solution**
14+
A clear and concise description of what you want to happen.
15+
16+
**Additional Context**
17+
Add any other context, references or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/issue.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: SDK Issue
3+
about: Use this to report an issue with the TypeScript SDK for Zerobus.
4+
title: "[ISSUE] "
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
A clear and concise description of what the bug is.
12+
13+
**Reproduction**
14+
A minimal code sample demonstrating the bug.
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Is it a regression?**
20+
Did this work in a previous version of the SDK? If so, which versions did you try?
21+
22+
**Debug Logs**
23+
Include any error messages or stack traces here.
24+
25+
**Other Information**
26+
- OS: [e.g. macOS, Linux, Windows]
27+
- Node.js Version: [e.g. 18.x, 20.x]
28+
- SDK Version: [e.g. 0.0.1]
29+
30+
**Additional context**
31+
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## What changes are proposed in this pull request?
2+
3+
Provide the readers and reviewers with the information they need to understand
4+
this PR in a comprehensive manner.
5+
6+
Specifically, try to answer the two following questions:
7+
8+
- **WHAT** changes are being made in the PR? This should be a summary of the
9+
major changes to allow the reader to quickly understand the PR without having
10+
to look at the code.
11+
- **WHY** are these changes needed? This should provide the context that the
12+
reader might be missing. For example, were there any decisions behind the
13+
change that are not reflected in the code itself?
14+
15+
The "why part" is the most important of the two as it usually cannot be
16+
inferred from the code itself. A well-written PR description will help future
17+
developers (including your future self) to know how to interact and update your
18+
code.
19+
20+
## How is this tested?
21+
22+
Describe any tests you have done; especially if test tests are not part of
23+
the unit tests (e.g. local tests).
24+
25+
**ALWAYS ANSWER THIS QUESTION:** Answer with "N/A" if tests are not applicable
26+
to your PR (e.g. if the PR only modifies comments). Do not be afraid of
27+
answering "Not tested" if the PR has not been tested. Being clear about what
28+
has been done and not done provides important context to the reviewers.

.github/workflows/ci.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
10+
jobs:
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
settings:
16+
- host: macos-latest
17+
target: x86_64-apple-darwin
18+
build: npm run build --target x86_64-apple-darwin
19+
- host: macos-latest
20+
target: aarch64-apple-darwin
21+
build: npm run build --target aarch64-apple-darwin
22+
- host: ubuntu-latest
23+
target: x86_64-unknown-linux-gnu
24+
build: npm run build --target x86_64-unknown-linux-gnu
25+
- host: ubuntu-latest
26+
target: x86_64-unknown-linux-musl
27+
build: npm run build --target x86_64-unknown-linux-musl
28+
- host: ubuntu-latest
29+
target: aarch64-unknown-linux-gnu
30+
build: npm run build --target aarch64-unknown-linux-gnu
31+
- host: ubuntu-latest
32+
target: aarch64-unknown-linux-musl
33+
build: npm run build --target aarch64-unknown-linux-musl
34+
- host: windows-latest
35+
target: x86_64-pc-windows-msvc
36+
build: npm run build --target x86_64-pc-windows-msvc
37+
- host: windows-latest
38+
target: aarch64-pc-windows-msvc
39+
build: npm run build --target aarch64-pc-windows-msvc
40+
41+
name: Build - ${{ matrix.settings.target }}
42+
runs-on: ${{ matrix.settings.host }}
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Setup Node.js
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 20
51+
cache: 'npm'
52+
53+
- name: Install Rust
54+
uses: dtolnay/rust-toolchain@stable
55+
with:
56+
toolchain: stable
57+
targets: ${{ matrix.settings.target }}
58+
59+
- name: Cache cargo
60+
uses: actions/cache@v4
61+
with:
62+
path: |
63+
~/.cargo/registry/index/
64+
~/.cargo/registry/cache/
65+
~/.cargo/git/db/
66+
target/
67+
key: ${{ matrix.settings.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68+
69+
- name: Install dependencies
70+
run: npm ci
71+
72+
- name: Build
73+
run: ${{ matrix.settings.build }}
74+
75+
- name: Upload artifact
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: bindings-${{ matrix.settings.target }}
79+
path: '*.node'
80+
if-no-files-found: error
81+
82+
test:
83+
name: Test Node.js ${{ matrix.node }} - ${{ matrix.os }}
84+
runs-on: ${{ matrix.os }}
85+
strategy:
86+
fail-fast: false
87+
matrix:
88+
os: [ubuntu-latest, macos-latest, windows-latest]
89+
node: ['16', '18', '20']
90+
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
- name: Setup Node.js ${{ matrix.node }}
95+
uses: actions/setup-node@v4
96+
with:
97+
node-version: ${{ matrix.node }}
98+
cache: 'npm'
99+
100+
- name: Install Rust
101+
uses: dtolnay/rust-toolchain@stable
102+
103+
- name: Install dependencies
104+
run: npm ci
105+
106+
- name: Build
107+
run: npm run build:debug
108+
109+
- name: Test
110+
run: npm test
111+
if: matrix.os != 'windows-latest'

.github/workflows/publish.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
settings:
13+
- host: macos-latest
14+
target: x86_64-apple-darwin
15+
- host: macos-latest
16+
target: aarch64-apple-darwin
17+
- host: ubuntu-latest
18+
target: x86_64-unknown-linux-gnu
19+
- host: ubuntu-latest
20+
target: x86_64-unknown-linux-musl
21+
- host: ubuntu-latest
22+
target: aarch64-unknown-linux-gnu
23+
- host: ubuntu-latest
24+
target: aarch64-unknown-linux-musl
25+
- host: windows-latest
26+
target: x86_64-pc-windows-msvc
27+
- host: windows-latest
28+
target: aarch64-pc-windows-msvc
29+
30+
name: Build - ${{ matrix.settings.target }}
31+
runs-on: ${{ matrix.settings.host }}
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Setup Node.js
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 20
40+
registry-url: 'https://registry.npmjs.org'
41+
42+
- name: Install Rust
43+
uses: dtolnay/rust-toolchain@stable
44+
with:
45+
toolchain: stable
46+
targets: ${{ matrix.settings.target }}
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Build
52+
run: npm run build --target ${{ matrix.settings.target }}
53+
54+
- name: Upload artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: bindings-${{ matrix.settings.target }}
58+
path: '*.node'
59+
if-no-files-found: error
60+
61+
publish:
62+
name: Publish to NPM
63+
runs-on: ubuntu-latest
64+
needs: build
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Setup Node.js
70+
uses: actions/setup-node@v4
71+
with:
72+
node-version: 20
73+
registry-url: 'https://registry.npmjs.org'
74+
75+
- name: Install dependencies
76+
run: npm ci
77+
78+
- name: Download all artifacts
79+
uses: actions/download-artifact@v4
80+
with:
81+
path: artifacts
82+
83+
- name: Move artifacts
84+
run: npm run artifacts
85+
86+
- name: List packages
87+
run: ls -R ./npm
88+
89+
- name: Publish
90+
run: npm publish --access public
91+
env:
92+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Build artifacts
2+
target/
3+
*.node
4+
index.js
5+
index.d.ts
6+
7+
# Dependencies
8+
node_modules/
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
pnpm-debug.log*
13+
14+
# IDE
15+
.vscode/
16+
.idea/
17+
*.swp
18+
*.swo
19+
*~
20+
21+
# OS
22+
.DS_Store
23+
Thumbs.db
24+
25+
# Environment
26+
.env
27+
.env.local
28+
.env.*.local
29+
30+
# Distribution
31+
dist/
32+
*.tgz
33+
34+
# Test coverage
35+
coverage/
36+
.nyc_output/
37+
38+
# Temporary files
39+
*.tmp
40+
*.temp
41+
.env
42+
43+
# Generated files
44+
examples/generated/
45+
schemas/*.pb
46+
schemas/*.b64

.npmignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Development files
2+
.github/
3+
.vscode/
4+
.idea/
5+
*.swp
6+
*.swo
7+
8+
# Git
9+
.git/
10+
.gitignore
11+
12+
# CI/CD
13+
.travis.yml
14+
.circleci/
15+
16+
# Build artifacts not needed in published package
17+
target/
18+
19+
# Development config
20+
tsconfig.json
21+
22+
# Documentation (except README, LICENSE, CHANGELOG, NEXT_CHANGELOG, and SECURITY)
23+
docs/
24+
*.md
25+
!README.md
26+
!CHANGELOG.md
27+
!NEXT_CHANGELOG.md
28+
!SECURITY.md
29+
!LICENSE
30+
31+
# Test files
32+
test/
33+
tests/
34+
*.test.ts
35+
*.test.js
36+
*.spec.ts
37+
*.spec.js
38+
39+
# Environment
40+
.env*
41+
42+
# OS
43+
.DS_Store
44+
Thumbs.db
45+
46+
# Temporary files
47+
*.tmp
48+
*.temp

0 commit comments

Comments
 (0)