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 62 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 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
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
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 Down
13 changes: 9 additions & 4 deletions Makefile
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 nats-base-client/tests/ jetstream/tests kv/tests/ os/tests/ service/tests/
deno test --allow-all --parallel --reload --quiet --unsafely-ignore-certificate-errors --coverage=coverage nats-base-client/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/ os/tests/ service/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 os/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 src/ doc/ bin/ nats-base-client/ examples/ tests/ debug/ unsafe_tests/ jetstream/ nuid/ kv/ os/ service/ jetstream.md README.md migration.md services.md
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -11,7 +11,7 @@ A Deno client for the [NATS messaging system](https://nats.io).
You can get the latest release version like this:

```typescript
import * as nats from "https://deno.land/x/nats/src/mod.ts";
import * as nats from "https://deno.land/x/nats/src/types.ts";
```

To specify a specific released version, simply replace nats with
Expand All @@ -20,7 +20,7 @@ nats@_versionTag_.
You can get the current development version by:

```typescript
import * as nats from "https://raw.githubusercontent.com/nats-io/nats.deno/main/src/mod.ts";
import * as nats from "https://raw.githubusercontent.com/nats-io/nats.deno/main/src/types.ts";
```

## Documentation
Expand Down Expand Up @@ -54,7 +54,7 @@ is working.

```typescript
// import the connect function
import { connect } from "../../src/mod.ts";
import { connect } from "../../src/types.ts";

const servers = [
{},
Expand Down Expand Up @@ -123,7 +123,7 @@ the server.

```typescript
// import the connect function
import { connect, StringCodec } from "../../src/mod.ts";
import { connect, StringCodec } from "../../src/types.ts";

// to create a connection to a nats-server:
const nc = await connect({ servers: "demo.nats.io:4222" });
Expand Down Expand Up @@ -191,7 +191,7 @@ All subscriptions are independent. If two different subscriptions match a
subject, both will get to process the message:

```javascript
import { connect, StringCodec, Subscription } from "../../src/mod.ts";
import { connect, StringCodec, Subscription } from "../../src/types.ts";
const nc = await connect({ servers: "demo.nats.io:4222" });
const sc = StringCodec();

Expand Down Expand Up @@ -244,7 +244,7 @@ simply to illustrate not only how to create responses, but how the subject
itself is used to dispatch different behaviors.

```typescript
import { connect, StringCodec, Subscription } from "../../src/mod.ts";
import { connect, StringCodec, Subscription } from "../../src/types.ts";

// create a connection
const nc = await connect({ servers: "demo.nats.io" });
Expand Down Expand Up @@ -319,7 +319,7 @@ Here's a simple example of a client making a simple request from the service
above:

```typescript
import { connect, Empty, StringCodec } from "../../src/mod.ts";
import { connect, Empty, StringCodec } from "../../src/types.ts";

// create a connection
const nc = await connect({ servers: "demo.nats.io:4222" });
Expand Down Expand Up @@ -357,7 +357,7 @@ import {
NatsConnection,
StringCodec,
Subscription,
} from "../../src/mod.ts";
} from "../../src/types.ts";

// this is the definition of a service with `count` members in them.
// if the queue is specified, the they will be part of a queue
Expand Down Expand Up @@ -436,7 +436,7 @@ are publishing a message with a header, it is possible for the recipient to not
support them.

```typescript
import { connect, createInbox, Empty, headers } from "../../src/mod.ts";
import { connect, createInbox, Empty, headers } from "../../src/types.ts";
import { nuid } from "../../nats-base-client/nuid.ts";

const nc = await connect(
Expand Down Expand Up @@ -525,7 +525,7 @@ Setting the `user`/`pass` or `token` options, simply initializes an
```typescript
// if the connection requires authentication, provide `user` and `pass` or
// `token` options in the NatsConnectionOptions
import { connect } from "src/mod.ts";
import { connect } from "src/types.ts";

const nc1 = await connect({
servers: "127.0.0.1:4222",
Expand Down
2 changes: 1 addition & 1 deletion bin/fix-os.ts
Expand Up @@ -13,7 +13,7 @@
* limitations under the License.
*/
import { parse } from "https://deno.land/std@0.221.0/flags/mod.ts";
import { ObjectStoreImpl, ServerObjectInfo } from "../jetstream/objectstore.ts";
import { ObjectStoreImpl, ServerObjectInfo } from "../os/objectstore.ts";
import {
connect,
ConnectionOptions,
Expand Down