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

Split Core/JetStream into their own libraries #690

Draft
wants to merge 116 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
15475d6
[FEAT] split core and jetstream - note this removes nc.jetstream/jets…
aricart Apr 29, 2024
90512c2
[FIX] nbc internal mod exporting jetstream internal util types from KV
aricart Apr 29, 2024
018516a
[MOVE] moved types in consumer.ts to types.ts
aricart May 9, 2024
0c7923e
[FIX] removed dependency of jsclientimpl to avoid circ dep
aricart Apr 24, 2024
6766cc8
moved additional types to prevent circ deps in the module
aricart Apr 24, 2024
c8d263d
doc
aricart Apr 25, 2024
898eca5
[CHANGE] [KV] is now its own module
aricart Apr 26, 2024
c33578b
[CHANGE] [OS] is now its own module
aricart Apr 26, 2024
53ae6c6
[CHANGE] [SVC] is now its own module
aricart Apr 26, 2024
03551eb
[CHANGE] missing types in svc
aricart Apr 26, 2024
2b81435
removed circular dependency
aricart Apr 29, 2024
46f5468
kvm in mod
aricart May 2, 2024
49e001a
jsr
aricart May 9, 2024
40a2d54
jsr
aricart May 9, 2024
d375627
import nuid from jsr
aricart May 9, 2024
9346c77
jsr nbc
aricart May 9, 2024
74c64ab
jsr nbc
aricart May 10, 2024
b3e3414
export DEFAULT_MAX_RECONNECT_ATTEMPTS for tests
aricart May 10, 2024
8a5d9fd
fmt
aricart May 10, 2024
b49059a
added exports required by tests
aricart May 10, 2024
db0ede3
added exports required by tests
aricart May 10, 2024
23a6658
added exports required by tests
aricart May 10, 2024
c7861a5
added exports required by tests
aricart May 10, 2024
537a954
added exports required by tests
aricart May 10, 2024
d6c7c5c
added exports required by tests
aricart May 10, 2024
f336b99
added exports required by tests
aricart May 10, 2024
bd1137e
added exports required by tests
aricart May 10, 2024
ff2359c
added exports required by tests
aricart May 10, 2024
ce18121
reorg tests
aricart May 10, 2024
7e75e04
added exports required by tests
aricart May 10, 2024
e5c31b5
[CHANGE] internal imports to use jsr
aricart May 13, 2024
7b6f020
jsr module
aricart May 13, 2024
22b10cb
added exports required by downstream module
aricart May 14, 2024
844afde
jsr updates
aricart May 14, 2024
1ac4727
jsr dependencies
aricart May 14, 2024
fda96dc
jsr dependencies
aricart May 14, 2024
4e03a53
jsr dependencies
aricart May 14, 2024
718e641
jsr
aricart May 14, 2024
4c2ad0b
missing types for downstream
aricart May 14, 2024
56ad8e4
jsr dependencies
aricart May 14, 2024
c202b78
jsr dependencies
aricart May 14, 2024
f1c87d7
jsr dependencies
aricart May 14, 2024
3a8106c
changed sha256 to typescript for publishing in jsr
aricart May 14, 2024
f7dacde
jsr dependencies
aricart May 14, 2024
136f2c4
jsr dependencies
aricart May 14, 2024
037fe36
jsr dependencies
aricart May 14, 2024
08cb827
jsr dependencies
aricart May 14, 2024
78f1b43
jsr dependencies
aricart May 14, 2024
ab17cb9
make, readme migration
aricart May 14, 2024
d949f24
make, readme migration
aricart May 15, 2024
1775500
jsr
aricart May 15, 2024
ed1a25a
cert_packaging
aricart May 15, 2024
2af35be
moved tests helpers
aricart May 15, 2024
c7b2fd0
test helpers
aricart May 15, 2024
a6c7196
test helpers
aricart May 15, 2024
c26cfcf
test helpers
aricart May 15, 2024
0d8d630
deno warning
aricart May 20, 2024
13d5602
[MERGE] manual merge of ordered consumer updates from #699
aricart May 20, 2024
386f5aa
[CHANGE] QueuedIterator incorrectly extended Dispatcher interface whi…
aricart May 22, 2024
1edbb82
[LINT] type it dispatcher references correctly so that the API usage …
aricart May 22, 2024
a38763d
bump nuid
aricart May 23, 2024
3b2d342
moved tests to nats-base-client
aricart May 23, 2024
56e2a6b
packages for core
aricart May 28, 2024
09fc776
core packaging for cjs
aricart May 29, 2024
b3e1e13
packaging
aricart May 30, 2024
3e5e9e2
[FIX] added fix from https://github.com/nats-io/nats.deno/pull/701
aricart May 30, 2024
ebee8c4
[LINTER] fixed linter warnings
aricart May 31, 2024
4b64982
[FIX] added fixes for account expired
aricart May 31, 2024
dbb6a7b
[BUMP] module versions
aricart May 31, 2024
891a2a6
reference deno import map for bundle dependency
aricart Jun 12, 2024
e2fb1b4
reference deno import map for bundle dependency
aricart Jun 12, 2024
4919f58
reference deno import map for bundle dependency
aricart Jun 12, 2024
255b985
reference deno import map for bundle dependency
aricart Jun 12, 2024
753af42
reference deno import map for bundle dependency
aricart Jun 12, 2024
1564b40
reference deno import map for bundle dependency
aricart Jun 12, 2024
a0cc5f8
wsconnect
aricart Jun 12, 2024
7281fe9
export lib
aricart Jun 12, 2024
9853517
removed wsconnect for now
aricart Jun 13, 2024
6dd65ba
readme
aricart Jun 13, 2024
b6d8dcc
readmes
aricart Jun 13, 2024
50d342c
[FEAT] added connect option `noResolve` which disables name resolutio…
aricart Jun 13, 2024
207ae85
[FEAT] `resolve` connection option
aricart Jun 13, 2024
f7c1f1c
[FEAT] `resolve` is handled at nats-core level
aricart Jun 14, 2024
bc7433a
reorg core
aricart Jun 14, 2024
f9c2246
[FIX] fix for KV maxBucketSize - https://github.com/nats-io/nats.deno…
aricart Jun 18, 2024
b8fba59
kv test migration
aricart Jun 18, 2024
975ef00
[FIX] ackAck() now provides a timeout option, and inherits default ti…
aricart Jun 20, 2024
620bcdf
[FEAT] added support for listing keys with multiple filters (client a…
aricart Jun 20, 2024
2d356cb
monorepo org
aricart Jun 21, 2024
cca5ac9
monorepo tests enablement
aricart Jun 21, 2024
3f16328
fix avj import thanks @sachaw
aricart Jun 24, 2024
78d29ea
fix formatting for build
aricart Jun 24, 2024
10950a4
fix formatting for build
aricart Jun 24, 2024
d3970c5
fix ci test
aricart Jun 24, 2024
194f997
fix ci test
aricart Jun 24, 2024
c7b7b4a
fix ci test
aricart Jun 24, 2024
1f20a4d
moved js cluster tests to be in the same file to prevent collisions
aricart Jun 24, 2024
83a53c3
ci fixes
aricart Jun 24, 2024
aa50dee
ci fixes
aricart Jun 24, 2024
dc45642
readmes
aricart Jun 25, 2024
76f13fb
jetstream module structure
aricart Jun 25, 2024
c115c53
kv module structure
aricart Jun 25, 2024
a0d7af1
obj module structure
aricart Jun 25, 2024
6779c49
services module structure
aricart Jun 25, 2024
99fdf57
fix import map references for reworked module structure
aricart Jun 25, 2024
a1f2155
missing MsgCallback type
aricart Jun 25, 2024
1b36214
readmes and doc generation
aricart Jun 25, 2024
8afe1d1
ci
aricart Jun 25, 2024
6f4413f
reorg examples
aricart Jun 26, 2024
93e546b
fixed service examples and readmes
aricart Jun 26, 2024
29922a6
fixed service examples and readmes
aricart Jun 26, 2024
f7c823d
typo
aricart Jun 27, 2024
e6d1688
merge of #715
aricart Jul 1, 2024
d048051
ci workflows
aricart Jul 1, 2024
a11c8b8
ci workflows
aricart Jul 2, 2024
8726c71
readme
aricart Jul 2, 2024
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
47 changes: 47 additions & 0 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: core release

on:
push:
paths:
- 'core/**'
tags: [ 'core/*' ]
branches:
- '*'
jobs:
test:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ubuntu-latest-4-cores
environment: CI
strategy:
matrix:
deno-version: [1.44.4]
permissions:
contents: read
id-token: write

steps:
- name: Git Checkout Core
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Lint Deno Module
working-directory: core
run: |
deno fmt --check
deno lint
- name: Test Deno Module
working-directory: core
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno task test


44 changes: 44 additions & 0 deletions .github/workflows/jetstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: core release

on:
push:
paths:
- 'jetstream/**'
tags: [ 'jetstream/*' ]
branches:
- '*'
jobs:
test:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ubuntu-latest-4-cores
environment: CI
strategy:
matrix:
deno-version: [1.44.4]

steps:
- name: Git Checkout JetStream
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Lint Deno Module
working-directory: jetstream
run: |
deno fmt --check
deno lint
- name: Test Deno Module
working-directory: jetstream
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno task test


44 changes: 44 additions & 0 deletions .github/workflows/kv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: core release

on:
push:
paths:
- 'kv/**'
tags: [ 'kv/*' ]
branches:
- '*'
jobs:
test:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ubuntu-latest-4-cores
environment: CI
strategy:
matrix:
deno-version: [1.44.4]

steps:
- name: Git Checkout Kv
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Lint Deno Module
working-directory: kv
run: |
deno fmt --check
deno lint
- name: Test Deno Module
working-directory: kv
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno task test


44 changes: 44 additions & 0 deletions .github/workflows/obj.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: core release

on:
push:
paths:
- 'obj/**'
tags: [ 'obj/*' ]
branches:
- '*'
jobs:
test:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ubuntu-latest-4-cores
environment: CI
strategy:
matrix:
deno-version: [1.44.4]

steps:
- name: Git Checkout Obj
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Lint Deno Module
working-directory: obj
run: |
deno fmt --check
deno lint
- name: Test Deno Module
working-directory: obj
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno task test


44 changes: 44 additions & 0 deletions .github/workflows/services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: core release

on:
push:
paths:
- 'services/**'
tags: [ 'services/*' ]
branches:
- '*'
jobs:
test:
name: ${{ matrix.config.kind }} ${{ matrix.config.os }}
runs-on: ubuntu-latest-4-cores
environment: CI
strategy:
matrix:
deno-version: [1.44.4]

steps:
- name: Git Checkout Services
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Use Deno Version ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Lint Deno Module
working-directory: services
run: |
deno fmt --check
deno lint
- name: Test Deno Module
working-directory: services
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno task test


28 changes: 9 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches:
- '*'
pull_request:
branches: [master]
branches: [main]

jobs:
test:
Expand All @@ -16,7 +16,7 @@ jobs:
environment: CI
strategy:
matrix:
deno-version: [1.43.1]
deno-version: [1.44.4]

steps:
- name: Git Checkout Deno Module
Expand All @@ -30,7 +30,7 @@ jobs:
deno-version: ${{ matrix.deno-version }}

- name: Set NATS Server Version
run: echo "NATS_VERSION=v2.10.14" >> $GITHUB_ENV
run: echo "NATS_VERSION=v2.10.17" >> $GITHUB_ENV

# this here because dns seems to be wedged on gha
# - name: Add hosts to /etc/hosts
Expand All @@ -45,37 +45,27 @@ jobs:
rm nats-server/README.md LICENSE

- name: Lint Deno Module
run: deno fmt --check --ignore=docs/
run: |
deno fmt --check
deno lint

- name: Test Deno Module
env:
TMPDIR: ${{ runner.temp }}
CI: true
NGS_CI_USER: ${{ secrets.NGS_CI_USER }}
run: |
deno test --allow-all --unstable --parallel --fail-fast --coverage=./cov tests/ jetstream/tests
deno test --allow-all --unstable --parallel --fail-fast --unsafely-ignore-certificate-errors --coverage=./cov unsafe_tests/
deno task test

- name: Build nats.js
run: deno bundle --unstable src/connect.ts nats.js
run: deno bundle --unstable transport-deno/src/connect.ts nats.js

- name: Generate lcov
run: deno coverage --unstable --lcov ./cov > cov.lcov
run: deno coverage --unstable --lcov ./coverage > cov.lcov

- name: Upload coverage
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./cov.lcov

- name: Release
uses: softprops/action-gh-release@v1
if: |
startsWith(github.ref, 'refs/tags/') &&
!startsWith(github.ref, 'refs/tags/std/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
nats.js
draft: true
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ npm-debug.log*
# generated files
.DS_Store
nats.js
jetstream.js
kv.js
os.js
svc.js

*.d.ts
nats.js.map
src/version.json
Expand All @@ -21,7 +26,7 @@ settings.json
coverage/

# Dependency directories
node_modules
**/node_modules/

# Optional npm cache directory
.npm
Expand All @@ -31,3 +36,4 @@ vcs.xml

# we copy package.json to read the version so ts, webpack, etc are happy
src/package.json

13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ lint:
deno lint --ignore=docs/,debug/

test: clean
deno test --allow-all --parallel --reload --quiet --coverage=coverage tests/ jetstream/tests
deno test --allow-all --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage unsafe_tests/
deno test --allow-all --parallel --reload --quiet --coverage=coverage core/tests/ jetstream/tests kv/tests/ obj/tests/ services/tests/
deno test --allow-all --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage core/unsafe_tests/


testw: clean
deno test --allow-all --unstable --reload --parallel --watch --fail-fast tests/ jetstream/
deno test --allow-all --unstable --reload --parallel --watch --fail-fast tests/ jetstream/ kv/tests/ obj/tests/ services/tests/

cover:
deno coverage --unstable ./coverage --lcov > ./coverage/out.lcov
Expand All @@ -23,6 +23,11 @@ clean:

bundle:
deno bundle --log-level info --unstable src/mod.ts ./nats.js
deno bundle --log-level info --unstable jetstream/mod.ts ./jetstream.js
deno bundle --log-level info --unstable kv/mod.ts ./kv.js
deno bundle --log-level info --unstable obj/mod.ts ./os.js
deno bundle --log-level info --unstable service/mod.ts ./svc.js


fmt:
deno fmt src/ doc/ bin/ nats-base-client/ examples/ tests/ debug/ unsafe_tests/ jetstream/ jetstream.md README.md services.md
deno fmt transport-deno/ doc/ bin/ core/ examples/ tests/ debug/ unsafe_tests/ jetstream/ kv/ obj/ services/ test_helpers/ jetstream.md README.md migration.md services.md
Loading
Loading