Skip to content

Commit

Permalink
feat: feat: added .js
Browse files Browse the repository at this point in the history
- need .js to all imports for CJS/ESM builds
  • Loading branch information
Bugs5382 committed Dec 9, 2023
1 parent 275ce6e commit e01b378
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 82 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"scripts": {
"clean": "rm -rf coverage docs lib",
"build": "npm run clean && tsc && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && ./bin/build-types.sh",
"build": "tsc && tsc -p tsconfig.cjs.json && tsc -p tsconfig.types.json && ./bin/build-types.sh",
"build:watch": "tsc -w",
"lint": "ts-standard --parser @typescript-eslint/parser | snazzy",
"lint:fix": "ts-standard --fix --parser @typescript-eslint/parser | snazzy",
Expand Down Expand Up @@ -68,7 +68,7 @@
"semantic-release": "^22.0.10",
"snazzy": "^9.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"ts-node": "^10.9.2",
"ts-standard": "^12.0.2",
"tsd": "^0.29.0",
"typedoc": "^0.25.4",
Expand Down
14 changes: 7 additions & 7 deletions src/builder/batch.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import * as Util from '../utils'
import { HL7FatalError, HL7ParserError } from '../utils/exception'
import { HL7FatalError, HL7ParserError } from '../utils/exception.js'
import {
ClientBuilderBatchOptions,
normalizedClientBatchBuilderOptions
} from '../utils/normalize'
import { Node } from './interface/node'
import { Message } from './message'
import { RootBase } from './modules/rootBase'
import { Segment } from './modules/segment'
import { SegmentList } from './modules/segmentList'
} from '../utils/normalize.js'
import { Node } from './interface/node.js'
import { Message } from './message.js'
import { RootBase } from './modules/rootBase.js'
import { Segment } from './modules/segment.js'
import { SegmentList } from './modules/segmentList.js'

/**
* Batch Class
Expand Down
14 changes: 7 additions & 7 deletions src/builder/message.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { HL7FatalError } from '../utils/exception'
import { RootBase } from './modules/rootBase'
import { Segment } from './modules/segment'
import { SegmentList } from './modules/segmentList'
import * as Util from '../utils/'
import { ClientBuilderMessageOptions, normalizedClientMessageBuilderOptions } from '../utils/normalize'
import { Node } from './interface/node'
import { HL7FatalError } from '../utils/exception.js'
import { RootBase } from './modules/rootBase.js'
import { Segment } from './modules/segment.js'
import { SegmentList } from './modules/segmentList.js'
import * as Util from '../utils'
import { ClientBuilderMessageOptions, normalizedClientMessageBuilderOptions } from '../utils/normalize.js'
import { Node } from './interface/node.js'

/**
* Message Class
Expand Down
10 changes: 5 additions & 5 deletions src/builder/modules/component.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Delimiters } from '../decorators/delimiters'
import { Node } from '../interface/node'
import { NodeBase } from './nodeBase'
import { SubComponent } from './subComponent'
import { ValueNode } from './valueNode'
import { Delimiters } from '../decorators/delimiters.js'
import { Node } from '../interface/node.js'
import { NodeBase } from './nodeBase.js'
import { SubComponent } from './subComponent.js'
import { ValueNode } from './valueNode.js'

/**
* Component Field of an HL7 Segment
Expand Down
2 changes: 1 addition & 1 deletion src/builder/modules/emptyNode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Node } from '../interface/node'
import { Node } from '../interface/node.js'

/** @internal */
export class EmptyNode implements Node {
Expand Down
12 changes: 6 additions & 6 deletions src/builder/modules/field.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HL7FatalError } from '../../utils/exception'
import { Delimiters } from '../decorators/delimiters'
import { Node } from '../interface/node'
import { FieldRepetition } from './fieldRepetition'
import { NodeBase } from './nodeBase'
import { ValueNode } from './valueNode'
import { HL7FatalError } from '../../utils/exception.js'
import { Delimiters } from '../decorators/delimiters.js'
import { Node } from '../interface/node.js'
import { FieldRepetition } from './fieldRepetition.js'
import { NodeBase } from './nodeBase.js'
import { ValueNode } from './valueNode.js'

