fix: use `isolatedModules: true` in tsconfig.json (#469)

* fix: use `isolatedModules: true` in tsconfig.json

This setting ensures the module can be used in projects where the workflow
includes type checking and transpilation as two separate steps.

See: https://ncjamieson.com/dont-export-const-enums/

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

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2022-02-10 07:39:09 -06:00 committed by GitHub
parent f36a1f0428
commit b5c0b56f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 17 deletions

View File

@ -17,30 +17,33 @@ import CONSTANTS from "./constants";
export {
// From event
CloudEvent,
CloudEventV1,
CloudEventV1Attributes,
Version,
ValidationError,
Mode,
HTTP,
Kafka,
MQTT,
MQTTMessageFactory,
emitterFor,
Emitter,
// From Constants
CONSTANTS
};
export type {
CloudEventV1,
CloudEventV1Attributes,
// From message
Headers,
Mode,
Binding,
Message,
Deserializer,
Serializer,
HTTP,
Kafka,
KafkaEvent,
KafkaMessage,
MQTT,
MQTTMessage,
MQTTMessageFactory,
// From transport
TransportFunction,
EmitterFunction,
emitterFor,
Emitter,
Options,
// From Constants
CONSTANTS,
Options
};

View File

@ -10,7 +10,10 @@ import { sanitize } from "../http/headers";
// Export the binding implementation and message interface
export {
Kafka,
Kafka
};
export type {
KafkaMessage,
KafkaEvent
};

View File

@ -6,10 +6,9 @@
import { Binding, Deserializer, CloudEvent, CloudEventV1, CONSTANTS, Message, ValidationError, Headers } from "../..";
export {
MQTT,
MQTTMessage,
MQTTMessageFactory
MQTT, MQTTMessageFactory
};
export type { MQTTMessage };
/**
* Extends the base {@linkcode Message} interface to include MQTT attributes, some of which

View File

@ -11,7 +11,8 @@
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
"outDir": "./dist",
"declaration": true,
"experimentalDecorators": true
"experimentalDecorators": true,
"isolatedModules": true,
},
"compileOnSave": true,
"include": [