* feat: add node 24 support
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
* squash: fixes for running tests
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
---------
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
* chore: Update compatible node version
Signed-off-by: Tim Nunamaker <tim@vana.com>
* Add Node.js 21 to the CI matrix
Signed-off-by: Tim Nunamaker <tim@vana.com>
---------
Signed-off-by: Tim Nunamaker <tim@vana.com>
* fix: handle big integers in incoming events
An event may have data that contains a BigInt. The builtin `JSON` parser
for JavaScript does not handle the `BigInt` types. The introduced
`json-bigint` dependency (34k) does.
Fixes: https://github.com/cloudevents/sdk-javascript/issues/489
Signed-off-by: Lance Ball <lball@redhat.com>
* feat!: remove node 12 and node 14
Node 12 has been EOL since the end of April 2022 and Node 14 just became EOL at the end of April 2023
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
This small change allows a developer to just run npm install and then npm test without having to run the build step separately, which compiles the schema that is needed to run the tests successfully.
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
* chore: bump ajv and remove old dep dependency
This should allow the existing, meaningful PRs to pass CI validation if they get a rebase.
Signed-off-by: Lance Ball <lball@redhat.com>
* feat: add builtin HTTP emitter
Adds a builtin HTTP event emitter that can be used with `emitterFor()`
to send events over HTTP without pulling in any additional dependencies.
In the past we chose to keep this in our code base by considering axios a
peer dependency - users were required to include it in their projects
explicitly. In working on the HTTP emitter, it became more and more
apparent that the axios emitter was probably no longer needed, and in fact
I doubt it was really used at all. To use it, users would have been required
to do this, since it isn't exported at the top level.
const { axiosEmitter } = require("cloudevents/transport/http");
Based on this, I think the usage in the wild is probably very minimal,
and I like the idea of eliminating this dependency.
Signed-off-by: Lance Ball <lball@redhat.com>
Adds a convenience npm script that allows you to run only a single test
file at a time. Example usage:
```
sdk-javascript on lance/update-deps-package-json [!?] is 📦 v5.3.2 via v16.14.0
❯ npm run test:one
> cloudevents@5.3.2 test:one
> mocha --require ts-node/register
Error: No test files found
sdk-javascript on lance/update-deps-package-json [!?] is 📦 v5.3.2 via v16.14.0
❯ npm run test:one -- ./test/integration/batch_test.ts
> cloudevents@5.3.2 test:one
> mocha --require ts-node/register "./test/integration/batch_test.ts"
A batched CloudEvent message over HTTP
✔ Can be created with a typed Message
A batched CloudEvent message over Kafka
✔ Can be created with a typed Message
2 passing (5ms)
sdk-javascript on lance/update-deps-package-json [!?] is 📦 v5.3.2 via v16.14.0
```
Signed-off-by: Lance Ball <lball@redhat.com>
* 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>
This commit extends the `message` package to include Kafka transport.
Additionally, some of the type information has changed across the project
to more accurately reflect the type of `Message` (by including `T`).
Related: https://github.com/cloudevents/sdk-javascript/issues/390
Signed-off-by: Lance Ball <lball@redhat.com>
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>