Skip to content

Commit

Permalink
Update CHANGELOG and READMEs for new 2.0.0 release
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Fendt <Florian.Fendt@bosch.io>
  • Loading branch information
ffendt committed Apr 16, 2021
1 parent f4fd128 commit c01b8ff
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 31 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ Implemented in Java, targeted for use in Java and all JVM based languages (sourc
## [JavaScript](javascript/)

[![Build Status](https://github.com/eclipse/ditto-clients/workflows/javascript-build/badge.svg)](https://github.com/eclipse/ditto-clients/actions?query=workflow%3Ajavascript-build)
[![npm api](https://img.shields.io/npm/v/@eclipse-ditto/ditto-javascript-client-api_1.0?label=npm%3A%20api)](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-api_1.0)
[![npm node](https://img.shields.io/npm/v/@eclipse-ditto/ditto-javascript-client-node_1.0?label=npm%3A%20node)](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-node_1.0)
[![npm dom](https://img.shields.io/npm/v/@eclipse-ditto/ditto-javascript-client-dom_1.0?label=npm%3A%20dom)](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-dom_1.0)
[![npm node](https://img.shields.io/npm/v/@eclipse-ditto/ditto-javascript-client-node?label=npm%3A%20node)](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-node)
[![npm dom](https://img.shields.io/npm/v/@eclipse-ditto/ditto-javascript-client-dom?label=npm%3A%20dom)](https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-dom)

Implemented in TypeScript, this SDK contains a JavaScript library for usage of Ditto in both browser and Node.JS
based environments.
Expand Down
20 changes: 18 additions & 2 deletions javascript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to the Ditto JavaScript client will be documented in this fi

## [2.0.0] - 2021-xx-xx

### \#112 Update npm module structure
The api module isn't published to npm any long. The node and dom module don't contain
the Ditto version in their name any longer, but are bound to the Ditto version itself
(and thus have the same version numbers as Ditto).

### \#142 Remove API 1
Removes all API 1 related code from the client (namely ACLs and the API 1 builders).

### \#166 Refactor model structure:
Fixes #114: Refactor model structure to avoid "duplicated paths" like `features.features` for all entities inheriting from `IndexedEntityModel` and simplify type generics.

Expand All @@ -26,7 +34,17 @@ Fixes #123: Fixes the serialization of booleans and numbers in filters.
### \#140 Add support for _created field
Adds the `_created` field to the `Thing` model.

### \#155 Update vulnerable dependencies
Update vulnerable dependencies as suggested by `npm audit`

### Breaking changes

* `DittoDomClient` and `DittoNodeClient`: The builder steps `apiVersion1()` and `apiVersion2()` were removed completely.
* Module `@eclipse-ditto/ditto-javascript-client-api_1.0` was removed completely and is no longer needed
for using the client.
* Module `@eclipse-ditto/ditto-javascript-client-node_1.0` was renamed to `@eclipse-ditto/ditto-javascript-client-node`
* Module `@eclipse-ditto/ditto-javascript-client-dom_1.0` was renamed to `@eclipse-ditto/ditto-javascript-client-dom`
* `Acl` and all subclasses: Removed completely.
* `Features`: Needs to be accessed using `thing.features` instead of `thing.features.features`
* `Features`: `toObject` instance method was removed. Use `Features#toObject` and `Features#fromObject` instead.
* `Entries`: Needs to be accessed using `policy.entries` instead of `policy.entries.entries`
Expand All @@ -35,8 +53,6 @@ Adds the `_created` field to the `Thing` model.
* `Resources`: `toObject` instance method was removed. Use `Resources#toObject` and `Resources#fromObject` instead.
* `Subjects`: Needs to be accessed using `policy.entries.<entryId>.subjects` instead of `policy.entries.<entryId>.subjects.subjects`
* `Subjects`: `toObject` instance method was removed. Use `Subjects#toObject` and `Subjects#fromObject` instead.
* `Acl`: Needs to be accessed using `thing.acl` instead of `thing.acl.acl`
* `Acl`: `toObject` instance method was removed. Use `Acl#toObject` and `Acl#fromObject` instead.
* `IndexedEntityModel`: The signature of some methods have been changed, see e.g. `Features` on how to update custom implementations to the new format.

## Releases in old version format
Expand Down
35 changes: 24 additions & 11 deletions javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ This module is a TypeScript library to facilitate working the the REST-like HTTP

### How to use it
Install `@eclipse-ditto/ditto-javascript-client-dom` for the DOM (browser) implementation,
`@eclipse-ditto/ditto-javascript-client-node` for the NodeJS implementation, or `@eclipse-ditto/ditto-javascript-client-api-ditto` for
the API and build your own client implementation.
`@eclipse-ditto/ditto-javascript-client-node` for the NodeJS implementation.

More information can be found in the descriptions of the subpackages:
* [@eclipse-ditto/ditto-javascript-client-api](./lib/api/README.md)
* [@eclipse-ditto/ditto-javascript-client-dom](./lib/dom/README.md)
* [@eclipse-ditto/ditto-javascript-client-node](./lib/node/README.md)
* [@eclipse-ditto/ditto-javascript-client-api](./lib/api/README.md) for some general information on the API of the client
* [@eclipse-ditto/ditto-javascript-client-dom](./lib/dom/README.md) for the DOM implementation
* [@eclipse-ditto/ditto-javascript-client-node](./lib/node/README.md) for the NodeJs implementation

### Compatibility with [Eclipse Ditto](https://github.com/eclipse/ditto)

The `@eclipse-ditto/ditto-javascript-client-<package>` modules use the same
[semantic versioning](https://docs.npmjs.com/about-semantic-versioning) and is released
[semantic versioning](https://docs.npmjs.com/about-semantic-versioning) and are released
alongside of Eclipse Ditto.

The newest release of the JavaScript client will always try to cover as much API
Expand Down Expand Up @@ -42,17 +41,31 @@ npm run build
# ...
```
It is important to know that during install and build some extra processes
are triggered by e.g. lerna which will symlink the `api` dependency into
the node_modules of `dom` and `node` packages.
are triggered.

### Dry-run a `publish`
```
# install a local npm registry
npm i -g verdaccio
verdaccio
npm adduser --registry http://localhost:4873
# publish
# on linux/mac
NPM_CONFIG_REGISTRY=http://localhost:4873 lerna publish --no-git-tag-version --no-git-reset --no-push 0.0.1
# on windows (do not add whitespace around &&):
set NPM_CONFIG_REGISTRY=http://localhost:4873&&lerna publish --no-git-tag-version --no-git-reset --no-push 0.0.1
# have a look at the results:
npm pack --registry=http://localhost:4873 @eclipse-ditto/ditto-javascript-client-node@0.0.1
npm pack --registry=http://localhost:4873 @eclipse-ditto/ditto-javascript-client-dom@0.0.1
```

### Internals
This project is using [lerna](https://github.com/lerna/lerna) to split up the
client into different packages. This way we can have standalone codeable
subprojects (`api`, `dom` and `node`) but still are able to control dependencies,
build processes or release processes globally.

Furthermore we use [rollup.js](https://rollupjs.org/) for providing multiple
module types of the packages, e.g. the `api` will be published as ES6 Module and CommonJS module.

For automatically generating barrel files, [barrelsby](https://github.com/bencoveney/barrelsby)
is used during the build process.
13 changes: 4 additions & 9 deletions javascript/lib/api/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Ditto JavaScript client API
This module is a TypeScript library to facilitate working the REST-like HTTP API and web socket API of Eclipse Ditto.

It is published with three different module types to the npm registry:
* CommonJS (`dist/index.js`), typical module type for using in Node.js
* ES6 Module (`dist/index.es.js`), typical module type for browsers. You could also use a CDN like
[UNPKG](https://unpkg.com/) to directly use it in an HTML document (although "_very experimental_",
use the `?module`-flag when importing from UNPKG)
It is not published itself, but as part of its implementations for NodeJS and DOM environments.

## Implementation
The already existing implementations can be found in the [parent module](../../README.md).
Expand All @@ -29,7 +24,7 @@ npm test

## Using the client

The different implementations (dom, node) describe how the provide instances of a `ThingsClient`.
The different implementations (dom, node) describe how to provide instances of a `ThingsClient`.
Have a look at them on how to get an instance of the client. We assume
the variable `client` to be an instance of `ThingsClient` for the following usage
explanations.
Expand All @@ -47,7 +42,7 @@ thingsHandle.putThing(thing)
.then(result => console.log(`Finished putting thing with result: ${JSON.stringify(result)}`));
```

Additionally options for requests can be specified and passed on to the methods:
Additionally, options for requests can be specified and passed on to the methods:
```typescript
const options = DefaultFieldsOptions.getInstance();
options.ifMatch('A Tag').withFields('thingId', 'policyId', '_modified');
Expand Down Expand Up @@ -122,7 +117,7 @@ A connection is still being attempted.
description: 'The request might have been sent and processed.'
}
```
This error is returned when the WebSocket connection failed while a request was waiting for it's response.
This error is returned when the WebSocket connection failed while a request was waiting for its response.
It's not possible to tell whether the request was received by the service or not.
```json5
{
Expand Down
3 changes: 1 addition & 2 deletions javascript/lib/dom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ npm test
## Using

```shell
# replace <ditto-major.minor> with the major and minor version number of Eclipse Ditto you are using.
npm i --save @eclipse-ditto/ditto-javascript-client-api_<ditto-major.minor> @eclipse-ditto/ditto-javascript-client-dom_<ditto-major.minor>
npm i --save @eclipse-ditto/ditto-javascript-client-dom
```

Create an instance of a client:
Expand Down
7 changes: 3 additions & 4 deletions javascript/lib/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ npm test
## Using

```shell
# replace <ditto-major.minor> with the major and minor version number of Eclipse Ditto you are using.
npm i --save @eclipse-ditto/ditto-javascript-client-api_<ditto-major.minor> @eclipse-ditto/ditto-javascript-client-node_<ditto-major.minor>
npm i --save @eclipse-ditto/ditto-javascript-client-node
```

Create an instance of a client:
Expand All @@ -47,7 +46,7 @@ since the API will stay the same no matter what implementation is used.

### Proxy
The Node.js implementation supports setting up a proxy.
Currently it supports either reading directly from 'https_proxy' (or 'HTTPS_PROXY') environment variable
Currently, it supports either reading directly from 'https_proxy' (or 'HTTPS_PROXY') environment variable
or manually setting the proxy settings.

```javascript
Expand All @@ -59,6 +58,6 @@ const proxyOptions = {
}

DittoNodeClient.newHttpClient(proxyOptions)
...
// ...
```
Any options that are set manually will override options that are read from an environment variable.

0 comments on commit c01b8ff

Please sign in to comment.