Commit Graph

9 Commits

Author SHA1 Message Date
Lance Ball b13bde9b49
feat: precompile cloudevent schema (#471)
* feat: precompile cloudevent schema

This commit modifies the build pipleline so that the cloudevent schema is
precompiled for runtime validation. This eliminates the need to compile the
schema at runtime, improving both performance and security.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/423

Signed-off-by: Lance Ball <lball@redhat.com>
2022-02-15 14:06:42 -05:00
Lance Ball 320354f750
chore: update cucumber dependency and remove prettier (#453)
The combination of prettier and eslint was causing some conflicting error
messages in formatting between VSCode and using npm in the CLI. For the most
part, there were only a couple of required formatting changes that prettier
was covering, so the change is minor.

The cucumber dependency had a major version bump and was carrying some unsafe
dependencies in the older version. This commit bumps to the new version and
makes appropriate configuration changes.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-12-22 10:45:35 -05:00
Lance Ball 061c122b86
chore: update eslint and prettier dependencies (#424)
There were some minor changes that resulted in a few code style changes, but not much.

Signed-off-by: Lance Ball <lball@redhat.com>
2021-08-04 15:51:37 -04:00
Remi Cattiau 80d987c1f6
chore: add copyrights header and lint rules (#418)
Signed-off-by: Remi Cattiau <remi@cattiau.com>
2021-05-14 09:28:49 -04:00
Remi Cattiau 6adb578402 ci: disable @typescript-eslint/no-explicit-any linter rule
Signed-off-by: Remi Cattiau <remi@cattiau.com>
2020-11-17 08:41:16 -05:00
Lance Ball 276b810dd8
BREAKING CHANGE(lib): rewrite in TypeScript (#226)
This is a major rewrite of the entire codebase into TypeScript. Nearly
all tests have been retained except where behavior is significantly
different. Some highlights of these changes:

* lowercase all CloudEvent properties and fix base64 encoded data

Previously there was a format() function that would convert a CloudEvent
object into JSON with all of the properties lowercased. With this rewrite
a CloudEvent object can be converted to JSON simply with JSON.stringify().

However, in order to be compliant with the JSON representation outlined in
the spec here https://github.com/cloudevents/spec/blob/v1.0/json-format.md
all of the event properties must be all lowercase.

* lib(transport): make transport mode an Enum
* src: allow custom headers (#1)
* lib(exports): export explicitly versioned names where appropriate
* lib(cloudevent): modify ctor to accept extensions inline
* lib(cloudevent): make extensions a part of the event object
* test: convert all tests to typescript
* examples: update all examples with latest API changes
* docs: update README with latest API changes
* src: add prettier for code style and fix a lot of linting errors
* lib: move data decoding to occur within the CloudEvent object

Signed-off-by: Lance Ball <lball@redhat.com>
2020-06-29 14:46:20 -04:00
Lance Ball b283583c0c
docs: add JSDocs for top level API objects (#140)
This commit add JSDoc documentation to the CloudEvent and HTTPReceiver
objects exposed by the API when using the top level imports, specifically
`CloudEvent` and `HTTPReceiver`.

This adds a `generate-docs` npm script to generate site and API documentation
for GitHub pages in `./docs`.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-05-12 17:27:11 -04:00
Lance Ball e83db297ae chore: update eslint rules to disallow var usage
Enforce the use of `let` and `const` by using elsint rules.
When creating the eslint configuration, I had assumed that
`extends: eslint:recommended` would have covered this, but
apparently not!

Existing usage of `var` fixed with `npm run lint -- --fix`.

Fixes: https://github.com/cloudevents/sdk-javascript/issues/97

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-30 12:36:04 -03:00
Lance Ball 3f238a0124
src: add eslint configuration and npm script
Automatically fixed > 2000 issues. The remaining 200+ issues need
to be fixed by hand. Additionally, all strings are double quotes
which is not typically standard and I wonder about fixing that too.

Signed-off-by: Lance Ball <lball@redhat.com>
2020-04-22 10:15:05 -04:00