/**
* Field Area of the HL7 Segment
Expand Down
12 changes: 6 additions & 6 deletions src/builder/modules/fieldRepetition.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Component } from './component'
import { Delimiters } from '../decorators/delimiters'
import { Node } from '../interface/node'
import { HL7FatalError } from '../../utils/exception'
import { NodeBase } from './nodeBase'
import { ValueNode } from './valueNode'
import { Component } from './component.js'
import { Delimiters } from '../decorators/delimiters.js'
import { Node } from '../interface/node.js'
import { HL7FatalError } from '../../utils/exception.js'
import { NodeBase } from './nodeBase.js'
import { ValueNode } from './valueNode.js'

/**
* Create a Field Repetition in an HL7 message segment
Expand Down
12 changes: 6 additions & 6 deletions src/builder/modules/nodeBase.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Batch } from '../batch'
import { EmptyNode } from './emptyNode'
import { HL7FatalError } from '../../utils/exception'
import { Batch } from '../batch.js'
import { EmptyNode } from './emptyNode.js'
import { HL7FatalError } from '../../utils/exception.js'
import * as Util from '../../utils'
import { Delimiters } from '../decorators/delimiters'
import { Node } from '../interface/node'
import { Message } from '../message'
import { Delimiters } from '../decorators/delimiters.js'
import { Node } from '../interface/node.js'
import { Message } from '../message.js'

/** @internal */
export class NodeBase implements Node {
Expand Down
10 changes: 5 additions & 5 deletions src/builder/modules/rootBase.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { HL7FatalError } from '../../utils/exception'
import { ClientBuilderOptions } from '../../utils/normalize'
import { Delimiters } from '../decorators/delimiters'
import { NodeBase } from './nodeBase'
import * as Util from '../../utils/'
import { HL7FatalError } from '../../utils/exception.js'
import { ClientBuilderOptions } from '../../utils/normalize.js'
import { Delimiters } from '../decorators/delimiters.js'
import { NodeBase } from './nodeBase.js'
import * as Util from '../../utils'

/**
* Root Base
Expand Down
12 changes: 6 additions & 6 deletions src/builder/modules/segment.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Delimiters } from '../decorators/delimiters'
import { HL7FatalError } from '../../utils/exception'
import { Field } from './field'
import { NodeBase } from './nodeBase'
import { Node } from '../interface/node'
import { Delimiters } from '../decorators/delimiters.js'
import { HL7FatalError } from '../../utils/exception.js'
import { Field } from './field.js'
import { NodeBase } from './nodeBase.js'
import { Node } from '../interface/node.js'
import * as Util from '../../utils'
import { SubComponent } from './subComponent'
import { SubComponent } from './subComponent.js'

/**
* Segment Class
Expand Down
6 changes: 3 additions & 3 deletions src/builder/modules/segmentList.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Node } from '../interface/node'
import { NodeBase } from './nodeBase'
import { Segment } from './segment'
import { Node } from '../interface/node.js'
import { NodeBase } from './nodeBase.js'
import { Segment } from './segment.js'

/**
* Segment List
Expand Down
4 changes: 2 additions & 2 deletions src/builder/modules/subComponent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as Util from '../../utils'
import { HL7FatalError } from '../../utils/exception'
import { ValueNode } from './valueNode'
import { HL7FatalError } from '../../utils/exception.js'
import { ValueNode } from './valueNode.js'

/**
* Sub Components
Expand Down
6 changes: 3 additions & 3 deletions src/builder/modules/valueNode.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { HL7FatalError } from '../../utils/exception'
import { Delimiters } from '../decorators/delimiters'
import { NodeBase } from './nodeBase'
import { HL7FatalError } from '../../utils/exception.js'
import { Delimiters } from '../decorators/delimiters.js'
import { NodeBase } from './nodeBase.js'

/** @internal */
export class ValueNode extends NodeBase {
Expand Down
4 changes: 2 additions & 2 deletions src/client/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EventEmitter from 'events'
import { Listener } from './listener'
import { normalizeClientOptions, normalizeClientListenerOptions, ClientListenerOptions, ClientOptions } from '../utils/normalize'
import { Listener } from './listener.js'
import { normalizeClientOptions, normalizeClientListenerOptions, ClientListenerOptions, ClientOptions } from '../utils/normalize.js'

/**
* Client Class
Expand Down
4 changes: 2 additions & 2 deletions src/client/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import EventEmitter from 'events'
import { Socket } from 'net'
import * as net from 'net'
import * as tls from 'tls'
import { Client } from './client'
import { ClientListenerOptions, normalizeClientListenerOptions } from '../utils/normalize'
import { Client } from './client.js'
import { ClientListenerOptions, normalizeClientListenerOptions } from '../utils/normalize.js'

/** Listener Class
* @since 1.0.0 */
Expand Down
30 changes: 15 additions & 15 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Client } from './client/client'
import { Component } from './builder/modules/component'
import { Delimiters } from './builder/decorators/delimiters'
import { Field } from './builder/modules/field'
import { FieldRepetition } from './builder/modules/fieldRepetition'
import { Listener } from './client/listener'
import { Message } from './builder/message'
import { Segment } from './builder/modules/segment'
import { SegmentList } from './builder/modules/segmentList'
import { Client } from './client/client.js'
import { Component } from './builder/modules/component.js'
import { Delimiters } from './builder/decorators/delimiters.js'
import { Field } from './builder/modules/field.js'
import { FieldRepetition } from './builder/modules/fieldRepetition.js'
import { Listener } from './client/listener.js'
import { Message } from './builder/message.js'
import { Segment } from './builder/modules/segment.js'
import { SegmentList } from './builder/modules/segmentList.js'
import { HL7_2_7 } from './specification/2.7.js'
import { HL7_SPEC, HL7_SPEC_BASE } from './specification/specification.js'
import { SubComponent } from './builder/modules/subComponent'
import { Batch } from './builder/batch'
import { ParserPlan } from './utils/parserPlan'
import { SubComponent } from './builder/modules/subComponent.js'
import { Batch } from './builder/batch.js'
import { ParserPlan } from './utils/parserPlan.js'

export default Client
export { Client, Listener, ParserPlan, Batch, Message, Delimiters, Segment, SegmentList, Component, SubComponent, Field, FieldRepetition }
export * from './utils/index'
export * from './utils/index.js'

/** HL7 Specs **/
export type { MSH } from './specification/specification.js'
Expand All @@ -24,5 +24,5 @@ export type { HL7_2_7_MSH } from './specification/2.7.js'
/** HL7 Class **/
export { HL7_SPEC, HL7_SPEC_BASE, HL7_2_7 }

export type { ClientOptions, ClientListenerOptions, ClientBuilderOptions, ClientBuilderBatchOptions, ClientBuilderFileOptions, ParserProcessRawData } from './utils/normalize'
export type { HL7Error, HL7FatalError, HL7ParserError } from './utils/exception'
export type { ClientOptions, ClientListenerOptions, ClientBuilderOptions, ClientBuilderBatchOptions, ClientBuilderFileOptions, ParserProcessRawData } from './utils/normalize.js'
export type { HL7Error, HL7FatalError, HL7ParserError } from './utils/exception.js'
8 changes: 4 additions & 4 deletions src/utils/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TcpSocketConnectOpts } from 'node:net'
import type { ConnectionOptions as TLSOptions } from 'node:tls'
import { HL7_2_7 } from '../specification/2.7'
import { BSH, MSH } from '../specification/specification'
import * as Util from './index'
import { ParserPlan } from './parserPlan'
import { HL7_2_7 } from '../specification/2.7.js'
import { BSH, MSH } from '../specification/specification.js'
import * as Util from './index.js'
import { ParserPlan } from './parserPlan.js'

const DEFAULT_CLIENT_OPTS = {
acquireTimeout: 20000,
Expand Down

0 comments on commit e01b378

Please sign in to comment.